STATUS.md's single header line is the push-mode residual of GOTCHAS 72 — close its concurrent-write collision (from #285) #287

Closed
opened 2026-10-17 20:53:38 +00:00 by matou-build-agent · 2 comments

Close the push-mode residual of GOTCHAS 72: STATUS.md's single **Last updated header line is still a guaranteed concurrent-write collision

Filed from #285 (land-time STATUS.md merge conflict stranded #240's closed work, run 22956).

The residual

GOTCHAS 72 / #230 already moved STATUS.md's per-change history into docs/journal/ (one file per ticket, so concurrent writers never collide) and left STATUS.md "ONE **Last updated header line + the surface tables". tests/docs-budget-test.sh ratchets that to at most one such line so history cannot re-accrete.

But #230 fixed only the LANDING=pr merge-to-head red (the worktree is pinned to a named branch, no merge onto main). GOTCHAS 72's own Residual called out that LANDING=push keeps merge-to-head because "there main IS the landing surface". And the one header line that survived is rewritten in full by every state-changing commit. So for a push-mode consumer, two overlapping writers STILL collide on that single line — exactly what reded run 22956 and stranded #240 (#285).

What to decide / build

Make the one header line stop being a universally-rewritten line. Options weighed in #285:

  1. (recommended) Move the dated **Last updated: … — lead fully into the per-ticket journal entry; STATUS.md keeps a stable title + the surface tables + blockers + the journal pointer only. The journal is already append-only/one-file-per-ticket (collision-free); the header's "what changed / prior head" narrative is redundant with the newest journal entry. STATUS.md then changes only via per-consumer/per-host table rows (writers touch different rows, rarely the same line) + blocker edits. docs-budget-test.sh's **Last updated ratchet flips from <=1 to == 0 (or the line becomes a fixed, non-dated subtitle).
  2. .gitattributes merge=union on STATUS.md — RULED OUT. Union keeps BOTH sides' replaced lines, i.e. it would produce a second **Last updated line, which the docs-budget-test.sh <=1 ratchet then fails. A custom (non-union) driver needs git config merge.<drv>.driver, i.e. a write to the protected .git/config on every host. Not viable as-is.

Blast radius — why ready-for-session

