Repository navigation
merge(evaluation): serve a run's stored trace, raw and manifest - #82
Merged
Merged
Conversation
A kind can be handed a sealed run's artifacts but not its trace, raw streams or manifest, and needs.trace is silently ignored. The plan serves each part on declaration, adds a typed exit status to shell tool results, and names the guards, the probe and their bites. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Eight nodes in four levels: the schema and a probe of real shell shapes, then both readers, the serving of the stored run and the helper, then a graded run on both harnesses, then an adversarial review of the whole diff. Each leaf states its guards, bites, estimate and cap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both leaves edit the trace enum, its generated schema and its contract page. The schema leaf now checks first whether trace_context has merged: the second to land rebases and regenerates, and the two land in one release for one minor bump. Its doc gate also says that needs.trace hands a kind the run's instruction texts once the trace holds context_start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The maintainer approved the spend cap with the go for level 1. The probe leaf commits under trace-model, since harness is not a scope cog.toml allows. M6.5's trace_context has not merged into origin/main, so the schema leaf goes ahead and whichever lands second rebases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The probe recorded that Claude Code moves a timed-out command to the background with is_error false, so the Claude Code reader must not give it code 0; a fourth bite guards that. OpenCode kills a timed-out command and writes its signal by name with no exit, so the OpenCode reader gives no exit when metadata.exit is missing, whatever the status. The plan keeps exit absent on a timeout; mapping the signal name waits for a consumer and joins the follow-ups. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Real Claude Code 2.1.311 and real OpenCode 2.2.7, each on the parity rig, ran one scripted turn of three shell calls: exit 3, a stderr-only exit 2, and a sleep that outlives a 1000 ms timeout. Their raw streams are kept as reader fixtures with provenance. The scratch test and the fake-model script that produced them ride in this commit and are removed by the next one. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Removes the scratch test and the fake-model script from the rig, and records what the recorded streams show: OpenCode writes the code in metadata.exit, Claude Code prefixes the content with Exit code N, and neither gives a code on its own timeout. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Real Claude Code and OpenCode 2.2.7, run on the parity rig, each made a shell call that exits 3, one that writes only to stderr and exits 2, and one their own timeout ends. Their streams land as reader fixtures with provenance, and the report answers what each writes: Claude Code keeps the `Exit code N` prefix with stderr only and moves a timed-out command to the background without a code; OpenCode writes a nonzero exit in `state.metadata.exit` and a timed-out call as a SIGTERM with no exit. The probe's own test code is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Verified against its fixtures; merged as e58f091. Its container-e2e run waits for the integration branch to reach a pull request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A reader of a record Candler writes ignores an unknown field, so the trace reader cannot refuse `exit` on a call line; the gate now states what holds. `Needs` keeps the reading `KindSpec` and `DescribeResult` have, schema strict and Rust reader lenient, instead of becoming the one strict struct in the describe result. The serving leaf now carries the engine's needs union, and the helper leaf the `bool | None` models that could write a null the Rust reader refuses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The schema leaf's doc gate asked for a sentence about an event the trace cannot carry until M6.5's trace_context lands, so the published schema would describe a field the wire does not have. Whichever of the two lands second writes it, in the commit that brings both together. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
History is not rewritten, so whichever of M6d and M6.5 lands second merges origin/main in rather than rebasing, then regenerates the schemas and contract pages. M6.5's side is its leaf meet_run_context.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Guards, written before the code and red on the base:
- a tool_result with an exit object reads and is written back; a bare
{code}, a string and null are refused
- a describe result whose needs set raw and manifest is valid; a
non-boolean raw and an unknown needs key are invalid, for the Rust
reader and the helper's models alike
- context digest vectors for contexts that serve a trace, raw streams
and a manifest, generated by the independent Python generator; the
existing rows are unchanged
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A trace line's tool_result gains an optional exit, the process exit
object. Needs gains raw and manifest, booleans that read as false when
absent, and refuses a key it does not know. RunContext gains an optional
manifest, and its trace and manifest are {path, abs, sha256} objects.
ContextRaw gains sha256. context_digest adds a key for each served part,
only when it is served, so the digest of a context that serves none of
them is unchanged.
BREAKING CHANGE: RunContext.trace is an object, no longer a path string,
and ContextRaw has a required sha256, so a context written before is
invalid now. Candler never wrote a context with a trace or a raw stream.
Migration: write trace as {"path": "trace.jsonl", "abs": <absolute path>,
"sha256": <digest>} and add "sha256" to each raw stream. In Rust,
EventKind::tool_result takes the exit as a third argument, ContextRaw::new
takes the digest, and RunContextBuilder::trace takes a ContextArtifact.
A describe result whose needs carry a key other than the listed ones is
refused.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The event constructor takes the shell call's exit; the reader gives none yet. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The event constructor takes the shell call's exit; the reader gives none yet. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The generated models follow the schemas: needs gain raw and manifest, a context gains a manifest, and its trace and manifest carry their digests. The helper's context builder takes the trace's absolute path from the object. The vector check of the isolation test skips the vectors whose fault is in a kind's needs, which an envelope check does not read. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Needs gain raw and manifest; the context holds an optional manifest, its trace and manifest are objects with a digest, and each raw stream carries its digest. The Notes are unchanged and stay within the budget. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A reader that takes exit as free JSON now fails on the refused row it accepts, not on the key order of a kept row. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Needs ignores an unknown key in serde, as KindSpec and DescribeResult do; the schema still refuses it. The needs_unknown_key vector goes, with its README row. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The trace need no longer mentions an event the schema cannot hold, and ContextArtifact says that the trace and the manifest have its shape. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A trace line's `tool_result` now carries an optional `exit`, the
`ExitStatus` object every supervised process already has, and both
trace readers pass none until they read it. A plug-in's needs gain
`raw` and `manifest`, false when absent. `RunContext.trace` and
`.manifest` are `{path, abs, sha256}` objects in `ContextArtifact`'s
shape, `ContextRaw` carries its sha256, and `context_digest` adds a key
for each of those parts only when it is served, so every existing
digest is unchanged. The schemas, the helper's models and the design
document follow.
The trace reader ignores an unknown field, as every reader of a record
Candler writes does, and `Needs` is read as its siblings in the describe
result are: the schema refuses an unknown key, the Rust reader ignores
it. The `feat(schemas)!` commit's body still says needs refuse an
unknown key; the `fix(schemas)` commit after it is what holds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The report now says the glob doc was corrected, what the guard leaves uncovered, and that bite (a) was applied again after the refactor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A plug-in kind that needs the trace and an artifact grades a real run of Claude Code and of OpenCode, behind the production gateway and the scripted fake model, and passes only when it sees each shell call's command with its exit status and the MCP call's server and tool. The guard runs in container-e2e and joins its expected list. The fake model's start, the shared experiment and the sealing of a run are shared with the parity guard; the seam helpers have one copy; the e2e cleanup removes every job's containers and networks. The Needs.artifacts doc says a glob starts with outputs/, as the registry requires. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The report is numbered 03: 02 is the seam review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The findings of a reviewer who built none of the campaign, judged against the README purpose paragraph, AGENTS.md and waste. Rulings and fixes follow on this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The script took exactly two commands; a recording of more shapes in one run needs a list of any length. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude Code writes is_error false and a returnCodeInterpretation, with no code, for grep with no match, diff of two files that differ and a false test. The reader gave them code 0. They now carry no exit; the reader is 0.4.0, its version one macro invocation instead of two literals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude Code reports grep with no match, diff of different files and a false test as non-error results, with a returnCodeInterpretation and no code. The reader wrote exit 0 for them; it now writes no exit, as the field promises when the harness states none. Reader 0.4.0. The OpenCode export already states exit 1 for the same commands; both are recorded as fixtures from the real harnesses, with the recipe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The store layout now owns the file names of the trace, the manifest and the raw files, and Store::raw_streams is the one reader of raw/: an entry that is not <stream>.jsonl.gz refuses with the store's Parse error rather than serving fewer streams. The context, the frame writer and the runner take their spellings from the layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The store holds the names of the trace, manifest and raw streams, and reads raw/ once, refusing an entry that is not a stream it writes. The helper refuses a trace out of order as the Rust reader does. materialise builds a served entry in one place; each reader version is spelled once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Claude Code reader is claude-code-stream-json@0.4.0, so the trace the import writes for run-6 and run-12 changed bytes and hash. The [[served]] rows record each new hash, taken from the store, and gen_live_context.py recomputes their projection and digest; --check agrees. Raw streams and the manifest are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
graded_run_sees_trace builds the evaluator helper with `uv sync`, and the container-e2e runner had no uv, so spawning it failed with NotFound. Install it as ci.yml does, at the same pinned action. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Take main (instructions and hooks as cell values, M6.5) into the run
context branch. Both trace changes meet in one generated schema: the
normalised trace keeps `context_start` and `tool_result.exit`, and the
schemas and contract pages come from BLESS, not a hand merge. No
version is bumped here.
Conflicts:
- parity rig: both sides lifted the fake model's start and the job run
out of the parity guard. Main's `run_job` and `Fake { container }`
are kept; `start_fake` takes the fake model's extra settings, `seal`
is built on `run_job`, and `base_experiment` stays shared. The
cleanup's job list (`Made::jobs`) replaces `Made::job`, so the
agent-config guard reads the last job from it.
- Claude Code reader: main replaced the local harness name by
`spec::CLAUDE_CODE`; the reader version stays 0.4.0.
- fixture provenance, the fake model's model list, the e2e module list
and the architecture's trace kinds: both sides kept.
`needs.trace` now says that declaring it hands the kind the run's
system text and first message verbatim (`context_start`), which may be
the treatment under test, in the `Needs` doc and the helper README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Take main's release commit (core v0.17.0, schemas@0.14.0) into the run context branch. The one conflict is the contract index's versions table: main's core and schema versions are kept beside this branch's candler-evaluator@0.2.0, and BLESS_CONTRACT regenerates the table unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merge of main kept main's `start_fake`, which leaves `Made::real` to its caller, as the parity and agent-config guards do. The graded trace guard relied on the old `start_fake` setting it, so its cleanup ran an empty path and panicked with NotFound after both runs had passed. The guard now sets the cleanup's docker path itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Candler's purpose includes grading "traces and artifacts, fresh or already on disk, through pluggable evaluators". Until now an evaluator could only be handed artifacts. The wire had
context.traceandcontext.raw[], andneeds.tracewas a declared field, but nothing filled them, and a kind that declaredneeds.trace = truewas silently served no trace. A shell call's exit status was also missing from the trace, so a kind that grades agent behaviour could not tell a failed command from a successful one.This change lets a kind be handed any part a sealed run stored (its trace, its raw streams, its manifest) the same way it is handed artifacts, and records each shell call's exit status in the trace on both harnesses.
Changes
Trace
ToolResultgains an optionalexit, the sameExitStatusevery supervised process carries ({kind: code, code}). It is written only for a shell call whose harness stated a code, and is absent otherwise (denied, interrupted, timed out, or not a shell call).nullis refused.claude-code-stream-json@0.4.0): anExit code Nprefix on an error result givesN, and a plain success gives0. Claude Code reports some nonzero exits as success:grepwith no match,diffon files that differ, a falsetest. Such a result carries areturnCodeInterpretationkey and no code, and it gets no exit, so the trace never says 0 for a command that exited 1.opencode-export@0.2.0):metadata.exiton a completedshellcall gives the code.tests/fixtures/README.mdsays how to record them again.Serving the run
Needsgainsrawandmanifest, both booleans that default tofalse, so an existing plug-in'sdescribestays valid.traceis now honoured.trace.jsonl,raw/<stream>.jsonl.gz,manifest.json.RunContext.traceandRunContext.manifestare{path, abs, sha256}.evaluation.run_part_missing, never served empty.Store::raw_streamsis the one reader ofraw/. An entry there that is not a stream Candler writes refuses the context.context_digestadds a key for a part only when it is served, so the digest of every existing context, golden imports included, is unchanged.Python helper (
candler-evaluator, unreleased 0.2.0)RunContext.manifest, andServedFilefor the trace, manifest and raw streams.read_traceyields typed records generated fromnormalised-trace.schema.json, and refuses a file out of order as the Rust reader does (helper.trace_out_of_order).End-to-end
graded_run_sees_trace, runs one scripted agent on Claude Code and on OpenCode throughcandler runandcandler evaluate. The plug-in passes only if the trace it was served holds the scripted commands with their exit codes and the MCP call's{server, tool}. The guard is incontainer-e2e.yml's expected list.Breaking changes
RunContext.traceis a{path, abs, sha256}object instead of a bare path (the field was never filled before).needs.trace(orraw,manifest) for a run that lacks the part is now refused withevaluation.run_part_missing. Before, the trace need was silently ignored.raw/now refuses the context withcandler.internal.Hard parts
evaluator-protocol.mdstates this. Whether outcome reuse and refusal should instead follow each kind's own needs is left open.Not covered
signalvariant ofExitStatusis unused in traces, because no harness reports a signal.seqgaps, undeclared session, araw_refto an unlisted stream), and its docs say so.*.partialentries inraw/are skipped by the store's visible-name rule rather than refused.ExitStatus.codeis an unboundedint, while Rust's isi32.Observations
candler runrebuildscandler-gateway:latest, and the superseded image disappears.docker ps -aqequality can flake on a machine where other containers start or stop during the test.Checks
On the tip:
cargo fmt --check, clippy with-D warningsandcargo docpass, andcargo nextest run --workspaceruns 738 tests, all passing (33 skipped). The fourguard_cli_e2eguards pass locally under--run-ignored only. The helper'spytest,ruffand thegen_models.pydrift check pass.🤖 Generated with Claude Code