import { AIRun, AIRunOutcomeLabel, AIRunSource, AIRunTrainingExample } from './ai-run-evidence';
export type AIRunFailureClass = 'none' | 'infra' | 'compile' | 'route' | 'journey_contract' | 'business' | 'release' | 'false_pass' | 'assistant_missing_evidence' | 'assistant_query_error' | 'assistant_permission' | 'assistant_date_window' | 'assistant_query_shape' | 'assistant_correctness' | 'manual' | 'stopped' | 'unknown';
export type AIRunRetryAction = 'none' | 'stop' | 'retry_infra_repair' | 'retry_build_repair' | 'retry_route_repair' | 'retry_journey_contract' | 'retry_business_repair' | 'retry_release_repair' | 'retry_assistant_answer_quality' | 'retry_assistant_query' | 'request_assistant_permission' | 'retry_assistant_date_window' | 'retry_assistant_query_shape' | 'manual_handoff';
export interface AIRunEvalExpectedGate {
    key: string;
    status?: string;
}
export interface AIRunEvalExpected {
    outcome: AIRunOutcomeLabel;
    failureClass?: AIRunFailureClass;
    nextActionIncludes?: string;
    gates?: AIRunEvalExpectedGate[];
}
export interface AIRunEvalFixture {
    id: string;
    title: string;
    source: AIRunSource;
    run: AIRun;
    expected: AIRunEvalExpected;
    tags: string[];
}
export interface AIRunEvalResult {
    id: string;
    title: string;
    source: AIRunSource;
    passed: boolean;
    actualOutcome: AIRunOutcomeLabel;
    expectedOutcome: AIRunOutcomeLabel;
    actualFailureClass: AIRunFailureClass;
    expectedFailureClass?: AIRunFailureClass;
    failures: string[];
    tags: string[];
}
export interface AIRunEvalSummary {
    passed: boolean;
    total: number;
    passedCount: number;
    failedCount: number;
    results: AIRunEvalResult[];
    failuresByTag: Record<string, number>;
    outcomes: Record<string, number>;
}
export interface AIRunDatasetExport {
    generatedAt: string;
    totalRuns: number;
    summary: {
        bySource: Record<string, number>;
        byOutcome: Record<string, number>;
        byFailureClass: Record<string, number>;
        estimatedUsd: number;
        totalTokens: number;
    };
    runs: AIRun[];
    trainingExamples: AIRunTrainingExample[];
}
export interface AIRunDatasetExportOptions {
    redact?: boolean;
    includeRuns?: boolean;
    maxEvidenceItems?: number;
    now?: Date | string;
}
export interface AIRunRetryPolicyInput {
    currentRun: AIRun;
    previousRun?: AIRun;
    newEvidenceCount?: number;
    unchangedFailureLimit?: number;
    sameFailureCount?: number;
    historicalAcceptanceRate?: number;
    estimatedNextRetryCostUsd?: number;
    minRetryExpectedValue?: number;
}
export interface AIRunRetryDecision {
    action: AIRunRetryAction;
    failureClass: AIRunFailureClass;
    repeatedFailure: boolean;
    reason: string;
    nextAction: string;
    retryExpectedValue?: number;
}
export declare function classifyAIRunFailureClass(run: AIRun): AIRunFailureClass;
export declare function evaluateAIRunFixture(fixture: AIRunEvalFixture): AIRunEvalResult;
export declare function evaluateAIRunFixtures(fixtures?: AIRunEvalFixture[]): AIRunEvalSummary;
export declare function buildAIRunTrainingExampleFromRun(run: AIRun, maxEvidenceItems?: number): AIRunTrainingExample;
export declare function buildAIRunDatasetExport(runs: AIRun[], options?: AIRunDatasetExportOptions): AIRunDatasetExport;
export declare function decideAIRunRetry(input: AIRunRetryPolicyInput): AIRunRetryDecision;
export declare const AI_RUN_SEED_EVAL_FIXTURES: AIRunEvalFixture[];
