Skip to content

Amendment 16 tooling: a lane is renamed by ONE WORD in ONE COMMIT — lane-rename moves the row, the log, the handoff and lanes/aliases.tsv together, and the old name resolves for ever in every reader - #81

Merged
brettheap merged 12 commits into
mainfrom
feat/amendment-16-lane-rename
Sep 16, 2026

Conversation

@brettheap

@brettheap brettheap commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Tooling half of lane-collision-protocol Amendment 16 — closes #35.

Ratified by Brett Heap 2026-09-14T09:24:35Z, verbatim "Ratify as drafted
(Recommended)"
, on his request of the same day, verbatim: "we need the ability
to rename a lane. maybe lanes --rename ."

A LANE IS RENAMED BY ONE WORD, IN ONE COMMIT, AND ITS OLD NAME KEEPS RESOLVING
FOR EVER.

Why: on 2026-09-14 two lanes renamed themselves by hand, each as one
RENAMED line appended to LANES.md. "The lines are honest and they are all
there is"
— the rows still carried the old keys, the logs and the handoffs the
old names, and a reader of either lane's history had to know the rename to
follow it.

The acts

# act where
1 lanes-edit.sh rename-lane <old> <new> ["<why>"] [--verbatim] [--no-github] — ONE commit, refused or whole lanes-edit.sh
2 RENAMED in VERB_LIST as a lane-kind verb that changes no object's state lanes-edit.sh
3 alias resolution in every reader that takes a lane name, through ONE seat lanes-edit.sh
4 lane-rename — the word on PATH, placed by --install new file
5 lanes --rename refuses and names the word (clause (h)) lanes
6 tests on a seeded register tests/test_lane_helpers.sh
7 docs docs/README-lanes.md, README.md, AGENTS.md

1 — the write

Clause (a)'s refusals first, and every one of them says "Nothing was
written."
— no row under <old> in any case and through no alias; a row under
<new> in any case (a CASE-ONLY rename is named as Amendment 15(d)'s hand act,
not this command's); <new> not <repo>-<n> without --verbatim; a LIVE
session holding <old> in another window (live_holder's here verdict is the
one exemption — a lane renames itself); two rows differing only by case; a
cycle in the alias table, asked of the table as it will be; a session field
that is not a transcript uuid; and a row or a log origin carries that this
checkout has not pulled. This command moves four files, and a half-done rename
is not something a second run can finish.

Then clauses (b)–(e), in ONE commit: the row's key cell → `<new>` with
*(ex `<old>`, renamed <UTC>)* beside it, the session cell keeping its whole
history; lanes/log/<old>.md → lanes/log/<new>.md plus a RENAMED line, with
the lines above it never rewritten; the handoff the row names → the same date
with lane-<new> plus a Rule 3 stamp, spliced with the byte-for-byte proof
lane-start makes for its own RESUMED by, and the row's handoff column
following the file; and lanes/aliases.tsv gaining <old><TAB><new><TAB><UTC>.

Then clause (g): one GitHub comment per object the lane HOLDS — Amendment
7(b)'s partition, the same set lane-end refuses on and who --lane reports —
posted only after the commit has landed and citing its sha, exactly as claim's
is, and skipped by --no-github.

The git mv of (c) and (d) is a plain mv plus a pathspec: git mv also
STAGES, and commit_push commits from its pathspecs precisely so a peer's
uncommitted work in this shared checkout can never be swept into a lane's commit.

3 — clause (e) is ONE seat, not a list of readers

Clause (e) lists the readers that resolve through the table. That list is not
built as a list: Amendment 15 already put canon_lane in front of every
<lane> argument and every $LANES_LANE, so the resolution is hooked there —
a row wins over an alias, a chain resolves to its end, and the resolution
says so on stderr. Two reads that take a name without going through it take the
same function one layer down: lane_named_ci (the SessionStart block) and the
guard's window and session lookups.

And the lane field of every old log line is resolved on the way in, in
LOG_AWK. Clause (c) never rewrites those lines, so a renamed lane's log holds
its history under two names in one file — and read byte for byte, half of that
lane's holds would be invisible to who --lane and to lane-end's refusal. One
rule in the parse serves lane_objects, superseded_by, holders_of,
lane_row_facts and first_landed_of at once.

4 and 5 — the two names a register writer may not touch

lane-rename renames the tmux window (one tmux call any client may make) and
types /rename <new> into the lane's own pane under M1's conditions — the only
path a running session's name has. Run from anywhere else it renames the lane and
says what is left, and Amendment 12's name guard finishes both at that lane's
next prompt
, out of the same alias table: it resolves the window's former name
to the row, renames the window itself, and types the /rename.

lanes --rename is refused with the one word to type, filled in from the
arguments given: Amendment 11(j)'s "it writes nothing" is untouched.

Counts

Twelve files → THIRTEEN; twenty-six artifacts → TWENTY-SEVEN. Derived
from INSTALLABLES and from the three lists in
tests/test_openrepotools_command.py, never restated: the installer, README.md
(13 of 13 placed), AGENTS.md, docs/README-lanes.md, the macOS bash-3.2
parse list in .github/workflows/tests.yml and HELPER_BASH in
tests/test_repo_hygiene.py all move with them. A local --install into a
sandbox $HOME places thirteen files including lane-rename and reports 27
artifacts unchanged on the second run.

Tests

A section of its own in tests/test_lane_helpers.sh, on a seeded register with a
row, a held object and a handoff named for the lane: every refusal in clause (a),
each with the checkout proved untouched afterwards; the four moves in ONE commit,
asserted on the commit's own name list and on rev-list --count; the old name
resolving through canon-lane, who --lane, who <object>, lane-objects,
register-row, live-holder, lanes, Rule 6 attribution and the SessionStart
block; a chain resolving to its end; a cycle refused at write time; the new verb
skipped by the last-lane-kind-line read (lane-last, swapped); lanes --rename; the guard renaming a window that carries a former name and typing the
/rename into the pane; and the word itself, in and out of the lane's own
window.

Not in this PR

The amendment's adoption act — the two hand renames of 2026-09-14 run through
this command on Brett Heap's word (clause (i): regularised, not re-done). No real
lane was renamed by this branch.

Lane: openrepotools-3 (openRepoTools-3)

🤖 Generated with Claude Code

Summary by Sourcery

Provide a single-command, atomic lane-renaming workflow that updates all related records while preserving permanent compatibility with the old lane name.

New Features:

  • Add the lane-rename command to rename a lane and keep its previous names resolvable across the tooling.
  • Support atomic lane renames covering the register row, object log, handoff, and alias table, with post-commit GitHub notifications and tmux/session name handling.

Bug Fixes:

  • Prevent partially applied lane renames by validating prerequisites up front and rolling back filesystem changes when a write fails.
  • Ensure renamed-lane history, object ownership, session startup, guard behavior, and attribution continue to work through aliases and legacy log entries.

Enhancements:

  • Introduce case-insensitive, chained lane-alias resolution with row precedence and cycle detection.
  • Treat RENAMED as a non-state-changing lane event and reject attempts to create it manually.
  • Keep lanes read-only by directing lanes --rename requests to lane-rename.

Build:

  • Update installation and artifact inventories to include the new lane-rename executable.

CI:

  • Extend shell parsing, hygiene, installer, and lane-helper coverage for the new command and updated artifact counts.

Documentation:

  • Document lane renaming, alias persistence, refusal conditions, installation, and reader behavior in the README and lane tooling guide.

Tests:

  • Add seeded-register coverage for rename refusals, atomic commits, rollback behavior, alias chains and cycles, reader resolution, guard repair, tmux/session integration, and command installation.

…s for ever: `lane-rename` moves the row, the log, the handoff and `lanes/aliases.tsv` together, because any two of them apart is a state no reader can read (Amendment 16)

lane-collision-protocol **Amendment 16**, ratified by Brett Heap
2026-09-14T09:24:35Z verbatim *"Ratify as drafted (Recommended)"*, on his
request of the same day, verbatim: *"we need the ability to rename a lane.
maybe lanes --rename <current lane name> <new lane name>."* #35.

WHY: two renames by hand in one night. On 2026-09-14 two lanes renamed
themselves by appending one `RENAMED` line to `LANES.md` — *"the lines are
honest and they are all there is"*: the rows still carried the old keys, the
logs and handoffs the old names, and a reader of either lane's history had to
know the rename to follow it.

THE ACTS

* `lanes-edit.sh rename-lane <old> <new> ["<why>"] [--verbatim] [--no-github]`
  — ONE commit, refused or whole. Clause (a)'s refusals first, every one of
  them saying *"Nothing was written."*: no row under `<old>` in any case and
  through no alias; a row under `<new>` in any case (a CASE-ONLY rename is
  named as 15(d)'s hand act, not this command's); `<new>` not `<repo>-<n>`
  without `--verbatim`; a LIVE session holding `<old>` in another window
  (`live_holder`'s `here` verdict is the one exemption — a lane renames
  itself); two rows differing only by case; a cycle in the alias table; a
  session field that is not a transcript uuid; a published row or log this
  checkout has not pulled. Then the four moves of (b)–(e) in ONE commit: the
  row's key cell → `` `<new>` `` with `*(ex `<old>`, renamed <UTC>)*` beside
  it; `lanes/log/<old>.md` → `lanes/log/<new>.md` plus a `RENAMED` line; the
  handoff the row names → the same date with `lane-<new>` plus a Rule 3 stamp,
  SPLICED with the byte-for-byte proof `lane-start` makes for its own, with the
  row's handoff column following; and `lanes/aliases.tsv` += `<old><TAB><new>
  <TAB><UTC>`. Then (g): one GitHub comment per object the lane HOLDS, after
  the commit lands and citing its sha, exactly as `claim`'s is.
* `RENAMED` joins `VERB_LIST` as a LANE-KIND verb that changes no state, and it
  is outside the last-line rule BY CONSTRUCTION: every state read here
  enumerates the five verbs that do. `log RENAMED` by hand is refused and names
  `lane-rename` — a line on its own is the hand rename this amendment replaces.
* CLAUSE (e) IN ONE SEAT, not in a list of readers. Amendment 15 already put
  `canon_lane` in front of every `<lane>` argument and every `$LANES_LANE`, so
  the alias table is resolved there: a row wins over an alias, a chain resolves
  to its end, and the resolution says so on stderr. Two reads that take a name
  without going through it take the same function one layer down —
  `lane_named_ci` (the `SessionStart` block) and the guard's window and session
  lookups. And the LANE FIELD OF EVERY OLD LOG LINE is resolved on the way in,
  in `LOG_AWK`: clause (c) never rewrites those lines, so a renamed lane's log
  holds its history under two names in one file, and read byte for byte half of
  its holds would be invisible to `who --lane` and to `lane-end`'s refusal.
* `lane-rename` on PATH, placed by `--install`: it renames the tmux window and
  types `/rename <new>` into the lane's own pane (Amendment 12(h) M1), which is
  what a register writer may not do. From elsewhere it prints what is left —
  and the name guard finishes both at the lane's next prompt, renaming the
  window itself (one tmux call) and typing the `/rename`.
* `lanes --rename` is REFUSED with the one word to type, filled in: Amendment
  11(j)'s *"it writes nothing"* is untouched (clause (h)).

COUNTS: twelve files → THIRTEEN, twenty-six artifacts → TWENTY-SEVEN, derived
from `INSTALLABLES` and from the three lists in
`tests/test_openrepotools_command.py` and restated nowhere; the installer,
`README.md`, `AGENTS.md`, `docs/README-lanes.md`, the macOS bash-3.2 parse list
and `HELPER_BASH` all move with them.

TESTS: a section of its own in `tests/test_lane_helpers.sh` on a seeded
register — every refusal with the checkout proved untouched after each, the
four moves in ONE commit, the old name resolving through `canon-lane`, `who
--lane`, `who <object>`, `lane-objects`, `register-row`, `live-holder`,
`lanes`, Rule 6 attribution and the `SessionStart` block, a chain, a cycle
refused, the verb skipped by the last-lane-kind-line read, `lanes --rename`,
the guard renaming a window that carries a former name and typing the
`/rename`, and the word itself in and out of the lane's own window.

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 15, 2026 13:25

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@sourcery-ai

sourcery-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown

Reviewer's Guide

Implements Amendment 16 lane renaming through a new lane-rename command backed by a validated, path-scoped atomic commit, persistent alias resolution across readers and historical logs, tmux/session coordination, and extensive tests and documentation.

State diagram for lane rename lifecycle

stateDiagram-v2
    [*] --> Current
    Current --> Refused: validation fails
    Refused --> Current: Nothing was written
    Current --> Renamed: one atomic commit
    Renamed --> Renamed: old name resolves via aliases.tsv
    Renamed --> Renamed: historical log fields canonicalized on read
    Renamed --> [*]
Loading

File-Level Changes

Change Details Files
Adds an atomic lane rename workflow that updates register, log, handoff, alias table, tmux state, and post-commit GitHub notifications.
  • Validates rename preconditions, alias-cycle safety, live-session ownership, UUIDs, collisions, naming form, and clean path-scoped commits.
  • Moves and edits the lane row, object log, and handoff while appending a persistent alias mapping.
  • Adds the lane-rename PATH command and rejects lanes --rename with guidance.
  • Renames the tmux window and coordinates the session /rename behavior.
  • Posts one commit-referencing comment per held object unless GitHub posting is disabled.
lanes-edit.sh
lane-rename
lanes
Centralizes former-name resolution so lane readers and log parsing continue to address the current lane indefinitely.
  • Extends canon_lane and related row/session/guard lookups with case-insensitive alias chains and row-over-alias precedence.
  • Canonicalizes lane fields and lane objects while parsing historical log lines without rewriting them.
  • Adds cycle handling, cache/flush behavior, and origin-aware alias-table reads.
lanes-edit.sh
Introduces comprehensive Amendment 16 coverage and updates installer/hygiene expectations for the new artifact.
  • Tests refusals, atomic commit contents, alias chains, historical holds, state readers, guard behavior, tmux/session renaming, and CLI usage.
  • Adds lane-rename to installation, syntax, executable, artifact-count, and repository hygiene checks.
  • Updates seeded fixtures and expected counts from twelve files/twenty-six artifacts to thirteen/twenty-seven.
tests/test_lane_helpers.sh
tests/test_openrepotools_command.py
tests/test_install_skill_and_hook.py
tests/test_repo_hygiene.py
.github/workflows/tests.yml
openRepoTools
Documents the Amendment 16 command, alias-table contract, atomicity guarantees, and installation changes.
  • Documents command syntax, refusal cases, four-file commit semantics, reader resolution, handoff/log behavior, and read-only lanes --rename.
  • Updates PATH installation and artifact counts throughout project guidance.
README.md
docs/README-lanes.md
AGENTS.md

Assessment against linked issues

Issue Objective Addressed Explanation
#35 Implement lanes-edit.sh rename-lane <old> <new> as an all-or-nothing operation that validates refusals before writing, moves and updates the lane row, log, handoff, and alias table in one commit, and posts one GitHub comment per held object afterward unless disabled. ✅
#35 Add the RENAMED lane verb and resolve lane aliases case-insensitively, including chains, through all lane-name readers and state/log parsing without changing lane or object state. ✅
#35 Provide the PATH-level lane-rename command with tmux/session integration, reject lanes --rename, update installation counts, tests, and documentation, including regularizing the two existing hand renames from 2026-09-14. ❌ The command, installer changes, tests, and documentation are included, but the PR explicitly states that the Amendment 16 adoption act was not performed: the two existing hand renames were not actually run through lane-rename and no real lane was renamed by this branch.

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

… option a person cannot find is an option they do not use — and this is the spelling Brett Heap reached for

`tests-windows` on 63fe837 caught it, by this repository's own rule
(`test_every_option_the_parser_accepts_is_in_the_usage`): `lanes` parsed
`--rename` and its synopsis line never named it. The rule exists for exactly
this — `--prefix` was parsed, documented in the BODY and missing from the line a
person reads first — and it bites harder here, because `lanes --rename <old>
<new>` is the spelling the amendment's own request used, verbatim *"maybe lanes
--rename <current lane name> <new lane name>"*. A person who types it and gets a
usage line has been answered with nothing; a person who reads the synopsis
should find it there and learn the word.

So the synopsis carries it, and the body says what it is: a REFUSAL that names
`lane-rename <old> <new>`, with the reason it is a word of its own — `lanes`
writes nothing (Amendment 11(j)) and a rename is four files in one commit
(Amendment 16(h)).

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical and moderate issues affect atomic rename integrity and alias resolution.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds Amendment 16 lane renaming with permanent alias resolution across tooling.

Changes:

  • Adds lane-rename and atomic rename support.
  • Updates alias handling, logs, handoffs, tmux sessions, and readers.
  • Expands tests, installation metadata, CI checks, and documentation.
File summaries
File Summary
tests/test_repo_hygiene.py Updates hygiene checks for the new command.
tests/test_openrepotools_command.py Updates command and artifact inventories.
tests/test_lane_helpers.sh Adds lane-rename integration coverage.
tests/test_install_skill_and_hook.py Updates installation expectations.
README.md Updates installation counts and lane documentation.
openRepoTools Installs the new command and updates counts.
lanes-edit.sh Implements rename, alias, log, handoff, and reader logic.
lanes Refuses --rename and directs users to lane-rename.
lane-rename Adds the PATH-facing rename wrapper.
docs/README-lanes.md Documents Amendment 16 behavior.
AGENTS.md Updates tooling and artifact guidance.
.github/workflows/tests.yml Adds syntax validation for lane-rename.
Review details

Suppressed comments (2)

lane-rename:91

  • The usage text omits the tab delimiters and UTC field that the implementation actually writes, so it documents a different alias-file format. Show the full TSV record here to keep the command's public contract accurate.
`lane-<new>` plus a Rule 3 stamp, and `lanes/aliases.tsv` gains `<old> <new>`.

lanes-edit.sh:3286

  • This traversal is capped at 32 hops even when no cycle is found. After a valid chain exceeds 32 renames, an earlier alias returns an intermediate name instead of the chain's end, so canon_lane cannot find the row and old-name reads stop resolving. The contract says chains resolve to their end; the walk needs cycle detection without truncating valid chains.
      for (i = 0; i < 32; i++) {
  • Files reviewed: 12/12 changed files
  • Comments generated: 11
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lane-rename Resolved
Comment thread lane-rename Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Copilot AI review requested due to automatic review settings September 15, 2026 13:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical and moderate issues remain in alias resolution and atomic rename handling.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (13)

Previously missed (1) — in code that hasn't changed since the last review.

lanes-edit.sh:3286

  • Alias resolution stops after 32 hops and returns the current intermediate name as if it were the chain's end. The writer does not cap the number of renames, so a valid 33+ entry chain can resolve old names to the wrong lane and can also evade cycle detection, violating Amendment 16(e)'s chain-to-end guarantee. Let the existing seen-key check terminate the walk instead of imposing an unvalidated hop limit.

lane-rename:186

  • This says rerunning the same command repairs a commit whose tmux window rename failed, but after the first commit canon_lane <old> returns <new>. The writer then sees the requested names as the same lane and refuses at its case-only/non-rename check, so the documented retry cannot reach the window repair (and the analogous pane failure is also not idempotent). Add an idempotent post-commit repair path or make the retry bypass the already-landed register write.
# THIS WINDOW IS THE LANE'S WHEN IT CARRIES ITS NAME. Compared without case
# (Amendment 15) against BOTH names: `<old>`, which is the ordinary state, and
# `<new>`, which is the state a re-run leaves — a rename whose write landed and
# whose window rename did not is finished by running the same command again.

lane-rename:191

  • The ownership check compares tmux's raw window name only with the raw old/new arguments. If old is a former alias, the writer resolves it to the current canonical row, but a window carrying that canonical name is classified as elsewhere; after the commit this wrapper therefore skips both the window rename and the /rename typing even though it is running in the lane's own window. Resolve the old/window names through the same alias seat before setting here.
# THIS WINDOW IS THE LANE'S WHEN IT CARRIES ITS NAME. Compared without case
# (Amendment 15) against BOTH names: `<old>`, which is the ordinary state, and
# `<new>`, which is the state a re-run leaves — a rename whose write landed and
# whose window rename did not is finished by running the same command again.
here=0
if [ -n "$win_name" ]; then
	[ "$(lc "$win_name")" = "$(lc "$old")" ] && here=1
	[ "$(lc "$win_name")" = "$(lc "$new")" ] && here=1
fi

lanes-edit.sh:7637

  • This branch deliberately leaves a handoff in place unless its basename ends in -lane-<old>.md. Paths such as handoffs/.../x.md are valid row values elsewhere in this repository, but clause (d) requires the row-named handoff to move to the same date with lane-<new>. As written, the row/log/alias rename can commit while that handoff keeps its old name, so the promised four-artifact operation is incomplete. Derive a new name for every supported form or refuse before writing when it cannot be transformed.
      # `lane-<new>` (clause (d)). ANY OTHER SHAPE IS LEFT WHERE IT IS: a
      # handoff not named for its lane has no `lane-<name>` in it to rename,
      # and inventing one would move a file the row points at to a path the
      # row's own history never named. Matched case-insensitively and cut by

lanes-edit.sh:7750

  • When the row names a handoff outside LANES_REPO, this code explicitly moves and stamps it but excludes it from rl_paths, then asks the user to commit it separately. That leaves the row/log/alias commit without the required handoff and violates the stated refused-or-whole, one-commit rename. Refuse this case before any move (or otherwise perform the whole operation in a repository that can commit the handoff).
      if [ -z "$rl_h_rel" ]; then
        note "the handoff is outside the workspace repository ($rl_hfile_new), so it is moved and stamped but is NOT in this commit; commit it where it lives."
      fi

lanes-edit.sh:7745

  • A failure to splice the RENAMED stamp is only reported with note, and execution continues to commit_push. The row, log, and alias can therefore land while an unreadable or unstampable handoff lacks the required Rule 3 update, even though the documented clause (a) behavior is to refuse an unreadable handoff before writing. Treat this failure as a preflight refusal or roll back the earlier moves.
          note "the handoff could not be stamped without rewriting a byte of it, so it was NOT stamped. Add this line under its header block by hand: $rl_hstamp"
        fi
      else
        note "the handoff could not be read, so it was NOT stamped. Add this line under its header block by hand: $rl_hstamp"

lanes-edit.sh:3225

  • On a local-only checkout with a present but unreadable aliases.tsv, the cat failure is swallowed and the cache is populated as “no lane aliases.” That violates the fail-closed refusal contract and can let the log/handoff moves happen before the later alias append fails, leaving a partial rename. Preserve the read error and refuse before the first move instead of treating the file as empty.
  elif [ -n "${LANES_ALIASES_TSV:-}" ] && [ -f "$LANES_ALIASES_TSV" ]; then
    lat_t="$(cat -- "$LANES_ALIASES_TSV" 2>/dev/null || :)"

lanes-edit.sh:1892

  • The log parser has the same 32-hop truncation, so even if shell readers resolve a long alias chain correctly, state readers such as who and lane-end still canonicalize historical log fields to an intermediate name. A 33+ rename chain therefore makes valid holds disappear from the state stream. Remove the fixed bound and rely on the existing visited-name cycle check.
  for (i = 0; i < 32; i++) {

lanes-edit.sh:7689

  • At this point rl_paths includes the new log, aliases.tsv when it does not yet exist, and the new handoff path before any of them are created. If LANES.md or the old log already has a peer edit, handle_preexisting passes those missing pathspecs to git add/commit; the failures are ignored, so the dirty peer edit remains and can be swept into the final rename commit. Capture only paths that existed before the move (or fail closed) before proceeding.
    refuse_dirty_checkout "rename lane $rl_old" "${rl_paths[@]}" "$LANES_PATH"
    acquire_lock
    capture_register_edit "${rl_paths[@]}"
    handle_preexisting "${rl_paths[@]}"

lanes-edit.sh:7563

  • The target-log guard checks only the exact new pathname. Amendment 15 treats log filenames case-insensitively, so on a case-sensitive filesystem an existing lanes/log/RepoRen-4.md is missed and repoRen-4.md is created beside it; subsequent readers see two logs for one lane and refuse or lose history. Check both the working tree and origin for case-insensitive target collisions before moving the old log.
    [ ! -e "$rl_log_new" ] || die "$rl_log_new_rel already exists in this checkout while lane '$rl_new' has no row: that file is not this rename's to write into, and appending one lane's history to another's is the one thing an append-only log cannot be walked back from. Nothing was written." 2
    if have_remote_ref && git -C "$LANES_REPO" cat-file -e "origin/$LANES_BRANCH:$rl_log_new_rel" 2>/dev/null; then
      die "$rl_log_new_rel is published on origin/$LANES_BRANCH while lane '$rl_new' has no row — renaming into it would merge two lanes' histories into one append-only file. Nothing was written." 2

lanes-edit.sh:7771

  • This is the first attempted write to aliases.tsv, but it occurs after the log and handoff have already been moved/stamped. If the table is present but unwritable, or its read was swallowed and the append/proof fails, the command exits after those earlier mutations and leaves a half-renamed checkout. Check the alias table's readability/writability during preflight and refuse before any move, or stage the complete rename before replacing files.
    append_text_line "$(printf '%s\t%s\t%s' "$rl_old" "$rl_new" "$rl_utc")" "$LANES_ALIASES_TSV"

lanes-edit.sh:7718

  • When the row names a handoff that is missing, this branch deliberately continues and later commits the row, log, and alias entry. That leaves the renamed row pointing at no handoff, contrary to the documented refusal for an unreadable handoff and the promised four-artifact, refused-or-whole operation. Treat a named-but-missing handoff as a pre-write refusal (or otherwise make the handoff part of the transaction).
    elif [ ! -f "$rl_hfile" ]; then
      note "the handoff the row names is not at $rl_hfile, so nothing was moved or stamped and the row's handoff column is left exactly as it is. If it turns up, rename it — $rl_hcell → $rl_hpath_new — and stamp it: $rl_hstamp"

lanes-edit.sh:7669

  • The handoff destination collision check also uses exact -e only. On a case-sensitive filesystem, an existing handoff whose lane suffix differs only by case is not detected and mv leaves both files, even though lane names are case-insensitive and the operation is supposed to move the one handoff rather than create a second one. Check destination paths case-insensitively (and include dangling symlinks) before the write.
      [ "$rl_hmove" = 1 ] && [ -e "$rl_hfile_new" ] && \
        die "the handoff would move to $rl_hfile_new and something is already there. That path belongs to lane $rl_new's own handoff and is not this rename's to overwrite. Move it aside and re-run. Nothing was written." 2
  • Files reviewed: 12/12 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Copilot AI review requested due to automatic review settings September 15, 2026 14:52
…kup in the parse cannot tell a renamed lane's history from a NEW lane minted under the name it freed — and every failure between the first move and the commit is rolled back

Fourteen threads on #81, taken in full except one, which
is declined below with the clause it is measured against.

THE ONE THAT CHANGED THE DESIGN. The parse resolved a log line's `lane <name>`
field through the alias table. Copilot found the case that breaks: a rename
FREES the old name — no row carries it, so `lane_next_free` hands the position
out — and a new lane can legitimately be called it. From that moment the field
`lane <old>` is ambiguous, and no amount of resolving a NAME tells the two
apart, because the name is the same. Adding row precedence to the walk only
moved the corruption: with it, the RENAMED lane's own historical lines were
pulled on to the new lane instead.

THE FILE ANSWERS IT, and it needed no table at all. Amendment 7's first sentence
is one file per lane, single writer; Amendment 15 makes its name the row's own
spelling; clause (c) MOVES it with the rename. So `lanes/log/<lane>.md` IS the
statement of which lane every line in it belongs to. `LOG_AWK` now takes the
lane (and the `lane:<name>` object, which is the writing lane by construction)
from the file's own name, and the field stays on the line as the spelling
somebody typed. That also settles, with nothing added, the two spellings of one
lane Amendment 15 had to reason about line by line — and it deletes the alias
map, the register map, the `AF`/`RF` plumbing and `alias_awkfile` from the
parser outright.

THE REST, in the order Copilot raised them:

* An unreadable `lanes/aliases.tsv` read as an EMPTY table. It fails closed now:
  `lane_alias_text` answers 5 with the reason in `LANES_ALIAS_ERR`, every write
  that asks refuses, and `canon_lane` — which may not refuse, since every
  `<lane>` argument on the workstation passes through it — says out loud that
  whether the name is a former one is NOT established.
* A `<new>` that is already an alias KEY is refused. A row wins over an alias,
  so minting one under a name another lane was renamed away from would END that
  name's resolution, which is the one thing clause (e) promises never happens.
* The 32-hop cap truncated a valid chain as well as a cycle, so an estate that
  renamed one lane thirty-three times would have its earliest names resolve to
  an intermediate one. The `seen` set is what guarantees termination — every hop
  consumes one key of a finite map — so the bound is now the table's own size.
* `rows_named_ci_alias` took the chain's END. It walks hop by hop, stopping at
  the first name that HAS a row: "a row wins over an alias" at every hop, which
  is the same rule the parse now gets from the file name.
* A handoff OUTSIDE the workspace repository was moved, stamped and left out of
  the commit — so "four moves, one commit" was not true of that row. Refused
  before anything is written, naming the path `lane-start` computes.
* A `lanes/log/<new>.md` of another CASE, here or on `origin`, was missed by the
  exact-path guard. Both scans are case-insensitive now, like every other case
  question in this file.
* A handoff that cannot take Rule 3's stamp was a `note` and the rename
  committed anyway, leaving it moved and unstamped. It is a refusal, and the
  unchecked redirect that let an unwritable file reach the "stamped" note is
  checked — this file runs `set -u` and not `set -e`.
* AND EVERY FAILURE BETWEEN THE FIRST MOVE AND THE COMMIT IS NOW ROLLED BACK.
  The refusals all happen before the first byte, but a filesystem can still
  refuse the third of four moves. The writes are made against a snapshot taken
  before the first of them, and `cleanup` restores it on EXIT and on both
  signals — which is the only hook that covers `replace_line`, a function that
  dies inside itself and after which a caller cannot put a line. The register is
  not in the snapshot and does not need to be: `replace_line` proves the new
  file before it writes a byte of `LANES.md`.
* `lane-rename` computed "is this the lane's own window" from the typed `<old>`,
  so a lane renamed through an OLDER name skipped both acts clause (f) gives it.
  It asks `canon-lane` of the window's name instead, after the write. And the
  repair run it documented could not work — the writer resolves `<old>` through
  the alias it just wrote and refuses — so a refusal is now asked WHICH ONE it
  is: where `<old>` already resolves to `<new>`, the write is done and this
  command runs its own half.
* Its usage said `lanes/aliases.tsv` gains `<old> <new>`; it gains a TAB-separated
  record with the UTC.

DECLINED, with the clause: *"a missing handoff must fail closed"*. Clause (a)'s
fail-closed is for "an unreadable register or records" — the register and the
SESSION records, which is the `live-holder` read — and a row naming a handoff
nobody has written yet is ORDINARY: every lane has one until its first swap.
Refusing there would make those lanes unrenameable. A handoff that EXISTS and
cannot be read or stamped is a different thing and is now a refusal, above.

Tests: the Amendment 16 section is 122 assertions (from 93) — the alias-key
refusal, a name that is an alias key AND a row again keeping its own holds under
both readings, a case-variant target log, an external handoff, an alias table
that cannot be read, a hand-written cycle read as no answer, and the rollback
proved by making a handoff unwritable and reading the log back byte for byte.
`bash tests/test_lane_helpers.sh`: 2469 passed, 0 failed, 0 skipped.

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@brettheap

Copy link
Copy Markdown
Contributor Author

Copilot round 2 (review on 49ddcca) — twelve of its thirteen suppressed comments are taken in 1a78ae4, which landed after that review was written: the 32-hop cap, lane-rename's false retry claim and its raw-name ownership check, the external handoff, the unreadable alias table, the alias-key collision, the case-variant target log, the unchecked stamp redirect and the half-renamed tree all have replies on their round-1 threads, and every one of those threads is resolved.

One is new, and it is DECLINED with a measurement.

lanes-edit.sh:7637 — this branch deliberately leaves a handoff in place unless its basename ends in -lane-<old>.md … the row/log/alias rename can commit while that handoff keeps its old name, so the promised four-artifact operation is incomplete. Derive a new name for every supported form or refuse before writing when it cannot be transformed.

Three things, in order of weight.

1. The four artifacts ARE all in the one commit. Where the row names a handoff that exists, it is stamped with Rule 3's line and its path is a pathspec of the same commit (rl_h_touch → rl_paths), whether or not its NAME changed. What is skipped in that branch is the rename of one of the four, not its presence.

2. Clause (d) defines the rename only for the form it names — "is git mv'd to the same date with lane-<new>". "The same date with lane-<new>" has no meaning for a file called x.md: there is no date in it and no lane in it, so a derived name would be a path the row's own history never carried, pointing at a file no reader of that lane has ever looked for.

3. Refusing would make most of this estate unrenameable. Measured on the register this amendment was written for, opensoft/brett-wip lanes/LANES.md at main:

rows with a handoff: 52; matching -lane-<name>.md: 10

The other 42 are *(none)*, an em dash, a path with commentary after it (…-lane-xFactory-2.md (written 2026-09-10T12:19Z, committed in new-workstation)), a pre-Amendment-8 spelling with no -lane- at all (session-handoff-2026-09-09-opsxfactory-3.md), or a template line. A refusal there would refuse four renames in five on the day the command ships, for a naming convention the rows predate — and lane-rename` exists because two lanes renamed themselves by hand rather than not at all.

So: the name is transformed where there is a lane in it to transform, the file is stamped and committed either way, the row's handoff column follows only where the file actually moved — a column pointed at a path nothing moved to names a file that is not there — and every one of those outcomes is said on stderr rather than left to be discovered.

A fresh review of 1a78ae4 is requested.

Lane: openrepotools-3 (openRepoTools-3)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical and moderate correctness and rollback issues remain in the lane-renaming and alias-resolution paths.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (3)

lane-rename:306

  • The pane selected here is not proven to belong to the lane being renamed. here was established from the window name alone, while window-session returns any live interactive session in that window; if a window named <old> contains another Claude session, this code can send /rename <new> to that unrelated session. Require the returned session id to match the renamed row's session (or leave the pane unset and print the manual instruction).
if have_tmux && [ -n "$win_harness" ]; then
	ws_out=""
	ws_out="$("$LANES_EDIT" window-session "$win_harness" 2>/dev/null)" || ws_out=""
	if [ -n "$ws_out" ]; then
		# `<sid><US><tmux><US><name><US><pid><US><profile>`, the record's own
		# fields — and the second is `<session>:<@id>.<%pane>`, a WINDOW target
		# with the pane on the end of it.
		#
		# THE PANE IS TAKEN OUT OF IT, AND ONLY FROM A TARGET THAT NAMES THIS
		# WINDOW — `guard_run`'s own rule, for the reason stated there: tmux
		# REUSES window ids, so a record placed in this window by its pid can
		# carry a target another window now answers to, and `/rename` typed
		# into that one would land in somebody else's pane. Where it does not
		# name this window the pane is left EMPTY and the line is printed.
		rec_tgt="$(printf '%s' "$ws_out" | awk -F'\037' '{print $2}')"
		sess_name="$(printf '%s' "$ws_out" | awk -F'\037' '{print $3}')"
		case "$rec_tgt" in none) rec_tgt="" ;; esac
		if [ -n "$rec_tgt" ] && [ "${rec_tgt%.*}" = "$win_harness" ]; then

