import type { BlockRecord, TestResultSummary } from '@duckcodeailabs/dql-project'; import { type InvariantResult } from './invariant-evaluator.js'; /** * Extra signals a certification rule can read beyond the block + test results. * Additive and optional so existing rules and callers are unaffected. */ export interface CertificationContext { /** * Results of evaluating the block's declared invariants against the most * recent run's result set. Undefined when no run was performed; an empty * array means the block declares no invariants. */ invariantResults?: InvariantResult[]; } /** * Certification rule that a block must pass to be certified. */ export interface CertificationRule { id: string; name: string; description: string; severity: 'error' | 'warning'; check: (block: BlockRecord, testResults?: TestResultSummary, context?: CertificationContext) => CertificationCheckResult; } export interface CertificationCheckResult { passed: boolean; message?: string; } export interface CertificationResult { blockId: string; blockName: string; certified: boolean; errors: Array<{ rule: string; message: string; }>; warnings: Array<{ rule: string; message: string; }>; checkedAt: Date; } /** * Built-in certification rules. */ export declare const BUILTIN_RULES: CertificationRule[]; export declare const ENTERPRISE_RULES: CertificationRule[]; export declare const PROMOTABLE_RULES: CertificationRule[]; /** * Certifier evaluates blocks against certification rules. */ export declare class Certifier { private rules; constructor(rules?: CertificationRule[]); /** * Add a custom rule. */ addRule(rule: CertificationRule): void; /** * Evaluate a block against all rules. */ evaluate(block: BlockRecord, testResults?: TestResultSummary, context?: CertificationContext): CertificationResult; } //# sourceMappingURL=certifier.d.ts.map