The running .sandcastle self-copy predates the #272 protected-path fix — every worker-bearing swarm run reds on #445 and deletes its own worker worktree #279

Closed
opened 2026-10-17 05:26:58 +00:00 by matou-build-agent · 1 comment

Filed by the swarm healer for run https://git.matou.nz/Matou/dev-factory/actions/runs/22811 (signature 0ef3e1e7d379).

Symptom

swarm REDs at protected-path violation — a worker edited machinery (#445),
exit 1, reason=protected-path-violation — on every run that launches a
live worker. Run 22811 (05:19 and 05:22 legs) named ~500 paths, all of them
the harness's own runtime artifacts:

protected-path violation (#445): a worker changed machinery that judges its work.
  - .sandcastle/logs/main-sandcastle-worker-20261017-050442-a19cd1-worker.log — CREATED by the worker (rolled back: deleted)
  - .sandcastle/worktrees/sandcastle-worker-20261017-050614-fc0976/run-swarm.sh — CREATED by the worker (rolled back: deleted)
  - … ~500 more paths under .sandcastle/worktrees/<worker>/ …
run-swarm: RUN FAILED — exit 1 in stage 'protected-path violation — a worker edited machinery (#445)'

No worker edited machinery. This is GOTCHAS 75 / #272 / #273, already
diagnosed and already FIXED at the repo root.

Root cause — the fix is landed but INERT

protected-paths-lib.sh was fixed in 10d0a8b (#272, 2026-10-17 05:19:59),
which extends PP_EXEMPT_GLOBS_DEFAULT with the anchored runtime set
(.sandcastle/logs/*, worktrees/*, pnpm-store/*, nix-store/*,
.state/*, .env, secrets/*_token, __pycache__/).

The running self-copy is pinned at .sandcastle/FACTORY_REF = 0d638e1163c4696d9e94b9f3e29dd42022fba6cf, which predates it, so
.sandcastle/protected-paths-lib.sh still carries
PP_EXEMPT_GLOBS_DEFAULT="*matou-heal-* */matou-heal-*". Proven side by side
in a fresh clone:

=== .sandcastle/protected-paths-lib.sh (running, 0d638e1) ===
PROTECTED  .sandcastle/logs/main-…-worker.log
PROTECTED  .sandcastle/worktrees/sandcastle-worker-…/run-swarm.sh
PROTECTED  .sandcastle/run-swarm.sh
=== protected-paths-lib.sh (root, 10d0a8b) ===
exempt     .sandcastle/logs/main-…-worker.log
exempt     .sandcastle/worktrees/sandcastle-worker-…/run-swarm.sh
PROTECTED  .sandcastle/run-swarm.sh      ← a real machinery edit still fires

GOTCHAS 4: a root harness fix does not change what the factory's own swarm
runs until a human re-vendors and bumps the pin. #272's own commit message says
so explicitly.

New in this run: the rollback destroys a LIVE worker's checkout

#272/#273 described the deleted worker log. Run 22811 shows the sharper blast
radius — pp_rollback deleted the contents of the running worker's nested
git worktree:

$ ls ~/swarm/Matou/dev-factory/.sandcastle/worktrees/sandcastle-worker-20261017-050614-fc0976/
docs  fleet-tui  git-hooks  node_modules  onboarding  prompts  tests  tui

Every file at that worktree's root is gone; only directories survive. And
.sandcastle/logs/main-sandcastle-worker-20261017-050442-a19cd1-worker.log —
named in the violation — no longer exists on the host, so this incident's heal
bundle carries a 493-byte worker-logs.txt with no fault text, exactly the
forensics loss GOTCHAS 75 predicted. 10d0a8b's worktrees/* exemption
already covers this; it just is not running.

Why the healer did not repair it

Every in-charter repair is either blocked or a human decision:

  • Hotfix .sandcastle/protected-paths-lib.sh in place — it is a
    FACTORY_MANIFEST path, so git-hooks/pre-push gate 1 (#932) raises
    DRIFT_BLOCK on any push that touches it and check-harness-drift.sh reds.
    That trades a protected-path red for a drift block.
  • Re-vendor + bump FACTORY_REF → 10d0a8b — the correct fix, but it is a
    fleet-visible pin bump that also carries #276/#241/#238/#253 into the running
    copy. GOTCHAS 4 and CLAUDE.md reserve it for a human.
  • Break-glass PP_ENFORCE=0 in the host's .sandcastle/.env, or the #251
    per-repo PROTECTED_PATHS policy key — both disable the #445 rail for this
    repo. GOTCHAS 75 calls this a human decision; the shared workdir was also
    locked (swarm-lock.txt: held).

What a human should do

From ~/swarm/Matou/dev-factory with the swarm lock free:

bash onboarding/onboard.sh vendor .sandcastle 10d0a8b

then commit the .sandcastle/ + FACTORY_REF bump and push. Until then
every dev-factory swarm run with a live worker reds and hollows out its own
worker worktree
; interim break-glass is PP_ENFORCE=0 in
.sandcastle/.env.

Same class as the stale #131/#132 (self-pin behind), different pin and
different symptom — those are about the unbounded claim path at a
29-commit-behind pin and are not this.

Evidence

/tmp/matou-heal-Matou-dev-factory.0boX2E/ — run-verdict.txt,
job-log.txt (violation blocks at lines 1203 and 2401), worker-logs.txt
(truncated by the rollback), workdir-git.txt.

Filed by the swarm healer for run https://git.matou.nz/Matou/dev-factory/actions/runs/22811 (signature `0ef3e1e7d379`). ## Symptom `swarm` REDs at `protected-path violation — a worker edited machinery (#445)`, exit 1, `reason=protected-path-violation` — on **every** run that launches a live worker. Run 22811 (05:19 and 05:22 legs) named ~500 paths, all of them the harness's **own runtime artifacts**: ``` protected-path violation (#445): a worker changed machinery that judges its work. - .sandcastle/logs/main-sandcastle-worker-20261017-050442-a19cd1-worker.log — CREATED by the worker (rolled back: deleted) - .sandcastle/worktrees/sandcastle-worker-20261017-050614-fc0976/run-swarm.sh — CREATED by the worker (rolled back: deleted) - … ~500 more paths under .sandcastle/worktrees/<worker>/ … run-swarm: RUN FAILED — exit 1 in stage 'protected-path violation — a worker edited machinery (#445)' ``` No worker edited machinery. This is **GOTCHAS 75 / #272 / #273**, already diagnosed and already FIXED at the repo root. ## Root cause — the fix is landed but INERT `protected-paths-lib.sh` was fixed in `10d0a8b` (#272, 2026-10-17 05:19:59), which extends `PP_EXEMPT_GLOBS_DEFAULT` with the anchored runtime set (`.sandcastle/logs/*`, `worktrees/*`, `pnpm-store/*`, `nix-store/*`, `.state/*`, `.env`, `secrets/*_token`, `__pycache__/`). The **running** self-copy is pinned at `.sandcastle/FACTORY_REF = 0d638e1163c4696d9e94b9f3e29dd42022fba6cf`, which predates it, so `.sandcastle/protected-paths-lib.sh` still carries `PP_EXEMPT_GLOBS_DEFAULT="*matou-heal-* */matou-heal-*"`. Proven side by side in a fresh clone: ``` === .sandcastle/protected-paths-lib.sh (running, 0d638e1) === PROTECTED .sandcastle/logs/main-…-worker.log PROTECTED .sandcastle/worktrees/sandcastle-worker-…/run-swarm.sh PROTECTED .sandcastle/run-swarm.sh === protected-paths-lib.sh (root, 10d0a8b) === exempt .sandcastle/logs/main-…-worker.log exempt .sandcastle/worktrees/sandcastle-worker-…/run-swarm.sh PROTECTED .sandcastle/run-swarm.sh ← a real machinery edit still fires ``` GOTCHAS 4: a root harness fix does not change what the factory's own swarm runs until a human re-vendors and bumps the pin. #272's own commit message says so explicitly. ## New in this run: the rollback destroys a LIVE worker's checkout #272/#273 described the deleted worker log. Run 22811 shows the sharper blast radius — `pp_rollback` deleted the contents of the **running** worker's nested git worktree: ``` $ ls ~/swarm/Matou/dev-factory/.sandcastle/worktrees/sandcastle-worker-20261017-050614-fc0976/ docs fleet-tui git-hooks node_modules onboarding prompts tests tui ``` Every file at that worktree's root is gone; only directories survive. And `.sandcastle/logs/main-sandcastle-worker-20261017-050442-a19cd1-worker.log` — named in the violation — no longer exists on the host, so this incident's heal bundle carries a 493-byte `worker-logs.txt` with no fault text, exactly the forensics loss GOTCHAS 75 predicted. `10d0a8b`'s `worktrees/*` exemption already covers this; it just is not running. ## Why the healer did not repair it Every in-charter repair is either blocked or a human decision: - **Hotfix `.sandcastle/protected-paths-lib.sh` in place** — it is a `FACTORY_MANIFEST` path, so `git-hooks/pre-push` gate 1 (#932) raises `DRIFT_BLOCK` on any push that touches it and `check-harness-drift.sh` reds. That trades a protected-path red for a drift block. - **Re-vendor + bump `FACTORY_REF` → `10d0a8b`** — the correct fix, but it is a fleet-visible pin bump that also carries #276/#241/#238/#253 into the running copy. GOTCHAS 4 and CLAUDE.md reserve it for a human. - **Break-glass `PP_ENFORCE=0`** in the host's `.sandcastle/.env`, or the #251 per-repo `PROTECTED_PATHS` policy key — both disable the #445 rail for this repo. GOTCHAS 75 calls this a human decision; the shared workdir was also locked (`swarm-lock.txt: held`). ## What a human should do From `~/swarm/Matou/dev-factory` with the swarm lock free: ``` bash onboarding/onboard.sh vendor .sandcastle 10d0a8b ``` then commit the `.sandcastle/` + `FACTORY_REF` bump and push. Until then **every dev-factory swarm run with a live worker reds and hollows out its own worker worktree**; interim break-glass is `PP_ENFORCE=0` in `.sandcastle/.env`. Same class as the stale #131/#132 (self-pin behind), different pin and different symptom — those are about the unbounded claim path at a 29-commit-behind pin and are not this. ## Evidence `/tmp/matou-heal-Matou-dev-factory.0boX2E/` — `run-verdict.txt`, `job-log.txt` (violation blocks at lines 1203 and 2401), `worker-logs.txt` (truncated by the rollback), `workdir-git.txt`.
Owner

Closed 2026-10-21 (Ben's stale sweep): the running self-copy was re-vendored to a4be7db on 2026-10-17 (#280), which carries the complete #445 protected-path fix this ticket said was missing.

Closed 2026-10-21 (Ben's stale sweep): the running self-copy was re-vendored to `a4be7db` on 2026-10-17 (#280), which carries the complete #445 protected-path fix this ticket said was missing.
ben 2026-10-21 14:16:10 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#279
No description provided.