Repository navigation
feat(session-flow): measure handoff resume accuracy with an A/A-calibrated eval - #17387
Conversation
The seed commit of a run repository failed when the host's signing program timed out, killing the run before any model call. Run repositories are throwaway, so child processes now get commit and tag signing turned off through GIT_CONFIG_* variables. Co-Authored-By: Claude Opus 5.5 <[email protected]>
build_predecessor_chain takes the save_point.py of the arm being seeded,
pinned by path. A case's explicit shape wins; otherwise the chain is built
in the shape that copy writes, read from its HANDOFF_SHAPE line rather than
imported, so a second copy never shadows the imported save_point module.
Shape 4 (or any shape the seeder cannot build) is an "unsupported seed
shape" error raised before any file is written. With no copy the default
stays shape 2, as before, so callers without an arm keep today's chains.
seed_hash hashes every file under handoffs/ with the run repository's path
written as {repo}, so two runs of one case and arm compare equal and any
content change shows.
target_bytes now steers shape-3 chains too: rules stay in the hot file, so
the count of generated rules per hop is steered from measured overhead, as
the shape-2 width steering does. Width steering capped out below target
(MAX_WIDTH), so count is the lever.
expected_fail states a hop that must FAIL validate and the pattern every
FAIL line must match; an unexpected pass or a different FAIL still stops
the build, and an unstated FAIL stops it as before.
load_case accepts task_relation: same or boundary.
test_shape3_spec_errors_are_refused_before_any_file_is_written drops its
target_bytes entry: shape-3 steering is now supported.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Exclusions are classed by a frozen Exclusion (source, kind) record. The sources are writer, reader, follow-up and judge; a behavior kind (no handoff, a denial, zero turns, a result error) scores 0 on every probe of the run, and every other kind is infrastructure (usage limit, sandbox start, a CLI that exited with no output, a judge with no verdict), which stays an error. A judge failure is always infrastructure: it is the grader's, not the arm's. Rows written before this carry only the error text, so row_cause reads it to keep old graded files reportable. run counts a behavior row done, re-runs infrastructure ones on the next invocation (exit 6 while any remain), keeps stopping at the first usage limit (exit 4), and stops on a seed whose hash differs from an earlier run of its case and arm (exit 5). It refuses before any work when an arm has no save_point.py to seed from; compact and free-hand seed with the before copy. Graded rows gain reader_m1 (reader tokens to the first state change, apart from the writer's tokens in m1), reader_whole_m1 (the whole reader run, so later reads of moved history count; codex_tokens gains the same whole option) and seed_hash. Older rows' reader_m1 comes from reader_tokens.m1. report takes --graded more than once (groups get @1, @2 so an A/A pair of one arm stays two groups), prints accuracy, reader m1, whole-run m1 and the pass count at T per group and per case, and with --baseline writes one shared-probe result pair per compared group (same reader), runnable by noise-report.py --baseline and win-test.py, and prints the paired accuracy change, the paired token changes, case drop: and pass-to-fail: lines. --subset same|boundary reads task_relation from the case files. It exits 1 on any left out (an excluded or missing run, or a case absent from one side of a pair), case drop:, pass-to-fail:, untagged: or seed mismatch: line. case drop: fails too because AC8's "no case drops" counts it. Edited tests: the two flow tests seed from this checkout's plugin dir with an explicit shape 2 (seeding now runs the arm copy's save_point.py, and those shape-2 cases cannot build in shape 3) and assert the new row fields; test_report_keeps_the_last_row_per_run_and_counts_every_exclusion calls main() since --graded is repeatable. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…robe A case present on both sides of a pair whose runs graded no probe both arms share was skipped without a line, so the pair compared fewer cases and the report still exited 0. It now prints a failing left out line. The pair test also asserted on a split field that was always the word "case"; it now checks the drop lines themselves. Co-Authored-By: Claude Opus 5.5 <[email protected]>
"over 1 cases" and "over 1 runs" read as "over 1 case" and "over 1 run". Co-Authored-By: Claude Opus 5.5 <[email protected]>
Seeding now follows the arm copy's shape unless a case names one. Seven re-* cases hold shape-2 sections (constraints, side effects) with no shape-3 home, so each names shape 2, the shape every case seeded in before. Two seeding tests drop the pin in memory to keep testing the arm-shape default. Adds the changelog fragment for the harness work. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The report loaded plugin-eval's noise-report.py at run time, a load across plugins the boundary rule forbids. The harness now keeps its own normal interval and case-drop share, and an agreement test, listed as an accepted crossing, holds them equal to noise-report.py. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The network deny list refused every `git ls-remote`, though a run's origin is a local bare repository. A compact-arm reader that checked `git ls-remote origin refs/heads/main` was denied, and the run counted as a non-delivery. Only https and ssh remote forms stay denied, as the git fetch rules already do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A seven-hop shape-3 chain whose newest hot file sits about 500 bytes under the hot-file cap carries two long early decisions (how releases are tagged; how a schema question is settled). The probes check the written handoff keeps each decision's binding clause and the resumed reader honors both. It rewrites an observed loss one-to-one with every detail changed, approved by the owner before it landed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A six-hop shape-3 chain whose newest hot file is over the cap, and is seeded to FAIL validate on size, carries a hop-1 migration rule. The probes check the written handoff keeps the rule whole and the resumed reader runs the check and pastes its output before merging. The seed test now honors a hop's stated FAIL. It rewrites a reproduced validator failure one-to-one, approved by the owner before it landed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A shape-3 injection in an id section can name `reuse: <injection id>` and take the id that injection held, once it was retired at an earlier hop. This seeds the AC2 failure: a retired rule id reused for a different rule, which `validate` accepts today. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three test repositories committed with the global signing config, so a slow signer failed the commit under a full-suite run. They now turn signing off, as the harness's own fixtures already do. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A shape-3 chain retires rule [R4] at hop 3 and reuses [R4] for a different, contradicting rule at hop 4. The reader's next action, a release, goes one way under each rule; the probes check the handoff carries the live rule and the reader tags rather than hand-bumping the version. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each of the nine cases resumes in a fresh session from a handoff, so each feeds the boundary compaction gate. Co-Authored-By: Claude Opus 5.5 <[email protected]>
An expected_fail entry may name `arms`; it holds only when that arm's copy builds the chain, so a case can seed one arm through a validator FAIL the other arm's copy does not raise. The harness passes each arm to the seeder. The seeded-session reads move from resume_cases.py to resume_history.py so resume_cases.py stays under the 1,000-line size reference. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…it codes resume-eval.md now states which copy seeds each arm and in which shape, expected_fail, task_relation, the report's pair folders, flags and exit codes, and run's exit codes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The newest predecessor's Resumption brief is about 29 KB of status lines, so its core alone is over the hot-file cap and validate passes it as UNVALIDATED. The one statement that warehouse 7 must backfill from 2026-10-01 is the brief's last status line; the probes check the handoff carries that bound and the reader runs the bounded backfill. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A case is `same` when its next action continues the task in progress and `boundary` when it starts the next item or task. Seven cases move to `same`; the rule is stated in resume-eval.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A 12-hop shape-3 chain whose newest hot file sits 201 bytes under the cap. The only purge rule was set at hop 1, and the next action breaks it with a full-zone purge; the probes check the rule survives whole and the reader purges by prefix. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The newest handoff was written while CI on PR #4460 ran and says to merge once green; after emit, CI failed test_backoff_cap and amend rewrote Remaining actions and Next. The probes check the next handoff carries the failure and the reader fixes the cap instead of merging. A predecessor's `amend` object is applied to the newest hop with the copy's own `save_point.py amend` before that hop validates, so a case can start from a handoff a late event changed after emit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… cases One scenario seeded from a shape-2 and from a shape-3 chain: a hop-1 rule (reindex only into the staging alias) and decision (12 shards) guard the next action. The artifact probes apply to the after arm, so they run once shape 4 exists; the reader probes run on every arm. The trap-number check now strips an id prefix as it strips a hop tag, so a spec-written id-section entry passes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e boundary and unrelated work Three plugin-eval cases check the router's recommendation at each kind of continuation: /compact mid-task, a handoff then /clear when the next plan phase starts, and a plain /clear when the next ask is unrelated and nothing carries over. Each invokes no continuation skill on a natural-language license. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tired-id case The after arm's validator fails the reused [R4] at hop 4 and at hop 5, which carries it; both hops are stated so that arm's seed builds on. The every-hop test now applies expected_fail as the seeder does, ignoring entries scoped to other arms. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…second call A hop stated in expected_fail retries a budget-refused fill once, as the writer's two-call path does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ersized-brief case The after arm's validator fails hop 4's oversized Resumption brief by slot; the entry lets that arm's seed build on. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A batch killed mid-run left `<index>-<reader>` copies behind, and the resumed batch crashed on the first one with FileExistsError. A run now clears its directory and its reader copies before it starts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgaqsQksryU8CarAPiU
…al exclusions A run whose graded.json is complete but whose rows never reached graded.jsonl (the batch died first) now has its rows appended on resume, once, instead of being skipped and lost from the report. A job whose runner raises no longer drops the rows of jobs still running: the batch stops submitting, appends every other finished job, then re-raises the first exception with its stack. The report's exclusion count now reads the final row per (case, index), so a run that errored and re-ran clean is no longer counted as excluded. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgaqsQksryU8CarAPiU
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ab42524f1e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A seeded file that starts with a shebang gets mode 755, so a Makefile recipe that runs `./scripts/<name>.sh` works instead of failing with Permission denied and adding repair turns to the measured run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgaqsQksryU8CarAPiU
|
claude-security-review reviewed Security review: incremental (1356265 → 5c40090)No security issues found. This lane already reviewed an earlier head of this pull request, so this review reports only CRITICAL and IMPORTANT findings. Scope. I read every hunk of both files this push changed: What I checked
Settled and prior items. This push does not touch the code under any earlier settled thread. This lane's earlier summary-level post had no findings to carry over. critical-findings: 0 |
The eval deny list matched only `https` and `git@` as the first argument, so http, ssh, git, scp-style and option-first forms reached the network. Deny any ls-remote argument holding a colon and any fetch URL or user@host, which keeps the local `origin` queries readers need. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgaqsQksryU8CarAPiU
|
Security lane suggestion ( |
|
claude-review reviewed Code review (incremental, 1356265..5c40090, blocking only)This round covers the 2 files changed in this push. I read every hunk of both files:
This lane already reviewed an earlier head, so this round reports only blocking findings. I found no blocking findings. What changed
Checks I did by reading
Other checks
Verifier dropped 0 of 0 candidates. |
…ny rules - Deny remote git ls-remote by URL shape without a trailing `:*`, which Claude Code reads as the old prefix form; the test now applies that reading. - decision-no-hand-tag also catches `git -C <dir>` and option-first tags. - expected_fail matches the arm's base, so after-promoted states its FAILs. - The wf-* negation guard looks only at the words beside the command, so a one-line "No handoff needed: just /clear" passes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgaqsQksryU8CarAPiU
|
claude-review findings on ab42524, each checked against the head source and the approved plan:
|
Lane run report
Failed GitHub API calls
|
Lane run report
Failed GitHub API calls
|
The guard now skips a line when a negation comes within 30 characters of the command with no clause break between, so "Instead of a /compact" and "No need for /compact" stay negated while "No handoff needed: just /clear" still names the command. Fail samples cover both forms per case. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgaqsQksryU8CarAPiU
Lane run report
Failed GitHub API calls
|
Lane run report
Failed GitHub API calls
|
|
The pr-verify verifier failed head What it wrote (44 lines)This pull request leaves the merge queue, and ci-status holds it out while it carries |
Eval sessions deny every `git ls-remote` again, as on main; narrowing it loosened a network guard nobody approved. A reader's `git ls-remote origin` now counts as a non-delivery, which the report gates as its own rate. The `git fetch` deny keeps its URL and user@host forms. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgaqsQksryU8CarAPiU
Post-merge mutation testingKilled 5, survived 2, timeout 0, no coverage 0, invalid 0, not run 0.
Surviving mutants
The run's summary has the full report. |
No related issue: phase 2 of the handoff redesign plan, tracked in a local plan, not an issue.
Summary
The resume eval could not yet measure the failures the handoff redesign targets, or tell a real change from run-to-run noise. This PR extends the resume-eval instrument and adds the cases it needs, so a later handoff change can be compared against an A/A-calibrated baseline.
plugins/session-flow/scripts/harness/): non-delivery scoring, pairedm1token comparison (to the first action and over the whole run),task_relationsubsets, per-arm frozen seeds built from each arm's plugin copy, an explicit seed shape per case, a hop allowed to fail with a stated FAIL (optionally per arm), a seeder option to reuse a retired id, anamendstep on the newest hop, and size steering for shape 3. The report fails on anyleft outline.plugins/session-flow/evals/:re-decision-trimmed-to-fit,re-rule-after-size-fail,re-retired-id-reused,re-oversized-brief,re-shape3-near-cap,re-late-event,re-transition-2-to-4,re-transition-3-to-4, and the continuation-router caseswf-same-task-compacts,wf-phase-boundary-hands-off,wf-unrelated-next-plain-clear. Each was approved by the owner before it landed.re-*case carries atask_relationtag (sameorboundary, by its next action).plugins/session-flow/evals/resume-eval.mddocuments seeding, the report flags and the exit codes.Fix
reportscores accuracy on delivered runs only and gates non-delivery as its own per-case rate (--nondelivery-margin, a non-inferiority margin of 1.43h from an A/A pair), with the whole-run readerm1change gated by--token-margin; every pair line printsh, so an A/A pair gives each margin directly.runkeeps graded rows across a crash, counts only final exclusions, and keeps eval-run worktrees inside the run's own directory.Acceptance criteria
/compactthrough the resume eval exists before any change is compared. (The A/A and baseline batch is running; this PR carries the instrument for it.)UNVALIDATED, long chains near the cap, and late events; each rewritten case was approved by the owner before it landed.M, T and the first-action token cut are set from the 6-runs-per-cell A/A now running, in a follow-up PR that changes
resume-eval.md's documented--margin; the owner approves T and the cut there. This PR changes only the eval harness and cases, no handoff runtime code.Verification
python3 -m pytest plugins/session-flow/scripts/harness -q).Related
N/A
🤖 Generated with Claude Code