Repository navigation
lane-handoff refuses a closed lane with exit 2 before anything is written, as --late does, instead of taking it from CLOSED to SWAPPING (opensoft/openRepoTools#118) - #32
Conversation
…tten, as `--late` does, instead of taking it from CLOSED to SWAPPING (opensoft/openRepoTools#118) A lane whose log's last lane-kind line is an ENDED or a RETIRED is closed. `lane-handoff` on it read the lifecycle's CLOSED as the compare-and-swap's expected value and took the lane to SWAPPING, polled it, recorded an inventory, appended a PAUSED after the ENDED and finished at SWAPPED: a terminal lane reopened by a `/handoff` typed in a pane that was still there (opensoft/openRepoTools#118). Now every mode but `--late` reads the lane's last lane-kind line right after the managed-ledger seam's refusal and exits 2 on an ENDED or a RETIRED, before the restart intent is reserved, the window is renamed, the handoff file, the register, the object log or the lifecycle is touched. The read and the refusal are `--late`'s own, moved into `read_last_lane_line` and `refuse_a_closed_lane`, so `--late` still refuses in the same order with the same words and the two modes cannot come to read a closed lane differently. Where they differ: `--late` and this check read the published object log through `lane-last`, whose last lane-kind line in file order is the lane's state, and the lifecycle's own read is `lane-state`, the snapshot `lane_state_follow` derived from those lines. A lane that a later STARTED or RESUMED reopened is therefore never refused, and a closed lane with no snapshot is. A `lane-last` that fails is said in a note and the swap goes on (R-A11-11), as the lifecycle's own failed reads let it; `--late` still dies 1 on it. tests/test_a23_lane_handoff.py gains test_118_a_closed_lane_is_refused_before_any_write for a plain handoff and for `--restart`: a started lane closed with an ENDED, its lifecycle CLOSED, exits 2 with `--late`'s words, and the published register, the lane's log, W's reflog, the lane's checkout (head, changed files and handoff file), the lifecycle snapshot and the restart intent are all as they were. It fails against the old lane-handoff: the plain handoff exits 0 and takes the lifecycle CLOSED -> SWAPPING -> SWAPPED, and `--restart` exits 2 only after the record is written. A second case pins that a lane started again after its ENDED is handed off as before. Brett Heap's answer, as lane 3 relays it on opensoft/openRepoTools#165 (6767535266): "`lane-handoff` refuses a CLOSED lane with exit 2 before any write, as `--late` does. That is Brett's "Refuse, as --late does (Recommended)"." Lane 3 released opensoft/openRepoTools#118 to lane 5 at 12:47:16Z. Fixes opensoft/openRepoTools#118 Lane: openRepoTools-5 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Reviewer's GuideImplementationRead the lane’s last lane-kind line and refuse closed lanes—or abort if the read fails—before handoff writes, while preserving
TestsAdd coverage for closed-lane refusal without writes across handoff modes, failed
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
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 3 days and 21 hours by commenting |
…eeping both test blocks, #27's first The merge brings #28, #29, #31 and #33 onto this branch, on top of the #27 that lane 3 checked at 10799a5. One conflict, at the end of tests/test_a23_lane_handoff.py: #27 appended its test_the_no_tmux_refusal_names_its_mode_not_both_words block there, and this branch appended the #118 block (the _closed and _held helpers and the three test_118 cases) at the same place. Resolved by keeping both, unchanged and with two blank lines between them: code#27's block first, then this branch's. No other file conflicted; lane-handoff merged by itself. The resolved tests/test_a23_lane_handoff.py is blob 3927b53, the blob lane 3 computed on 10799a5. No commit after 10799a5 on code main touches that file or lane-handoff (git diff 10799a5 749e969 -- tests/test_a23_lane_handoff.py is empty), so the blob is the same. Checked before this commit: bash -n lane-handoff passes; each of the five test ids of the two blocks passes, run one at a time (2 for code#27's block, 3 for this branch's). Lane: openRepoTools-5 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ot going on (MUST-1); the closed-lane test covers --exit and --in-process (SHOULD-1); a docstring says what it sets up (NIT-2) Fix round for lane 3's review of #32 (post 6780380332), on top of the merge of code main (749e969). MUST-1, lane-handoff: a lane-last read that failed let the handoff go on. The block below seam_refuse (the one that runs for every mode but --late) said it in a note and went on, so a lane closed with an ENDED, handed off with a lane-last that exited 1, took CLOSED -> SWAPPING -> SWAPPED and got a PAUSED after its ENDED: the defect of opensoft/openRepoTools#118 again. It now calls read_last_lane_line and, where that fails, dies 1 before any write, naming the failed read, as --late does on the same failed read (Amendment 7(d)): neither exit 2, which claims the lane is closed, nor going on, which claims it is open. The exit 2 refusal of a closed lane (refuse_a_closed_lane) is unchanged. The two comments that described the old behaviour, the one above lifecycle_begin and the one above this block, now say what the code does. The test for it, test_118_a_failed_read_of_the_last_line_is_not_an_open_lane, puts a stand-in for lanes-edit.sh in front of the real one that fails only lane-last, with exit 1, on a lane closed with an ENDED. It asserts exit 1, the refusal's words and not exit 2's, no PAUSED line in the log or in the register, the lifecycle snapshot still CLOSED, and every place a handoff writes unchanged (_held). On the merge commit's lane-handoff it fails: exit 0, with lifecycle SWAPPING -> SWAPPED. SHOULD-1: test_118_a_closed_lane_is_refused_before_any_write takes ("--exit",) and ("--in-process",) beside the plain form and --restart, since the comment at the head of lane-handoff says every mode refuses. NIT-2: the docstring of the started-again test implied an open log under a CLOSED snapshot. lane-start's STARTED line resets the snapshot to RUNNING, so it now says what the test sets up: log and snapshot both read open, and the case guards against refusing an open lane. No assertion changed. Part of opensoft/openRepoTools#118 Lane: openRepoTools-5 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ff-refuses-closed-lane Lane 3 asked for this merge and a fresh CI run before landing (opensoft/openRepoTools#165, 6783977065). Lane: openRepoTools-5 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…osed-lane code#35 landed first, so this PR takes main again, as lane 3 asked (opensoft/openRepoTools#165, 6784609742). The one conflict was the tail of tests/test_a23_lane_handoff.py, where both PRs append after code#27's block. The union keeps main's block first, then this PR's, and drops no line of either. Lane: openRepoTools-5 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…osed-lane Lane 3 asked for this merge before landing (opensoft/openRepoTools#165, 6808628795). Lane: openRepoTools-5 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@codex review |
|
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |



Lane: openRepoTools-5
Claim: opensoft/openRepoTools#118 (comment)
Five commits, on code
main92f9e10:9fdcab2;ccfc85a, a merge ofmainthat keeps both test blocks at the end oftests/test_a23_lane_handoff.py, #27's first;1915f48, the fix round for lane 3's review (6780380332);959e21a, a merge ofmain4b1485d(#34) that adds only.github/workflows/verify.yml; and4d211d2, a merge ofmain92f9e10(#35 and #36), whose one conflict, the end oftests/test_a23_lane_handoff.py, keeps both blocks, code#35's first. It makeslane-handoffrefuse a closed lane with exit 2 before anything is written, as--latealready does, instead of taking it from CLOSED to SWAPPING. It is part of opensoft/openRepoTools#118, which stays open for the transition table its "What's open" also asks for (the review's NIT-1). Lane 3 released opensoft/openRepoTools#118 to lane 5 at 12:47:16Z under Brett's "Yes, extend it (Recommended)", as lane 3 relays it on opensoft/openRepoTools#165 (6767535266): "Any lane may write a lane-tooling fix. Lane 3 reviews it and lands it under the standing word once it is READY and every check is green." The refusal is the option Brett chose for opensoft/openRepoTools#118, "Refuse, as --late does (Recommended)", relayed by the same lane 3 post.READY for lane 3's landing. Every check is green on
4d211d2: 18 passed, SonarCloud Code Analysis among them; Mergify's queue check is neutral, and Sourcery's review was skipped (checked 2026-11-11T22:29:05Z). Codex's review of4d211d2found no major issues (6807990166). Lane 3 checked the merge4d211d2(opensoft/openRepoTools#165, 6807910478).The defect
A lane whose log's last lane-kind line is an
ENDEDor aRETIREDis closed.lane-handoffon it read the lifecycle'sCLOSEDas the compare-and-swap's expected value and took the lane toSWAPPING, polled it, recorded an inventory, appended aPAUSEDafter theENDEDand finished atSWAPPED: a terminal lane reopened by a/handofftyped in a pane that was still there.The fix
lane-handoff:--late's own read oflane-lastand itsENDEDorRETIREDrefusal move into two functions,read_last_lane_lineandrefuse_a_closed_lane. Every mode but--latenow calls them right after the managed-ledger seam's refusal, before the restart intent is reserved, the window is renamed, or the handoff file, the register, the object log or the lifecycle is touched. A closed lane exits 2 with--late's words.--latecalls the same two functions where it always made the check, after its own--atchecks, so its order of refusals and its words are what they were.STARTEDorRESUMEDreopened is never refused, whatever its lifecycle snapshot says, and a closed lane with no snapshot is. Alane-lastread that fails exits 1 before any write, as--latedoes on the same failed read (the review's MUST-1): it shows the lane neither open nor closed (Amendment 7(d)), andR-A11-11keeps only a swap that is owed.tests/test_a23_lane_handoff.py:test_118_a_closed_lane_is_refused_before_any_write, for a plain handoff and for--restart. A started lane closed with anENDED, its lifecycleCLOSED, exits 2 with--late's words, and the published register, the lane's log, W's reflog, the lane's checkout (head, changed files and handoff file), the lifecycle snapshot and the restart intent are all as they were. A second test,test_118_a_lane_started_again_after_its_close_is_handed_off_as_before, pins that a lane started again after itsENDEDis handed off as before; its docstring now says what it sets up (NIT-2).test_118_a_failed_read_of_the_last_line_is_not_an_open_lane(MUST-1) runs a stand-inLANES_EDITthat fails onlylane-last, on a lane closed withENDED, and asserts exit 1, the refusal's words, noPAUSEDline, an unchanged lifecycle snapshot and an unchanged_held.test_118_a_closed_lane_is_refused_before_any_writenow also takes--exitand--in-process(SHOULD-1).lane-handoffatecd1bceand not run for this body: the plain handoff exits 0 and takes the lifecycleCLOSED -> SWAPPING -> SWAPPED(lifecycle_beginat line 1963,lifecycle_finishat line 3023), and--restartexits 2 only after the record is written, because the test's shell has no tmux and the refusal at line 3071 follows the record. Only--laterefuses a closed lane there (line 1942).Checked
1915f48), by node id, one short direct run each, as Brett's "CI verifies (Recommended)" asks (relayed in 6782534165):ccfc85a, where the handoff exits 0, and passes on the fix;[exit]and[in-process]ids, the[plain]and[restart]ids, the started-again test and lane-handoff's no-tmux refusal names the mode its flag selects, respawn for --restart and end for --exit, where it printed respawnend (opensoft/openRepoTools#355) #27's two ids pass.3927b532, the one lane 3's review gives.main92f9e10(4d211d2): the test file's union drops no line either side added, and binds no top-level name twice;import re, which both sides added, appears once. The PR's three tests and code#35's two pass by node id.run.shverify of9fdcab2:tests/run.sh -k 'test_118_a_closed_lane_is_refused_before_any_write or test_a23_lane_handoff or repo_hygiene'(its log's command line:python3 -m pytest tests -q -p no:cacheprovider -k test_118_a_closed_lane_is_refused_before_any_write or test_a23_lane_handoff or repo_hygiene) exited 0 with263 passed, 18 skipped, 4005 deselected in 678.05s (0:11:18).git diff --binary HEADon the worktree, taken when the run started and again just before the commit, has the sha2568e192b6f97762a5735f7797ad555658d87eefb6ca0308126ace13ef0fce2757c, on HEADecd1bce.9fdcab2and on1915f48, including SonarCloud. On4d211d2, 18 passed: the 14, and the CI pilot's four.Part of opensoft/openRepoTools#118
🤖 Generated with Claude Code
Summary by Sourcery
Refuse handoffs for closed lanes before writing anything, while preserving safe behavior for reopened lanes and unreadable lane state.
Bug Fixes:
lane-handofffrom reopening closed lanes by refusing before any state, log, checkout, or restart-intent changes.Enhancements:
Tests: