Skip to content

lane-handoff's --exit refusals keep their words and name their mode: the /exit refusal prints /exit, and the row and handoff gates say ending, not respawning - #35

Merged
mergify[bot] merged 2 commits into
mainfrom
fix/exit-refusals-keep-their-words
Nov 11, 2026
Merged

mergify[bot] merged 2 commits into
mainfrom
fix/exit-refusals-keep-their-words

Conversation

@brettheap

@brettheap brettheap commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openRepoTools-5
Claim: none (no issue; lane 3's finding in its review 6778792731 on opensoft/openRepoTools#165, taken by lane 5 in 6778832343)

One commit, 37129a3, on code main 749e969. Three of lane-handoff's refusals fire under --exit but did not read true for it, and now they do:

  • the /exit refusal prints /exit, where it used to run the word as a command substitution;
  • the row and handoff gates say "ending", not "respawning".

--restart's messages are unchanged, byte for byte.

READY for lane 3's review. Every check is green on 37129a3: 14 of 14 passed, SonarCloud Code Analysis among them (checked 2026-11-11T00:59:18Z).

The defect

Line numbers are at lane 3's queue prefix p3 (9bfedfa). The file is unchanged from there on main.

  • :3109 is the refusal for a /exit that tmux send-keys could not type. It spelled the word with backquotes inside a double-quoted die message, so bash ran it as a command substitution.
    • stderr gained "line 3109: /exit: No such file or directory".
    • The message read "the record is written and could NOT be typed into the pane".
  • :3081 and :3083 are the ROW WAS NOT FLIPPED gate and the HANDOFF WAS NOT REFRESHED gate. They fire under --exit as under --restart, and said "respawning" to a lane whose session was about to be ended.

The fix

Tests

In tests/test_a23_lane_handoff.py, beside the opensoft/openRepoTools#355 test:

  • test_the_exit_refusal_prints_its_slash_exit_word_and_runs_no_command, with a tmux that refuses send-keys;
  • test_the_row_and_handoff_gates_name_the_act_their_mode_takes, for each gate under each flag, 4 ids.

Checked

  • By node id, one short direct run each, as Brett's "CI verifies (Recommended)" asks (relayed in 6782534165):
    • all five ids pass on 37129a3;
    • on main 749e969, with this commit's test file, the three --exit ids fail on the old words.
  • The re-cut: the commit was first built on p3, as ab0baaf (6778832343), and re-cut onto main by git merge-tree.
    • The patch-id is unchanged (630e20c3).
    • The subject's issue reference is dropped, since there is no issue.
  • CI runs the whole suite on this head.

A merge note for lane 3

This PR's tests and #32's both append after #27's block, at the end of tests/test_a23_lane_handoff.py. Whichever lands second needs a merge of main that keeps both blocks.

Authority

Brett Heap'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." This gives no new word of Brett's.

🤖 Generated with Claude Code

Summary by Sourcery

Fix lane handoff refusal wording for exit mode while preserving restart behavior and existing failure handling.

Bug Fixes:

  • Correct lane handoff refusal messages so /exit is printed literally and exit-mode gate messages describe ending sessions rather than respawning them.

Tests:

  • Add coverage for failed /exit delivery and row/handoff gate wording across both --exit and --restart modes.

…the /exit refusal prints /exit, and the row and handoff gates say ending, not respawning

Three refusals that fire under --exit did not read true for it. Lane
openRepoTools-3's review 6778792731 on opensoft/openRepoTools#165 found the
first, and named the other two as its neighbours. Lines are at the base,
refs/l3/queue-p3-29 (9bfedfa), where the three stood at :3081, :3083 and :3109.

- :3109, the refusal for a /exit that tmux send-keys could not type, spelled
  the word with backquotes inside a double-quoted die message, so bash ran it
  as a command substitution. stderr gained "line 3109: /exit: No such file or
  directory" and the message read "the record is written and  could NOT be
  typed into the pane". The backquotes are now escaped with a backslash, as every
  other message of the file that names a word spells it, and the message
  prints /exit. A scan of the whole file for a backquote in a double-quoted or
  bare position found no other: the rest are escaped, or inside single-quoted
  printf formats and the quoted usage heredoc.
- :3081 (the ROW WAS NOT FLIPPED gate) and :3083 (the HANDOFF WAS NOT
  REFRESHED gate) fire under --exit as under --restart, and said "respawning"
  (the row gate also "replaced") to a lane whose session was about to be
  ended. The mode words are now set once, ahead of the gates, in the block
  that already holds opensoft/openRepoTools#355's tmux_act_word. --restart's
  messages are byte for byte what they were. --exit says "ending its session
  would leave the register reading RUNNING for a session that has just been
  ended", and "ending now would leave the new session to be started with the
  block of a handoff this act has replaced". The gate logic and the exit code
  (2) are unchanged, as are :3068's words, which already name both acts.

Tests, in tests/test_a23_lane_handoff.py beside the opensoft/openRepoTools#355 test:
- test_the_exit_refusal_prints_its_slash_exit_word_and_runs_no_command, with a
  tmux ahead of the sandbox's fake one that refuses send-keys;
- test_the_row_and_handoff_gates_name_the_act_their_mode_takes, for each gate
  under each flag, with a LANES_EDIT whose set-row-state is refused for the row
  gate and the existing _forcing wrapper (write-handoff exits 1, writes
  nothing) for the handoff gate.

Controls: the same tests pointed at p3's lane-handoff (OPENREPOTOOLS_CODE_ROOT
at an archive of refs/l3/queue-p3-29, so the harness copies p3's file): the
/exit test fails with "/exit: No such file or directory", and the row and
handoff gates fail under --exit on the old words; the two --restart cases pass
on both, as they pin words that did not change. All five pass on this commit.

Authority: Brett Heap'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." This gives no new word of Brett's.

Lane: openRepoTools-5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Update lane-handoff’s refusal messages so /exit is printed literally and the row and handoff gates describe ending a session under --exit, while preserving --restart wording.

  • lane-handoff L3069-3087, L3100-3102, L3123

Tests

Add a failing send-keys fixture and verify the /exit refusal prints its word literally, identifies the target pane, and runs no command.

  • tests/test_a23_lane_handoff.py L32, L507-545

Pin the row and handoff gate wording for both modes, checking that --exit says “ending” and --restart retains its existing wording.

  • tests/test_a23_lane_handoff.py L546-603

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai

sourcery-ai Bot commented Nov 11, 2026

Copy link
Copy Markdown

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 17 hours by commenting @sourcery-ai review. Upgrade to get a review now.

…sals-keep-their-words

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]>
@sonarqubecloud

