harness: a transient Forgejo 5xx reds the swarm tick at git-setup — git-setup.sh has NO retry and no TRANSPORT outcome (#1359/#1394 class, third surface) #1411
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1411
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
swarm run 22229 (
Matou/idss, started 2026-09-12T04:29:34Z) died beforerun-swarm.shever started, with:No row in
~/swarm/logs/run-swarm-verdicts.logfor run 22229 (the last entry isrun=22225 … reason=completed, 04:29:23Z) — confirming the tick was lost at the.sandcastle/git-setup.shcall inswarm.yml:151, one step beforebash .sandcastle/run-swarm.sh.Nothing was wrong with this host, the token, or the workdir.
workdir-git.txt: clean,no rebase in progress, HEAD9e3345eb.api-timing.txt:api_seconds=2. Three healer probes ofgit.matou.nz/Matou/idss.git/info/refs?service=git-upload-packnow:200in 0.82 / 0.72 / 0.73 s. 42 of the 50 runs in the surrounding 48-minute window succeeded.Root cause — a real but brief Forgejo server-side wobble, on a surface with zero retry
The blip is independently witnessed in the same minute by run 22225's worker (
worker-logs.txt:196-215):list-ready-tasks.shreturned exit 22 — its#52retry posture exhausted — then a directcurlgotHTTP 503, then three attempts 3 s apart got200. So the outage lasted tens of seconds (long enough to outrun 3 backed-off attempts) and then self-healed.git.matou.nzis off this host, so there is no runner-side cause.The durable gap:
.sandcastle/git-setup.shhas no retry at all. Its fetch-or-clone is a single bare attempt inside oneset -esubshell (lines 43-63), so any 5xx blip — even a one-second one — reds the whole swarm tick with exit 128 and burns a healer investigation.This is the third surface of the same rule as #1359 / #1394 / GOTCHAS #217 — "a probe that cannot reach the server has not obtained a verdict." #1359 gave
forgejo_issue_write_probeFORGEJO_PROBE_RETRIES/FORGEJO_PROBE_BACKOFF; #1394 gavecheck-harness-drift.shFACTORY_FETCH_RETRIES/FACTORY_FETCH_BACKOFF+EX_TRANSPORT=3. The git-transport half was never applied togit-setup.sh— even though #1359's own evidence block quoted astage=git-setup … 503verdict fromMatou/matou-appas its corroborating witness.What to do
.sandcastle/git-setup.shis vendored (FACTORY_MANIFESTline 23,FACTORY_REF dcda962f) and owned byMatou/dev-factory— it must NOT be edited here (the#932pre-push drift gate blocks it, andcheck-harness-drift.shwould red the seam). Land it upstream, bumpFACTORY_REF, re-vendor — the #891/#931/#1394 pattern:GIT_SETUP_RETRIES=3,GIT_SETUP_BACKOFF=2, each attempt bounded by git's own transport. Keep it inside theset -esubshell so fixture 2's masked-fetch pin still holds.exit 0like theflock -nyield atswarm.yml:137. A lost tick is cheap here; a healer run per blip is not.tests/git-setup-test.sh(currently 5 scenarios): rides out a transient 5xx; a sustained outage is named TRANSPORT and is never reported as a checkout/auth fault.swarm.yml:153-161andtriage.yml— reachable only by a workdir one fetch behind, but the same hole.Second surface in the same window — a failed claim renders as an EMPTY queue (may warrant its own ticket)
claim-next-task.shcorrectly fails closed on a lister fault (lister_rcpropagates, line 172; onlytimeout's rc 124 gets the graceful[]). But Sandcastle's prompt shell-expansion swallowed that non-zero exit and inserted the empty output:bash .sandcastle/claim-next-task.sh → ~1 tokens(worker-logs.txt:190). The worker therefore opened its iteration with an empty ready-tasks block — which the "Done" instructions treat as a completion candidate.This worker handled it exactly right: it re-ran the lister, got
#1408 / #1410 / #1409, and refused to emit the completion signal (worker-logs.txt:206-215). But it burned an iteration, and a less careful worker would have signalled "all done" on a transport fault. A fail-closed claim step whose failure is rendered as "no work" is fail-open at the surface that matters.Evidence
run-verdict.txt,worker-logs.txt(lines 190-215),workdir-git.txt,api-timing.txt,runs.json,host.txtin/tmp/matou-heal-Matou-idss.xufeXEe920609ff288, heal runheal-Matou-idss-1789187471-2125383Close-report — landed & proven (standing session, ADR 0174)
Ruled by agent under ADR 0174 — veto anytime. This was a two-way door: a revertible harness retry + a re-vendor pin bump, every part proven by an existing/added offline test and the drift check. No one-way door touched (no credentials, no security widening, no data destruction).
What landed
The workdir fetch-or-clone in
git-setup.sh— the swarm/triage tick’s ONE live network call — was a single bare attempt inside oneset -esubshell with no retry, so a transientgit.matou.nz5xx red the whole tick at stage one with a bareexit 128that read as a checkout fault (run 22229). Fixed as the #891/#931/#1394 pattern — land upstream, bumpFACTORY_REF, re-vendor (git-setup.shis FACTORY_MANIFEST-vendored and must not be edited in-repo):GIT_SETUP_RETRIES=3,GIT_SETUP_BACKOFF=2(exponential), the whole subshell re-run per attempt so fixture 2’s masked-fetch pin still holds. A momentary blip is ridden out.is_transport_errorclassifier fails fast on the three non-transport faults (dead auth / missing branch / corrupt workdir) so each keeps its native git error and its distinct #639 healer signature; only transport-class failures are retried. A sustained transport outage re-keys the verdict off the raw git error onto an explicitTRANSPORT:line and exits code 3 — so the healer separates "Forgejo was unreachable" from the other three faults this one stage used to collapse.check-harness-drift.sh. Rationale: the retry already rides out the common case (blips — 42/50 runs in the window succeeded), so a sustained red is rare; theTRANSPORT-named verdict gives the healer a distinct, deduplicating signature (stage :: first-error-line), so repeated transport reds collapse to one signature rather than spawning fresh investigations. A true "yield exit 0" is unsafe from git-setup.sh — returning 0 would letrun-swarm.shproceed on a stale/incomplete workdir; a real yield would require rewiring every consumer’sswarm.yml/triage.ymlcontrol flow (a larger, less-reversible change). A lost tick is cheap here — the cron/backstop re-fires.tests/git-setup-test.sh5 → 7 scenarios. Scenario 6: a transient 5xx is ridden out to exit 0 with no verdict. Scenario 7: a sustained outage exits 3, is named TRANSPORT, is re-keyed off the raw 503, and shares neither the repo-not-found nor branch-not-found signature. Red-before-green proven — the new tests fail against the pinned (old, no-retry)git-setup.sh.swarm.yml:153-161/triage.yml(reachable only by a workdir one fetch behind git-setup.sh) — filed as follow-up #1423 (per "work only this ticket").Proof
Matou/dev-factory@26f142c(upstream fix + test + STATUS + GOTCHAS 53): full offline suite green (git-setup-test7/7,check-harness-drift-test,forgejo-lib-test,verdict-lib,run-swarm-stages, … — the only failure wasfleet-tui-test.sh, a missing-pytest-in-venv host env issue, vendor-excluded and pre-existing).Matou/idss@6e26d90(re-vendor: FACTORY_REFdcda962f→26f142c, adopting intervening #137–#140 harness commits + GOTCHAS 226 + STATUS): vendoredgit-setup-test.sh7/7 green in-repo, andcheck-harness-drift.shOK against the new pin.Note
The push itself hit the exact fault class this ticket fixes —
git.matou.nzwas flapping 200/502/503 through this session — and only landed after several retries. Fitting corroboration that the blip is real and external.The second surface flagged in the report (a failed claim rendering as an EMPTY ready-tasks queue —
claim-next-task.shfail-closed exit swallowed by Sandcastle’s prompt shell-expansion) is out of scope for this ticket and warrants its own; not filed here to avoid scope-creep beyond the two-way work proven above.Audit-trail addendum (a second standing session raced this ticket). #1411 was already fully landed & proven on
main(6e26d90, FACTORY_REFdcda962f→26f142c) with the close-report above by the time this session reached it — the work is complete and I confirmed it independently:.sandcastle/tests/git-setup-test.sh7/7 green on the landedmain, GOTCHAS #226 present, and (fittingly) the drift check on this host just exercised the new #1394TRANSPORTpath live —git.matou.nzwas flapping 200/502/503 through this session, socheck-harness-drift.shcleanly returned "TRANSPORT — drift was NOT read" (exit 3) instead of a bare red. No duplicate commit was pushed.The one dangling item: the close-report noted the second surface (a failed
claim-next-task.shrendered as an EMPTY ready-tasks queue — fail-closed at the script, fail-open at the worker) was deliberately left unfiled. It is a real hazard the healer flagged as warranting its own ticket, so I have filed it as #1425 to give it a tracker home. No code touched here. Ruled by agent under ADR 0174 — veto anytime.