Skip to content

lane-start gains a guard-only binding mode that stamps the transcript being bound, so the offer's yes no longer records a RESUMED nobody is in (#70) - #223

Merged
brettheap merged 4 commits into
mainfrom
fix/lane-start-binding-mode-70
Oct 18, 2026
Merged

brettheap merged 4 commits into
mainfrom
fix/lane-start-binding-mode-70

Conversation

@brettheap

@brettheap brettheap commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Lane openRepoTools-5. This is the shape Brett Heap chose on lane 5's RULED line of 2026-10-11T16:5xZ: "Binding mode flag". lane-start gains a mode, used only by the guard, that stamps the id being BOUND. The rejected alternative, suppressing the resume stamp whenever --no-launch launches nothing, is not implemented.

What was wrong

On choice 2 at the name guard's offer (Amendment 12(h) rule 2), the guard ran lane-start --no-launch <repo> <n> for the lane the person had renamed their session to. Step 3b's veto 1 refused the session's uuid, because the row being left still records it. When the destination row already named a transcript that is present in its directory, lane-start took its ordinary resume path. It stamped the row, the lane's append-only log and the handoff with RESUMED by <the id the row already had>, under --no-launch, about a conversation nobody was in. guard_bind_uuid then appended the real uuid to the cell. The cell ended on the right id, but the log recorded a different one.

Reproduced at f87fd5a by the new suite case, which drives the guard's yes into a lane repoGD-6 whose cell records aaaa0012-6666…. The session being moved is aaaa0012-1111…:

FAIL …and the destination's log records a RESUMED by the transcript BOUND
       expected to contain [session aaaa0012-1111-4000-8000-aaaa00121111@]; got: RESUMED — lane repoGD-6, session aaaa0012-6666-4000-8000-aaaa00126666@Eagle, … lane:repoGD-6 → home opensoft/repoGD; …
FAIL …the row's stamp names the bound transcript too
       expected to contain [RESUMED by aaaa0012-1111-…]; got: | `repoGD-6` | harness aaaa0012-6666-… → harness aaaa0012-1111-… | … | LIVE · … · RESUMED by aaaa0012-6666-…