lanes-edit.sh:3458

  • canon_lane returns success with the typed name after an alias-table read returns 5. That is safe only for a read-only command, but register-row and lane-start use this result to decide whether the lane is new; with a current row under <new> and an unreadable table, lane-start <repo> <n> can treat the former name as absent and append a duplicate row. Propagate a distinct failure to writers instead of allowing them to proceed.
      note "${LANES_ALIASES_PATH:-lanes/aliases.tsv} COULD NOT BE READ (${LANES_ALIAS_ERR:-unknown error}), so whether '$cl_want' is a FORMER name of some lane is NOT established — which is not the same as it not being one (Amendment 16(e)). Carrying on with '$cl_want' exactly as typed; every WRITE that asks this table refuses instead."

lanes-edit.sh:6509

  • This assignment discards alias-table read failures with || : and then treats an empty result as “no row.” If the alias table is unreadable, the lane_shaped fallback below can bind the old spelling and send a running session toward lane-start; capture the alias-read status and refuse before that fallback. The session-name lookup at line 6542 has the same failure mode.
  gr_hits="$(rows_named_ci_alias "$G_WINNAME" 2>/dev/null || :)"
  gr_n="$(printf '%s' "$gr_hits" | grep -c . || :)"
  • Files reviewed: 12/12 changed files
  • Comments generated: 7
  • Review effort level: Lite

Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
… no renames — every reader fails closed on it — and the rollback stays armed until a commit exists

