import { type Annotation, type EffectiveTraceAnnotations } from "./annotations.js"; import { type FoldedComments } from "./comments.js"; import { type Trace } from "./traces.js"; /** * A run directory is a plain folder holding one run: `statelog.jsonl` (one * trace; more is refused), `annotations.jsonl`, and optional attachments — the agent's code * closure directly under `code/`, a working-directory snapshot directly under * `workdir/` with its `workdir.json` sidecar, free-form `notes.md`. This * module names its paths and reads it into one snapshot: the statelog and * annotations are paired coherently (see `readRunDirectory`); `notes.md` is * sampled independently, best effort (see `readNotes`). It never writes; * `mutations.ts` does. */ export type RunDirectoryPaths = { dir: string; statelog: string; annotations: string; notes: string; codeDir: string; /** The graders the run was executed with: the bundled module and any judge * files, named by content hash; the `run` row says which is which. */ gradersDir: string; workdirDir: string; workdirSidecar: string; checklistsDir: string; /** Comments on rows of the trace (`comments.ts`); read like `notes.md`, * outside the statelog coherence check. */ comments: string; lock: string; }; export declare function runDirPaths(dir: string): RunDirectoryPaths; export type RunDirectorySnapshot = { dir: string; hasStatelog: boolean; traces: Trace[]; annotationRows: Annotation[]; effectiveAnnotations: Record; /** The text of `notes.md`, written by a person with any editor; null when absent. */ notes: string | null; /** Comments on rows of the trace, folded into threads; empty when there are none. */ comments: FoldedComments; }; export type ReadRunDirectoryOptions = { reportWarning(message: string): void; }; /** * Read a run directory without taking the lock, and still get one coherent * picture: statelog, then annotations, then the statelog again — if the second * statelog read differs from the first, a writer landed in between, so start * over. A missing statelog is an empty, valid directory, not an error. */ export declare function readRunDirectory(dir: string, options: ReadRunDirectoryOptions): RunDirectorySnapshot;