/** * Mixed grading: deterministic assertions + LLM judge + multi-dimensional scoring. */ import type { GradeResult, ExecutorFn, JudgeConfig, Sample, ToolCallInfo, TurnInfo } from '../types/index.js'; interface GradeOptions { output: string; sample: Sample; /** * Unified judge config — always non-empty. `length === 1` runs the single-judge * quick path (one judge per (sample × dimension)), `length >= 2` runs the * ensemble path with per-judge breakdown + Pearson/MAD agreement metrics * (refutes "judge same-modality bias" critique). * * The first entry (`judgeModels[0]`) is also used as the "primary judge" for * single-call paths (async assertions): one LLM call per assertion, no ensemble * aggregation — the primary judge is a deterministic representative. */ judgeModels: JudgeConfig[]; /** * Map `executor name → ExecutorFn`. The map only needs entries for executors * actually invoked by this grade call — i.e. when the sample triggers an LLM * code path (async assertions, dimension scoring, single rubric, ensemble * member). Sync-only samples can pass `{}`. Failures are lazy: missing entry * throws only at the call site, not on grade entry. */ judgeExecutors?: Record; allowLlmJudge?: boolean; execMetrics?: { costUSD?: number; durationMs?: number; numTurns?: number; toolCalls?: ToolCallInfo[]; turns?: TurnInfo[]; mockStats?: { hits: number; misses: number; perMock: Record; }; }; samplesDir?: string; /** * Run the LLM judge N times per (sample × dimension) pair and report mean + stddev. * Default 1 (single judge call). Useful for measuring judge self-consistency: * a high stddev means the judge isn't stable on this rubric and the score is noisy. */ judgeRepeat?: number; /** * length-debias toggle. Defaults to true — judge prompt includes the * "length is not a quality signal" instruction. Set false (via `--no-debias-length`) * to drop it (the debias-off prompt variant) for reproducing older no-length-debias * reports. The presentation/tone neutrality instruction is always on regardless. */ lengthDebias?: boolean; } /** * Grade a model output against a sample's criteria. */ export declare function grade({ output, sample, judgeModels, judgeExecutors, allowLlmJudge, execMetrics, samplesDir, judgeRepeat, lengthDebias }: GradeOptions): Promise; export { runAssertions, validateJsonSchema } from './assertions.js'; export { buildTraceSummary } from './judge.js';