Seven threads and three suppressed comments on #81, all
taken.

THE CLASS THAT RAN THROUGH FOUR OF THEM. `rows_named_ci_alias` turned a
`lane_alias_hop` failure into a successful EMPTY answer, and every reader behind
it then took its own not-a-lane branch: `canon_lane` answered the typed
spelling, so `lane-start` would read a renamed lane as new and append a SECOND
row — the duplicate Amendment 15(a) exists to refuse; the guard fell to
`lane_shaped` and sent a running session to bind a row it already has; the
`SessionStart` block said no lane binds a window that one does. The status is
propagated now and each reader decides:

* `canon_lane` REFUSES (2), naming the read and both paths to the table. R22's
  rule governs — a read that could not be performed is never an answer — and
  this one's answer is what a writer decides "is this lane new" by.
* the guard REFUSES THE PROMPT on either lookup, which is clause (d)'s own
  fail-closed shape: a triple that cannot be verified is not a triple that
  agrees.
* `session-start` may not refuse, so it SAYS SO: one warning line, printed only
  where the window resolved to nothing, so the line below it is read as what it
  is.

AND ONE THE ROUND UNCOVERED UNDERNEATH. `live_holder` skips a record a PERSON
named for another lane (Amendment 8). After a rename the lane's OWN session
still carries its former name — the `/rename` is clause (f)'s and lands at the
lane's next prompt, not before — so read byte for byte, the lane's live session
stopped being its holder the instant the row moved: the rename's own window
would lose the `/rename`, and `who` would call a running lane NOT LIVE. The
comparison goes through the same seat as every other name now, and a name that
resolves ELSEWHERE is still skipped, which is Amendment 8's rule unchanged.

THE REST:

* A handoff path that EXISTS and is not a regular file — a directory, a FIFO, a
  DANGLING symlink — read as "no handoff written yet" and the rename committed
  the other three. `-e` or `-L` beside `-f` now, and it is a refusal; an absent
  path is still passed over, which is the declined half of round 1.
* An UNTRACKED old log moved away was still handed to `git add`, which fails on
  a pathspec that matches nothing — ending the write inside `commit_push` with
  all four moves on disk. It is a pathspec only where git knows the path.
* `handle_preexisting` was given every pathspec of this write, most of which do
  not exist yet, so its `git add` could fail and a peer's uncommitted row be
  swept into this commit. It is given the register alone — the only file that
  can be dirty here, because every other tracked change was refused one line up.
* `lanes/aliases.tsv` published on origin and absent here would have been
  CREATED with one mapping, dropping every alias already published. Refused,
  naming the pull, exactly as the row and the log guards do.
* `replace_line`'s `cat > "$LANES_FILE"` was unchecked: on an unwritable
  register it returned 0 having written nothing, both proofs having passed
  against a temporary file. Checked, and it dies — which for a rename means the
  alias no longer lands while the row it points at never moves. That is the last
  act of every row edit in this file, so the fix is theirs too.
* `RL_ACTIVE` was cleared before `commit_push`, which can die on
  `update-index`, `git add` or `git commit` BEFORE any commit exists. The undo
  stays armed through it and `rename_undo` decides by HEAD: unchanged means no
  commit carries the work and the four are restored; moved means the commit
  exists and `commit_push` owns the recovery, as its own exit 3 says.
* `lane-rename` took its pane from `window-session`, which answers about the
  WINDOW — a second Claude session in another pane of it would have been typed
  into. It asks `live-holder <lane>`, which answers about the LANE because it
  reads only ids the row's session cell carries.

Tests: the Amendment 16 section is 139 assertions (from 122) — the reader
refusals with the table pointed at a path `origin` does not carry, the guard's
own refusal, a handoff path that is a directory, an alias table published and
not pulled, a session named for a former name still holding its lane, and the
same session named for a former name somebody has since taken AS a lane not
holding it. `bash tests/test_lane_helpers.sh`: 2486 passed, 0 failed, 0 skipped.

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
Copilot AI review requested due to automatic review settings September 15, 2026 15:53
@brettheap

Copy link
Copy Markdown
Contributor Author

Copilot round 3 — all seven threads taken, replied to and resolved in f962a3a, and the three suppressed comments with them:

  • lane-rename:306 (the pane may belong to another session in the window) — taken. The pane now comes from live-holder <lane>, which answers about the LANE because it reads only ids the row's own session cell carries (Amendment 6(b)), rather than from window-session, which answers about the WINDOW. The window-agreement test stays on top of it, for guard_run's reason: tmux reuses window ids.
  • lanes-edit.sh:3458 (canon_lane returns success after a 5) — taken; it refuses (2) now, and the thread on rows_named_ci_alias carries the reasoning.
  • lanes-edit.sh:6509 (the guard discards the read failure) — taken; both of its lookups refuse the prompt, which is clause (d)'s own fail-closed shape.

And one the round uncovered underneath, which is not in the review and is worth naming: live_holder skips a record a PERSON named for another lane (Amendment 8). After a rename the lane's own session still carries its FORMER name — the /rename is clause (f)'s and lands at the lane's next prompt — so read byte for byte, the lane's live session stopped being its holder the instant the row moved: the rename's own window would lose its /rename, and who would call a running lane NOT LIVE. That comparison goes through the same resolver now, and a name that resolves elsewhere is still skipped, which is Amendment 8's rule unchanged. Both directions are tested, including a former name somebody has since taken AS a lane, which is another lane's and stays skipped.

bash tests/test_lane_helpers.sh: 2486 passed, 0 failed, 0 skipped (the Amendment 16 section is 139 assertions).

Lane: openrepotools-3 (openRepoTools-3)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical issues remain in symlink safety, transaction rollback, and fail-closed alias handling.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (2)

lanes-edit.sh:7951

  • When the row's handoff exists as an untracked regular file, the move removes the old pathname but this unconditionally adds that now-nonexistent old pathname to rl_paths. commit_push then runs git add on it, which fails because an untracked file has no index entry; the rename is rejected even though adding the new pathname is sufficient. Add the old handoff path only when it is tracked, as is already done for the old log path.
      [ "$rl_hmove" = 1 ] && rl_paths+=("$rl_h_rel")

lanes-edit.sh:7915

  • This target check only tests -e. It misses dangling symlinks and, on the required case-sensitive Linux/WSL2 filesystems, an existing handoff whose filename differs only by case; the following mv can replace the dangling link or create a second handoff for the same case-insensitive lane. Check link existence and perform the same case-insensitive target collision check used for logs before moving the handoff.
      [ "$rl_hmove" = 1 ] && [ -e "$rl_hfile_new" ] && \
        die "the handoff would move to $rl_hfile_new and something is already there. That path belongs to lane $rl_new's own handoff and is not this rename's to overwrite. Move it aside and re-run. Nothing was written." 2
  • Files reviewed: 12/12 changed files
  • Comments generated: 7
  • Review effort level: Lite

Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
…use 2 already means two things to four commands; a symlinked log, handoff or alias table is refused because all three are written IN PLACE; and the register joins the rollback

Seven threads on #81, all taken.

THE EXIT CODE. `canon_lane` refusing with 2 was the right refusal on the wrong
number: `lane-start`, `lane-end`, `lane` and `lane-handoff` each read a 2 as
EITHER Amendment 15(d)'s two-rows refusal — told apart by the words in its
message — or the unknown-subcommand 2 of a helper predating Amendment 15, which
they carry on past with the name as typed. A third meaning lands in the second
branch, which is the fail-OPEN the refusal exists to close: an unreadable alias
table would make a renamed lane look new and `lane-start` would append a second
row for one that has been running all day. It is 66 now — EX_NOINPUT, an input
file that could not be read, which is exactly what happened. `lane` and
`lane-handoff` already refuse every code they do not recognise; `lane-start` and
`lane-end` are taught it here, each in its own words.

THE THREE THAT ARE ONE RULE. A symlink at the object log, at the handoff or at
`lanes/aliases.tsv` was accepted: `ls` lists one like any other file and `-f` is
TRUE through one to a regular file. All three are written IN PLACE — the log's
`>>`, the stamp's `cat >`, the alias row's `>>` — and a redirect follows a link,
so the bytes would land at the far end, possibly outside this repository, while
the commit recorded only the link and the rollback restored the wrong file.
Refused, each with the write that makes it matter. It is the rule
`openRepoTools --install` already states for every target it places, and the one
this file's own header opens with for `sed -i` and the register's symlink.

AND FOUR MORE:

* `live_holder` piped `rows_named_ci_alias` into `grep | head || :` and threw
  its status away, so an unreadable table answered EMPTY, the record was
  skipped, and the read returned 8 — "no live session holds it" — about a lane
  that is running. That is the read `lane-start` renames a window over. It fails
  closed with 1 and `SESSION_FILES_ERR` naming the read, which is the contract
  its callers already have.
* `refuse_dirty_checkout` exempted `lanes/aliases.tsv` because it is a pathspec
  of this write, and round 3 had narrowed the capture to the register alone — so
  a peer's half-finished rename could be appended to and swept into this lane's
  commit. The table has ONE writer and is not the mid-write state `LANES.md` is
  in half the day, so it is left out of the exemption and the generic refusal
  names it.
* The register was written by `replace_line` after the snapshot and was not IN
  the snapshot, so a `commit_push` that died before committing rolled the other
  three back and left the row renamed — a split rename. It is snapshotted and
  restored with a `cat >`, which follows the register's own symlink where `mv`
  or `cp` would replace it with a regular file.
* AND THE INDEX WITH IT: `commit_push` stages before it commits, so a `git add`
  that succeeded and a `git commit` that did not left the rename staged for the
  next writer to commit by accident. The undo resets those pathspecs.

Tests: the Amendment 16 section is 169 assertions (from 139). The rollback case
is now the real one — a `pre-commit` hook that refuses, which is the smallest
honest way to reach `commit_push`'s pre-commit failure — and it reads back the
register, the log, the alias table, the handoff, the index and HEAD, then runs
the same rename again and watches it go through, which is what "refused or
whole" is worth. `bash tests/test_lane_helpers.sh`: 2516 passed, 0 failed, 0
skipped.

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
Copilot AI review requested due to automatic review settings September 15, 2026 16:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved critical and moderate issues remain in alias handling, path validation, rename safety, and transaction behavior.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (8)

Previously missed (1) — in code that hasn't changed since the last review.

lane-rename:228

  • When the writer refuses a case-only rename, canon-lane "$old" still returns the existing row spelling, so the case-insensitive comparison here matches $new. lane-rename repoRen-1 REPOREN-1 can therefore turn the required refusal into success and rename the tmux window even though no register change landed. Only enter this repair path when the requested names are not equal under lc (and the alias/row state proves a prior rename completed).

docs/README-lanes.md:1831

  • This says that no other row cell changes, but clause (d) and the implementation update the handoff cell when the row's named handoff is moved. As written, the guide documents a stale old handoff path after a successful rename; qualify the statement to exempt that required path update.
