/** * Canary — separate promotion from deployment (ADR-176 phase 5). * * Held-out evaluation proves a candidate on FROZEN data; it has not observed * real-world behavior. The canary runs the candidate on a bounded, reversible * SLICE of live work and measures rollback rate, latency, cost, failure * frequency, and acceptance — the telemetry the accept() conjunction needs * (canary.rollback_rate <= baseline). Only after canary evidence does PROMOTE * fire. This is what stops benchmark-specific evolution from reaching global * rollout. Zero deps, $0 (the runner is injected; a real one meters real work). */ /** One canary run's observed outcome. */ export interface CanaryOutcome { ok: boolean; rolledBack: boolean; latencyMs: number; costUsd: number; accepted: boolean; } /** Executes a candidate on one task input under real (or simulated) conditions. */ export type CanaryRunner = (input: unknown, candidate: C) => CanaryOutcome; export interface CanaryTelemetry { n: number; rollbackRate: number; failureRate: number; acceptanceRate: number; latencyP95: number; latencyMean: number; costPerTask: number; costTotalUsd: number; } export interface CanaryOptions { sampleFraction?: number; maxSamples?: number; } /** * Run the candidate on a bounded, deterministic sample of the slice and * aggregate telemetry. Deterministic sampling (stride over id-sorted inputs) so * two runs converge (ADR-176 acceptance test). */ export declare function runCanary(candidate: C, slice: Array<{ id: string; input: unknown; }>, runner: CanaryRunner, opts?: CanaryOptions): CanaryTelemetry; export interface CanaryComparison { pass: boolean; checks: Record; failed: string[]; } /** * Canary gate: the candidate must be NO WORSE than the baseline on rollback, * latency, and cost (the ADR-176 metrics table constraints). Feeds accept()'s * `canary.rollback_rate <= baseline` term plus the latency/cost guards. */ export declare function compareCanary(candidate: CanaryTelemetry, baseline: CanaryTelemetry, tolerance?: number): CanaryComparison; //# sourceMappingURL=harness-canary.d.ts.map