triage: one transient Forgejo read blip reds the whole tick — app-report-gate has no retry, no verdict seam, and the heal bundle blames the wrong host #2036
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#2036
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
triagerun 37106 (schedule, 2026-10-01T08:05:53Z, hostbens-mac-04) went red. The job log is the whole fault:git-setup.shsucceeded at 08:05:56.app-report-inherit.shsucceeded at 08:06:07. Thenapp-report-gate.shdied on oneforgejo_get "/issues/1819/comments?limit=50".It was a momentary transport blip, not a Forgejo or data fault:
api_http=000 api_seconds=9.780522 api_curl_exit=6— curl exit 6 is DNS resolution failure forgit.matou.nzfrom this host.http=200, ~0.7 s) in every other heal bundle on this host for the preceding 12 hours. A one-off.http=200, 1638 bytes, 0.70–1.06 s. #1819 is fine, is already gated, and its comment read is a no-opcontinue.So the run was lost to a ~seconds-long resolver stall. Three things made that cost far more than it should have.
1.
forgejo_gethas no retry — every call is a single point of failure for the tick.sandcastle/forgejo-lib.sh:26is a barecurl -sf --max-time 30, no backoff.app-report-gate.shis aset -eline intriage.yml, so one blip on any of its reads skipsrun-triage.shfor the whole tick and trips the healer + a Mattermost alarm.Per tick the gate makes ~5 un-retried calls (1 labels + 3 open-issue pages + 1 comment read per open app report) and
app-report-inherit.sh~4 more. Each is an independent chance to red the tick, every 30 minutes, forever — and the comment-read count grows with open reports.This is the exact class #1411 closed for git transport:
git-setup.shrides out a blip with bounded retry + backoff, andtriage.yml's own comment calls that "the last un-retried git-transport surface". The Forgejo API surface never got the same treatment.Ask: give reads a bounded retry with backoff (same posture as
git-setup.sh). Reads only —_forgejo_getalso backsforgejo_post, and retrying a POST would double-post comments. That split is the substance of this ticket; please make it deliberately rather than wrapping_forgejo_getwholesale.2. The two app-report lines have no verdict seam, so the signature degrades to noise
git-setup.shandrun-triage.shboth drop a/tmp/matou-Matou-idss-triage-verdict.txt. The two lines between them —scripts/app-report-inherit.sh,scripts/app-report-gate.sh— drop nothing. No verdict file existed after this run.So
error_line()fell to the degraded path, wroteseam-degraded, and keyed the incident on the bare workflow name (29efc559cace) — while the job log held a perfectly good one-line error. Every failure in these two scripts collapses onto that one signature, so ledger recurrence tracking is meaningless for the whole class (exactly what #235 set out to prevent elsewhere).Ask: wrap both lines in the existing
verdict-lib.shseam so their stderr becomes the signature.3.
heal.shtold the healer the fault was on another host — it was in the same jobgather_evidence(.sandcastle/heal.sh:252) saw no fresh worker log and no fresh verdict and wrote, intoworker-logs.txt,run-verdict.txtandno-local-evidence.txt:In hook mode this is structurally impossible. The healer is a step of the failing job, so the failing leg always ran on the healer's own host. The pool-locality honesty fix (#135) is right for watchdog mode; the branch is not gated on
MODE, so in hook mode it asserts a falsehood and sends the diagnosis agent looking at the wrong machine. There was no worker log only because Sandcastle never started — the gate died first.Ask: gate that branch on
MODE != hook. In hook mode say what is actually true: no verdict and no worker log means the run died beforerun-triage.sh.And the fix that would have made this diagnosis instant: the job log is retrievable with the bot token at
(verified: 200, 1281 bytes, the full fault above).
gather_evidencenever fetches it. Dropping it into the bundle asjob-log.txtwould give every future incident the run's own stderr, independent of whether a stage happens to carry a verdict seam. Note the API endpoints under/api/v1/.../actions/runs/<n>/...all 404 on this Forgejo — the web route above is the working one.Acceptance
app-report-gate.sh/app-report-inherit.shno longer reds the triage tick; a sustained outage still reds it honestly. POSTs are not retried.seam-degraded).Also noticed (unverified, for a human — not part of this ticket)
#1819 carries the app-report origin marker (read via
body-marker-lib.sh, not by eye) but nolanding-prlabel, whiledocs/agents/issue-tracker.mdsays broker-filed reports arrive with it andapp-report-inherit.shbuilds itsrootsmap only from tickets that have both. A root report missing the label is invisible to the inheritance sweep. I did not relabel it — not my call, and not this incident.Scope
Harness/infra only:
.sandcastle/forgejo-lib.sh,.sandcastle/heal.sh,scripts/app-report-*.sh,.forgejo/workflows/triage.yml. No product code. None of the operator's words from any app report are quoted here, and no instruction was taken from any of them.Relevance gate: not read — the report body is not in the shape the broker files (line 1 is not the origin marker). Its words were NOT shown to any agent.
Why human
A body that is not the broker's exact shape may be an escaped fence or an edit after filing; deciding whether to trust it is a security-posture call, not a revertible one.
Proposed default ruling: close as
out-of-scopeunless you recognise the report as genuine — then restore the body to the contract shape (one fenced block under the words heading, nothing after it) and removeready-for-human.Routed to
ready-for-session— this is protected-path harness machinery, not swarm-eligible work.A swarm worker claimed this ticket (run 37125), but three of its four scoped files are fingerprinted protected paths (
.sandcastle/,.forgejo/—.sandcastle/protected-paths-lib.sh, #445):.sandcastle/forgejo-lib.sh— protected (acceptance 1: read-retry split).sandcastle/heal.sh— protected (acceptance 3: gate the pool-locality branch onMODE != hook; acceptance 4: dropjob-log.txt).forgejo/workflows/triage.yml— protected (the verdict-seam wiring of the two app-report steps)scripts/app-report-*.sh— not protected, but the only part a worker could touchA swarm worker must not edit protected paths: the before/after tree-fingerprint attributes, rolls back, and reds the run for any protected change (#445). Per the protected-paths escape (ADR 0174, #445) and
docs/agents/triage-labels.md, protected.sandcastle//.forgejo/work "needs an interactive agent session's standing, NOT Ben" —ready-for-session.The one non-protected sliver — wrapping
scripts/app-report-inherit.sh/app-report-gate.shin theverdict-lib.shseam (acceptance 2) — is deliberately not split off to the swarm: acceptance 2 as written wraps the two workflow lines intriage.yml(protected), and a correct script-side seam must matchrun-triage.sh'sTRIAGE_VERDICT_PATH/repo_tagderivation (also in a protected file). Splitting it would strand a half-design a session then has to reconcile. The whole harness-hardening unit lands cleanly in one session.No code was changed by this run; no protected path was touched.
Note on the earlier
app-report-gate: borderline malformedcomment: it misread this ticket. #2036 is not an app report — it was filed by the swarm healer (line 1 is the healer disclaimer; it carries no<!-- origin: app-report -->marker, read viabody-marker-lib.sh). Its "close as out-of-scope" proposal does not apply; this is genuine machinery work for a session. (Theready-for-humanlabel that comment added is left in place — I do not remove hand-off labels; a session sweeps bothready-for-sessionandready-for-human.)The ticket's own "Also noticed" item (#1819 missing
landing-pr) is explicitly out of scope and left untouched.Ruled by agent under ADR 0174 — veto anytime. Worked this ticket; it splits cleanly along the factory-vendor boundary, and one part is a two-way door I landed, the rest is routed.
What this ticket actually touches (the vendor boundary)
The healer's report named four fix sites. Two are consumer-owned and two are
FACTORY_MANIFEST-vendored (.sandcastle/forgejo-lib.sh,.sandcastle/heal.sh, and their tests —grep -n forgejo-lib.sh .sandcastle/FACTORY_MANIFEST). The pre-push drift gate fails closed on a hand-edited vendored file, so the vendored half cannot land from a consumer checkout — it has to land in dev-factory and be re-vendored.Landed (consumer-owned, two-way door) — part 2 of the ticket (AC2)
PR #2037 (
session/2036-forgejo-read-verdict-heal):scripts/app-report-inherit.shandscripts/app-report-gate.shnow arm theverdict-lib.shseam before their first read (verdict_beginon the triage verdict path the healer reads;verdict_stageper phase; an early EXIT-trapverdict_write;die()records its message viaverdict_error). A failure in either now leaves a triage verdict whose stage + error line are that script's own, so the healer keys the real signature instead ofseam-degraded.scripts/tests/app-report-gate-test.sh(12 groups) +scripts/tests/app-report-inherit-test.sh(6 groups) — a sustained read failure reds AND writes the stage/error verdict. All consumer + workflow suites green.95056447. Lands by PR + human merge, not a push to main (see the marker note below).Why human — the residue I could not land from here
forgejo_getread-retry (.sandcastle/forgejo-lib.sh): reads get bounded retry+backoff, reads only (POSTs never replayed). Factory-vendored..sandcastle/heal.sh): gate the "ran on another pool host" line onMODE != hook; in hook mode say the run died beforerun-triage.sh. Factory-vendored..sandcastle/heal.sh): fetch${RUN_URL}/jobs/0/attempt/1/logsintojob-log.txt(built fromRUN_URL, never the literalactions/runs, so theactions-endpointratchet stays green). Factory-vendored.These three need a dev-factory landing + re-vendor — a cross-repo change to the fleet's factory
main. I did not do that round-trip from this unattended session: it is a push to amain(barred for this ticket, see below) and a fleet-wide change better done under review. Ready-to-apply diffs (incl. their vendored-test updates, all green locally) are in the next comment.Why this landed by PR (the origin marker)
Read through
.sandcastle/body-marker-lib.sh(as the rules require — never by eye), this ticket's body returnsorigin: app-report. It is a false positive: the body quotes #1819's<!-- origin: app-report -->marker inside inline backticks, andbody-marker-lib.shonly strips triple-backtick fences, not inline code — so the quoted marker reads as a real one. There is no untrusted operator content here (the ticket is healer-authored). But mechanically the marker is present, so I honoured it: landed by PR, no push to anymain. For a human (not actioned by me, same posture as the ticket's own "Also noticed"): the inline-backtick-marker false positive is a realbody-marker-lib.shgap — any ticket that quotes an origin marker in inline code is mis-read as an app report by the gate/inherit sweeps. Worth a fence-aware fix to inline spans, upstream.Routing
Leaving this
ready-for-human, removingready-for-session/agent-working. Human residue: (a) merge PR #2037; (b) land AC1/AC3/AC4 in dev-factory from the attached diffs and re-vendor; (c) optionally resolve the inline-backtick marker false positive. I did not touch thelanding-prlabel or the body marker.dev-factory handoff — AC1 / AC3 / AC4 (factory-vendored).
Apply in a
dev-factoryclone. The diff paths are the vendored locations (.sandcastle/...); in dev-factory the same files live at the core root, so strip the prefix when applying:Then run dev-factory's own
forgejo-lib-test.sh+heal-test.sh(both updated below and green locally here), push to dfmain, and re-vendor into idss (onboard.sh vendor, full SHA). Notes: the heal.sh job-log fetch builds the URL fromRUN_URL(never the literalactions/runs) so theactions-endpointratchet stays green — verified:pass=5 fail=0. The retry is reads only;forgejo_issue_write_probeswitches to bare_forgejo_getto avoid retry-in-retry.Full patch:
Recurrence — same class, different call site (run 39890, 2026-10-05)
triagerun 39890 (schedule, 2026-10-05T13:35:52Z, hostbens-mac-04) went red the same way. All three asks in this ticket reproduced verbatim, four days on.The whole job log:
Ask 1 (no retry on reads) — confirmed, and it is not just the gate. This time the single lost read was
app-report-inherit.sh'sfetch_all "state=open&type=issues"on page 1, not a gate comment read.git-setup.shfinished at 13:35:55; thedielanded at 13:36:27 — ~32 s, i.e. the call sat on_forgejo_get's own--max-time 30and timed out. Unlike 2026-10-01 there was no DNS fault: the healer's in-job probe recordedapi_http=200 api_seconds=0.744031 api_curl_exit=0, so this was plain server-side latency on one issue-list page.Supporting measurement, taken just now on the same host:
http=200,total1.99 s / 2.76 s / 2.95 s (DNS 0.02 s);bash scripts/app-report-inherit.sh→ rc 0 in 10.7 s;bash scripts/app-report-gate.sh→ rc 0 in 17.0 s, with nothing to do in either.So a quiet tick already spends ~28 s inside these two scripts across ~9 un-retried reads, each with a 30 s ceiling. At 2–3 s nominal per page, a 10× stall on any one of them reds the tick — which is the shape of both incidents.
Ask 2 (no verdict seam) — confirmed, and the collapse is now observable. No
/tmp/matou-Matou-idss-triage-verdict.txtexisted after the run;error_line()wroteseam-degradedand keyed the incident on29efc559cace— byte-identical to the 2026-10-01 signature in this ticket. The two incidents have different failing scripts and different failing calls and are indistinguishable in the ledger, exactly as predicted.Ask 3 (wrong host in hook mode) — confirmed. The bundle again asserted
no local evidence for run 39890 in the last 2 hours: the failing leg ran on another swarm pool host (healer-host: bens-mac-04)intoworker-logs.txt,run-verdict.txtandno-local-evidence.txt, while the failure was in the very job that ran the healer.The log-retrieval recipe at the end of this ticket works.
GET /Matou/idss/actions/runs/39890/jobs/0/attempt/1/logswith the bot token returned the 1259-byte log above and gave the one-line fault immediately. It was the only thing in this investigation that did.One new, adjacent finding
marker("origin")reads this ticket (#2036) as an app report. Its only<!-- origin: app-report -->text is in an inline code span in the prose of section 3's neighbour —outside_fencesstrips fenced blocks but not inline spans, so quoting the marker mints one. The gate therefore held #2036, found it not well-formed, and disposed itborderline/malformed→ready-for-human. Benign here (a healer ticket wants to be human-read), but any ticket that discusses the marker becomes an app report, and thelanding-prtripwire then sees marker-present/label-absent on it. Flagging only; not relabelled, and not this incident.Why no repair was made
Ask 1 is the fix that would have saved both ticks, and this ticket states the read/write split must be made deliberately rather than by wrapping
_forgejo_getwholesale. That is a human decision, and the ticket is alreadyready-for-human, so the healer stood down rather than preempt it. Nothing was committed.Second occurrence — same script, same class, different transport fault
triagerun 41915 (schedule, 2026-10-08T15:35:53Z, hostbens-mac-04, sig29efc559cace, ledgerattempts=2) went red the same way. Job log:git-setup.shsucceeded (workdir clean at the run's SHA).app-report-inherit.shsucceeded. Thenapp-report-gate.shdied on one un-retriedforgejo_get "/issues/2036/comments?limit=50"— the read of this ticket's own comments. Run 37106 died on #1819's; the failing call now tracks whichever app report is open, exactly as predicted under "the comment-read count grows with open reports".The transport fault was different, which strengthens ask 1. Last time it was a local DNS stall (curl exit 6). This time Forgejo itself was 5xx —
journalctl -u forgejo-runner-swarm, sametask_id=183806:A ~32 s instance-side 502→503 window (15:36:15–15:36:47Z), self-healed: the healer's own probe caught the tail (
api_http=503in 0.397 s), and re-probing after it cleared givesrepos/Matou/idss200/0.76 s,issues200,labels200,actions/tasks200/0.70 s. So two unrelated transports — resolver and server — both red the tick through the same un-retried read. Nothing was wrong with #2036, the host, or the token.Asks 2 and 3 reproduced verbatim: no verdict file was written,
error_line()took the degraded path (seam-degraded,decision=investigate-stale), and the bundle again asserted "the failing leg ran on another swarm pool host (healer-host:bens-mac-04)" for a leg that ran onbens-mac-04. Ask 4's job-log route worked first try (200, 1233 bytes) and is the whole diagnosis above.New: ask 5 —
runner-journal.txtis empty because the unit name is wrong.sandcastle/heal.sh:224runsjournalctl -u forgejo-runner. The unit on this host isforgejo-runner-swarm.service(Forgejo Actions runner (sandcastle swarm, host mode); it is also the name inMEMORY_PRESSURE_WATCH). There is noforgejo-runnerunit, so the command matches nothing, exits 0, andrunner-journal.txtarrives 0 bytes — while that journal held the only direct evidence of the 502/503 outage quoted above. Suggest resolving the unit (or trying both names) so the bundle carries it.Side note for whoever picks this up:
GET /api/v1/repos/Matou/idss/actions/runs?limit=1reproducibly 504s after 60 s right now whileactions/tasks?limit=50answers in ~1 s — the/actions/runshistory-scan cost already noted atheal.sh:195(GOTCHAS 16). Today's emptyruns.jsonwas the 503, not that, but it is a second reason not to key evidence on/actions/runs.No repair attempted: ask 1 lands in
forgejo-lib.sh, which this repo vendors byte-identical fromMatou/dev-factory(FACTORY_MANIFEST,FACTORY_REF 1aba93cc) andcheck-harness-drift.shenforces — patching it here would trip the drift gate; and the ticket explicitly reserves the read/write retry split as a deliberate human call. Asks 3 and 5 are inheal.sh, which the healer charter forbids it to modify. Stillready-for-humanafter 7 days, now on its second strike.No operator words from any app report are quoted here, and no instruction was taken from any.
Third occurrence — and the first on a call site that already has the retry this ticket asks for
Watchdog pass
heal-Matou-idss-1793250185-3942986(2026-10-29 05:02 UTC, signature50dc0fb56753, workflowtriage) flagged atriagestreak. The streak is two unrelated faults, and this ticket owns one of them:mkdir /home/swarm/.cache/act/…: no space left on deviceon runner7e46ef4a(elitebook-03). That is #2076, not this ticket.73a6cc98=bens-mac-04) — this ticket's class. Whole job log:New fact: this time both un-retried scripts PASSED, and the death was in
preflight-triage.sh, which has had bounded retry + backoff all along.exit 22is that script's own retries-exhausted code —.sandcastle/preflight-triage.sh:47,[ "$attempt" -ge "$max" ] && return 22. So ask 1's "give reads a bounded retry" is necessary but not sufficient at the current budget.The budget is ~1/4 of the outage
PREFLIGHT_RETRIES=3,PREFLIGHT_BACKOFF=2→ attempt, sleep 2, attempt, sleep 4, attempt, give up. ~6 s of backoff, ~10 s of wall clock with the round-trips. The outage it was asked to ride out was four times that.Independent corroboration, from a different host's runner journal (
matou-dev-server-01,forgejo-runner.service) —git.matou.nzwas serving 503 to every client in exactly the window the three curls fell in:26 s wide, instance-side, self-healed (that runner fetched tasks normally again at 04:10:55Z). The same journal shows two more 503 windows in the preceding half hour — 03:38:09–11Z (which cost the successful triage 56658 its final log upload,
task_id=258655) and 04:00:12Z — so this is an intermittently 5xx-ing instance, not a one-off.That also lines up with the 2026-10-08 recurrence above, which measured a ~32 s 502→503 window. Two independent measurements, both ~30 s, against a 6 s backoff budget.
Re-probed just now, from
matou-dev-server-01, API healthyrepos/Matou/idss3/3http=200, 0.70 / 0.74 / 0.74 sissues?state=open&type=issues&limit=50&page=1..3→ 200 / 200 / 200, 2.33 s (342 KB) / 3.32 s (448 KB) / 0.70 s (empty)bash .sandcastle/preflight-triage.sh→ rc 0 in 7.78 s, 0 untriagedNothing is wrong with the token, the host, or the data. A quiet tick spends ~7.8 s inside preflight alone across 4 reads.
Ask (sharpening ask 1, not a new ask)
Size the retry budget to the observed outage, not to a blip: ~30 s of 5xx is the measured shape twice over, so a read's retry envelope wants to clear ~60 s (e.g. 5 attempts / 2 s base → 2+4+8+16 = 30 s, or a plain deadline loop) — and whatever lands in
forgejo-lib.shfor ask 1 should use the same envelope aspreflight-triage.sh, so the three triage-tick read surfaces do not each carry their own number.Asks 2 and 3 reproduced verbatim again: no verdict file for run 56668 existed on the healer host, so
error_line()took the degraded path (seam-degraded, trigger linewatchdog: streak ()— empty parens), andno-local-evidence.txtasserted "local evidence … shows THIS repo's job ran on this host" when neither failing run did (this host's runner is4ff4a71f, which ran triage 56658 — the green one). That last part is #2079.No repair:
preflight-triage.shis in the fingerprinted protected set (.sandcastle/FACTORY_MANIFEST:44), so the budget change belongs to this ticket'sready-for-sessionroute, not to a healer push./is 100% full (0 bytes free) because /etc/cron.d/swarm-prune still points at the rootless docker socket — every task landing on its runner dies in 1-3s at Set up job, includingswarm-pool triage/resume-asks #2076workflow 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