| 1 | (b) | the register row's key cell becomes `` `<new>` ``, and the text beside it gains `` *(ex `<old>`, renamed <UTC>)* `` — the form the register already uses for a lane named later than it started. Nothing else in the row changes; **the session cell keeps its history** (Amendment 6(b)) |

docs/README-lanes.md:1867

  • The implementation now snapshots LANES.md in RL_SNAP/register and restores it during rollback, so saying that the register is not in the snapshot contradicts the actual all-or-nothing behavior. This documentation should list the register among the restored files and explain that the pre-write proof does not replace the rollback snapshot.
every exit path — a `die`, a signal, the shell — restores it: the log, the
handoff and `lanes/aliases.tsv` go back to what they were and nothing is
committed. The register is not in the snapshot and does not need to be:
`replace_line` proves the new file before it writes a byte of `LANES.md`.

lanes-edit.sh:7872

  • Only symlinks are rejected here. If the alias path is an existing FIFO and the origin has no published alias table yet, the later > used to create the table blocks waiting for a reader rather than failing closed. Treat every existing non-regular path (FIFO, directory, device, etc.) as a refusal before any alias-table read or write.
    if [ -L "$LANES_ALIASES_TSV" ]; then
      die "$LANES_ALIASES_PATH is a SYMLINK at $LANES_ALIASES_TSV. The alias row is appended in place and a redirect follows a link, so it would be written at the far end while this commit recorded the link — and the alias is the one thing that makes a renamed lane's old name resolve for ever (Amendment 16(e)). Replace it with the file itself and re-run. Nothing was written." 2
    fi

lanes-edit.sh:7710

  • canon_lane returns 66 when the alias table cannot be read, but this branch converts that status to 2 and exits before the rename-specific refusal is printed. Renaming through an alias-only old name with an unreadable table therefore reports the wrong failure class and omits the required “Nothing was written” diagnosis; handle the alias-read status explicitly and return the writer's read-failure result.
    rl_old="$(canon_lane "$rl_old")" || exit 2

