/**
 * Literacy bridge — maps LiteracyTaskDefinition to the new compiler pipeline.
 *
 * This module bridges the task loading system (TaskSource →
 * GeneralizedTaskDefinition) and the compiler (TaskGraph →
 * PromptfooCompiler). It allows literacy tasks to run through
 * the compiler.
 *
 * Pipeline: LiteracyTaskDefinition[] → TaskGraphBuilder → topological order →
 *           LiteracyModeHandler (per task) → LiteracyBridgeResult
 *
 * Key behaviors:
 * - Tasks without explicit mode get mode: "literacy" (backward compat)
 * - LiteracyTaskDefinition fields map to compiler input fields
 * - Rubric config is loaded from config/rubrics
 * - Prompts from config/prompts are integrated
 * - TaskGraphBuilder validates the DAG, deduplicates, and orders tasks
 *
 * @see docs/archive/exec-plans/architecture-overhaul/phase-7-migrate-literacy.md
 */
import { type LiteracyTaskDefinition } from "../../_vendor/ailf-core/index.d.ts";
import { type LiteracyCompileResult } from "./mode-handlers/literacy/index.js";
import type { PreflightRubricContext } from "./rubric-resolution.js";
import { type LiteracyEvalSubMode } from "../normalize-mode.js";
/** Options for compiling all literacy tasks via the new compiler */
export interface LiteracyBridgeOptions {
    /** Root directory of the eval package */
    rootDir: string;
    /** Eval mode to compile for */
    evalMode?: LiteracyEvalSubMode;
    /** Grader provider ID */
    graderProvider?: string;
    /** Model providers */
    models?: {
        id: string;
        label: string;
        config?: Record<string, unknown>;
    }[];
    /** Grader context policy passed through to `compileLiteracyTask`. */
    graderContext?: "rubric-only" | "with-docs";
    /**
     * W0198 Phase 6 — preflight context passed through to every task's
     * `code-correctness` rubric so the grader treats the deterministic
     * lane's existence verdicts as ground truth.
     */
    preflightContext?: PreflightRubricContext;
}
/** Result of compiling all literacy tasks */
export interface LiteracyBridgeResult {
    /** Per-task compilation results */
    tasks: {
        taskId: string;
        result: LiteracyCompileResult;
    }[];
    /** All warnings across tasks */
    warnings: string[];
    /** Total test cases generated */
    totalTests: number;
}
/**
 * Compile an array of LiteracyTaskDefinition through the literacy handler.
 *
 * This is the primary entry point for Phase 7 migration. It takes
 * LiteracyTaskDefinition[] and routes them through the compiler pipeline:
 *
 *   LiteracyTaskDefinition[] → TaskGraphBuilder → topological order →
 *   LiteracyModeHandler (per task) → LiteracyBridgeResult
 *
 * The TaskGraphBuilder provides:
 * - Duplicate task ID detection (warns on collisions)
 * - Status-based filtering (archived/paused/draft)
 * - Dependency edge discovery and DAG cycle validation
 * - Topological priority assignment (tasks with deps run in order)
 *
 * Note: The incoming tasks are typically pre-filtered by the pipeline
 * step (area/tag/taskId filters + release auto-scope). The graph
 * builder's own filtering is intentionally invoked WITHOUT a filter
 * argument to avoid double-filtering — it still applies status-based
 * rules (e.g., rejecting archived tasks that slipped through).
 */
export declare function compileLiteracyTasks(tasks: LiteracyTaskDefinition[], options: LiteracyBridgeOptions): LiteracyBridgeResult;
/**
 * Compare old-style expanded entries with new-style compiled entries.
 *
 * This is the parallel comparison gate (task 7b). For each task, it
 * checks that the new compiler produces structurally equivalent output
 * to the legacy expand-tasks path.
 */
export declare function compareCompilerOutputs(legacyEntries: LegacyEntry[], newResult: LiteracyBridgeResult): ComparisonResult;
/** Minimal legacy entry shape (from expand-tasks) */
export interface LegacyEntry {
    description?: string;
    vars?: Record<string, unknown>;
    assert?: {
        type: string;
        value?: unknown;
    }[];
    prompts?: string[];
}
export interface ComparisonDiscrepancy {
    taskId: string;
    field: string;
    legacy: unknown;
    new_: unknown;
    message: string;
}
export interface ComparisonResult {
    passed: boolean;
    discrepancies: ComparisonDiscrepancy[];
    summary: string;
}
