export type ValidatorContext = { contextDir: string; projectRoot: string; changedFiles?: string[]; }; export type ValidatorResult = { pass: boolean; severity: "error" | "warning" | "info"; message: string; detail?: string; }; export type ValidatorDef = { policyId: string; check: (ctx: ValidatorContext, options: Record) => Promise; }; export type GenericEvaluatorDef = { type: string; check: (ctx: ValidatorContext, config: Record) => Promise; }; export type EnforcedPolicy = { id: string; type?: string | null; config?: Record | null; severity?: "info" | "warning" | "error" | "block" | null; }; export declare function registerValidator(def: ValidatorDef): void; export declare function getValidator(policyId: string): ValidatorDef | undefined; export declare function getRegisteredPolicyIds(): string[]; export declare function registerGenericEvaluator(def: GenericEvaluatorDef): void; export declare function getGenericEvaluator(type: string): GenericEvaluatorDef | undefined; export declare function getRegisteredEvaluatorTypes(): string[]; export type ReviewResult = { policy_id: string; pass: boolean; severity: "error" | "warning" | "info"; message: string; detail?: string; }; export type ReviewSummary = { total: number; passed: number; failed: number; warnings: number; }; export type ReviewOutput = { results: ReviewResult[]; summary: ReviewSummary; }; /** * Run validators for every enforced policy. Dispatch order per policy: * 1. If the policy has a `type`, look it up in the generic evaluator * registry (cortex-web custom rules use this path). * 2. Otherwise, look up a name-based validator by policy id * (predefined rules shipped with the plugin use this path). * 3. If neither path yields an implementation, emit a warning so the * gap is visible instead of silent. * * Accepts either `Set` (legacy id-only callers) or an array of * `EnforcedPolicy` objects carrying `type` + `config` from the * cortex-web policy sync. Set inputs are normalized to entries with * null type/config, so they always route to the name-based registry. */ export declare function runValidators(enforced: Set | EnforcedPolicy[], ctx: ValidatorContext, validatorConfigs: Record>): Promise; //# sourceMappingURL=engine.d.ts.map