import type { RunOutcome } from "../runDirectory/annotations.js"; import type { Test } from "./runTypes.js"; import type { HarnessSnapshot } from "./grading/harnessSnapshot.js"; import type { GraderFilesSnapshot } from "./grading/graderFilesSnapshot.js"; import { type GradersSnapshot } from "./grading/gradingModule.js"; /** One fake test run to write into a run directory. */ export type FakeRun = { test: Test; traceId?: string; /** The recorded output; undefined → the trace ends with no output. */ output?: unknown; ended?: RunOutcome; errorMessage?: string; /** Files to place in the trace's workdir snapshot. */ workdirFiles?: Record; costUsd?: number; /** When false, no trace is written at all — a run that never started. */ wroteStatelog?: boolean; /** The harness's agent label, recorded as `flags.agent` on the run row. */ agentLabel?: string; /** Harness pairs to store under graders/ and record on the run row, as * `eval run` does for a test directory with files/ and holdout/. */ harness?: HarnessSnapshot; /** The test's grader-only files to store under graders/, as `eval run` * does for a test directory with graderFiles/. */ graderFiles?: GraderFilesSnapshot; /** The test's own graders to store under graders/ and record on the run * row, as `eval run` does for a test with a graders.ts or graders.json. */ graders?: GradersSnapshot & { origin: "test" | "config"; }; /** Recorded on the run row, as `eval run` does for a suite invocation. */ batch?: string; trial?: number; }; /** * Write one run directory the way `eval run` does — the trace, its workdir, * and the `run` row — for tests of grading, labeling, the explorer, the * optimizer, and the CLI. Returns the directory. One run per directory is * the only shape writers produce and readers accept; a group of several is * `writeRunGroup`. */ export declare function writeRunDirectory(run: FakeRun, dir?: string): string; /** * A group the way `eval run --out` writes one: one run directory per fake * run, at `//` (the trace id when the test has no id). * Child names are checked for clashes before anything is written, so a bad * call leaves no partial group. Returns the group directory. */ export declare function writeRunGroup(runs: FakeRun[], groupDir?: string): string;