Copy link
Copy Markdown

@brettheap

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T18:27:49.682237Z 447b51b Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@brettheap

Copy link
Copy Markdown
Contributor Author

Brett approved landing #35 and #36 through one narrow real-code Mergify batch after full CI and exact-head Codex review. Queue configuration is in #42. Please leave this PR unmerged and its branch unchanged for this bounded batch; no hold on other work or repository-wide freeze is requested. This coordination does not restart, rebind, retarget or edit any lane session.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 447b51b93d

ℹ️ 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".

@brettheap

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue openrepotools-real-code-35-36

@brettheap

Copy link
Copy Markdown
Contributor Author

@Mergifyio refresh

@mergify

mergify Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

queue openrepotools-real-code-35-36

⚠️ Naming a queue is deprecated. Post @mergifyio queue without a name instead: Mergify then puts the pull request in the first queue whose queue_conditions it matches. A future release will stop accepting the name.

@mergify

mergify Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into main as 92f9e10 at 19:37 UTC

Merged together with #36. 37 min in the queue, 36 min of it CI.

So far

10 merge conditions met
  • check-success=@github-actions/guard-launch-mode
  • check-success=@github-actions/package
  • check-success=@github-actions/tests
  • check-success=@github-actions/tests-no-submodule
  • github-code-owner-review-satisfied · required by GitHub repository ruleset rule Require Code Owner Review
  • github-review-approved · required by GitHub repository ruleset rule Require Code Owner Review
  • any of · required by GitHub repository ruleset rule main: the four tests.yml jobs required (owner act 2):
    • check-success = guard-launch-mode
    • check-neutral = guard-launch-mode
    • check-skipped = guard-launch-mode
  • any of · required by GitHub repository ruleset rule main: the four tests.yml jobs required (owner act 2):
    • check-success = tests
    • check-neutral = tests
    • check-skipped = tests
  • any of · required by GitHub repository ruleset rule main: the four tests.yml jobs required (owner act 2):
    • check-success = tests-no-submodule
    • check-neutral = tests-no-submodule
    • check-skipped = tests-no-submodule
  • any of · required by GitHub repository ruleset rule main: the four tests.yml jobs required (owner act 2):
    • check-success = package
    • check-neutral = package
    • check-skipped = package

Times in UTC · dashboard · how the merge queue works

@mergify

mergify Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

refresh

✅ Pull request refreshed

@mergify mergify Bot added the queued label Nov 11, 2026
@mergify
mergify Bot merged commit 92f9e10 into main Nov 11, 2026
31 checks passed
@mergify mergify Bot removed the queued label Nov 11, 2026
brettheap added a commit that referenced this pull request Nov 11, 2026
…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]>
brettheap added a commit that referenced this pull request Nov 11, 2026
…tten, as `--late` does, instead of taking it from CLOSED to SWAPPING (opensoft/openRepoTools#118) (#32)

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`, then
`SWAPPED`, appending a `PAUSED` after the `ENDED`: a terminal lane reopened
by a `/handoff` typed in a pane that was still there.

- `lane-handoff`: `--late`'s read of `lane-last` and its `ENDED` or
  `RETIRED` refusal move into `read_last_lane_line` and
  `refuse_a_closed_lane`. Every mode but `--late` calls them right after
  the managed-ledger seam's refusal, before the restart intent, the window,
  the handoff, the register, the object log or the lifecycle is touched. A
  closed lane exits 2 with `--late`'s words, and `--late` keeps its own
  order and words.
- The log is the lane's state: a lane that a later `STARTED` or `RESUMED`
  reopened is never refused, and a `lane-last` read that fails exits 1
  before any write (Amendment 7(d)).
- tests/test_a23_lane_handoff.py: a closed lane is refused before any
  write, for the plain handoff, `--restart`, `--exit` and `--in-process`; a
  failed read of the last line is not an open lane; and a lane started
  again after its close is handed off as before.

It is the option Brett Heap chose for opensoft/openRepoTools#118, "Refuse,
as --late does (Recommended)". The issue stays open for the transition
table its "What's open" also asks for.

Lane openRepoTools-3's independent review read READY at 1915f48, after the
fix round for its MUST and SHOULD, and its delta check read READY at the
merge 959e21a. The merge 4d211d2 took code main 92f9e10
(#36 and #35): lane 3 checked that its tree
equals git merge-tree's in every file but tests/test_a23_lane_handoff.py,
which holds both sides' blocks, main's first, and Codex found no major
issue there. The head 0356714 then merges code main d3c55e5
(#44 and #45, two CI changes), and its tree,
3284253, is git merge-tree's of d3c55e5 and 4d211d2, so it adds nothing
of its own. Codex found no major issue at 0356714. All 18 checks that
ran passed at 0356714 on main d3c55e5 (Sourcery's review was skipped and
the Mergify queue check was neutral), so the tested tree is this commit's
tree, 3284253. Lane openRepoTools-3 lands it under Brett Heap's standing
landing word, which he extended on 2026-11-10 to lane-tooling fixes any
lane writes, once lane 3 has reviewed them.

Part of opensoft/openRepoTools#118

Lane: openRepoTools-5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant