/** * Typed wire records for the planRun JSONL data stream. * * These interfaces are the shared contract between the producer * ({@link EvalJsonlReporter}) and any consumer (e.g. the analytics * server's outcome parser). Typing both ends against the same shape * means a field rename or removal fails to compile on both sides * instead of silently degrading the consumer at runtime. */ import type { StimulusGradeResult } from "../pipeline/grading.js"; import type { TrialResult } from "../pipeline/plan.js"; import type { Trajectory } from "../trajectory/types.js"; /** * One `trial-result` line in the JSONL data stream, emitted once per * completed trial. Optional fields are omitted from the serialized line * when absent (single-model runs omit `model`, single-run stimuli omit * `trialIndex`/`totalTrials`, etc.). `gradeResult` and `trajectory` are * the exception: they are always emitted (as `null` when absent) so every * record is a valid `EvalOutcome` shape that round-trips through `grade`. */ export interface TrialResultRecord { type: "trial-result"; /** Originating `TrialWorkItem.id`. */ itemId: string; evalName: string; evalFilePath: string; /** Variant name. Always present — every planRun item has a variant. * `vally eval` runs use a single default variant; experiment runs * carry the variant name configured in the experiment YAML. */ variant: string; /** Resolved stimulus name (`TrialWorkItem.stimulus.name`). */ stimulus: string; /** Stable shard identity (from `computeShardKey`). Present on `vally * experiment run` output; lets merge map a result line directly to its * shard key instead of re-deriving it. Omitted by plain `vally eval`. */ shardKey?: string; /** Omitted for single-model runs. */ model?: string; /** 0-based trial index; omitted for single-run stimuli. */ trialIndex?: number; /** Total trials for the stimulus; paired with `trialIndex`. */ totalTrials?: number; status: TrialResult["status"]; durationMs: number; /** Present when `status === "error"`. */ error?: string; /** Present when `status === "skipped"`; explains why the stimulus was * skipped (e.g. executor not in `supported_executors`). */ skipReason?: string; /** Present when the per-trial workspace was preserved. */ workspacePath?: string; /** Always present; `null` when grading did not run (e.g. `--skip-grade`). */ gradeResult: StimulusGradeResult | null; /** Always present; `null` when the executor produced no trajectory. */ trajectory: Trajectory | null; } //# sourceMappingURL=jsonl-record.d.ts.map