run-swarm: cold pnpm-store FATAL is mis-attributed to "preflight self-tests" and loses its error line (elitebook-03 × matou-app, 20 h of unknown-class reds) #9

Closed
opened 2026-08-20 21:00:36 +00:00 by ben · 3 comments
Owner

Symptom. Matou/matou-app swarm jobs on elitebook-03 died on every tick since the repo was onboarded (first line in that host's run-swarm-verdicts.log, 2026-08-20T00:05Z, through 20:30Z — ~8–20 s each), logged as reason=died-in:preflight self-tests (#446) exit=1. The healer's evidence keyed on that stage with zero error lines, so it escalated as CLASS: unknown for 20 h while the other host carried the whole queue.

Actual cause. Preflight passes (verified by hand on that host: all 7 guards fired, exit 0, also under env -i). The run got as far as listing the ready set (ready=[45,44,37,5] is in the log line) and then hit the cold-store guard in run-swarm.sh:

run-swarm: FATAL — pnpm store .../pnpm-store is EMPTY: workers cannot install (GOTCHAS #20, #489).
exit 1

elitebook-03 was warm-seeded for Matou/idss only (543 M store); its matou-app store was 0 entries. Seeded by hand from the workstation (28 M) on 2026-08-20 ~21:00Z — the next tick is the proof.

Harness bugs (this ticket):

  1. The cold-store FATAL path sets neither verdict_stage nor SWARM_EXIT_REASON, so the EXIT trap attributes the death to whatever stage label was last set — "preflight self-tests" — and the healer's signature/evidence collector looks in the wrong place. Same mis-keying family as the #446/#235 guards exist to prevent. Fix: verdict_stage "pnpm store warm check (#489)" + SWARM_EXIT_REASON="cold-pnpm-store" before the exit 1; same treatment for the .env allowlist FATAL a few lines above it.
  2. The FATAL text is printed to stderr of the job but never reaches the healer (--- error lines --- was empty in run-verdict.txt). The verdict writer should capture the first FATAL line as the run's error line.

Relation to #6 (onboard-host). This is the concrete evidence that "warm state per repo per host" is a host-registry concern: enrolling a host for repo A does not enrol it for repo B. onboard-host should seed (or verify) pnpm-store for every repo the host serves, and the guard should name the recipe (rsync from an established host) in its message.

Acceptance. On a host whose pnpm-store for one repo is deliberately emptied, the swarm run's verdict line reads died-in:pnpm store warm check with the FATAL text as its error line, and the healer classifies it (not unknown).

**Symptom.** `Matou/matou-app` swarm jobs on `elitebook-03` died on *every* tick since the repo was onboarded (first line in that host's `run-swarm-verdicts.log`, 2026-08-20T00:05Z, through 20:30Z — ~8–20 s each), logged as `reason=died-in:preflight self-tests (#446) exit=1`. The healer's evidence keyed on that stage with **zero error lines**, so it escalated as `CLASS: unknown` for 20 h while the other host carried the whole queue. **Actual cause.** Preflight passes (verified by hand on that host: `all 7 guards fired`, exit 0, also under `env -i`). The run got as far as listing the ready set (`ready=[45,44,37,5]` is in the log line) and then hit the cold-store guard in `run-swarm.sh`: ``` run-swarm: FATAL — pnpm store .../pnpm-store is EMPTY: workers cannot install (GOTCHAS #20, #489). exit 1 ``` `elitebook-03` was warm-seeded for `Matou/idss` only (543 M store); its `matou-app` store was 0 entries. Seeded by hand from the workstation (28 M) on 2026-08-20 ~21:00Z — the next tick is the proof. **Harness bugs (this ticket):** 1. The cold-store FATAL path sets neither `verdict_stage` nor `SWARM_EXIT_REASON`, so the EXIT trap attributes the death to whatever stage label was last set — "preflight self-tests" — and the healer's signature/evidence collector looks in the wrong place. Same mis-keying family as the `#446`/`#235` guards exist to prevent. Fix: `verdict_stage "pnpm store warm check (#489)"` + `SWARM_EXIT_REASON="cold-pnpm-store"` before the `exit 1`; same treatment for the `.env` allowlist FATAL a few lines above it. 2. The FATAL text is printed to stderr of the job but never reaches the healer (`--- error lines ---` was empty in `run-verdict.txt`). The verdict writer should capture the first FATAL line as the run's error line. **Relation to #6 (onboard-host).** This is the concrete evidence that "warm state per repo per host" is a host-registry concern: enrolling a host for repo A does not enrol it for repo B. `onboard-host` should seed (or verify) `pnpm-store` for every repo the host serves, and the guard should name the recipe (`rsync` from an established host) in its message. **Acceptance.** On a host whose `pnpm-store` for one repo is deliberately emptied, the swarm run's verdict line reads `died-in:pnpm store warm check` with the FATAL text as its error line, and the healer classifies it (not `unknown`).

Fresh reproduction — matou-workstation × Matou/dev-factory, swarm run 57 (c27ad6f, 2026-08-22).

The factory's own swarm reddened with the exact #9 signature: run-verdict.txt = stage=preflight self-tests (#446), exit=1, empty --- error lines ---; worker-logs.txt/runner-journal.txt 0 bytes; healer keyed on preflight and found nothing there.

Confirmed cause (same as #9): preflight passes by hand (all 7 guards fired, exit 0). .sandcastle/pnpm-store for dev-factory on this host is empty (0 entries) — the repo just self-onboarded as the third consumer (b895146) and its store was never warm-seeded. The run passed preflight, found ready tasks (n>0), resolved its model, then hit the cold-store FATAL (run-swarm.sh:281-285) → exit 1 with no verdict_stage/SWARM_EXIT_REASON, so the EXIT trap kept the last label, preflight self-tests.

New detail for fix #1 — the mis-attribution window is WIDER than this ticket describes. In the current copy, verdict_stage "swarm model resolution (#448 fail-fast)" (line 222) is set inside the if ! swarm_resolve_model failure block. On the normal path (model resolves) it never runs, so VERDICT_STAGE stays preflight self-tests from line 165 all the way to the next unconditional verdict_stage at line 312 (pnpm install). That means the env-allowlist FATAL (251), the cold-store FATAL (282), and the secrets/nix prep in between all mis-key to preflight self-tests. Fix #1 should set verdict_stage + SWARM_EXIT_REASON at each of those exits (env-allowlist already sets SWARM_EXIT_REASON but not verdict_stage).

Note on the seeding remedy for a bash-only consumer. dev-factory's worker tasks are offline bash/mts (no pnpm install in the sandbox), and run-swarm.sh does not source .env — so SWARM_ALLOW_COLD_STORE can only be set via the workflow env, not the per-repo .env/.env.example. Whether dev-factory should warm-seed a store, run with a deliberate cold-start override, or have the guard skip non-pnpm consumers (ties to #17) is a human decision — not repaired here.

**Fresh reproduction — `matou-workstation × Matou/dev-factory`, swarm run 57 (`c27ad6f`, 2026-08-22).** The factory's own swarm reddened with the exact #9 signature: `run-verdict.txt` = `stage=preflight self-tests (#446)`, `exit=1`, **empty** `--- error lines ---`; `worker-logs.txt`/`runner-journal.txt` 0 bytes; healer keyed on preflight and found nothing there. **Confirmed cause (same as #9):** preflight passes by hand (`all 7 guards fired`, exit 0). `.sandcastle/pnpm-store` for dev-factory on this host is **empty (0 entries)** — the repo just self-onboarded as the third consumer (b895146) and its store was never warm-seeded. The run passed preflight, found ready tasks (n>0), resolved its model, then hit the cold-store FATAL (`run-swarm.sh:281-285`) → `exit 1` with no `verdict_stage`/`SWARM_EXIT_REASON`, so the EXIT trap kept the last label, `preflight self-tests`. **New detail for fix #1 — the mis-attribution window is WIDER than this ticket describes.** In the current copy, `verdict_stage "swarm model resolution (#448 fail-fast)"` (line 222) is set *inside* the `if ! swarm_resolve_model` **failure** block. On the normal path (model resolves) it never runs, so `VERDICT_STAGE` stays `preflight self-tests` from line 165 all the way to the next unconditional `verdict_stage` at line 312 (pnpm install). That means the env-allowlist FATAL (251), the cold-store FATAL (282), and the secrets/nix prep in between **all** mis-key to `preflight self-tests`. Fix #1 should set `verdict_stage` + `SWARM_EXIT_REASON` at each of those exits (env-allowlist already sets `SWARM_EXIT_REASON` but not `verdict_stage`). **Note on the seeding remedy for a bash-only consumer.** dev-factory's worker tasks are offline bash/mts (no `pnpm install` in the sandbox), and `run-swarm.sh` does not source `.env` — so `SWARM_ALLOW_COLD_STORE` can only be set via the workflow env, not the per-repo `.env`/`.env.example`. Whether dev-factory should warm-seed a store, run with a deliberate cold-start override, or have the guard skip non-pnpm consumers (ties to #17) is a human decision — not repaired here.

swarm-claim host=matou-dev-server-01 run=94
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=94 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #9 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 9,
  "status": "success",
  "commits": [
    "2711f80"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "run-swarm.sh",
    "tests/run-swarm-cold-store-test.sh",
    "tests/run-swarm-env-guard-test.sh",
    "tests/verdict-lib-test.sh",
    "verdict-lib.sh"
  ],
  "tests": [
    {
      "command": "bash tests/verdict-lib-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/run-swarm-cold-store-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/run-swarm-env-guard-test.sh",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\"; done",
      "exit_code": 0
    },
    {
      "command": "bash -n run-swarm.sh",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Cold-store FATAL sets verdict_stage + captures the FATAL error line (harness bug 1+2)": "run-swarm.sh cold-store guard now calls verdict_stage \"pnpm store warm check (#489)\" and verdict_error \"$cold_fatal\" before exit; verdict-lib.sh gains verdict_error/VERDICT_ERROR, emitted by verdict_write as the error line when no errlog yielded one (commit 2711f80).",
    ".env allowlist FATAL gets the same treatment": "run-swarm.sh .env-allowlist guard now sets verdict_stage \"env allowlist check (#593)\" + verdict_error \"$env_fatal\" (keeping its existing SWARM_EXIT_REASON=env-allowlist-violation slug).",
    "Verdict line reads died-in:pnpm store warm check with the FATAL as its error line": "tests/run-swarm-cold-store-test.sh runs the guard + EXIT-trap reason derivation verbatim: the fixed variant asserts REASON == 'died-in:pnpm store warm check (#489)', verdict file stage=pnpm store warm check (#489), and the FATAL 'pnpm store ... is EMPTY' as the error line. SWARM_EXIT_REASON left unset so the runlog reason keeps the died-in:<stage> form.",
    "The healer classifies it (not unknown)": "tests/run-swarm-cold-store-test.sh asserts seam_verdict_signal recovers a non-empty 'stage :: error' signal from the verdict (vs the buggy variant which reproduces the empty-error-block/died-in:preflight symptom). The healer keys its signature on the verdict file (heal.sh error_line -> seam_verdict_signal), so a real stage + error line is what makes it not-unknown.",
    "Test-first offline, lib change updates its test in the same commit": "New tests/verdict-lib-test.sh + tests/run-swarm-cold-store-test.sh; tests/run-swarm-env-guard-test.sh extended for the .env verdict capture; whole offline suite green (tests/**, onboarding/tests/**), bash -n run-swarm.sh OK.",
    "Operational hazard recorded": "docs/GOTCHAS.md 7 documents the guard-FATAL-to-stderr mis-key hazard and the rule; STATUS.md header + milestone log updated in the same commit."
  },
  "summary": "run-swarm's cold-pnpm-store (and .env-allowlist) FATAL now name their own verdict stage and capture the FATAL as the error line, so the death keys on pnpm store warm check with real evidence instead of an empty-blocked preflight mis-attribution the healer escalated as unknown.",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #9 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 9, "status": "success", "commits": [ "2711f80" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "run-swarm.sh", "tests/run-swarm-cold-store-test.sh", "tests/run-swarm-env-guard-test.sh", "tests/verdict-lib-test.sh", "verdict-lib.sh" ], "tests": [ { "command": "bash tests/verdict-lib-test.sh", "exit_code": 0 }, { "command": "bash tests/run-swarm-cold-store-test.sh", "exit_code": 0 }, { "command": "bash tests/run-swarm-env-guard-test.sh", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\"; done", "exit_code": 0 }, { "command": "bash -n run-swarm.sh", "exit_code": 0 } ], "criteria": { "Cold-store FATAL sets verdict_stage + captures the FATAL error line (harness bug 1+2)": "run-swarm.sh cold-store guard now calls verdict_stage \"pnpm store warm check (#489)\" and verdict_error \"$cold_fatal\" before exit; verdict-lib.sh gains verdict_error/VERDICT_ERROR, emitted by verdict_write as the error line when no errlog yielded one (commit 2711f80).", ".env allowlist FATAL gets the same treatment": "run-swarm.sh .env-allowlist guard now sets verdict_stage \"env allowlist check (#593)\" + verdict_error \"$env_fatal\" (keeping its existing SWARM_EXIT_REASON=env-allowlist-violation slug).", "Verdict line reads died-in:pnpm store warm check with the FATAL as its error line": "tests/run-swarm-cold-store-test.sh runs the guard + EXIT-trap reason derivation verbatim: the fixed variant asserts REASON == 'died-in:pnpm store warm check (#489)', verdict file stage=pnpm store warm check (#489), and the FATAL 'pnpm store ... is EMPTY' as the error line. SWARM_EXIT_REASON left unset so the runlog reason keeps the died-in:<stage> form.", "The healer classifies it (not unknown)": "tests/run-swarm-cold-store-test.sh asserts seam_verdict_signal recovers a non-empty 'stage :: error' signal from the verdict (vs the buggy variant which reproduces the empty-error-block/died-in:preflight symptom). The healer keys its signature on the verdict file (heal.sh error_line -> seam_verdict_signal), so a real stage + error line is what makes it not-unknown.", "Test-first offline, lib change updates its test in the same commit": "New tests/verdict-lib-test.sh + tests/run-swarm-cold-store-test.sh; tests/run-swarm-env-guard-test.sh extended for the .env verdict capture; whole offline suite green (tests/**, onboarding/tests/**), bash -n run-swarm.sh OK.", "Operational hazard recorded": "docs/GOTCHAS.md 7 documents the guard-FATAL-to-stderr mis-key hazard and the rule; STATUS.md header + milestone log updated in the same commit." }, "summary": "run-swarm's cold-pnpm-store (and .env-allowlist) FATAL now name their own verdict stage and capture the FATAL as the error line, so the death keys on pnpm store warm check with real evidence instead of an empty-blocked preflight mis-attribution the healer escalated as unknown.", "blockers": [], "no_code_change": "" } ``` </details>
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.

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