/** * Custom Rules Engine (v1.1.0) * * Configurable rules to block or warn on PRs matching specific patterns. * Example: "Block PRs that touch auth/ without security team review" */ export type RuleActionType = 'block' | 'warn' | 'require-review' | 'assign-reviewer' | 'notify-slack' | 'notify-discord' | 'apply-label'; export interface RuleAction { type: RuleActionType; payload?: string | string[]; } export interface RuleDefinition { id: string; description: string; action: RuleAction | RuleActionType; condition: RuleCondition; } export type RuleCondition = PathCondition | MaxFilesCondition | MaxDiffSizeCondition | AuthorCondition | ImpactScoreCondition | BusFactorCondition | AndCondition | OrCondition | NotCondition; export interface PathCondition { type: 'path'; pattern: string; } export interface MaxFilesCondition { type: 'max-files'; count: number; } export interface MaxDiffSizeCondition { type: 'max-diff-size'; lines: number; } export interface AuthorCondition { type: 'author-in'; authors: string[]; } export interface ImpactScoreCondition { type: 'impact-score'; minScore: number; } export interface BusFactorCondition { type: 'bus-factor'; maxFactor: number; } export interface AndCondition { type: 'and'; conditions: RuleCondition[]; } export interface OrCondition { type: 'or'; conditions: RuleCondition[]; } export interface NotCondition { type: 'not'; condition: RuleCondition; } export interface RuleInput { files: string[]; linesAdded: number; linesRemoved: number; author?: string; impactScore?: number; lowestBusFactor?: number; } export interface RuleViolation { ruleId: string; description: string; action: RuleAction; } export declare class RulesEngine { private rules; constructor(rules?: RuleDefinition[]); addRule(rule: RuleDefinition): void; setRules(rules: RuleDefinition[]): void; getRules(): RuleDefinition[]; evaluate(input: RuleInput): RuleViolation[]; private evaluateCondition; } //# sourceMappingURL=rules.d.ts.map