Option 1 is a documented-convention change that ripples beyond one lib:

  • CLAUDE.md ("## Project status — STATUS.md") mandates "update the affected STATUS.md surface row + header line" on every state-changing commit — that sentence drops the header-line clause.
  • .sandcastle/prompt-enrichments/*.md (the read-first enrichment) and the five rendered prompt copies carry the same "header line" wording — a prompt-skeleton edit is design work needing a session's standing (CLAUDE.md rule 2c / protected-path rule).
  • tests/docs-budget-test.sh ratchet and GOTCHAS 72's Rule/Residual text both need updating in the same arc.
  • STATUS.md itself gets restructured (header lead → journal).

#285 also surfaced that push-mode close-report.sh gates against the pushed worker branch pre-land (by design — the host promotes to main only after its post-run verify). So a ticket can close green and then have its land fail/park, stranding verified work (the #282/#283/#285 family). Whether the host's failed-land path should reopen or flag the just-closed ticket is a HOST-side change (landing-lib.sh / run-swarm.sh), orthogonal to the STATUS.md contention fix above — worth its own ticket rather than bundling here.

Acceptance (option 1)

  • STATUS.md carries no per-change dated lead that every writer rewrites; docs-budget-test.sh asserts the new shape and stays green.
  • CLAUDE.md + the read-first enrichment + prompt copies no longer tell workers to rewrite a header line on every state change.
  • GOTCHAS 72's Residual is closed (or re-scoped) with a body/journal note.
  • Offline suite green.
## Close the push-mode residual of GOTCHAS 72: STATUS.md's single `**Last updated` header line is still a guaranteed concurrent-write collision Filed from #285 (land-time STATUS.md merge conflict stranded #240's closed work, run 22956). ### The residual GOTCHAS 72 / #230 already moved STATUS.md's per-change *history* into `docs/journal/` (one file per ticket, so concurrent writers never collide) and left STATUS.md "ONE `**Last updated` header line + the surface tables". `tests/docs-budget-test.sh` ratchets that to **at most one** such line so history cannot re-accrete. But #230 fixed only the `LANDING=pr` merge-to-head red (the worktree is pinned to a named branch, no merge onto `main`). GOTCHAS 72's own **Residual** called out that `LANDING=push` keeps `merge-to-head` because "there `main` IS the landing surface". And the one header line that survived is **rewritten in full by every state-changing commit**. So for a push-mode consumer, two overlapping writers STILL collide on that single line — exactly what reded run 22956 and stranded #240 (#285). ### What to decide / build Make the one header line stop being a universally-rewritten line. Options weighed in #285: 1. **(recommended) Move the dated `**Last updated: … —` lead fully into the per-ticket journal entry; STATUS.md keeps a *stable* title + the surface tables + blockers + the journal pointer only.** The journal is already append-only/one-file-per-ticket (collision-free); the header's "what changed / prior head" narrative is redundant with the newest journal entry. STATUS.md then changes only via per-consumer/per-host *table rows* (writers touch different rows, rarely the same line) + blocker edits. `docs-budget-test.sh`'s `**Last updated` ratchet flips from `<=1` to `== 0` (or the line becomes a fixed, non-dated subtitle). 2. **`.gitattributes` `merge=union` on STATUS.md — RULED OUT.** Union keeps BOTH sides' replaced lines, i.e. it would produce a *second* `**Last updated` line, which the `docs-budget-test.sh` `<=1` ratchet then fails. A custom (non-union) driver needs `git config merge.<drv>.driver`, i.e. a write to the protected `.git/config` on every host. Not viable as-is. ### Blast radius — why `ready-for-session` Option 1 is a documented-convention change that ripples beyond one lib: - `CLAUDE.md` ("## Project status — STATUS.md") mandates "update the affected `STATUS.md` surface row + header line" on every state-changing commit — that sentence drops the header-line clause. - `.sandcastle/prompt-enrichments/*.md` (the read-first enrichment) and the five rendered prompt copies carry the same "header line" wording — **a prompt-skeleton edit is design work needing a session's standing** (CLAUDE.md rule 2c / protected-path rule). - `tests/docs-budget-test.sh` ratchet and GOTCHAS 72's Rule/Residual text both need updating in the same arc. - `STATUS.md` itself gets restructured (header lead → journal). ### Related but separate: close-before-land #285 also surfaced that push-mode `close-report.sh` gates against the **pushed worker branch pre-land** (by design — the host promotes to `main` only after its post-run verify). So a ticket can close green and then have its land fail/park, stranding verified work (the #282/#283/#285 family). Whether the host's failed-land path should **reopen or flag** the just-closed ticket is a HOST-side change (`landing-lib.sh` / `run-swarm.sh`), orthogonal to the STATUS.md contention fix above — worth its own ticket rather than bundling here. ### Acceptance (option 1) - STATUS.md carries no per-change dated lead that every writer rewrites; `docs-budget-test.sh` asserts the new shape and stays green. - `CLAUDE.md` + the read-first enrichment + prompt copies no longer tell workers to rewrite a header line on every state change. - GOTCHAS 72's Residual is closed (or re-scoped) with a body/journal note. - Offline suite green.
Author
Member

Close-report — #287 landed (ADR 0174, two-way doors only)

Took option 1 from the ticket (the one it recommended, and #285 weighed): the dated **Last updated … — lead moved fully into the newest per-ticket journal entry; STATUS.md now opens with a stable, non-dated subtitle + the surface tables + blockers + the journal pointer, and changes only via surface rows (writers touch different rows) + blocker edits. The single header line every state-changing commit rewrote — the push-mode concurrent-write collision — is gone.

Ruled by agent under ADR 0174 — veto anytime. Rulings made, each a two-way door (revertible doc/test/convention change, proven by the existing offline suite): (1) option 1 over the ruled-out merge=union; (2) the docs-budget-test.sh ratchet flips <=1 → == 0; (3) the orthogonal host-side close-before-land question is filed separately (#288), not bundled.

What landed

  • STATUS.md — dated lead replaced by a stable subtitle; journal pointer + bottom note reworded (no header-line-to-rewrite). #286’s narrative that a concurrent writer had put back in the header is preserved in docs/journal/2026-10-17-286.md / …-240.md, so nothing was lost resolving that rebase conflict.
  • tests/docs-budget-test.sh — **Last updated ratchet <=1 → == 0; also fixed a latent || echo 0 that printed a second "0" line (only reachable at zero matches, i.e. only after this change) and would have broken the -eq.
  • CLAUDE.md ("## Project status"), .sandcastle/prompt-enrichments/read-first.md + the rendered .sandcastle/prompt.md (byte-identical, re-proven), docs/journal/README.md — all drop the "rewrite a header line on every state change" clause.
  • docs/gotchas/72-*.md — records the push-mode residual as CLOSED; separate residual (rebased PR mergeable:false) and host-side close-before-land (#288) noted out of scope.
  • docs/journal/2026-10-17-287.md added.

Proof

  • bash tests/docs-budget-test.sh → 4 passed, 0 failed (asserts the new == 0 shape).
  • bash onboarding/tests/onboard-lib-test.sh → 274 passed, 0 failed (the cutover-proof render: .sandcastle/prompt.md re-renders byte-identical from the edited enrichment).
  • Full offline suite (for t in tests/*.sh onboarding/tests/*.sh; …) → 96/96 pass, 0 fail.

Acceptance (option 1) — all met

  • ✅ STATUS.md carries no per-change dated lead that every writer rewrites; docs-budget-test.sh asserts the new shape and stays green.
  • ✅ CLAUDE.md + the read-first enrichment + prompt copy no longer tell workers to rewrite a header line on every state change.
  • ✅ GOTCHAS 72’s residual closed with a body + journal note.
  • ✅ Offline suite green.

Commits (pushed to main)

  • a2a02ed docs: #287 — STATUS.md drops its rewritten header line (push-mode residual of GOTCHAS 72)
  • 5b614ec docs: cite #288 (host-side close-before-land follow-up) in GOTCHAS 72 + #287 journal

Follow-up filed

  • #288 — push-mode close-before-land: when the host fails/parks a land, should it reopen or flag the just-closed ticket? (host-side, landing-lib.sh/run-swarm.sh).

Note, aptly: this very change hit the collision it fixes — a concurrent #286 land rewrote the header line during git pull --rebase, which I resolved by keeping the no-header shape.

## Close-report — #287 landed (ADR 0174, two-way doors only) Took **option 1** from the ticket (the one it recommended, and #285 weighed): the dated `**Last updated … —` lead moved fully into the newest per-ticket journal entry; STATUS.md now opens with a **stable, non-dated subtitle** + the surface tables + blockers + the journal pointer, and changes only via surface *rows* (writers touch different rows) + blocker edits. The single header line every state-changing commit rewrote — the push-mode concurrent-write collision — is gone. **Ruled by agent under ADR 0174 — veto anytime.** Rulings made, each a two-way door (revertible doc/test/convention change, proven by the existing offline suite): (1) option 1 over the ruled-out `merge=union`; (2) the `docs-budget-test.sh` ratchet flips `<=1` → `== 0`; (3) the orthogonal host-side close-before-land question is filed separately (#288), not bundled. ### What landed - **STATUS.md** — dated lead replaced by a stable subtitle; journal pointer + bottom note reworded (no header-line-to-rewrite). #286’s narrative that a concurrent writer had put back in the header is preserved in `docs/journal/2026-10-17-286.md` / `…-240.md`, so nothing was lost resolving that rebase conflict. - **tests/docs-budget-test.sh** — `**Last updated` ratchet `<=1` → `== 0`; also fixed a latent `|| echo 0` that printed a second "0" line (only reachable at zero matches, i.e. only after this change) and would have broken the `-eq`. - **CLAUDE.md** ("## Project status"), **.sandcastle/prompt-enrichments/read-first.md** + the rendered **.sandcastle/prompt.md** (byte-identical, re-proven), **docs/journal/README.md** — all drop the "rewrite a header line on every state change" clause. - **docs/gotchas/72-*.md** — records the push-mode residual as CLOSED; separate residual (rebased PR `mergeable:false`) and host-side close-before-land (#288) noted out of scope. - **docs/journal/2026-10-17-287.md** added. ### Proof - `bash tests/docs-budget-test.sh` → 4 passed, 0 failed (asserts the new `== 0` shape). - `bash onboarding/tests/onboard-lib-test.sh` → 274 passed, 0 failed (the cutover-proof render: `.sandcastle/prompt.md` re-renders byte-identical from the edited enrichment). - Full offline suite (`for t in tests/*.sh onboarding/tests/*.sh; …`) → **96/96 pass, 0 fail**. ### Acceptance (option 1) — all met - ✅ STATUS.md carries no per-change dated lead that every writer rewrites; `docs-budget-test.sh` asserts the new shape and stays green. - ✅ CLAUDE.md + the read-first enrichment + prompt copy no longer tell workers to rewrite a header line on every state change. - ✅ GOTCHAS 72’s residual closed with a body + journal note. - ✅ Offline suite green. ### Commits (pushed to `main`) - `a2a02ed` docs: #287 — STATUS.md drops its rewritten header line (push-mode residual of GOTCHAS 72) - `5b614ec` docs: cite #288 (host-side close-before-land follow-up) in GOTCHAS 72 + #287 journal ### Follow-up filed - **#288** — push-mode close-before-land: when the host fails/parks a land, should it reopen or flag the just-closed ticket? (host-side, `landing-lib.sh`/`run-swarm.sh`). Note, aptly: this very change hit the collision it fixes — a concurrent #286 land rewrote the header line during `git pull --rebase`, which I resolved by keeping the no-header shape.
matou-build-agent 2026-10-17 21:10:59 +00:00
Author
Member

Ruled by agent under ADR 0174 — veto anytime. Close-report.

Finding

The #287 work was already fully landed on origin/main by a prior session-runner leg (same host, Factory-Account d631bd58e1e9) that died at its final message before closing the ticket — the exact close-before-land / session-dies residue this ticket and #288 are about. This leg verified that landed work against all four acceptance criteria and found it complete and proven; nothing further to build.

What landed (two commits on main)

  • a2a02ed — docs: #287 — STATUS.md drops its rewritten header line (push-mode residual of GOTCHAS 72)
  • 5b614ec — docs: cite #288 (host-side close-before-land follow-up) in GOTCHAS 72 + #287 journal

Acceptance — all met (proof)

  1. STATUS.md carries no per-change dated lead. It now opens with a stable, non-dated subtitle + the consumer/host tables + blockers + the journal pointer; it changes only via surface rows (writers touch different rows) + blocker edits — no universally-rewritten line two push-mode writers can collide on. tests/docs-budget-test.sh ratchet flipped <=1 → -eq 0 on ^\*\*Last updated, so the head line cannot re-accrete. docs-budget-test: 4 passed, 0 failed.
  2. The "rewrite a header line on every state change" clause dropped everywhere it renders into workers: CLAUDE.md ("## Project status"), the read-first enrichment + the rendered .sandcastle/prompt.md (byte-identical — onboard-lib cutover: 274 passed, 0 failed), and docs/journal/README.md. The dated **Last updated … lead now lives in the newest per-ticket journal entry (docs/journal/2026-10-17-287.md), which is the head — append-only, one file per ticket, collision-free.
  3. GOTCHAS 72's Residual recorded closed in its body (docs/gotchas/72-…md): the push-mode header-line residual is marked closed by #287; the separate PR-mergeable:false residual and the orthogonal host-side close-before-land question are noted out of scope and split to #288.
  4. Offline suite green: 97 passed, 0 failed (shimmed curl/claude, no docker/network; exit codes captured per GOTCHAS, not the exit-code-ignoring canonical loop).

Out of scope (correctly split)

The host-side close-before-land path — whether a failed/parked land should reopen or flag the just-closed ticket (landing-lib.sh / run-swarm.sh) — is filed as #288 (open), not bundled here, as the ticket directed.

Two-way throughout (docs/test/prompt edits, revertible; proven by existing offline tests). Closing.

**Ruled by agent under ADR 0174 — veto anytime.** Close-report. ### Finding The #287 work was already fully landed on `origin/main` by a prior session-runner leg (same host, Factory-Account `d631bd58e1e9`) that died at its final message before closing the ticket — the exact close-before-land / session-dies residue this ticket and #288 are about. This leg verified that landed work against all four acceptance criteria and found it complete and proven; nothing further to build. ### What landed (two commits on `main`) - `a2a02ed` — docs: #287 — STATUS.md drops its rewritten header line (push-mode residual of GOTCHAS 72) - `5b614ec` — docs: cite #288 (host-side close-before-land follow-up) in GOTCHAS 72 + #287 journal ### Acceptance — all met (proof) 1. **STATUS.md carries no per-change dated lead.** It now opens with a stable, non-dated subtitle + the consumer/host tables + blockers + the journal pointer; it changes only via surface rows (writers touch different rows) + blocker edits — no universally-rewritten line two push-mode writers can collide on. `tests/docs-budget-test.sh` ratchet flipped `<=1` → `-eq 0` on `^\*\*Last updated`, so the head line cannot re-accrete. **docs-budget-test: 4 passed, 0 failed.** 2. **The "rewrite a header line on every state change" clause dropped everywhere it renders into workers:** `CLAUDE.md` ("## Project status"), the read-first enrichment + the rendered `.sandcastle/prompt.md` (byte-identical — **onboard-lib cutover: 274 passed, 0 failed**), and `docs/journal/README.md`. The dated `**Last updated …` lead now lives in the newest per-ticket journal entry (`docs/journal/2026-10-17-287.md`), which is the head — append-only, one file per ticket, collision-free. 3. **GOTCHAS 72's Residual recorded closed** in its body (`docs/gotchas/72-…md`): the push-mode header-line residual is marked closed by #287; the separate PR-`mergeable:false` residual and the orthogonal host-side close-before-land question are noted out of scope and split to **#288**. 4. **Offline suite green: 97 passed, 0 failed** (shimmed `curl`/`claude`, no docker/network; exit codes captured per GOTCHAS, not the exit-code-ignoring canonical loop). ### Out of scope (correctly split) The host-side close-before-land path — whether a failed/parked land should reopen or flag the just-closed ticket (`landing-lib.sh` / `run-swarm.sh`) — is filed as **#288** (open), not bundled here, as the ticket directed. Two-way throughout (docs/test/prompt edits, revertible; proven by existing offline tests). Closing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/dev-factory#287
No description provided.