Repository navigation
Description
What happens
lane-handoff reads the lane's lifecycle through a pipeline that can die of SIGPIPE.
- The pipeline:
lane-handoff:1490-1491and:1505-1506at670a852pipelanes-edit.sh lane-state "$lane"intoawk -F"\t" '$1 == "state" { print $2; exit }', and the second one into the same filter foroperation. - The race: the script runs under
set -uo pipefail(lane-handoff:120).awkexits as soon as it has printed its one field. Iflanes-edit.shwrites again after that, the write gets SIGPIPE,lanes-edit.shdies with 141, and underpipefailthe whole substitution's status is 141. - What the handoff does then:
case "$lcb_rc" in 0 | 8)takes 141 as a failed read. The handoff prints "the lane lifecycle could not be read (… lane-state …exited 141), so this handoff records no RUNNING -> SWAPPING -> SWAPPED transition", and returns from the lifecycle block. It records no fence, takes no inventory, and makes no transition. - It fails safe: the swap still goes on, and the lane is read later as a lane with no recorded swap.
- But it is wrong, and it depends on timing alone. The read did not fail: the reader stopped listening.
How it was found
- The run: CI run 39322387035, on lane 3's prefix
lane3-queue/q5c-228t025-on-q4e(quickstart.md has been run and its three wrong passages fixed, the 006 docs cite the tests where they now sit, and the partial-stamp example is the line stamp_read prints (#228) #270, docs only, on top of The record tells the truth about releases: the v1.0.0 notes are in the repository, the v1.1.0 notes are drafted, and README says what a release is, what --version prints and what a workstation with pipx's link sees (#228, PR 4 of 4) #269). - The failure: 1 failed, 2742 passed, in
tests/test_triad_lane_tooling_handoff.py::test_t018_the_handoff_reports_a_leg_git_cannot_read_as_the_sweep_counts_it(:600→:553).- The handoff's stderr says
… lanes-edit.sh lane-state triad-1exited 141. - So the expected line, "the worktree inventory entry for … was NOT written: the assembly has 1 unreadable leg(s) …", is never printed.
- The handoff's stderr says
- It is intermittent: the same test passed on the same code one prefix down (q4e, run 39322369835) and in every run before it.
- The runner image was the one that started rolling out on 2026-10-19 (
ubuntu-latestmoving to Ubuntu 26, git 2.55.0). It may change the timing, but not the cause.
Where else
The same shape occurs elsewhere: a command whose output is read by a consumer that stops early (awk … exit, head -1), under pipefail. At 670a852, by grep:
lane-handoff: 32| awk … exit }pipelines and 2| head -1;lanes-edit.sh: 18 and 27;lane-start: 19 and 1;lane-end: 0 and 1.
Only the ones whose producer writes in several pieces can race. A producer that writes its whole output in one write finishes before the reader exits.
The fix
- For the lifecycle reads, read the whole output first, then parse it:
lcb_raw="$(… lane-state "$lane" 2>/dev/null)" || lcb_rc=$?, thenawkonprintf '%s\n' "$lcb_raw". The read's status is then the producer's own, and nothing can end the producer early. - For the other sites, audit each pipeline fed by a command. Do the same where the producer can write after the consumer exits, and leave the rest.
- Test it deterministically: a
lane-statethat prints thestateline, then writes again after a short pause, makes the old pipeline exit 141 every time.
Why now
Every PR's tests job runs the T018 test, so the race can turn any PR's CI red at random. It can also flake the candidate suites of the triad migration's rehearsal (#186). Lane openRepoTools-3, which owns the lane tooling, is fixing it now, to land before the rehearsal's freeze.
Lane: openRepoTools-3
🤖 Generated with Claude Code
Activity
brettheap commentedon Oct 19, 2026
CLAIMED — lane openRepoTools-3, session 83619980-06bb-4469-ae73-2a8c5e61981a@Eagle, 2026-10-19T22:42:17Z, for #280
Logged in
lanes/log/openRepoTools-3.mdat28b38c12debd47140496fb16081dcf979d53736c.The three reads (lane-collision-protocol Rule 1):
brettheap commentedon Oct 20, 2026
Lane openRepoTools-3, 2026-10-20T00:5xZ: a correction to this issue, the fix's state, and a follow-up.
ubuntu-24.0420261012.334.1, which is Ubuntu 24.04.5./usr/bin/awkat a higher priority than mawk.awk … exitcloses the pipe whilelanes-edit.shis still writing. That is the race.fc061fe, onfix/280-lane-state-sigpipe. It readslane-statewhole, takes the status from it alone, and then parses the value.lane-start, which runs underset -euo pipefail. In a few sites a 141 ends it with no message. At:2156, a 141 takes the minted-transcript branch for a session that is already recorded.lanes-edit.shhas nopipefail, and none oflane-end's sites can race.Lane: openRepoTools-3
lane-handoff reads the lane lifecycle whole and parses it afterwards,…
brettheap commentedon Oct 20, 2026
RELEASED — lane openRepoTools-3, session 83619980-06bb-4469-ae73-2a8c5e61981a@Eagle, 2026-10-20T03:44:03Z, for #280 — #283 landed as 677acc0 and closed #280
The v1.1.0 notes take lane 3's review of #293, put #209 in the lane a…
The v1.1.0 notes now say that the fixes for #255 and #280 are part of…
Case 6's comment on #280's race says the two red runs ran on ubuntu-2…