/**
 * Per-dimension failure-mode taxonomy barrel — relocated to @sanity/ailf-core.
 *
 * Previously lived in packages/eval/src/grader/index.ts. Moved here (D-05)
 * so card files in packages/core/src/services/diagnosis/cards/ can import
 * `failureModesForDimension` without violating the core→eval import rule.
 *
 * Named re-exports only (W0124 — never `export *`).
 *
 * The eval-side packages/eval/src/grader/index.ts now re-exports from here,
 * keeping all existing eval-side callers working without source changes.
 *
 * @see docs/design-docs/actionability-ladder/03-structured-grader-judgments.md
 *      §"Per-dimension failure-mode taxonomies" (lines 239-283).
 * @see docs/decisions/D0005-grader-model-separation.md — single grader model;
 *      taxonomies travel with the rubric prompt for reproducibility.
 */
export { COMMON_FAILURE_MODES } from "./common.js";
export { LITERACY_FAILURE_MODES } from "./literacy.js";
export { MCP_FAILURE_MODES } from "./mcp.js";
export { KP_FAILURE_MODES } from "./knowledge-probe.js";
export { AGENT_FAILURE_MODES } from "./agent-harness.js";
import { COMMON_FAILURE_MODES } from "./common.js";
import { LITERACY_FAILURE_MODES } from "./literacy.js";
import { MCP_FAILURE_MODES } from "./mcp.js";
import { KP_FAILURE_MODES } from "./knowledge-probe.js";
import { AGENT_FAILURE_MODES } from "./agent-harness.js";
/**
 * Return the legal failure-mode list for a given rubric dimension.
 *
 * Accepts both family-level keys (`mcp-behavior`, `knowledge-probe`,
 * `agent-harness`) and the per-template `dimension` strings used in
 * `config/rubrics.ts` (`task-completion`, `input-validation`,
 * `factual-correctness`, `process-quality`, …). The cross-cutting
 * `COMMON_FAILURE_MODES` is always included.
 *
 * Unknown dimensions fall through to `COMMON_FAILURE_MODES` only — safe
 * default, the grader can still pick `unclassified`.
 */
export function failureModesForDimension(dimension) {
    switch (dimension) {
        // ── Literacy family ──────────────────────────────────────
        case "task-completion":
        case "code-correctness":
        case "doc-coverage":
            return [...COMMON_FAILURE_MODES, ...LITERACY_FAILURE_MODES];
        // ── MCP family ───────────────────────────────────────────
        case "mcp-behavior":
        case "input-validation":
        case "output-correctness":
        case "error-handling":
        case "security":
            return [...COMMON_FAILURE_MODES, ...MCP_FAILURE_MODES];
        // ── Knowledge-probe family ───────────────────────────────
        case "knowledge-probe":
        case "factual-correctness":
        case "completeness":
        case "currency":
            return [...COMMON_FAILURE_MODES, ...KP_FAILURE_MODES];
        // ── Agent-harness family ─────────────────────────────────
        case "agent-harness":
        case "process-quality":
        case "agent-output":
        case "tool-usage":
            return [...COMMON_FAILURE_MODES, ...AGENT_FAILURE_MODES];
        default:
            return COMMON_FAILURE_MODES;
    }
}
/**
 * Flat list of all dimension names recognized by `failureModesForDimension`.
 * Used by card-validators and test calibration.
 */
export const CANONICAL_DIMENSIONS = [
    // Literacy family
    "task-completion",
    "code-correctness",
    "doc-coverage",
    // MCP family
    "mcp-behavior",
    "input-validation",
    "output-correctness",
    "error-handling",
    "security",
    // Knowledge-probe family
    "knowledge-probe",
    "factual-correctness",
    "completeness",
    "currency",
    // Agent-harness family
    "agent-harness",
    "process-quality",
    "agent-output",
    "tool-usage",
];
/**
 * Returns `true` when `mode` appears in the failure-mode list of any
 * canonical dimension family.
 */
export function isCanonicalFailureMode(mode) {
    const allModes = new Set([
        ...COMMON_FAILURE_MODES,
        ...LITERACY_FAILURE_MODES,
        ...MCP_FAILURE_MODES,
        ...KP_FAILURE_MODES,
        ...AGENT_FAILURE_MODES,
    ]);
    return allModes.has(mode);
}
