Skip to content

Amendment 17 tooling: a handoff is the swap under one name — lane-handoff on PATH, /handoff with /swap, /lane-swap and /ctx, the record naming the agent and its transcript, and lane-start --agent resuming a lane from any agent the table carries - #47

Merged
brettheap merged 20 commits into
mainfrom
feat/amendment-17-handoff-ctx
Sep 15, 2026

Conversation

@brettheap

@brettheap brettheap commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Lane: openRepoTools-3

← brettheap/new-workstation#32 (Amendment 17, ratified 2026-09-14) and its Addendum 1, in force 2026-09-14T20:59:31Z (brettheap/new-workstation#40, merged as 26a0d5b; Brett Heap, verbatim: "ratify 40"), with Amendment 18(d) and Amendment 18 Addendum 2 (i-8), both in force 2026-09-14.

A handoff is the swap, under one name; a lane resumes from any agent that can read it; and /ctx is the whole act in one word. /lane-swap already fixed the identity triple, refreshed the handoff, polled the writers, wrote the lane's PAUSED record and printed the restart line — every one of those is what a person means by hand the lane off. What differed between a context clear, a usage reset, a profile switch and handing the lane to someone else was only WHY, and the record's free text has always carried that. The word has been wrong, not the act. The other half was missing: lane-start launched claude and nothing else, while a lane's state — the row, the object log, the handoff with its Rule 3 resume prompt, the worktrees — is model-neutral.

The acts, and what holds each

1. lane-handoff [why] on PATH — the act from a shell (lane-handoff, 870 lines; clause (a)). The handoff skill's steps as a command: the identity triple fixed, the handoff refreshed with a fresh Rule 3 top block, the writers polled, PAUSED written, the restart line printed. skills/handoff/SKILL.md is the act (the file moved there with its history); skills/lane-swap/SKILL.md, commands/swap.md and commands/handoff.md name it and restate nothing — "two copies of one procedure that must stay byte-equal" is the alternative the clause rejects. --install places the command (the twelfth file) and the three command files.
Tests: tests/test_lane_helpers.sh § "Amendment 17" — the record and its free text, the refreshed top block, the writers polled off disk, the handoff's own commit and trailer, the row flipped; tests/test_install_skill_and_hook.py holds alias restates no step per command file and for the alias skill.

2. The record names the agent (lanes-edit.sh; clause (b)). The PAUSED payload gains agent <name> and transcript <id|none> beside Amendment 11(c)'s three. The writer validates both (pause_subfields_check, called from write_event) because this log is append-only and lane-start --agent launches on what it reads back. swapped prints them as its sixth and seventh fields; three reads answer for them — lane-agent, lane-transcript, lane-last — and a record written before this amendment carries both EMPTY and answers 8, never a guess (Amendment 7(i)'s cutover rule). Nothing is backfilled; each lane cuts over at its own next handoff.
Tests: the two sub-fields written and read back, the writer's refusal of a value that is not a manifest key, swapped's seventh field, and repoSW-1 — a pre-amendment record — answering 8.

3. lane-start … --agent <name> — the launcher table (lane-start; clause (c)). With no --agent the default is the agent of the last PAUSED, else claude. claude with its transcript here resumes by id exactly as Amendment 6 has always done; every other case launches the named agent with the handoff's top block as its first prompt, after the Rule 3 stamp is written, and appends the row's session cell in that agent's own spelling (Codex <id>). An agent the table does not carry is a refusal naming the two it knows — never a guessed argv.
Tests: a fake codex logging its argv; the top block delivered and only the top block; stamps-at-launch=1, which is how the stamp was written FIRST is proved rather than assumed; the cell appended; the unknown agent refused; the no---agent default read from the record.

4. /ctx — one word, and everything after it is automatic (clause (f)). /ctx is /handoff --restart: the record first — with a top block whose WRITERS section lists every worktree the lane had running, its branch, its last commit and its brief — and then tmux respawn-pane -k on the lane's own pane, so the act survives the death of the session that started it. A /ctx whose record could not be written refuses before it kills anything. The respawn line is lane <lane> where that word is on PATH and the launcher where it is not (Addendum 2 (i-8), whose adoption line names this issue), and never restart <lane>; a lane on PATH that is not this estate's word is passed over for the launcher with a line saying so, because a respawn is the one act no later refusal can undo. LANE_START_FRESH=1 is the one seam — a new session primed by the top block — and it rides in the environment, so it survives lane handing the launch on to lane-start.
Tests: the fake tmux records, at the instant it is called, how many PAUSED lines the lane's log carries — paused-lines=1 is the ORDER, proved by what the second act could see of the first; the unwritable record refuses and no pane is respawned; three PATH cases (the word, no word, somebody else's word), each on a PATH the suite builds so the question is the one being asked.

5. --exit, Amendment 18(d): after the record, /exit is typed into the lane's own pane, because a handoff to ANOTHER PLACE is a handoff and not a restart. --restart and --exit together are refused: they are two ends for one act.

6. The transcript follows the lane (adoption act 6, as corrected by measurement on 2026-09-14T12:35Z). On a launcher-configured workstation every profile's projects/ is ONE shared directory, so a transcript needs no move to be resumed under another profile: lane-start now SAYS where it found it and says when that directory is shared. Where two profiles' projects/ really are two directories the transcript is MOVED (with its sibling <uuid>/), a pointer <uuid>.jsonl.moved-to-<profile>-<UTC> is left, and a copy is never made — two live transcripts of one uuid diverge. A uuid whose holder is LIVE in the other profile is a refusal, never a move (Amendment 18(h)), naming the pid, where that process is, and the retire act.
Tests: the shared case (no move, said), the real move (file, sibling, pointer, no copy left behind), and the live holder refused with nothing moved.

7. lane-handoff --late --at <UTC> (adoption act 7) — the record a swap never left, written from a shell BEFORE the relaunch. A lane's state is its log's last lane-kind line IN FILE ORDER and the log is append-only, so a late PAUSED appended after the relaunch's RESUMED would make a lane that is RUNNING read as paused. It is therefore dated by its own --at field and written only where the lane's last line is a STARTED/RESUMED older than that instant; every other state refuses, writes nothing, and names the act to take instead. lanes-edit.sh log … --utc <UTC> is the one seam it needs and has no other caller.
Tests: no --at refused, a bad --at refused, the pair written, a second late record on an already-paused lane refused, and the after-the-relaunch case refused with the log unchanged.

8. Docs: docs/README-lanes.md § "The handoff (Amendment 17)" — the act under its three names, the record's two sub-fields with a real line, the launcher table, /ctx, --late and the transcript act; README.md and the installer's prose carry the counts.

