/**
 * pipeline/chronic-failures.ts
 *
 * Aggregates error data across recent reports to identify tasks that
 * consistently fail (>threshold error rate). This catches structurally
 * broken tasks — wrong model config, tasks too complex for the provider,
 * persistent API incompatibility — that would otherwise be invisible.
 *
 * @see docs/exec-plans/eval-pipeline-timeout-resilience.md — Phase 5
 */
import type { ReportStore } from "../report-store.js";
export interface ChronicFailureEntry {
    /** Task ID */
    task: string;
    /** Error rate as a fraction (0–1) */
    errorRate: number;
    /** Number of runs with errors / total runs analyzed */
    errorCount: number;
    totalRuns: number;
    /** Which models are affected and how often */
    modelBreakdown: {
        model: string;
        errorCount: number;
    }[];
    /** Most common error message */
    commonError: string;
}
export interface ChronicFailureReport {
    /** Number of reports analyzed */
    lookback: number;
    /** Threshold used for classification */
    threshold: number;
    /** Tasks exceeding the error threshold */
    failures: ChronicFailureEntry[];
    /** Total reports found (may be less than lookback if not enough history) */
    reportsFound: number;
}
export interface ChronicFailureOptions {
    /** Number of recent reports to analyze (default: 10) */
    lookback?: number;
    /** Error rate threshold (0–1) for "chronic" classification (default: 0.5) */
    threshold?: number;
}
/**
 * Query recent reports and identify tasks with chronic failures.
 *
 * @param reportStore - The report store to query
 * @param options - Lookback window and threshold
 * @returns Chronic failure report, or null if no reports found
 */
export declare function detectChronicFailures(reportStore: ReportStore, options?: ChronicFailureOptions): Promise<ChronicFailureReport>;
/**
 * Format a chronic failure report for console output.
 */
export declare function formatChronicFailuresConsole(report: ChronicFailureReport): string;
