Skip to content

append-line proves its one line AFTER writing it, so a lane-handoff --why carrying a newline corrupts LANES.md and leaves the checkout dirty #85

Closed

Description

@brettheap

Lane: openrepotools-3 (openRepoTools-3) — found by Copilot round 2 on #82 and filed rather than fixed there, because it predates that PR and belongs to lane-handoff, not to the state cell.

The defect

lane-handoff takes a free-form --why and passes it through sanitize, which replaces — with ; and nothing else (lane-handoff, sanitize()). A --why carrying a NEWLINE then reaches two writers:

  • lanes-edit.sh log PAUSED … "$why_text" — refused, and correctly: write_event checks [$'\n\r'] in the payload and the free text and dies 2 before the lock, before anything is created. Fail-closed.
  • "$LANES_EDIT" append-line "PAUSED — lane $lane, session …; $why_text; handoff refreshed" — not refused. append_text_line appends with >> and only THEN proves that the file grew by exactly one line. A newline in the text makes that proof fail AFTER the write: the register is left carrying two physical lines where one was meant, the checkout is dirty, and every later lanes-edit.sh in it refuses for the dirty file (unstaged tracked change — so the race cannot be run safely here), which is the shape A9 Addendum 4 measured 48 times in one macOS transcript.

The same why also reaches the handoff file's own Rule 3 block, where a newline is harmless.

Why it is not fixed in #82

That PR is Amendment 13's tooling: the state cell, the two narrative verbs, history and the migration. Its own writer refuses a newline (row_state_check), and its shared cut_to_line now flattens CR/LF so the row is written rather than refused — but append-line and --why are lane-handoff's, landed with #47, and a fix there is a change to the file-level Rule 6 writer that every lane reads.

The act

Two candidates, and the second is the one this repository's own guards argue for:

  1. sanitize flattens CR/LF as well as —, in lane-handoff and in the /handoff skill's copy of it (they are the same steps under one name, Amendment 17(a)).
  2. append_text_line REFUSES a newline in the text BEFORE it appends, the way write_event already does for the log — one gate in the writer rather than one per caller, which is the reason this file gives for putting the container guard at the dispatcher: "nine copies of one rule is how eight of them would come to disagree". Every caller of append-line gets it, including the /handoff skill's own and lane-end's Rule 6 lines.

Both, most likely: the writer refuses, and the caller spells the newline ; so that the act still happens.

Test: lane-handoff --why "$(printf 'a\nb')" leaves lanes/LANES.md with exactly one appended line and the checkout clean, and append-line refuses a text carrying a newline with nothing written.

🤖 Generated with Claude Code

Activity

  1. brettheap commented on Sep 15, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoTools-3, session 4135b2c9-34a6-47e3-a156-5adebb632fae@Eagle, 2026-09-15T15:03:12Z, for #85

    Logged in lanes/log/openRepoTools-3.md at 0a49a1cb1ae197a74a5c7c2ef75fbf8649b6f335.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoTools#85:
       none
    2. `gh pr list --repo opensoft/openRepoTools --state all --search "#85"`, kept where the row or its body names `#85`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoTools` branches naming `85` as a whole token:
       none
    
  2. brettheap commented on Oct 11, 2026

    @brettheap
    ContributorAuthor

    TAKEOVERopenRepoTools-3 — lane openRepoTools-5, session 0d83dca2-c18c-4bb0-99ce-896e6cafea02@Eagle, 2026-10-11T16:58:51Z, for #85

    Logged in lanes/log/openRepoTools-5.md at 4991f302115ab6c6cf0212a3eff003f4ecd50af7 (takeover of the stale claim held by lane openRepoTools-3).

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoTools#85:
    6:CLAIMED — lane openRepoTools-3, session 4135b2c9-34a6-47e3-a156-5adebb632fae@Eagle, 2026-09-15T15:03:12Z, for opensoft/openRepoTools#85
    13:1. existing `CLAIMED —` comments on opensoft/openRepoTools#85:
    2. `gh pr list --repo opensoft/openRepoTools --state all --search "#85"`, kept where the row or its body names `#85`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoTools` branches naming `85` as a whole token:
       none
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions