/**
 * pipeline/targeted-loo.ts
 *
 * Targeted leave-one-out (LOO) attribution for ambiguous cases.
 *
 * Phase 4d of the Scenario Matrix implementation.
 *
 * When correlation-based attribution (Phase 2c) identifies ambiguous tasks
 * (2+ changed docs map to the same task), targeted LOO resolves the ambiguity
 * by running per-document mini-evaluations to measure each document's
 * marginal contribution.
 *
 * This module handles:
 * - Cost estimation before execution (to enable user confirmation)
 * - Result analysis after LOO runs complete
 * - Integration with the existing AttributionReport
 *
 * The actual evaluation execution is handled by the pipeline orchestrator —
 * this module is pure computation on inputs and outputs.
 *
 * @see docs/archive/exec-plans/scenario-matrix-implementation/phase-4-content-release-integration.md
 * @see docs/design-docs/scenario-matrix/per-document-attribution.md
 */
import type { AttributionReport, LOOCostEstimate, LOOResult, TaskAttribution } from "./types.js";
/**
 * Analyze LOO evaluation results to compute marginal contributions.
 *
 * Given the full-release score and per-document revert scores,
 * calculates each document's marginal contribution as:
 *   marginal(doc) = fullReleaseScore - revertedScore(doc)
 *
 * @param taskId - The task being analyzed
 * @param fullReleaseDelta - The total task delta from the full release
 * @param revertResults - Per-document scores when that document is reverted
 * @param noiseThreshold - Threshold for marking contributions as noise
 * @param additionalCost - Actual cost incurred for the LOO evaluations
 * @returns LOO result with per-document marginal contributions
 */
export declare function analyzeLOOResults(taskId: string, fullReleaseDelta: number, revertResults: {
    /** Score delta with this document reverted */
    revertedDelta: number;
    /** The document slug that was reverted */
    slug: string;
}[], noiseThreshold: number, additionalCost: number): LOOResult;
/**
 * Enrich an attribution report with LOO results for ambiguous tasks.
 *
 * Replaces the "ambiguous" classification with resolved per-document
 * contributions for tasks that have LOO data.
 *
 * @param attribution - Original attribution report
 * @param looResults - LOO results for ambiguous tasks
 * @returns New attribution report with LOO data integrated
 */
export declare function enrichAttributionWithLOO(attribution: AttributionReport, looResults: LOOResult[]): AttributionReport & {
    looResults: LOOResult[];
};
/**
 * Estimate the cost of running targeted LOO for ambiguous tasks.
 *
 * @param ambiguousTasks - Tasks identified as ambiguous
 * @param testsPerTask - Number of tests per task (from task YAML)
 * @param costPerTest - Estimated cost per test (default: $0.08)
 * @returns Cost estimate with per-task breakdown
 */
export declare function estimateLOOCost(ambiguousTasks: TaskAttribution[], testsPerTask: Record<string, number>, costPerTest?: number): LOOCostEstimate;
/**
 * Identify ambiguous tasks that would benefit from targeted LOO.
 *
 * Filters the attribution report to find tasks where 2+ changed documents
 * are in the canonical set and the delta is outside the noise floor.
 *
 * @param attribution - Attribution report from Phase 2c
 * @returns Ambiguous task attributions suitable for LOO
 */
export declare function findAmbiguousTasks(attribution: AttributionReport): TaskAttribution[];
/**
 * Format a LOO cost estimate for console output (for user confirmation).
 */
export declare function formatLOOCostEstimate(estimate: LOOCostEstimate): string;
/**
 * Format LOO results for console output.
 */
export declare function formatLOOResultsConsole(results: LOOResult[]): string;
/**
 * Format LOO results as markdown.
 */
export declare function formatLOOResultsMarkdown(results: LOOResult[]): string;
