reporter files a phantom leg-red ticket when preflight parks on exit 3 — it diagnoses the PREVIOUS run dir, and the ticket then blocks the drive that would disprove it #918

Closed
opened 2026-08-28 03:31:29 +00:00 by ben · 2 comments
Owner

The defect

When the drive parks at preflight with exit 3 (bootstrap-stale), no run directory is created. scripts/rehearsal-cycle.sh then resolves run_dir as the newest directory under test-results/drive-<target>/ — which is the previous drive — and hands that to .sandcastle/rehearsal-report.sh. The reporter dutifully diagnoses that older run's leg failure and files it as a fresh defect, blocking the drive issue.

This contradicts #600's explicit contract for the gate it added:

On staleness: park loudly, don't drive — exit the preflight with a distinct verdict (bootstrap-stale: served <sha> is N agent-commits behind origin/main) so the reporter files/updates ONE staleness ticket instead of a misleading leg-red ticket.

A misleading leg-red ticket is precisely what it files.

Observed, 2026-08-27/28 — four tickets for one phantom

#788's cycle produced #912, #913, #916 and #917, all titled as the same consent sshd defect, all citing drive 20260827T185504Z (18:56Z), long after that defect was fixed by 838d8c44 and shipped in the served artifact. Executor log for the last of them:

==> preflight
PREFLIGHT: bootstrap-stale: served dcab019c… is 1 agent-commit(s) behind origin/main
           (newest agent-affecting: 6fc7fba1b1a8)
