Skip to content

Amendment 19: a closed or dormant lane leaves the listing, one sweep retires a repository's dormant rows on a word, and a retired position is never reissued - #93

Merged
brettheap merged 45 commits into
mainfrom
feat/amendment-19-closed-lanes-leave-the-listing
Oct 3, 2026
Merged

brettheap merged 45 commits into
mainfrom
feat/amendment-19-closed-lanes-leave-the-listing

Conversation

@brettheap

@brettheap brettheap commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openrepotools-3 (openRepoTools-3)

Closes #42. Tooling half of Lane Collision Protocol Amendment 19 (brettheap/new-workstation#36, text #37 → main 69eb676), ratified by Brett Heap 2026-09-14T13:46:16Z, verbatim "ratify 19". Built on #82 (Amendment 13's set-row-state), which is on main as 9449557.

Why. lanes inside the openxFactory checkout on 2026-09-14 listed nineteen rows for five lanes: the five live under team-01b, and fourteen marked NO LOG — lanes that ran between 2026-08-27 and 2026-09-02, before Amendment 7 gave every lane an object log, and that no writer today can close, because lane-end wants a live session or a log to write into and they have neither. They sat at the top of every listing and the next free position was read past them. Brett Heap, verbatim: "openxfactory has 19 lanes showing with command 'lanes'. we need tools to clean them up."

The acts

(a) Two states below PARKED. CLOSED = the lane's object log's last lane-kind line is ENDED or RETIRED. DORMANT = a row with no object log and no live session on this workstation. Dormancy is asked of the facts table the listing already builds (lane_row_facts emits a line for every lane whose log carries one of the five lane verbs), so it costs nothing — a git cat-file per lane would make the listing pay for the whole estate to answer about the rows it is about to hide.

One row with no log is not dormant: one whose state cell is Amendment 13(a)'s phrase naming a state other than ENDED, RETIRED or the migration's MIGRATED. The register says where a lane IS (13(a)), and hiding a row that says PAUSED would hide a lane a person can still pick up. (mig_cell_is_phrase is the same test the migration makes of the same cell, not a second reading of it, and since round 1 the sweep re-proves it for itself.)

(b) The listing. lanes lists neither by default; --closed adds them, and combines with --all, --here and the narrowing flags. A CLOSED lane shows with the closing line's verb (STATE) and its time (AGE); a DORMANT row as NO LOG with a second line carrying its start date, its state cell's head and FLAGS where that cell says the work was unpushed, lost, a loss or owed, or still says LIVE. --lane <name> is never filtered: its caller has named the lane, and an empty answer would read as "no such lane".

The row gains four columns at the end — class, started, the cell's head, the flags — and every surface that splits it by position (lanes, lane, lane-end's sweep, lane_groups) was taught to read them, because four unread fields at the end land in the twelfth, which is the fork count lanes prints a DEFECT for. Since #83 landed they are columns 14–17: #83's binding locality kept 13, and 13 now prints none rather than empty, because a tab-IFS read collapses an empty field and would shift every column after it.

The next free position is computed over EVERY row: next-free unions the rows on stdin with the published register and archive (this checkout's as the fallback), so a hidden row that is on origin and not pulled here still holds its position — and a source that exists and cannot be read is a refusal rather than an empty set, because a position is handed out once and a read that failed is never an answer (7(d)).

Also in (b): a LIVE lane's line now prints the ATTACH — lane <name> — superseded by #83, which landed first and fills a LIVE row's column 10 with the attach itself (tmux switch-client/tmux attach -t <session>:<@id>); this PR now asserts only that a LIVE row is never offered a launch.

(c) The sweep. lane-end --retire-dormant <repo> [--reason "<why>"] [--yes] — a DRY RUN naming every dormant row with its start, workstation and cell head, flagging the ones above, so the person sees what the sweep will close before it closes it; an agent's stdin is not a terminal, so the word is --yes typed by a person. With --yes it is ONE commit (lanes-edit.sh retire-rows, the lock held once, the scan inside it): each lane's log is created with a single RETIRED line carrying the reason and the row's own last words, and the row's state becomes RETIRED · <UTC> · <why>; was: <head>.

  • The payload on a RETIRED is this amendment's own: 7(b) gives that verb none and A11(c) keeps it that way (which is why lane-end's fork retire is a door that writes nothing), and 19(c) — later, ratified, spelled out character by character — carries the row's last words into the log so nothing the row said is lost when the row stops saying it.
  • The cell is 13(a)'s phrase, not clause (c)'s literal RETIRED <UTC> · <why> · was: <head>, which is four parts where the cell has three and whose first word is a state no reader knows. The phrase written here carries the same four facts through row_state_check, the gate set-row-state uses — so the 240-character cap, the | and the second · are refused here exactly as they are there. A | a legacy cell carries becomes / in the ROW and stays verbatim in the LOG line, which is not a table.
  • Refusals, any one of which refuses the whole run before a byte is written (one commit is one decision): a lane a live session holds here — asked of both rows' session ids, published and local, because an id committed here and not yet pushed is on no published cell; a row whose log carries a lane-kind line other than ENDED/RETIRED (a parked lane is not dormant); a row whose own 13(a) cell says the lane is somewhere, which is the listing's test re-proved by the writer rather than trusted from lane-end's list; a repository with no dormant row (nothing to do is said, not done, exit 8); a session-record read that failed (a read that failed is not "nothing is live"); a checkout behind origin or dirty; a row whose | count makes the state cell unknowable; a log that would need Amendment 15's case-rename, which is a write of its own and not one this commit smuggles; an untracked log, which is somebody's uncommitted work; a lane named twice, whose append-only log would take the same line twice; and a --reason that would forge a cell — or whose value is a flag.
  • --reason is checked ONCE, as an argument, so a refusal names the words that are wrong rather than a cell the caller never wrote.
  • It touches no file outside the register and the logs, asserted in the suite.

(d) The archive. lanes-edit.sh archive-rows <repo> [--yes] moves every RETIRED row of that repository into lanes/archive/LANES-retired.md in one commit naming each lane. The archive is written first and the rows removed second — delete_lines proves N removed and zero rewritten — so a refusal between them leaves a copy in the archive and the register whole, never a row in neither. A row of that repository which cannot be taken apart refuses the whole move: the act says it moves EVERY retired row. register_lanes, the register index and the next-free reader all read the archive beside the register, which is the amendment's own sentence.

And add-row refuses a lane name the archive holds (own commit): next-free never offers a retired position, but nothing refused one typed by hand — and that lane's log is append-only, so a second lane under the name would write its life into the first one's file. It stays a REFUSAL and not a resolution: row_line and canon_lane still read the register alone, because a line number from the archive would rewrite the wrong file.

Counts

files lanes-edit.sh, lane-end, lanes, lane, docs/README-lanes.md, tests/test_lane_helpers.sh
new subcommands lanes-edit.sh retire-rows, lanes-edit.sh archive-rows, lanes --closed / lanes-edit.sh lanes --closed, lane-end --retire-dormant (with --reason, --yes)
new row columns 4 (14 class · 15 started · 16 the cell's head · 17 the flags — after #83's 13)
new assertions ~95, in one section of their own on a register of its own
amended assertions 4 places — the row's field count (13 → 17 after #83); the pair that asserted an ENDED lane is still in the listing (19(b) amends 11(j)), now asserting it LEAVES and that --closed puts it back; the pick's fixture read, which asks for --closed so the partition still has a closed row to drop; and the pick section's read case, which asserted that lanes still carried the closed lane

The dry run, on the seeded register

$ lane-end --retire-dormant repo19
lane-end --retire-dormant repo19 — DRY RUN, nothing is written (lane-collision-protocol Amendment 19(c))
  register : …/brett-wip/lanes/LANES.md
  dormant  : 3 row(s), 3 of them FLAGGED

       lane                       started              where      flags
  FLAG repo19-4                   2026-08-27           Eagle      unpushed,loss
       was: ENDED WITHOUT PUSHING — loss risk; work unpushed on branch feat/x
  FLAG repo19-5                   2026-08-28           Raven      owes
       was: dormant since 2026-09-02; owes a handoff
  FLAG repo19-7                   2026-08-29           Eagle      LIVE
       was: LIVE

  A FLAG is this row saying the work was unpushed, lost, a loss or owed, or
  still saying LIVE. Retiring the row does not lose that text: it is carried
  into the RETIRED line of the log this sweep creates, and into the cell.
  Nothing outside the register and the logs is touched — worktrees, branches
  and handoffs stay exactly where they are (Amendment 19(c)).
  reason   : none given — the writer names the amendment (--reason "<why>" says it better)

  DRY RUN — nothing was written. Make it the one act with:
    LANES_LANE=<your lane> lane-end --retire-dormant repo19 --reason "<why>" --yes

and what --yes then wrote, in ONE commit (register + three created logs, nothing else):

RETIRED — lane repo19-4, session <the writer's uuid>@Eagle, <UTC>, lane:repo19-4 → retired-dormant by lane repo19-2; reason pre-Amendment-7 rows, no log, no session; was: ENDED WITHOUT PUSHING — loss risk; work unpushed on branch feat/x
| `repo19-4` | … | RETIRED · <UTC> · pre-Amendment-7 rows, no log, no session; was: ENDED WITHOUT PUSHING — loss risk; work unpushed on branch feat/x |

The first sweep is NOT in this PR

