import type { Score } from "../runDirectory/annotations.js"; import type { RunDirectorySnapshot } from "../runDirectory/runDir.js"; import { type TraceOutputText } from "../runDirectory/traceText.js"; import type { Source } from "./sources.js"; import type { ScanResult } from "./mine.js"; /** One grader's effective verdict on a test: the latest complete pass's * score row, as the graders table and the verdict screen show it. */ export type GraderVerdict = { /** The effective-score key: annotator kind, lineage, and name. Two * verdicts can share a name (a regrade from a different module), never a key. */ key: string; name: string; score: Score; weight: number; mustPass: boolean; feedback: string | null; /** The annotator id: `@` for a grader, the judge's id for a judge. */ annotator: string; }; /** What a person sees when drilling into a test: the input it was given, * the output the graders saw, and every grader's verdict. Only a run * directory has it; a raw statelog trace was never graded. */ export type TestDetail = { input: string | null; output: TraceOutputText; graders: GraderVerdict[]; }; export type TestRow = { inputId: string; /** The trace this test ran as; the viewer opens the run's statelog on it. */ traceId?: string; statelogPath?: string; score: number | null; gatesPassed: boolean | null; status: "ok" | "missing" | "failed"; costUsd: number | null; durationMs: number | null; startedAtMs: number | null; models: string[]; /** The trace's `agentName` event; feeds run identity. */ agentName?: string; detail?: TestDetail; /** The trace produced events but the run was cut short (timeout, cost * cap, kill) — the signature of a killed run. */ statelogHadEvents?: boolean; }; export type RunRow = { /** Stable identity: the run directory, or `${statelogPath}#${traceId}`. * The cursor pins to this, never to a table index. */ key: string; source: Source; startedAtMs: number | null; agent: string; /** Shown on the info screen only; the table shows `agent`. */ command?: string; /** The harness's agent label (`flags.agent` on the run row), kept for * identity fallback + info screen. */ agentLabel?: string; suite: string; score: number | null; gatesPassed: boolean | null; status: "ok" | "partial" | "failed" | "killed" | "trace"; costUsd: number | null; wallMs: number | null; models: string[]; tests: TestRow[]; warnings: string[]; backfilled: boolean; }; /** * One row for a run directory, from its summary. The run is a test row * whether or not it wrote a trace: the harness `run` row names the test and * how it ended; scores come from the effective annotations; cost, time and * models from the trace (zero for a run that died before its first event). */ export declare function buildRunRowFromDirectory(snapshot: RunDirectorySnapshot, source: Source): RunRow; /** A source that could not be read at all: still a row, so 1 broken run * in 200 stays visible instead of vanishing. */ export declare function buildFailedRunRow(source: Source, warning: string): RunRow; /** One row per recovered trace of a raw statelog file. */ export declare function buildTraceRows(file: string, result: ScanResult): RunRow[]; /** Recompute every run-level aggregate from the per-test rows. Called * after phase 1 and after every completed backfill patch. */ export declare function recomputeRunAggregates(row: RunRow): void;