==> RED (exit 3) — reporting (the reporter blocks #788)
reporter: filed 'consent: agent enables `sshd` unit…' (28ff46f6d26f)
reporter: drive issue #788 blocked by 917

Why it is a deadlock, not just noise

The filed ticket blocks the drive issue. The only thing that could disprove it is a drive. The drive cannot run while blocked. Each executor cycle re-files it from the same stale evidence, so it never resolves on its own — a human has to close a ticket per cycle, and the next cycle files another. I closed four by hand today; that is the symptom, not the fix.

It also sends swarm workers at fixed defects and gives the healer an already-repaired red to chase (three attempts, two rebase onto origin/main conflicted, one diff cap breach (2 files / 91 lines; cap 3/60), all reverted — plus three executor ticks lost to the capacity slot those attempts held).

Fix

  1. An exit-3 park must not be reported as a leg red. rehearsal-cycle.sh should branch on rc == 3 before the reporter call and either skip reporting entirely or route to a staleness-specific path — the gate already emits a distinct, machine-readable verdict line to key on.
  2. The reporter must never diagnose a run directory this cycle did not produce. Pass the run dir explicitly rather than re-globbing "newest", or refuse when the newest dir predates the cycle's own start time. This is the durable guard: it fixes every future variant, not just exit 3.
  3. When staleness parks, file or update ONE staleness ticket as #600 intended — idempotent, so repeated parks update rather than multiply.

Neither the reporter nor the healer checks whether the red it is acting on still reproduces in the bits a new drive would run before filing or fixing. The check already exists and is cheap — scripts/lib/bootstrap-staleness-lib.sh does exactly this for the drive-side preflight (HEAD get.idss.nz, read x-idss-release, git merge-base --is-ancestor <fix> <served>). Reusing it on the report/heal side would have suppressed all four tickets above.

Acceptance

  • A bootstrap-stale preflight park files no leg-red ticket and blocks the drive issue on nothing.
  • The reporter refuses (loudly) to diagnose a run directory older than the cycle that invoked it.
  • Repeated staleness parks converge on one ticket, updated, not N tickets.
  • Offline cover in scripts/tests/ per the house pattern, exercising rc=3 with a pre-existing older run dir present.

Evidence

/home/dev/swarm/rehearsal-executor.log on matou-workstation (the cycle quoted above); tickets #912, #913, #916, #917; drive test-results/drive-idip/20260827T185504Z.

Filed by the watch under ADR 0174 after closing the fourth phantom by hand. Veto anytime.

## The defect When the drive parks at preflight with **exit 3** (`bootstrap-stale`), no run directory is created. `scripts/rehearsal-cycle.sh` then resolves `run_dir` as the newest directory under `test-results/drive-<target>/` — which is the **previous** drive — and hands that to `.sandcastle/rehearsal-report.sh`. The reporter dutifully diagnoses that older run's leg failure and files it as a fresh defect, blocking the drive issue. This contradicts #600's explicit contract for the gate it added: > On staleness: **park loudly, don't drive** — exit the preflight with a distinct verdict (`bootstrap-stale: served <sha> is N agent-commits behind origin/main`) **so the reporter files/updates ONE staleness ticket instead of a misleading leg-red ticket.** A misleading leg-red ticket is precisely what it files. ## Observed, 2026-08-27/28 — four tickets for one phantom `#788`'s cycle produced **#912, #913, #916 and #917**, all titled as the same `consent` sshd defect, all citing drive `20260827T185504Z` (18:56Z), long after that defect was fixed by `838d8c44` and shipped in the served artifact. Executor log for the last of them: ``` ==> preflight PREFLIGHT: bootstrap-stale: served dcab019c… is 1 agent-commit(s) behind origin/main (newest agent-affecting: 6fc7fba1b1a8) ==> RED (exit 3) — reporting (the reporter blocks #788) reporter: filed 'consent: agent enables `sshd` unit…' (28ff46f6d26f) reporter: drive issue #788 blocked by 917 ``` ## Why it is a deadlock, not just noise The filed ticket **blocks the drive issue**. The only thing that could disprove it is a drive. The drive cannot run while blocked. Each executor cycle re-files it from the same stale evidence, so it never resolves on its own — a human has to close a ticket per cycle, and the next cycle files another. I closed four by hand today; that is the symptom, not the fix. It also sends swarm workers at fixed defects and gives the healer an already-repaired red to chase (three attempts, two `rebase onto origin/main conflicted`, one `diff cap breach (2 files / 91 lines; cap 3/60)`, all reverted — plus three executor ticks lost to the capacity slot those attempts held). ## Fix 1. **An exit-3 park must not be reported as a leg red.** `rehearsal-cycle.sh` should branch on `rc == 3` before the reporter call and either skip reporting entirely or route to a staleness-specific path — the gate already emits a distinct, machine-readable verdict line to key on. 2. **The reporter must never diagnose a run directory this cycle did not produce.** Pass the run dir explicitly rather than re-globbing "newest", or refuse when the newest dir predates the cycle's own start time. This is the durable guard: it fixes every future variant, not just exit 3. 3. **When staleness parks, file or update ONE staleness ticket** as #600 intended — idempotent, so repeated parks update rather than multiply. ## Related, and worth fixing in the same pass Neither the reporter nor the healer checks whether the red it is acting on **still reproduces in the bits a new drive would run** before filing or fixing. The check already exists and is cheap — `scripts/lib/bootstrap-staleness-lib.sh` does exactly this for the drive-side preflight (`HEAD get.idss.nz`, read `x-idss-release`, `git merge-base --is-ancestor <fix> <served>`). Reusing it on the report/heal side would have suppressed all four tickets above. ## Acceptance - A `bootstrap-stale` preflight park files no leg-red ticket and blocks the drive issue on nothing. - The reporter refuses (loudly) to diagnose a run directory older than the cycle that invoked it. - Repeated staleness parks converge on one ticket, updated, not N tickets. - Offline cover in `scripts/tests/` per the house pattern, exercising rc=3 with a pre-existing older run dir present. ## Evidence `/home/dev/swarm/rehearsal-executor.log` on `matou-workstation` (the cycle quoted above); tickets #912, #913, #916, #917; drive `test-results/drive-idip/20260827T185504Z`. *Filed by the watch under ADR 0174 after closing the fourth phantom by hand. Veto anytime.*

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

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

close-report for #918 — status success

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

envelope
{
  "issue": 918,
  "status": "success",
  "commits": [
    "4e292243"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "scripts/rehearsal-cycle.sh",
    "scripts/lib/rehearsal-staleness-park-lib.sh",
    "scripts/tests/rehearsal-staleness-park-test.sh"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/rehearsal-staleness-park-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash scripts/tests/rehearsal-release-nudge-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash -n scripts/rehearsal-cycle.sh",
      "exit_code": 0
    },
    {
      "command": "for t in scripts/tests/*.sh; do bash \"$t\"; done",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A bootstrap-stale preflight park files no leg-red ticket and blocks the drive issue on nothing": "scripts/rehearsal-cycle.sh case dispatch: rc==3 with a #600 verdict -> park-staleness, which calls rehearsal_staleness_park (files/updates ONE staleness ticket, no leg red, no dependency on the drive issue) and NEVER invokes .sandcastle/rehearsal-report.sh. Proven by scripts/tests/rehearsal-staleness-park-test.sh (rc=3 with an older run dir present decides park-staleness, never report; the park-staleness) arm contains no rehearsal-report.sh).",
    "The reporter refuses (loudly) to diagnose a run directory older than the cycle that invoked it": "rehearsal_report_decision (scripts/lib/rehearsal-staleness-park-lib.sh) returns refuse-stale-dir when a red's run-dir stamp predates cycle_start (stamped BEFORE the drive); the refuse-stale-dir) arm in scripts/rehearsal-cycle.sh echoes a loud REFUSING message and files nothing. Proven by the test's refuse-stale-dir vs report cases.",
    "Repeated staleness parks converge on one ticket, updated, not N tickets": "rehearsal_staleness_park is idempotent via a body marker (<!-- bootstrap-staleness-park (#918) -->): rehearsal_staleness_find returns the existing open ticket and the park comments on it instead of filing anew; a drive past preflight (rc!=3) calls rehearsal_staleness_clear to close it. Proven by the test's find hit/miss cases (Surface 3).",
    "Offline cover in scripts/tests/ per the house pattern, exercising rc=3 with a pre-existing older run dir present": "scripts/tests/rehearsal-staleness-park-test.sh (18 checks) builds test-results/drive-idip/<older-stamp>, sets rc=3, and asserts park-staleness/park-preflight (never report); auto-discovered by seam-smoke's scripts/tests/*.sh loop."
  },
  "summary": "An exit-3 (bootstrap-stale) preflight park no longer re-globs the previous drive's run dir into a phantom leg-red ticket that deadlocks the drive; the report path decides from a pure rc+stamp verdict and files/updates ONE idempotent staleness ticket instead.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #918 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 918, "status": "success", "commits": [ "4e292243" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "scripts/rehearsal-cycle.sh", "scripts/lib/rehearsal-staleness-park-lib.sh", "scripts/tests/rehearsal-staleness-park-test.sh" ], "tests": [ { "command": "bash scripts/tests/rehearsal-staleness-park-test.sh", "exit_code": 0 }, { "command": "bash scripts/tests/rehearsal-release-nudge-test.sh", "exit_code": 0 }, { "command": "bash -n scripts/rehearsal-cycle.sh", "exit_code": 0 }, { "command": "for t in scripts/tests/*.sh; do bash \"$t\"; done", "exit_code": 0 } ], "criteria": { "A bootstrap-stale preflight park files no leg-red ticket and blocks the drive issue on nothing": "scripts/rehearsal-cycle.sh case dispatch: rc==3 with a #600 verdict -> park-staleness, which calls rehearsal_staleness_park (files/updates ONE staleness ticket, no leg red, no dependency on the drive issue) and NEVER invokes .sandcastle/rehearsal-report.sh. Proven by scripts/tests/rehearsal-staleness-park-test.sh (rc=3 with an older run dir present decides park-staleness, never report; the park-staleness) arm contains no rehearsal-report.sh).", "The reporter refuses (loudly) to diagnose a run directory older than the cycle that invoked it": "rehearsal_report_decision (scripts/lib/rehearsal-staleness-park-lib.sh) returns refuse-stale-dir when a red's run-dir stamp predates cycle_start (stamped BEFORE the drive); the refuse-stale-dir) arm in scripts/rehearsal-cycle.sh echoes a loud REFUSING message and files nothing. Proven by the test's refuse-stale-dir vs report cases.", "Repeated staleness parks converge on one ticket, updated, not N tickets": "rehearsal_staleness_park is idempotent via a body marker (<!-- bootstrap-staleness-park (#918) -->): rehearsal_staleness_find returns the existing open ticket and the park comments on it instead of filing anew; a drive past preflight (rc!=3) calls rehearsal_staleness_clear to close it. Proven by the test's find hit/miss cases (Surface 3).", "Offline cover in scripts/tests/ per the house pattern, exercising rc=3 with a pre-existing older run dir present": "scripts/tests/rehearsal-staleness-park-test.sh (18 checks) builds test-results/drive-idip/<older-stamp>, sets rc=3, and asserts park-staleness/park-preflight (never report); auto-discovered by seam-smoke's scripts/tests/*.sh loop." }, "summary": "An exit-3 (bootstrap-stale) preflight park no longer re-globs the previous drive's run dir into a phantom leg-red ticket that deadlocks the drive; the report path decides from a pure rc+stamp verdict and files/updates ONE idempotent staleness ticket instead.", "reason": "", "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.

Dependencies

No dependencies set.

Reference
Matou/idss#918
No description provided.