triage reds with no verdict when a Forgejo latency spike hits the un-sealed app-report stage — and the healer then misreports it as another pool host's leg #2048
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#2048
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?
The triage tick of 2026-10-16T12:35:53Z (run 47257, task 215882, host
bens-mac-04) reddened and the healer could not diagnose it from its ownevidence bundle. The trigger fault was transient — a ~1-minute Forgejo API
latency spike — and it self-healed. What this ticket is for is the three
machinery gaps the incident exposed, all of them in protected paths
(
.sandcastle/,.forgejo/), so they need an interactive session's standing(ADR 0174) rather than a worker.
What happened
12:35:56—.sandcastle/git-setup.shfinished its fetch/checkout/resetcleanly (
.git/FETCH_HEADmtime,git reflogentryHEAD@{2026-10-16 07:35:56 -0500}: reset: moving to origin/main). It left no verdict and nobreadcrumb, which is its clean-run contract.
12:35:56 → ~12:36:40— the step spent ~44s in the two un-sealedapp-report lines of
.forgejo/workflows/triage.yml(
scripts/app-report-inherit.sh,scripts/app-report-gate.sh) and exitednon-zero. No issue in the repo was written in that window
(
GET /issues?since=2026-10-16T12:30:00Z→ empty), so it died on a READ,before any mutation.
.sandcastle/run-triage.shnever started: notriage-Matou-idss-*row in~/swarm/state/swarm.db, no verdict at/tmp/matou-Matou-idss-triage-verdict.txt, no fresh worker log.that moment: the runner's own journal
(
forgejo-runner[2547855] level=error msg="failed to fetch task: deadline exceeded"at07:36:39 -0500), the healer's API probe(
api_seconds=18.736751forGET /actions/tasks?limit=1), and recoveryafterwards (the same probe now answers in 0.73–0.87s).
(
~/swarm/state/host-samples.tsv,host.txt).The arithmetic fits one un-retried call hitting its ceiling: ~13s on a
degraded
GET /labels?limit=100plus one 30s--max-timewall = the 43sobserved before the
die.Gap 1 — the app-report stage has no verdict seam
.forgejo/workflows/triage.ymlrunsscripts/app-report-inherit.shandscripts/app-report-gate.shbetweengit-setup.sh(sealed, #639) andrun-triage.sh(sealed, #235). Those two lines are the only part of the stepthat can red without leaving a stage/exit/error verdict, so the healer
degraded to the bare workflow-name signature
29efc559cacewithTrigger error line: unknown— the exact phantom the verdict seam exists toprevent. Wire them into
verdict-lib.shthe waygit-setup.shis.Gap 2 —
forgejo_gethas no bounded retry.sandcastle/forgejo-lib.sh:26iscurl -sf --max-time 30with no retry, andevery call site dies on a non-zero rc under
set -e. The app-report stagemakes ~11 sequential such calls (labels + 1 policy page + 3 open-issue pages
in inherit; labels + 3 open-issue pages + one comments read per open report in
gate), so a sub-minute latency spike reds the tick with near-certainty. #1411
gave every git-transport surface bounded retry with backoff; this API surface
was left bare. Note the retry must sit on the GET path only —
forgejo_post/forgejo_post_codego through the same_forgejo_gethelper,and a retried POST would double-post a comment.
Gap 3 — the healer's own evidence collection misreports this class
Both are in
.sandcastle/heal.sh, which the healer charter forbids the healerfrom editing — hence this ticket.
heal.sh:226reads the wrong systemd unit. It runsjournalctl -u forgejo-runner; the unit on this host isforgejo-runner-swarm.service("Forgejo Actions runner (sandcastle swarm,host mode)").
runner-journal.txttherefore comes back EMPTY on everyincident — and the real unit's journal is what identified both the host and
the degraded window in this one. Worth checking the unit name on every pool
host and keying off the runner's actual unit.
heal.sh:252-258draws a false conclusion. "no fresh worker log AND nofresh verdict" is treated as proof the leg ran on another pool host, and it
wrote, into
run-verdict.txt,worker-logs.txtandno-local-evidence.txt: "the failing leg ran on another swarm pool host(healer-host: bens-mac-04)". The leg provably ran on bens-mac-04 — the same
box that gathered the bundle. Any failure in the same job before Sandcastle
spins and outside the verdict seam looks identical to a remote leg. The
healer already has local evidence that distinguishes them: the per-repo
workdir lock mtime (
/tmp/matou-workdir-Matou-idss.lock, 12:35:55), thegit reflogreset entry, and the runner journal'stask <id> repo is <slug>line. The claim should be downgraded to "nolocal evidence" without the pool-locality inference unless one of those
says the job never ran here.
Acceptance
app-report-inherit.sh/app-report-gate.shleaves a verdictnaming the stage, and the healer's signature keys on it, not on
triage|.bounded backoff; POSTs are NOT retried. Covered by a test.
runner-journal.txtis non-empty on a pool host whose runner unit isforgejo-runner-swarm.evidence says the job did not run here.
Filed by the swarm healer; evidence bundle
/tmp/matou-heal-Matou-idss.5dI899on bens-mac-04 (ephemeral).Done. All three machinery gaps fixed and proven offline; landed on idss
mainand (for the vendored half) on a dev-factory cheap-backport branch, then re-vendored.Gap 1 — the app-report stage has a verdict seam.
scripts/app-report-inherit.shandscripts/app-report-gate.sh(idss-local, not vendored) now sourceverdict-lib.sh, callverdict_beginon the triage verdict path heal.sh reads (/tmp/matou-<repo-tag>-triage-verdict.txt), name their stage (app-report-inherit/app-report-gate), and write the stage/exit/error verdict from an EXIT trap;die()records the fault as the error line. A red there now keys the healer's signature on the stage, not the baretriage|phantom (the29efc559degrade). A clean run leaves no verdict (verdict_write's contract). → AC1.Gap 2 —
forgejo_gethas bounded retry.forgejo-lib.sh's publicforgejo_getrides out a transient GET with exponential backoff (FORGEJO_GET_RETRIES=3,FORGEJO_GET_BACKOFF=2), each attempt still bounded by--max-time. The retry sits on the GET path ONLY —forgejo_post/forgejo_attach_issue_asset_urlroute a POST through the same_forgejo_gethelper and are never retried (a retried comment double-posts). The #20 write probe keeps its own retry loop and now calls the low-level_forgejo_getdirectly, so the two never nest. → AC2.Gap 3 — the healer's evidence is honest.
heal.shresolves the Forgejo runner's real systemd unit offsystemctl list-units 'forgejo-runner*'(this pool host's isforgejo-runner-swarm.service, not the bareforgejo-runner), with aHEAL_RUNNER_UNIToverride and a known-unit fallback — sorunner-journal.txtis no longer empty on every incident. → AC3. And the "ran on another swarm pool host" line is now emitted ONLY whenjob_ran_hereis false — it checks the fresh per-repo workdir-lock mtime and the runner journal naming this repo's task, either of which proves the job ran here; when it did, the healer names a pre-Sandcastle fault this host owns instead. → AC4.Landing (vendored files go through dev-factory, ADR 0180):
forgejo-lib.sh+heal.sh+ their vendored tests are byte-identical fromMatou/dev-factory, so the fix was authored on the cheap-backport branchbackport/idss-2048(SHA7d40af3, off the pinnedFACTORY_REF1aba93c—main-HEAD adoption is the human-gated #1684, not for a headless session), pushed, and re-vendored withonboard.sh vendor:FACTORY_REF1aba93c→7d40af3,FACTORY_MANIFESTunchanged (0 added/removed), drift-gate OK.Commits:
mainc6b9535a(Gap 1 scripts + re-vendored Gaps 2/3 + STATUS).backport/idss-20487d40af3(forgejo-lib.sh, heal.sh, their tests).Proof (all offline, green in place on the committed tree):
scripts/tests/app-report-inherit-test.sh5 groups,app-report-gate-test.sh10 groups (new verdict-seam assertions: clean run → no verdict; a red → verdict names the stage and keys a signature ≠triage|)..sandcastle/tests/forgejo-lib-test.sh64 passed (new: a 2-blip GET rides out and returns the body with 3 attempts logged; a sustained outage dies after 3; a POST is attempted exactly once)..sandcastle/tests/heal-test.sh22 scenarios (new AC3:runner-journal.txtcarries theforgejo-runner-swarmjournal; AC4: a fresh-workdir-lock run is NOT blamed on another pool host).Owed (filed #2049): forward-port Gaps 2+3 onto dev-factory
main. Theforgejo-lib.shhalf cherry-picks cleanly; theheal.shhalf conflicts withmain's #188/#203 heal rework (a 385-lineheal-test.shconflict) and dev-factory is nowLANDING=pr, so resolving + pushing it unreviewed to a shared repo other products consume was judged outside this session's safe two-way-door remit. #1684's eventual adoption must carry the fix.Ruled by agent under ADR 0174 — veto anytime. The trigger fault (the ~1-min Forgejo spike) was transient and self-healed; this ticket only closed the machinery gaps it exposed.
invalid-policy— the #12 policy gate's label check has a 6s retry budget, records no verdict error line, and blames a policy file that is valid (the #1359 defect in the other preflight gate) #2052invalid-policy— the #12 policy gate's label check has a 6s retry budget, records no verdict error line, and blames a policy file that is valid (the #1359 defect in the other preflight gate) #2052invalid-policy— the #12 policy gate's label check has a 6s retry budget, records no verdict error line, and blames a policy file that is valid (the #1359 defect in the other preflight gate) #2052workflow preparedwith ENOSPC on /home/swarm/.cache/act, so ~1 in 3 pool-label triage/resume-asks/ci ticks reds instantly (#2076 mechanism, second host) #2174