/**
 * scoring-bridge.ts — Bridge between Promptfoo raw results and the
 * 4-tier scoring engine.
 *
 * Converts Promptfoo `ComponentResult[]` (from test results) into the
 * scoring engine's `AssertionScore[]` format, then delegates aggregation
 * to `aggregateDimensions` and `computeTaskScore` from core.
 *
 * This bridge replaces the three legacy scoring primitives in
 * `calculate-scores.ts`:
 *   - `accumulateDimensions`  → `convertToAssertionScores` + `aggregateDimensions`
 *   - `averageDimensions`     → (handled internally by `aggregateDimensions`)
 *   - `weightedComposite`     → `computeTaskScore`
 *
 * The bridge preserves the existing 0–100 output scale. The 4-tier
 * engine works in [0, 1]; this module handles the conversion at
 * boundaries.
 *
 * W0198 Phase 5 — when a `preflightForTest` callback is provided and
 * returns a `SymbolPreflightReport`, the bridge synthesizes one extra
 * `AssertionScore` per test in the `code-correctness` dimension. The
 * deterministic preflight and the LLM rubric merge through D0010's
 * weighted dimension aggregation; the relative share is set by
 * `preflightWeight` in `[0, 1]`.
 *
 * The consumer-verification lane rides the same mechanism at
 * `consumerVerificationWeight`; when both lanes report, the rubric share is
 * `1 - preflightWeight - consumerVerificationWeight`, clamped at 0 (D0047).
 *
 * @see packages/core/src/services/scoring-engine.ts — the 4-tier engine
 * @see packages/eval/src/pipeline/calculate-scores.ts — the consumer
 * @see docs/archive/exec-plans/architecture-overhaul/phase-7-migrate-literacy.md
 * @see docs/design-docs/two-stage-grader-symbol-preflight.md — W0198 design
 */
import { type AssertionScore, type ConsumerVerificationReport, type DimensionScore, type SymbolPreflightReport } from "../../_vendor/ailf-core/index.d.ts";
import type { TestResult } from "../../_vendor/ailf-core/index.d.ts";
/** Result of scoring a group of tests via the 4-tier engine */
export interface BridgedScoreResult {
    /** Per-dimension breakdown (0–100 scale) */
    dimensions: Record<string, number>;
    /** Weighted composite score (0–100 scale) */
    composite: number;
    /** Total cost across all tests */
    totalCost: number;
    /** Raw DimensionScore objects from the engine (0–1 scale) */
    rawDimensions: DimensionScore[];
}
/**
 * W0198 Phase 5 options. When `preflightForTest` is omitted (or returns
 * `undefined`) the bridge stays purely rubric-driven — identical to the
 * pre-W0198 behavior. When a report is returned, one `code-correctness`
 * preflight assertion is synthesized per test and merged with the rubric
 * via weighted-mean.
 */
export interface ScoreTestGroupOptions {
    /** Look up the preflight report attached to a particular test, if any. */
    preflightForTest?: (test: TestResult) => SymbolPreflightReport | undefined;
    /**
     * Preflight's share of the `code-correctness` dimension, in `[0, 1]`.
     * The complementary share belongs to the LLM rubric. Defaults to
     * `DEFAULT_PREFLIGHT_CODE_CORRECTNESS_WEIGHT` (0.4). Ignored when
     * `preflightForTest` is omitted.
     */
    preflightWeight?: number;
    /**
     * Look up the consumer-verification report for a test, if any. Merges
     * exactly like `preflightForTest`; both lanes may be active at once.
     */
    consumerVerificationForTest?: (test: TestResult) => ConsumerVerificationReport | undefined;
    /**
     * Verification's share of the `code-correctness` dimension, in `[0, 1]`.
     * Defaults to `DEFAULT_CONSUMER_VERIFICATION_CODE_CORRECTNESS_WEIGHT` (0.4).
     * Ignored when `consumerVerificationForTest` is omitted.
     */
    consumerVerificationWeight?: number;
}
/**
 * Score a group of test results using the 4-tier scoring engine.
 *
 * This replaces the legacy `accumulateDimensions → averageDimensions →
 * weightedComposite` chain with the new engine's `aggregateDimensions →
 * computeTaskScore` chain.
 *
 * @param tests    Pre-filtered test results (e.g., all gold or all baseline)
 * @param profile  Weight profile mapping kebab-case dimension names to weights
 *                 (e.g., `{ "task-completion": 0.4, "code-correctness": 0.35, "doc-coverage": 0.25 }`)
 * @param taskId   Optional task identifier for traceability in TaskScore output
 * @param options  Optional deterministic-lane integration (W0198 preflight
 *                 and/or consumer verification) merged into code-correctness
 * @returns        Dimensions (0–100) and composite (0–100), matching legacy output format
 */
export declare function scoreTestGroup(tests: TestResult[], profile: Record<string, number>, taskId?: string, options?: ScoreTestGroupOptions): BridgedScoreResult;
/**
 * Synthesize a `code-correctness` AssertionScore from a W0198 symbol-
 * preflight report.
 *
 * The score is `1 - min(1, total / cap)`. With the default
 * `{ perMissing: 20, cap: 60 }` config: 0 missing → 1.0, 1 missing → 0.667,
 * 2 missing → 0.333, ≥3 missing → 0.0.
 *
 * Edge cases for the deduction config:
 * - `cap === 0` (measurement-only config): score is 1.0 — divide-by-zero
 *   would NaN otherwise.
 * - `cap < 0` (misconfigured): score is 1.0 and the merge silently
 *   collapses to rubric-only on this dimension. The Phase 3 Zod schema
 *   gates against this upstream so it should never reach here, but the
 *   guard preserves the never-deduct invariant if it does.
 *
 * `unresolved` findings never deduct (the preflight's never-deduct rule):
 * they're not part of `total`, so they fall through to the LLM rubric.
 */
export declare function preflightToScore(report: SymbolPreflightReport, weight: number): AssertionScore;
/**
 * Synthesize a `code-correctness` AssertionScore from a consumer-
 * verification report. The verifier already scored in `[0, 1]`, so the
 * verdict passes through unchanged (D0047: sibling, never a deduction).
 */
export declare function consumerVerificationToScore(report: ConsumerVerificationReport, weight: number): AssertionScore;