lanes-edit.sh:3316

  • LANES_ALIAS_ERR is assigned inside lane_alias_text, but every caller invokes that function through command substitution (lat_out=$(lane_alias_text), and the same pattern in the hop/key helpers). The assignment is lost with the subshell, so all propagated alias-read failures are rendered as unknown error, defeating the new diagnostic promised by this block. Carry the reason through a file or another status-bearing channel.
    lat_t="$(git -C "$LANES_REPO" show "origin/$LANES_BRANCH:$LANES_ALIASES_PATH" 2>/dev/null)" || {
      LANES_ALIAS_ERR="git show origin/$LANES_BRANCH:$LANES_ALIASES_PATH failed, and the object is there"
      return 5

lanes-edit.sh:3318

  • When the configured alias-table path exists but is a directory, FIFO, device, or dangling symlink, -f is false and this branch skips the read entirely, returning an empty alias table. That makes every former name look unmapped instead of failing closed; validate existing alias-table paths as regular files and return the read error for other types.
  elif [ -n "${LANES_ALIASES_TSV:-}" ] && [ -f "$LANES_ALIASES_TSV" ]; then

lanes-edit.sh:8022

  • When the row-named handoff exists but is untracked, the move removes $rl_h_rel; passing that missing old path to git add makes commit_push fail even though the new path is the file that should be added. The log path has an explicit tracked-path guard above, but the handoff path does not, so this valid rename is rolled back instead of committing.
    if [ "$rl_h_touch" = 1 ]; then
      rl_paths+=("$rl_h_rel_new")
      [ "$rl_hmove" = 1 ] && rl_paths+=("$rl_h_rel")
  • Files reviewed: 15/15 changed files
  • Comments generated: 6
  • Review effort level: Lite

Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
brettheap and others added 2 commits September 15, 2026 18:51
…ached read, `..` out of the workspace, a dangling destination, a FIFO, an untracked table and a table with no newline at its end

Six threads on #81, all taken. Every one of them is the
same shape: a test that was nearly right, and a path through it that reaches a
write.

* THE CACHE'S OWN READ. `lane_alias_text` checked the fetch and the working-tree
  read and then answered an unchecked `cat` of its own cache with `return 0`. A
  cache this process wrote and cannot now read would answer EMPTY with status 0,
  and a former lane name would resolve as new — the one outcome every other
  branch of that function refuses. Checked, 5, `LANES_ALIAS_ERR`.
* `..` IS STILL OUTSIDE. The workspace-containment test was a string prefix, so
  `handoffs/../../outside/x.md` — and any path whose PARENT is a symlink out of
  the checkout — matched `"$LANES_REPO"/*` while resolving elsewhere: the file
  would be moved and stamped before git refused the pathspec. The directory's
  own `cd -P` decides it now, which is the resolution `lane-start` already makes
  for this very path and for the reason it gives (`readlink -f` is not in the
  stock macOS userland).
* A DANGLING SYMLINK AT THE DESTINATION IS OCCUPIED. `-e` is false on one, so
  `mv` would have replaced it — destroying a path this rename does not own.
  `-L` beside `-e`, which is what the source-side tests already say.
* A FIFO AT THE OLD LOG PATH. `log_files_named_ci` lists one like any other
  name, and only symlinks were refused — so the snapshot's `cat` would BLOCK,
  for ever, holding this lane's mutex. The log must be a regular file; so must
  the alias table, for the same reason.
* AN EXISTING UNTRACKED ALIAS TABLE. `refuse_dirty_checkout` reads
  `tracked_dirty`, which deliberately omits untracked files, so before this
  estate's FIRST rename a hand-written `lanes/aliases.tsv` walked past the guard
  and its lines were committed inside this lane's rename. `rename-lane` is that
  file's only writer and commits what it writes, so an untracked one was written
  by hand or left by a run that died: refused, naming both exits.
* A TABLE WITH NO NEWLINE AT ITS END. `>>` would put the record on the END of
  the previous line — and `append_text_line`'s own proof PASSES, because the
  bytes it builds to compare are concatenated the same way, and the line count
  moves by one either way. The parser would then never see the new alias: the
  rename would land and the old name would stop resolving, which is the one
  thing clause (e) promises. Refused rather than repaired, because putting a
  newline on a file this command did not write is an edit to somebody else's
  lines.

Tests: the Amendment 16 section gains a case for each of the five that can be
staged — the `..` handoff with the far end read back, the dangling destination,
the FIFO, the untracked table and the missing newline — and then runs the same
rename with every edge cleared and watches it go through.

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
…e-rename

# Conflicts:
#	docs/README-lanes.md
#	lanes-edit.sh
Copilot AI review requested due to automatic review settings September 15, 2026 19:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical and moderate correctness issues remain in rename locking, untracked-file handling, path handling, alias reads, and recovery behavior.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (4)

lanes-edit.sh:8868

  • A row may name a handoff path containing spaces (for example, lane-start --estate 'team blue' accepts the value), but this newly added path is later fed through unquoted CP_PATHS expansions and is also flattened into RL_PATHS_FOR_UNDO. The path is therefore split into multiple pathspecs: the rename can fail to stage the handoff, and rollback can leave its add/delete entries staged after restoring the files. Keep these paths as an indexed array and pass/iterate them with quoted array expansions throughout the rename and rollback path.
      rl_paths+=("$rl_h_rel_new")
      [ "$rl_hmove" = 1 ] && rl_paths+=("$rl_h_rel")

lanes-edit.sh:8868

  • When the handoff exists but is untracked, rl_h_touch=1 and this adds both the new and old paths. After mv, the old path no longer exists, so git add -- new old fails and a valid untracked handoff cannot participate in the promised one-commit rename. Add the old path only when it is tracked, as is already done for the old log.
    if [ "$rl_h_touch" = 1 ]; then
      rl_paths+=("$rl_h_rel_new")
      [ "$rl_hmove" = 1 ] && rl_paths+=("$rl_h_rel")

lanes-edit.sh:3490

  • If no published alias file exists but LANES_ALIASES_TSV is an existing directory, FIFO, or dangling symlink, this -f test falls through as an empty table instead of failing closed. After a rename, readers can therefore treat the former name as new and miss the row; reject existing non-regular paths here, matching the writer's refusal.
  elif [ -n "${LANES_ALIASES_TSV:-}" ] && [ -f "$LANES_ALIASES_TSV" ]; then

tests/test_openrepotools_command.py:62

  • lane-rename is added to the installed inventory, but the help-contract test's command tuple below never includes its usage line. A regression could remove lane-rename from openRepoTools --help while these installer tests still pass; add its help assertion alongside this inventory update.
INSTALLED = ("openRepoTools", "park", "resume", "status", "lane", "lanes",
             "lane-handoff", "lane-rename", "lanes-edit.sh", "lane-start",
             "lane-end", "link-estates", "repos.tsv")
  • Files reviewed: 15/15 changed files
  • Comments generated: 5
  • Review effort level: Lite

Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
…e verbs it skips — and a source log or handoff git has never seen is a peer's work, not this rename's to commit

Five threads on #81, all taken, plus one defect of my own
that the suite caught behind them.

THE ONE I BROKE IN THE MERGE. Amendment 13 (#82) landed `is_note_verb` for
`NOTED`/`RULED` — lane-kind lines that are NOT transitions — which is exactly
what clause (c) says `RENAMED` is, so the merge moved `RENAMED` out of
`is_lane_verb` and into it. But `swapped_candidates` is the one reader that
takes a lane's LAST lane-kind line whatever its verb is, and it NAMES the verbs
it skips rather than asking the predicate: a lane whose last line was its rename
stopped reading as PAUSED, so `swapped` would not list it and `restart` would
not find it. One line, and a case that renames a swapped lane and asks `swapped`
again.

THE REST:

* An UNTRACKED `lanes/log/<old>.md` was moved to a path this write always
  stages, so a peer's uncommitted log would be committed under this rename's
  message. `refuse_dirty_checkout` reads `tracked_dirty`, which reports no
  untracked file, so nothing above it saw one. Refused, naming the commit its
  author owes — and the same for an untracked handoff, which is a pathspec here
  the moment it exists.
* The mutex was taken AFTER every collision check. Each of those checks asks
  what is NOT there, so two renames on one workstation could both answer "the
  target is free" and the second would move its log over the first's. The lock
  is taken before them now; across workstations the arbiter is the one Rule 1's
  claim has, whichever commit lands on `main` first, and the loser's next
  attempt meets its own refusals with nothing written.
* `canon_lane`'s 66 was flattened by a `|| exit 2` in this arm, so the SAME
  fault — an alias table that cannot be read — answered 2 or 1 depending on
  whether the typed name happened to have a row of its own, because a name with
  one never reaches the table. One condition, one code: this writer's own 1.

AND ONE THE SUITE FOUND UNDERNEATH ROUND 5. Resolving the handoff's containment
physically made `cd -P` the test, and `cd -P` of a directory that does not exist
fails — which is every lane before its first swap, because `lane-start` puts the
path in the row and `lane-handoff` creates the file and its estate directory
later. Read as "outside the workspace repository", that refused the ordinary
case. The question is put to the NEAREST ANCESTOR THAT EXISTS now, which is the
rule `openRepoTools --install` already states for its own targets, with a `..`
among the components that do not exist refused rather than guessed at.

EVIDENCE AS THIS COMMIT IS MADE. `bash tests/test_lane_helpers.sh` reached the
end of the Amendment 16 section with 206 assertions and 0 FAIL in the run as a
whole (log /tmp/a16-run14.txt); the run's tail was still going when this was
committed for a handoff, so the footer count is not in hand. The state before
this commit — f187feb, round 5 with Amendment 13 merged — is GREEN on all four
CI platforms (tests, tests-macos, tests-no-submodule, tests-windows) and was
2657 passed / 0 failed locally.

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
Copilot AI review requested due to automatic review settings September 15, 2026 20:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved moderate issues remain in rename argument and repair handling, notification coverage, alias-table failures, and handoff validation.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (5)

docs/README-lanes.md:1987

  • This documentation still says the register is not in the snapshot, but the implementation now copies and restores it (RL_REG/$RL_SNAP/register). That contradicts the actual rollback guarantee described immediately above and should be corrected to include the register.
handoff and `lanes/aliases.tsv` go back to what they were and nothing is
committed. The register is not in the snapshot and does not need to be:
`replace_line` proves the new file before it writes a byte of `LANES.md`.

lane-rename:214

  • --why is forwarded as an unlabelled third positional argument. If the reason begins with an option token such as --no-github or --verbatim, lanes-edit.sh reparses it as that option instead of recording the reason (or refuses an unknown token), so this wrapper can silently change behavior or lose the supplied text. Forward the reason through the writer's --why option instead of as a positional argument.
"$LANES_EDIT" rename-lane "$old" "$new" ${why:+"$why"} ${pass[@]+"${pass[@]}"} || rc=$?

lane-rename:229

  • The repair check treats every case-insensitive match as a completed rename. For a normal case-only request, the writer deliberately returns 2 under Amendment 15(d), but canon-lane "$old" still equals new ignoring case, so this wrapper reports success and renames/types into the new spelling even though no row was changed. Require the canonical spelling to match the requested target exactly (or otherwise distinguish the writer's case-only refusal) before entering the repair path.
	if [ "$rc" = 2 ]; then
		landed="$("$LANES_EDIT" canon-lane "$old" 2>/dev/null)" || landed=""
		if [ -n "$landed" ] && [ "$(lc "$landed")" = "$(lc "$new")" ]; then
			step "the rename itself has already landed — '$old' resolves to $new — so this run is the window and the session only (Amendment 16(f))"

lane-rename:232

  • commit_push can leave the rename committed locally and then return 3 (rebase/push recovery) or 6 (for example, an initial push failure), but this repair path only probes canon-lane for exit code 2. The wrapper therefore exits before clause (f)'s window/session repair even though the row, alias, log, and handoff have landed; a retry can also be blocked by the target row. Detect a landed rename for every nonzero writer result from the local tree, and carry that local-state choice through the subsequent window_is_lane/live-holder reads instead of consulting stale origin refs.
	if [ "$rc" = 2 ]; then
		landed="$("$LANES_EDIT" canon-lane "$old" 2>/dev/null)" || landed=""
		if [ -n "$landed" ] && [ "$(lc "$landed")" = "$(lc "$new")" ]; then
			step "the rename itself has already landed — '$old' resolves to $new — so this run is the window and the session only (Amendment 16(f))"
			rc=0
		fi
	fi

tests/test_openrepotools_command.py:195

  • Adding lane-rename to the installed command inventory does not add its synopsis to the assertion list below. This test now claims to cover every installed command, but a regression in the new lane-rename <old> <new> help entry could pass; assert that synopsis or narrow the test's promise.
    """`--install` places thirteen files, and twelve of them are commands this one
    knows nothing about — so `--help` has to say what they are and where the
    rest is written down. A command a person has on PATH and cannot find
    written down is a command they will not use.
  • Files reviewed: 14/15 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread lanes-edit.sh Resolved
…hed off, so the suite gets a fake `gh` — which also closes the door the workstation's own `gh` was standing behind

One thread on #81, taken.

Amendment 16(g) — one comment per object the lane HOLDS, posted after the commit
and citing its sha — is the only act of `rename-lane` that happens after the
push, and it had no test: this suite exports `LANES_NO_GITHUB=1` and every case
passes `--no-github`, which is the rule that keeps it off the network and is
also why that path never ran.

THE FAKE `gh` MAKES THIS SUITE SAFER, NOT LOOSER, and that is worth saying
plainly because adding one looks like the opposite. The fakebin is PREPENDED to
`$PATH`, so until now a call that slipped past `LANES_NO_GITHUB` would have
found THE WORKSTATION'S OWN `gh`. It cannot now: the fake answers the two
comment forms `gh_comment` makes — `gh issue comment <n> --repo <o/r>
--body-file -` and its `pr` twin, body on stdin — and REFUSES every other call
with exit 90 and a line saying so. `LANES_NO_GITHUB=1` still stops the call
being made; the fake decides what answers it where a case switches that off on
purpose, which exactly one case now does.

The cases: a lane holding two objects and having released a third is renamed
with GitHub ON, and the log is read back for exactly TWO comments — on the two
it holds and not on the one it released — each carrying the amendment's own
sentence, Rule 10's wire form `Lane: repocmt-2 (repoCmt-2)`, the sha of the
commit that carries the rename, and the alias table that keeps the old name
resolving; and every URL reported on stderr. Then a `gh` made to refuse: the
rename still exits 0, warns naming the object it could not reach, says the
commit IS the rename and it has landed, and the row, the log and the push are
all where they were — which is what "posted only after the commit lands" means
when the posting fails. And the fake's own refusal is asserted, so the door it
closes is a tested door.

`bash tests/test_lane_helpers.sh`: 2692 passed, 0 failed, 0 skipped — the
Amendment 16 section is 225 assertions. CI on 86407ed, the state before this
commit, is GREEN on all four platforms.

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
Copilot AI review requested due to automatic review settings September 15, 2026 21:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Five unresolved findings remain in lanes-edit.sh: two critical, two moderate, and one nit.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 14/15 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
brettheap and others added 2 commits September 16, 2026 01:05
…is the fail-open the whole function closes, and an undo's pathspecs are an ARRAY because a handoff may live under a directory with a space

Two threads on #81, both taken, plus one defect of my own
underneath the first that would have made its refusal unreadable.

THE READER'S FALLBACK (lanes-edit.sh:3494). With no alias blob on `origin`, the
working-tree read was guarded by `-f` alone, and `-f` is FALSE for a directory,
a FIFO, a socket and a DANGLING symlink alike — so the branch was simply
skipped, `# no lane aliases` was cached, and the function answered EMPTY with
status 0. That is the one outcome every other branch of it exists to refuse: a
former lane name reads as NEW, and `lane-start` appends a SECOND row for a lane
that has been running all day — Amendment 15(a)'s duplicate, arrived at through
a read. `-L` is asked beside `-e` because `-e` is false on a dangling link,
which is the pair the handoff's own destination test already uses.

AND THE READER'S RULE IS NARROWER THAN THE WRITER'S, deliberately, which is why
the two say different words. The writer refuses a LIVE symlink to a regular
file as well, because it appends in place and a redirect follows one into
whatever is at the far end. A READER that follows the same link gets the
table's own bytes and is right to, so `-f` answers it and says nothing. What is
refused here is only what cannot be READ.

THE REASON HAD TO SURVIVE A SUBSHELL FIRST. Every one of those refusals printed
`(unknown error)`, because `LANES_ALIAS_ERR` is set inside `lane_alias_text` and
every caller reaches it through a COMMAND SUBSTITUTION — `lane_alias_hop`,
`lane_alias_target`, `lane_alias_keys`, and `rows_named_ci_alias` through
`canon_lane` — so the variable died with the subshell that set it. Fail-closed
and silent about what to fix is half a refusal. The reason goes in a file beside
the events cache, which `cleanup` already sweeps, exactly as `SE_WARN_FILE`
carries a warning raised inside the same kind of substitution; the variable
stays as the answer for a process whose `mktemp` failed; and the file is cleared
where a fresh read begins, so it is never the reason for a read that has since
succeeded.

THE UNDO'S PATHSPECS (lanes-edit.sh:8995). `RL_PATHS_FOR_UNDO="${rl_paths[*]}"`
flattened five quoted paths into one string that `rename_undo` expanded
unquoted, so a handoff under `handoffs/team notes/…` became `handoffs/team` and
`notes/…`: two pathspecs that match nothing. MEASURED, under bash:

    pathspecs git receives: 3
      [reg.md]
      [handoffs/team]
      [notes/h.md]
    staged: handoffs/team notes/h.md reg.md
    --- the flattened, unquoted reset (the defect) ---
    exit=0
    staged now: handoffs/team notes/h.md

`git reset` resets what it matches, says NOTHING about what it does not, and
exits 0 — so the `|| :` was never reached and no line of output said the index
had been left half-reset. The rename stayed STAGED for the next writer to commit
by accident, which is the half-transaction the snapshot exists to prevent. The
array is kept as an array and passed quoted; `${#…[@]}` guards the expansion,
which is the form `state_events`, `session_records` and `live_holder` in this
same file already use under `set -u` on macOS bash 3.2.

TESTS. Nine cases in the Amendment 16 section, twenty-four assertions:

* the three shapes Copilot names — a DIRECTORY, a DANGLING SYMLINK and a FIFO
  (skipped where the host has no `mkfifo`) — each put to BOTH readers that
  matter: `canon-lane`, which is clause (e)'s one seat, refuses with 66 naming
  what is at the path, and `lane-start` refuses rather than adding the second
  row. Each asserts the message is NOT `unknown error`;
* a LIVE symlink to a table that IS one is READ, and answers the name that table
  names — the asymmetry above, written down as a case;
* the writer's own unreadable-table refusal now asserts the reason it carries
  (`aliases-unreadable.tsv is there and could not be read`) rather than a second
  copy of the assertion above it;
* a lane whose handoff lives under `handoffs/team notes/` is renamed with a
  `pre-commit` hook that refuses: the register, the log, the alias table and the
  handoff all come back, HEAD is unmoved, and `diff --cached` is EMPTY — which
  is the assertion the flattened pathspec failed. Then the same rename runs
  again and goes through, moving the handoff under its spaced directory and
  landing it in one commit.

`bash tests/test_lane_helpers.sh`: 2725 passed, 0 failed, 0 skipped. CI on
f1fa32b, the state before this commit, is GREEN on all four platforms.

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EaHzfTLW4u9ukpWuw8Dt6r
…name of this lane is the SECOND drift the lock closes, and is never one of the three choices

`main` is f9e63f4 — #87, the name guard's three-choice offer and `lane-start`'s
exact-uuid resume. Three textual conflicts in `lanes-edit.sh`, all in the guard
and all resolved as UNIONS, plus one resolution that is a decision and not a
merge and is written out here because a reader of the diff cannot see it.

THE THREE TEXTUAL ONES.

* `guard_triple` gains BOTH: my `guard_window_renamed_note` and its
  `GUARD_RENAME_SAID` flag (Amendment 16(f) — the guard's own rename of a window
  is the one act it takes that is not a refusal, so it is announced wherever the
  run ends), and #87's `[<heading>]` argument (an allowed prompt prints the same
  three names under a heading that does not say REFUSES).
* the window line prints my "— a former name of $G_LANE (Amendment 16(e))"
  annotation UNDER #87's `${1:-…}` heading.
* the agreeing branch does #87's allowance sweep and THEN my window-renamed
  note, in that order: the allowance dies with the mismatch it allowed, and the
  note is the last thing said before the prompt is let through.

AND THE ONE THAT IS A DECISION: THE LOCK NOW CLOSES TWO DRIFTS, NOT ONE.

#87 left `guard_lock_rename` exactly one case — a session name differing from
the row's only by CASE, the same lane under Amendment 15 — and made EVERY other
readable mismatch a three-choice offer, on the reasoning that a person renaming
a session to another lane's name is choosing something a guard may not choose
for them. That reasoning is right and it does not reach a FORMER NAME OF THIS
VERY LANE: clause (e) makes that name resolve to this row FOR EVER, so a session
still called `repoRen-1` on a lane the register now spells `repoRen-7` is this
lane under the name it was renamed away from. It is not a decision anybody is
making — it is what a `lane-rename` run from ANOTHER window leaves behind, and
finishing it is the whole of clause (f).

Merged verbatim, that state would have gone to the offer, and TWO OF ITS THREE
ANSWERS WOULD BE WRONG: `1` makes the old name permanent for this transcript and
`2` moves the lane BACK to the name it was renamed away from. The condition is
`$G_SES_LANE`, which is already the resolved answer — `rows_named_ci_alias
"$G_NAME"`, computed thirty lines above — so it is this lane exactly when the
session's name is this lane's under any case or any former spelling. The lock
then says which of the two drifts it is closing, in the amendment's own words.

The suite caught this: `…while the SESSION's name is typed, which is the only
path it has` asserts `send-keys -t %16 /rename repoRen-7` for a window and a
session both still carrying `repoRen-1`, and a verbatim merge stops typing it.
That case now also asserts the offer is NOT made — neither `1) explicitly allow
this lane` nor `2) adjust the lane to session` appears — and that the refusal
names clause (e) as what already settled it.

THE HEADER AND THE MANUAL SAY TWO where they said one: `lanes-edit.sh`'s
Amendment 12 block, the guard TABLE's row for it, and the lock's own paragraph
in `docs/README-lanes.md`. And `guard_lock_rename`'s D4 note is corrected rather
than deleted: it said a name differing by more than case no longer reaches this
lock, which the second drift makes untrue — the point it was making survives
intact, because NEITHER name that reaches the lock can carry a ` (N)` suffix (a
suffixed former name is not a KEY of the alias table, so it resolves to nothing
and goes to the offer with every other wider mismatch).

ONE VARIABLE RENAMED, `gr_arc` → `gr_warc`. #87 introduced `gr_arc` in
`guard_run` for the pending answer's status; Amendment 16 already had one there
for the window-name alias read. Both are set before every read of them, so
nothing leaked — but one name for two questions in one function stays harmless
only until somebody moves a block, and mine pairs with `gr_sarc` beside it.

`README.md`, `lane-start`, `tests/test_lane_helpers.sh` and
`openspec/changes/interactive-lane-name-repair/` merged with no conflict;
`lane-start`'s and `lane-end`'s Amendment 16 exit-66 branches are untouched, and
the thirteen files / twenty-seven artifacts counts are unchanged by this merge.

`bash tests/test_lane_helpers.sh`: 2803 passed, 0 failed, 0 skipped, with the guard section
(both #87's three-choice cases and Amendment 16's) and the Amendment 16 section
(232 assertions) green in one run.

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EaHzfTLW4u9ukpWuw8Dt6r
…e textual conflict in README.md, resolved as a union

`main` moved from f9e63f4 to 957a26f — #102 (every `chmod` `--install` performs
fails through `die`, and a second writer of either hook refuses whether or not
our own entry is beside it) and #101 (`wip init` stops reading a failed `git
status` as clean, refuses a template path whose ancestor is a symlink or not a
directory, refuses one staged at a mode it never wrote, and names a
skip-worktree path HEAD carries and the disk does not). Neither touches
`lanes-edit.sh`, so the guard and Amendment 16 sections merge untouched.

ONE TEXTUAL CONFLICT, IN README.md, AND IT IS A UNION. Both sides edited the
same sentence in the settings-merge paragraph: this branch's Amendment 16
raised twelve files to THIRTEEN (`lane-rename` joins `INSTALLABLES`), and #102
appended the new paragraph on a second writer refusing whether or not our own
entry sits beside it. Kept: "thirteen" (this branch's count — `openRepoTools`
itself already says thirteen throughout, unconflicted, since that count comes
from `INSTALLABLES` and not from this paragraph) followed by #102's whole
"A SECOND WRITER REFUSES..." paragraph, in main's order. `openRepoTools`,
`tests/test_install_skill_and_hook.py`, `tests/test_openrepotools_command.py`
and `tests/test_wip_init_command.py` merged with no conflict.

`bash tests/test_lane_helpers.sh` run to completion after this merge; see the
finishing-writer report for the count.

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01EaHzfTLW4u9ukpWuw8Dt6r
Copilot AI review requested due to automatic review settings September 16, 2026 12:57
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical rename-path issues can break atomic commits or split handoffs, and an alias-collision gap remains.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

tests/test_openrepotools_command.py:393

  • This updated docstring now reads “an install that rewrote all thirteen every time”, which is missing the noun and is grammatically unclear. Please keep the count update while retaining the original meaning by saying “all thirteen files every time.”
    thirteen every time would have nothing to say about which one was stale."""
  • Files reviewed: 14/15 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
@brettheap brettheap added the ready landing gate: runs tests-macos once before the squash label Sep 16, 2026
@brettheap
brettheap merged commit 4c2ffef into main Sep 16, 2026
6 of 7 checks passed
@brettheap
brettheap deleted the feat/amendment-16-lane-rename branch September 16, 2026 13:59
brettheap added a commit that referenced this pull request Sep 16, 2026
…n `lanes-edit.sh`, because both halves add a lane-kind verb and neither of them is a state

`lane-rename` and Amendment 18 met in five places, and in none of them
does either side replace the other:

  * the header's subcommand map takes BOTH blocks — Amendment 16's above
    Amendment 18's, which leaves 18(h) under 18 where it belongs;
  * `is_note_verb` takes THREE verbs, `NOTED`, `RULED` and `RENAMED`,
    while `HANDOFF-REQUESTED` stays inside `is_lane_verb`: the difference
    between those two sets is the OBJECT and not the state, because
    `is_lane_verb`'s ONE caller is the `log` arm's check that a lane
    verb's object is `lane:<name>`, which the request needs and the three
    narrative verbs are given by their own arm. None of the four moves a
    lane and none of the four is seen by a state reader, which is what
    `swapped_candidates` is the proof of;
  * `VERB_LIST` names all of them: `… ENDED RETIRED HANDOFF-REQUESTED |
    CLAIM-LOST | NOTED RULED RENAMED`;
  * the dispatcher's workstation guard takes BOTH new writers,
    `request-handoff` and `rename-lane`. A rename's `RENAMED` line
    carries `session <uuid>@<ws>` and its four moves are one commit, so
    a container with no configured workstation would write its own id
    into the register, the log AND `lanes/aliases.tsv` in a single write;
  * `log` refuses both hand-written lines, `HANDOFF-REQUESTED` and
    `RENAMED`, each in its own words and for its own reason;
  * and the unknown-subcommand usage names `rename-lane` beside `binding`
    and `request-handoff`.

Everything else merged clean, and the counts were checked rather than
assumed: AGENTS.md keeps both sides' dated cap entries and the higher
number — 278, which is exactly what the merged file measures — the
README cap stays 472 at 472 lines, `HELPER_BASH` gains `lane-rename`,
and the artifact count is main's, 27 artifacts and 13 files on PATH.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01EaHzfTLW4u9ukpWuw8Dt6r
brettheap added a commit that referenced this pull request Oct 2, 2026
…-16 totals: a row goes to every placed regular file (the installables plus the skill and command files, with no row for the two hook entries or for the receipt), and the number is derived as `ARTIFACTS - HOOK_ENTRIES` and named as 27 artifacts and 25 rows only where it must appear (Copilot on #103 at `openRepoTools:325` and `tests/test_openrepotools_command.py:822`, #57)

`INSTALLABLES` has thirteen files since `lane-rename` (Amendment 16, #81), so "twenty-six artifacts, twenty-four of them files, twenty-four rows" and "twenty-four rows, not twenty-six" were each two short; the three other places that carried the old totals ("beside the twelve", "twelve of the twenty-four", "twelve more rows every run", "twenty-four plus one more bin directory") now say what they mean without a number that the next list change would strand again.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
brettheap added a commit that referenced this pull request Oct 3, 2026
Bring in #81 (lane-rename and the lane alias table), #129, #131, #133,
#135 and #136 so the PR is mergeable again. Two textual conflicts, both
resolved so each side's intent survives:

- lanes-edit.sh, the `*)` arm's unknown-subcommand list: main added
  `rename-lane`, this branch added `duplicate-holder`. The list now
  carries both, which is what test_repo_hygiene's derived-list check
  demands of the dispatcher.
- tests/test_lane_helpers.sh, the suite's fakebin: main added a fake
  `gh` (Copilot round 7 on #81), this branch added fake `pgrep` and
  `ps` (issue #39). All three fakes are kept and the one chmod line
  marks all five fakebin entries executable.

No new main code calls pgrep or ps, so the suite-wide fakes change
nothing for main's new cases; and main's file-keyed LOG_AWK lane field
leaves holder_is_dead's verb-only read and superseded_by's tolower
comparison unchanged in meaning.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Oct 4, 2026
Bring #97 onto a current base before the seam rework Brett Heap ruled on
2026-10-04 ("managed ledger owns enrolled lanes; #97 owns legacy — rework
both"). Main moved 14 commits past 957a26f, to daed209: #81 lane-rename,
#83 Amendment 18, #93 Amendment 19, #61 claim --force takeover, #146,
#119, #101-#103, #129, #131, #133, #135, #136, #139 and #134.

Four files conflicted, and in every one both intents survive:

- lanes-edit.sh, the function sections: both sides appended after
  migrate_state_cells. Main's Amendment 19(c)/(d) sweep and archive stay
  directly under it, because its header says "the shape
  `migrate-state-cells` has one screen up"; #97's lifecycle and
  inventory section follows them.
- lanes-edit.sh, the unknown-subcommand refusal: the union of both lists,
  56 names, the same set as the dispatcher's 56 arms.
- lanes-edit.sh, the exit-code table, and the manual's copy of it: #97's
  7 row ("another act got there first", in three verbs) is kept, and exit
  9 now has two meanings, one per verb. #61 spent 9 on `claim --force`'s
  abandoned takeover and #97 spent it on `lane-state`'s unreadable
  snapshot, and each PR took it as unused. Neither verb can return the
  other's 9, so the table names both and nothing is renumbered in a
  merge. The manual's 9 row said "(`claim` only)", which the merge would
  have made false; its 7 row now names #97's two fenced writers too, as
  the code table already did. The next commit moves #97's 9 to 10.
- lane-handoff, the late-record restart line: #129's
  `$lane_profile_word` (lclaude) with #97's lifecycle line under it.
- docs/README-lanes.md: Amendment 19's section, then #97's #91 section,
  so the amendment sections stay in number order.
- tests/test_lane_helpers.sh: main's Amendment 19 and Amendment 18
  sections run first, in main's order (A18's restores its fixtures), and
  #97's self-contained #91 section follows them, before the
  workstation-seam section, as it did on #97's branch.

lane-start auto-merged around #134's rewrite. #97's section 4a still
prints the reconciliation after Amendment 18's binding gate and before
section 5 and the STARTED/RESUMED write in 5b. AGENTS.md, README.md,
tests/test_repo_hygiene.py and skills/ are byte-identical to main, so
the 316- and 486-line caps already match the merged counts.

Locally, tests/run.sh -k 'lane_helpers_suite or repo_hygiene or
lane_start_claude_current or guard_launch_mode or install_skill_and_hook':
274 passed, 600 deselected, in 1560 s.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Oct 21, 2026
…put a cut-short register back, retire-rows refuses an unpushed log rename before it writes and calls a lane closed only from its published log, and add-row refuses an archive row it cannot read and takes back a row refused after its rebase (#120, #122) (#263)

* Tests for #120 and #122: register rewrites cut short, the sweep's case-only rename, a closed lane's refusal, and add-row's archive scan

New tests/test_register_hardening_120_122.py, in the shape of
test_register_scan_hardening_138.py: a throwaway register in a local bare
repository, the real lanes-edit.sh against it. All 19 cases fail at
5e88a2c, each on the assertion it targets:

- #120 item 1: a register copy or rewrite cut short (a `cat` shim cuts one
  copy at half its lines) leaves a half register, committed with exit 0, or
  behind an exit 5 that calls it UNCHANGED;
- #120 item 2: a case-only log rename whose commit is not pushed passes
  retire-rows' scan, and ensure_log refuses it inside the write loop after
  the lane before it has had its log created;
- #120 item 3: the refusal for a lane whose log already closes it names no
  exit, and the one for a parked lane does not name lane-end <lane>;
- #122: an archive row whose lane cell is mangled is skipped, and an awk
  scan that failed reads as no match, so add-row reissues a retired position.

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

* The register's two rewrites prove what they copied and what landed, and put the register back where a write cut it short (#120 item 1)

replace_line and delete_lines made every proof (line count, numstat, the
no-op) against a `cat` of the register into $pre whose status was never
read, and wrote the result with `cat -- <out> > LANES.md`, whose status was
read but not its result, while `>` truncates before cat writes. Measured
at 5e88a2c with a `cat` that cuts one copy at half its lines:

- a short COPY: the half register passed every proof and was written back,
  committed and pushed, exit 0 (set-row-state and archive-rows alike);
- a WRITE that failed part-way: exit 5 saying "its line N is UNCHANGED",
  with the register at half its bytes;
- a WRITE that came out short and said nothing: exit 0, half a register
  committed.

register_copy now compares the copy with the register, and
register_rewrite compares what landed with what was built; where it differs
the copy's bytes are put back and proved, and the refusal (5) says which of
the two the register holds, or, where even that failed, that it MAY NOW BE
TRUNCATED and how to restore it before the next write commits it as a
pre-existing edit. The status check on the write itself landed earlier
(4c2ffef, #81, for replace_line; c1bac0d, #93, for delete_lines); this
adds the proof the issue asked for, and the copy it rests on.

The header's exit-code table and the README's row 5 say so. Tests: five
cuts against each of the two acts in tests/test_register_hardening_120_122.py.

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

* retire-rows' scan refuses a case-only log rename whose commit never landed, in ensure_log's own words, before any log is written (#120 item 2)

The sweep's published-path preflight asked ensure_log's question only where
this checkout had NO log (`rr_ln2 = 0`), beside a clause comparing a
basename with a repo-relative path that could never be equal. So the state
a case-only rename leaves when its commit is not pushed (the row's spelling
here, committed; the old spelling on origin; a checkout merely ahead) passed
the scan, and ensure_log refused it inside the write loop, after the lanes
before it had had their logs created and appended: measured at 5e88a2c,
exit 2 with lanes/log/repoX-2.md left behind for a sweep of repoX-2 and
repoX-3.

The preflight is now ensure_log's test (the published path is not the
canonical one, and this checkout's file is not the one it names) and carries
ensure_log's sentence, so the two refusals read the same. The README's
sweep section names it.

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

* retire-rows tells a lane whose log already closes it that it is CLOSED and names archive-rows, and sends a running or parked one to lane-end (#120 item 3)

The rule stays clause (c)'s, as the issue declined to change it: a log that
carries a lane-kind line refuses the sweep. The sentence now follows the
LAST lane-kind line. ENDED or RETIRED: the lane is already CLOSED and hidden
(19(b)), its log is append-only, and `lanes-edit.sh archive-rows <repo>`
takes rows whose cell says RETIRED out of the register (19(d)); `lane-end`
is not named, because it is not the exit for a lane that has ended.
STARTED, PAUSED or RESUMED: "End it as itself when its work is done:
lane-end <lane>". At 5e88a2c both read the same sentence and named neither
exit.

The shell suite's pinned fragments ("RETIRED line", "ENDED line",
"carries a PAUSED line") are kept. The README's sweep section says so.

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

* add-row refuses an archive line it cannot take apart, by its number, and an archive scan that failed, instead of reissuing a retired position (#122)

retired_identity_hits skipped every `|` line of the archive with no
backticked token, took the first backtick anywhere in a line as its lane,
and returned the status of the `sort -u` behind its awk. So a retired row
whose lane cell a hand edit had mangled, or an awk that failed, read as "no
archived row matched", and add-row reissued the position (measured at
5e88a2c: exit 0, the row pushed).

Every `|` line is now the rule, the header (first cell `lane`, as
archive_rows writes it), or a row whose first backticked token lies wholly
inside its first cell. Any other line is named by its line number and
add-row refuses with 1, the code it uses for an archive it could not read;
retired-identity and the after-rebase rescan fail closed the same way. The
header is found by its first cell and not by a ` | ` count (it carries six,
like a row) nor by the rule below it (the live register has rows between
its header and its rule). Dry-run against the live register's 75 `|` lines:
its header, its rule and all 73 rows pass, none refused. The scan's own
status is now read.

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

* Tests for #120 and #122 take test_register_scan_hardening_138's register harness rather than a copy of it

SonarCloud's quality gate on #263 failed on duplication alone: 72 of the
519 new lines (13.9%, gate 3%), every one of them in the Register class this
file copied from its neighbour. It now subclasses that class, as
test_lane_start_hardening_138 imports its Sandbox, and adds only what these
cases need: thirty rows of another repository below repoX's, the published
read, and the cat and awk seams. No case changes.

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

* #263 review fixes: add-row's after-rebase refusals take their row back, register refusals name what is already on disk, and a lane is called CLOSED only from a published closing line

The independent Opus review of #263 returned FIX: one MUST, two SHOULDs and
seven NITs.

M1. add_row_retirement_rescan only took the committed row back on a
retired match. When the rescan after `pull --rebase` refused for any other
reason (an archive it could not read, or a peer's archive line it could not
take apart), it returned 1 and left the add-row commit at HEAD, and the next
unrelated write from this checkout published the refused row. Every refusal
there now runs the same compensation: the exact appended line is removed in
a local commit. The new test is in repo19race's shape: a peer publishes a
mangled archive row during add-row's pull. add-row exits 1, the row is gone
from the local HEAD and from origin, and a later set-row-state publishes
nothing of it.

S2. register_copy's refusal said "Nothing was written" after retire-rows
had appended a log and archive-rows had created the archive. It now says
nothing has been committed, and lists what the act already wrote in this
checkout: the sweeps name their writes with reg_wrote. retire-rows calls a
lane CLOSED only when origin's log ends on the closing line. A closing line
that only this checkout's log carries, such as an earlier sweep's that
stopped part-way, is refused as exactly that.

S1. One unparseable archive line makes `retired-identity`, and so every
`lane-start`, refuse, and lane-start (lane 3's file, unchanged here) hides
the reason. The README says so, and how to see the line.

NITs:
- 1: the README says CRLF archives and space-less tables are refused.
- 3: add-row's own refusal is asserted. "As it was" has its own message,
  apart from the put-back and the truncation, with an unwritable-register
  case for both acts. archive-rows is matched exactly.
- 4: each bad line names the copy it is in, published or this checkout's.
- 5: an ENDED lane is not told it "is not retired a second time", and
  archive-rows is not named as its exit.
- 6: where the register MAY NOW BE TRUNCATED, the exact copy from before
  the edit is moved out of the trap's reach and its path named.

Lock lines are untouched.

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

* #263 delta review: add-row's take-back removes only a row this checkout adds, refusals say this act committed nothing, and the kept register copy lives in the git directory

The delta review of #263 at 42e73e5 returned FIX: one MUST and three NITs.

D1. add_row_retirement_rescan took the rejected row back by its exact
text. Suppose a peer publishes the byte-identical row during add-row's
`pull --rebase`. The rebase drops add-row's commit as already upstream,
and the copy left is the peer's. The take-back deleted it, and the next
write published the deletion, so the peer's row was gone from origin.
The take-back now removes only the copy that this checkout's register
adds over origin's. It reads that copy from their -U0 diff, by
content, so the check holds under the sha the rebase gave the commit.

- None added: nothing is taken back, and the refusal code is returned.
- One added: exactly that line, and it is checked first.
- More than one, or an unreadable diff: nothing is taken back, and the
  refusal says so.

"origin already has the row" would be wrong the other way. A commit that
survived beside a peer's identical row at another place would be kept,
and the next write would publish a second copy. The retired-match branch
shares the path.

NITs:
- A refusal now says "this act has committed nothing". handle_preexisting
  may already have captured a peer's edit as a commit of its own. Where
  add-row's take-back cannot rewrite the register, the refusal instead
  says that add-row HAS committed its row, and how to remove it.
- "an ENDED line", not "a ENDED line".
- The kept copy of the register goes to the checkout's own git
  directory, as lanes-edit-register-before-edit.<UTC>.<pid>. It is
  written with mode 0600 under noclobber and proved with cmp. Only where
  that cannot be done is it renamed beside $TMPD, and the refusal then
  says a restart would lose it.

Lock lines are untouched; lane-start and lane-handoff are untouched.

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

* #263 delta review: the D1 tests assert the published register before the take-back's message

Both D1 cases now run the next unrelated write and count the published
repoX-4 rows before they read add-row's stderr. A run against 42e73e5 is
then red on what the review measured, the peer's row gone from origin or
add-row's commit published as a second copy, rather than on a sentence.

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

* #263 delta review 3: add-row's take-back finds its row's line whatever context the diff carries, and its refusals speak add-row's own words

Delta review 3 of #263 (d0256ff) returned FIX: one SHOULD and one NIT.

S3. The take-back read its row's line from `git diff -U0` and counted
only `+` lines. -U0 does not hold on its own. GIT_DIFF_OPTS=-u3 in the
environment overrides it, and a user's diff.interHunkContext fuses a
nearby change's hunk with the row's, with the lines between as context.
Either way the row was put at the wrong line, the line check refused,
nothing was taken back, and the next ordinary write published the
refused row: M1 again. Both halves of the fix are in:
- that one diff runs with GIT_DIFF_OPTS unset (inside the command
  substitution's own subshell) and -c diff.interHunkContext=0, which
  outranks every config file and GIT_CONFIG_* in the environment;
- the parse advances its new-file line on every hunk line except a
  removed one (`-`) and git's "\ No newline" note, so context that
  still arrives is counted where it stands.

The tests cover four cases:
- GIT_DIFF_OPTS=-u3;
- diff.interHunkContext=3 beside an unpushed edit one row above the end;
- context forced in by a shim;
- another lane's unpushed row just above.
Each asserts the published register after the next write, and how the
diff was called.

NIT. When the take-back's own rewrite failed, the refusal ended in
delete_lines' sentences, which are archive-rows': "the rows are in"
the archive, and "the archive may have been appended". delete_lines now
takes its caller's sentences, with archive-rows' as the default.
add-row's say its row is still committed locally and unpushed, and
that it must be removed before any other write publishes it.

Lock lines are untouched; lane-start and lane-handoff are untouched.

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

* #263 delta review 4: add-row's take-back reads its diff as text and proves its removal whatever the register's size, and every refusal or failed commit after it says add-row has committed its row

Delta review 4 of #263 (5b460b7) closed S3 and returned FIX: one SHOULD
and two NITs.

S4. Where git classes the register as binary, the take-back's diff is
the one line "Binary files ... differ", with no hunk to read. add-row
then said this checkout added no copy of the row, kept its commit, and
the next write published the row: M1 again. The review measured eight
routes: a binary or -diff attribute, published or local, a diff driver
with binary=true, core.attributesFile, GIT_ATTR_SOURCE, attr.tree, a NUL
byte in the first 8000 bytes, and a core.bigFileThreshold below the
register's size (the live register is 2,309,050 bytes). The fix:
- (a) the take-back's diff is read with --text;
- (b, the review's N2) delete_lines' line-count and numstat refusals end
  as register_copy's does: the register as it was, what this act has
  committed, the caller's sentence and what it has already written;
- (c) delete_lines' numstat proof runs with -c core.bigFileThreshold=2g.
  Under a smaller threshold numstat printed "-" for both counts, and
  --text does not change that, so the take-back refused. A command-line
  -c outranks the global config and GIT_CONFIG_* in the environment.
An attribute on every path, or a NUL byte, still makes numstat read the
copies as binary at any threshold; the take-back then refuses (exit 5)
in add-row's words.

N1. The refusal of the pass that removes the line said "The register is
as it was: no row was removed, so that row is still in it and in that
commit", naming no lane and no commit. It takes (b)'s sentence.

N3. When the compensating git add or git commit failed, add-row said
nothing of its own, and the next write's commit carried the removal
under that write's caption. A note now says whether the removal is
staged, that add-row's commit still holds the row, and the command that
commits the removal.

Tests: three binary cases (-diff in .git/info/attributes, a published
.gitattributes with binary, core.bigFileThreshold=200), each asserting
the published register after the next write; three more ways the
take-back cannot remove its row (the pass refused, a line count off,
numstat reading binary), each asserting add-row's sentence; and the
failed stage and commit, each running the command the note gives.

Lock and sidecar lines are untouched; lane-start and lane-handoff are
untouched.

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

---------

Co-authored-by: Brett Heap <[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

ready landing gate: runs tests-macos once before the squash

Projects

None yet

2 participants