What changed

  • lane-start --bind <uuid> is the name guard's binding mode, and nobody else's. It is step 3b's own take, with veto 1 answered by the person's choice 2. Clause (h) rule 4 forbids moving a uuid between rows without the person's yes, and that choice is the yes. In this mode, lane-start:

    • appends the uuid to the session cell first (Amendment 8's order). The anchor is the PUBLISHED last id. Where the cell has no uuid, the anchor is the none recorded or pending — set by the session's first act text the cell carries; that is the guard's former anchor rule, moved into lane-start.
    • names that uuid in the row's stamp, the lane's RESUMED log line and the handoff's Rule 3 stamp. A brand-new row is created with it and stamped STARTED.
    • skips act 6 (finding or moving a transcript) and the PAUSED fallback. Its launch branch is decided before every transcript-location branch. The printed command is claude --name <lane> --resume <uuid>.
    • forces AGENT=claude, whichever agent last paused the lane.
    • records the cell commit as session cell: bound <uuid> on the person's choice 2 at the name guard (Amendment 12(h) rule 2).
  • It binds or it refuses (exit 2) before anything is written. It refuses:

    • a value that is not a transcript uuid, or an empty value (both spellings);
    • use without --no-launch;
    • use with --fresh or --agent;
    • a uuid that is not the session live in this window;
    • no live session in this window;
    • a window still named for another lane, because veto 2 stands. --bind answers veto 1 only.

    Falling through to the resume path would re-create The offer's yes leaves the destination lane's log saying a transcript was RESUMED that nobody is in, because lane-start has no binding mode and the guard makes the cell write itself #70, so every one of these is a refusal.

  • The guard passes the flag. guard_answer runs lane-start --no-launch --bind "$G_ID" <repo> <n>. self_args and every printed command are untouched, so the guard-only flag reaches no line a person is told to type.

  • The guard no longer makes its own register write (the closing line of The offer's yes leaves the destination lane's log saying a transcript was RESUMED that nobody is in, because lane-start has no binding mode and the guard makes the cell write itself #70). guard_bind_uuid becomes guard_bound_check. It reads the published cell back, then either reports that the cell ends on this uuid or prints the act that puts it there. I did not keep the old write as a fallback, for three reasons:

    • It used the same anchor as lane-start, so where lane-start's append refuses (a stale copy of the row), it refuses too.
    • In that stale case, lane-start's next write to the same row line has already met the difference as a rebase conflict, so nothing pulls the copy level.
    • After a push timeout it would read a published ref that never moved and append the uuid a second time.
  • Docs: the --bind entry in lane-start's OPTIONS header (its --help), and a note at step 3b in the header. In docs/README-lanes.md: the step 3b note, a --bind paragraph beside --dry-run/--no-launch, and the choice-2 paragraph of The offer rewritten.

Functions and regions edited

Line numbers are at a4acad3, before the merges of main (93c12db, e40c067) and the added case (25463a1).

  • lane-start: header OPTIONS --bind entry (115-127); header step 3b note (155-157); argument variables (777-778); argument loop, --bind / --bind=* arms (815-820); post-loop --bind validation (863-882); step 3b, new block "3b(ii). THE BINDING MODE" ahead of the veto chain (2097-2150); AGENT selection (2472-2478); act 6 condition (3195-3198); PAUSED-fallback condition (3258-3260); launch decision, new --bind branch (3323-3335); step 5 harness append, harness_why (3698-3707).
  • lanes-edit.sh: guard_bind_uuid replaced by guard_bound_check (9860-9921); guard_answer choice 2: rename comment, the lane-start call with --bind, its refusal sentence, and the call to guard_bound_check (9996-10027).
  • docs/README-lanes.md: lane-start <repo> <n> step 3b (388-390); new --bind paragraph (493-507); The offer, choice 2 (2212-2240).
  • tests/test_lane_helpers.sh: Amendment 12 section. Choice-2 block assertions (7053-7064); new The offer's yes leaves the destination lane's log saying a transcript was RESUMED that nobody is in, because lane-start has no binding mode and the guard makes the cell write itself #70 block after it (7072-7146); pending-anchor case comment and description (7356-7369).

None of these overlaps #56's live_holders_of_id/follow_transcript, #72 item 5's deferred print or self_args, lane 4's #157 region near lane-start:1435, or lane 3's lanes-edit.sh regions.

Tests

New in tests/test_lane_helpers.sh, in the Amendment 12 section:

Local proof, in isolation (no full suite, per the lane rules). A builder in my scratchpad cuts a copy of tests/test_lane_helpers.sh down to four parts:

  • its prelude, which builds its own sandbox $HOME, bare register repo and fake tmux;
  • the E/LOGD lines;
  • the whole Amendment 12 section;
  • the summary.

The copy's SRC_DIR is pinned to a given tree. It was run with env -u LANES_EDIT -u LANES_WORKSPACE_ROOT -u LANES_REPO -u LANES_LANE …:

tree result
f87fd5a, unchanged tests (baseline) 211 passed, 0 failed
f87fd5a code + this PR's tests (fail before) 229 passed, 14 failed — all 14 are new or changed assertions
a4acad3, this PR before the merges of main (pass after) 243 passed, 0 failed

I ran bash -n on lane-start, lanes-edit.sh and tests/test_lane_helpers.sh, and all three parse. I also applied tests/test_repo_hygiene.py's line-level bash rules to the three changed shell files at f87fd5a and at this head, using that file's own helper functions. The rules cover bash 3.2 variable names before non-ASCII characters, quoted replacements, case inside $( ), -- after an operand, the two spellings of a flag, and backticks in suite descriptions. There were no hits at either tree. I did not run pytest itself locally: the workstation's pytest lock was held by another lane's composed shell-suite run, with ten or more waiters queued. CI is the suite of record.

Compatibility

lanes-edit.sh and lane-start are installed together by openRepoTools --install, and the guard finds lane-start beside itself first. A mismatched older lane-start found on PATH answers unknown option '--bind' with exit 2. The guard's refusal prints that message and says the offer is kept, but by then the window has been renamed to the destination: choice 2 renames it before it runs lane-start, and nothing renames it back. So under real tmux the next prompt finds the window naming a different lane from the one the offer was made in. It DROPS the offer ("the offer has been DROPPED rather than answered on a state you were never shown") and refuses with the plain lane-start --no-launch <repo> <n> as the cure, a command whose step 3b veto 1 will not take this transcript while the row it left still records it. Choices 1 and 3 are not offered again. Main does the same after any lane-start refusal that follows the rename, so this is not a regression.

Closes #70

🤖 Generated with Claude Code

Summary by Sourcery

Add a guard-only binding mode so name-guard lane moves consistently bind and stamp the transcript the person approved.

New Features:

  • Add a guard-only lane-start --bind <uuid> mode that binds the live transcript to a lane while consistently attributing the row, log, handoff, and session cell to that transcript.
  • Route the name guard’s choice-2 flow through binding mode and report the resulting cell state without performing a separate register write.

Bug Fixes:

  • Ensure guard-driven moves do not record a RESUMED event for an unrelated transcript already associated with the destination lane.
  • Reject invalid or unsafe binding-mode invocations before modifying lane state or launching a session.

Enhancements:

  • Preserve existing transcript history while using the published row state and supported empty-cell anchors during binding.
  • Document the binding mode, its guard-only constraints, and the updated name-guard behavior.

Documentation:

  • Update lane documentation and command help to describe transcript binding and the revised choice-2 flow.

Tests:

  • Add coverage for binding-mode validation, existing-destination transcript mismatches, new-lane creation, session-cell commits, and prevention of guard-only flags in user-facing commands.

… being bound, so the offer's yes no longer records a RESUMED nobody is in (#70)

The name guard's choice 2 ran `lane-start --no-launch <repo> <n>` for the
lane a person renamed their session to. Step 3b's veto 1 refused the
session's uuid because the row being left still records it, so where the
destination row already named a transcript, lane-start took its ordinary
resume path and stamped the row, the lane's append-only log and the
handoff with `RESUMED by <the id the row already had>`, under --no-launch,
about a conversation nobody was in. The guard then appended the real uuid
to the cell itself, so the cell ended right and the log said otherwise.

Brett Heap ruled the shape ("Binding mode flag"): lane-start gains a mode,
used only by the guard, that stamps the id being bound. `--bind <uuid>` is
step 3b's own take with veto 1 answered by the person's choice 2 (clause
(h) rule 4's yes). It appends the uuid to the cell first, anchored on the
published last id or on the `none recorded` / `pending` text such a cell
carries, and the row stamp, the log line and the handoff's Rule 3 stamp all
name it. It binds or it refuses before anything is written: only with
--no-launch, never with --fresh or --agent, only for the session live in
this window, and never from a window still named for another lane (veto 2
stands). No printed command carries it.

The guard passes it, and its own append (`guard_bind_uuid`) becomes
`guard_bound_check`, a read that confirms the cell ends on this uuid or
prints the act. The old write is not kept as a fallback: it used the same
anchor, so it would have refused wherever lane-start's append did, and
after a timed-out push it would have appended the uuid twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces a guard-only binding mode that atomically records the transcript being moved before stamping resume state, fixing incorrect RESUMED identities when the destination row already references another transcript; the guard now delegates the write to lane-start, with expanded documentation and focused tests.

Sequence diagram for guard choice 2 binding flow

sequenceDiagram
    actor Person
    participant Guard as NameGuard
    participant LaneStart as lane-start
    participant Register as LaneRegister

    Person->>Guard: choose 2 at the name guard
    Guard->>LaneStart: lane-start --no-launch --bind G_ID repo n
    LaneStart->>LaneStart: validate --bind and live session
    LaneStart->>Register: append G_ID to session cell first
    LaneStart->>Register: stamp row, RESUMED log, and handoff with G_ID
    LaneStart-->>Guard: success
    Guard->>Register: guard_bound_check reads published cell
    Register-->>Guard: cell ends on G_ID
Loading

Flow diagram for lane-start binding validation

flowchart TD
    A[Guard invokes lane-start --no-launch --bind uuid] --> B{Binding arguments valid?}
    B -->|No| R[Refuse with exit 2; write nothing]
    B -->|Yes| C{Session live in this window?}
    C -->|No| R
    C -->|Yes| D{Window named for another lane?}
    D -->|Yes| R
    D -->|No| E[Append uuid to session cell first]
    E --> F[Stamp row, RESUMED log, and handoff with uuid]
    F --> G[Guard reads published cell and confirms bound uuid]
Loading

File-Level Changes

Change Details Files
Adds a guard-only --bind <uuid> execution path that binds the live session before generating any resume metadata, ensuring all resulting state identifies the transcript being moved. lane-start
lanes-edit.sh
docs/README-lanes.md
tests/test_lane_helpers.sh

Assessment against linked issues

Issue Objective Addressed Explanation
#70 Add a lane-start binding mode for the name guard’s choice 2 that binds the session live in the window and records that UUID in the destination lane’s cell and stamps, rather than stamping a resume of the destination’s prior transcript. ✅
#70 Prevent the guard’s choice 2 from producing a misleading RESUMED log entry under --no-launch for a transcript nobody is in. ✅
#70 Have the guard use lane-start to perform the binding instead of making its own session-cell register write, and document and test the new behavior. ✅

Possibly linked issues


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

Brett Heap and others added 3 commits October 18, 2026 03:51
… this PR on today's main

The branch was cut from f87fd5a; main has since moved fourteen commits, through
lane-start (#203's verified transcript holders), lanes-edit.sh, the lanes docs and
tests/test_lane_helpers.sh, the same four files this PR edits. The merge is clean,
and it lets the required checks run against the main this PR would land on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…row names the bound transcript and no minted id, and is stamped STARTED by it (#70)

This PR's body says a suite case covers choice 2 into a lane with no row, and none
did: every case of the binding mode drove a destination that already had a row. The
new case, after the #70 block in the Amendment 12 section, renames the session to
repoGD-8, which has no row, answers the offer to create it with `2`, and asserts
that the row lane-start creates names this transcript as the one uuid in its session
cell, is stamped STARTED by it, and opens the lane's log with one lane-kind line
naming it; that the guard reads it back as lane-start's own write; and that nothing
minted an id on the way. The #70 block also asserts now that its RESUMED is the
log's one lane-kind line. The assertions are an independent review's, adapted.

Against origin/main's lane-start and lanes-edit.sh (no binding mode) the case fails
five assertions: the row is born `harness <minted> (minted by lane-start, ...) ->
harness <this transcript>`, stamped `STARTED by <minted>`, its log's STARTED names
the minted id, lane-start prints `minted session id`, and the guard's read-back is
its own append rather than lane-start's. At this head it passes, and the Amendment 12
section runs 256 passed, 0 failed in isolation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… this PR on today's main

Main moved one commit past the first merge: #209, which also edits
tests/test_lane_helpers.sh and docs/README-lanes.md. The merge is clean, and it
puts the required checks on the main this PR would land on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

brettheap added a commit that referenced this pull request Oct 18, 2026
… act on every verified child, not the first (#76, #86) (#205)

Landed on Brett Heap's word "land #205 #222 #223 #239 when green" (2026-10-18), by lane openRepoTools-5. Required Linux CI (guard-launch-mode, tests, tests-no-submodule; run 39148145583) was green on head 4c7e847 with main babd9fe in its tree. Main a059c1a merged with head 4c7e847 is tree 55e51f6, which queue run 39154616302 (workflow_dispatch of tests on cb9da52) tested whole and green.

Independent review (lane 5, Opus, of d4cf2ee) and delta review of de0809c with its polish 0cf7417 confirmed: LAND; the merges of main add nothing to the PR's own lines. The --resume condition is Brett Heap's ruling of 2026-10-18.

Closes #76
Closes #86

Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Oct 18, 2026
…ct is read off the lane's live window from any window, and the guard's cure for a lane named before Rule 4 says what it cannot fill in (#73) (#222)

Landed on Brett Heap's word "land #205 #222 #223 #239 when green" (2026-10-18), by lane openRepoTools-5. Required Linux CI (guard-launch-mode, tests, tests-no-submodule; run 39146171277) was green on head 0b72a5c with main babd9fe in its tree. Main a656627 merged with head 0b72a5c is tree 7aee6bf, which queue run 39154621848 (workflow_dispatch of tests on 0dbafc9) tested whole and green.

Independent review (lane 5, Opus, of 2946a41): LAND; the merges of main add nothing to the PR's own lines.

Closes #73

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brettheap
brettheap marked this pull request as ready for review October 18, 2026 19:52
@sourcery-ai

sourcery-ai Bot commented Oct 18, 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 2 days and 23 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@brettheap
brettheap merged commit 7748375 into main Oct 18, 2026
5 checks passed
brettheap added a commit that referenced this pull request Oct 18, 2026
…otes, and the suite stops counting its bash files (#54 part b, #58) (#239)

Landed on Brett Heap's word "land #205 #222 #223 #239 when green" (2026-10-18), by lane openRepoTools-5. Required Linux CI (guard-launch-mode, tests, tests-no-submodule; run 39136612565) was green on head 7c4df04 with main 586dea2 in its tree. Main 7748375 merged with head 7c4df04 is tree 8c13769, which queue run 39154634006 (workflow_dispatch of tests on 1d149e3) tested whole and green.

Independent review (lane 5, Opus, of bb3c7dc): LAND; the later commits 5f1c329 and 7c4df04 change comments only.

Closes #54
Closes #58

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

1 participant