run-swarm: a transient Forgejo 5xx while listing ready tasks reds a run and mis-keys the death to preflight (GOTCHAS #7 family, uncovered path) #52

Open
opened 2026-08-24 03:18:04 +00:00 by matou-build-agent · 8 comments

Symptom

Run 421 (swarm (2), job id 19548) reddened with verdict stage=preflight self-tests (#446) exit=22 and an empty --- error lines --- block
(evidence run-verdict.txt). Preflight actually passed — adjacent runs in
the same minute spawned workers and closed tickets fine (#48 → a35badb). At
the moment of failure the Forgejo API was degraded: the healer's latency
probe recorded api_seconds=timeout (api-timing.txt), amid a heavy
trigger burst (dozens of swarm runs 02:00–03:12 hammering the instance).

Root cause

This is a new member of GOTCHAS #7's mis-key family, on a path that
rule never covered. exit=22 is curl -sf hitting an HTTP ≥400 (a
transient Forgejo 5xx under load). The failing call is in the happy-path
window of run-swarm.sh after preflight passes (line 178) but before
the next verdict_stage at line 368 — specifically ready="$(bash list-ready-tasks.sh)" (run-swarm.sh:212) → list-ready-tasks.sh:76
batch="$(api ...)" where api() { curl -sf ...; } (also the 10-wide
curl -sf at list-ready-tasks.sh:96, and janitor_sweep at run-swarm.sh:209).

A transient 5xx makes curl -sf exit 22; under set -e that propagates up
through the $(...) assignment and kills run-swarm while VERDICT_STAGE is
still preflight self-tests (#446) and no verdict_error was set — hence
the wrong stage + empty evidence, exactly the pain GOTCHA #7 set out to end
for the FATAL-to-stderr guards (cold-store, env-allowlist) but left open for
the implicit-set-e-death-from-an-api-curl case.

Two defects compound: (a) the ready-list/janitor Forgejo reads have no
retry/backoff and no --max-time
(unlike forgejo-lib.sh:_forgejo_get,
heal.sh, session-runner.sh, schedule-backstop.sh which all use
--max-time 30), so a brief blip that a single retry would absorb reds a
run; and (b) the death is mis-keyed to preflight with no evidence, so the
healer signs on the wrong signature.

Acceptance criteria

  1. The ready-task listing tolerates a transient Forgejo 5xx/timeout: the
    ready-list (and janitor sweep) Forgejo GETs retry with backoff (and carry
    a --max-time) so a single transient blip does not red an otherwise-idle
    tick. Match the existing _forgejo_get posture.
  2. A death while listing ready tasks is not mis-keyed to preflight self-tests (#446): set verdict_stage "list ready tasks" (or equivalent)
    before line 212 and capture the failing curl's status/line via
    verdict_error, extending GOTCHAS #7's rule to the implicit-set -e-death
    path. The verdict file must carry the real stage + a non-empty error line.
  3. Offline guard-fragment test (sibling of
    tests/run-swarm-cold-store-test.sh / run-swarm-env-guard-test.sh)
    asserting: a shimmed curl returning HTTP 503 on the ready-list makes the
    verdict record the list ready tasks stage with a non-empty error block,
    and seam_verdict_signal recovers a non-empty signal (not the stale
    preflight self-tests marker). Update GOTCHAS #7 to name this path.
  4. Every changed lib updates its test in the same commit (CLAUDE.md rule 2);
    full offline suite green.

Notes

  • The incident itself self-heals — the API recovered (probe now
    http=200 in ~1.6 s) and the 30-min cron backstop re-lists; no run is
    wedged (swarm-lock.txt = free). This ticket is the latent-robustness fix,
    not an outage fix.
  • Product-class: the fix lives in the harness source at the repo root
    (run-swarm.sh, list-ready-tasks.sh, docs/GOTCHAS.md). A root fix does
    not reach the running .sandcastle/ copy until a human re-vendors
    (onboarding/onboard.sh vendor .sandcastle <sha>).
  • Filed by the swarm healer from incident run 421 / signature 2f7109f4c37a.
## Symptom Run 421 (`swarm (2)`, job id 19548) reddened with verdict `stage=preflight self-tests (#446) exit=22` and an **empty** `--- error lines ---` block (evidence `run-verdict.txt`). Preflight actually passed — adjacent runs in the same minute spawned workers and closed tickets fine (#48 → a35badb). At the moment of failure the Forgejo API was degraded: the healer's latency probe recorded `api_seconds=timeout` (`api-timing.txt`), amid a heavy trigger burst (dozens of `swarm` runs 02:00–03:12 hammering the instance). ## Root cause This is a new member of **GOTCHAS #7**'s mis-key family, on a path that rule never covered. `exit=22` is `curl -sf` hitting an HTTP ≥400 (a transient Forgejo 5xx under load). The failing call is in the happy-path window of `run-swarm.sh` **after** preflight passes (line 178) but **before** the next `verdict_stage` at line 368 — specifically `ready="$(bash list-ready-tasks.sh)"` (run-swarm.sh:212) → `list-ready-tasks.sh:76` `batch="$(api ...)"` where `api() { curl -sf ...; }` (also the 10-wide `curl -sf` at list-ready-tasks.sh:96, and `janitor_sweep` at run-swarm.sh:209). A transient 5xx makes `curl -sf` exit 22; under `set -e` that propagates up through the `$(...)` assignment and kills run-swarm while `VERDICT_STAGE` is still `preflight self-tests (#446)` and no `verdict_error` was set — hence the wrong stage + empty evidence, exactly the pain GOTCHA #7 set out to end for the FATAL-to-stderr guards (cold-store, env-allowlist) but left open for the implicit-set-e-death-from-an-api-curl case. Two defects compound: (a) the ready-list/janitor Forgejo reads have **no retry/backoff and no `--max-time`** (unlike `forgejo-lib.sh:_forgejo_get`, `heal.sh`, `session-runner.sh`, `schedule-backstop.sh` which all use `--max-time 30`), so a brief blip that a single retry would absorb reds a run; and (b) the death is **mis-keyed** to preflight with no evidence, so the healer signs on the wrong signature. ## Acceptance criteria 1. The ready-task listing tolerates a transient Forgejo 5xx/timeout: the ready-list (and janitor sweep) Forgejo GETs retry with backoff (and carry a `--max-time`) so a single transient blip does not red an otherwise-idle tick. Match the existing `_forgejo_get` posture. 2. A death while listing ready tasks is **not** mis-keyed to `preflight self-tests (#446)`: set `verdict_stage "list ready tasks"` (or equivalent) before line 212 and capture the failing curl's status/line via `verdict_error`, extending GOTCHAS #7's rule to the implicit-`set -e`-death path. The verdict file must carry the real stage + a non-empty error line. 3. Offline guard-fragment test (sibling of `tests/run-swarm-cold-store-test.sh` / `run-swarm-env-guard-test.sh`) asserting: a shimmed `curl` returning HTTP 503 on the ready-list makes the verdict record the `list ready tasks` stage with a non-empty error block, and `seam_verdict_signal` recovers a non-empty signal (not the stale `preflight self-tests` marker). Update GOTCHAS #7 to name this path. 4. Every changed lib updates its test in the same commit (CLAUDE.md rule 2); full offline suite green. ## Notes - The **incident itself self-heals** — the API recovered (probe now `http=200` in ~1.6 s) and the 30-min cron backstop re-lists; no run is wedged (`swarm-lock.txt` = free). This ticket is the latent-robustness fix, not an outage fix. - Product-class: the fix lives in the harness **source** at the repo root (`run-swarm.sh`, `list-ready-tasks.sh`, `docs/GOTCHAS.md`). A root fix does **not** reach the running `.sandcastle/` copy until a human re-vendors (`onboarding/onboard.sh vendor .sandcastle <sha>`). - Filed by the swarm healer from incident run 421 / signature `2f7109f4c37a`.
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=423
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=423 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #52 — status success

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

envelope
{
  "issue": 52,
  "status": "success",
  "commits": [
    "866dc378263c7b9e13827fb679e925ca906fb5c0"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/GOTCHAS.md",
    "list-ready-tasks.sh",
    "run-swarm.sh",
    "schedule-lib.sh",
    "tests/run-swarm-stages-test.sh",
    "tests/schedule-lib-test.sh",
    "tests/run-swarm-ready-list-test.sh"
  ],
  "tests": [
    {
      "command": "bash tests/run-swarm-ready-list-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/schedule-lib-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/run-swarm-stages-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
    }
  ],
  "criteria": {
    "1. ready-task listing tolerates a transient 5xx/timeout: ready-list (and janitor) reads retry with backoff and carry a --max-time; match _forgejo_get posture": "list-ready-tasks.sh api() and the 10-wide dependency curl now retry with exponential backoff, each attempt bounded by --max-time (LIST_READY_MAX_TIME=30), matching forgejo-lib.sh:_forgejo_get (commit 866dc37). The janitor already carries --max-time (#28's CLAIM_API_MAX_TIME) AND cannot red a tick (schedule_janitor_rearm runs `janitor_sweep || true`; every read inside is `|| return 0`/`|| continue` guarded), so criterion 1's stated goal already held for it; retry stayed off the claim path because #28/GOTCHAS 16 deliberately fails it fast to release the host slot (ruled two-way-door, ADR 0174 — documented in the commit/STATUS). Proven by tests/run-swarm-ready-list-test.sh arms 3 & 4 (transient blip on both reads absorbed).",
    "2. a death while listing ready tasks is not mis-keyed to preflight: set verdict_stage 'list ready tasks' before the listing and capture the failing curl's status/line via verdict_error; verdict carries the real stage + a non-empty error line": "schedule_list_ready_or_verdict (schedule-lib.sh) sets `verdict_stage \"list ready tasks\"` and, on failure, `verdict_error` with the failing read's rc + stderr; run-swarm.sh calls it on its own shell via an out-file (not $(...)) so the parent VERDICT_* the EXIT trap reads carry through. Proven by run-swarm-ready-list-test.sh arm 1: verdict has `stage=list ready tasks` + a non-empty error block.",
    "3. offline guard-fragment test asserting a shimmed curl 503 on the ready-list makes the verdict record the 'list ready tasks' stage with a non-empty error block, seam_verdict_signal recovers a non-empty signal (not the stale preflight marker); GOTCHAS #7 names the path": "tests/run-swarm-ready-list-test.sh (sibling of run-swarm-cold-store/env-guard) drives the REAL list-ready-tasks.sh with a shimmed curl: arm 1 asserts stage + non-empty error + seam_verdict_signal non-empty AND not preflight; arm 2 (teeth) reproduces the pre-fix mis-key. GOTCHAS #7 extended with the implicit-set-e path naming #52 and the new test.",
    "4. every changed lib updates its test in the same commit; full offline suite green": "schedule-lib.sh -> tests/schedule-lib-test.sh (new group 6); list-ready-tasks.sh -> tests/run-swarm-ready-list-test.sh; run-swarm.sh seam order -> tests/run-swarm-stages-test.sh updated. Full suite (all tests/*.sh + onboarding/tests/*.sh) green — no FAIL lines."
  },
  "summary": "The ready-list read now retries a transient Forgejo 5xx/timeout under a --max-time and re-keys any death there to the 'list ready tasks' stage with a real error line, closing GOTCHAS #7's implicit-set-e sibling.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #52 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 52, "status": "success", "commits": [ "866dc378263c7b9e13827fb679e925ca906fb5c0" ], "changed_files": [ "STATUS.md", "docs/GOTCHAS.md", "list-ready-tasks.sh", "run-swarm.sh", "schedule-lib.sh", "tests/run-swarm-stages-test.sh", "tests/schedule-lib-test.sh", "tests/run-swarm-ready-list-test.sh" ], "tests": [ { "command": "bash tests/run-swarm-ready-list-test.sh", "exit_code": 0 }, { "command": "bash tests/schedule-lib-test.sh", "exit_code": 0 }, { "command": "bash tests/run-swarm-stages-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 } ], "criteria": { "1. ready-task listing tolerates a transient 5xx/timeout: ready-list (and janitor) reads retry with backoff and carry a --max-time; match _forgejo_get posture": "list-ready-tasks.sh api() and the 10-wide dependency curl now retry with exponential backoff, each attempt bounded by --max-time (LIST_READY_MAX_TIME=30), matching forgejo-lib.sh:_forgejo_get (commit 866dc37). The janitor already carries --max-time (#28's CLAIM_API_MAX_TIME) AND cannot red a tick (schedule_janitor_rearm runs `janitor_sweep || true`; every read inside is `|| return 0`/`|| continue` guarded), so criterion 1's stated goal already held for it; retry stayed off the claim path because #28/GOTCHAS 16 deliberately fails it fast to release the host slot (ruled two-way-door, ADR 0174 — documented in the commit/STATUS). Proven by tests/run-swarm-ready-list-test.sh arms 3 & 4 (transient blip on both reads absorbed).", "2. a death while listing ready tasks is not mis-keyed to preflight: set verdict_stage 'list ready tasks' before the listing and capture the failing curl's status/line via verdict_error; verdict carries the real stage + a non-empty error line": "schedule_list_ready_or_verdict (schedule-lib.sh) sets `verdict_stage \"list ready tasks\"` and, on failure, `verdict_error` with the failing read's rc + stderr; run-swarm.sh calls it on its own shell via an out-file (not $(...)) so the parent VERDICT_* the EXIT trap reads carry through. Proven by run-swarm-ready-list-test.sh arm 1: verdict has `stage=list ready tasks` + a non-empty error block.", "3. offline guard-fragment test asserting a shimmed curl 503 on the ready-list makes the verdict record the 'list ready tasks' stage with a non-empty error block, seam_verdict_signal recovers a non-empty signal (not the stale preflight marker); GOTCHAS #7 names the path": "tests/run-swarm-ready-list-test.sh (sibling of run-swarm-cold-store/env-guard) drives the REAL list-ready-tasks.sh with a shimmed curl: arm 1 asserts stage + non-empty error + seam_verdict_signal non-empty AND not preflight; arm 2 (teeth) reproduces the pre-fix mis-key. GOTCHAS #7 extended with the implicit-set-e path naming #52 and the new test.", "4. every changed lib updates its test in the same commit; full offline suite green": "schedule-lib.sh -> tests/schedule-lib-test.sh (new group 6); list-ready-tasks.sh -> tests/run-swarm-ready-list-test.sh; run-swarm.sh seam order -> tests/run-swarm-stages-test.sh updated. Full suite (all tests/*.sh + onboarding/tests/*.sh) green — no FAIL lines." }, "summary": "The ready-list read now retries a transient Forgejo 5xx/timeout under a --max-time and re-keys any death there to the 'list ready tasks' stage with a real error line, closing GOTCHAS #7's implicit-set-e sibling.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
matou-build-agent 2026-11-19 19:29:25 +00:00
Author
Member

🚨 Reopened — a push-mode close did NOT land on main (#283). close-report closed this issue against the pushed worker branch, but the host's post-run verify rolled the land back (the promote did not advance main (a no-op push to main)), so origin/main never carried the commits (354f9df6966b7090dfebcc5b39506ae3e20d97ba). The gates-passed comment above is therefore NOT true of main. Reopening and relabelling ready-for-session so the work is redone where it can land; the commits are parked on a rescue branch for triage (see this run's alarm).

:rotating_light: **Reopened — a push-mode close did NOT land on `main` (#283).** close-report closed this issue against the pushed worker branch, but the host's post-run verify rolled the land back (`the promote did not advance main (a no-op push to main)`), so `origin/main` never carried the commits (`354f9df6966b7090dfebcc5b39506ae3e20d97ba`). The gates-passed comment above is therefore NOT true of `main`. Reopening and relabelling `ready-for-session` so the work is redone where it can land; the commits are parked on a rescue branch for triage (see this run's alarm).
Author
Member

close-report for #52 — status success (already landed; spurious reopen)

Ruled by agent under ADR 0174 — veto anytime.

Finding: this ticket's work is genuinely complete on main and has been since 2026-08-24. The 2026-11-19 reopen was a spurious #283-reconcile false-positive, not outstanding work. No new code was needed; re-doing the fix would only produce another no-op land and re-trigger the reopen loop.

What proves it (verified on origin/main today, 2026-11-19)

  • Fix commit 866dc37 ("sandcastle: a transient Forgejo 5xx while listing ready tasks stops redding a run and mis-keying the death to preflight (#52)") is byte-for-byte on origin/main (git merge-base --is-ancestor 866dc37 origin/main → yes).
  • All four acceptance criteria met by 866dc37:
    1. list-ready-tasks.sh api() and the 10-wide dependency curl retry with exponential backoff, each attempt --max-time-bounded (LIST_READY_MAX_TIME/RETRIES/BACKOFF), matching forgejo-lib.sh:_forgejo_get. (Scope ruling documented in the commit: retry stayed off the janitor path — it already carries --max-time and is || true-guarded — and off the claim path, which deliberately fails fast per #28/GOTCHAS 16.)
    2. schedule_list_ready_or_verdict (schedule-lib.sh:113) sets verdict_stage "list ready tasks" and captures the failing read via verdict_error, on run-swarm's own shell through an out-file (not $(...)), so the EXIT trap's VERDICT_* carry the real stage + a non-empty error line. run-swarm.sh:299 calls it in place of the bare assignment.
    3. tests/run-swarm-ready-list-test.sh exists (sibling of the cold-store / env-guard tests): shimmed curl 503 → verdict records the list ready tasks stage + non-empty error, seam_verdict_signal non-empty and not the stale preflight marker; a teeth arm reproduces the pre-fix mis-key.
    4. docs/gotchas/07-*.md names the implicit-set -e path; GOTCHAS 53/55/56 have since adopted #52's retry posture as the standard — months of work built atop this fix.
  • Tests pass today (exit codes checked):
    • bash tests/run-swarm-ready-list-test.sh → PASS
    • bash tests/schedule-lib-test.sh → PASS
    • bash tests/run-swarm-stages-test.sh → PASS

Why the 2026-11-19 reopen was spurious

The reopen comment cited commit 354f9df6966b7090dfebcc5b39506ae3e20d97ba as "did not land". That commit does not exist in the repo. The rescue branch the run parked, sandcastle/rescue-20261119-193223, has its tip at fc4c1c2 — an ancestor of main, zero commits and zero diff versus origin/main. The re-attempt produced nothing that was not already landed: the "no-op push to main" the host verify reported was a no-op because the fix was already there, which the #283 reconcile mis-read as a stranded close.

That reconcile edge (reopening an already-landed ticket on a no-op re-land) is filed as follow-up #372 so the loop is fixed properly rather than re-dispatched onto #52 forever.

Landing

push mode. Nothing to land — the fix is already on main byte-for-byte; no commit was made and nothing was pushed (a no-op commit would be dishonest and would re-arm the loop). Closing on the verified-already-done basis.

**close-report** for #52 — status `success` (already landed; spurious reopen) Ruled by agent under ADR 0174 — veto anytime. **Finding: this ticket's work is genuinely complete on `main` and has been since 2026-08-24.** The 2026-11-19 reopen was a spurious #283-reconcile false-positive, not outstanding work. No new code was needed; re-doing the fix would only produce another no-op land and re-trigger the reopen loop. ### What proves it (verified on `origin/main` today, 2026-11-19) - **Fix commit `866dc37`** ("sandcastle: a transient Forgejo 5xx while listing ready tasks stops redding a run and mis-keying the death to preflight (#52)") is byte-for-byte on `origin/main` (`git merge-base --is-ancestor 866dc37 origin/main` → yes). - **All four acceptance criteria met by `866dc37`:** 1. `list-ready-tasks.sh` `api()` and the 10-wide dependency `curl` retry with exponential backoff, each attempt `--max-time`-bounded (`LIST_READY_MAX_TIME`/`RETRIES`/`BACKOFF`), matching `forgejo-lib.sh:_forgejo_get`. (Scope ruling documented in the commit: retry stayed off the janitor path — it already carries `--max-time` and is `|| true`-guarded — and off the claim path, which deliberately fails fast per #28/GOTCHAS 16.) 2. `schedule_list_ready_or_verdict` (`schedule-lib.sh:113`) sets `verdict_stage "list ready tasks"` and captures the failing read via `verdict_error`, on run-swarm's own shell through an out-file (not `$(...)`), so the EXIT trap's `VERDICT_*` carry the real stage + a non-empty error line. `run-swarm.sh:299` calls it in place of the bare assignment. 3. `tests/run-swarm-ready-list-test.sh` exists (sibling of the cold-store / env-guard tests): shimmed `curl` 503 → verdict records the `list ready tasks` stage + non-empty error, `seam_verdict_signal` non-empty and not the stale `preflight` marker; a teeth arm reproduces the pre-fix mis-key. 4. `docs/gotchas/07-*.md` names the implicit-`set -e` path; GOTCHAS 53/55/56 have since adopted #52's retry posture as the standard — months of work built atop this fix. - **Tests pass today** (exit codes checked): - `bash tests/run-swarm-ready-list-test.sh` → PASS - `bash tests/schedule-lib-test.sh` → PASS - `bash tests/run-swarm-stages-test.sh` → PASS ### Why the 2026-11-19 reopen was spurious The reopen comment cited commit `354f9df6966b7090dfebcc5b39506ae3e20d97ba` as "did not land". That commit **does not exist** in the repo. The rescue branch the run parked, `sandcastle/rescue-20261119-193223`, has its tip at `fc4c1c2` — an **ancestor of `main`, zero commits and zero diff versus `origin/main`**. The re-attempt produced nothing that was not already landed: the "no-op push to main" the host verify reported was a no-op *because the fix was already there*, which the #283 reconcile mis-read as a stranded close. That reconcile edge (reopening an already-landed ticket on a no-op re-land) is filed as follow-up **#372** so the loop is fixed properly rather than re-dispatched onto #52 forever. ### Landing push mode. **Nothing to land** — the fix is already on `main` byte-for-byte; no commit was made and nothing was pushed (a no-op commit would be dishonest and would re-arm the loop). Closing on the verified-already-done basis.
matou-build-agent 2026-11-19 20:58:31 +00:00
Author
Member

🚨 Reopened — a push-mode close did NOT land on main (#283). close-report closed this issue against the pushed worker branch, but the host's post-run verify rolled the land back (push-parked-on-rescue), so origin/main never carried the commits (4e25556e02c7babe3223488e53b4079d30495096). The gates-passed comment above is therefore NOT true of main. Reopening and relabelling ready-for-session so the work is redone where it can land; the commits are parked on a rescue branch for triage (see this run's alarm).

:rotating_light: **Reopened — a push-mode close did NOT land on `main` (#283).** close-report closed this issue against the pushed worker branch, but the host's post-run verify rolled the land back (`push-parked-on-rescue`), so `origin/main` never carried the commits (`4e25556e02c7babe3223488e53b4079d30495096`). The gates-passed comment above is therefore NOT true of `main`. Reopening and relabelling `ready-for-session` so the work is redone where it can land; the commits are parked on a rescue branch for triage (see this run's alarm).
Author
Member

close-report for #52 — status success (already landed on main; no commit — see the loop note)

Ruled by agent under ADR 0174 — veto anytime.

This ticket's work is genuinely complete on main and has been since 2026-08-24. I made no commit: the fix is byte-for-byte on origin/main already, and a no-op/rework commit would be dishonest AND would re-arm the #283 reconcile loop that has reopened this ticket twice today (19:29Z, 20:58Z). This close repeats the 2026-11-19 19:35Z ruling with fresh verification on today's origin/main (44e5984).

Verified on origin/main today (2026-11-19)

  • Fix commit 866dc37 ("a transient Forgejo 5xx while listing ready tasks stops redding a run and mis-keying the death to preflight (#52)") is an ancestor of origin/main (git merge-base --is-ancestor 866dc37 origin/main → yes).

  • All four acceptance criteria met:

    1. Retry/backoff + --max-time. list-ready-tasks.sh api() (and the 10-wide dependency curl) retry with exponential backoff, each attempt bounded by --max-time (LIST_READY_MAX_TIME/RETRIES/BACKOFF), matching forgejo-lib.sh:_forgejo_get. The janitor/claim paths were deliberately left out (janitor already --max-time-carrying and || true-guarded; the claim path fails fast to release the slot per #28/GOTCHAS 16 — documented in the commit).
    2. No mis-key to preflight. schedule_list_ready_or_verdict (schedule-lib.sh:113) sets verdict_stage "list ready tasks" and captures the failing read via verdict_error, run on run-swarm's own shell through an out-file (not $(...)), so the EXIT trap's VERDICT_* carry the real stage + a non-empty error line. run-swarm.sh:299 calls it in place of the bare assignment.
    3. Offline guard test + GOTCHAS #7. tests/run-swarm-ready-list-test.sh exists (sibling of the cold-store / env-guard tests); docs/gotchas/07-*.md names the implicit-set -e path (#52, run 421).
    4. Tests updated, suite green.
  • Tests run just now (exit 0):

    • bash tests/run-swarm-ready-list-test.sh → 4 scenarios passed
    • bash tests/schedule-lib-test.sh → 22 groups passed
    • bash tests/run-swarm-stages-test.sh → 14 groups passed

The reopen loop is #283/#372, not outstanding work on #52

The two reopens today (citing commits 354f9df… / 4e25556… that are not on main) are the #283 reconcile firing on a re-attempt's no-op/stranded land — already filed as #372 (#283 reconcile reopens an already-landed ticket when a re-attempt's land is a no-op, open, ready-for-agent). #52 is done; #372 is where the loop gets fixed.

Landing

push mode. Nothing to land — the fix is already on main. No commit made, nothing pushed. Closing on the verified-already-done basis and removing ready-for-session so this ticket stops being re-dispatched into the loop.

If this reopens a fourth time, do not re-dispatch it onto a session — pin it closed by hand and prioritise #372, which is the only thing that stops the reconcile from reopening already-landed tickets.

**close-report** for #52 — status `success` (already landed on `main`; no commit — see the loop note) Ruled by agent under ADR 0174 — veto anytime. **This ticket's work is genuinely complete on `main` and has been since 2026-08-24.** I made no commit: the fix is byte-for-byte on `origin/main` already, and a no-op/rework commit would be dishonest AND would re-arm the #283 reconcile loop that has reopened this ticket twice today (19:29Z, 20:58Z). This close repeats the 2026-11-19 19:35Z ruling with fresh verification on today's `origin/main` (`44e5984`). ### Verified on `origin/main` today (2026-11-19) - Fix commit **`866dc37`** ("a transient Forgejo 5xx while listing ready tasks stops redding a run and mis-keying the death to preflight (#52)") is an ancestor of `origin/main` (`git merge-base --is-ancestor 866dc37 origin/main` → yes). - **All four acceptance criteria met:** 1. **Retry/backoff + `--max-time`.** `list-ready-tasks.sh` `api()` (and the 10-wide dependency `curl`) retry with exponential backoff, each attempt bounded by `--max-time` (`LIST_READY_MAX_TIME`/`RETRIES`/`BACKOFF`), matching `forgejo-lib.sh:_forgejo_get`. The janitor/claim paths were deliberately left out (janitor already `--max-time`-carrying and `|| true`-guarded; the claim path fails fast to release the slot per #28/GOTCHAS 16 — documented in the commit). 2. **No mis-key to preflight.** `schedule_list_ready_or_verdict` (`schedule-lib.sh:113`) sets `verdict_stage "list ready tasks"` and captures the failing read via `verdict_error`, run on run-swarm's own shell through an out-file (not `$(...)`), so the EXIT trap's `VERDICT_*` carry the real stage + a non-empty error line. `run-swarm.sh:299` calls it in place of the bare assignment. 3. **Offline guard test + GOTCHAS #7.** `tests/run-swarm-ready-list-test.sh` exists (sibling of the cold-store / env-guard tests); `docs/gotchas/07-*.md` names the implicit-`set -e` path (#52, run 421). 4. **Tests updated, suite green.** - **Tests run just now (exit 0):** - `bash tests/run-swarm-ready-list-test.sh` → `4 scenarios passed` - `bash tests/schedule-lib-test.sh` → `22 groups passed` - `bash tests/run-swarm-stages-test.sh` → `14 groups passed` ### The reopen loop is #283/#372, not outstanding work on #52 The two reopens today (citing commits `354f9df…` / `4e25556…` that are not on `main`) are the #283 reconcile firing on a re-attempt's no-op/stranded land — already filed as **#372** (`#283 reconcile reopens an already-landed ticket when a re-attempt's land is a no-op`, open, `ready-for-agent`). #52 is done; #372 is where the loop gets fixed. ### Landing push mode. **Nothing to land** — the fix is already on `main`. No commit made, nothing pushed. Closing on the verified-already-done basis and removing `ready-for-session` so this ticket stops being re-dispatched into the loop. **If this reopens a fourth time, do not re-dispatch it onto a session** — pin it closed by hand and prioritise **#372**, which is the only thing that stops the reconcile from reopening already-landed tickets.
matou-build-agent 2026-11-19 21:10:40 +00:00
matou-build-agent 2026-11-19 21:46:30 +00:00
Author
Member

🚨 Reopened — a push-mode close did NOT land on main (#283). close-report closed this issue against the pushed worker branch, but the host's post-run verify rolled the land back (the promote did not advance main (a no-op push to main)), so origin/main never carried the commits (a60d4bd1a05b41938a3bbaf08c8889d4a61ba9a9). The gates-passed comment above is therefore NOT true of main. Reopening and relabelling ready-for-session so the work is redone where it can land; the commits are parked on a rescue branch for triage (see this run's alarm).

:rotating_light: **Reopened — a push-mode close did NOT land on `main` (#283).** close-report closed this issue against the pushed worker branch, but the host's post-run verify rolled the land back (`the promote did not advance main (a no-op push to main)`), so `origin/main` never carried the commits (`a60d4bd1a05b41938a3bbaf08c8889d4a61ba9a9`). The gates-passed comment above is therefore NOT true of `main`. Reopening and relabelling `ready-for-session` so the work is redone where it can land; the commits are parked on a rescue branch for triage (see this run's alarm).
Author
Member

Why human — this ticket is DONE on main; what remains is a re-vendor (GOTCHAS 4), a human-only one-way door

Ruled by agent under ADR 0174 — veto anytime.

Routing to ready-for-human instead of closing again, because closing has provably not stuck (3 times today) and the only thing that breaks the loop is a human re-vendor. This is the fourth-reopen escalation the 2026-11-19 21:10Z close-report called for ("If this reopens a fourth time, do not re-dispatch it onto a session — pin it closed by hand and prioritise #372"). It reopened a fourth time at 21:46Z and was re-dispatched to a session (run 2916159); I am breaking that loop here rather than producing a fifth no-op close.

The work is genuinely complete (two-way-door part — nothing left to do)

  • Fix commit 866dc37 ("a transient Forgejo 5xx while listing ready tasks stops redding a run and mis-keying the death to preflight (#52)") is an ancestor of origin/main (git merge-base --is-ancestor 866dc37 origin/main → yes), landed 2026-08-24.
  • All four acceptance criteria met and re-proven green today (2026-11-19) on main:
    1. list-ready-tasks.sh api() and the 10-wide dependency curl retry with exponential backoff, each attempt --max-time-bounded (LIST_READY_MAX_TIME/RETRIES/BACKOFF), matching forgejo-lib.sh:_forgejo_get. (Janitor/claim paths deliberately excluded — documented in the commit.)
    2. schedule_list_ready_or_verdict (schedule-lib.sh) sets verdict_stage "list ready tasks" and captures the failing read via verdict_error on run-swarm's own shell through an out-file (not $(...)); run-swarm.sh:299 calls it in place of the bare assignment.
    3. tests/run-swarm-ready-list-test.sh (sibling of the cold-store / env-guard tests); docs/gotchas/07-*.md names the implicit-set -e path.
    4. Tests updated, suite green: tests/run-swarm-ready-list-test.sh → 4 scenarios passed; tests/schedule-lib-test.sh → 22 groups passed; tests/run-swarm-stages-test.sh → 14 groups passed.

Why it keeps reopening — and why a session cannot stop it (the human residue)

The reopens are the #283 reconcile firing on a no-op re-land: a run re-attempts #52, produces nothing (the fix is already on main), the host's post-run verify reads the no-op promote as a stranded close, and reopens the ticket.

#372 fixes exactly this ("the #283 reconcile no longer reopens an already-landed ticket whose re-attempt land was a no-op"). Its fix commit 697a783 IS on main (landed today 2026-11-19 21:43:39Z). But the running .sandcastle/ copy is pinned at FACTORY_REF = 9fd804b, which predates 697a783 (git merge-base --is-ancestor 697a783 9fd804b → no). So the reconcile doing the reopening still lacks #372's fix. The 4th reopen (21:46:34Z) fired ~3 min after #372 landed, from a run whose vendored copy was never bumped.

A root change reaches the running copy only when a human re-vendors (GOTCHAS 4) — a one-way-door, human-only action. No session or swarm run can close this gap from inside the loop.

Human residue — pick either; both stop the loop

  1. Re-vendor .sandcastle/ to a sha ≥ 697a783 so the live reconcile carries #372 and stops reopening already-landed tickets:
    bash onboarding/onboard.sh vendor .sandcastle <sha> (GOTCHAS 4), then pin #52 closed.
  2. Or pin #52 closed by hand now and let the re-vendor land on its normal cadence — once the running copy carries 697a783, the reconcile will no longer reopen it.

Do not re-dispatch #52 onto a session again: there is no code for a session to write, and a fresh no-op close only re-arms the loop.

## Why human — this ticket is DONE on `main`; what remains is a re-vendor (GOTCHAS 4), a human-only one-way door Ruled by agent under ADR 0174 — veto anytime. **Routing to `ready-for-human` instead of closing again, because closing has provably not stuck (3 times today) and the only thing that breaks the loop is a human re-vendor.** This is the fourth-reopen escalation the 2026-11-19 21:10Z close-report called for ("If this reopens a fourth time, do not re-dispatch it onto a session — pin it closed by hand and prioritise #372"). It reopened a fourth time at 21:46Z and was re-dispatched to a session (run 2916159); I am breaking that loop here rather than producing a fifth no-op close. ### The work is genuinely complete (two-way-door part — nothing left to do) - Fix commit **`866dc37`** ("a transient Forgejo 5xx while listing ready tasks stops redding a run and mis-keying the death to preflight (#52)") is an ancestor of `origin/main` (`git merge-base --is-ancestor 866dc37 origin/main` → yes), landed 2026-08-24. - All four acceptance criteria met and **re-proven green today (2026-11-19) on `main`**: 1. `list-ready-tasks.sh` `api()` and the 10-wide dependency `curl` retry with exponential backoff, each attempt `--max-time`-bounded (`LIST_READY_MAX_TIME`/`RETRIES`/`BACKOFF`), matching `forgejo-lib.sh:_forgejo_get`. (Janitor/claim paths deliberately excluded — documented in the commit.) 2. `schedule_list_ready_or_verdict` (`schedule-lib.sh`) sets `verdict_stage "list ready tasks"` and captures the failing read via `verdict_error` on run-swarm's own shell through an out-file (not `$(...)`); `run-swarm.sh:299` calls it in place of the bare assignment. 3. `tests/run-swarm-ready-list-test.sh` (sibling of the cold-store / env-guard tests); `docs/gotchas/07-*.md` names the implicit-`set -e` path. 4. Tests updated, suite green: `tests/run-swarm-ready-list-test.sh` → 4 scenarios passed; `tests/schedule-lib-test.sh` → 22 groups passed; `tests/run-swarm-stages-test.sh` → 14 groups passed. ### Why it keeps reopening — and why a session cannot stop it (the human residue) The reopens are the **#283 reconcile firing on a no-op re-land**: a run re-attempts #52, produces nothing (the fix is already on `main`), the host's post-run verify reads the no-op promote as a stranded close, and reopens the ticket. **#372 fixes exactly this** ("the #283 reconcile no longer reopens an already-landed ticket whose re-attempt land was a no-op"). Its fix commit **`697a783` IS on `main`** (landed today 2026-11-19 21:43:39Z). **But the running `.sandcastle/` copy is pinned at `FACTORY_REF = 9fd804b`, which predates `697a783`** (`git merge-base --is-ancestor 697a783 9fd804b` → no). So the reconcile doing the reopening still lacks #372's fix. The 4th reopen (21:46:34Z) fired ~3 min after #372 landed, from a run whose vendored copy was never bumped. A root change reaches the running copy only when a human re-vendors (GOTCHAS 4) — a one-way-door, human-only action. No session or swarm run can close this gap from inside the loop. ### Human residue — pick either; both stop the loop 1. **Re-vendor `.sandcastle/` to a sha ≥ `697a783`** so the live reconcile carries #372 and stops reopening already-landed tickets: `bash onboarding/onboard.sh vendor .sandcastle <sha>` (GOTCHAS 4), then pin #52 closed. 2. Or **pin #52 closed by hand now** and let the re-vendor land on its normal cadence — once the running copy carries `697a783`, the reconcile will no longer reopen it. Do **not** re-dispatch #52 onto a session again: there is no code for a session to write, and a fresh no-op close only re-arms the loop.
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#52
No description provided.