Act 6 of #42 is openxFactory's fourteen rows, and it runs on Brett Heap's word after he sees the dry run. Nothing here was run against the live register with --yes. Read-only, on the live register: all fourteen of those rows split cleanly (six | separators each), so the sweep's all-or-nothing posture will not trip on them; the two rows that do carry a stray separator (openXfactory-2, openxfactory-4) are the big active ones and are not dormant.

The command, from this branch until the install lands:

LANES_WORKSTATION=Eagle …/a19-closed/lane-end --retire-dormant openxFactory
LANES_WORKSTATION=Eagle LANES_LANE=<the sweeping lane> …/a19-closed/lane-end \
    --retire-dormant openxFactory --reason "<why>" --yes

One more thing, from #82

Copilot's last review on #82 (on 76acf51, 17:09Z) posted seven findings as suppressed comments in the review body, with no threads, and that PR's writer was cut off before taking them. Two are taken here because they are in paths this PR builds on — docs/README-lanes.md:463 (the --retire paragraph still described the two-step Amendment 13(a) removed) and lanes-edit.sh:7525 (the retired append-row-status was caught by the generic workspace guard, so on a machine with no workspace it gave the workspace refusal instead of the retirement refusal naming its replacements). A third — an untracked file being swept into an act's own commit, round 2's finding against migrate-state-cells — is taken as a guard in both new acts. The rest are filed as #88 (three migrate-state-cells defects), #89 (the listing never reads the row's current-state phrase — which interacts with the DORMANT rule here and is deliberately left to the migration's author), and #90 (two fail-open reads on the closing paths).

