import { type AgentVariant } from './service'; export type CanaryStatus = 'active' | 'promoted' | 'rolled_back'; export type CanaryRollout = { id: string; taskType: string; canaryVariantId: string; baselineVariantId: string; trafficPct: number; status: CanaryStatus; minSamples: number; rollbackThreshold: number; startedAt: number; decidedAt: number | null; decision: string | null; decisionEventId: string | null; }; export type StartCanaryInput = { taskType: string; canaryVariantId: string; baselineVariantId?: string; trafficPct?: number; minSamples?: number; rollbackThreshold?: number; }; export declare function startCanary(input: StartCanaryInput): CanaryRollout; export declare function getActiveCanary(taskType: string): CanaryRollout | null; export declare function listCanaryRollouts(taskType: string, limit?: number): CanaryRollout[]; export type CanaryPick = { variant: AgentVariant; rolloutId: string; arm: 'canary' | 'baseline'; }; export declare function pickCanaryArm(taskType: string, rng?: () => number): CanaryPick | null; export type CanaryDecision = { kind: 'hold'; reason: string; canarySamples: number; baselineSamples: number; } | { kind: 'promote'; meanCanary: number; meanBaseline: number; uplift: number; pValue: number; canarySamples: number; } | { kind: 'rollback'; reason: 'regression' | 'pvalue'; meanCanary: number; meanBaseline: number; delta: number; canarySamples: number; }; export type EvaluateCanaryOptions = { taskType: string; pThreshold?: number; windowStart?: number; }; export declare function evaluateCanary(opts: EvaluateCanaryOptions): CanaryDecision; export declare function rampCanary(taskType: string, newTrafficPct: number): CanaryRollout; export declare function promoteCanary(taskType: string): { rolloutId: string; promotedVariantId: string; archivedVariantId: string; eventId: string; }; export declare function rollbackCanary(taskType: string, reason?: string): { rolloutId: string; archivedVariantId: string; eventId: string; }; export type CanaryStepResult = { action: 'held'; decision: Extract; } | { action: 'ramped'; from: number; to: number; decision: CanaryDecision; } | { action: 'promoted'; rolloutId: string; promotedVariantId: string; archivedVariantId: string; eventId: string; decision: Extract; } | { action: 'rolled_back'; rolloutId: string; archivedVariantId: string; eventId: string; decision: Extract; }; export type StepCanaryOptions = { taskType: string; rampSteps?: number[]; pThreshold?: number; }; export declare function stepCanary(opts: StepCanaryOptions): CanaryStepResult;