/** * JSONL reporter for the planRun-based pipeline. * * Emits one JSON line per `onTrialResult` (in completion order) followed * by a single `run-summary` line in `onRunComplete`. A separate `log` * stream receives short human-readable progress text so the data stream * stays valid JSONL even when both share a TTY. * * Two configurations are typical: * - stdout JSONL (`--output=jsonl`): * new EvalJsonlReporter({ stream: process.stdout, logStream: process.stderr }) * - on-disk JSONL (`--output-dir`): * new EvalJsonlReporter({ stream: fileStream }) — `logStream` defaults * to a /dev/null sink so the file never receives progress prose. */ import type { PlanReporter, PlanRunStartContext, RunArtifacts } from "./plan-reporter.js"; import type { EvalSummary, RunSummary, ScopedDiagnostic, TrialResult, TrialWorkItem } from "../pipeline/plan.js"; export interface EvalJsonlReporterOptions { /** Required: writable stream for the JSONL data stream. */ stream: NodeJS.WritableStream; /** * Optional log stream for short human-readable progress messages. * Defaults to a sink that drops everything (so file destinations * never receive progress prose). */ logStream?: NodeJS.WritableStream; /** Verbose progress logging. Defaults to false. */ verbose?: boolean; /** Optional directory for sidecar diff artifacts. */ diffArtifactsDir?: string; } export declare function escapedJsonContentLength(value: string): number; export declare class EvalJsonlReporter implements PlanReporter { private readonly stream; private readonly logStream; private readonly verbose; private readonly diffArtifactsDir?; private diffSeq; constructor(options: EvalJsonlReporterOptions); onRunStart(ctx: PlanRunStartContext): Promise; onTrialStart(_item: TrialWorkItem): Promise; onTrialResult(event: { item: TrialWorkItem; result: TrialResult; }): Promise; /** * Prepare a trajectory for serialization. `baselineGitDir`/`baselineRef` are * temp paths meaningless outside the originating process, so they are always * stripped. `raw` (the unconverted source document) is likewise in-process * only — it reaches graders during the run but would bloat/duplicate the * output, so it is dropped here. `workspacePatch` is always written to a * `workspace.patch` file on disk by the trial runner, so it is stripped here * to avoid bloating/duplicating the JSONL output. The `diff` is replaced by a * `diffPath` sidecar reference when a diff artifacts dir is configured; * otherwise (e.g. stdout/JSONL mode, or if the sidecar write fails) it stays * inline so re-grade workflows can still read it. */ private serializeTrajectory; private invalidTurnDiffs; private serializeTurnDiffs; onDiagnostics(diagnostics: ScopedDiagnostic[]): Promise; onEvalComplete(summary: EvalSummary): Promise; onRunComplete(summary: RunSummary, artifacts: RunArtifacts): Promise; onTrialPhase(): Promise; private writeData; private log; } //# sourceMappingURL=eval-jsonl.d.ts.map