Copilot round 1 is taken in 5c49740 and summarised in a comment below: six findings taken (the liveness read from both rows, the fail-closed archive read, the writer re-proving the listing's dormancy, archive-rows refusing an unreadable row instead of skipping it, add-row asking both archives, and a flag never being a value), one already fixed, and one declined with the amendment's words — using log existence rather than a lane-kind line would put the read and the sweep's own refusal out of step, and would take openxFactory's fourteen rows out of the sweep the moment anyone ran migrate-state-cells.

Copilot round 2 is taken in 47639cc, summarised in a second comment: nine findings, all taken — the pick dropping a row on its CLASS rather than its state word (a dormant row's state is NO LOG, which was in none of lane_groups's lists, so lane <name> could have offered to bind one); the dry run validating --reason before it previews an act that could not run, and forwarding it as one argument; the liveness snapshot taken inside the lock and the lane-kind check reading this checkout's log beside the published one; four reads that answered "empty" for "unreadable" made fail-closed (and the listing, which may not refuse, saying so); add-row comparing the POSITION and not only the name; and lanes's empty branch asking next-free instead of assuming 1, because since 19(b) an empty listing is not an empty register.

🤖 Generated with Claude Code

https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m

Summary by Sourcery

Implement Amendment 19 to hide closed or dormant lanes by default, safely retire dormant rows, archive retired entries, and permanently reserve their positions.

New Features:

  • Add closed and dormant lane classification with opt-in listing via --closed, including state-cell details and live-lane attach guidance.
  • Add an all-or-nothing dormant-row retirement sweep with dry-run previews, reasons, safety refusals, and consolidated register/log commits.
  • Add archival of retired rows and reserve archived positions to prevent lane names and positions from being reissued.

Bug Fixes:

  • Ensure listings, position allocation, and row creation account for hidden and archived rows without treating unreadable sources as empty.
  • Prevent platform-specific multi-line awk -v failures during archive row removal.
  • Keep liveness fixtures valid for the test-suite timeout and expose the portability rule in contributor guidance.

Enhancements:

  • Extend lane readers and pick partitioning to consume the new row metadata consistently, while preserving named-lane queries.
  • Update existing retirement documentation to reflect the single state-cell write introduced by Amendment 13.

CI:

  • Add an assertion that the liveness fixture outlives the test-suite timeout.

Documentation:

  • Document Amendment 19's closed/dormant listing behavior, retirement sweep, archive semantics, and position reservation rules.
  • Document the macOS awk portability constraint in AGENTS.md.

Tests:

  • Add comprehensive coverage for closed and dormant classification, previews, all-or-nothing retirement, archival, unreadable and malformed inputs, position reuse prevention, and portability behavior.

brettheap and others added 6 commits September 15, 2026 19:20
…sting, one sweep retires a repository's dormant rows on a word, and a retired position is never reissued (Amendment 19)

`lanes` inside the openxFactory checkout on 2026-09-14 listed NINETEEN rows for
five lanes: the five live under team-01b, and fourteen marked `NO LOG` — lanes
that ran between 2026-08-27 and 2026-09-02, before Amendment 7 gave every lane
an object log, and that no writer today can close, because `lane-end` wants a
live session or a log to write into and they have neither. They sat at the top
of every listing and the next free position was read past them. Brett Heap,
verbatim: "openxfactory has 19 lanes showing with command 'lanes'. we need tools
to clean them up" — and, of the three choices he was given, "Retire them in one
sweep", "Hide by default, --closed shows", "Amendment 19". Ratified
2026-09-14T13:46:16Z, verbatim "ratify 19".

(a) TWO STATES BELOW PARKED. CLOSED is a lane whose object log's last lane-kind
line is `ENDED` or `RETIRED`. DORMANT is a row with NO object log and no live
session on this workstation — asked of the facts table the listing already
builds, not of the filesystem, so it costs nothing. One row with no log is NOT
dormant: one whose state cell is Amendment 13(a)'s phrase naming a state other
than ENDED, RETIRED or the migration's MIGRATED. The register says where a lane
IS (13(a)), and hiding a row that says PAUSED would hide a lane a person can
still pick up.

(b) THE LISTING. `lanes` lists neither by default; `--closed` adds them — a
CLOSED lane with the closing line's verb and its time, a DORMANT row as `NO LOG`
with its start date, its state cell's head and FLAGS where that cell says the
work was unpushed, lost, a loss or owed, or still says LIVE. It combines with
`--all`, `--here` and the narrowing flags, and `--lane <name>` is never filtered:
its caller has named the lane, and an empty answer would read as "no such lane".
The row gains four columns at the end — class, started, the cell's head, the
flags — and both surfaces that split it by position were taught to read them.
THE NEXT FREE POSITION IS COMPUTED OVER EVERY ROW: `next-free` now unions the
rows on stdin with this checkout's register and the archive below, so a position
the listing hides still holds, and a retired `<repo>-<n>` is never reissued.
A LIVE lane's line now prints the ATTACH — `lane <name>`, the same word, under
its own label (Amendment 18 Addendum 1: a lane live here is attached to and
never started a second time). The column said `none` for the one row where the
act is "go to it".

(c) THE SWEEP. `lane-end --retire-dormant <repo> [--reason "<why>"] [--yes]` is
a DRY RUN that names every dormant row of that repository with its start, its
workstation and its cell's head, and FLAGS the ones above — so the person sees
what the sweep will close before it closes it; an agent's stdin is not a
terminal, so the word is `--yes` typed by a person. With `--yes` it is ONE
commit (`lanes-edit.sh retire-rows`, the lock held once, the scan inside it):
each lane's log is created with a single `RETIRED` line carrying the reason and
the row's own last words, and the row's state becomes
`RETIRED · <UTC> · <why>; was: <head>`. Clause (c) spells that cell
`RETIRED <UTC> · <why> · was: <head>`, which is four parts where 13(a)'s cell
has three and whose first word is a state no reader knows; the phrase written
here carries the same four facts through `row_state_check`, the gate
`set-row-state` uses. It refuses a lane a live session holds here, a row whose
log carries a lane-kind line other than ENDED/RETIRED (a parked lane is not
dormant), a repository with no dormant row (nothing to do is said, not done),
and a session-record read that failed — a read that failed is not "nothing is
live". Any one refuses the whole run before a byte is written, because one
commit is one decision. Nothing outside the register and the logs is touched.

(d) THE ARCHIVE, a second act on a second word: `lanes-edit.sh archive-rows
<repo> [--yes]` moves every RETIRED row of that repository into
`lanes/archive/LANES-retired.md` in one commit naming each lane. The archive is
written FIRST and the rows removed second — `delete_lines` proves N removed and
zero rewritten — so a refusal between them leaves a copy in the archive and the
register whole, never a row in neither. `register_lanes`, the register index and
the next-free reader all read the archive beside the register, which is the
amendment's own sentence.

The payload on a `RETIRED` line is this amendment's own: 7(b) gives that verb
none and A11 clause (c) keeps it that way, and 19(c) — later, ratified, spelled
out character by character — carries the row's last words into the log so that
nothing the row said is lost when the row stops saying it.

Tests: a seeded register of its own (a live lane, a parked one, an ended one,
three rows with no log, and a seventh whose 13(a) cell says PAUSED) — the
default lists two, `--closed` six, the dry run flags the `unpushed` cell and
writes nothing, `--yes` writes three logs and three cells in ONE commit whose
every path is under `lanes/`, a second `--yes` says nothing is dormant, a live
lane and a parked one are refused by the writer itself, the RETIRED line's
session field is the WRITER's uuid (7(b)), `archive-rows` moves the rows and the
position still skips them, and the wrapper prints the attach for a live lane.
Three existing cases are amended rather than worked around: the row's field
count, the pair that asserted an ENDED lane is still in the listing (19(b)
amends 11(j)), and the pick's fixture read, which now asks for `--closed` so
that the partition still has a closed row to drop.

Docs: the two states, the sweep and the archive in `docs/README-lanes.md`, plus
the `--retire` paragraph that still described Amendment 13(a)'s removed two-step
(Copilot round 4 on #82, suppressed comment `docs/README-lanes.md:463`).

Closes #42

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
…ith no workspace too (#82, Copilot round 4)

It is out of the dispatcher's WRITER list and says of itself that it refuses
"before the workstation guard and before the register is even looked for" — but
the generic guard one case below caught it all the same. On a machine with no
configured workspace the caller got the WORKSPACE refusal (exit 1) instead of
the RETIREMENT refusal (exit 2) naming `set-row-state` and `log NOTED`, which
are the two acts that replace it. A compatibility refusal that only fires where
the register is already reachable is not one.

Taken from the suppressed comments of Copilot's last review on #82
(`lanes-edit.sh:7525`), which its writer was cut off before reading; the rest
are filed as issues of their own.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
…n cannot be reissued by hand either (Amendment 19)

`next-free` counts the archive and never OFFERS a retired `<repo>-<n>`, but
nothing refused one that was typed: `archive-rows` moves a RETIRED row out of
`lanes/LANES.md`, and every duplicate test this writer makes reads the register
alone — so `lane-start <repo> 4` on an archived position would have appended a
second row for a lane whose object log already exists. That log is APPEND-ONLY:
the new lane would write its life into the old one's file, and every read of it
— who holds what, when it was claimed, which session paused it — would answer
for two lanes at once.

The archive is asked beside the register, the refusal names the file, the
spelling it found and that lane's log, and it stays a REFUSAL rather than a
resolution: `row_line` and `canon_lane` still read the register alone, because a
line number from the archive would rewrite the wrong file.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
…drops a `--` sed will not need

Two small ones, both about acts that are ONE commit. `retire-rows repo19-4
repo19-4` would have appended the same `RETIRED` line to that lane's log twice,
inside a single commit, in a file that is append-only and that no later line can
correct — so a duplicate in the argument list is refused by name, compared on
the RESOLVED lane so that two spellings of one lane are one lane here as they
are everywhere else (Amendment 15).

And `archive-rows`'s dry run printed its names through `sed -n 's/^/  /p' --
<file>`; the `--` buys nothing there and this file is parsed and run under BSD
userland on the macOS job. One `awk` instead, which is how the rest of this file
indents a list.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
… of a reissued name is asserted

Two test changes. `lanes --prefix repoPick` no longer carries the CLOSED lane —
the pick hid it before the read did, and 19(b) takes it out of the read too —
so that case now asserts the absence and a new one asserts that `--closed` puts
it back with the line saying which verb closed it. What has not moved is the
POSITION, and the footer assertion beside it still proves that.

And the archive's half of "a retired `<repo>-<n>` is never reissued" is asserted
where it is enforced: `add-row` refuses a lane name the archive holds, naming
the archive and that lane's log, while the free position beside it is still
added.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
…s a cell half-way down the scan

It goes into every row the sweep rewrites, so a `|`, a second ` · ` or a newline
in it is a refusal of the ARGUMENT — named as one, with the words that are
wrong — instead of `row_state_check` dying on the first row with a message about
a cell the caller never wrote. Nothing had been written either way (every test
in that act is made before the first byte), but a refusal a person cannot act on
is a refusal that costs them the run twice.

The cap beside it is 180 where the cell's own line is 240, because the row's OWN
last words go in beside the reason and a reason that fills the cell leaves none
of them.

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

@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 5 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

Amendment 19 adds closed/dormant lane classification and listing controls, an atomic dry-run-first sweep that retires dormant rows, and an archive integrated into all position and identity reads so retired lane names and positions cannot be reused; the PR also updates retirement compatibility documentation and extensive shell assertions.

Sequence diagram for dormant lane retirement sweep

sequenceDiagram
    actor Operator
    participant lane_end
    participant lanes_edit as lanes-edit.sh
    participant Register
    participant Logs
    Operator->>lane_end: --retire-dormant repo [--reason] [--yes]
    lane_end->>lanes_edit: retire-rows dormant lanes
    lanes_edit->>Register: scan rows and state cells
    lanes_edit->>Logs: check logs and live sessions
    alt dry run
        lanes_edit-->>Operator: list rows, starts, workstations, heads, flags
    else --yes and validation succeeds
        lanes_edit->>Logs: create RETIRED line per dormant lane
        lanes_edit->>Register: set state to RETIRED phrase
        lanes_edit-->>Operator: commit register and logs once
    end
Loading

Sequence diagram for retired row archiving

sequenceDiagram
    actor Operator
    participant lanes_edit as lanes-edit.sh
    participant Register
    participant Archive
    Operator->>lanes_edit: archive-rows repo [--yes]
    lanes_edit->>Register: find RETIRED rows
    alt dry run
        lanes_edit-->>Operator: list rows to archive
    else --yes
        lanes_edit->>Archive: append retired rows first
        lanes_edit->>Register: delete exact rows
        lanes_edit-->>Operator: commit archive and register once
    end
Loading

Flow diagram for closed and dormant lane listing

flowchart TD
    A[Read register and archive rows] --> B[Build lane_row_facts]
    B --> C{Lane classification}
    C -->|Last log verb ENDED or RETIRED| D[closed]
    C -->|No object log and no live session| E{State cell is active phrase?}
    E -->|PAUSED, LANDING, HANDED OFF, or other active state| F[none]
    E -->|ENDED, RETIRED, or MIGRATED| G[dormant]
    C -->|Other| F
    D --> H{--closed or --lane specified?}
    G --> H
    F --> I[Listed by default]
    H -->|yes| J[Include row with class, started, head, flags]
    H -->|no| K[Hide row]
Loading

File-Level Changes

Change Details Files
Classify and filter closed and dormant lanes in listings while preserving explicit lane lookups.
  • Derive CLOSED from terminal log state and DORMANT from missing log/session plus migration-compatible state-cell parsing.
  • Add --closed support and four trailing output columns for class, start date, state-cell head, and flags.
  • Keep named-lane queries unfiltered, render close metadata, and show an attach command for LIVE lanes.
  • Teach both listing surfaces and lane grouping to consume the expanded row format.
lanes-edit.sh
lanes
lane
docs/README-lanes.md
tests/test_lane_helpers.sh
Implement an atomic dormant-row retirement sweep with dry-run reporting and fail-closed validation.
  • Add retire-rows and expose it through lane-end --retire-dormant with --reason and --yes.
  • Validate live sessions, existing log states, malformed cells, log case collisions, repository synchronization, workspace cleanliness, and writer identity before writing.
  • Create one RETIRED log line per row carrying the original state-cell head, update cells through the Amendment 13 grammar, and commit register plus logs together.
  • Add refusal-path and one-commit regression coverage for flagged rows, parked/live rows, and no-op sweeps.
lanes-edit.sh
lane-end
docs/README-lanes.md
tests/test_lane_helpers.sh
Archive retired rows without losing their identity or position reservations.
  • Add archive-rows with dry-run and --yes modes, writing the archive before deleting register rows.
  • Prove deletions remove only the selected lines and commit the register/archive move atomically.
  • Include archived rows in listing, register indexing, and next-free calculations.
  • Reject add-row attempts for lane names already present in the archive.
lanes-edit.sh
lanes
lane
docs/README-lanes.md
tests/test_lane_helpers.sh
Update Amendment 13 retirement documentation and compatibility behavior.
  • Document the single-write set-row-state retirement semantics and accept the obsolete --state-was argument without using it.
  • Move the retired append-row-status compatibility refusal ahead of the workspace guard.
  • Expand documentation and assertions for the new commands, columns, filtering rules, archive semantics, and safety guarantees.
lanes-edit.sh
docs/README-lanes.md
tests/test_lane_helpers.sh

Assessment against linked issues

Issue Objective Addressed Explanation
#42 Update lane listing behavior so CLOSED and DORMANT rows are hidden by default, shown with --closed, next-free considers all register and archived rows, and retired positions cannot be reused. ✅
#42 Implement dormant-row retirement and archiving: provide a dry-run/--yes repository sweep that performs one commit with the required refusals, logs, state updates, and writer session identity; provide archive-rows with one-commit movement of RETIRED rows; and update documentation and tests. ✅
#42 Perform the first openxFactory sweep by running the dry run and, after Brett Heap's approval, retiring the fourteen specified dormant rows. ❌ The PR explicitly states that Act 6, the openxFactory fourteen-row sweep, was not run in this PR; it only implements the tooling for a later operator-approved run.

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

brettheap and others added 5 commits September 15, 2026 21:04
…, because it is where a person learns what this file answers to

`tests/test_repo_hygiene.py::test_the_unknown_subcommand_refusal_names_every_
subcommand_there_is` caught it on the Windows job, which is the one that runs
the static tests alone: the two new arms existed and worked, and a person who
mistyped either was told by omission that it does not exist. That is F-X16's own
defect — `fetch-age` was missing from the same list for the same reason — and
the test derives the list from the dispatcher's own arms precisely because a
restated list is the thing that drifts.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
`archive_text` swallowed a failed `git show` and answered with nothing, which
for this file is not a small loss: its rows hold POSITIONS, and read as absent a
retired `<repo>-<n>` comes back on offer — the one thing Amendment 19(d) exists
to prevent. It now falls through to this checkout's own copy and says on stderr
that it did, which is `log_sync`'s own posture for a fetch that did not answer.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
…d work, and neither act may commit it

The finding `migrate-state-cells` took in round 2 of #82, in the two acts that
have its shape. A TRACKED file that is dirty is already refused for the whole
run by `refuse_dirty_checkout`, which exempts the register alone and reads
staged and unstaged alike; an UNTRACKED file is in neither of those lists, so
appending to it would put a peer's first lines into this act's one commit, under
this act's message.

For the sweep that is a lane's object log: a dormant row usually has none at
all, but a MIGRATED one has a log of NOTED lines, and that is the file this
meets. For the move it is the archive itself. Both are checked in the scan,
before a byte is written, and both name the commit that settles them.

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

`repo19-6` — the row the `add-row` case leaves behind, dormant and with no log —
gets an uncommitted log beside it, and the sweep refuses by name rather than
carrying a peer's first lines into its own commit. Nothing is written and the
file is taken away again.

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

The section listed clause (c)'s three refusals and stopped there, while the act
also refuses a checkout behind or dirty, a row whose separators hide the state
cell, a log needing Amendment 15's rename, an untracked log, a lane named twice
and a `--reason` that would forge a cell — and the archive half now says that a
published file it cannot render falls back rather than reading as empty, and
that `add-row` refuses a name the archive holds. A manual that lists some of the
refusals reads as a list of all of them.

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

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 dormant classification, retirement, archival, session detection, position reservation, and argument validation.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Implements Amendment 19 for lane cleanup, dormant-row retirement, archival, and permanent position reservation.

Changes:

  • Adds CLOSED/DORMANT listing and expanded row metadata.
  • Adds dormant retirement and retired-row archiving workflows.
  • Updates lane parsing, documentation, tests, and position allocation.
File summaries
File Review summary
tests/test_lane_helpers.sh No final comments.
lanes-edit.sh 5 critical, 2 moderate, 1 nit: lifecycle-only logs can be mistaken for missing logs; retirement and archival may accept or partially process invalid rows; local session IDs are omitted from LIVE checks; position allocation can miss published/archive data or fail open; usage omits new subcommands.
lanes No final comments.
lane-end 1 moderate: spaced --reason accepts a following flag as its value instead of rejecting the malformed invocation.
lane No final comments.
docs/README-lanes.md No final comments.
Review details

Suppressed comments (5)

lane-end:527

  • The spaced --reason arm accepts the next flag as its value. For example, lane-end --retire-dormant repo --reason --yes consumes --yes as the reason, silently falls back to the dry run, and exits successfully instead of refusing the malformed invocation or performing the requested act. Reject -* values and require the documented --reason=<why> spelling for a reason that starts with -, consistent with the other command parsers.
    --reason)      sweep_reason="${2-}"; [ -n "$sweep_reason" ] || die "--reason needs the words that say why" 2; shift 2 ;;

lanes-edit.sh:7906

  • The writer's second liveness check has the same published-only problem: session_ids_of_lane reads the origin row, while rr_row is read from the working tree and the ahead check permits a clean local commit. A current UUID added locally is therefore absent from rr_ids, so rr_live cannot fence that lane and this command can retire it. Include session_ids_local_of_lane in this fail-closed recheck.
    # (c) REFUSAL 1 — a live session here.
    rr_ids="$(session_ids_of_lane "$rr_l" 2>/dev/null || :)"
    for rr_id in $rr_ids; do
      case "$rr_fence" in
        *" $rr_id "*) die "lane $rr_l has a LIVE session on this workstation (transcript $rr_id), so it is not a dormant row: clause (c) refuses a lane a live session holds, and retiring it would take the row out from under the conversation that IS the lane. End it the ordinary way when it is done — lane-end $rr_l. Nothing was written." 2 ;;

lanes-edit.sh:8404

  • archive_text prefers the remote archive whenever that path exists, and only falls back to the working tree when the remote has no archive file. Thus, after a clean local archive commit that is ahead of origin (with older rows already present remotely), ar_arch omits the newly archived lane and add-row can reuse its name. The duplicate check must examine both the published and local archive contents.
      ar_arch="$(archive_text 2>/dev/null | awk -v want="$lane_new" '
        substr($0,1,1) == "|" {
          p1 = index($0, "`"); if (p1 == 0) next
          r = substr($0, p1 + 1); p2 = index(r, "`"); if (p2 == 0) next
          t = substr(r, 1, p2 - 1)
          if (tolower(t) == tolower(want)) print t
        }' || :)"
      if [ -n "$ar_arch" ]; then
        die "lane '$lane_new' is RETIRED: its row is in $LANES_ARCH_PATH, spelled $(printf '%s\n' "$ar_arch" | tr '\n' ' ')— and a retired position is NEVER REISSUED (Amendment 19(b)). That lane's object log is $(log_path_for "$lane_new") and it is append-only, so a second lane under this name would write its life into the first one's file and every read of that log would answer for two lanes at once. Take a free position instead — \`lanes --prefix <repo>\` prints the next one and the line that takes it. Nothing was written." 2

lanes-edit.sh:8465

  • These new subcommands are not included in the unknown subcommand usage list at the dispatcher's fallback (line 9663). A typo or unsupported invocation therefore prints help that omits both retire-rows and archive-rows, making the newly added interface undiscoverable through the command's own error message. Add both names to that list.
  # AMENDMENT 19(c) — THE SWEEP'S WRITE. `lane-end --retire-dormant <repo>` is
  # the word that finds the dormant rows, shows the dry run and takes the
  # person's `--yes`; this is the one commit under it, and it re-proves every
  # refusal for itself rather than trusting the caller's list.
  retire-rows)
    retire_rows ${1+"$@"}
    ;;

  # AMENDMENT 19(d) — THE ARCHIVE. A DRY RUN unless `--yes` is passed, like the
  # migration beside it, and one commit naming each lane moved when it is.
  archive-rows)

