protected-path deadlock: #272/#273 fixes closed but stranded on rescue branches — main still broken, running pin still reds every worker run (#445) #280

Closed
opened 2026-10-17 05:33:13 +00:00 by matou-build-agent · 2 comments

Symptom

protected-path violation (#445) reds every worker-bearing swarm run on
Matou/dev-factory — run 22812,
signature 0ef3e1e7d379, leg matou-dev-server-01. This is the fourth+
recurrence
of the fault already ticketed as #272 / #273.

The new fact: #272 and #273 are CLOSED, their fixes are CORRECT, and neither
fix is on main.
The gate blocks its own fix from landing, and the
close-report gate then reported success against a commit that was never
pushed.

Evidence

origin/main is a3c9f50. Neither fix commit is reachable from it; both are
parked on healer-pushed rescue branches (verify_protected_paths, verify-lib.sh:193):

ticket fix commit parked on on main? closed at
#273 fbdd7d8 sandcastle/rescue-20261017-051857 no 05:17:53Z
#272 10d0a8b sandcastle/rescue-20261017-052212 no 05:20:48Z
#208 4630d57 sandcastle/rescue-20261017-052443 no —

Both close-reports claim "every claim verified against main; issue closed".
That is a false green: in LANDING=push the HOST lands main only after
verify_protected_paths, which returned 1 — so nothing was pushed, HEAD was
parked, and the issue was closed anyway. Note this is the inverse of #244
(false refusal); same seam, opposite failure, and this direction silently
loses landed-looking work.

4630d57 (#208) is also committed in the shared workdir's local main but
unpushed, so /home/dev/swarm/Matou/dev-factory sits one commit ahead of
origin/main (swarm-lock was held, so the healer did not touch it).

Why the deadlock is total

The enforcing copy is the vendored .sandcastle/protected-paths-lib.sh at
FACTORY_REF = 0d638e1, and that file is itself a protected path a worker
may not edit. A root fix is inert until a human re-vendors (GOTCHAS 4). So:
every worker that fixes the gate trips the old gate, is rolled back, and never
lands — including the fix for the gate. Run 22812's banner named the worker's
own log and the whole worker worktree
(.sandcastle/worktrees/<name>/STATUS.md, docs/journal/2026-10-17-269.md,
__pycache__/*.pyc), so #269's legitimate output was deleted too.

What the healer already did (and what it did NOT)

Hotfixed the running vendored copy only — .sandcastle/protected-paths-lib.sh

  • .sandcastle/tests/protected-paths-lib-test.sh, carried verbatim from the
    already-reviewed 10d0a8b (the superset of fbdd7d8). Root
    protected-paths-lib.sh is untouched (product-class). This is deliberate
    drift against FACTORY_REF = 0d638e1.

What a human / session must do

  1. Land 10d0a8b on main (it supersedes fbdd7d8: adds worktrees/*,
    pnpm-store/*, nix-store/*, .env, __pycache__/*, secrets/*_token,
    and the set -f word-split hardening). Decide what to do with fbdd7d8.
  2. Land 4630d57 (#208) or confirm it is superseded.
  3. Re-vendor with bash onboarding/onboard.sh vendor .sandcastle <sha> --force
    so the hotfix drift is carried back deliberately, and bump FACTORY_REF.
  4. Reopen #272/#273 or record that they closed un-landed — the tracker
    currently says fixed when main is not.
  5. Fix the close-report/landing seam so a run that never pushed cannot report
    success "verified against main" and close its ticket.
## Symptom `protected-path violation (#445)` reds every worker-bearing swarm run on `Matou/dev-factory` — run [22812](https://git.matou.nz/Matou/dev-factory/actions/runs/22812), signature `0ef3e1e7d379`, leg `matou-dev-server-01`. This is the **fourth+ recurrence** of the fault already ticketed as #272 / #273. The new fact: **#272 and #273 are CLOSED, their fixes are CORRECT, and neither fix is on `main`.** The gate blocks its own fix from landing, and the close-report gate then reported `success` against a commit that was never pushed. ## Evidence `origin/main` is `a3c9f50`. Neither fix commit is reachable from it; both are parked on healer-pushed rescue branches (`verify_protected_paths`, verify-lib.sh:193): | ticket | fix commit | parked on | on `main`? | closed at | |---|---|---|---|---| | #273 | `fbdd7d8` | `sandcastle/rescue-20261017-051857` | **no** | 05:17:53Z | | #272 | `10d0a8b` | `sandcastle/rescue-20261017-052212` | **no** | 05:20:48Z | | #208 | `4630d57` | `sandcastle/rescue-20261017-052443` | **no** | — | Both close-reports claim *"every claim verified against main; issue closed"*. That is a **false green**: in `LANDING=push` the HOST lands `main` only after `verify_protected_paths`, which returned 1 — so nothing was pushed, HEAD was parked, and the issue was closed anyway. Note this is the *inverse* of #244 (false refusal); same seam, opposite failure, and this direction silently loses landed-looking work. `4630d57` (#208) is also committed in the shared workdir's local `main` but unpushed, so `/home/dev/swarm/Matou/dev-factory` sits one commit ahead of `origin/main` (swarm-lock was `held`, so the healer did not touch it). ## Why the deadlock is total The enforcing copy is the **vendored** `.sandcastle/protected-paths-lib.sh` at `FACTORY_REF` = `0d638e1`, and that file is itself a protected path a worker may not edit. A root fix is inert until a human re-vendors (GOTCHAS 4). So: every worker that fixes the gate trips the old gate, is rolled back, and never lands — including the fix for the gate. Run 22812's banner named the worker's own log *and* the whole worker worktree (`.sandcastle/worktrees/<name>/STATUS.md`, `docs/journal/2026-10-17-269.md`, `__pycache__/*.pyc`), so #269's legitimate output was deleted too. ## What the healer already did (and what it did NOT) Hotfixed the **running vendored copy only** — `.sandcastle/protected-paths-lib.sh` + `.sandcastle/tests/protected-paths-lib-test.sh`, carried verbatim from the already-reviewed `10d0a8b` (the superset of `fbdd7d8`). Root `protected-paths-lib.sh` is untouched (product-class). This is deliberate drift against `FACTORY_REF` = `0d638e1`. ## What a human / session must do 1. Land `10d0a8b` on `main` (it supersedes `fbdd7d8`: adds `worktrees/*`, `pnpm-store/*`, `nix-store/*`, `.env`, `__pycache__/*`, `secrets/*_token`, and the `set -f` word-split hardening). Decide what to do with `fbdd7d8`. 2. Land `4630d57` (#208) or confirm it is superseded. 3. Re-vendor with `bash onboarding/onboard.sh vendor .sandcastle <sha> --force` so the hotfix drift is carried back deliberately, and bump `FACTORY_REF`. 4. Reopen #272/#273 or record that they closed un-landed — the tracker currently says fixed when `main` is not. 5. Fix the close-report/landing seam so a run that never pushed cannot report `success` "verified against main" and close its ticket.
Author
Member

Healer hotfix committed — e68a321 (sandcastle: #280 — heal hotfix: vendored protected-path boundary exempts .sandcastle/ runtime artifacts), pushed to main by the healer.

Scope: .sandcastle/protected-paths-lib.sh + .sandcastle/tests/protected-paths-lib-test.sh only, carried verbatim from 10d0a8b. Root protected-paths-lib.sh untouched.

The push is a fast-forward over a3c9f50 and therefore also lands the stranded 4630d57 (#208), which was sitting committed-but-unpushed in the shared workdir's local main. Item 2 of this ticket is satisfied by that; items 1, 3, 4 and 5 remain.

Proof recorded in docs/journal/2026-10-17-280.md: vendored test 27 → 52 checks green; run 22812's exact path list is rc=1 + log/worktree deleted under the 0d638e1 lib and rc=0 with both surviving under the hotfix; negative control (a real .sandcastle/run-swarm.sh edit alongside the same runtime churn) still rc=1 CAUGHT and restored to pre-run content.

**Healer hotfix committed** — `e68a321` (`sandcastle: #280 — heal hotfix: vendored protected-path boundary exempts .sandcastle/ runtime artifacts`), pushed to `main` by the healer. Scope: `.sandcastle/protected-paths-lib.sh` + `.sandcastle/tests/protected-paths-lib-test.sh` only, carried verbatim from `10d0a8b`. Root `protected-paths-lib.sh` untouched. The push is a fast-forward over `a3c9f50` and therefore also lands the stranded `4630d57` (#208), which was sitting committed-but-unpushed in the shared workdir's local `main`. Item 2 of this ticket is satisfied by that; items 1, 3, 4 and 5 remain. Proof recorded in `docs/journal/2026-10-17-280.md`: vendored test 27 → 52 checks green; run 22812's exact path list is `rc=1` + log/worktree deleted under the `0d638e1` lib and `rc=0` with both surviving under the hotfix; negative control (a real `.sandcastle/run-swarm.sh` edit alongside the same runtime churn) still `rc=1 CAUGHT` and restored to pre-run content.
Author
Member

close-report (#280) — ruled by agent under ADR 0174, veto anytime

The protected-path deadlock is broken: the proven fix is on main as deliberate source, the self-copy pin is bumped, and the running copy carries it by design rather than ad-hoc hotfix drift. Mapped to the ticket's five items.

1. Land the complete PP fix on main — DONE (a4be7db). Rather than land 10d0a8b verbatim, I landed the already-proven running hotfix (d66ad8a worktrees + 3a41b1e word-split) back to ROOT, byte-identical to the vendored copy: PP_EXEMPT_GLOBS_DEFAULT exempts all three gitignored runtime trees (.sandcastle/logs/*, .sandcastle/.state/*, .sandcastle/worktrees/*), and new _pp_words splits the glob list with pathname expansion OFF (set -f) so patterns survive a populated cwd — closing the run-22813 word-split trap fbdd7d8 could not see. fbdd7d8 was already fast-forwarded onto main; it is superseded by a4be7db. Red-first test: tests/protected-paths-lib-test.sh 35 → 47 checks. 10d0a8b's WIDER exempt set (.env, secrets/*_token, caches) is a protected-boundary posture change and was deliberately NOT folded in — filed as #284.

2. Land 4630d57 (#208) — DONE (8cf496f). Clean cherry-pick (only STATUS.md conflicted; header kept at #280, #208's narrative preserved in its journal). Touched suites green.

3. Re-vendor + bump FACTORY_REF — DONE (23fb3a6). onboard.sh vendor .sandcastle a4be7db --force bumped 0d638e1 → a4be7db; the --force carried the healer's deliberate drift back deliberately. Because root was first made byte-identical to the hotfix, the overwrite of the two PP files is a content no-op. check-harness-drift OK; the bump also carried the already-green 0d638e1→a4be7db delta (#246's no-token gate, #277's hermetic test fix). #208 is NOT in this pin (root-ahead, inert) as its own commit anticipated.

4. Reconcile the tracker — DONE. #273, #278, #208 and #272 closed with their fixes stranded off main; I posted audit-correction comments on each (fix now genuinely on main at the named sha, proof attached), keeping them CLOSED since their filed symptoms are resolved. #272's un-landed remainder (10d0a8b's wider set) is #284.

5. Fix the false-green close-report/landing seam — ROUTED to #283. This is the deadlock's root enabler and the inverse of #244: in push mode close-report.sh runs in the sandbox pre-land, verifies the worker branch, then closes the issue and posts "verified against main" — but if the HOST's later verify_protected_paths rolls back and never advances main, the issue is already closed against work that never landed, with no reopen path. A correct fix spans the host/sandbox boundary (main.mts + landing-lib.sh + close-report.sh ordering) — not a safe unattended two-way quick-edit, so it is filed as #283 (ready-for-session) with the full diagnosis and candidate directions rather than rushed here.

Proof

  • Commits: a4be7db (root fix), 23fb3a6 (re-vendor/pin), 8cf496f (#208). HEAD == origin/main.
  • tests/protected-paths-lib-test.sh 47 checks green (red-first proven); full offline suite green twice (before and after #208); check-harness-drift OK against a4be7db.
  • Running self-copy pinned FACTORY_REF = a4be7db; vendored PP suite + the changed vendored tests green.
  • GOTCHAS 75 extended; journals 2026-10-17-280.md, -280-revendor.md, -208.md; STATUS surface updated.

Follow-ups filed: #283 (false-green seam), #284 (wider exemptions / posture). Closing.

## close-report (#280) — ruled by agent under ADR 0174, veto anytime The protected-path deadlock is broken: the proven fix is on `main` as deliberate source, the self-copy pin is bumped, and the running copy carries it by design rather than ad-hoc hotfix drift. Mapped to the ticket's five items. **1. Land the complete PP fix on `main` — DONE** (`a4be7db`). Rather than land `10d0a8b` verbatim, I landed the **already-proven running hotfix** (`d66ad8a` worktrees + `3a41b1e` word-split) back to ROOT, byte-identical to the vendored copy: `PP_EXEMPT_GLOBS_DEFAULT` exempts all three gitignored runtime trees (`.sandcastle/logs/*`, `.sandcastle/.state/*`, `.sandcastle/worktrees/*`), and new `_pp_words` splits the glob list with pathname expansion OFF (`set -f`) so patterns survive a populated cwd — closing the run-22813 word-split trap `fbdd7d8` could not see. `fbdd7d8` was already fast-forwarded onto `main`; it is superseded by `a4be7db`. Red-first test: `tests/protected-paths-lib-test.sh` 35 → 47 checks. `10d0a8b`'s WIDER exempt set (`.env`, `secrets/*_token`, caches) is a protected-boundary **posture** change and was deliberately NOT folded in — filed as **#284**. **2. Land `4630d57` (#208) — DONE** (`8cf496f`). Clean cherry-pick (only STATUS.md conflicted; header kept at #280, #208's narrative preserved in its journal). Touched suites green. **3. Re-vendor + bump `FACTORY_REF` — DONE** (`23fb3a6`). `onboard.sh vendor .sandcastle a4be7db --force` bumped `0d638e1` → `a4be7db`; the `--force` carried the healer's deliberate drift back deliberately. Because root was first made byte-identical to the hotfix, the overwrite of the two PP files is a content no-op. `check-harness-drift` OK; the bump also carried the already-green `0d638e1`→`a4be7db` delta (#246's no-token gate, #277's hermetic test fix). #208 is NOT in this pin (root-ahead, inert) as its own commit anticipated. **4. Reconcile the tracker — DONE.** #273, #278, #208 and #272 closed with their fixes stranded off `main`; I posted audit-correction comments on each (fix now genuinely on `main` at the named sha, proof attached), keeping them CLOSED since their filed symptoms are resolved. #272's un-landed remainder (`10d0a8b`'s wider set) is **#284**. **5. Fix the false-green close-report/landing seam — ROUTED to #283.** This is the deadlock's root enabler and the inverse of #244: in push mode `close-report.sh` runs in the sandbox pre-land, verifies the worker branch, then closes the issue and posts *"verified against main"* — but if the HOST's later `verify_protected_paths` rolls back and never advances `main`, the issue is already closed against work that never landed, with no reopen path. A correct fix spans the host/sandbox boundary (`main.mts` + `landing-lib.sh` + `close-report.sh` ordering) — not a safe unattended two-way quick-edit, so it is filed as **#283** (`ready-for-session`) with the full diagnosis and candidate directions rather than rushed here. ### Proof - Commits: `a4be7db` (root fix), `23fb3a6` (re-vendor/pin), `8cf496f` (#208). `HEAD == origin/main`. - `tests/protected-paths-lib-test.sh` 47 checks green (red-first proven); full offline suite green twice (before and after #208); `check-harness-drift` OK against `a4be7db`. - Running self-copy pinned `FACTORY_REF` = `a4be7db`; vendored PP suite + the changed vendored tests green. - GOTCHAS 75 extended; journals `2026-10-17-280.md`, `-280-revendor.md`, `-208.md`; STATUS surface updated. Follow-ups filed: **#283** (false-green seam), **#284** (wider exemptions / posture). Closing.
matou-build-agent 2026-10-17 06:38:42 +00:00
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#280
No description provided.