import type { VerificationRule, CanaryStage, CanaryDeployment, CanaryExitCriteria } from './types.js'; export interface CanaryEvaluation { readonly rule_id: string; readonly timestamp: string; readonly baseline_verdict: 'PASS' | 'FAIL'; readonly canary_verdict: 'PASS' | 'FAIL'; readonly agreed: boolean; readonly latency_ms: number; readonly error?: string; } export declare class RuleCanaryDeployer { private deployments; private evaluations; private statePath; constructor(statePath?: string); /** * Start canary deployment for a rule. * Formal rules skip shadow mode (they are deterministic). */ startDeployment(rule: VerificationRule, customExitCriteria?: Partial>>): CanaryDeployment; /** * Record a canary evaluation (comparison of new rule against baseline). */ recordEvaluation(evaluation: CanaryEvaluation): void; /** * Check if a rule is ready to promote to the next canary stage. * Returns the next stage if ready, null if not ready, 'rollback' if metrics are bad. */ checkPromotion(ruleId: string): { action: 'promote' | 'wait' | 'rollback'; nextStage?: CanaryStage; reason: string; }; /** * Promote a rule to the next canary stage. */ promote(ruleId: string): CanaryDeployment | null; /** * Rollback a rule's canary deployment. Removes it from all stages. */ rollback(ruleId: string): { success: boolean; reason: string; }; /** * Get the current deployment state for a rule. */ getDeployment(ruleId: string): CanaryDeployment | undefined; /** * List all active canary deployments. */ listDeployments(): CanaryDeployment[]; /** * Check if a rule should be evaluated for a given request. * Based on the canary stage traffic percentage. */ shouldEvaluate(ruleId: string): boolean; /** * Save deployment state to disk. */ saveState(): Promise; /** * Load deployment state from disk. */ loadState(): Promise; private computeMetrics; private computeDurationHours; private emptyMetrics; }