lanes-edit.sh:5477

  • lanes feeds next-free from the published register, but this helper only cats $LANES_FILE and the local archive. When origin/<branch> contains a hidden or archived row that this checkout has not pulled into its worktree, that row is absent from the default-listing stdin and from this union, so the footer can offer its position again. Union the published register/archive with the local unpushed files using the same source rule as the listing.
lane_position_rows() {
  [ -n "${LANES_FILE:-}" ] || return 0
  { [ -f "$LANES_FILE" ] && { cat -- "$LANES_FILE" 2>/dev/null || :; }
    [ -f "${LANES_ARCH_FILE:-}" ] && { cat -- "$LANES_ARCH_FILE" 2>/dev/null || :; }
  } | awk '
  • Files reviewed: 6/6 changed files
  • Comments generated: 5
  • 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
… re-proves the listing's dormancy, the archive is read where it actually is, and a flag is never a value

Six takes, each with its own reason.

**A flag is not a value.** `lane-end --retire-dormant repo --reason --yes` took
`--yes` as the reason, fell back to the dry run and exited 0 — a malformed line
that RAN and did not do what it said. Refused now, in `lane-end`'s `--reason`
and in `retire-rows`'s `--reason` and `--writer`, with the `=` spelling named
for a reason that really begins with a dash.

**The LIVE test reads BOTH rows' session ids**, in the listing and in the
writer. The published cell is R19's source for everything else, but a lane whose
`append-session-id` has landed in this checkout and not yet been pushed carries
its current transcript in the local row alone — and `live_session_ids` can see
that very session running. Read from the published cell only, such a lane is not
LIVE, which under 19(a) makes it DORMANT: hidden, and offered to the sweep,
while somebody is working in it.

**The writer re-proves the row's own claim.** Amendment 13(a) makes the state
cell the lane's current state, and the listing does not hide a no-log row whose
cell is the phrase naming anything but `ENDED`/`RETIRED`/`MIGRATED`. The sweep
trusted `lane-end`'s filtered list for that half, so `retire-rows <lane>` by
hand could retire a row the listing calls parked — two surfaces disagreeing
about one answer, which is the defect clause (h) exists to prevent.

**`next-free` reads the PUBLISHED register and archive**, with this checkout's
as the fallback: reading only the local files missed a row that is on
`origin/<branch>` and not pulled here — hidden from the stdin rows by clause (b)
and absent from the union, so its position came back on offer. And a source that
EXISTS and cannot be read is now a refusal rather than an empty set, because a
position is handed out once and a read that failed is never an answer (7(d)).

**`add-row` asks both copies of the archive**: `archive_text` answers with the
published file wherever there is one, so a move committed here and not yet
pushed was invisible and its name came back on offer.

**`archive-rows` refuses a row of its repository that it cannot take apart**,
where it used to skip it silently: the act says it moves EVERY `RETIRED` row,
and a row whose separators hide the state cell may be one — moving the others
and saying nothing about that one reports a partial act as a whole one.

Declined, with the amendment's own words: making DORMANT depend on a log FILE
existing rather than on the log carrying a lane-kind line. The sweep's own
refusal is "a log that already carries a lane-kind line other than
ENDED/RETIRED", so the two must be the same test or they disagree; and
`migrate-state-cells` creates logs of `NOTED` lines, which under the file test
would take exactly the fourteen rows this amendment was written for out of the
sweep's reach, silently. The one already fixed in this branch is the
unknown-subcommand list, which now names both new verbs.

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:23
@brettheap

Copy link
Copy Markdown
Contributor Author

Copilot round 1 — taken in 5c49740. Five inline threads answered and resolved; the five suppressed comments have no threads, so they are answered here.

finding where what happened
liveness read from the published cell only lanes-edit.sh:5188 (inline) + :7906 (suppressed) taken — the listing and the writer both union session_ids_of_lane with session_ids_local_of_lane. An append-session-id committed here and not yet pushed left a running lane reading as DORMANT: hidden, and offered to the sweep.
the archive read was fail-open :5477 (inline) + :8396 taken — a file that is THERE and will not open is a refusal now, propagated through lane_position_rows into lane_next_free, which offers no position rather than one out of a partial read (7(d)).
retire-rows never proved dormancy :7917 (inline) half taken — it now makes the listing's own 13(a)-cell test itself, so retire-rows <lane> by hand cannot retire a row lanes calls PAUSED. Declined: refusing a log that already ENDS — 19(c) refuses "a lane-kind line other than ENDED/RETIRED", and appending a RETIRED to a finished lane is 6(d)'s own act.
archive-rows skipped an unreadable row :8044 (inline) taken — it refuses the whole move, naming the lane, the line, the separator count and the hand edit. The act says it moves EVERY retired row.
lifecycle facts used as log existence :5303 (inline) declined, with the amendment's words and a measured consequence — the sweep's own refusal is written in terms of a lane-kind line, so the read must ask the same question or the two disagree; and migrate-state-cells writes NOTED-only logs, which under a file test would take openxFactory's fourteen rows out of the sweep's reach the moment anyone migrated that register.
spaced --reason ate the next flag lane-end:527 (suppressed) taken — in lane-end's --reason and in retire-rows's --reason and --writer. --reason --yes used to swallow the word that makes it the act, fall back to the dry run and exit 0.
add-row read only the published archive :8404 (suppressed) taken — both copies are asked, as the row scan beside it already asks both.
the new verbs missing from the unknown-subcommand list :8465 (suppressed) already fixed in e21c349, caught by tests/test_repo_hygiene.py on the Windows job before this review landed.
next-free read only the local files :5477 (suppressed) taken — the published register and archive are read, with this checkout's as the fallback, so a hidden row that is on origin and not pulled here still holds its position.

Three cases were added for the takes (the 13(a)-cell refusal, the --reason that is a flag, and the unreadable row in archive-rows), plus one for the untracked-log guard that came out of #82's round 2.

🤖 Generated with Claude Code

https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m

… text

Measured on the live register, where the fourteen dormant rows of openxFactory
carry `started` cells like `2026-09-02 ~22:30Z; RESUMED 09-03 12:55Z and 19:27Z`
and workstation cells reading `<workstation? — owner fills>`: either pushes
every column after it out of line, in the one report a person reads to decide
whether to say the word. Both are cut to their width; the LANE is widened
instead of cut, because it is the name they act on. The cut is a bash expansion
and not printf's `%.Ns`, which counts BYTES and would tear the `≤` and `—` those
same cells carry.

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

Copy link
Copy Markdown
Contributor Author

The first sweep's DRY RUN, on the live register — act 6 of #42, for Brett Heap's word. It is a READ: it writes nothing, takes no lock and makes no commit (the only thing it touches is the fetch of origin/main every read here makes). Run from this branch, since the installed lane-end predates it:

$ lane-end --retire-dormant openxFactory
lane-end --retire-dormant openxFactory — DRY RUN, nothing is written (lane-collision-protocol Amendment 19(c))
  register : /workspace/projects/brett-wip/lanes/LANES.md
  dormant  : 14 row(s), 7 of them FLAGGED

       lane                         started              where      flags
       openxfactory-13              2026-09-01           <workstat… 
       was: ended (last activity 2026-09-02 morning)
  FLAG openxfactory-1d              2026-09-02 (cont.)   Eagle      LIVE
       was: **LIVE**
       openxfactory-1d-b            2026-09-02 ~15:xx    <workstat… 
       was: ENDED
       openxfactory-4f              unknown              unknown    
       was: unknown
       openxfactory-7c              2026-09-01           <workstat… 
       was: **ENDED** (stated verbatim in #566's body)
       openxfactory-chain-anchoring 2026-09-01 05:53     <workstat… 
       was: **ENDED WITHOUT A PR — the estate's largest orphan**
  FLAG openxfactory-f2-b            2026-09-02 14:01     <workstat… LIVE
       was: **LIVE**
  FLAG openxfactory-f5              2026-08-31           <workstat… owes
       was: ended — **owes** "extension PR #2" and the #542/#553 realization slice
       openxfactory-governance      2026-08-27           <workstat… 
       was: ended
  FLAG openxfactory-nightly         ≤ 2026-08-31       <workstat… unpushed
       was: **UNKNOWN — work unpushed** (last file touch 2026-09-02 09:41)
       openxfactory-pins            2026-09-02           <workstat… 
       was: dormant
  FLAG openxfactory-smalls          2026-09-02 ~22:30Z;… Eagle      owes
       was: **CLOSED 2026-09-04 14:1xZ** — everything landed: nine PRs (#603 #599 #601 #614 #602 #604 #617 #622 #619), #636 v3.3 amendment, contract-v3.3 TAGGED 16b85614, archives #644 342bee51 + #643 6ced5d1d; filed #634 #635; #507/#537 open by design; owed elsewhere: #634/#635 fixes ...
  FLAG openxfactory-standards-body  2026-09-01 08:23     <workstat… loss
       was: **ENDED WITHOUT PUSHING — loss risk**
  FLAG openxfactory-worker-fleet    2026-09-01 21:06     <workstat… loss
       was: **ENDED WITHOUT PUSHING — loss risk**

  A FLAG is this row saying the work was unpushed, lost, a loss or owed, or
  still saying LIVE. Retiring the row does not lose that text: it is carried
  into the RETIRED line of the log this sweep creates, and into the cell.
  Nothing outside the register and the logs is touched — worktrees, branches
  and handoffs stay exactly where they are (Amendment 19(c)).
  reason   : none given — the writer names the amendment (--reason "<why>" says it better)

  DRY RUN — nothing was written. Make it the one act with:
    LANES_LANE=<your lane> lane-end --retire-dormant openxFactory --reason "<why>" --yes

Fourteen dormant rows, seven flagged — exactly the population the amendment names. The five lanes that are LIVE under team-01b are not in it and cannot be: a live session here is refused by name, in the read and again in the writer.

Nothing is retired until a person types --yes, and the act is then ONE commit: fourteen logs created, each with a single RETIRED line carrying that row's own last words, and fourteen state cells replaced. No worktree, branch or handoff is touched.

🤖 Generated with Claude Code

https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m

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 and critical findings affect lane grouping, retirement validation and concurrency, and archived position/name reuse.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (6)

lane:435

  • This new contract comment is not true for dormant rows: lanes_rows can return a dormant row when a name is explicitly requested, but its state is NO LOG, while the dormant classification is in field 13. lane-groups only filters field 2, so the named/picker path can still make that row available. Pass the class field through the grouping filter (or otherwise exclude dormant) rather than relying on state alone.
# cell. A closed or dormant row never reaches this word — `lanes_rows` leaves
# them out of the listing and `lane_groups` drops them by state as well — but

lane-end:660

  • When the caller uses the documented --reason=--why spelling, this wrapper accepts the value, but forwards it as two arguments (--reason, --why). retire_rows deliberately rejects a dash-led value in that form, so the confirmed sweep always refuses even though the outer parser says this spelling is valid. Forward the reason as a single --reason=$sweep_reason argument (or otherwise preserve the = form).
  if [ -n "$sweep_reason" ]; then rd_argv+=(--reason "$sweep_reason"); fi

lanes-edit.sh:8500

  • The archive check intentionally relies on archive_text to report an unreadable archive, but this pipeline turns that failure into an empty result with || :. If LANES_ARCH_FILE exists but cannot be read, add-row can therefore miss a retired name and append a second row whose log is append-only, reissuing the identity this amendment is meant to reserve. Propagate the archive read failure and refuse instead of treating it as an empty archive.
      ar_arch="$( { archive_text 2>/dev/null || :
                    [ -f "$LANES_ARCH_FILE" ] && { cat -- "$LANES_ARCH_FILE" 2>/dev/null || :; }
                  } | awk -v want="$lane_new" '

lanes-edit.sh:7963

  • lane_log_events can select a tracked log that exists only in this checkout, but its remote-backed path resolution uses git show origin/... whenever the remote ref exists. In a clean local-ahead checkout this returns an empty event stream for a dormant row whose local log contains STARTED, PAUSED, or RESUMED, so the sweep can retire a parked lane instead of refusing it. Read the selected local log or fall back to the local tree when the remote path is absent before classifying the row.
    rr_ev="$(lane_log_events "$rr_l" 2>/dev/null)" || rr_erc=$?

lanes-edit.sh:4914

  • archive_text deliberately returns nonzero when the local archive exists but cannot be read, but this pipeline's final awk succeeds and masks that status. Consequently an archive-only retired row silently disappears from register_lanes/lanes --closed instead of producing the documented fail-closed refusal. Preserve and propagate the archive read status rather than treating an unreadable archive as an empty input.
  { register_text; archive_text; } | awk '

lanes-edit.sh:5507

  • The register is also a required source for position allocation, but this call converts a failed register_text read into an empty string. If the published register object exists but cannot be rendered, lane_position_rows can proceed with only the archive and next-free may offer an occupied position; a read failure must not be indistinguishable from an empty register. Propagate the register reader's failure through this union.
    lpr_reg="$(register_text 2>/dev/null || :)"
  • Files reviewed: 6/6 changed files
  • Comments generated: 5
  • Review effort level: Lite

Comment thread lanes Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lane-end Resolved
…n previews the act it will run, and no read of the archive answers "empty" for "unreadable"

Nine takes.

**The pick was still reachable by a dormant row.** `lane_groups` filtered on the
STATE word, and a dormant row's state is `NO LOG`, which is in none of its
lists — so a row arriving from a read that does not hide it (`--closed`, or
`lane <name>`'s own `--lane` read, which is never filtered because its caller
named the lane) was grouped as available, and the word would have offered to
bind a lane whose last act was its last. It drops on column 13 now, which is the
read's own answer to exactly that question.

**The dry run must be a preview of the act it prints.** `--reason` was checked
only inside `retire_rows`, which `--yes` reaches and the dry run does not, so a
reason carrying a `|` printed a clean preview of a run that could not happen.
Checked in `lane-end` too, by the writer's own rules, before anything prints.
And the reason is forwarded as ONE argument — `--reason=<why>` — because split
in two, the documented spelling for a reason that BEGINS with a dash arrived at
the writer as a flag and was refused there by design.

**The liveness snapshot is taken inside the lock.** Read before `acquire_lock`,
a lane could go live behind it: `lane-start` appends its id to the row under
that same mutex, so the scan would read the new id and compare it against a
fence that predates it. And the lane-kind check reads THIS CHECKOUT's copy of
the log beside the published one, for the reason the session ids are read from
both rows: the `behind` guard refuses a checkout that is behind, one that is
AHEAD is legitimate, and there a `STARTED` that exists only here was invisible.

**No read of the archive answers "empty" for "unreadable."** `archive_text`
returns non-zero where the published file exists, will not render, and there is
no local copy to fall back to; `lane_position_rows` treats an empty answer from
a non-empty register as a failure; `add-row` refuses rather than missing a
retired name; and the listing — which may not refuse, because it sits in front
of a launch — SAYS that the archive could not be read and that the position will
be refused rather than guessed.

**`add-row` compares the POSITION and not only the name.** `lane_next_free`
reserves `repo-4` and `repo-4a` as one position — "a re-cut position is not
free" — so a name test alone let `repo-4a` through against a retired `repo-4`.

**An empty listing is not an empty register.** Since 19(b) a repository whose
every row is CLOSED or DORMANT lists nothing, and `lanes`'s empty branch offered
"next free position: 1" — a number a dormant row holds. The position is asked
for now (`next-free` reads the register and the archive itself, so it answers
over an empty listing), and the line says which of the two emptinesses it is.

Six cases added: the pick dropping on the class, the dormant-only repository's
footer, the reason refused before the preview, the `=` spelling surviving, and
the two from round 1's archive work.

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:45
@brettheap

Copy link
Copy Markdown
Contributor Author

Copilot round 2 — taken in 47639cc. Five inline threads answered and resolved; the six suppressed comments are answered here. Nine findings, all taken.

finding where what happened
a dormant row could still reach the PICK lane:435 (suppressed) + lane-groups taken — lane_groups drops on column 13 (the class), not on the state word. A dormant row's state is NO LOG, which is in none of its lists, so a row from a read that does not hide it — --closed, or lane <name>'s own unfiltered --lane read — was grouped as available. Proven: lane repo19d-1 now refuses.
the dry run previewed an act that could not run lane-end:534 taken — --reason is validated in lane-end, before anything prints, by the writer's rules.
--reason=--why was forwarded as two arguments lane-end:660 (suppressed) taken — forwarded as --reason=<why>, one argument. The documented spelling for a dash-led reason was accepted by the outer parser and refused by the inner one.
the liveness snapshot predated the lock lanes-edit.sh:7903 taken — the read moved below acquire_lock: lane-start appends a session id under that same mutex, so a fence taken before it is one a lane can go live behind.
the lane-kind check read only origin :7963 (suppressed) taken — this checkout's copy of the log is read beside the published one. A STARTED committed here and not yet pushed was invisible, and the behind guard does not refuse a checkout that is AHEAD.
four reads answered "empty" for "unreadable" :2291, :4914, :5507, :8498/8500 taken — archive_text fails when the published file exists, will not render and there is no local copy; lane_position_rows treats an empty answer from a non-empty register as a failure; add-row refuses; and the listing, which may not refuse, SAYS it and tells the reader the position will be refused rather than guessed.
add-row compared the name, not the position :8506 taken — the position key is compared too, by lane_next_free's own rule (repo-4 and repo-4a are one position), so a retired number cannot come back under a letter.
an empty listing was read as an empty register lanes:244 taken — the empty branch asks next-free instead of assuming 1, and says which emptiness it is: a repository with no rows keeps the old sentence; one whose rows are all hidden is told so and pointed at --closed.

Six cases added, on their own seeded rows: the pick dropping on the class, the dormant-only repository's footer and position, the reason refused before the preview, the = spelling surviving to the writer, the archive's unreadable-row refusal and the untracked-log guard.

🤖 Generated with Claude Code

https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m

brettheap and others added 2 commits September 15, 2026 21:47
…ops a row on its class

Two sentences for two things a person meets: a repository whose every row is
closed or dormant lists NOTHING, and the footer there says which emptiness it is
and offers the position it read rather than assuming 1; and a closed or dormant
row never reaches the numbered pick even when it is asked for by name, because
`lane <name>`'s read is deliberately unfiltered and `lane-groups` drops it on the
class rather than on the state word.

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

The branch I added for a repository whose rows are all hidden fell back to 1 whenever `next-free` failed — including the case that read refuses ON PURPOSE since round 2, a source it must count that could not be read. Offering 1 there hands out a position a retired row may hold, which is the one thing the amendment is for. The un-upgraded workstation (exit 2, no `next-free` at all) keeps the old answer of 1, because that is what this branch printed before the read existed.

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

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 fail-closed position-allocation issues and retirement validation gaps remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (5)

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

lane-end:535

  • These sweep-only flags are parsed before the retire_dormant branch but are never rejected when that branch is not entered. Consequently, lane-end <lane> --yes performs the ordinary lane ending act, while lane-end <lane> --reason "..." silently ignores the reason. A command that looks like a confirmed sweep must not execute a different operation; reject --yes and --reason after parsing unless --retire-dormant was supplied.

lanes:373

  • This branch uses next-free != 1 as a proxy for “hidden rows exist.” If the only recorded row is hidden at position 2 (or any later non-contiguous position), next-free legitimately returns 1, so the command falsely says no lane is recorded and omits the --closed hint. Determine whether rows exist independently of the numeric next position before choosing this message.
		if [ -n "$e_next" ] && [ "$e_next" != 1 ]; then
			say "no lane of $here_repo is LISTED — and that is not the same as none being recorded: closed and dormant lanes are left out (Amendment 19(b))."
			say ""
			say "  see them:            $prog --closed --prefix $here_repo"
		else
			say "no lane of $here_repo is recorded."

lanes-edit.sh:8007

  • The local log read is explicitly converted to an empty stream on error, so an unreadable tracked log that exists only in this checkout is treated as if it had no events. Because the later untracked-file check does not catch a tracked-but-unreadable file, the sweep can continue toward ensure_log/append instead of refusing under Amendment 7(d). Propagate this read failure before evaluating rr_open.
    rr_lev=""
    rr_lf="$(log_file_for "$rr_l")"
    [ -f "$rr_lf" ] && rr_lev="$(log_events "$rr_lf" 2>/dev/null || :)"

lanes-edit.sh:5336

  • lr_live_rc records whether the session tree was readable, but this branch ignores it when assigning dormant. With an unreadable session-record directory, a no-log row is classified as dormant and hidden even though the required “no live session here” fact was never established; leave the class unset unless the liveness read succeeded.
        if [ -n "$lr_row" ] && [ "$lr_lanekind" = 0 ]; then
          lr_class=dormant

lanes-edit.sh:8010

  • This only rejects STARTED/PAUSED/RESUMED events, so a named row with an existing log whose last lane-kind line is ENDED or RETIRED passes with an empty rr_open. The sweep then appends another RETIRED line and rewrites a closed row, even though DORMANT requires no object log; this is also reachable when a local log is ahead of origin. Check for any published or local object log (case-insensitively) and refuse it before writing, rather than only checking whether it is currently open.
    rr_open="$(printf '%s\n%s\n' "$rr_ev" "$rr_lev" | awk -F"$US" '$3 == "STARTED" || $3 == "PAUSED" || $3 == "RESUMED" { v = $3 } END { if (v != "") print v }')"
    [ -z "$rr_open" ] ||
      die "lane $rr_l's object log carries a $rr_open line, so it is not a dormant row — a parked lane is not dormant (Amendment 19(c)), and a lane whose log says it is running is a lane a person can still pick up. End it as itself: lane-end $rr_l. Nothing was written." 2
  • Files reviewed: 6/6 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread lanes Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes-edit.sh Resolved
Copilot AI lite review requested due to automatic review settings October 3, 2026 02:52

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.

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Review effort: Lite
Findings: 2 High severity

Open (2)
Resolved since last review (1)

Comment thread lane Resolved
Comment thread lane-end Resolved
…Amendment 18 hands over

At the #83 merge (7c1aef2) Linux `tests` went red on two of #83's own
Amendment 18 cases, both `lane-start` exiting 2:

  FAIL …which it now does, with nothing refused            expected [0], got [2]
  FAIL `lane-start --dry-run --request-handoff` prints a plan instead of
       refusing on a release it did not make                expected [0], got [2]

Both lanes (repoBind-3 after a forced release, repoBind-12 bound in
another container) have their own window in the shared tmux server —
`cloudsess:4 @62 repoBind-3`, `cloudsess:6 @65 repoBind-12` — and the
server-wide window-name fence d0310f6 added to step 4 refused the second
place's bind because another window carried the name. Amendment 18 rules
that takeover in: a bench in another container keeps the lane's name
until that session hands off, and binding after a release or through
`--request-handoff` is the flow. main has no such fence and is green.

The fence keeps the case it was written for: a NEW lane (no row), whose
name on any other window is certainly foreign because nothing has bound
it. That is this branch's own assertion — `REPOA-8` on @99 still
refuses — and the manual's sentence now says which launches it asks.

Lane: openRepoTools-3
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 3, 2026 03:25
…e-listing

#139 (wip init refuses an adopted checkout ahead of origin's main) landed
after #83. It touches `openRepoTools`, its own tests, README.md and a
different docstring of tests/test_repo_hygiene.py than this branch does;
the merge is clean and nothing of it is resolved by hand.

Lane: openRepoTools-3
Co-Authored-By: Claude Fable 5.1 <[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.

Copilot review overview

🟡 Changes recommended

Unresolved critical retirement and lane-state handling issues remain, along with moderate listing and malformed-state issues.

Review effort: Lite
Findings: 2 High severity · 1 Medium severity

Open (3)
Resolved since last review (2)

Comment thread lane-start Resolved
Comment thread lanes-edit.sh Resolved
Comment thread lanes Resolved
… the listing says it may

The listing classes a row with no lane-kind log line DORMANT unless its
Amendment 13(a) cell names a state other than ENDED, RETIRED or MIGRATED,
so a no-log row whose phrase says RETIRED is dormant and the preview names
it. d0310f6 made `retire_rows` refuse that cell as "already retired", so
the act could not take a row its own preview offered, and because the
sweep is all-or-nothing that one row stopped every other retirement in the
repository. The row a migration leaves is that row: the phrase in the
cell, NOTED lines in the log.

A second retirement is a second RETIRED line in an append-only log, and
refusal 2 directly above already refuses that, reading the log. The cell
test goes back to accepting ENDED, RETIRED and MIGRATED, so the read and
the writer agree again, and a new case (`repo19ret-1`) pins it: dormant to
the listing, retired by the writer, one RETIRED line in its new log.
Taken from Copilot round 20 on #93 (lanes-edit.sh:10044).

Lane: openRepoTools-3
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 3, 2026 03:38
@sonarqubecloud

sonarqubecloud Bot commented Oct 3, 2026

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.

Comment thread lane-start Resolved
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 Oct 3, 2026
@brettheap
brettheap merged commit c1bac0d into main Oct 3, 2026
19 of 21 checks passed
@brettheap
brettheap deleted the feat/amendment-19-closed-lanes-leave-the-listing branch October 3, 2026 06:30
brettheap added a commit that referenced this pull request Oct 3, 2026
Bring in #119, #103, #83, #139 and #93 so #61 lands last in the queue
on the main it will actually land on. One textual conflict:

- lanes-edit.sh, the `*)` arm's unknown-subcommand list: main added
  `binding`, `request-handoff`, `register-row-local`, `retired-identity`
  (#83) and `retire-rows`, `archive-rows` (#93); this branch added
  `duplicate-holder`. Every name is kept, in main's order with
  `duplicate-holder` after `forks` as before, and the list still equals
  the dispatcher's arms exactly (test_repo_hygiene's derived check).

Checked against #61's code, nothing else needed a change: the suite's
fake-command block (tmux, claude, pgrep, ps, gh) is intact and no new
main code calls pgrep or ps; #93's columns 14-17 and #83's column 13
are in the `lanes` listing rows, which #61 never reads; LOG_AWK's
fields, live_holder's, transcript_holders' and lane_forks' output
formats are unchanged; #83's HANDOFF-REQUESTED is a lane-kind verb that
changes no state and holder_is_dead's five-verb whitelist skips it as
every last-line reader must; and lane-end's --retire-dormant sweep is
refused beside --retire and exits before the fork/duplicate retire path.

Lane: openRepoTools-3
Co-Authored-By: Claude Opus 5.5 <[email protected]>
brettheap added a commit that referenced this pull request Oct 4, 2026
* claude-current and claude-restart-check: launch only the newest published Claude Code, and tell a running session when its binary moved

For opensoft/openBenches#119, on Brett Heap's rulings of 2026-09-29:
the home decision ("this work is really for openRepoTools repo") puts
the resolver here, installed by `openRepoTools --install`, and point 2
("for 2, we can run update on every start, this ensures we have the
latest models") makes every launch run the check.

claude-current resolves the executable by ABSOLUTE PATH, never through
PATH: the newest native version, the user npm prefix, ~/.local/bin/claude,
then the image's copies, each read with --version and read once per
physical file. It asks npm for the published version with a bound, updates
the user-writable install under a lock when every candidate is behind
(claude update for a native install, else npm install -g --prefix <user>
plus the package's install.cjs that npm 12 skips), and hands back the path
whose version equals npm. An equal candidate beats a newer one, and a newer
one launches as ahead. Offline, it launches unverified. Still behind after
the update, it refuses (exit 2) unless CLAUDE_ALLOW_STALE=1.
--porcelain gives path/version/published/status, and --offline reads no npm.

claude-restart-check prints one green RESTART NEEDED line when the claude
process above it (at most three processes up) runs a binary since
replaced on disk (exe ends " (deleted)") or older than the installed one,
read from the native versions directory or the package's package.json. It
reads /proc and two small files, runs no binary, reaches no network, and
always exits 0.

Tests: tests/test_claude_current.py and tests/test_claude_restart_check.py,
both hermetic, and both commands held to test_repo_hygiene.py's bash rules.
The macOS job parses both with /bin/bash -n.

Refs opensoft/openBenches#119

Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* claude-current: the watchdog ends the whole tree, and one launch reaps a dead owner's lock

Two Copilot findings on #134, both in the fallbacks a
stock macOS takes, and a third wording fault found beside them:

- With no `timeout` and no `gtimeout`, the watchdog killed only the command.
  A child the command had started (npm's lifecycle processes, a script's
  `sleep`) kept the caller's command substitution open, so a 1 s bound took
  as long as the child did. `kill_tree` now stops, walks (`pgrep -P`),
  signals and continues the whole tree, as GNU `timeout` ends its process
  group, and the watchdog's own `sleep` is ended the same way.
- With no `flock`, two launches that both read one dead owner each removed
  "the stale lock", and the second removal could take the lock the first had
  just made, so both updated at once. Only the launch holding the reaper
  directory (`<lock>.d.reap`) removes it now, and only while the lock still
  names the pid it saw dead. A reaper left by a launch killed in those lines
  blocks the takeover, and the refusal names it.
- A lock directory that could not be created was reported as a lock that
  "was not free within 330s". It is named as what it is.

tests/test_claude_current.py runs the two fallbacks on every host by hiding
`timeout`, `gtimeout` or `flock` from PATH. Against the previous head the
watchdog case takes the fake npm's full 30 s and the reaper case removes the
lock and updates; both pass here. 52 cases.

Refs opensoft/openBenches#119

Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* lane-start: an unset CLAUDE_BIN launches what claude-current names, and a stale one is refused before any write

opensoft/openBenches#119, Brett Heap 2026-09-29, verbatim "for 2, we can run
update on every start, this ensures we have the latest models". The hook is
minimal and touches three places only:

- Beside the CLAUDE_BIN default: CLAUDE_VERIFIED_VERSION is read once and
  removed, so no session inherits it. CLAUDE_BIN unset, or equal to
  CLAUDE_RESOLVED_BIN with no CLAUDE_VERIFIED_VERSION (an earlier launch's
  answer inherited through a session's environment), is resolved. Any other
  CLAUDE_BIN is a pin, launched as it is.
- At the foot of 5a, once the agent and the launch are known and before the
  row, the object log and the handoff stamp are written: `claude-current
  --porcelain`, found beside this command or in $OPENREPOTOOLS_BIN_DIR and
  never on PATH. Exit 0 replaces the command's first word with the absolute
  path and exports CLAUDE_BIN and CLAUDE_RESOLVED_BIN; exit 2 ends the run
  with 2 and anything else with 1, nothing written. `--dry-run` plans the
  call and `--no-launch` makes none. Only the `claude` agent asks. With no
  claude-current installed, one note, and CLAUDE_BIN as before.
- The lane's STARTED/RESUMED payload gains `; claude <version>` when a
  version is in hand, and only when it is x.y.z.

Step 4 is untouched. The bare path a `--confirm` answered No takes still
launches CLAUDE_BIN unresolved.

tests/test_lane_start_claude_current.py: 17 cases in a cut-down copy of the
lane suite's sandbox, with a stub resolver and a decoy one on PATH.

Refs opensoft/openBenches#119

Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* --install places claude-current and claude-restart-check, and their manual

`INSTALLABLES` gains the two commands at its END, so every index the suite
takes still names the file it did: FIFTEEN files and TWENTY-NINE artifacts,
with the usage text, the header and every in-body count moved with them
(`THIRTEEN SINCE AMENDMENT 16` and "the thirteen placements" stay: one is
history and the other a different count). The home ruling of 2026-09-29 is
why they are here: Brett Heap, verbatim "this work is really for
openRepoTools repo".

docs/README-claude-current.md is the manual: the candidates and their order,
the update and its lock, output, exit codes and variables, the hand-off
between launchers (CLAUDE_BIN, CLAUDE_RESOLVED_BIN, CLAUDE_VERIFIED_VERSION),
what `lane-start` does with it, and the restart check the status line calls.

README.md stays at 472 lines, the cap tests/test_repo_hygiene.py holds it
to: the counts are rewritten in place, and "THIRTEEN files" and
`13 of 13 placed`, which that test also asserts, survive as the history
sentence that says when they stopped being true. The doc is linked from the
existing line that names docs/README-lanes.md.

Refs opensoft/openBenches#119

Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* claude-current: a malformed bound exits 64, the usage status, and not 1

The workBenches side (opensoft/openBenches#121, 016-launch-current-claude)
reports claude-current's exit 1 as "Claude CLI not found.", which is what 1
means for every other cause. A CLAUDE_CURRENT_* bound that is not a whole
number of seconds is a typo in a setting, not a missing Claude Code, so it
exits 64 now, as an argument it does not know already did. The launcher there
already refuses on 64 and names the status.

`lane-start` ends with 1 for any failure but 2, as before, and its message
says "named no Claude Code to launch" so it reads true for 64 as well as 1.
The header, the usage text, the manual and both suites say the same.

Refs opensoft/openBenches#119

Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Copilot's second round on #134: SemVer pre-release order, the installed version across both families, and the bare --confirm launch resolves

Three findings, all real:

- Pre-release tags were compared as one string, so `2.1.284-beta.9` sorted
  after `2.1.284-beta.10` and a launch could take an older pre-release as
  ahead of npm. `precmp` compares the dot-separated identifiers by SemVer
  2.0.0 rule 11: numbers as numbers and before words, words in byte order
  (LC_ALL=C), fewer identifiers lower. It is in both commands byte for byte,
  like `numcmp` and `vercmp`; the suite checks the identity and runs rule
  11's own example chain.
- claude-restart-check read the installed version only from the running
  binary's family, so an npm 2.1.283 session beside a native 2.1.284 said
  nothing, though the next launch starts the native one. It now takes the
  highest of the running install's own, the native versions directory
  ($CLAUDE_CURRENT_NATIVE_DIR) and the user npm prefix's package, which it
  finds with claude-current's `npm_user_prefix`, byte for byte. No `$HOME`
  reads only the running install. Its suite now runs with `$HOME` and the
  npm prefix inside the fixture.
- lane-start's bare launch, the one a `--confirm` answered No takes, came
  before the resolution and started `claude` from PATH. The resolution is
  one function now, `lane_claude_resolve_launch`, called from that launch
  and from the foot of 5a, and it refuses a stale copy in both. The bare
  path gains one line; step 4 is untouched.

Also: the lane-start suite asks for the `claude <version>` sub-field by name
rather than at the end of the payload, because Amendment 18 (#83) appends
`host`, `os` and `container` after it (measured on a test-merge of #83).

Counts: tests/test_claude_current.py 70, tests/test_claude_restart_check.py
19, tests/test_lane_start_claude_current.py 20.

Refs opensoft/openBenches#119

Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Copilot's third round on #134: the lock without flock names its owner as it is taken, and the two commands borrow every per-file hygiene rule

- Without `flock`, the lock was a directory made first and given its
  owner's pid a line later. A launch killed between the two left a lock with
  no owner, which the takeover never removes (it reaps only a named dead
  owner), so every later launch waited it out and refused. The lock is now a
  symlink whose text is `pid=<pid>`: one `ln -s` makes it and names the
  owner, so no ownerless lock can exist. The reaper is unchanged. A
  directory standing at the lock path (where `ln` would put the link inside
  it and succeed) is refused by name. The release removes the link only
  while it still names this launch.
- The two commands are still not in test_repo_hygiene.py's `ALL_BASH`,
  because that file is being changed by open PR #93 and this PR touches none
  of #93's files. tests/test_claude_current.py now also borrows the
  flag-spelling rule and runs the LF-index check for both. The follow-up
  after #93 lands is to put `claude-current` in `SHIPPED_BASH` and
  `claude-restart-check` in `HELPER_BASH`, then drop the borrowed list.

tests/test_claude_current.py, 72 cases:
- `test_the_link_lock_names_its_owner_while_it_is_held` reads the lock from
  inside the update. It fails on the directory lock.
- `test_a_directory_at_the_lock_path_is_refused_not_taken` is new.
- The takeover, reaper and live-lock cases now work on the link.

Refs opensoft/openBenches#119

Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* claude-current: a copy ahead of npm that appears during the lock wait is ahead, not stale

Copilot's overview at 9ba858d, a finding in code unchanged since its
earlier rounds: after the wait for another launch's update, only a copy
EQUAL to npm was accepted. A copy newer than the published version that the
other launch installed meanwhile (npm moved on while this launch waited)
therefore went to another update, or, when the wait ran out, to the stale
refusal, although the same copy is `ahead` before any wait. The re-read
after the lock now gives the same two answers as the first read, in the same
order.

test_a_copy_ahead_of_npm_that_appears_during_the_wait_is_ahead: the other
launch installs 2.1.285 against a published 2.1.284 while it holds the lock
past this launch's wait. At 9ba858d this is exit 2; here it is `ahead`, and
this launch installs nothing. 73 cases.

Refs opensoft/openBenches#119

Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* claude-current and claude-restart-check: a relative npm prefix is taken under $HOME

Copilot's overview at c7e3e3c, a finding in code unchanged since earlier
rounds: npm takes a relative `--prefix` and installs there, but the
candidate read back from it is not an absolute path and is refused, so an
update that worked ended in "no runnable Claude Code" (exit 1). A relative
prefix from any source ($CLAUDE_CURRENT_NPM_PREFIX, $NPM_CONFIG_PREFIX,
$npm_config_prefix, the `prefix=` line of ~/.npmrc) is now anchored at
$HOME, in `npm_user_prefix`, which both commands carry byte for byte. npm
installs into that path, the resolver reads it back, and the restart check
reads it from whatever directory the status line runs in.

Both suites now run their command from inside the sandbox rather than the
checkout, so a relative path can never land in the repository. On the
previous head the three new cases fail: the resolver exits 1 for a relative
prefix from the environment and from ~/.npmrc, and the restart check never
reads the copy. They pass here.

Suites: tests/test_claude_current.py 78, tests/test_claude_restart_check.py 20.

Refs opensoft/openBenches#119

Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Copilot's overview at da83af3: KILL after a grace on every bound, a minified package.json, and one count

Three findings the overview lists as missed in unchanged code, all real:

- A command that ignored TERM, with its children, held a launch past every
  bound, because TERM was the only signal. Every branch now sends KILL
  KILL_GRACE (5) seconds after TERM: `timeout -k` and `gtimeout -k`, and in
  the watchdog, the whole tree it signalled. The watchdog and run_bounded
  settle who acts with one `mkdir` of a flag, whoever makes it first, so a
  command that ends early is never signalled and a watchdog is never stopped
  half way. A zombie counts as ended, because in a container whose first
  process reaps nothing (py-bench's pid 1 is `sleep`) it is never reaped. A
  137 from the KILL reads as the timeout's 124.
- claude-restart-check read `"version"` only from a line of its own, so a
  minified package.json gave no installed version and no notice. The file is
  cut at each brace and comma before the first "version" is taken, and a
  missing or unreadable file is still silent.
- The comment above `place_skill_and_hook` said "thirteen placements" for
  fourteen artifacts. It now says fourteen artifacts in thirteen writes (the
  two hook entries go into settings.json in one write).

On da83af3 the three new cases fail (the TERM-ignoring npm on both
branches, and the minified package); they pass here. Suites:
tests/test_claude_current.py 80, tests/test_claude_restart_check.py 21.

Refs opensoft/openBenches#119

Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* claude-current: one symlink lock for every launch, whatever its PATH holds

Copilot's round three on #134 (claude-current:516): the lock was flock
where PATH had one and the symlink where it did not, so two launches
with different PATHs held two independent locks and both ran the same
npm update at once. Every launch now takes the one symlink lock at
claude-current.lock.l, and flock is never consulted.

The symlink names its owner as pid=<pid>@<place>, where <place> is the
host's name and, where /proc shows one, the pid namespace's inode.
Containers that share a home share this lock, and a pid read in another
namespace says nothing about its owner, which flock never needed to
know: a lock made at another place is waited on and never taken over,
and the refusal names its owner and place. A lock made here whose owner
has gone (a zombie included) is taken over under the reaper as before.
A cache directory the launch cannot write in, and a file that is not
this command's lock at the lock path, are named rather than waited out
in silence.

Tests: two real launches, one with a flock on PATH (a logging shim, on
every host) and one without, exclude each other in both orders, one
install, and flock is never called; red on b90f4dc in both orders.

Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* AGENTS.md: the installer places fifteen files

Copilot's round three on #134 (openRepoTools:286): INSTALLABLES now
holds fifteen names with claude-current and claude-restart-check, and
AGENTS.md still said thirteen. One word, line-neutral, so the file stays
at the 265-line cap; #93's AGENTS.md hunk is at line 254 and does not
touch this paragraph.

Lane: openxfactory-5 (openXfactory-5)
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(claude): share relative cache locks across checkouts

* fix(claude): preflight lane launches and qualify newer-copy notices

* fix(lanes): approve handoffs before resolver preflight

Read the authoritative agent after handoff while resolving a possible Claude replacement before release.

Fixes #150

* fix(lanes): reject directories in resolved Claude paths

Fixes #151

* fix(claude): recheck bindings and reject watchdog timeout output

Recheck the binding immediately before window rename after resolver waits. A watchdog timeout stays 124 even when the command traps TERM and exits successfully.

Fixes #152

* fix(claude): contain timed-out children and preflight local fences

Run the watchdog command in a dedicated process group so TERM-handler children remain covered by the final KILL. Refuse known retired lanes and new-window name collisions before resolver work or a handoff, and recheck those fences after resolution before rename.

Validation: 463 focused tests passed, 411 deselected in 195.30s through tests/run.sh in py-bench.

Fixes #153.

---------

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