Agent evaluations
cargo xtask agent-eval runs a real Claude Code or Codex CLI session on a small Rust task inside srt, with or without Symposium, then grades the code the agent left behind and checks what Symposium did along the way. The approved design and its precise rules are in the skill evaluation RFD and its reference. This chapter records how that design maps onto the repository.
The runner calls a model, so it never runs in CI. Its model-free parts do: task validation (--check-tasks) and the crate’s tests.
Where things live
| Path | Holds |
|---|---|
symposium-eval/ | The engine, as a library crate (publish = false). |
xtask/ | The cargo xtask agent-eval entry point. It forwards its arguments to symposium_eval::run and holds no evaluation logic. |
evals/ | Tasks, plugins, and fixture crates. Data only, excluded from the Cargo workspace. |
results/ | Retained batches, one directory per run. Machine-local and ignored by git. |
Trial run directories are created outside the checkout. srt denies the whole checkout to the agent, since it holds evals/ and the hidden tests, so a trial cannot live inside it. Only finished results are copied back to results/.
The RFD places the runner in xtask. The command is unchanged, but the code lives in its own crate so that its tests run with cargo test -p symposium-eval and later evaluations can build on a library rather than on a grab-bag binary.
Modules
Each module arrives with the RFD step that needs it:
| Module | Responsibility | RFD step |
|---|---|---|
task | task.toml, the one-test-per-checks/-file rule, --check-tasks | 1 |
run | Batch and Trial directories, the generated srt policy, process-tree cleanup | 2 |
client | ClientRunner and the Claude and Codex adapters | 4, 7 |
grade | The grading copy and its checks | 1 |
expect | Skill, hook, and sync expectations | 4 |
report | result.json, the batch manifest, benchmark.json | 4, 5 |
Task parsing
cargo xtask agent-eval --check-tasks validates every entry of evals/tasks/ without running an agent. It is the RFD’s task-authoring gate and runs in CI, needing no model or API key. A missing or empty tasks/ is an error, so a broken checkout cannot pass as “checked 0 tasks”.
task.toml is parsed in two layers, following Cargo’s Cargo.toml handling. task::schema mirrors the file, with Option where “absent” and “empty” mean different things (used). Task is the validated form: names and patterns are checked while deserializing, and the cross-field rules run afterwards, collected into one TaskErrors so every problem is reported at once. Unlike Cargo, unknown keys are errors: Cargo warns because it promises compatibility across versions, while a misspelled key here would silently make no claim.
- Names. Task, plugin, fixture, skill, and check names become directory or file names, so
DirName<marker::…>accepts only one portable path component: no separators or Windows-forbidden characters, no control characters, no trailing dot or space, and none of the device names Windows reserves (the list Cargo rejects for package names). Hook names never touch the filesystem, soHookNameonly requires text. - Editable patterns are compiled with
globsetwhen the task loads, with*never crossing/, so an unusable pattern is an authoring error rather than a grading failure. Each pattern starts with a literal directory or file name, so**and*.tomlare rejected. - Protected files.
Cargo.tomlandCargo.lockat any depth, anything under a.cargodirectory,rust-toolchainfiles, everybuild.rs, andrustfmt.tomlor.rustfmt.toml(rustfmt reads one in every directory above a source file) change how Cargo builds the crate, run code while it builds, or change how the fmt check judges it, so grading always takes them from the starter (task::protected). Aneditablepattern that matches one in the starter is rejected, and the starter must ship aCargo.lock, since grading runs Cargo with--locked. - Hidden checks.
checks/must hold at least one.rsfile, and each file exactly one top-level, plain#[test]function that is synchronous, takes no parameters, and has no generics. Duplicate#[test]attributes are rejected because Rust registers a test for each attribute. The test declarations are checked on the source withsyn, since a check cannot compile against a starter that lacks the API it calls. The starter cannot have its owntests/<check>.rs, where grading places the check, and a check’s file name must work as a Cargo test target name (an identifier, with-allowed). At file scope and on items inspected by the scanner (including items in inline modules),cfgandcfg_attrare rejected so test discovery does not depend on compilation conditions. The scanner also rejects#[ignore]on tests, unsupported attributes and derives on inspected items, item macro invocations at those scopes, out-of-line modules, and tests inside modules. Function bodies are not inspected: conditional compilation inside a test or helper body is permitted, for example to select platform-specific assertions. The rule constrains which tests exist, not which assertions their bodies execute. - Directories. Task,
starter/, plugin, fixture, andchecks/directories must be real directories; a path that cannot be inspected is reported as an I/O error with its cause, separately from a structural problem. Unlike skill installation, which follows symlinks, a symlink is rejected here: these contents cross into trials and grading, which must see exactly what the checkout holds. Every entry oftasks/is reported, including stray files and names that are not UTF-8.
The crate exports only run; everything else is pub(crate) until another crate needs it. Evals holds the evals/ layout so no other code joins those paths itself.
Grading
Grading never runs a submission in place. grade (in grade/mod.rs) builds a grading copy in a private temporary directory, laid out as in a trial (project/ beside fixtures/<name>/, so path dependencies resolve): a fresh copy of the starter and fixtures, with only the submission’s editable files taken from it.
- Within
editable, the starter’s files are removed before the submission’s are copied in, and so is each editable directory that leaves empty, so a file the agent deleted stays deleted and a directory can become a file or the reverse. A submitted file whose place is still held by trusted content (a protected file inside a directory it replaces, or the same name in another case on a case-insensitive filesystem) is not imported and is reported instead. - The submission is listed recursively without following links (
tree::walk). Files and directories are both imported, so an empty directory survives grading. A link or special file at, inside, or above an editable root (a pattern’s literal prefix, such assrc) invalidates the submission; anywhere else it is only reported. - Protected files are never imported, even when
editablematches them. Their names compare without regard to ASCII case on every platform. - Every other change is reported as an outside edit (added, modified, deleted, or type changed), sorted by path; a directory with contents is reported through them, and an empty one by itself; files are compared in fixed-size chunks, so a large one costs time, not memory. The top-level
target/is ignored, since the agent runs Cargo in its project. - The starter and fixtures are trusted, but a link or special file in them is still a task error rather than something to copy.
Commands run through a grade::process::Backend: grading decides which command runs and what its result means, and the backend decides how the process starts and stops, so the srt backend can replace Local without changing grading policy. Local contains the whole process tree: on Unix a process group, killed at the deadline and again once the command exits; on Windows a kill-on-close job object the command is assigned to as it starts, closed on every path. A guard owns each command from the moment it starts, so every return path stops and reaps it, and no wait is unbounded. Full output streams to log files while a bounded tail stays in memory, and a failure to start, contain, stop, or collect a command is an infrastructure error. GradeLimits caps each command and all of grading’s commands together: a command gets the smaller of its cap and the budget left, and only time spent running commands is charged. File work (copying, listing, comparing) is not counted; it gets entry-count and size quotas when grading accepts untrusted submissions.
Cargo runs in the grading copy with --locked --offline, a private target directory and CARGO_HOME, and incremental compilation off. Its environment is built, not inherited: only what the toolchain (including the RUSTUP_* pair), the linker, and temporary files need is passed through, so no unapproved Cargo or Rust override reaches a grade. $CARGO, with rustc and rustdoc from beside it, keeps grading on the toolchain running cargo xtask. A known gap remains: Cargo also reads .cargo/config.toml in every directory above the grading copy, which can include the developer’s home; the srt backend’s controlled run directories close it. Before anything is imported, cargo metadata runs on the trusted starter: it checks the lockfile, and the build scripts it reports at custom paths (package.build) become protected for the import. Cargo exits with the same code for a broken lockfile as for a compile error, so this preflight is what tells the task’s failures from the submission’s. That first run must report no test target named after a hidden check: metadata does not report harness, so a starter declaring one with harness = false would look like the placed check later while its test never ran under libtest. Each hidden check is then copied into the trusted starter at tests/<check>.rs, and a second cargo metadata must report each one as the only test target of its name, built from that file, since a manifest can turn off test discovery or point a target elsewhere and cargo test --test <check> would run some other test; the import keeps those paths the starter’s. Changes are measured against the starter as evals/ holds it, so the placed checks never count as the submission’s. The checks then run on the grading copy in order: cargo build --locked --offline, cargo test --lib, each hidden check in name order, and cargo fmt --check when the task sets fmt_check. Only a failed build skips the later checks. A hidden check is one step that needs three signals to agree: its listing (--list --format terse, plain and with --ignored) shows exactly one test and none ignored, its run exits successfully, and its last summary reports exactly one passed test and nothing else. Exiting successfully without that summary is reported as unconfirmed. A check that does not compile against the submission fails it; any other listing is the task’s or the runner’s error. Code under test can print anything, so this is defensive validation rather than an authentication boundary: an exact forged summary followed by a successful exit cannot be told from a real one. Every command runs with CARGO_NET_OFFLINE=true, since cargo fmt has no --offline flag, and a task with fmt_check has cargo fmt --version checked before the import, so a missing rustfmt is the machine’s failure rather than the submission’s. A failure or deadline Cargo reports is the submission’s outcome, a step in the grading report; a failure to start, supervise, stop, or collect the command is an infrastructure error.
Invariant: only repository-owned code runs outside the srt backend. Until grading runs through srt, --check-tasks is the only caller: it lays each task’s solution/ over a copy of the starter (an entry of the other type is replaced, so a solution can turn a file into a directory or the reverse) and imports it like a submission, so a solution cannot pass by changing a file an agent may not contribute. A solution with a link, or with any outside edit, is a task error.
The tasks
evals/ holds the RFD’s two tasks:
formatting(regression) uses theformat-on-stopplugin: therust-formattingskill and aStophook that runscargo fmt. Its hidden check callsdouble, andfmt_checkis set.store-durability(capability) depends onfixture-store, a crate that exists only in this repository:Store::putbuffers writes, and onlyStore::flushwrites them to disk. Thefixture-storeplugin carries the skill that states the rule. Its hidden check saves settings, opens a newStoreat the same directory, and reads them back, so a submission that never flushes fails it.
Both have a solution/, so --check-tasks shows each hidden check passes against a correct submission. Each starter ships a Cargo.lock generated by Cargo in the trial layout, where fixtures/ sits beside the project. plugin validate reports fixture-store as missing from crates.io, which is the point; pass --no-check-crates.
grade::repository_tasks grades these tasks the ways RFD step 1 asks: the solution passes, dropping the flush fails the hidden check, and extra unit tests, an edited Cargo.toml, or an edited fixture beside the project do not change the grade.
Trials
A Batch is one run of the runner: <eval-root>/<batch>/, holding the staged tools and its trials. A Trial is one agent session, created only by Batch::create_trial and carrying its batch, with a fresh copy of the starter, the fixtures, and, for a Symposium trial, the task’s plugins as its registry.
- Fresh. The batch and trial directories are created with
create_dir, so one that already exists is an error. A restarted run can never inherit an earlier attempt’s home, project, or evidence. A trial whose setup failed keeps its directory and its number is not retried;srt.jsonis written last, so a trial without one never ran. On Unix the batch directory is0700, as Nix creates its build directories. - Paths. A batch name is a
BatchName, one portable path component like a task name, so it cannot leave the evaluation root. The evaluation root must be absolute and is kept both as given and resolved. - Machine.
Machine::newtakes the checkout and the toolchain sysroot (rustc --print sysroot), which must exist and are resolved, since on Linuxsrtignores adenyReadfor a missing path. The toolchain must holdbin/cargoandlib/rustlib, so~/.cargoor a home cannot be passed by mistake and reopen the credentials and binaries beside it. It always denies the platform’s user data roots and the current user’s home, which can sit outside them (/var/lib/<service>); a caller’s roots are added to those, never in place of them. On Linuxsrtmatches a read rule by the name a path is reached through, not its target, so each user data root, the checkout, and the evaluation root is denied both as given and as resolved. - Policy.
Policy::for_trial(trial, machine, api_host, api_key)takes the evaluation root from the trial’s batch rather than from the caller, so the root it denies is the one the trial lives in. It refuses an evaluation root inside the checkout and a toolchain inside either, sincesrt’s precedence would let one rule silently undo the other. It denies the user data roots, the evaluation root, and the checkout; reopens the trial’s read-onlyfixtures/andbin/,tools/common, the toolchain, and, for Symposium only,registry/andtools/symposium; allows writes toproject,home,cargo-home,tmp, andevidence, so fixtures and the registry stay read-only; and allows network access to the API host only. The API key is masked (credentials.envVarswithmode: "mask", which needsnetwork.tlsTerminate): inside the sandbox its variable holds a sentinel, andsrt’s proxy, outside the sandbox, substitutes the real key only into requests to the API host, over TLS it terminates and re-encrypts to a verified upstream. So neither the client nor a tool the agent starts can read it, from its own environment or another process’s/proc/<pid>/environ.srtpoints the sandbox’s trust variables (NODE_EXTRA_CA_CERTS,SSL_CERT_FILE, and others) at a bundle of the system roots plus its per-run CA, whose private key never leavessrt’s memory; each client’s smoke test has to show it trusts that bundle. Every entry is written as{ "path": ..., "literal": true }, so no path is read as a glob. It never reopens the trial directory as a whole: srt 0.0.81 rebinds anallowReadread-only over the writable directories inside it, and then cannot create its guard files (such asproject/.gitconfig). The writable directories are readable anyway, sincesrtbinds them read-write. srt 0.0.81 also refuses a settings file withoutfilesystem.denyWriteandnetwork.deniedDomains, so both are written, empty. - Temporary files.
srtlets every sandbox write/tmp/claudewhatever the policy says, and adenyReadof it does not hide what is already there (sandbox-runtime#654, #611), so the policy alone cannot keep one trial out of what another left there. The runner does not rely on environment-variable overrides to isolate it; the launcher closes it instead (below).CLAUDE_CODE_TMPDIRas Claude Code’s own setting belongs to the Claude adapter. - Staging.
Batch::stage(name, tool, audience)copies a tool into the batch once, before any trial is created: intotools/common/for every trial, ortools/symposium/for Symposium trials only. AToolis oneExecutable(a native client, ornode; a link such as~/.local/bin/claudeis resolved and its target copied) or aNodePackage, a package directory run through anentry, a regular file inside it whoseenv nodeline finds the stagednode; a missing or unusable entry fails staging rather than the first trial that runs it. A package is copied exactly (grade::copy_exact),target/included, since the grading copy’s rule thattarget/is build output belongs to submissions, not installed packages; links and special files are still refused. Tools are copied, not linked, sincesrtmatches read rules by the name a file is opened under, so a link into the developer’s home would not run. Each trial’sbin/then links every tool its configuration may run (only on Unix: elsewhere creating a trial that needs a link fails, rather than leavingbin/empty), so a baseline trial’sbin/has nocargo-agents; the policy keeps it from readingtools/symposium/too, so either layer alone stops it. Which client is installed, and how, is the adapters’ to say. FIXME: record each staged tool’s hash in the results. - Symposium setup.
Trial::set_up_symposium(client, backend, env, deadline)writes the trial’s~/.symposium/config.toml(auto-syncon,hook-scope = "global",auto-update = "off", both built-in registries off, and one[[registry]]namedevalat the trial’sregistry/), serialized from typed data so no path can break the TOML, then runs the stagedcargo-agents init --add-agent <client>throughbackend, inside the trial’s sandbox.initwrites the config’s agent and registers hooks in the trial’s home without syncing; global scope matters because project-scoped hooks exist only after a sync, which would install skills before the behavior under test. A baseline trial is refused.Clientnames the two clients and the nameinittakes for each. Every trial’s project starts with an empty.claude/:srtwrite-protects.claude/commandsin its working directory, and where.claude/is missing it protects the whole directory instead, so a sync could not install a Claude Code skill. - Pre-launch checks.
Trial::check_before_launch(client, env)runs just before a client starts, on the host, which is what the sandbox sees. Every trial must have no skill in the client’s skill directory, in the project or the home, and nothing in the client’s machine-wide managed-settings directory (/etc/claude-code,/etc/codex). A baseline trial must also have nocargo-agentsin any directory ofenv’sPATH, no~/.symposium, and no hook or MCP configuration file that namescargo-agents. A failure isRunError::NotReady, naming the path and the check (Unready).Client(run/client.rs) holds where each client keeps these files. - Exploratory mode. Without
srt,Trial::exploratory_arguments(client, machine)returns the arguments that confine the client to its own sandbox. For Claude Code it writesclaude-settings.jsonat the trial root, outside every writable directory since Claude Code reloads a changed settings file, and returns--settings <file> --permission-mode acceptEdits. The file turns the sandbox on strictly (failIfUnavailable, no unsandboxed retries, no network) and gives commands the trial’sReach, the same read and write rules as itssrtpolicy (Reach::for_trialbuilds both), plusblockReadsOutsideWorkingDirectoriesfor the file tools. Claude Code reads those paths as globs, so a path with*,?, or a bracket is refused. Those guarantees need Claude Code 2.1.285 or later: only from then does disabling unsandboxed retries through--settingsstop a repository’s settings from loosening the sandbox, so the client preflight must refuse older versions. For Codex it returns--sandbox workspace-writewith the trial’s cargo home, home and evidence assandbox_workspace_write.writable_roots, passed through--configas a TOML array;--add-dirdoes not make a root writable on some versions (openai/codex issue 18448). Its reads stay open. In both clients hooks run outside the sandbox, and the API key is in the client’s environment, which is why exploratory results are never compared. Setup runsinitthrough the local backend. - Environment.
Trial::environmentis the whole environment of a trial’s processes:HOME,PATH,TMPDIR,CARGO_HOME,EVAL_EVIDENCE_DIR,SYMPOSIUM_HOOK_TRACE(evidence/hook-trace.jsonl), and the API key.PATHis the trial’sbin/, the toolchain’sbin/, then/usr/binand/bin. The real key is set onsrtonly, which masks it. The key’sDebugnever prints it, and neither doesInvocation’s, which lists the environment’s names only, since the key travels on as a plain value. - Launching (Linux only).
Srtnames the Node that runssrtand itsdist/cli.js, sincesrtfinds Node throughenv node, which the trial’sPATHmay not satisfy.Srt::preflightruns before a batch, so an unsuitable machine fails setup rather than the first trial: Node must be 22.12 or later,srtthe pinnedSRT_VERSION, andtruemust run through the whole stack (outerbwrap, Node,srt, a policy file with the same network proxy and TLS termination as a trial’s), which provessrt’s own dependencies and the nested namespace without this code listing them. A tool that cannot start, answer in time, or exit successfully is reported by name, apart from one that reports the wrong version.Srt::for_trialrefuses a trial whosesrt.jsonhas not been written.Sandboxedis thegrade::process::Backendfor one trial: it wraps a command assrt --settings <run>/srt.json -- <program> <args>and hands it toLocal, which keeps the deadline, kills the process tree, and logs.srtruns the command throughbash -cwithsrt’s own environment, so the trial’s environment is set onsrt. An outerbwrap --dev-bind / / --dir /tmp/claude --bind <run>/tmp /tmp/claudegives each trial its own/tmp/claudeand changes nothing else;srtbuilds its sandbox inside, with its own PID namespace, so killing the tree reaches processes that left the process group. Three ignored tests run realsrtunder the generated policy: one trial cannot see another’s temporary files, the real API key appears in no environment the sandbox can read, and a process that callssetsidstill dies at the deadline. Run them on Linux withcargo test -p symposium-eval -- --ignored. - Smoke test.
run::smokeis RFD step 2’s no-model smoke test under realsrtand the generated policy, oneshscript per trial that stops at the first failed check and names it. Each trial builds and tests its project offline; cannot read a home (a shell profile, and~/.cargo/bin/cargo-agents, also run by absolute path), a hidden check, a solution, the checkout’s manifest, or another trial; and leaves its fixtures, its policy, the stagedcargo-agents, the registry, and another trial’s project unchanged. Only a Symposium trial can run the stagedcargo-agents. The home is a decoy the test creates and adds to the denied user data roots, so the test does not depend on what the machine’s home holds; the machine’s own files are checked too when they exist. Paths reach the script as arguments, so any name works. Writes are checked on the host, not inside the sandbox, becausesrtcovers a read-denied directory with an empty writable tmpfs, so a write there succeeds and is thrown away. Its tools are staged the way the runner stages them, and run by name from each trial’sbin/: the machine’snode, a small npm-style package run through that stagednode, and a stand-in forcargo-agents, which a baseline trial cannot find on itsPATH. Staging and launching the real clients andcargo-agentswith--versioncomes with the adapters. - macOS. The RFD makes enforced mode the default on macOS too, but there trials would share
/tmp/claude, and with no PID namespace a process that leaves the process group outlives the deadline. Until both are solved, the runner has no macOS backend. - Tests.
Policy::can_readandcan_writemodelsrt’s documented precedence (anallowReadreopens a less specificdenyRead, never a more specific one), after Codex’sWritableRoot::is_path_writable. The isolation invariants are tested through them: a trial cannot read another trial, the checkout, or a home; only a Symposium trial readstools/symposium; a trial writes only its working directories. The policy tests never read the developer’s home or the platform’s roots:Machine::with_exact_rootstakes them as arguments. The model leaves outsrt’s built-in rules, which is exactly where the/tmp/claudegap lives, so these are the guarantees the policy is designed to give; only the no-model smoke test undersrt(RFD step 2) shows they hold, andrunlands with that caller.
run::adversarial adds real-sandbox tests. Concurrent trials write the same /tmp/claude filename, then finish separately, checking both file isolation and independent process cleanup. A local HTTPS fixture verifies that the proxy substitutes a fake API key only for the allowed host, blocks a different hostname for the same server, and leaves the real value out of sandbox output. Symlinks created inside the project must not expose hidden solutions or another trial, or permit fixture writes. Failed and timed-out setup must release a detached child’s file lock, retain evidence, and reject reuse of the trial number; these cases need setsid and flock. The HTTPS test also needs openssl and curl; it generates a temporary certificate and never contacts a model provider. Run these with cargo test -p symposium-eval run::adversarial -- --ignored.
Client sessions
client::execute(runner, backend, trial, env, prompt, skills, deadline) runs one session and never returns an error: whatever goes wrong is how the session Ended, and the Execution also carries each skill’s Load. A ClientRunner only builds the client’s Invocation and reads its transcript, once, in ClientRunner::read, which returns a Reading: the completion (or why there is none, as Unusable) and the loads. The Backend sandboxes, logs, and stops the process, so a stand-in backend tests every ending without a client. A timed-out transcript is read too, since it can still show a mismatch or a load. A transcript is not read when the client never started, when the backend lost hold of it (Unsupervised), or when its output stayed open after the deadline, since whatever still holds the pipe may still be writing; its loads are then all Unknown.
- Transcript. The client’s standard output, which the backend writes to the trial’s
session/, such assession/claude.stdout.log. The runner writes it from outside the sandbox, and the policy gives the trial no access tosession/, so the agent cannot alter it. - Client failures. Only
Failedis the client’s: a reported error, which wins over the exit status since its message says more, then a failed exit (Exited), then a successful exit without a completion event (NoCompletion), so exiting 0 is never enough. - Not the client’s.
NotLaunched(the program could not start: a setup failure, never a trial),Unsupervised(the runner lost hold of a started client), andUnreadable, carrying aTranscriptError:Readwhen the runner could not read the transcript,Malformedwith a line number when an event the adapter needs is not in a shape it knows. An unreadable transcript decides the ending before the exit status does, so a changed event format is never counted as a failed session.Completion::Missingis only for a transcript the adapter fully read.Mismatched, carrying aProvenanceError, is a transcript that is not this session’s, or comes from a client other than the one checked before launch. The client launched, so it is an isolation exclusion, not a setup failure, and it outranks a timeout and the exit status.Unusableseparates the two kinds of problem. - Deadlines.
TimedOutstands once the runner killed the tree.Local::runreturns a timeout even when collecting the output then fails, keeping that problem inFinished::after_deadline. A session keeps it inEnded::TimedOut, and a grading step inOutcome::TimedOutwith its causes, so the report says why the output may be incomplete while still counting the submission’s timeout. A preflight timeout keeps it as the source ofGradeError::TimedOut.
Claude Code
client::claude::Claude is one session. It runs <trial>/bin/claude -p --output-format stream-json --verbose --include-hook-events --session-id <uuid> --model <model>, then its sandbox arguments, then -- and the prompt, so a prompt starting with - is not read as an option. The session ID is a fresh UUID, which names Claude Code’s own copy of the session (<id>.jsonl under the trial home’s .claude/projects/) and comes back on init, on result, and on most messages. --include-hook-events adds hook events other than SessionStart, such as Stop; they stay secondary to Symposium’s hook trace. Claude::enforced passes --permission-mode bypassPermissions, since srt is the boundary; Claude::exploratory builds its arguments with Trial::exploratory_arguments, so no caller supplies flags. A test checks that neither mode passes a flag that would invalidate a trial (--bare, --safe-mode, --disable-slash-commands, --restricted, --setting-sources, --no-session-persistence, --include-partial-messages; see the Step 4 research notes).
client::claude::transcript reads the transcript once, a line at a time. Each line is first decoded into a shallow envelope: its type, with its other parts (subtype, session_id, a message’s payload, a hook event’s fields) borrowed raw. Message payloads and hook fields are not decoded again; system/init and result, which the ending rests on, are then decoded into their typed forms and must have the shape the runner expects. Only the tool call record decodes a message’s payload, so a message Claude Code reshapes damages the evidence read from tool calls (skill loads and tool activity), never the ending. A system event without a string subtype is skipped. An init that does not parse leaves the transcript Malformed, not unattributed. Reading goes on past a line that does not parse, so a later load or mismatch still shows; the first malformed line is the one reported, and a mismatch outranks it. The last result event decides the Completion: is_error means Reported, with its result text if not empty, else its errors joined, else its subtype. Only is_error is read, because an API error arrives with subtype: "success". Other event types are skipped, so a new kind of event leaves the transcript readable; a line that is not JSON, or a result without is_error, is Malformed. The tests replay transcripts recorded from Claude Code 2.1.316 in src/client/claude/transcripts/, with personal details removed.
client::claude::version::preflight runs the staged claude --version before any trial, with a scratch directory as its home and the batch’s staged tools first on PATH (Batch::tools_path), so an npm entry’s env node finds the staged Node as it does in a trial. It refuses a release older than MINIMUM (2.1.316, the oldest the command line and recorded transcripts were checked against), a prerelease, which comes before its release, or output it cannot read. That is a setup failure (RunError::ClaudeVersion), never a trial’s. Exploratory trials need 2.1.285, which the floor already covers.
Claude holds the version preflight found. Every system/init event must carry the requested session ID and that claude_code_version, or the session is Mismatched (Session or Version). Every result must carry that session ID too, and come after an init. A message naming another session is a mismatch. The SDK allows a user message to name no session; its tool results still count, since a result only answers a call that a message of this session registered, while an assistant message naming none makes the loads Unknown. A result before any init is Mismatched (Unstated), since nothing yet says whose it is. A transcript that stops before init is only Completion::Missing.
A Reading gives a Load for each InstalledSkill (its name and the SKILL.md sync installed, possibly under <name>-<hash>/), whatever the ending, since a skill loaded before a deadline was still loaded. Claude’s adapter decodes each message once, into client::claude::calls::Calls: every tool call with its result, paired by tool use ID, and whether anything could hide one. It knows nothing of skills; a Matcher interprets that record afterwards, so other tool-call evidence reads the same record rather than decoding messages again. A tool use ID used by two calls, or answered twice, attributes no result, since IDs are unique and a repeat is malformed evidence. Each call keeps the cwd in force when it was made, so an init cannot move a call made before it. A message’s blocks are read flat rather than as a tagged enum, so a tool result’s body is skipped unread; a call’s input is kept as raw JSON for the matchers to decode. The record keeps calls only while the messages holding them total 64 MiB; past that it counts as damaged, and a call it drops still makes its ID ambiguous. A malformed line is described by what is wrong and where (Malformation), never by quoting it, since the client wrote it and it can be megabytes.
A Reading also carries HookEvidence: what the transcript, which the agent cannot write, says about the hooks the client ran. A client whose output does not report hooks is Unsupported; codex exec --json drops its hook events. Each ClientRunner says what an unread transcript gives (unread_hooks), so a session that never started still reports its client’s capability. Claude Code reports them with --include-hook-events as system events, hook_started then hook_response, the SessionStart ones before init and the Stop ones before result. client::claude::hooks takes each response with a readable event and outcome as a HookRun, with or without its start, since a response names both; one whose ID or name cannot be read is kept but cannot pair; a start left unanswered is NoResponse. Claude Code does not promise unique hook_ids, so a start pairs with a response by ID, name and event together, and a repeated ID damages nothing. The outcome decides (success, error, cancelled, or Other, which decides nothing); the exit code is detail, never taken for 0, and one that cannot be read is left out rather than the run. Each adapter lists the events it reports every run of in HookRuns::observed, Claude Code’s being SessionStart and Stop; HookRuns::complete promises only that nothing hid a run of one of them: every line was read, the session reached its result, and no hook line of this session was unreadable. Claude Code does not report every event, so the absence of an Other event never decides anything. A hook line in an unexpected shape damages only the hook record, never the ending; a system event whose subtype is not a string is skipped, as is hook_progress. The hook fields are borrowed raw from the line’s single decode, so hook output is skipped unread. What the record keeps is bounded at 64 MiB, each entry charged its size as well as its text, so empty fields cannot add entries for free; past that it counts as damaged. Only hook_started and hook_response are checked for their session; other hook events are skipped first.
A Reading also carries ToolActivity: the file mutations and shell commands the transcript shows the agent asking for, as facts to cross-check evidence with, not proof of what reached the disk. client::claude::activity reads them from the call record after the pass, as a list rather than through a Matcher, since each call is its own fact. Write and Edit name their file in file_path, NotebookEdit in notebook_path, and Bash, PowerShell and Monitor run a command; the recorded tools_used transcript pins all but the last two, which follow Claude Code’s documented inputs. A call of one of these without a command that can be read makes the record incomplete, since no recording shows a shape that runs nothing. A mutation’s path is kept as reported and resolved by name against the cwd the call was made in (client::paths::lexical_absolute), never against the disk, where the file may be gone and links may have moved; one that cannot be read is kept as ObservedPath::Unreadable, since it could have been any file. A command keeps its first 4 KiB, cut on a character boundary, and its full length. A call’s result is its tool result: success, an error (which is also how a denial arrives), or missing. An omitted is_error means success; one that is present but not a boolean, null included, leaves the result unread. ToolActivity::complete holds when nothing could have hidden a mutation or command: the call record was not damaged, the session reached its result, no such call came from an unscoped message, and every one was read well enough to keep; only then does the absence of one say anything. Claude Code also reports a mutation’s applied result in tool_use_result; it is not read yet. client::claude::loads is the matcher that says which skill a call would load. It detects two routes: a Skill call naming the skill (a plugin’s <plugin>:<skill> matches on its last part), and a Read whose path, resolved against the cwd the init reports (the project until then), is the installed SKILL.md, compared both resolved by name (client::paths::lexical, which never drops a leading ..) and with links resolved, since macOS keeps temporary directories under a link. A result that is not an error is Loaded; an error, which is also how a denial arrives, is Attempted. Shell commands such as cat SKILL.md are not detected. Calls inside a subagent count, since the skill still reached an agent on the task. Session IDs are required on init and result; a message naming another session is a mismatch, and an unscoped user tool result may answer only a call a message of this session already made. A tool’s input is read only once the tool is Skill or Read, so an unfamiliar tool changes nothing. Blank lines are skipped. A last line cut off mid-write is malformed like any other; a timeout outranks it in the ending anyway. A skill not yet loaded is Unknown when the stream could hide its outcome: a line that does not parse, another session’s message or result, a call without its result, a loading call without its input, or no result event of this session; otherwise it is NotObserved. Recorded transcripts cover the Skill route, the Read route, and a failed Skill call. Each was recorded from Claude Code 2.1.316 and reduced by hand to remove personal and account-specific data while keeping real event shapes, with the session, project and home replaced; a test checks that no fixture names a home, another session, or an MCP server, which is where an account’s connectors appear. Tests edit fixtures through client::claude::fixtures, whose helpers find lines by event where they can and fail when an edit changes nothing. Re-recording needs a tool that records into a temporary file and keeps only allowlisted fields; it is left for when the version floor next moves. A line longer than 8 MiB is Malformed and skipped without being held, since its size is the client’s to choose; reading goes on past it, so a later mismatch still outranks it. On Unix, a stand-in claude replays them through the real Local backend as the session the runner requested, so the command line, supervision, deadline and reading are tested together without a model: a completed load, a client that ignores --session-id, a timeout that keeps its load, an API error whatever the exit, and a stream with no result.
expect::crosscheck compares what each piece of agent-writable evidence claims with the records from outside the trial, and returns every Concern it finds: a Contradiction, when a record says otherwise, or an Uncertainty, when the evidence could be wrong and nothing settles it. A concern makes the expectation it bears on inconclusive; no concern means only that none was found, never that the evidence is proven. A gap in the transcript weakens only a claim that something happened: evidence that it did not already fails, and stands unless the transcript shows the opposite. The hook checks differ by what the evidence describes. The hook trace and the client’s report of SessionStart describe the same invocation, so each contradicts the other (session_start_trace). A sync record is written inside SessionStart, but a sync can finish before the hook fails and the hook can succeed after a sync fails, so only a SessionStart that never ran contradicts a record (sync_record). A plugin hook’s record is written under Symposium’s dispatch of its event, which can fail after the plugin’s hook succeeds, so likewise only an event that never ran contradicts it (plugin_hook_record). Each run dispatches the hook once, so a complete transcript showing fewer runs of the event than the hook’s readable records (hooks::record_count, a lower bound) contradicts the records, whatever they say (ExtraHookRecords): an extra record was written by something else, such as a script the agent ran, whose text names no protected path. A client that does not report hooks raises no concern, and neither does an event the adapter does not observe. activity checks each protected artifact, one file (the hook trace, the hook records) or a tree (the sync records, the installed skills), against the tool activity: a mutation that succeeded is a contradiction; one that failed or has no result, one the transcript cannot place, one matching only if case is ignored, an incomplete record, a command naming the artifact by its path in either slash form or a variable pointing into it, and a command too long to keep whole are uncertainties, each kept with the call’s result. A bare name such as .claude/skills is not matched, since harmless commands use it. A ProtectedRoot spells the artifact under every name the batch has for the evaluation root and reads nothing from disk, since every directory below that root is the agent’s to replace; the reported path is never resolved on disk either. A relative path, an unrecognized variable, a glob, a script or other shell indirection in a command, and a write through a link the agent made, are not seen. config makes each config change a concern for every expectation: each watched file can make the client or Symposium run a command outside the agent’s tool calls, and such a command can write any evidence.
Expectations
expect decides a task’s [expected] assertions as a Verdict: Pass, Fail, or Inconclusive when the evidence cannot decide, never quietly turned into either. expect::skill_use decides used and not_used from each named skill’s Load by the RFD’s table: Loaded passes used and fails not_used; Attempted and NotObserved fail used and pass not_used, since an attempt that failed or was denied never delivered the content; Unknown is inconclusive for both. Each decision keeps its Load, so a failed attempt is still reported.
expect::installed::skill_installs decides installed and not_installed against the client’s skill directory. Sync installs a skill as a copy of its source directory named after the skill, or <name>-<8 hex> when two sources claim the name, and marks it with .symposium and a .gitignore. A skill is installed when a marked copy holds what its source in evals/ does, read as sync reads a tree: links followed, and a broken link, a link back into a directory being read, or anything neither file nor directory left out, so a linked file in a source matches the real file sync copied. The walk is the checker’s own rather than tree::walk, which never follows links, so it does not share a mistake with the copy it checks. Files are compared by size first, then a chunk at a time, since the agent chose the copy’s size. An unmarked directory is not Symposium’s, and a link in the skill directory is not a copy. A <name>-<hash> directory counts only when its SKILL.md names the skill, since sync names a copy after that name and another skill may be called <name>-<hash>. The name is read with serde_yaml_ng, as Symposium reads it, so comments and block scalars agree; a directory whose SKILL.md is missing or names nothing is unidentified, which makes the assertion inconclusive unless another copy settles it. Each decision keeps its InstallEvidence (absent, matching, differing, present but not compared, unreadable, unidentified, or no source) and the verdict follows from it: a copy that differs fails installed, as the RFD reads a mismatch as not installed; a marker or copy that cannot be read, or a skill no plugin of the task provides, is inconclusive. An entry that cannot be inspected is passed over rather than ending the scan, so it cannot hide a copy that settles the assertion. A hashed copy’s SKILL.md is opened through expect::file, since the agent can write there: no link followed, regular files only, and a pipe cannot block it.
expect::sync::sync_record decides whether Symposium recorded a successful sync, which it does only after one succeeds, as <dir>/state.json under Trial::sync_records(). The trial’s environment is built whole, without SYMPOSIUM_HOME or XDG_*, so that is the trial home’s .symposium/cache/workspaces; the runner lists its directories rather than copying Symposium’s hash. The reader is the checker’s own, strict and typed, not Symposium’s WorkspaceState, whose loader reads an unreadable or malformed file as “never synced”. It needs only "last-sync", present and either null or an object with a root, and ignores what Symposium adds. The agent can write under the home, so the reader follows no link from the home itself down, reads only regular files, and refuses a record over 1 MiB. A record whose root is the project, compared with links resolved, is Recorded and settles it; a root that is relative or no longer resolves could have been the project, so it counts as unreadable; otherwise anything it could not read makes it Unknown, which is inconclusive; otherwise it is NotRecorded, which fails, since check_before_launch requires the trial to start with no records directory at all (Unready::SyncRecord). A Linux test runs the real cargo-agents hook claude session-start in a trial under srt and reads its record with this reader, so a change in Symposium’s format fails there loudly.
expect::trace::session_start decides whether the client’s SessionStart hook ran and succeeded, from the trace Symposium appends to SYMPOSIUM_HOOK_TRACE (Trial::hook_trace()): one JSON line per hook call that reached a response, with its event, agent and exit_code. A call that failed before responding leaves no line. The reader needs only those three fields, holds at most 8 MiB of a line through jsonl::next_line, the bounded line reader it shares with the transcript, reads at most 64 MiB of the whole trace, checked before reading and again while reading in case it grew, and follows no link. A larger trace is Unknown: each line carries a hook’s input, so a long session’s trace reaches megabytes, but reading more than any session leaves would be work the agent chose. A SessionStart of the client that exited 0 is Succeeded and settles it; otherwise a line it could not read is Unknown, inconclusive; otherwise a call that exited otherwise is Failed, and none at all is Missing, both failing, since check_before_launch requires the trial to start with no trace (Unready::HookTrace). A failed auto-sync does not change the hook’s exit, which is why the sync record is decided separately. The same real-hook test pattern reads the trace this reader expects. The bounded, link-free reading is expect::log, shared by every log a process inside the trial writes.
expect::hooks::hook_record decides each [expected] hooks entry. Loading a task finds each entry’s event in the [[hooks]] of its plugins’ Symposium.toml, with the checker’s own reader of name, event, agent and format (task::hooks), and --check-tasks rejects one that no plugin declares, that two declare, whose event is not one of Symposium’s five, or that is limited to one agent by agent or a format other than symposium: a task runs on every client. A manifest that cannot be read or parsed is reported alone, since it could declare any hook. Which events a client delivers is not checked, so a hook Symposium does not deliver on a client fails there as a missing record. The trace shows Symposium handled an event, not which plugin hooks ran within it, so each hook in evals/ records its own runs: with EVAL_EVIDENCE_DIR set, it appends a JSON line naming itself and its exit code to hook-records.jsonl (Trial::hook_records()), one file for all hooks, so a hook’s name never becomes a path. format-on-stop also records whether the code was already formatted. A Stop hook is decided by its first record (Counted::First), as the RFD asks, and a line before it that cannot be read could have been it, so that is Unknown. check_before_launch requires no records file (Unready::HookRecord). A Linux test runs Symposium’s real Stop hook, which runs the plugin’s, and reads its record.
expect::config::Snapshot copies the client’s hook config, in the home (Client::hook_config) and the project (Client::project_config), and Symposium’s config.toml after init, and changes compares them after the trial, byte for byte. Claude Code applies a hook edit mid-session, so the project files matter too. A file unreadable either time is a change, since it cannot be shown unchanged. Claude Code’s .claude.json is not watched: Claude Code rewrites it mid-session.
expect::decide puts them together for a Symposium trial, which both of its functions take as a SymposiumTrial, built only from one, so a baseline trial’s files are never read as Symposium’s. gather reads what the trial left once: the SessionStart trace, the sync record, each expected hook’s record (a Stop hook by its first, Counted::First), and the installs, with the caller giving each skill’s source in evals/. decide reads nothing: it pairs each expectation with the concerns expect::crosscheck raises about its evidence, the trace with the client’s SessionStart, the sync record with it too, each hook record with its event, and each artifact with the tool activity and config changes, the installs with the project’s skill directory. Each Checked expectation keeps its evidence and its concerns apart, as nextest keeps each attempt and derives “flaky” from them: the evidence gives its own verdict (HasVerdict), stored nowhere else, and Checked::verdict derives the one to report, inconclusive when there is any concern. used and not_used are decided from the transcript itself, so they carry no concerns.
Code comments
Comments answer why, an invariant, or a surprising behavior of a client or tool. They never restate what the code says.
- Module docs (
//!). One summary sentence, then only what the code cannot show: the mechanism, the decision behind it, and links to the RFD rule it implements. Cargo’sfingerprintmodule is the model, kept short. - Invariants. Write a rule the code must keep as
Invariant:in the module doc, and back each one with a#[test], as rust-analyzer does with its architecture invariants. Example: the baseline can never reachcargo-agents. - Item docs (
///). One or two lines of purpose, plus an# Errorssection on fallible public functions. Skip the doc when it would only repeat the item’s name. - Inline comments (
//). Proper sentences, starting with a capital and ending with a period (rust-analyzer). Detail is welcome for a non-obvious client quirk, such as Codex appending a non-empty stdin to the prompt (rustc dev guide). - Error and context messages. Lowercase, with no trailing period (rust-analyzer, Rust API guidelines).
- Markers.
FIXME:for a known gap that may be merged.TODOonly inside an unfinished PR, never merged (rustc’s tidy rejects it).SAFETY:above anyunsafeblock (salsa). - Tests. The test name states the behavior. Comment only a fixture whose setup is not obvious.
Precedents
- rustc’s compiletest treats tests as data: each test is a directory or file the runner discovers, so adding a test needs no code change.
evals/tasks/follows the same idea, and--check-tasksplays the role of compiletest’s directive validation. - The
cargo xtaskconvention keeps repository automation as a workspace binary invoked through a Cargo alias, with no extra tooling to install. This repository already uses it formd-orphan-check. - Cargo’s own CLI test calls clap’s
Command::debug_assertin a unit test, so a malformed argument definition failscargo testinstead of the first person to run the command.symposium-evaldoes the same.