A helper's place counts at both gates, the code review lints its tests, and a compaction ends at the step's first turn after it (#576) #578

Merged
cmoriarty merged 3 commits from claude/run203-batch into main 2026-11-20 18:18:34 -05:00
Owner

Fixes braid#576, run 203's findings 2 to 4 (braid#565). OpenSpec change run203-batch. Finding 1 shipped in pull request 566.

What changes

  • A helper's place counts at both gates (finding 2). A helper started in the background now takes a place at the run server's own gate as well as osfd's. When osfd does not answer, the gate alone decides. Before this, the two gates admitted helpers without counting each other's, so one helper ending could start two. Twice in run 203's code review, three sessions worked on a backend that serves two. A helper that starts no session now gives both halves of its place back.
  • The code review lints the tests it changes (finding 3). Its brief asks for the same lint as apply's, through the braid tool, with the review's entry commit as the base. Run 203's review added a fixed wait to a browser test, and the lanes' first round failed on that line alone. Three sentences of the brief are tighter, so its own text stays within its 6,000-character budget: 5,994.
  • A compaction ends at the step's first turn after it (finding 4). That turn's reading is the shrink, and Braid's note is sent then, as the step's next message, even while subagents keep the session busy. Before this, Braid waited for the session to go quiet. Run 203's review was woken by its subagents and worked on for 17 minutes, then got the note when it had already finished. Braid recorded 215k to 131k, when the compaction had made 8.6k.

Evidence, on the laptop

  • ./tools/test.sh: the suite passed in 60 s, with 922 backend, 212 UI unit and 64 browser tests.
  • Each new test fails on main:
    • tests/agent/test_path_guard.py::test_a_helpers_place_is_counted_once_whichever_gate_gave_it. On main, one helper ending started two queued ones (a, b, c), and osfd granted a place beside a helper only the guard's gate had counted.
    • tests/engine/test_code_review_helpers.py::test_the_review_lints_the_tests_it_changes
    • tests/engine/test_compaction_reading.py::test_only_the_steps_own_turn_begun_after_the_compaction_is_its_reading
  • New simulated run compaction-woken-by-a-helper. It replays run 203's order: the alarm, a running helper stopped, the command in flight stopped, the compaction, then the stopped helper's result waking the step before Braid's note.
    • On main it fails: "the compaction … did not shrink the context (36000 -> 27000)", then a fresh session.
    • With the fix it passes, four runs out of four.
  • These simulated runs also pass: compact-any-step, apply-group-compacts, compaction-refused-note, free-switch-compacts, helpers-queue-in-the-background, helpers-wait-for-a-place, and the smoke set.

Not in this change

braid#575, the code review looping while its readers work, has its own issue.

🤖 Generated with Claude Code

Fixes braid#576, run 203's findings 2 to 4 (braid#565). OpenSpec change `run203-batch`. Finding 1 shipped in pull request 566. ## What changes - **A helper's place counts at both gates** (finding 2). A helper started in the background now takes a place at the run server's own gate as well as osfd's. When osfd does not answer, the gate alone decides. Before this, the two gates admitted helpers without counting each other's, so one helper ending could start two. Twice in run 203's code review, three sessions worked on a backend that serves two. A helper that starts no session now gives both halves of its place back. - **The code review lints the tests it changes** (finding 3). Its brief asks for the same lint as apply's, through the `braid` tool, with the review's entry commit as the base. Run 203's review added a fixed wait to a browser test, and the lanes' first round failed on that line alone. Three sentences of the brief are tighter, so its own text stays within its 6,000-character budget: 5,994. - **A compaction ends at the step's first turn after it** (finding 4). That turn's reading is the shrink, and Braid's note is sent then, as the step's next message, even while subagents keep the session busy. Before this, Braid waited for the session to go quiet. Run 203's review was woken by its subagents and worked on for 17 minutes, then got the note when it had already finished. Braid recorded 215k to 131k, when the compaction had made 8.6k. ## Evidence, on the laptop - `./tools/test.sh`: the suite passed in 60 s, with 922 backend, 212 UI unit and 64 browser tests. - Each new test fails on main: - `tests/agent/test_path_guard.py::test_a_helpers_place_is_counted_once_whichever_gate_gave_it`. On main, one helper ending started two queued ones (`a, b, c`), and osfd granted a place beside a helper only the guard's gate had counted. - `tests/engine/test_code_review_helpers.py::test_the_review_lints_the_tests_it_changes` - `tests/engine/test_compaction_reading.py::test_only_the_steps_own_turn_begun_after_the_compaction_is_its_reading` - New simulated run `compaction-woken-by-a-helper`. It replays run 203's order: the alarm, a running helper stopped, the command in flight stopped, the compaction, then the stopped helper's result waking the step before Braid's note. - On main it fails: "the compaction … did not shrink the context (36000 -> 27000)", then a fresh session. - With the fix it passes, four runs out of four. - These simulated runs also pass: `compact-any-step`, `apply-group-compacts`, `compaction-refused-note`, `free-switch-compacts`, `helpers-queue-in-the-background`, `helpers-wait-for-a-place`, and the smoke set. ## Not in this change braid#575, the code review looping while its readers work, has its own issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run 203's findings 2 to 4 (braid#565):

- Helper places: every helper started in the background now takes a place at the run server's
  own gate as well as osfd's, and osfd not answering leaves the gate alone to decide. Twice in
  run 203's code review a third session worked on a backend that serves two: a waiter that had
  fallen back to the gate was let in as a helper ended, while the pump took osfd's freed place
  for the next. A helper that starts no session gives both halves of its place back.
- The code review's brief asks for the test lint over the tests it changes, through the braid
  tool, as apply's does. Its fixed wait failed run 203's first round. Three sentences of the
  brief are tighter, so its own text stays within its budget.
- A compaction ends at the step's own first turn after it, read as its shrink, and Braid's note
  is sent then. Run 203's review, woken by its subagents, worked on 17 minutes before Braid's
  note; the shrink was read from the note's turn (215k to 131k, when it had made 8.6k).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(openspec): run203-batch's suite and simulated runs pass (#576)
All checks were successful
test / suite (pull_request) Successful in 1m30s
b987018766
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/braid!578
No description provided.