/** * Counterfactual evaluation. * * Estimates whether another candidate may have performed better using * evaluation scenarios, replays, or comparable historical runs. Results are * clearly labeled as estimates, carry explicit uncertainty, identify the * off-policy estimator, and never retroactively change completed-run authority. */ import type { CandidateEvidence } from "./types.js"; export type CounterfactualMode = "direct_paired" | "replay_compatible" | "matched_historical" | "unsupported"; export interface CounterfactualEstimate { decisionId: string; productionCandidateId?: string; counterfactualCandidateId?: string; mode: CounterfactualMode; estimator: "direct" | "doubly_robust" | "importance_sampling" | "none"; estimatedWouldHaveImproved: boolean; effectSize: number; uncertainty: number; supported: boolean; reasonCodes: string[]; } export interface CounterfactualInput { decisionId: string; productionCandidateId?: string; counterfactualCandidateId?: string; productionEvidence?: CandidateEvidence; counterfactualEvidence?: CandidateEvidence; /** Environment/task compatibility flags. */ compatible: { task: boolean; environment: boolean; scenario: boolean; identity: boolean; }; } /** * Produce a counterfactual estimate. Only produces a supported numeric estimate * when evidence for both candidates exists and identities are compatible. * Otherwise it reports an explicit "unsupported" mode with no causal claim. */ export declare function evaluateCounterfactual(input: CounterfactualInput): CounterfactualEstimate; //# sourceMappingURL=counterfactual.d.ts.map