import type { Test, TestInput } from "../../eval/runTypes.js"; import type { EvalRecord } from "../../eval/types.js"; import type { AgencyRunner } from "./agencyRunner.js"; /** The unified run-spec type lives in the eval layer; re-export it so the many * `import { Test } from "./types.js"` sites in the optimizer keep working. */ export type { Test }; /** A JSON-compatible value. */ export type JSON = string | number | boolean | null | JSON[] | { [key: string]: JSON; }; /** A path of object keys / array indices into a JSON value. */ export type JSONPath = (string | number)[]; /** One trace's evidence as grading sees it — as opposed to `AgentRun` * (lib/eval/run/runAgent.ts), which is the outcome of EXECUTING. */ export type LoadedRun = { output: JSON; traceId: string; workdir: string; record: EvalRecord; }; /** A grader's score: pass/fail or a continuous value. */ export type Score = { kind: "binary"; pass: boolean; } | { kind: "scalar"; value: number; }; /** One answer from a checklist judge: the point as the test wrote it, * whether the work met it, and the words from the work that decided it. */ export type Point = { point: string; pass: boolean; evidence: string; }; /** A grader's output: a score plus optional natural-language feedback, and * for a checklist grader the answer per point. */ export type Grade = { score: Score; feedback?: string; points?: Point[]; }; /** Options common to every grader; subclasses extend this with their own fields. */ export type GraderOptions = { mustPass?: boolean; threshold?: number; weight?: number; samples?: number; aggregate?: "any" | "all"; name?: string; }; /** What a grader's `_run` receives. */ export type GraderInput = { test: Test; run: LoadedRun; runAgency: AgencyRunner; /** The test's grader-only files, as a directory; absent when it has none. */ graderFiles?: string; };