import type { AgencyConfig } from "../../config/config.js"; import { type BatchStatistics, type IncompleteBatch } from "../../eval/batchStatistics.js"; import type { EvalRunGrading } from "../../eval/runTypes.js"; import type { GraderSource } from "../../eval/grading/gradeRun.js"; export type EvalGradeOptions = { /** Grade with each test's CURRENT graders from this suite (a file, a * directory, or a git source), matched to runs by test id, instead of the * copy each run directory stored. Improve a grader, re-score old runs. */ suite?: string; /** Judge every trace against this goal with the bundled goal judge (a test's * own recorded goal still wins). Not combined with `suite`: the suite's * graders bring their own criteria, and `--goal` names the criterion. */ goal?: string; /** Also write the grading summary here, as JSON. */ out?: string; /** Grade up to this many run directories at once (default 1). Judge calls * are LLM calls, so a big group grades much faster in parallel. */ parallel?: number; /** Called once per graded run directory, in completion order — the CLI's * progress line. Omitted (tests, programmatic use) = silent. */ progress?: (message: string) => void; config?: AgencyConfig; }; /** One graded run directory and the mean over them all. */ export type EvalGradeResult = { runs: { dir: string; grading: EvalRunGrading; }[]; /** Mean objective over the runs graded. */ mean: number; /** Total LLM spend of this pass's judge calls, in USD. */ judgeCostUsd: number; /** Every run passed its gates. */ gatesPassed: boolean; /** Trial statistics for each selected batch that ran more than one trial, * in the order the batches were met. Unrelated batches never merge. */ batches: BatchStatistics[]; /** Batches with no statistics — an uneven trial grid, say — and why. Their * runs are still graded above; only the batch-level numbers are missing. */ incompleteBatches: IncompleteBatch[]; }; /** The command's own preconditions, checked before anything loads: the two * ways of saying "judge against this" are exclusive, and the targets must * hold run directories (a bare statelog copied into a folder is the common * miss). Returns canonical run directories to grade, duplicates removed by * physical identity: `eval grade runs/suite runs/suite/a` grades `a` once. */ export declare function validateGradeTarget(targets: string[], opts: EvalGradeOptions): string[]; /** Where `eval grade` takes each run's graders from: the suite named by * `--suite`, else the copy the run directory stored. */ export declare function graderSourceFor(opts: EvalGradeOptions, config: AgencyConfig): GraderSource; /** * Score run directories, or every run directory in groups. Never re-executes * the agent. Each run gets its own grading pass, appended to ITS * `annotations.jsonl` — a re-grade sits beside the earlier ones, never over * them. */ export declare function evalGrade(targets: string[], opts: EvalGradeOptions): Promise; /** * The `agency eval grade` action: progress lines on stderr, the report on * stdout. Returns whether every run passed its gates — the caller owns the * exit code. */ export declare function runGradeCommand(paths: string[], opts: EvalGradeOptions): Promise;