/**
 * Release confidence gate.
 *
 * This is the production-facing composition layer over the lower-level
 * primitives:
 *   - Dataset manifests prove corpus/version coverage.
 *   - RunRecord rows prove reproducible search/holdout outcomes.
 *   - Multi-shot trace evidence carries turn counts and ASI diagnostics.
 *   - HeldOutGate decisions remain the paired promotion authority.
 *
 * The gate is intentionally pure and conservative. Missing declared evidence
 * fails closed instead of being treated as a neutral zero.
 */
import type { DatasetManifest, DatasetScenario, DatasetSplit } from './dataset';
import type { GateDecision } from './held-out-gate';
import type { RunRecord, RunSplitTag } from './run-record';
/** Severity of an actionable finding attached to a run/trace. */
export type AsiSeverity = 'info' | 'warning' | 'error' | 'critical';
/** Actionable side-info — a diagnosed finding the loop can act on. */
export interface ActionableSideInfo {
    /** Stable expectation/check id when available. */
    expectationId?: string;
    /** Human-readable diagnosis of what happened. */
    message: string;
    severity?: AsiSeverity;
    /** Concrete trace excerpt, file path, tool call, screenshot id, etc. */
    evidence?: string;
    /** Prompt/tool/context surface likely responsible. */
    responsibleSurface?: string;
    /** Suggested fix in natural language. */
    suggestion?: string;
    /** Whether this expectation was satisfied. Defaults to false for ASI rows. */
    matched?: boolean;
    metadata?: Record<string, unknown>;
}
export type ReleaseConfidenceStatus = 'pass' | 'warn' | 'fail';
export type ReleaseConfidenceAxisName = 'corpus' | 'quality' | 'generalization' | 'diagnostics' | 'efficiency';
export interface ReleaseTraceEvidence {
    scenarioId: string;
    candidateId?: string;
    split?: RunSplitTag;
    score?: number;
    ok?: boolean;
    turnCount?: number;
    costUsd?: number;
    durationMs?: number;
    failureMode?: string;
    asi?: ActionableSideInfo[];
    metadata?: Record<string, unknown>;
}
export interface ReleaseConfidenceThresholds {
    /** Require a Dataset manifest or explicit scenarios. Default true. */
    requireCorpus?: boolean;
    minScenarioCount?: number;
    minSearchRuns?: number;
    minHoldoutRuns?: number;
    /** Require at least one holdout scenario/run. Default true. */
    requireHoldout?: boolean;
    minPassRate?: number;
    minMeanScore?: number;
    /** Search mean may exceed holdout mean by at most this much. */
    maxOverfitGap?: number;
    maxMeanCostUsd?: number;
    maxP95WallMs?: number;
    /** Low-score/failed rows must carry ASI. Default true. */
    requireAsiForFailures?: boolean;
    /** Score below this is considered a failure for ASI coverage. Default 0.5. */
    failureScoreThreshold?: number;
}
export interface ReleaseConfidenceInput {
    target: string;
    candidateId?: string;
    baselineId?: string;
    dataset?: DatasetManifest;
    scenarios?: readonly DatasetScenario[];
    runs?: readonly RunRecord[];
    traces?: readonly ReleaseTraceEvidence[];
    gateDecision?: GateDecision | null;
    thresholds?: ReleaseConfidenceThresholds;
}
export interface ReleaseConfidenceAxis {
    name: ReleaseConfidenceAxisName;
    status: ReleaseConfidenceStatus;
    score: number;
    detail: string;
}
export interface ReleaseConfidenceIssue {
    axis: ReleaseConfidenceAxisName;
    severity: 'critical' | 'warning';
    code: string;
    detail: string;
}
export interface ReleaseConfidenceMetrics {
    scenarioCount: number;
    searchRuns: number;
    holdoutRuns: number;
    passRate: number;
    meanScore: number;
    searchMeanScore: number;
    holdoutMeanScore: number;
    overfitGap: number;
    meanCostUsd: number;
    p95WallMs: number;
    failedRows: number;
    failuresWithAsi: number;
    singleShotTraces: number;
    multiShotTraces: number;
    splitCounts: Record<DatasetSplit, number>;
    domainCounts: Record<string, number>;
    failureModeCounts: Record<string, number>;
    responsibleSurfaceCounts: Record<string, number>;
}
export interface ReleaseConfidenceScorecard {
    target: string;
    candidateId: string | null;
    baselineId: string | null;
    status: ReleaseConfidenceStatus;
    promote: boolean;
    axes: ReleaseConfidenceAxis[];
    issues: ReleaseConfidenceIssue[];
    metrics: ReleaseConfidenceMetrics;
    dataset: DatasetManifest | null;
    gateDecision: GateDecision | null;
    summary: string;
}
export declare function evaluateReleaseConfidence(input: ReleaseConfidenceInput): ReleaseConfidenceScorecard;
export declare function assertReleaseConfidence(input: ReleaseConfidenceInput): ReleaseConfidenceScorecard;
//# sourceMappingURL=release-confidence.d.ts.map