Repository navigation
lane-start fails closed on three #138 fences: a new lane's rename is read back and undone when another window took the name, a row or log that says RETIRED is not started again, and a new lane never takes a window named for another registered lane - #216
Merged
Merged
Conversation
…pt, a closed row resumed, another lane's window taken tests/test_lane_start_hardening_138.py drives a real lane-start in the claude-current sandbox with a stateful fake tmux. Items 3, 14 and 16 of #138. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…sk the register about this window's own name Item 3: a NEW lane's rename is read back with the same scan the fence makes; another window carrying the name, or a list that fails, undoes this window's rename and its automatic-rename and refuses. No reservation is added (#84). Item 14: a register row (local or published) whose state word is ENDED or RETIRED, or a log whose last lane-kind line is either, refuses before any rename; a lane-last that fails refuses too. Item 16: a new lane started from a window named for another registered lane (published or this checkout's row) refuses; a read that fails refuses. Refs #138 (items 3, 14, 16). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…es as well as a RESUMED Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Sorry @brettheap, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 22 hours and 55 minutes by commenting |
Reviewer's GuideHardens lane-start against three #138 fail-open paths: it rolls back colliding or unverifiable renames, refuses closed lanes based on register and log state, and prevents new lanes from taking windows belonging to other registered lanes. A stateful fake-tmux sandbox provides focused proving and control tests without real tmux, Claude Code, or network access. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
… name says it was not made ENDED is "the window is closing", not "the lane is not coming back": it releases the binding as PAUSED does (Amendment 18(b)), `lane` sends a closed lane back to `lane-start` to be reopened, and the real register has an ENDED lane resumed by lane-start. The row loop and the `lane-last` case now match RETIRED alone; a `lane-last` that cannot be read still refuses with 1. The ENDED cases become controls that resume (exit 0, row LIVE, a RESUMED line). Item 3's undo printed "This window's rename is undone" where `#W` was empty and no rename back was made; it now says the undo was not made. Refs #138 (items 3, 14). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
brettheap
pushed a commit
that referenced
this pull request
Oct 18, 2026
…R on today's main Main moved through files this PR also changes (#199 or #216, and #201) after the last green run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap
pushed a commit
that referenced
this pull request
Oct 18, 2026
…so CI tests this PR on today's main Main moved through files this PR also changes (#199 or #216, and #201) after the last green run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap
pushed a commit
that referenced
this pull request
Oct 18, 2026
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This was referenced Oct 18, 2026
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.



Refs #138 (items 3, 14, 16)
This PR covers the three
lane-startitems of #138. They are re-proved onmain(f87fd5a), fixed fail-closed, and each has a proving test in the newtests/test_lane_start_hardening_138.py. The test drives a reallane-startin the claude-current sandbox (tests/test_lane_start_claude_current.py'sSandbox), with a stateful faketmux: the server's windows live in a file,list-windowsprints it andrename-windowedits it. It uses no real tmux server, no real Claude Code and no network.The other #138 items are not touched: the
lanes-edit.shitems and items 6, 13 and 15 belong to other lane-4 writers. Nothing here is inlane-start~:1435 (seam_refuse), ~:2584–2651 (live_holders_of_id/follow_transcript), ~:3502 (cut_to_line) or ~:3896.Item 3: window-name uniqueness check vs rename (fixed)
On main:
lane_check_local_fencesscanslist-windows(lane-start:2223-2236atf87fd5a), and step 4 renames (:2477). Nothing reserves the name between the two calls. So two NEW-lane starts in two windows can both find the name free and both take it, and the register lock that comes after cannot undo a rename.Fix: no reservation is added. #84 records that a lane reservation is a ruling's to make, and a file lock would not cover benches in other containers that share one tmux server. Instead, the rename is read back:
window_named_lane(:2288-2303). The fence calls it before the rename, as before.:2549-2585).automatic-renamerestored: unset, oron, asshow-options -w -vread it before the rename (:2543-2544). Then the run refuses with exit 2, before any write.Tests:
test_item3_a_name_another_window_took_during_the_rename_is_given_back: a rival's rename lands just before this run's.test_item3_a_read_back_that_fails_is_not_a_name_that_is_freetest_item3_the_undo_restores_automatic_rename_when_the_window_had_ittest_item3_a_window_with_no_name_to_go_back_to_says_the_undo_was_not_made: where#Wwas empty, no rename back is made, and the refusal says the undo was not made instead of claiming it.test_item3_an_uncontested_rename_is_keptItem 14: retired-identity fence asks only the archive (fixed, RETIRED only)
On main:
lane_check_local_fencesasks onlyretired-identity(:2201-2209), which reads the archive. A row thatlane-end --retireor the dormant sweep marked RETIRED, but thatarchive-rowshas not yet moved, still sits inlanes/LANES.md.retired-identityanswers 8 about it, and the existing-row path resumes the lane. That appends a STARTED or RESUMED after its RETIRED line, in a log nothing ever rewrites.Fix (
:2212-2240, inside the same function, so it is asked again before the rename):RETIREDis refused (exit 2). Both copies are asked: this checkout's$rowand the published$pub_row.RETIRED(read withlanes-edit.sh lane-last) is refused (exit 2).lane-lastthat cannot be read (anything but 0 or 8) refuses with exit 1.ENDED is not refused, because ENDED is not terminal in this estate:
lane-endis "the window is closing", whilelane-end --retireis "the lane is not coming back".lane-start's own binding section: a binding is released by aPAUSEDor anENDED, and the lane can then be bound again.lane's closed-lane refusal points atlane-start <repo> <n>as the way to reopen a lane.lane-start.The earlier revision of this PR refused ENDED as well. That would need a ruling from Brett, so it was taken out.
Tests:
test_item14_a_retired_lane_still_in_the_register_is_not_started, parametrized over three cases: RETIRED in the cell with or without a log, and a PAUSED cell over a log that ends RETIRED.test_item14_a_retirement_this_checkout_has_not_pushed_is_still_onetest_item14_a_log_that_cannot_be_read_is_not_a_lane_that_is_opentest_item14_an_ended_or_paused_lane_is_still_resumed, over three cases: an ENDED cell, a log ending ENDED, and a log ending PAUSED. Each resumes the recorded session: exit 0,--resume <id>, the row set toLIVE, and aRESUMEDline.Item 16: new-lane window-name fence skips this window (fixed)
On main: the scan skips this window (
:2229). So a NEW lane started from a window still named for ANOTHER registered lane renames that window and takes that lane's tmux address.Fix (
:2260-2285): for a NEW lane whose window name differs from the lane's, the fence asksregister-rowandregister-row-localabout the window's own name. The local read is there because a row this checkout has not pushed already owns its window.A name that
check_lane_namerefuses (a space, a slash, a leading.or-) can be carried by no row. Such a name is reusable without a read, as areclaude, a shell's name and any other name no row carries.Tests:
test_item16_a_new_lane_does_not_take_another_lanes_windowtest_item16_a_row_only_this_checkout_has_still_names_the_windowtest_item16_a_window_name_read_that_fails_refuses, for each of the two readstest_item16_a_generic_or_unregistered_window_name_is_reused(zsh,my notes,REPOZ-1)Verification
Local scoped run at
ed933f5, under the shared lock (flock … python3 -m pytest tests/test_lane_start_hardening_138.py -q, lock taken 19:59Z):git archiveofmain(OPENREPOTOOLS_CODE_ROOT;lane-startis unchanged fromf87fd5atoa74c7fc): 13 failed, 7 passed. Every proving test failed. The seven that passed are the controls, and among them are the three ENDED and PAUSED cases, which show that main resumes them too.CI's Linux
testsjob is the suite of record.The shell suite's existing
lane-startcases were reviewed for the new refusals. None starts a RETIRED lane, none starts a NEW lane from a window named for another registered lane (therepoVT-2,repoGD-*and guard choice-2 cases all start lanes that have rows), and the read-back predicate is the fence's own, so a fake whose windows do not change gives the same answer before and after the rename.🤖 Generated with Claude Code