/**
 * pipeline/failure-modes.ts
 *
 * Ceiling-cross-check failure-mode validator + report assembly + keyword
 * fallback classifier.
 *
 * The grader emits `failureMode` directly under the per-dimension taxonomy
 * (Plan 03-02 — `packages/eval/src/grader/`) when its structured response
 * is available to the pipeline. In practice (W0273 discovery), Promptfoo's
 * `llm-rubric` post-processor extracts `score` + `reason` from the grader's
 * JSON envelope and discards the rest of the structured surface — including
 * `failureMode`. The wire-shape footer instructs the LLM correctly but the
 * structured fields never reach `extractGraderJudgments`, so every emission
 * arrives as the synthesized `failureMode: "unclassified"` placeholder.
 *
 * To restore the pre-2026-05-11 classification rate (15-23% → 0% → 15-23%),
 * a keyword-pattern classifier is run as a FALLBACK when the grader's
 * emitted mode is `"unclassified"` and the score is below the classification
 * threshold. Plan 03-03 deleted this classifier in favor of grader-emission
 * source-of-truth; W0273 reinstates it because the grader-emission path is
 * blocked by Promptfoo's lossy `llm-rubric` parsing. The long-term fix
 * (capturing the grader's full structured response) is tracked separately.
 *
 * `classifyByCeiling` continues to serve as the confidence cross-check.
 *
 * @see docs/decisions/D0005-grader-model-separation.md — single grader emits
 *      failureMode under the per-dimension taxonomy
 * @see docs/decisions/D0049-shared-confidence-contract.md — Confidence triple
 *      shape and `ceiling-cross-check` derivation tag
 * @see docs/audits/2026-05-22-empty-gap-analysis-regression.md — W0273 root
 *      cause (Promptfoo strips structured fields)
 */
import type { Confidence } from "../_vendor/ailf-core/index.d.ts";
import type { FailureModeReport, FeatureScore, GraderJudgment } from "./types.js";
/**
 * Build a complete failure mode report from grader judgments and scores.
 *
 * The grader-emitted `judgment.failureMode` is the source of truth (Plan
 * 03-03 — keyword classifier deleted). `validateFailureMode` cross-checks
 * the emission against ceiling decomposition and stamps a D0049 confidence.
 *
 * The `FailureMode` triple shape (`mode`, `confidence`, `source`) is
 * preserved for backward compatibility with downstream consumers
 * (gap-analysis, manifest emission) — the bucketed `confidence` enum maps
 * 1:1 from `Confidence.level`, and `source` is always `"ceiling"` now that
 * the keyword path is gone.
 *
 * @param judgments - All grader judgments from the evaluation
 * @param scores - Per-area feature scores (for ceiling decomposition)
 * @returns Failure mode report with per-area breakdowns
 */
export declare function buildFailureModeReport(judgments: GraderJudgment[], scores: FeatureScore[]): FailureModeReport;
/**
 * Cross-check a grader-emitted `failureMode` against ceiling decomposition
 * and emit a D0049 `Confidence` triple stamped with
 * `derivation: "ceiling-cross-check"`.
 *
 * Replaces the deleted keyword-pattern + ceiling combine classifier — the
 * grader's emission is now the source of truth for the mode itself; this
 * function only stamps confidence based on whether the structural ceiling
 * signal agrees.
 *
 *  - `level: "high"` (`signalsPresent: 2`) — grader emission and ceiling
 *    decomposition agree on the same mode.
 *  - `level: "medium"` (`signalsPresent: 2`) — both signals present but
 *    disagree. The live pipeline increments
 *    `GraderReliability.failureModeCalibration` ONLY on this branch — a
 *    true calibration miss requires both signals to be present.
 *  - `level: "low"` (`signalsPresent: 1`) — only the grader's emission;
 *    ceiling decomposition produced no structural signal. Not a
 *    calibration miss (we have nothing to cross-check against).
 *  - `level: "low"` (`signalsPresent: 0`) — passing scores
 *    (`>= CLASSIFICATION_THRESHOLD`) don't classify; emit absent.
 *
 * @param judgment - The grader judgment carrying `failureMode` + `score`
 * @param ceilingScore - The area's ceiling score (with-docs best case)
 * @param floorScore - The area's floor score (no-docs baseline)
 * @returns D0049 Confidence triple stamped `derivation: "ceiling-cross-check"`
 *
 * @see docs/decisions/D0005-grader-model-separation.md
 * @see docs/decisions/D0049-shared-confidence-contract.md
 */
export declare function validateFailureMode(judgment: GraderJudgment, ceilingScore: number, floorScore: number): Confidence;
/**
 * Format a failure mode report for console output.
 */
export declare function formatFailureModesConsole(report: FailureModeReport): string;
/**
 * Format a failure mode report as markdown for PR comments.
 */
export declare function formatFailureModesMarkdown(report: FailureModeReport): string;