9. Amendment 17 Addendum 1 — the WRITERS section is a list to COUNT (in force 2026-09-14T20:59:31Z; this pull request is its named adoption). The lesson it was drafted on was measured in this lane: a harness /clear mints a new transcript id IN THE SAME PROCESS, so the five writers the handoff had just told the next session to relaunch were all still alive on their worktrees.

  • (h) the record names the KIND, and there are now THREE: --in-process writes in-process, --restart/--exit/--late write respawn, and a PLAIN handoff writes unknown — the act that follows it is not this command's to know. The word is in the payload (; kind <k>, for readers that parse) and in the line's FREE TEXT after the why (clear in-process, clear respawn, kind unknown — the addendum's own spelling, for the person who reads it).
  • (i) one first line for every kind, verbatim from the clause: FIRST count the live writers … A writer still live OWNS its worktree: do not relaunch it; one message telling it that its in-flight call died and who the coordinator now is, is enough. Relaunch only a writer that is NOT live … — and where the count and this list disagree, THE COUNT WINS.
  • (j) the kind says what to EXPECT and never what to do, so relaunch every writer below and relaunch NONE of them are both gone from the template; (k) one worktree, one writer is in the first acts, with the retire act for a second one found.
    Tests: the three kinds in the record and in the free text, (i)'s first line under every kind, "expect every writer below live" under in-process, and the negatives for both removed instructions.

10. tests/run.sh, and the guard that never waited (#51, measured 2026-09-14T20:4xZ on Eagle). Four python3 -m pytest tests -q runs were live at once in four worktrees, every one past a guard copied into four briefs: while pgrep -af 'python3 -m pytest' | grep -v pgrep >/dev/null; do sleep 20; done. It never waits — under the harness grep is a shell FUNCTION whose status is 1 when its stdout is /dev/null, even where it matched — and its pattern is unanchored, so it also matches the guard's own command line. A poll ALONE is the second defect: every waiter starts the instant the run it watched ends. tests/run.sh is the guard written ONCE — wait, take ${TMPDIR:-/tmp}/openrepotools-pytest.lock (flock, or a mkdir lock on macOS, which has none), wait again INSIDE the lock, then python3 -m pytest tests -q "$@" — named in AGENTS.md and docs/README-lanes.md as the way to run the suite, parsed by the macOS job with every other bash file this repository ships, and held by a hygiene test that pins the lock path in both places.

11. The macOS defect three of this branch's own cases found (tests-macos red at db206db and ac0c697, Linux/Windows green). quoted() { printf '%q ' "$@" | sed 's/ $//'; } — one line, two defects. Bash 4.4+ gives a multi-line argument back as $'…\n…'; bash 3.2, which is what Apple ships and what that job runs, has no such form and escapes every space and every byte of every multi-byte character with a backslash of its own. And the pipe made that FATAL rather than ugly: under set -o pipefail the function's status is the pipeline's, and BSD sed in a UTF-8 locale refuses bytes that are not a valid sequence (RE error: illegal byte sequence) — which is what 3.2's %q makes of the em dash every document in this estate is written with. quoted is a BARE command in the --no-launch branch, so set -e ended the command there with exit 1 and an empty stdout. The one caller that passes a multi-line argument is this amendment's own: the --no-launch print of a launch carrying the handoff's top block as its first prompt. It is now POSIX quoting of this file's own, in lane-start and lane-handoff: safe words bare, anything else in single quotes with '\'' for its own — readable AND runnable on either bash. (restart carries the same line and is untouched: #43 deletes that file in flight.)

What is NOT in this pull request, and why

restart does not learn --agent. Amendment 18 Addendum 2 (i-6) takes that word off the person's PATH and #43 deletes the file in flight beside this branch; adding a flag to a file whose deletion is already written would conflict in that PR and ship a word the amendment removes. The DEFAULT is inherited by every door already, because it is read from the record (lane-agent) inside lane-start, which is what restart and the launcher both call; the explicit flag belongs to lane <name>, #43's word.

Counts

  • --install places 12 files (lane-handoff is the twelfth), 3 skills at two paths each (handoff, lane-swap, restart), 3 command files at two paths each (handoff, ctx, swap) and 2 merged hook entries (SessionStart, and Amendment 12's UserPromptSubmit name guard, which arrived with main): 26 artifacts, derived in tests/test_openrepotools_command.py from the three lists plus HOOK_ENTRIES and stated in README.md, docs/README-lanes.md and the installer's own prose. Neither side's number survived the merge — main had 19 and this branch 25 — and the derivation is what settles it.
  • bash tests/test_lane_helpers.sh: 1500 passed on main at the branch point (92eab6c), 2102 passed, 0 failed, 0 skipped here on the merged tree — Amendment 17's own section is 142 cases plus this round's, and Amendment 15's, merged in from 8345d2f, is 178.
  • tests/run.sh (the whole suite under pytest, serialized on the estate's lock — act 10 above) wraps the shell suite counted above through tests/test_lane_helpers_suite.py; this pull request's own CI run is the authority for both, and all four jobs are green on the head this says so at.

Merged, never rebased: main at b5244e2 (#44's installer mode stamping and unwritable-target refusal, #53's skills/restart/SKILL.md), at a954435 (#50's commit_push conflict die), and at 2faa883 (#52, Amendment 12's name guard — which is where the artifact count met this branch's).

Amendment 15 (canon_lane, #41) landed on main mid-branch and is MERGED in, never rebased: swapped's row now carries the register row's spelling in its first field and in its pickaxe key, and lane-agent, lane-transcript and lane-last canonicalise their <lane> as lane-dir does.

The review rounds

Copilot round 1 (6 inline threads on db206db) — 4 taken: the /ctx respawn gate (it tested only the object-log write, so a pane could be respawned over an unflipped row or a stale top block — it now gates on all three, and each refusal names the act that clears it); readlink -f in real_of, which is not stock macOS userland and silently defeated the shared-projects/ comparison the whole act was shrunk to (now cd -P + pwd -P); and the transcript move's sibling and pointer, which are now ONE TRANSACTION with a rollback — a step that cannot complete puts back what the steps before it moved and refuses, naming anything it could not put back. 2 declined, both the same claim about lane-handoff's file mode: it is 100755 in the index and was at the commit that review read (git ls-tree db206db lane-handoff → 100755). What the finding read is a hygiene-test docstring describing the FIRST commit; that sentence now names the commit that fixed it and points at git ls-files -s.

From round 1's suppressed list, also taken: --dry-run moved a transcript before reaching the exit that says it moved nothing; handoff_written=1 was set whether or not the write succeeded; a failed mktemp gave a WRITERS section with a count and no entries; the record's transcript was derived from $sess_uuid rather than the resolved $uuid; $CLAUDE_PROFILES_HOME was ignored by both profile walks; a failed lane-agent read launched the default agent, which is the one thing that read's own refusal forbids; and a lane with no row wrote RESUMED as its object log's first line.

Copilot round 2 (ac0c697) — taken: lanes-edit.sh's sread fence treated exit 2 as "no answer", but canon_lane spends 2 on a register holding two rows that differ only by case, so lane-handoff fell through to the next rung and would have renamed a window and written a record for whichever lane it answered with; it now asks for the refusal by its own words and relays it, and the lane is canonicalised BEFORE the window rename. Also taken: the PAUSED sub-fields are written together or not at all and an empty one is not an absent one; --utc is the late PAUSED's seam and is refused for every other verb; lane-transcript's id is carried into the row's cell only where the record's agent IS the agent being launched; and the launched agent's name is exported, so a codex session's own handoff does not record agent claude.

Copilot round 3 (d8267a5, which went green on all four CI jobs, macOS included) — taken: the mkdir lock this pull request ships as the way to run the suite got three things wrong and now gets them right (a lock with no pid in it is STALE not eternal; a takeover is an atomic CLAIM re-read after the rename, not a rm -rf two waiters can both do; and the INT/TERM handlers EXIT rather than releasing the lock and carrying on); a transcript never moves onto an occupied name, because mv <dir> <existing dir> does not fail but NESTS; readlink -f in the two acts that reach a handoff through the estate's handoffs symlink, which is the same macOS rule as real_of and cost an uncommitted handoff there; head -c 8192 … | grep -q taking SIGPIPE under pipefail, which classified the estate's OWN lane as somebody else's; a launcher this workstation does not have, refused before the row, the log and the stamp are written rather than after exec exits 127; and the window sub-field's fence gaining the two separators its own comment already claimed.

Copilot rounds 4 to 10 (e8d67a2 … 2bb5d4e) raised twenty-two more, all of them on a pull request that was already green on all four jobs. Eight were taken — the --in-process help that still carried the instruction Addendum 1 (j) removed; --late --in-process, refused now as the contradiction it is; a comment that claimed a refusal canon_lane does not make; the documented guard counting the way tests/run.sh counts (pgrep -fc is not portable, which is why the wrapper never used it) and pytest_live no longer reporting a failure in the same breath as a zero; and three gaps between the two halves of ONE act, where skills/handoff/SKILL.md lagged its command — the kind sub-field, the <session>:<@id> spelling window-session answers, and a row-state parser that knew | WORD · and not the | WORD | an ordinary fresh row carries. One was DECLINED with the amendment's own words (--agent claude with its transcript here resumes by id — Amendment 17(c)'s case (a), and LANE_START_FRESH=1 is the seam for the other). The rest are #72, filed with what each would cost: the test lock's ownership and its signal handlers, three status gates, a deferred command that drops --agent, and the handoff skill catching up with its command.

Filed rather than folded in: #65 (the /ctx respawn recognises this estate's lane by a string in its head, which is a heuristic and not provenance — the fix changes an adopted behaviour and three PATH fixtures with it), #55 (swapped's first field is the LOG's spelling, not the register row's — Amendment 15's claim, landed on main with #41, so it predates this diff) and #56 (the cross-profile transcript-holder scan tests only kill -0, where lanes-edit.sh's one liveness contract tests three things). Both are claimed by this lane.

Closes #36
Closes #51

Lane: openrepotools-3 (openRepoTools-3)

🤖 Generated with Claude Code

brettheap and others added 6 commits September 14, 2026 18:11
…under one name — `lane-handoff` on PATH, `/handoff` with `/swap` and `/lane-swap` as aliases, `/ctx` = `/handoff --restart`, the record naming the agent and its transcript, and `lane-start --agent` resuming the lane from any agent the launcher table carries

WIP, AND THE WORD IS IN THE SUBJECT BECAUSE THE PROOF IS NOT IN YET. Every file
parses (`bash -n` on the four commands and the suite, `py_compile` on the three
pytest files) and the bash suite was green through every pre-existing section on
the run before this one; the Amendment 17 section this commit adds had NOT yet
been reached when the swap was called, and `python3 -m pytest tests -q` has not
been run at all. Nothing here is merged on that basis: the next session re-runs
both suites and takes what they say.

lane-collision-protocol **Amendment 17** (ratified 2026-09-14T09:45:33Z,
revision 2 with clause (f)), **Amendment 18(d)** and **Addendum 2**;
#36, acts 1-8.

THE ACT HAS ONE NAME AND THREE DOORS. `lane-handoff` on PATH (new file,
`INSTALLABLES` 11 -> 12) is the `/lane-swap` skill's steps as one command: the
identity triple fixed through `lanes-edit.sh`, the handoff file refreshed with a
fresh Rule 3 top block, every running writer polled — `git status --short` and
`git log @{u}..` of every worktree under the lane's checkout `.claude/worktrees/`
and `<projects>/.lane-worktrees/<lane>/` — `PAUSED` written with Amendment
11(c)'s payload plus Amendment 17(b)'s `agent <name>; transcript <id|none>`, and
the one restart line printed. The top block's template gains a WRITERS section
(worktree, branch, brief, last commit, dirty and unpushed counts) and the first
line *"relaunch every writer below from where it stands"*; it is PREPENDED and
the file is never rewritten, so what was there stays below a `---` rule as
history. `skills/handoff/SKILL.md` carries the steps with their history (a
rename, so `git log --follow` reads straight through); `skills/lane-swap/SKILL.md`
and `commands/swap.md` name it and add nothing, and `commands/handoff.md` and
`commands/ctx.md` are new.

`--exit` (Amendment 18(d)) types `/exit` into the lane's own pane — the pane from
the LIVE record's own `tmux` field — because a handoff to another place is a
handoff and not a restart. `--restart` is `/ctx` (clause (f)):
`tmux respawn-pane -k` on that same pane through the launcher, with
`LANE_START_FRESH=1 pclaude --lane <lane> <profile>` — never `restart <lane>`,
which Addendum 2 takes off the person's PATH. BOTH REFUSE BEFORE THEY TOUCH THE
PANE where the record could not be written: *"a pane is never respawned over an
unrecorded lane"*.

`lanes-edit.sh`, ADDITIVELY, because #41 is landing in the same file:
`pause_subfields_check` validates the two sub-fields in the WRITER
(`write_event`, from any caller) and reads them with `all` so that
`agent not a key` is refused rather than read as `not`; `swapped` gains a sixth
and a seventh field, EMPTY for every record written before the amendment;
`window_lane`'s reader names that row's fields in full so a short list cannot
swallow them; four new reads (`lane-agent`, `lane-transcript`, `lane-last`,
`workspace-root`); and `log … --utc <UTC>` dates the late record by its own
field.

`lane-start --agent <name>` (clause (c)): the default is the agent of the last
`PAUSED`, else `claude`. `claude` with its transcript here resumes by id exactly
as Amendment 6 has always done; otherwise a launcher table — `claude` takes a
named new session with the handoff's TOP BLOCK as its first prompt, `codex` takes
the top block positionally, and a name the table does not carry is a refusal
naming the two it knows. The Rule 3 stamp and the row's session cell are written
BEFORE the launch, the stamp naming the agent (`RESUMED by codex <id>`) and the
cell in that agent's own spelling (`Codex <id>`).

ACT 6, the transcript follows the lane, shrunk to what the measurement of
2026-09-14T12:35Z left of it: `lane-start` SAYS which projects directory it found
the transcript in and whether that directory is SHARED (`readlink -f` equal
across profiles), and MOVES the `<uuid>.jsonl` and its sibling `<uuid>/` only
where another profile's `projects/` really is another directory, leaving the
pointer `<uuid>.jsonl.moved-to-<profile>-<UTC>` where they were. A uuid whose
holder is LIVE in another profile is a refusal naming the pid, its window or
`bg`, the profile and the retire act (Amendment 18(h)) — never a move, because a
copy leaves two live transcripts of one uuid to diverge.

ACT 7, `--late`, AND THE RULE IT IS BUILT ON. A lane's state is its log's last
lane-kind line IN FILE ORDER and the log is append-only, so a late `PAUSED`
appended after the relaunch's `RESUMED` would make a lane that is RUNNING read as
paused. The simplest rule that keeps every `binding` and state read correct is to
refuse to write a line that can no longer be last: `--late` REQUIRES `--at <UTC>`
— a late line is dated by its own field — and is written only where the lane's
last lane-kind line is a `STARTED` or `RESUMED` older than that instant. Every
other case is a refusal that writes nothing, made BEFORE the writers are polled
and before the handoff is refreshed, so a refused `--late` leaves the lane
exactly as it found it. Stated in the code, in the skill and in the manual.

Docs: `docs/README-lanes.md` gains "The handoff (Amendment 17)" — the act under
its three names, the two sub-fields and the reads that answer for them, the
launcher table, `/ctx`, `--late` with its rule, and the transcript rule;
`README.md`'s install section moves to twelve files, three skills, three command
files and twenty-five artifacts, with the cap raised in a dated entry.

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…` appends a non-Claude agent's id to is the PUBLISHED row's last id, and four Amendment 17 cases in the suite ask what they say they ask

WIP FOR THE SAME REASON THE FIRST ONE IS: this is the predecessor's working
tree at the moment the swap was called, committed so that nothing is lost and
so that the next run's diff is against a tree that parses. The Amendment 17
section had not been through a green run when these lines were written; the
suites decide what survives.

`lane-start`: the id `append-session-id` is anchored on for an agent that is
not Claude is `$row_sid`, the LAST id of the published session cell, which is
the same anchor the minted-uuid append uses and for the same reason —
`append-session-id` refuses unless its anchor occurs exactly once in that cell,
so a stale copy of the row is a refusal that prints the act rather than a
corruption. `$cell_anchor` is not that id: it is set only where a session is
live in this window whose uuid the cell lacks, which is never the case for the
launch of an agent that is not Claude, so the branch as written took the
empty-anchor door every time.

The suite, four cases that were asking something other than what they read:
`lane-handoff`'s stdout is kept in `hf1_out` because a `swapped` read stands
between the run and the assertions that quote it; the unwritable-record `/ctx`
case is asked from a window NO live record names, so that there is no transcript
uuid anywhere and `write_event` really does refuse (Amendment 11(e)) rather than
being handed one by the window read; the shared-`projects/` case gets its own
lane `repoSH-1`, because `repoFR-1`'s cell has since gained the uuid the
`LANE_START_FRESH=1` run minted and that one has no transcript at all — the
other branch; and the live-holder record is named for ANOTHER lane, which is the
shape Amendment 18(h) is written about: a second process on one transcript that
the lane's own liveness read does not see.

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…l` chmods it: the executable bit, the macOS parse step and the mode of every placed file are each derived from a list the next file joins by existing

THE PROOF THE TWO WIP COMMITS SAID WAS NOT IN YET. `bash tests/test_lane_helpers.sh`
is **1630 passed, 0 failed, 0 skipped, 0 pending**, with the 129 cases of
`== Amendment 17: the handoff is the swap ==` among them — the section that had
not been reached when the swap was called. Nothing in the amendment's own code
needed changing for that; what this commit carries is what reading the file
alongside the suite found.

`lane-handoff` WAS COMMITTED 100644. Every other file `--install` places is
100755 in the index and `repos.tsv`, which is data, is not. The installed copy
runs anyway — `--install` stamps 755 on everything it places — so the defect has
no symptom there; what it costs is `./lane-handoff` from a clone, and the `cp -p`
this suite copies it with, which takes the mode git recorded. The suite's own
case did not see it because the fixture ran `chmod 755` on the copy. That line is
gone: the case now reads back the mode THE REPOSITORY carries, which is the only
mode anyone else gets.

AND THE THREE LISTS IT WAS MISSING FROM, each closed so that the next file joins
by existing rather than by being remembered:

* `ALL_BASH` gains it through a new `HELPER_BASH`, with the reason it is in
  neither list beside it stated where the other two state theirs — not
  `SHIPPED_BASH`, because `R-A11-11` (*a swap is never left unwritten*) is why it
  does not `set -e`; not `LANE_BASH`, because it carries no copy of Amendment
  9(a)'s workspace resolver, resolving no workspace and reading the one path it
  needs back from `lanes-edit.sh workspace-root`. So 837 lines of shipped bash
  now take the parse gate, the LF index, the flag-spelling rule and the four
  bash-3.2 text rules; it passes all of them as written.
* the macOS job's `/bin/bash -n` step, which is a HAND-WRITTEN LIST and the only
  place the README's bash-3.2 claim is asked of bash 3.2. `lane-handoff` was not
  in it and nothing said so: the job goes green and proves one file less than it
  claims. `test_the_macos_job_parses_every_bash_file_this_repository_ships` reads
  that step and holds it against `ALL_BASH`, per name, because `bash -n a b`
  parses `a` and hands `b` to it as `$1`.
* the index mode, read out of the installer's OWN `INSTALLABLES=( … )` rather
  than a list in the suite — 755 for a command, 644 for the `.tsv` that is read
  and never run. That is the test that would have caught this the moment
  `lane-handoff` joined the installer's list, with nobody coming here first.

THE COUNTS THAT STATE THEMSELVES, finished: `AGENTS.md` and `docs/README-lanes.md`
still said eleven files, two skills and eighteen artifacts — twelve, three, three
and twenty-five — and four docstrings in the installer's tests counted the same
way. `README.md`, the installer's prose and every derived count moved with the
first WIP commit; these are the ones that state rather than derive.

lane-collision-protocol **Amendment 17** (in force 2026-09-14T09:45:33Z),
**Amendment 18(d)** and **Addendum 2**; #36.

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Fable 5.1 <[email protected]>
…`lane <lane>` where that word is on PATH, the launcher where it is not, and never a `lane` this estate did not place

Addendum 2 clause (i-8), in force 2026-09-14T16:50:32Z, says the respawn after
`/ctx` *"relaunches the lane's own pane with `lane <name>` (its parked branch is
exactly Amendment 11(i)'s act), or through the launcher directly"*, and its
adoption line names this issue: *"#36 (`/ctx`) respawns
with `lane <name>`"*. What this branch had was the second half of that sentence
and never the first: every respawn was `pclaude --lane <lane> <profile>`.

So `lane-handoff --restart` now asks PATH for the word and types it —
`LANE_START_FRESH=1 lane <lane>`, with NO profile argument, because `lane
<name>`'s parked branch reads the record this command has just written for the
lane's directory and profile and asks nothing. The launcher line stays as the
door the same clause leaves open, for the workstation where `lane` is not
installed yet: it arrives with #43 and this act ships
first, and a respawn is the one act no later refusal can undo — the pane's
process is already dead when the new command fails — so the word is used only
where this command can SEE it.

AND NOT EVERY `lane` ON A PATH. `pclaude` is nobody else's name; `lane` is an
ordinary English word, and a pane respawned over somebody else's `lane` is a
pane the person cannot get back. The file is read for the string every bash file
this toolset ships carries (`lane-collision-protocol`, in all six of them), and
one that carries none is passed over for the launcher with a line saying which
file was passed over — the safe side of the two, because it still starts the
lane.

The skill and the manual say the same thing in the same order, and the skill's
snippet is now the choice the command makes in code rather than one branch of
it.

TESTS, in `tests/test_lane_helpers.sh` § "Amendment 17", all three on a PATH
THIS FILE BUILDS: `a17_path_without_lane` drops every directory holding a `lane`
from the section's PATH, so the cases ask their own question on a workstation
that has the word (#43 places it in `~/.local/bin`) and on one that does not.
`repoHF-8`, with a fake `lane` carrying the marker, asserts the respawn line is
that file and `repoHF-8`, with the FRESH seam still on it, with no profile
argument, and never the launcher; `repoHF-9`, with a fake `lane` carrying none,
asserts the launcher line and the sentence naming what was passed over;
`repoHF-5`, on a PATH with no `lane` at all, keeps every assertion it had.

VERIFIED HERE: `bash -n lane-handoff`, `bash -n tests/test_lane_helpers.sh`.
Suite before this commit, at e25b54c: 1630 passed, 0 failed, 0 skipped. THE RUN
OF THE SUITE WITH THESE CASES IN IT FOLLOWS THIS COMMIT — it is pushed now
because a context clear of the driving session is imminent and an unpushed
change is a change the next session cannot see.

Lane: openrepotools-3 (openRepoTools-3)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…handoff branch — the swap record's lane is the ROW's spelling and its two new sub-fields ride beside it, and the three new reads canonicalise their `<lane>` as `lane-dir` now does

`8345d2f` landed Amendment 15's tooling on `main` while this branch was being
written, and the two touch the same three files. Merged, never rebased: these
commits are pushed.

THE TWO REAL CONFLICTS, and what each resolution keeps:

* `swapped_candidates`' `printf`. Amendment 15 changed the lane it emits from
  the awk KEY (`l`, folded to one case) to `nm[l]`, the spelling the register
  row carries; Amendment 17 added a sixth and a seventh field, `agent` and
  `transcript`. The resolution is both: `nm[l]` in the row's first field and in
  its pickaxe key, with the seven fields Amendment 17(b) gives this output. A
  caller that hands the first field back to a read now hands back the row's own
  spelling, which is the whole of Amendment 15(b).
* the `unknown subcommand` line, which is the list of verbs this file answers
  to: `canon-lane` from Amendment 15 and `lane-agent|lane-transcript|lane-last|
  workspace-root` from Amendment 17, in one list.

AND ONE THING THE MERGE DID NOT SAY ALOUD: Amendment 15 gives every `<lane>`
argument `canon_lane` before any read, and this branch had added three reads
after that rule was written but before it landed. `lane-agent`, `lane-transcript`
and `lane-last` now carry the same line `lane-dir` carries — a lane typed in
another case reads the row's own log rather than none — because a read that
answers 8 for a lane that exists is exactly the defect Amendment 15 was ratified
over.

`tests/test_lane_helpers.sh` conflicted where both amendments appended a section
at the same point; both are kept, Amendment 15's first (it is `main`'s) and
Amendment 17's after it, so the file reads in amendment order and every fixture
this branch seeds is created after that section has run.

Parsed: `bash -n lanes-edit.sh`, `bash -n lane-start`, `bash -n lane-handoff`,
`bash -n tests/test_lane_helpers.sh`. The suite run follows this commit.

Lane: openrepotools-3 (openRepoTools-3)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…use the job that runs this suite under BSD `head` is the macOS one and a portability question is not one to answer inside the act that kills a pane

`lane-handoff --restart` reads the head of the `lane` it found on `PATH` for the
string every bash file this toolset ships carries, and read it as
`head -c 8192 -- "$lane_word_path"`. The macOS job runs `python3 -m pytest tests
-q` — which is this shell suite, through `tests/test_lane_helpers_suite.py` —
under BSD `head`, whose option handling is its own; `head -c 8192 < "$file"`
hands the file to the utility as a file descriptor and asks nothing of its
argument parsing. Same bytes, same guard, one fewer question.

Parsed: `bash -n lane-handoff`. The suite at f8a4ce6, with the three PATH cases
this guard exists for, was 1821 passed, 0 failed, 0 skipped; the run over this
line follows.

Lane: openrepotools-3 (openRepoTools-3)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI lite review requested due to automatic review settings September 14, 2026 20:20

@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, your pull request is larger than the review limit of 150,000 diff characters

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

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds Amendment 17 lane handoff tooling, agent-aware lane resumption, transcript migration, /ctx, and related installer/documentation updates.

Changes:

  • Adds lane-handoff and handoff aliases.
  • Extends records with agent/transcript metadata and lane-start --agent.
  • Adds transcript migration, late records, tests, and Bash 3.2 checks.
File summaries
File Description
tests/test_repo_hygiene.py Updated as part of this pull request.
tests/test_openrepotools_command.py Updated as part of this pull request.
tests/test_lane_helpers.sh Updated as part of this pull request.
tests/test_install_skill_and_hook.py Updated as part of this pull request.
skills/lane-swap/SKILL.md Updated as part of this pull request.
skills/handoff/SKILL.md Updated as part of this pull request.
README.md Updated as part of this pull request.
openRepoTools Updated as part of this pull request.
lanes-edit.sh Updated as part of this pull request.
lane-start Updated as part of this pull request.
docs/README-lanes.md Updated as part of this pull request.
commands/swap.md Updated as part of this pull request.
commands/handoff.md Updated as part of this pull request.
commands/ctx.md Updated as part of this pull request.
AGENTS.md Updated as part of this pull request.
.github/workflows/tests.yml Updated as part of this pull request.
Review details

Suppressed comments (11)

lane-handoff:612

  • The write status is not checked before setting handoff_written=1. If the handoff file is read-only or the redirect fails, this cat returns nonzero but the flag still lets --restart pass the record gate and respawn with the stale top block. Set the flag only when the copy succeeds and refuse the restart otherwise.
			cat -- "$hs_tmpd/out" > "$handoff_file"   # the redirect FOLLOWS the symlink
			handoff_written=1

lane-handoff:395

  • When this command runs from a shell without CLAUDE_CODE_SESSION_ID, uuid has already fallen back to the row’s recorded session ID, but this branch checks only sess_uuid. A normal Claude handoff then records transcript none despite having the UUID, so the next default lane-start cannot resume that conversation by ID; derive the Claude transcript from the resolved uuid instead.
if [ -z "$transcript" ]; then
	if [ "$agent" = claude ] && [ -n "$sess_uuid" ]; then transcript="$sess_uuid"
	else transcript=none
	fi

lane-handoff:494

  • If mktemp fails, writers_tmp is empty and the later : > "${writers_tmp:-/dev/null}" succeeds, while poll_writer still counts writers. The handoff is then written with a WRITERS count but no entries, so /ctx can relaunch without the writer state this amendment requires. Refuse immediately when the snapshot file cannot be created.
writers_tmp="$(mktemp "${TMPDIR:-/tmp}/lane-handoff-writers.XXXXXX" 2>/dev/null || printf '')"
cleanup() { [ -n "${writers_tmp:-}" ] && rm -f -- "$writers_tmp"; return 0; }
trap cleanup EXIT INT TERM

lane-start:1776

  • This migration runs before the later dry_run exit and the mv is unconditional, so lane-start --dry-run can move the transcript (and its sibling) and create a pointer even though the command promises that dry-run makes no writes. Make dry-run discover and report the planned source/destination without performing the move.
    if ! mv -- "$ft_f" "$ft_dest_dir/$ft_id.jsonl" 2>/dev/null; then

lane-start:1997

  • When --agent is supplied for a brand-new lane (row_count=0), this branch marks the launch as RESUMED and sets an unknown session instead of preserving the normal new-lane STARTED path. Explicit Claude consequently writes a RESUMED object-log event for a newly created row, while non-Claude launches cannot write the object-log event at all because unknown is rejected. Keep the STARTED verb whenever no row exists.
elif (( fresh )) || (( AGENT_EXPLICIT )); then
  # `--agent claude` WITH NO TRANSCRIPT HERE, and the `/ctx` respawn: a NAMED
  # NEW SESSION, with the handoff's top block as its first prompt. It skips the
  # title fallback deliberately — a caller that named an agent, or a context
  # clear that has just written a fresh top block, is asking for a new session
  # of this lane and not for a picker filtered by a title.

lane-start:1881

  • lane-agent uses exit 8 for an older record with no Amendment 17 field, but any other nonzero result is a failed read. This branch silently converts such a failure into the Claude default, so an unreadable object log can launch Claude over a lane whose last handoff named another agent. Refuse on read errors and reserve the legacy fallback for 8 (and the explicitly supported pre-Amendment subcommand case).
    *) note "$LANES_EDIT lane-agent $LANE failed (exit $ag_rc) — launching the default agent, which is what this command did before Amendment 17" ;;

lane-start:1902

  • AGENT_ID is populated only from lane-transcript, i.e. the previous PAUSED record; this launch never captures the resumable ID produced by the new codex process. A handoff with transcript none therefore appends no Codex <id>, while one with an old ID appends a stale target, so the next resume cannot identify the Codex session that was just launched. Capture the ID through Codex’s supported interface or make the first agent act write the new ID before treating the launch as recorded.
if [ "$AGENT" != claude ]; then
  at_out=""; at_rc=0
  at_out="$("$LANES_EDIT" lane-transcript "$LANE" 2>/dev/null)" || at_rc=$?
  case "$at_rc" in
    0) [ "$at_out" = none ] || AGENT_ID="$at_out" ;;
    8|2) : ;;
    *) note "$LANES_EDIT lane-transcript $LANE failed (exit $at_rc) — the row's session cell will record this launch without the agent's own id" ;;
  esac

lane-start:1687

  • These paths ignore the documented CLAUDE_PROFILES_HOME override. When the profile store is relocated, follow_transcript never scans the other profiles' projects/ directories, so a lane resumed under a different profile can miss its existing transcript and start a new conversation instead of following it.
  for ppd_d in "$HOME"/.claude-profiles/profiles/*/*/*/projects \
               "$HOME"/.claude-profiles/profiles/*/*/projects \
               "$HOME"/.claude-profiles/profiles/*/projects \
               "$HOME"/.claude/projects; do

lane-start:1719

  • The live-holder scan has the same hardcoded profile root, so a custom CLAUDE_PROFILES_HOME is invisible here. A transcript held by a live process in that relocated store can therefore pass this check and be resumed or moved, creating the second live process that Amendment 18(h) is meant to prevent.
  for lho_f in "$HOME"/.claude-profiles/profiles/*/*/*/sessions/*.json \
               "$HOME"/.claude-profiles/profiles/*/*/sessions/*.json \
               "$HOME"/.claude-profiles/profiles/*/sessions/*.json \
               "$HOME"/.claude/sessions/*.json; do

lane-start:1725

  • This separate liveness implementation treats any matching PID as live, without checking the record status or the recorded /proc start time. An ended record, or a recycled PID, can therefore cause a false refusal; the shared lanes-edit.sh liveness contract already checks all three fields and should be reused here.
    case "$lho_blob" in *"\"sessionId\":\"$lho_id\""*) : ;; *) continue ;; esac
    lho_pid="$(printf '%s' "$lho_blob" | grep -o '"pid":[0-9][0-9]*' | head -n1 | sed 's/.*://')"
    [ -n "$lho_pid" ] || continue
    kill -0 "$lho_pid" 2>/dev/null || continue

lanes-edit.sh:3946

  • The gate treats a payload containing exactly one of agent or transcript as valid: the initial pattern only decides whether to enter the check, and each empty result is accepted independently. That permits a partial PAUSED record, so lane-start can default to Claude while reading a transcript ID written without its agent (or vice versa); accept the legacy case only when neither field is present, otherwise require both before appending the event.
pause_subfields_check() {   # <payload>
  psc_pay="${1-}"
  case "$psc_pay" in *'agent '*|*'transcript '*) : ;; *) return 0 ;; esac
  • Files reviewed: 17/17 changed files
  • Comments generated: 6
  • 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 lane-handoff Resolved
Comment thread tests/test_repo_hygiene.py Resolved
Comment thread lane-handoff Resolved
Comment thread lane-start Resolved
Comment thread lane-start Resolved
Comment thread lane-start Resolved
…rocess clear does not kill this lane's writers — the top block runs `ListAgents` first and relaunches only what it does not name; and the two stale tests CI found in the same breath

THE MEASURED FACT, in this lane on 2026-09-14: a harness `/clear` mints a NEW
TRANSCRIPT ID IN THE SAME PROCESS. Every subagent the lane has running survives
it — only the tool calls they had in flight die, a `Bash` killed that way exiting
137 — and the handoff written before that clear said *"every agent dies with this
context; relaunch every writer"*, which was FALSE. A next session that believed
it would have put a SECOND writer on a worktree the first one still held, and
two writers on one worktree is how the work in it is lost.

Only a NEW PROCESS takes the writers with it: the pane respawned (`--restart`,
which is what `/ctx` does here), the session ended (`--exit`), or the launcher
run after a plain handoff. So the act now records WHICH IT WAS and the top block
tells the next session what to do about it:

* `lane-handoff --in-process` — the clear that keeps this process. Refused with
  `--restart` and `--exit`, because each of those replaces the process every
  writer is a child of. Default, and every other form: `respawn`.
* the `PAUSED` payload carries `kind <in-process|respawn>` after `agent` and
  `transcript`, on the same argument those two were added on: a reader written
  before the field stops at the sub-field it knows. It is in the RECORD and not
  only in the handoff because the record is what a later reader and a launcher
  have.
* the top block's act (3) is now, in both kinds: **RUN `ListAgents` FIRST. A
  WRITER STILL LISTED IS ALIVE AND OWNS ITS WORKTREE: DO NOT RELAUNCH IT.
  Relaunch only writers `ListAgents` does NOT name, and only after
  `git status --short` and `git log @{u}..` in that worktree say where it
  stood.** The `WRITERS` section repeats the rule where the list is, and the
  kind adds its own sentence — *expect `ListAgents` to name none of them* for a
  respawn, *expect it to name every one, and relaunch NONE* for an in-process
  clear.

The skill, `commands/ctx.md` and the manual say the same in the same order, and
the skill carries the table of the two kinds so that a session writing the block
by hand writes the same two texts.

AND THE TWO TESTS CI FOUND, both of which were green here for the wrong reason:

* `test_the_swap_skill_snippet_and_its_prose_spell_the_same_command` read
  `skills/lane-swap/SKILL.md`, which Amendment 17(a) turned into an ALIAS that
  restates no step — so it was asserting over an emptiness. It now reads the
  installer's own `SKILL_NAME`, which is where the canonical skill is declared
  once, and every assertion it makes lands on the file that carries the act
  (2 `restart_cmd=` branches, no `pclaude run` unexplained, `--lane` leading).
* `test_no_committed_file_names_a_host_absolute_path` caught three `/home/b/`
  spellings in the manual's examples. They are `~/projects/repoHF` and
  `~/.claude/projects` now, which is what every other example in that file uses.

AND ONE SUITE AT A TIME, in `AGENTS.md` where an agent is sent to read it: six
lanes build in sibling worktrees of this checkout and FOUR SUITES RAN AT ONCE
under the guard they had been given — `pgrep -af 'python3 -m pytest' | grep -v
pgrep >/dev/null` never waits where `grep` is the harness's own shell function
(status 1 when its stdout is `/dev/null`), and its unanchored pattern matches the
guard's own command line. The working form is an anchored `pgrep -fc` with its
pattern split so it cannot match itself, then `flock` so the waiters cannot all
start together. The cap entry for those nineteen lines is in the test that holds
it.

SUITE: `bash tests/test_lane_helpers.sh` — 1821 passed, 0 failed, 0 skipped at
`f8a4ce6` (the merge of Amendment 15); **1844 passed, 0 failed, 0 skipped** with
the `kind` cases of this commit (+23: the record's kind, the block's ListAgents
rule and its two texts, the `--in-process` record and block, the pane untouched,
and both refusals). `bash -n` on `lane-handoff` and the suite. The pytest run
that would have covered the two test files above is NOT started: this workstation
has three suites running under other lanes and this lane is shutting down on
Brett Heap's word; CI on #47 is the authority and has already run these two
tests red on their pre-fix bytes.

Lane: openrepotools-3 (openRepoTools-3)
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Copilot AI review requested due to automatic review settings September 14, 2026 20:43

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 review findings affect executable installation, lane validation and state ordering, transcript migration, and record handling.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (13)

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

lanes-edit.sh:3963

  • An explicitly present but empty agent or transcript value produces an empty parsed value and is treated exactly like an absent pre-Amendment-17 field. Thus a malformed PAUSED payload can be written and later makes lane-start fall back/default instead of refusing the record. Distinguish missing fields from empty fields and reject the latter while retaining the legacy missing-both case.

lane-handoff:1

  • This new PATH command is tracked as mode 100644 (the Amendment 17 fixture explicitly observes that), so a fresh checkout and the suite's cp -p copy are not executable. The installer's later chmod cannot repair the checkout or this copy; mark lane-handoff executable in the Git index (100755).
#!/usr/bin/env bash

lane-handoff:360

  • When the window name differs only in case from the register row, register-row succeeds but this assignment keeps $window_name rather than the row's canonical spelling. The later top block, payload, object-log lane field, and restart command can therefore use the wrong case, contrary to Amendment 15; canonicalize the name before assigning it here.
if [ -z "$lane" ] && [ -n "$window_name" ]; then
	sread row_probe "'this window is not a lane'" register-row "$window_name"
	[ -n "$row_probe" ] && lane="$window_name"
fi

lane-handoff:403

  • An explicit --lane skips the register-resolution branch and reaches this rename with the raw, unvalidated value. A case-different or malformed/ambiguous value can rename the tmux window first and only then be rejected by lanes-edit during the record write, leaving the command to print a misleading READY line; validate and canonicalize the lane before any window mutation.
if have_tmux && [ -n "$window_name" ] && [ "$window_name" != "$lane" ]; then
	tmux rename-window "$lane" 2>/dev/null &&
		step "window renamed '$window_name' → '$lane' (Amendment 8(b): the window IS the lane)"

lane-handoff:842

  • row_write_refused is set when replace-in-row or append-row-status fails, but this guard checks only record_written. In that partial-write case --restart/--exit still kills or replaces the pane even though the register remains unpaused, violating the record-before-pane ordering and leaving the next launcher with inconsistent state. Gate this action on both the object-log write and the row write succeeding.
	[ "$record_written" = 1 ] ||
		die "the lane's PAUSED record was NOT written, so this pane is left exactly as it is: a pane is never respawned over an unrecorded lane, and a session is never ended without one (Amendment 17(f)). Fix the write above and re-run." 2

lane-start:1781

  • If the transcript sibling directory exists but this mv fails, the JSONL file has already moved while the sibling stays in the old profile, yet follow_transcript still returns success and the caller resumes the split transcript. Treat a failed sibling move as a refusal (or roll back the first move) before reporting success.
    [ -d "$ft_sib" ] && mv -- "$ft_sib" "$ft_dest_dir/$ft_id" 2>/dev/null

lane-start:1788

  • The pointer creation is unchecked, so a non-writable source directory can leave the transcript moved without the required .moved-to-* pointer while the next line claims that a pointer was left. Handle this failure explicitly instead of returning success with incomplete migration metadata.
    printf 'moved to %s by %s at %s\n' "$ft_dest_dir" "$prog" "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
      > "$ft_f.moved-to-$ft_to-$(date -u +%Y-%m-%dT%H%M%SZ)" 2>/dev/null

lane-start:1881

  • lanes-edit lane-agent returns exit 1 when the log cannot be read and explicitly says that a caller must not launch the default agent in that case (lanes-edit.sh:6310-6315). This fallback therefore can start Claude over a lane whose paused agent is unknown; a read failure must refuse rather than silently changing the launcher.
    *) note "$LANES_EDIT lane-agent $LANE failed (exit $ag_rc) — launching the default agent, which is what this command did before Amendment 17" ;;

lane-start:1899

  • lane-transcript is queried only by lane, so an explicit lane-start --agent codex on a record whose last PAUSED says agent claude loads the Claude UUID into AGENT_ID. The later append then records Codex <Claude UUID>, which is not a Codex resumable id and misattributes the session history. Read the recorded agent as well and reuse the transcript only when it belongs to the requested agent; otherwise leave the new agent id unset.
if [ "$AGENT" != claude ]; then
  at_out=""; at_rc=0
  at_out="$("$LANES_EDIT" lane-transcript "$LANE" 2>/dev/null)" || at_rc=$?
  case "$at_rc" in
    0) [ "$at_out" = none ] || AGENT_ID="$at_out" ;;

lane-start:1982

  • The Codex branch launches only codex and does not propagate the selected agent to the child process. lane-handoff derives its record field from LANES_AGENT and otherwise defaults to claude, so a Codex session started here will later write agent claude; transcript none unless an undocumented wrapper sets the variable. Export the selected agent for the launched process (or pass equivalent agent context) before executing the command.
      cmd=("$AGENT")

lanes-edit.sh:4917

  • This folded-key aggregation still carries the raw log spelling stored in nm[k], although swapped promises the register row's canonical spelling. The existing repoWin-1 shape has a repoWin-1 row but a PAUSED event spelled repowin-1, so this path emits the lowercase token to callers. Resolve each folded key through the register/canonical resolver before rendering the first field.
      for (l in mp) {
        if (verb[l] != "PAUSED") continue
        if (substr(pay[l], 1, 5) != "swap;") continue
        w = ""; wst = ""; d = ""; pf = ""; ag = ""; tr = ""
        n = split(pay[l], sf, "; ")

lanes-edit.sh:5723

  • The parser stores --utc for every log verb; the only validation here is the timestamp shape. A caller can therefore write STARTED, RESUMED, or another event with an arbitrary historical timestamp even though this option is documented as the late-PAUSED seam, changing the metadata state readers report. Reject --utc outside the intended late PAUSED path or expose that path as a dedicated operation.
        # is what every state read means by "last"). The shape is checked here
        # because a UTC field this parser cannot read is a line no reader can
        # date — and the log is never rewritten.
        --utc)       utc_override="${2-}"; [ -n "$utc_override" ] || die "--utc needs a UTC instant" 2; shift 2 ;;
        --utc=*)     utc_override="${1#--utc=}"; [ -n "$utc_override" ] || die "--utc needs a UTC instant" 2; shift ;;

tests/test_repo_hygiene.py:199

  • lane-handoff is an installable command, but this rationale says its index mode is 100644 while the assertion below requires every non-TSV installable to be 100755. If that recorded mode is current, this hygiene test fails and the checkout copy is not executable; mark lane-handoff executable in the git index (or correct this stale rationale) before merging.
    from a clone, and the `cp -p` the lane suite copies `lane-handoff` with,
    both take the mode git recorded. `lane-handoff` was committed 100644 under
    Amendment 17(a) and the suite's own `chmod` hid it — which is the whole
    reason this is asked of the INDEX and derived from the installer's list
    instead of a list here: the two tests above are per-name, and a name nobody
  • Files reviewed: 17/17 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread lane-handoff Resolved
…transcript never half-moves between profiles, and the launch line is quoted by something bash 3.2 and BSD `sed` both read — Copilot rounds 1 and 2, Amendment 17 Addendum 1, and the suite's own lock

THE macOS JOB'S THREE RED CASES WERE THIS BRANCH'S OWN, and the defect is one
line that has been in `lane-start` since before this amendment:

    quoted() { printf '%q ' "$@" | sed 's/ $//'; }

Two defects in it, and only their combination is fatal. `printf '%q '` renders
differently under BASH 3.2 — what Apple ships, and what `tests-macos` runs
(`/bin/bash` 3.2.57 on macOS 26.6.2): bash 4.4 and later give a multi-line
argument back as `$'…\n…'`, one readable and runnable word, while 3.2 has no
such form and escapes every space and every byte of every multi-byte character
with a backslash of its own. And the PIPE made that fatal rather than ugly:
under `set -o pipefail` the function's status is the pipeline's, and BSD `sed`
in a UTF-8 locale (`LC_ALL=en_US.UTF-8` there) refuses bytes that are not a
valid sequence — `RE error: illegal byte sequence` — which is exactly what
3.2's `%q` makes of the em dash every document in this estate is written with.
`quoted` is a BARE command in the `--no-launch` branch, so `set -e` ended
`lane-start` there: exit 1, empty stdout, three assertions red and no other
platform able to see it. The one caller that passes a multi-line argument is
this amendment's own — the `--no-launch` print of a launch carrying the
handoff's top block as its first prompt — which is why it went red here and
nowhere before. It is now POSIX quoting of the file's own, in `lane-start` and
`lane-handoff`: safe words bare, anything else in single quotes with `'\''`
for its own. `restart` carries the same line and is untouched — #43 deletes
that file in flight and a conflict there costs it a round.

COPILOT ROUND 1 (`db206db`), the four inline findings:

* `lane-handoff:842` — the `--restart`/`--exit` gate tested only the
  object-log write. The record is THREE writes: the ROW is what every other
  lane reads this lane's state from, and the HANDOFF's top block is literally
  the respawn's first prompt. It now gates on all three and each refusal names
  the act that clears it.
* `lane-start:1692` — `readlink -f` is not stock macOS userland, so `real_of`
  fell back to the UNRESOLVED path, two spellings of one directory compared as
  two directories, and the shared-`projects/` case — every case on a
  launcher-configured workstation — would have moved a transcript that never
  needed moving. Now `( CDPATH=''; cd -P -- "$1" && pwd -P )`.
* `lane-start:1781` and `:1788` — the sibling `<uuid>/` move's status was
  discarded and the pointer's write was suppressed. The `.jsonl`, its sibling
  and the pointer are ONE TRANSACTION now: each step is checked, a step that
  cannot complete puts back what the steps before it moved (`ft_rollback`) and
  refuses, and the refusal names anything the rollback itself could not undo.
* DECLINED, both mode findings (`lane-handoff:1`, `tests/test_repo_hygiene.py:198`):
  `git ls-tree db206db lane-handoff` → `100755`, and `git ls-files -s` says the
  same today. What they read is that test's docstring describing the FIRST
  Amendment 17(a) commit; it now names `e25b54c` as the commit that fixed the
  mode and points at `git ls-files -s`. The same stale rationale in the A17
  fixture is corrected.

From round 1's SUPPRESSED list: `lane-start:1776` (`--dry-run` moved the
transcript before reaching the exit that says it moved nothing),
`lane-handoff:612` (`handoff_written=1` set whether or not the write
succeeded), `lane-handoff:494` (a failed `mktemp` gave a WRITERS section with a
count and no entries), `lane-handoff:395` (the record's `transcript` came from
`$sess_uuid`, not the resolved `$uuid`, so a handoff from a bare shell wrote
`transcript none` about a conversation whose id the same line carries),
`lane-start:1687` and `:1719` (`$CLAUDE_PROFILES_HOME` ignored by both profile
walks, though this repository's own README documents it), `lane-start:1881`
(a failed `lane-agent` read launched the default agent, which is the one thing
that read's own refusal forbids — it now refuses and names `--agent`), and
`lane-start:1997` (a lane with NO ROW wrote `RESUMED` as its object log's first
line).

COPILOT ROUND 2 (`ac0c697`):

* `lane-handoff:303` — the read fence treated exit 2 as "no answer", but
  `canon_lane` spends 2 on a register holding two rows that differ only by
  case. `lane-handoff` fell through to the next rung and would have renamed a
  window, written a record and respawned a pane for whichever lane it answered
  with. The refusal is now asked for by its own words, as `lane-start:755-767`,
  `lane-end` and `restart` ask for it, and relayed.
* `lane-handoff:360` and `:403` — the lane is canonicalised through
  `canon-lane` BEFORE the window rename, so the row's spelling is what the
  rename, the top block, the payload, the log's lane field and the restart line
  all carry; and a `--lane` that is not a lane name is refused there rather
  than after the window has been renamed.
* `lanes-edit.sh:3946`/`:3963` — `pause_subfields_check` accepted a payload
  carrying exactly one of `agent`/`transcript`, and an empty value parsed like
  an absent one. Both are refused now, with the value judged before the pair so
  a malformed one is still refused for the malformation.
* `lanes-edit.sh:5723` — `--utc` was taken for every verb and only its shape
  was checked; it is the late `PAUSED`'s seam and is refused for everything
  else, because file order is what every state read means by "last".
* `lane-start:1899` — `lane-transcript` answers for the LANE, so `--agent
  codex` over a record that says `agent claude` would have appended
  `Codex <claude uuid>` to the row's cell. The id is carried only where the
  recorded agent IS the agent being launched.
* `lane-start:1982` — the launched agent's name is exported, so a `codex`
  session's own handoff does not record `agent claude`.

FILED, NOT FOLDED IN: #55 (`swapped`'s first field is the
LOG's spelling and not the register row's — Amendment 15's claim, landed on
`main` with #41, so it predates this diff) and #56 (the
cross-profile transcript-holder scan tests only `kill -0`, where
`lanes-edit.sh`'s one liveness contract tests three things). Both claimed by
this lane.

AMENDMENT 17 ADDENDUM 1, in force 2026-09-14T20:59:31Z (brettheap/new-workstation#40,
`26a0d5b`), whose adoption line names this issue:

* (h) the record names the KIND, and there are THREE: `--in-process` writes
  `in-process`, `--restart`/`--exit`/`--late` write `respawn`, and a PLAIN
  handoff writes `unknown` — the act that follows it is not this command's to
  know. The word is in the payload (`; kind <k>`) and in the line's FREE TEXT
  after the why (`clear in-process`, `clear respawn`, `kind unknown`), which is
  the addendum's own spelling.
* (i) the WRITERS section is a list to COUNT, not a list to relaunch, and its
  first line is the clause's own words under EVERY kind.
* (j) the kind says what to EXPECT and never what to do, so `relaunch every
  writer below` and `relaunch NONE of them` are both gone from the template.
* (k) one worktree, one writer, in the first acts, with the retire act for a
  second one found.

AND THE SUITE'S OWN LOCK (#51). Four `python3 -m pytest
tests -q` runs were live at once on this workstation on 2026-09-14, every one
past a guard copied into four briefs: `pgrep -af '…' | grep -v pgrep
>/dev/null` never waits, because `grep` under the harness is a shell FUNCTION
whose status is 1 when its stdout is `/dev/null`, and its pattern is unanchored
besides. `tests/run.sh` is that guard written ONCE — wait, take
`${TMPDIR:-/tmp}/openrepotools-pytest.lock` (`flock`, or a `mkdir` lock on
macOS, which has none), wait again inside it, then run the suite — named in
`AGENTS.md` and `docs/README-lanes.md` as the way to run it, parsed by the
macOS job with every other bash file here, and pinned by a hygiene test that
holds the lock path in both places.

Closes #51 (with #36).

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

Unresolved critical and moderate issues remain in handoff safety, lane startup state handling, and test-lock recovery.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (10)

lane-handoff:240

  • The --flag= forms bypass flag_value, so an explicitly empty value is accepted instead of refused. For example, --agent= falls through to the default claude, while --transcript= and --dir= silently trigger discovery/default behavior, so the command can hand off a different lane or record than the caller named. Validate these assignment forms as non-empty just like the space-separated forms (including --at= and --writers-file=).
	--lane=*) lane="${1#--lane=}"; shift ;;
	--agent) agent="$(flag_value --agent "${2-}")"; shift 2 ;;
	--agent=*) agent="${1#--agent=}"; shift ;;
	--transcript) transcript="$(flag_value --transcript "${2-}")"; shift 2 ;;
	--transcript=*) transcript="${1#--transcript=}"; shift ;;

lane-handoff:496

  • A failed tmux rename-window is silently ignored here, but the handoff then continues and records the canonical lane name. That leaves the window/record identity triple inconsistent and makes the printed restart target stale; treat the rename failure as a refusal before any record write.
	tmux rename-window "$lane" 2>/dev/null &&
		step "window renamed '$window_name' → '$lane' (Amendment 8(b): the window IS the lane)"

lane-handoff:1052

  • With set -o pipefail, this grep -q can exit as soon as it sees the marker, causing head to receive SIGPIPE when the PATH command is larger than 8192 bytes. The pipeline then returns nonzero and a real lane command is misclassified as foreign, so /ctx falls back to pclaude instead of respawning through lane. Let grep consume the bounded input (for example, remove -q and redirect its output).
		if head -c 8192 < "$lane_word_path" 2>/dev/null | grep -q 'lane-collision-protocol'; then

lane-handoff:860

  • The payload grammar splits sub-fields on ; , but this validation omits that delimiter (and ") for window_ref even though the preceding comment says both are dropped. A tmux session name containing ; would therefore be written as a malformed window payload and later swapped/window readers would recover the wrong reference. Apply the same delimiter/quote fence used for dir.
case "$window_ref" in *', '* | *' — '*) refused="$refused window=$window_ref"; window_ref="" ;; esac

lane-start:1878

  • When the destination already contains a directory named for this UUID, mv "$ft_sib" "$ft_dest_dir/$ft_id" succeeds by nesting the source as $ft_dest_dir/$ft_id/$ft_id. The code then marks the sibling as moved, leaves the pre-existing destination directory as the apparent sibling, and resumes with the sidecar state split from the transcript. Reject an occupied destination sibling before moving the JSONL (or otherwise make this move fail and roll back).
    if [ -d "$ft_sib" ]; then
      if mv -- "$ft_sib" "$ft_dest_dir/$ft_id" 2>/dev/null; then
        ft_moved_sib=1

lane-start:2132

  • The codex branch does not verify that the selected launcher exists before the row, object log, and Rule 3 stamp are written. On a machine without codex, the later exec exits 127 after recording the lane as resumed, leaving a false PAUSED→RESUMED transition and requiring manual repair. Refuse before any state writes when the table entry is unavailable.
      cmd=("$AGENT")

lane-start:2225

  • The documented -- passthrough is appended here, but the handoff prompt is appended later at line 2879. If a caller passes a positional prompt (lane-start … -- custom prompt), that text becomes the agent's first prompt and the handoff top block is no longer first, contrary to the launcher-table contract. Assemble option passthrough without placing positional arguments ahead of the handoff prompt, or reject positional passthrough for this mode.
cmd+=(${pass[@]+"${pass[@]}"})

lane-start:2560

  • For every Codex launch, lane_sid is unknown, so lane_sid_known stays false and this branch skips the object-log write. The row and handoff are nevertheless marked RESUMED, leaving the append-only log ending in PAUSED; readers such as lane-last and the --late guard can then treat a running Codex lane as paused. Record an agent-neutral resume event/session identifier for non-Claude launches before marking the launch resumed.
if (( ! lane_sid_known )); then
  note "no transcript uuid is knowable at this instant (the row's stamp says '${lane_sid:-unknown}'), so the lane's $lane_verb log line is NOT written: Amendment 7(b) makes that field a transcript uuid and only that, and the log is append-only. Nor is the handoff's Rule 3 stamp. BOTH are written by the first act that knows the uuid, which is this session's own:"

tests/run.sh:113

  • When two wrappers observe the same dead PID, both can execute rm -rf "$LOCKDIR"; if one has already recreated the directory, the other's removal deletes the new holder's lock and both suites can enter the critical section. Stale-lock takeover needs an atomic claim/rename (or an equivalent ownership recheck) rather than deleting the shared name directly.
    *) if ! kill -0 "$holder" 2>/dev/null; then
         printf '%s: the lock %s was left by pid %s, which is gone — taking it over\n' \
           "$prog" "$LOCKDIR" "$holder" >&2
         rm -rf -- "$LOCKDIR"
         continue

tests/run.sh:120

  • The INT/TERM traps only remove the lock directory and then return, so cancelling while waiting or while pytest is still running can release the lock while this suite continues. A second tests/run.sh can then enter concurrently, defeating the serialization this wrapper introduces. Have the signal handlers clean up and exit, while retaining the EXIT cleanup.
trap 'rm -rf -- "$LOCKDIR"' EXIT INT TERM
  • Files reviewed: 18/18 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread lane-handoff Resolved
Comment thread tests/run.sh Resolved
Comment thread lane-handoff Resolved
…ver moves onto an occupied name, and the two acts that reach a handoff through a symlink resolve it the way macOS can — Copilot round 3

The round before this one went green on all four CI jobs, macOS included, which
is what made these findings readable rather than hidden behind three red cases.

`tests/run.sh` — THE LOCK THIS PULL REQUEST SHIPS AS THE WAY TO RUN THE SUITE,
and three things a `mkdir` lock has to get right that the first shape of it got
wrong (`tests/run.sh:109`, `:113`, `:120`):

* A LOCK WITH NO PID IN IT IS STALE, NOT ETERNAL. The pid is written the instant
  after `mkdir` returns, and a run killed in that instant left a directory
  nothing could validate — which the loop waited on for ever, blocking the
  estate's one test entry point for everybody.
* A TAKEOVER IS A CLAIM, NOT A DELETE. Two waiters that both saw a dead holder
  both `rm -rf`'d the name, and if one had already re-made it the other deleted
  the NEW holder's lock and both suites ran. It is a `mv` now — one rename, one
  winner, the loser loops — with the claimed directory RE-READ after the rename,
  because the only way a live holder can be behind that name is if it appeared
  between the read and the rename, and then it is put straight back. A stale
  state must also hold for three polls before it is claimed at all.
* THE SIGNAL HANDLERS EXIT. `trap 'rm -rf …' EXIT INT TERM` released the lock on
  a Ctrl-C and then carried on running the suite, which is the collision the
  lock exists for.

`lane-start:1878` — AN OCCUPIED DESTINATION IS REFUSED BEFORE ANYTHING MOVES.
`mv <dir> <existing dir>` does not fail: it moves the source INSIDE it. A
`<uuid>/` already in this profile would therefore have taken the other
profile's sidecar as `<uuid>/<uuid>/`, been marked moved, and left the lane
resuming with the transcript's state split from the transcript. Which of two
`<uuid>` directories is this lane's is not a thing to guess at, so the read
names what is there and stops — and a name that is NOT a directory still falls
to the transaction below, where `mv` really does fail and the rollback puts the
transcript back.

`lane-handoff:812` and its twin in `lane-start` — `readlink -f` IS NOT IN THE
STOCK macOS USERLAND, which is the same rule `real_of` took last round. Where it
is absent the fallback hands the path back UNRESOLVED, so `hs_repo` — which git
answers with a PHYSICAL path — and `hs_rel`, derived from the symlinked
spelling, disagree; `git add` then refuses the pathspec and the handoff this act
has just written, or the Rule 3 stamp it has just spliced, is left uncommitted.
A handoff is reached through the estate's `handoffs` symlink on every
workstation that has one. Both now resolve the PARENT with `cd -P`/`pwd -P`.

`lane-handoff:1052` — `head -c 8192 … | grep -q` TAKES SIGPIPE UNDER `pipefail`.
`grep -q` exits the instant it matches, `head` writing the rest of a word larger
than 8192 bytes dies with 141, and the pipeline's status is that — so the
estate's OWN `lane` was classified as somebody else's and `/ctx` respawned
through the launcher instead of the word. `grep` reads all of the bounded input
now, and the suite's fake `lane` is padded past 8192 bytes so the three PATH
cases prove it.

`lane-start:2132` — A LAUNCHER THIS WORKSTATION DOES NOT HAVE IS REFUSED BEFORE
ANY WRITE. The row, the object log and the Rule 3 stamp are all written before
the `exec`, so a `codex` that is not installed recorded the lane as RESUMED and
then exited 127: a false transition in two append-only files that a person has
to repair by hand.

`lane-handoff:860` — the `window` sub-field's fence gains `; ` and `"`, the two
its own comment already claimed it dropped. `window` is two space-separated refs
in ONE sub-field, so a `; ` inside it is read back as the end of the sub-field
and every reader recovers a window ref that is not the lane's.

FILED, NOT FOLDED IN: #65 — the `/ctx` respawn recognises
this estate's `lane` by a string in the word's own head, which is a heuristic and
not provenance: any executable can carry it. Tightening that to the directory
`--install` places these commands in is a change to the behaviour Amendment 18
Addendum 2 (i-8) adopted, and to three of this suite's PATH fixtures with it.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
Copilot AI review requested due to automatic review settings September 14, 2026 22:09

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

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (11)

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

lane-handoff:793

  • This write is not atomic: the redirection truncates the live handoff before cat copies the prepared content. A full filesystem or interrupted write can therefore leave an empty/partial handoff; the failure branch then claims the old block still exists and /ctx refuses with corrupted recovery data. Replace or roll back the target only after a complete write, while preserving the symlink-following behavior.

lane-handoff:753

  • top_block embeds the raw why, but why_text is sanitized later before the PAUSED record is written. A reason containing — therefore makes the persisted top block disagree with the record, and a newline is inserted into the block even though lanes-edit.sh will reject that reason; because the handoff is refreshed first, the command can leave a malformed/new block after the record write fails. Normalize or validate why once before top_block and reuse that value for every output.
	printf '## RESUME PROMPT — PAUSED %s (%s), agent %s, transcript %s, kind %s — %s\n\n' \
		"$UTC" "${why:-handoff}" "$agent" "$transcript" "$handoff_kind" "$kind_headline"

lane-handoff:924

  • When lanes-edit.sh log PAUSED refuses, this branch only prints a note and continues into the row update; a plain handoff can then flip the row to PAUSED even though the object-log record is absent and still exits 0. That leaves the row and log inconsistent while reporting success. Treat the failed object-log write as a refusal (or gate subsequent record writes and return nonzero) for plain handoffs too, as the --restart/--exit gates already do.
	if LANES_LANE="$lane" LANES_SESSION="$uuid" "$LANES_EDIT" log PAUSED "lane:$lane" \
		'→' "$payload" "$why_text"; then
		record_written=1
		step "object log: PAUSED lane:$lane → $payload"
	else

lane-handoff:900

  • For --late with no explicit reason, this fallback is applied only after top_block has already rendered ${why:-handoff} and ${why:-no why given}. The handoff therefore tells the next session a generic handoff occurred while the PAUSED record says the usage limit caused the late write. Compute one effective reason before refreshing the handoff and reuse it consistently.
	late_why="$(sanitize "${why:-late; usage limit hit before the swap at $late_at}") $kind_word"

lane-handoff:307

  • The respawn kind headline still tells the next session to “relaunch from where each stands.” Addendum 1(j) makes the kind an expectation only; the common first-act/count text must decide which non-live writers need relaunching. Because this headline is interpolated into the top prompt, it reintroduces an action instruction that the amendment explicitly removed.
	kind_headline='expect none of the writers below live — count them, then relaunch from where each stands'

lane-handoff:298

  • The in-process kind headline also includes an instruction (“count them before you touch any of them”), even though Addendum 1(j) requires the kind to state only what to expect; the shared first-act text already gives the count and ownership procedure. Keep this headline expectation-only so all three kinds obey the same contract.
	kind_headline='expect every writer below live — count them before you touch any of them'

lane-handoff:648

  • This implementation comment still says the next session “RELAUNCHES EVERY WRITER IT LISTS,” which contradicts Addendum 1(i)/(j) and the top-block text below: live writers must not be relaunched, and the live count wins. Update the comment so future changes do not restore the removed behavior.
# session *"RELAUNCHES EVERY WRITER IT LISTS from where each stood"*. A shell

lane-handoff:183

  • The --in-process help text still claims that the top block tells the next session to “relaunch NONE of them.” The generated block now requires counting live writers and relaunching only writers that are not live, so this description is both inaccurate and preserves the Addendum 1(j) instruction that was removed from the template.
                          top block tells the next session to relaunch NONE of
                          them. Refused with --restart and --exit, which each

lane-start:2162

  • This Claude resume branch checks only for a UUID in the row and a local transcript, not which agent recorded the last PAUSED. After a Codex handoff the row can still contain an earlier Claude UUID in its history, while RECORDED_AGENT is codex; lane-start --agent claude will therefore resume that stale Claude conversation instead of launching the explicitly requested agent with the handoff top block. Gate this id-resume path on a Claude/legacy recorded agent, otherwise use the named-agent first-prompt path.
elif [ -n "$row_sid" ] && [ -n "$rec_file" ]; then
  step "the row's current session is $row_sid and its transcript is here ($(basename -- "$rec_file")) — resuming it by id"
  (( holder_here )) && step "  (it is the session live in this window; --resume attaches to the same conversation)"
  cmd=("$CLAUDE_BIN" --name "$LANE" --resume "$row_sid")
  lane_verb=RESUMED; lane_sid="$row_sid"

lane-start:2190

  • The title fallback has the same agent-mismatch hole: it runs for --agent claude even when the last PAUSED record names Codex. A prior Claude transcript titled for this lane can therefore be selected and resumed, bypassing the new handoff prompt; when the requested agent differs from the recorded agent, this fallback must be skipped (while preserving the legacy no-agent-metadata behavior).
elif titled="$(titled_transcript)"; then
  transcript="${titled%%$'\t'*}"; found_title="${titled#*$'\t'}"
  [ -n "$row_sid" ] && note "the row's last session id $row_sid has no transcript for this directory — falling back to the title"
  step "a transcript here carries the title '$found_title' ($(basename -- "$transcript")) — resume beats new"

skills/lane-swap/SKILL.md:3

  • The alias description repeats the handoff procedure (identity fix, refresh, writer polling, and PAUSED fields) even though clause (g) makes handoff the single source of those steps. This copy will drift from skills/handoff/SKILL.md as the procedure changes; keep the front matter description limited to saying that lane-swap invokes handoff.
description: "/lane-swap is the alias of /handoff kept by lane-collision-protocol Amendment 17(a): the swap IS the handoff, under one name. It invokes the handoff skill and adds nothing to it — the identity triple fixed, the handoff refreshed with a fresh Rule 3 top block listing every running writer, the writers polled, the PAUSED record written with the window, the directory, the profile, the agent and its transcript, and the one restart command printed."
  • Files reviewed: 18/18 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread tests/run.sh Resolved
Comment thread tests/run.sh Resolved
…cause the workstation it was written on HAS codex installed

Four assertions of the round-3 case `--agent codex on a workstation with no
codex is refused` went red on Eagle and green on every CI runner, which is the
shape of a fixture asking a different question rather than of a defect: the
workstation carries `~/.npm-global/bin/codex`, so the refusal correctly did not
fire and the launch went ahead.

`a17_path_without <word>` is the generalisation of the `a17_path_without_lane`
the three `lane` cases already use, and for the reason that helper's own comment
gives — *a case that asked "what happens where there is no `lane`" against a
workstation that has one would go green on the answer to a different question*.
The codex case now builds its PATH the same way.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
Copilot AI review requested due to automatic review settings September 14, 2026 22:31
…ive` stops reporting a failure in the same breath as a zero — Copilot rounds 7 and 8

Three threads on one inconsistency and one on its neighbour, all of them this
branch's own:

* `AGENTS.md` and `docs/README-lanes.md` showed the guard with `pgrep -fc`,
  which `tests/run.sh` deliberately does NOT use — `-c` is not in every `pgrep`
  this repository runs under, and it is the COUNT and never `pgrep`'s exit
  status that decides. A document that shows a person a non-portable form of
  the very guard the wrapper exists to make portable is worse than one that
  shows none. Both snippets count with `awk` now, as the wrapper does, and both
  say the wrapper is the canonical implementation and why the lines are
  repeated at all.
* `tests/run.sh:66` — `pgrep` exits 1 when it matches nothing and `set -o
  pipefail` makes that the pipeline's, so `pytest_live` printed `0` and
  returned a FAILURE together. Every caller today reads the printed count,
  which is what its own comment says; the explicit `return 0` is what keeps
  that true for the first caller that uses it in a condition.

The two remaining findings of those rounds — parametrising the skill-placement
assertions over `SKILL_NAMES`, and an `INSTALLABLES=( … )` regex that tolerates
a wrapped array — are #72's kind and are noted there.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
Copilot AI review requested due to automatic review settings September 15, 2026 01:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical and moderate issues remain in late-record atomicity, explicit agent selection, handoff metadata, and respawn handling.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (13)

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

lane-handoff:321

  • This respawn headline includes the action “relaunch from where each stands”. Amendment 17 Addendum 1(j) requires kind text to state only what to expect; the common WRITERS/count rules decide which non-live writers to relaunch. Leaving this action in the kind-specific headline can cause a reader to relaunch live writers.

AGENTS.md:242

  • This copy-paste guard is not equivalent to tests/run.sh: it omits the second process poll after acquiring the lock and has no mkdir fallback for macOS. Following it can still race with a manually started pytest run, and on the documented macOS environment flock is unavailable; point readers to the wrapper or include both lock implementations and the in-lock poll.
pat='^python3 -m pyt'"est"                       # split so it cannot match itself
while [ "$(pgrep -f "$pat" | awk 'END { print NR + 0 }')" -gt 0 ]; do sleep 20; done
flock "${TMPDIR:-/tmp}/openrepotools-pytest.lock" python3 -m pytest tests -q

docs/README-lanes.md:444

  • This standalone guard has the same divergence from the canonical wrapper: it takes flock immediately after the first poll, omits the required second poll inside the lock, and has no macOS mkdir fallback. A reader copying this documented command can overlap a manually started run or fail on the repository's supported macOS shell; reference tests/run.sh or reproduce its complete portable logic.
pat='^python3 -m pyt'"est"
while [ "$(pgrep -f "$pat" | awk 'END { print NR + 0 }')" -gt 0 ]; do sleep 20; done
flock "${TMPDIR:-/tmp}/openrepotools-pytest.lock" python3 -m pytest tests -q

lane-handoff:240

  • The --at=* arm bypasses flag_value, so --at= is accepted with an empty value (and is silently ignored unless --late is also present) instead of being refused as a missing value. Reject an empty suffix here while still allowing the equals form to carry a flag-like value.
	--at=*) late_at="${1#--at=}"; shift ;;

lane-handoff:242

  • The --lane=* arm bypasses flag_value, so --lane= is accepted and later falls through to inferred lane discovery (or a less specific refusal) instead of rejecting the missing value. Validate the suffix before assigning it.
	--lane=*) lane="${1#--lane=}"; shift ;;

lane-handoff:244

  • The --agent=* arm bypasses flag_value, so --agent= is accepted and line 563 silently substitutes $LANES_AGENT or claude; an explicitly empty value should be a missing-option-value refusal, not a request for the default agent.
	--agent=*) agent="${1#--agent=}"; shift ;;

lane-handoff:246

  • The --transcript=* arm bypasses flag_value, so --transcript= is accepted and later replaced by the inferred transcript/none value. This makes an explicitly empty value indistinguishable from an omitted option; reject the empty suffix at parse time.
	--transcript=*) transcript="${1#--transcript=}"; shift ;;

lane-handoff:248

  • The --writers-file=* arm bypasses flag_value, so --writers-file= is accepted as if the option were omitted instead of refusing a missing path. Validate the suffix before storing it.
	--writers-file=*) writers_file="${1#--writers-file=}"; shift ;;

lane-handoff:250

  • The --dir=* arm bypasses flag_value, so --dir= is accepted and later permits the command to fall back to the recorded/current checkout rather than refusing the missing path. Validate the suffix before assigning it.
	--dir=*) dir_flag="${1#--dir=}"; shift ;;

lane-handoff:269

  • The usage makes --at part of the --late --at <UTC> form, but this validation only rejects --late combined with restart/exit. A command such as lane-handoff --at 2026-... therefore performs a normal handoff and silently ignores the timestamp; reject any nonempty late_at unless do_late is set.
[ "$do_late" = 1 ] && { [ "$do_restart" = 1 ] || [ "$do_exit" = 1 ]; } &&
	die "--late is the record a swap never left, written from a shell BEFORE the relaunch: there is no session of this lane's to restart or exit. Write the late record first, then start the lane." 2

lane-handoff:20

  • This command synopsis still says the in-process kind tells the next session to “relaunch none,” but Addendum 1(j) explicitly removed action instructions from the kind. The generated top block now uses an expectation-only phrase, so update this source comment to describe that every writer survived and is expected to be live rather than prescribing an action.
#                                  every writer SURVIVED and to relaunch none

skills/handoff/SKILL.md:618

  • The skill reaches this unconditional respawn-pane -k without checking whether the object-log PAUSED write or the handoff refresh succeeded; row_write_refused only covers the register row. Thus /ctx can kill the pane while the new session has no PAUSED log entry or a stale/missing top block, contrary to the command's three-write gate. Track and require all three write results before this block, as the lane-handoff implementation does.
if command -v lane >/dev/null 2>&1; then
  tmux respawn-pane -k -t "$pane" "LANE_START_FRESH=1 lane $lane"
else
  tmux respawn-pane -k -t "$pane" "LANE_START_FRESH=1 pclaude --lane $lane ${CLAUDE_PROFILE_NAME:-<profile>}"

skills/handoff/SKILL.md:618

  • Unlike lane-handoff, this skill treats any lane found on PATH as this estate's command and hardcodes pclaude as the fallback. A foreign executable can therefore be run after the pane is killed, and a workstation that only has claude-profile loses the pane to a command-not-found failure. Apply the same provenance check and pclaude/claude-profile fallback before constructing the respawn command.
if command -v lane >/dev/null 2>&1; then
  tmux respawn-pane -k -t "$pane" "LANE_START_FRESH=1 lane $lane"
else
  tmux respawn-pane -k -t "$pane" "LANE_START_FRESH=1 pclaude --lane $lane ${CLAUDE_PROFILE_NAME:-<profile>}"
  • Files reviewed: 18/18 changed files
  • Comments generated: 4
  • Review effort level: Lite

Comment thread lane-handoff Resolved
Comment thread lane-start Resolved
Comment thread skills/handoff/SKILL.md Resolved
Comment thread skills/handoff/SKILL.md Resolved
…ion` the question that read answers — Copilot round 9

Two conformance gaps between the two halves of ONE act, which is the thing
Amendment 17(a) exists to prevent: `skills/handoff/SKILL.md` is `/handoff` and
`/ctx` for a session with no `lane-handoff` on `PATH`, so a fact the command
writes and the skill does not is a record whose shape depends on which door the
person came through.

* `skills/handoff/SKILL.md:476` — the skill's `PAUSED` payload carried Amendment
  17(b)'s two sub-fields and not Addendum 1 (h)'s `kind`. A record from the
  skill was therefore one no reader could tell a surviving writer from a dead
  one by, while the top block it writes in the same act states the kind. The
  payload gains `; kind <k>` and the line's free text gains the same word after
  the why — `clear in-process`, `clear respawn`, `kind unknown`.
* `skills/handoff/SKILL.md:612` — the `/ctx` respawn asked `window-session` with
  `#{window_id}` alone (`@21`). That read matches a live record on the
  HARNESS's own `tmux` field, `<session>:<@id>`, and the three spellings of one
  window are never derived from each other — `lane-start:975-984` says so and
  `lane-handoff` reads it that way. The skill's `/ctx` therefore found no
  record, left `$pane` empty, and respawned something that was not the lane's
  pane. It asks with `#{session_name}:#{window_id}` now.

Three cases in `tests/test_lane_helpers.sh` § "Amendment 17", beside the ones
that already hold the skill to the command's words.

DECLINED, from the same round: `lane-start:2177`, that `--agent claude` should
skip the recorded transcript. Amendment 17(c) is explicit the other way —
*"`claude` with its transcript here resumes by id exactly as Amendment 6 has
always done; every other case launches the named agent with the handoff's top
block as its first prompt"* — and the suite's `--agent claude with no
transcript here` case is the branch that takes a new session. `LANE_START_FRESH=1`
is the seam for *a new session even though the transcript is here*, and it is
what `/ctx` sets.

FILED: `lane-handoff:924`'s late-record race is #72's
kind and is noted there — the preflight reads the lane's last line before the
poll and the refresh, and a `RESUMED` appended in that window would be
overtaken by the `PAUSED` this writes.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
Copilot AI review requested due to automatic review settings September 15, 2026 01:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical and moderate issues remain in handoff validation, ordering, atomicity, launcher preflight, and skill behavior.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (13)

lane-handoff:691

  • The same cleanup function is installed for INT and TERM as for EXIT, but it only removes the snapshot and returns. Bash then continues the handoff after the signal with its writer snapshot gone, so an interrupted command can still refresh the handoff and write records with an empty/incomplete WRITERS section. Make the signal traps exit with their signal status and reserve the cleanup-only trap for EXIT.
cleanup() { [ -n "${writers_tmp:-}" ] && rm -f -- "$writers_tmp"; return 0; }
trap cleanup EXIT INT TERM

lane-handoff:643

  • The late-state check is completed before the append is locked. A normal session can append RESUMED after lane-last returns but before the later log PAUSED --utc call, allowing this late PAUSED to become the last state line of a running lane. The state validation and append need one serialized operation (or an equivalent recheck under the writer lock).
	# THE LANE'S LAST LANE-KIND LINE, read from the published log exactly as
	# every state reader reads it: FILE ORDER decides which is last.
	last_line=""; ll_rc=0
	last_line="$("$LANES_EDIT" lane-last "$lane" 2>/dev/null)" || ll_rc=$?

lane-handoff:815

  • Writing the new handoff with cat > truncates the existing file before the full content is available. If the write fails partway through (for example, a full filesystem or an I/O error), the old handoff is lost or left partial even though the refusal says it still carries the previous block. Build the replacement beside the target and install it atomically, or restore the original on every failed write.
			if cat -- "$hs_tmpd/out" > "$handoff_file"; then   # the redirect FOLLOWS the symlink

lane-handoff:434

  • @[0-9]* is only a prefix check, so a malformed tmux value such as @1garbage is accepted and persisted in the handoff payload. lane-start already requires @ followed only by digits (lane-start:1143-1147); use the same exact validation here so a bad shim or environment value is omitted rather than recorded as a window reference.
	wid="$(tmux display-message -p '#{window_id}' 2>/dev/null || :)"
	case "$wid" in @[0-9]*) : ;; *) wid="" ;; esac

lane-handoff:441

  • The fallback environment value is checked with the same prefix-only pattern, so WORKBENCHES_CLAUDE_WINDOW_ID=@1garbage is also written as if it were a valid tmux window id. Apply the exact digit-only validation used for the live tmux result here as well.
[ -n "$wid" ] || wid="${WORKBENCHES_CLAUDE_WINDOW_ID:-}"
case "$wid" in @[0-9]*) : ;; *) wid="" ;; esac

lane-handoff:321

  • This generated headline prescribes relaunch as part of the respawn kind. Amendment 17 Addendum 1(j) requires the kind to state only what to expect; the common WRITERS instruction and live count decide what to do. Remove the action from this headline so a respawn handoff does not reintroduce the forbidden instruction.
	kind_headline='expect none of the writers below live — count them, then relaunch from where each stands'

lane-handoff:949

  • When the object-log write fails, record_written remains 0 but this non-respawn path continues to the normal READY message and exits 0. The row may still be flipped, yet swapped, lane-agent, and the launcher cannot discover the PAUSED record from the missing object-log line, so the command reports a successful resumable handoff that is not actually recorded. Propagate a nonzero refusal (and an explicit repair instruction) for this incomplete record instead of treating the failure as informational.
	if LANES_LANE="$lane" LANES_SESSION="$uuid" "$LANES_EDIT" log PAUSED "lane:$lane" \
		'→' "$payload" "$why_text"; then
		record_written=1
		step "object log: PAUSED lane:$lane → $payload"
	else
		note "the PAUSED line was NOT written — the helper's own refusal is above. Write it before anything else:"
		note "  LANES_LANE=$lane LANES_SESSION=$uuid $LANES_EDIT log PAUSED lane:$lane '→' \"$payload\" \"$why_text\""
	fi

lane-handoff:566

  • The --agent and --transcript grammar checks run after the tmux window was renamed at lines 516–519. Thus lane-handoff --agent 'not a key' (or an invalid transcript) exits 2 but leaves the window renamed even though no handoff record is written, creating a partial identity update on a refused command. Validate these metadata values before renaming, or explicitly roll the rename back on refusal.
[ -n "$agent" ] || agent="${LANES_AGENT:-claude}"
case "$agent" in
*[!A-Za-z0-9._-]* | '') die "--agent takes a manifest key — letters, digits, '.', '_', '-' — and '$agent' is not one. The record's \`agent\` sub-field is what \`lane-start --agent\` reads back to know which launcher to use (Amendment 17(b))." 2 ;;
esac

lane-handoff:20

  • This header still documents the pre-Addendum-1 behavior, telling the next session to “relaunch none.” The ratified contract requires the top block to state expectations only (the implementation/tests use “expect every writer below live”); leaving this instruction here can mislead maintainers about the required handoff semantics. Please update the header to the expectation-only wording.
#                                  every writer SURVIVED and to relaunch none

lane-start:2244

  • An agent name that is valid syntax but absent from the launcher table reaches this refusal only after the window was renamed at lines 1762–1766. lane-start ... --agent <unknown-agent> therefore exits without writing the row/log/stamp or launching anything, but leaves the caller's window renamed to the lane. Perform the launcher-table/PATH preflight before the rename so a refused start has no partial identity change.
    *)
      die "this command has no launcher for the agent '$AGENT'. It knows: claude (resume by id where its transcript is here, else a named new session with the handoff's top block as its first prompt) and codex (the top block as its first prompt). A lane is resumed by an agent whose launch this command has been taught and tested — never by a guessed argv (Amendment 17(c))." 2 ;;

openRepoTools:106

  • The installer’s --help synopsis exposes only --restart and --exit, even though this command also has the public --in-process and --late --at <UTC> modes documented and tested in the same change. A user reading the installed help cannot discover the in-process or late-handoff acts.
  lane-handoff [--restart|--exit]  hand this lane off: the identity triple, the

skills/handoff/SKILL.md:66

  • canon_lane uses exit 2 to refuse a case-insensitive duplicate lane, but this fence collapses every exit 2 into an empty answer and continues through the fallback rungs. On a register containing two rows that differ only by case, /handoff can therefore bind the window to whichever later rung answers, then write a PAUSED record for it. Mirror lane-handoff's Amendment 15(d) handling here and relay the ambiguity instead of treating it as “no record.”
    8|2) sr_out="" ;;

skills/handoff/SKILL.md:485

  • For /ctx and /handoff --exit, the skill invokes this block with no assignment to kind; ${kind:-unknown} therefore writes kind unknown unless an undeclared shell variable happens to be injected. That contradicts commands/ctx.md, which requires these respawn paths to record kind respawn, and gives the next session the wrong writer expectation. Set the kind from the invocation before constructing the payload.
kind="${kind:-unknown}"       # in-process | respawn | unknown
  • Files reviewed: 18/18 changed files
  • Comments generated: 2
  • Review effort level: Lite

Comment thread lane-handoff Resolved
Comment thread skills/handoff/SKILL.md Resolved
Copilot AI review requested due to automatic review settings September 15, 2026 02:12
…y fresh row is the one it did not know — Copilot round 10

`| WORD ·` is a state cell with history after it and `| WORD |` is one with
none, and a fresh row from `add-row` is the second. The skill's parser knew
only the first, so for those rows `$state` was empty, `replace-in-row` had no
anchor, and `/handoff` through the skill left the lane RUNNING in the register
with its handoff already refreshed and its PAUSED line already written — the
one state this act exists to make impossible. `lane-handoff` has read both
shapes all along and keeps whichever punctuation the row carries; the skill
does the same now, including in the replacement it hands the writer.

Two cases in `tests/test_lane_helpers.sh` § "Amendment 17", beside this round's
other two.

The round's other finding — a multi-line `why` reaching `append-line` and the
top block before the event writer validates it — is #72's
finding 6, filed in round 4 and noted again there with what `append-line` adds
to it.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Unresolved moderate findings remain in cancellation handling, atomicity, option validation, ambiguity propagation, and handoff-kind assignment.

Review details

Suppressed comments (11)

AGENTS.md:242

  • This copy-pastable guard invokes flock unconditionally, but the repository explicitly supports macOS and documents that macOS has no flock (AGENTS.md:218-220); following this snippet there fails before pytest starts. Please point readers to tests/run.sh, which contains the portable flock/mkdir implementation, or reproduce that fallback instead of duplicating only the Linux branch.
flock "${TMPDIR:-/tmp}/openrepotools-pytest.lock" python3 -m pytest tests -q

docs/README-lanes.md:444

  • The documented manual command is not runnable on one of the supported platforms: macOS ships no flock, while this line invokes it unconditionally. Please use the canonical tests/run.sh entrypoint here, or include the same mkdir fallback it uses, so following the README does not fail before the suite begins.
flock "${TMPDIR:-/tmp}/openrepotools-pytest.lock" python3 -m pytest tests -q

lane-handoff:691

  • The INT and TERM traps only run cleanup and then return. This script is not using set -e, so an interrupt during polling can delete the writer snapshot and still fall through to the PAUSED write and pane action, potentially recording an empty WRITERS section or respawning after cancellation. Keep cleanup on EXIT and make the signal traps exit with the signal status after cleanup.
trap cleanup EXIT INT TERM

lane-handoff:663

  • The late-state check is performed before the later lanes-edit.sh log call acquires the writer lock. A concurrent lane-start can append RESUMED after this check but before the late PAUSED append, leaving PAUSED as the file's last lane-kind line and making a running lane appear paused. The last-line validation and append need one atomic compare-and-append operation (or an equivalent recheck under the write lock).
	if ! [ "$last_utc" '<' "$late_at" ]; then
		die "lane $lane's last lane-kind line is $last_verb at $last_utc, which is AT OR AFTER the $late_at this late record claims: the relaunch is already recorded, and this log is APPEND-ONLY, so a PAUSED appended now would be the lane's last line and would make a lane that is RUNNING read as paused. Nothing was written.
    The act, in order: run \`$prog --late --at <when the old session ended>\` from a SHELL, and only then start the lane (\`pclaude <profile>\`).
    Where the relaunch has already happened — which is this case — the honest record of the state that session now holds is its own next \`$prog\`." 2
	fi

lane-handoff:240

  • --at is parsed into late_at but is only consumed inside the later if [ "$do_late" = 1 ] branch. As a result, lane-handoff --at <UTC> ... silently performs a plain handoff and drops the timestamp instead of refusing an option that only has meaning for --late; add a post-parse guard (so either flag order works) requiring --late whenever --at is supplied.
	--at) late_at="$(flag_value --at "${2-}")"; shift 2 ;;
	--at=*) late_at="${1#--at=}"; shift ;;

lane-start:2093

  • Exit 2 is not always the legacy-helper "no answer" code: the current lane-agent calls canon_lane, which returns 2 when the published register has case-colliding rows. If the register changes between the earlier canonicalization and this read, treating that refusal as an empty agent makes lane-start default to Claude and continue instead of refusing the ambiguous lane. Propagate the ambiguity refusal; only exit 8 should select the default.
    8|2) RECORDED_AGENT="" ;;

lane-start:2145

  • This branch has the same ambiguity problem for the transcript read: lane-transcript re-canonicalizes the lane and returns 2 for case-colliding register rows, but 8|2) : treats that refusal as "no transcript". A register update between the earlier canonicalization and this call can therefore let a Codex launch proceed without the required refusal and attribution. Handle 2 as an ambiguity error and reserve the empty-transcript fallback for 8.
      8|2) : ;;

openRepoTools:106

  • The installer's command summary only advertises --restart and --exit, omitting the new --in-process and --late --at <UTC> handoff modes. A user reading the documented PATH interface therefore cannot discover two supported forms; include all supported options or direct readers to lane-handoff --help.
  lane-handoff [--restart|--exit]  hand this lane off: the identity triple, the

skills/handoff/SKILL.md:485

  • kind is never assigned before this fallback in the skill. The /ctx alias invokes this skill with --restart, and /handoff --exit uses the same procedure, so both flows leave kind empty and write kind unknown in the PAUSED payload/free text instead of the required kind respawn; the next session consequently gets the wrong expectation. Assign kind=respawn for the restart/exit paths (and kind=in-process only for an explicitly in-process clear) before constructing the payload.
kind="${kind:-unknown}"       # in-process | respawn | unknown

skills/handoff/SKILL.md:66

  • The handoff skill still collapses exit 2 into the old-helper/no-answer path. Current lanes-edit.sh uses exit 2 for canon_lane's case-colliding-register refusal, so window-lane can return 2 and this code will fall through to a swap record for a different lane before renaming the window and writing PAUSED. Preserve the legacy fall-through only when the helper actually reports an unknown subcommand; otherwise relay the ambiguity refusal as lane-handoff does.
    8|2) sr_out="" ;;

tests/test_lane_helpers.sh:7470

  • The test description contains the typo hand-on; it should say handoff so the assertion text matches the handoff terminology used by the command and protocol.
has   "…still with the FRESH seam, which rides in the environment and survives the hand-on to lane-start" \
  • Files reviewed: 18/18 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@brettheap
brettheap merged commit fcccbe0 into main Sep 15, 2026
7 checks passed
@brettheap
brettheap deleted the feat/amendment-17-handoff-ctx branch September 15, 2026 02:41
brettheap added a commit that referenced this pull request Sep 15, 2026
…sub-fields, tests/run.sh) -- one usage-list conflict, both sides' new subcommands kept

fcccbe0 lands a large, unrelated feature (lane-handoff on PATH, /handoff with
/swap and /lane-swap as aliases, /ctx, lane-start --agent, four new
lanes-edit.sh subcommands -- lane-agent, lane-transcript, lane-last,
workspace-root) and does not touch lane-end at all. The only conflict was
the dispatcher's "unknown subcommand" usage list in lanes-edit.sh, where both
branches added their own new names to the same line; resolved by keeping
both sets (main's four Amendment 17 reads alongside this PR's own
duplicate-holder). docs/README-lanes.md and tests/test_lane_helpers.sh --
the latter +1000 lines on main's side alone -- merged with no conflict at
all; spot-checked afterward that this PR's own repoL-1..4 fixtures, the
AMBIG multi-child test, and lane-end's dup_other fix are all still intact.

tests/run.sh is main's new locked suite entry point (#51:
four lanes running python3 -m pytest at once one evening, past a guard that
had been hand-copied into four briefs and never actually worked -- `grep`'s
own status is 1 with stdout on /dev/null even on a match under this harness).
Used in place of this branch's own hand-rolled flock/pgrep recipe from here on.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
brettheap added a commit that referenced this pull request Sep 15, 2026
…`/handoff` skill and its two command files, and the installer's TWENTY-SIX artifacts): six conflicts, and every one of them a list where `restart` leaves and `lane` stays

The fourth merge of `origin/main` into this branch, and the one that touches the
most of it: #47 adds a TWELFTH file to `INSTALLABLES`, a THIRD skill, TWO more
command files and a suite section of its own, in the same four lists Amendment
18 Addendum 2 takes `restart` out of.

THE SIX, and what each resolution is:

1. **`README.md`** — theirs, with the word changed: TWELVE files, and `lane`
   where their line says `restart`. The paragraph under it already said TWELVE.
2. **`openRepoTools`, the header inventory** — theirs, with `lane` named as
   `restart`'s replacement and Addendum 2 cited for why; their `lane-handoff`,
   three skills, three command files and twenty-six artifacts all kept.
3. **`openRepoTools`, `INSTALLABLES`** — the UNION and still TWELVE: `restart`
   out, `lane` in its place, `lane-handoff` beside it. One word left as another
   arrived, which is why the count did not move for Addendum 2 and moved by one
   for Amendment 17.
4. **`openRepoTools`, the artifact paragraph** — theirs (twenty-six, and the
   history of how it got there), with the one sentence naming `restart` as the
   second word on PATH rewritten to name both: *"`restart` then, `lane` since
   Amendment 18 Addendum 2 retired that one"*.
5. **`openRepoTools`, `SKILLS`** — theirs (`handoff lane-swap restart`), with
   the comment above it saying what the `/restart` skill is the inside half OF,
   now that the outside half is `lane <name>`.
6. **`skills/lane-swap/SKILL.md`** — THEIRS WHOLE. #47 replaces that skill's 495
   lines with a 26-line ALIAS naming `/handoff`, which is Amendment 17(a)'s own
   act; this branch's edit to the old file was one sentence about the retired
   CLI, and the file it was in no longer exists in that form. Nothing is lost:
   the new `skills/handoff/SKILL.md` already says it, in `main`'s own words —
   *"**The respawn line is `lane <lane>` and never `restart <lane>`**
   (Amendment 18 Addendum 2, in force)"*.
7. **`tests/test_openrepotools_command.py`, `INSTALLED`** — the same union as
   `INSTALLABLES`, twelve entries, with the note that `lane` is `restart`'s
   place and `lane-handoff` is what makes it twelve.
8. **`tests/test_lane_helpers.sh`** — BOTH SECTIONS, THEIRS FIRST. Amendment 17's
   935 lines and Addendum 1's 963 were inserted at the same anchor, immediately
   before `== the workstation seam ==`; the section that landed on `main` keeps
   the position it landed in, which is how the #41 merge resolved this same
   collision.

WHAT NEEDED NO RESOLUTION AND IS WORTH SAYING: the CI parse list in
`.github/workflows/tests.yml` merged to `lane` AND `lane-handoff` with no
`restart`, and `lane-start` — which both sides rewrite, this branch at its bare
form and #47 at `--agent` and the transcript move — merged clean.

Measured on the merged tree, through `tests/run.sh` (#51's runner, which is the
lock now):

    tests/run.sh   654 passed, 1 failed in 2129 s (35:29), and the shell suite
                   inside it 2345 passed, 2 failed — TWO cases, and NEITHER is
                   this merge's code:

  * `…quoted the way the shell reads it back` was THIS BRANCH'S OWN CASE pinning
    one spelling of a correct quoting. #47 replaced `lane-start`'s `quoted` — it
    was `printf '%q '`, rendering `team\ blue`, and is now a POSIX single-quote
    loop rendering `'team blue'`. Both are one word when a shell reads them
    back, which is the contract; the case asserts THAT now, accepts either
    spelling, still refuses the bare form, and proves the one-word property of
    both spellings in the same line. FIXED IN THIS COMMIT.
  * `one lane read alone is the same row the estate listing gives it` compares
    two `lanes` reads byte for byte, and one of the twelve fields is an AGE IN
    WHOLE MINUTES: `64h 49m` against `64h 48m`. It is on `main` and nothing here
    touches that read; a 35-minute run on a workstation building several lanes
    at once crossed a minute between the two. Filed as
    #75 and claimed by this lane, with the two-line fix
    named — compare the row without the column that is a function of the wall
    clock.

Lane: openrepotools-3 (openRepoTools-3)

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_019UFwD7bCS73jaUMJ2vuo5m
brettheap added a commit that referenced this pull request Sep 15, 2026
… as well as its write, an untracked target log is a peer's work and is skipped, and the cut flattens a newline

THREE FINDINGS: two accepted, one half-declined with the code that already
refuses it.

* **The scan and the write were two different moments.** The act read every
  row's LINE NUMBER and cell, and then rewrote those lines BY NUMBER — with the
  mutex taken between the two. A peer's `add-row` or `replace-in-row` landing in
  this checkout in that window moves the lines under it, and `replace_line`
  then rewrites the wrong row: its one-line proof holds for the line it was
  given, not for the row a person meant. The lock and the register's capture now
  come BEFORE the scan, so what is read is what is committed. THE DRY RUN TAKES
  NO LOCK: it writes nothing, and a read that holds the estate's one register
  mutex for the seconds this scan takes is a read that blocks every lane's write
  to say what it would have done.

* **An untracked target log is somebody's uncommitted work.** A TRACKED log that
  is dirty was already refused for the whole run — `refuse_dirty_checkout`
  exempts the register alone and `tracked_dirty` reads staged and unstaged alike
  — but an untracked file is in neither list, and appending to it here would put
  a peer's first lines into this migration's one commit under this migration's
  message. That row is now SKIPPED and the file named, as the other five reasons
  are, and its cell keeps every character, so a re-run after the peer commits
  migrates exactly it.

* **The cut flattens CR and LF.** It is the fourth thing `set-row-state`
  refuses, beside ` · `, `|` and the 240-character cap: a row is ONE line of a
  table, so a newline in its text would split it in two and every row after it
  would be read as a lane. The register write was already fail-CLOSED on it (the
  writer refuses), which cost the row its state rather than corrupting it; now
  the caller spells it `; ` and the row is written. The OTHER half of that
  finding — `lane-handoff`'s free-form `--why` reaching `append-line`, whose
  one-line proof fails AFTER the append — predates this PR (it came with #47's
  `lane-handoff`, whose `sanitize` replaces ` — ` and nothing else) and is filed
  rather than fixed inside a diff about the state cell.

Tests: the cut flattening a newline; a row whose object log is untracked skipped
and named, then migrated once the peer commits it. The Amendment 13 section: 200
passed, 0 failed.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
brettheap added a commit that referenced this pull request Sep 15, 2026
…its diary moves to the lane's own log — `set-row-state`, `NOTED`/`RULED`, `history`, `migrate-state-cells`; `append-row-status` retired (#82)

* The register row says where a lane IS in one line a person can read, and its diary moves to the lane's own log (Amendment 13)

The `state` column was defined as a cell and used as a diary. Measured on Eagle
the day the amendment was drafted: `lanes/LANES.md` was 1,141,283 bytes over 46
rows, its longest row 96,228 characters, and one lane's cell 7,016 characters
after ONE day — three different things in one column (the lane's CURRENT state,
which Rule 6 reads; a running narrative; and rulings quoted verbatim), appended
for ever with ` · `, never replaced, in a table nobody can read in the table.
Re-measured on 2026-09-15, before this: 1,335,595 bytes over 52 rows.

lane-collision-protocol Amendment 13, in force 2026-09-13T21:08:36Z on Brett
Heap's word "Ratify as drafted (Recommended)", with O1, O2 and O3 as
recommended. This is its tooling, #29.

**(a) The cell is ONE PHRASE, replaced on every write.**
`lanes-edit.sh set-row-state <lane> "<STATE> · <one line>"` stamps the UTC
itself and REPLACES the cell. STATE is one of LIVE, PAUSED, LANDING #<n>,
LANDED, ENDED, RETIRED, HANDED OFF — Rule 6's reading of the cell is unchanged
and is now the whole of what the cell says at that moment. The line is at most
240 characters (ratified decision O1) and carries neither a `|` nor a second
` · `. `append-row-status` is RETIRED and refuses, naming `set-row-state` for
the state and `log NOTED` / `log RULED` for the narrative, so the cell can never
grow again — because the act that grew it is gone, not because every caller
remembered.

WHICH TEXT IS THE STATE CELL is decided by splitting the row on ` | `: a
seven-column row has exactly six separators, and then the two readings of the
row — six from the left, the last cell from the right — are the same text. A row
with more carries a ` | ` inside a cell, the two readings disagree about which
text to overwrite, and it is REFUSED by name rather than written at a guess. Of
the live register's 52 rows, 50 split cleanly.

**(b) The narrative goes to the lane's own log**, under two new Amendment 7
verbs: `NOTED` (a status note) and `RULED` (a ruling, verbatim, with the object
it bears on as its payload — canonicalised through `repos.tsv` like every other
object this tooling writes). Both are lane-kind lines whose object is the lane.
NEITHER IS A TRANSITION, so no reader's state moves because one was written:
`who`, `lane-end` and `lanes` take a whitelist of the five lane verbs already,
and `swapped_candidates` — the one reader that took a lane's last lane-kind line
whatever its verb — skips the two by name. Without that, a lane that noted
anything after its swap would have vanished from `swapped`, which is what
`restart` reads to find the lane whose window name a new tmux session has lost.

**(4) `lanes-edit.sh history <lane> [--since <UTC>]`** prints them in FILE order
(R14), which is the diary the cell used to be; 8 for a lane that has written
none, 64 for a caller's bad arguments.

**(e) `lanes-edit.sh migrate-state-cells`** — the ONE act, a DRY RUN unless
`--yes`. Per row it splits the cell on ` · `, writes `RULED` for an entry
beginning RULING/RULINGS/RATIFIED and `NOTED` for the rest, takes the UTC from
the entry's own leading timestamp (the row's `started` where it has none), the
session from the LAST uuid of the row's session cell and the workstation from
the row's own column; then replaces the cell with the state the last entry's
leading verb names, else `MIGRATED`. ONE commit carries the archive
`lanes/archive/LANES-pre-amendment-13-<UTC>.md`, every log it appended to and
the register, so the narrative exists three times over. It REFUSES when no cell
holds a ` · ` entry it can take, and a row it cannot take is SKIPPED and NAMED,
its cell untouched, so a re-run after that row is settled migrates exactly it.

Measured on a COPY of the live register (the act is Brett Heap's to run, on his
word, after this is installed on both workstations — O3): 52 rows read, 20
migrated, 28 already one phrase, 4 skipped; 2,206 lines (2,158 NOTED, 48 RULED)
into 20 logs; 782,465 characters of state cell become 1,495; one commit of 22
files; 1,336,371 bytes of register become 555,401.

THE CALLERS ALL MOVE, because a retired verb with a caller is a broken command:
`lane-start`'s Amendment 6(c) stamp, `add-row`'s brand-new row (born in the
phrase rather than opening with the bare word `STARTING`), `lane-end`'s closing
write — which now carries `RETIRED` itself, so `--retire`'s second write and the
`--state-was` anchor it needed are gone — `lane-handoff`'s swap (one write where
it made two guesses at a cell that was a history), the `/handoff` skill, and the
name guard's MOVED marker.

Two measurements decided details that are not obvious from the amendment:

* `${row#"$body"}` — removing a literal prefix — walks every prefix length in
  turn, so splitting one 90,751-character row cost ELEVEN SECONDS, and a dry run
  of the migration ninety-four. `${row:${#body}}` is linear and the same answer:
  5 seconds for the whole register.
* A line cut with `${s:0:n}` can land INSIDE a character, because that counts
  BYTES wherever the locale is not a UTF-8 one — and these lines are full of
  `—`, `·` and `→`. Every caller cuts back to the last space, which takes the
  fragment with it.

Tests: a new section in `tests/test_lane_helpers.sh` for each act, the migration
on its own seeded workspace (it rewrites every row of the register it is pointed
at, so it may not be pointed at the suite's own). The cases that asserted the
old shape are re-pointed, and the two that asserted the PATHOLOGY — a row
carrying one uuid three times because every stamp was appended — now assert the
two it carries, which is still not one, which is why the session-cell append
stays cell-scoped.

Docs: `docs/README-lanes.md` gains "The row is current state; the log is
history (Amendment 13)" and its writer lists, row-format paragraph, `lane-start`
step 5 and `lane-end` paragraph follow.

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

* Copilot round 1 on #82: the cut fixes the three things set-row-state refuses, lane-end reads the phrase's STATE and not its prose, LANDING #<n> ends where the word does, the staging goes, and a one-word cell is not "already the phrase"

FIVE FINDINGS, ALL ACCEPTED.

* **lane-end read the WHOLE cell for a merge hold.** The one path that still
  decides a hold from words — a lane with no object log — scanned every
  character of the state cell, so an Amendment 13 phrase whose LINE says
  "waiting for LANDING #7" was a false hold and the lane could not be closed.
  The line is PROSE; the STATE is where the lane is. A cell whose second ` · `
  field is exactly an instant is the phrase and only its state part is scanned;
  a legacy diary cell is unchanged and still scanned whole. Both readings of the
  row — this checkout's and the published one — take it.

* **A `|` in a launch flag or a directory reached `set-row-state`**, whose
  contract refuses every pipe, so a normal start would rename the window and
  then fail to stamp the row. The shared cut now fixes ALL THREE things that
  writer refuses — ` · ` spelled `; `, `|` spelled `¦`, and the 240-character
  cap — so no caller has to remember any of them, and the three copies stay
  byte-identical under the hygiene test that holds them together.

* **`LANDING #123abc` derived the state `LANDING #123`** — a merge hold Rule 6
  would read, out of an entry that names no PR at all. The number now ends where
  the word ends, exactly as `state_word_is_valid` bounds the other six.

* **The staging directories were never removed.** `append_text_block` allocated
  one per lane (a whole copy of that log) and `migrate_state_cells` one per run,
  and a DRY RUN left them behind while reporting that nothing was written — on
  the live register that is twenty copies a run. Both are removed where their
  work is done; a refusal still keeps them, as every other refused write here
  does, because a refused write is evidence.

* **A one-word cell is not "already the phrase".** `ACTIVE` and `LIVE` have no
  diary to move, so this act leaves them alone — but they are NOT
  `<STATE> · <UTC> · <one line>`, and reporting them together with the cells
  that are said the register was compliant when a third of it is not. The two
  are counted and reported apart, with the sentence that says what the one-word
  cells still owe: the next set-row-state on each lane writes it.

Tests: the shared cut as a unit (the broken bar, the word-boundary cut, the
marker); `lane-end` on a phrase whose line mentions a landing, on a phrase whose
STATE is one, and on a legacy diary cell; the migration's sixth row, whose
`LANDING #123abc` derives no landing; the report's two counts; and the dry run
leaving no staging directory behind. The Amendment 13 section: 196 passed, 0
failed.

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

* …and the description's backticks are escaped, which is the suite's own rule and its own test

`test_the_suite_descriptions_run_no_command_of_their_own` caught one line of the
round-1 tests: a description reading "…and `LANDING #123abc` derives no landing"
is a description bash runs `LANDING #123abc` inside, leaving a hole where those
words were. The rule is one file over and the test is what holds it; this is the
escape it asks for.

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

* Copilot round 2 on #82: the migration holds the mutex across its scan as well as its write, an untracked target log is a peer's work and is skipped, and the cut flattens a newline

THREE FINDINGS: two accepted, one half-declined with the code that already
refuses it.

* **The scan and the write were two different moments.** The act read every
  row's LINE NUMBER and cell, and then rewrote those lines BY NUMBER — with the
  mutex taken between the two. A peer's `add-row` or `replace-in-row` landing in
  this checkout in that window moves the lines under it, and `replace_line`
  then rewrites the wrong row: its one-line proof holds for the line it was
  given, not for the row a person meant. The lock and the register's capture now
  come BEFORE the scan, so what is read is what is committed. THE DRY RUN TAKES
  NO LOCK: it writes nothing, and a read that holds the estate's one register
  mutex for the seconds this scan takes is a read that blocks every lane's write
  to say what it would have done.

* **An untracked target log is somebody's uncommitted work.** A TRACKED log that
  is dirty was already refused for the whole run — `refuse_dirty_checkout`
  exempts the register alone and `tracked_dirty` reads staged and unstaged alike
  — but an untracked file is in neither list, and appending to it here would put
  a peer's first lines into this migration's one commit under this migration's
  message. That row is now SKIPPED and the file named, as the other five reasons
  are, and its cell keeps every character, so a re-run after the peer commits
  migrates exactly it.

* **The cut flattens CR and LF.** It is the fourth thing `set-row-state`
  refuses, beside ` · `, `|` and the 240-character cap: a row is ONE line of a
  table, so a newline in its text would split it in two and every row after it
  would be read as a lane. The register write was already fail-CLOSED on it (the
  writer refuses), which cost the row its state rather than corrupting it; now
  the caller spells it `; ` and the row is written. The OTHER half of that
  finding — `lane-handoff`'s free-form `--why` reaching `append-line`, whose
  one-line proof fails AFTER the append — predates this PR (it came with #47's
  `lane-handoff`, whose `sanitize` replaces ` — ` and nothing else) and is filed
  rather than fixed inside a diff about the state cell.

Tests: the cut flattening a newline; a row whose object log is untracked skipped
and named, then migrated once the peer commits it. The Amendment 13 section: 200
passed, 0 failed.

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

* …and the hygiene test follows the cut it pins: the substitutions run on $ctl now that CR and LF go first, and the newline is pinned too

The test I added in the same breath as the block is what caught the refactor — it
asserted `${1// · /; }` and the block spells it `${ctl// · /; }`, because the
CR/LF flattening now runs before it. That is the test doing its job one round
early; the assertions name the four substitutions as they are, newline included.

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

* Copilot round 4 on #82: narrowing the in-flight scan takes BOTH fields, and the /handoff skill's copy of the cut carries all four substitutions

TWO FINDINGS, BOTH ACCEPTED, and both are the same shape: a check that was
weaker than the rule it stands for.

* **`cell_for_scan` tested only the second field.** A cell whose second ` · `
  entry is nothing but a timestamp — `ACTIVE · 2026-09-12T10:00:00Z · LANDING
  #7` — has the phrase's SHAPE and none of its meaning, and narrowing the scan
  to `ACTIVE` there would CLOSE a pre-cutover lane holding an open landing.
  Narrowing is the fail-OPEN direction, so it is now taken only where the cell
  is certainly the phrase: the first field one of Amendment 13(a)'s seven states
  (or `MIGRATED`, which the migration writes and which holds nothing), the
  second exactly an instant, and a third part after it — which is
  `mig_cell_is_phrase`'s rule in `lanes-edit.sh`, said again where `lane-end`
  needs it.

* **The `/handoff` skill's copy of the cut had two of the four substitutions.**
  It is the same act as `lane-handoff` under one name (Amendment 17(a)), so it
  writes the state cell too, and a copy that drops one is a line the writer
  refuses exactly where the command's line is accepted. It now carries CR and LF
  beside ` · ` and `|`, and a hygiene test pins all four in the skill as well as
  in the three commands.

Tests: a diary cell whose second entry is only an instant still holds its lane
(exit 2, naming the landing), beside the three cases from round 1 — a phrase
whose LINE mentions a landing ends the lane, a phrase whose STATE is one
refuses, and a legacy diary is scanned whole. The Amendment 13 section: 202
passed, 0 failed.

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

* tests-macos on 4df80b6: an unescaped { in a BRE is undefined, and BSD sed answers nothing — the cut's unit test extracted no function at all

THE SHIPPED FUNCTION WAS NEVER THE PROBLEM, and the same job proves it: every
assertion about `lane-start`'s own row stamp passed on macOS, which is
`cut_to_line` running inside it. What failed was the TEST's extraction —
`sed -n "/^cut_to_line() {/,/^}/p"`, whose address carries an unescaped `{`.
POSIX leaves that undefined outside an interval; GNU sed reads it literally and
BSD sed answers NOTHING, so the `eval` defined no function, all three cases
came back empty, and TWO OF THEM PASSED VACUOUSLY against the empty string (a
zero-length line is "inside the cap" and carries no half character).

The address drops the brace — the function's own line is unique without it — and
the comment says why, so the next person writing a unit test of a shipped
function does not put a brace in a BRE again.

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

* Copilot round 5 on #82: the cell is written before the stamp that names it, a note names ITS OWN lane, and three lines that are built rather than passed are bounded like the ones that are

FIVE FINDINGS: four accepted, one accepted in its ordering half and declined in
its consequence, with the rule that decides it.

* **`cell_for_scan` accepted a fourth part and an empty third.** `LIVE · <UTC> ·
  a note · <UTC> LANDING #7` has the phrase's first two fields and a HISTORY
  after them; narrowing the scan to `LIVE` there would close a lane over the
  landing in that history. It now mirrors `mig_cell_is_phrase` to the letter —
  exactly three parts, the third not empty, the first a state, the second an
  instant — and narrowing stays the fail-OPEN direction it is taken in only when
  the cell is certainly the phrase.

* **A `NOTED`/`RULED` could name another lane.** `is_lane_object` reads the
  `lane:` prefix and nothing more, so `LANES_LANE=repoA … log NOTED lane:repoB`
  wrote a line into repoA's log whose object named repoB — a note about a lane
  in a file that is not its log, which `history repoB` would never show. Clause
  (b) is explicit that these are "lane-kind lines whose object is the lane
  itself", so the object is now compared with `lane:$lane`, case-insensitively
  (Amendment 15). The five OLDER lane verbs keep the old laxity: changing them
  is a change to Amendment 7's writers and not to the state cell.

* **Two lines that are BUILT rather than passed were unbounded.** The migrated
  cell carries `history in lanes/log/<lane>.md`, whose length is the lane's
  name — `check_lane_name` bounds a name's characters, not its length — and the
  guard's MOVED marker carried the destination lane's name TWICE. Both are cut
  at 230 back to the last space now, the same rule `cut_to_line` applies in the
  three commands, so neither can build a line `set-row-state` would refuse: one
  after the migration has read every row, the other after the window has already
  moved.

* **The stamp was written before the session cell it names** on the `new_sid`
  path. ACCEPTED as an ORDERING defect and fixed: Amendment 8's rule is THE CELL
  FIRST, THEN THE STAMP, said in those words above the harness path one branch
  up, and this path did the opposite. DECLINED as a resume hazard, which is what
  the finding claims: the resume target is the SESSION CELL and nothing else
  (Amendment 6(b)), read from the PUBLISHED row — so a refused append left the
  next start resuming the id the register knew, never a wrong conversation, and
  the refusal already printed the act that cures it. What it left was a row
  saying two things a reader had to reconcile; in this order the common path
  says one.

Tests: a cell with a fourth part still holds its lane; a NOTED naming another
lane is refused and writes nothing to that lane's log; a lane whose name alone
overruns the cap still migrates, with its line inside 240 and marked cut; and
the session-cell commit is asserted as the one BEFORE the stamp, with the stamp
naming the same id. The Amendment 13 section: 211 passed, 0 failed.

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

* tests-windows on 21e86c0: `grep` and an awk `\|` on one line is what the GNU-only guard reads as a BRE alternation

`test_no_shipped_bash_reaches_for_gnu_only_utilities_unaccompanied` is a LINE
test, deliberately: it cannot tell whose regex a `\|` belongs to, and the thing
it exists to catch — an alternation handed to `grep` or `sed`, which BSD
matches LITERALLY and reports no error for — is worth the false positive. The
`\|` on that line was awk's own escape inside an ERE and never reached `grep`.

The row is taken first and the awk that splits it runs on its own line, so
neither line carries both. Same assertions, same values.

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

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants