harness: a transient Forgejo 5xx reds the whole swarm tick as preflight-red (the #20 probe has no retry), and the empty verdict error block sends the healer chasing a guard that never broke #1359
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#1359
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 20865 (
Matou/idss, 2026-09-09T21:46:04Z) died after 7 seconds withreason=preflight-red exit=1(~/swarm/logs/run-swarm-verdicts.log), and left the healer a verdict of exactly this:Nothing under the marker. No worker log for the window, empty runner journal. The healer signature keyed on the bare stage name, so the incident read as "a silent-failure guard has rotted" — when nothing in the harness had changed.
Root cause — two independent gaps, stacked
1. Preflight's one live network call has no retry and fails CLOSED.
Forgejo was 5xx-ing at that minute. The sibling
Matou/matou-appverdict written in the same minute is:and the healer's own probe recorded
api_seconds=timeoutwith an emptyworkflow_runslist.guard_issue_write_permission(#20) is preflight's only live call —forgejo_issue_write_probe→forgejo_get ""— and_forgejo_getis a barecurl -sf --max-time 30with no retry, unlikelist-ready-tasks.sh:api(), which was given exactly this posture by #52 for exactly this reason. One 503 returned instantly, the guard reported "cannot confirm the bot can write issues", preflight failed closed, and the tick was gone in 7s.Forgejo answered 200 in 0.9s by the time the healer probed, and
preflight-swarm.shrun live against the same token is green (issue_write_permission OK, all 10 guards fired). Nothing was ever wrong with the bot's permissions — the probe reported a permission verdict it never actually read.2.
preflight_gatenever records the failing guard as the verdict's error line.The guard FATALs to stderr, not to an errlog file — the #9 case
verdict_errorexists to close.preflight_gateprints thePREFLIGHT REDline to the job log and to Mattermost but never callsverdict_error, soverdict_writeemits an empty--- error lines ---block and the healer keys on the bare stage. That is what burned this investigation.Fix (written and verified, needs landing)
Both files are vendored from
Matou/dev-factory(FACTORY_MANIFEST), so the healer could not land this itself — it must go to the factory root source and then be re-vendored (ADR 0180). The patch below is byte-clean against factory root4d7b1afand applies withgit apply.forgejo-lib.sh—forgejo_issue_write_proberetries with exponential backoff (FORGEJO_PROBE_RETRIES=3,FORGEJO_PROBE_BACKOFF=2, each attempt bounded by_forgejo_get's--max-time; #52's posture). A sustained outage still fails closed, but saysTRANSPORT, not a permission verdict (the bot's write access was never read)instead of "the bot has no write access".preflight-lib.sh—preflight_gaterecords thePREFLIGHT REDline(s) viaverdict_errorbefore returning, so the verdict, the runlog and the healer signature all name the failing guard. A red with noPREFLIGHT REDline still leaves a non-empty line.tests/forgejo-lib-test.sh(rides out a transient 5xx; a sustained outage is named TRANSPORT; never claims lost write access; the probe demonstrably retried) and 2 intests/preflight-lib-test.sh.Red-before-green confirmed: on unpatched code the new pins fail —
forgejo-lib: 55 passed, 3 failedandFAIL: the gate must record the failing guard as the verdict's error line, got ''.Green after, in the factory tree:
preflight-lib9 groups,forgejo-lib58/0,preflight-swarm6 scenarios,run-swarm-stages10 groups. Also green in an idss clone:preflight-triage,run-swarm-ready-list,run-swarm-cold-store,provision-lib,policy-lib,claim-lib,close-report-lib,landing-lib,heal-lib.Landing steps
Matou/dev-factory(forgejo-lib.sh,preflight-lib.sh,tests/forgejo-lib-test.sh,tests/preflight-lib-test.sh) and push there.Matou/idss: bump.sandcastle/FACTORY_REF(51c8dc66→ new factory SHA) and re-vendor the manifest set. Note idss is currently one factory commit behind (4d7b1af, the rehearsal-heal de-numbering), which the bump will also carry in.Patch
GOTCHAS #217 draft
217. ⭐⭐ Preflight's ONE live network call fails CLOSED with no retry, so a transient Forgejo 5xx reds the whole swarm tick as
preflight-red— and because the guard FATALs to stderr, the verdict's error block is EMPTY and the healer keys a full investigation on a bare stage nameSymptom: swarm run 20865 (
Matou/idss, 2026-09-09T21:46:04Z) died after 7 seconds withreason=preflight-red exit=1(~/swarm/logs/run-swarm-verdicts.log) and a verdict of exactly three useful bytes:Nothing under the marker. No worker log for the window, no runner journal. The healer signature keyed on the bare stage, so the incident read as "a silent-failure guard broke" — a guard rot alarm — when nothing in the harness had changed.
Cause: two independent gaps stacked. (1) Forgejo was 5xx-ing at that minute — the sibling
Matou/matou-appverdict written in the SAME minute isfatal: unable to access 'https://git.matou.nz/Matou/matou-app.git/': The requested URL returned error: 503, and the healer's own probe recordedapi_seconds=timeoutwith an emptyworkflow_runslist.guard_issue_write_permissionis preflight's only live call (forgejo_issue_write_probe→forgejo_get ""), and_forgejo_getis a barecurl -sf --max-time 30with no retry — unlikelist-ready-tasks.sh:api(), which was given exactly this posture by #52 for exactly this reason. One 503 returned instantly, the guard reported "cannot confirm the bot can write issues", preflight failed closed, and the tick was gone in 7 s. (2)preflight_gateprinted thePREFLIGHT REDline to the job log and to Mattermost but never calledverdict_error, and the guard FATALs to stderr rather than to an errlog file — the #9 caseverdict_errorexists to close. Soverdict_writeemitted an empty--- error lines ---block. Forgejo answered 200 in 0.9 s by the time the healer probed, and theissue_write_permissionguard passes live against the same token: nothing was ever wrong with the bot's permissions.Rule: a probe that cannot reach the server has not obtained a verdict — it must never be reported as the verdict it was asking about.
forgejo_issue_write_probenow retries with exponential backoff (FORGEJO_PROBE_RETRIES=3,FORGEJO_PROBE_BACKOFF=2, each attempt bounded by_forgejo_get's--max-time— #52's posture), and a sustained outage still fails closed but saysTRANSPORT, not a permission verdict (the bot's write access was never read)instead of "the bot has no write access". Separately, every fail-closed gate whose guard FATALs to stderr must record that line withverdict_errorbefore it returns:preflight_gatedoes, so the verdict, the runlog and the healer signature all name the failing guard. An empty--- error lines ---block under a named stage is not a diagnosis — it is a wasted investigation. Pinned bytests/forgejo-lib-test.sh(rides out a transient 5xx; a sustained outage is named TRANSPORT and never claims lost write access; the probe demonstrably retried) andtests/preflight-lib-test.sh(the gate records the failing guard, and a red with noPREFLIGHT REDline still leaves a non-empty error line).Handed to
ready-for-session— this is a protected-path + cross-repo machinery change a swarm worker cannot land.Every file this fix touches is a vendored, protected
.sandcastle/path:.sandcastle/forgejo-lib.sh.sandcastle/preflight-lib.sh.sandcastle/tests/forgejo-lib-test.sh.sandcastle/tests/preflight-lib-test.shand the landing steps additionally require bumping
.sandcastle/FACTORY_REF(51c8dc66→ new factory SHA) and re-vendoring theFACTORY_MANIFESTset. All of that is under.sandcastle/, which the protected-paths fingerprint (#445) rolls back and fails loud on any swarm run — a worker literally cannot make these edits stick. Beyond that, landing step 1 requires applying the patch to the root source inMatou/dev-factoryand pushing there (ADR 0180), a repo the swarm worker has no worktree or write access to. The filing healer already noted this: "the healer could not land this itself — it must go to the factory root source and then be re-vendored."Only
docs/GOTCHAS.md#217 is a non-protected path here, and landing it alone would document a fix that does not exist — worse than leaving it.Per ADR 0174 §5, work that needs an interactive session's standing for a protected
.sandcastle/path (per #445) isready-for-session, notready-for-agentand not Ben. The patch in the issue body is byte-clean against factory root4d7b1afand comes with red-before-green evidence, so a session can:Matou/dev-factoryroot (forgejo-lib.sh,preflight-lib.sh, and both test files) and push;.sandcastle/FACTORY_REFand re-vendor the manifest set (carries in the one-behind4d7b1aftoo);Swapping
ready-for-agent→ready-for-sessionand releasing the swarm claim.Close-report — landed under ADR 0174 (session-runner, veto anytime)
Both gaps fixed at the factory root and re-vendored into idss. Ruled two-way by agent under ADR 0174: revertible (commit/vendor bump) and provable (existing + new self-tests, red-before-green).
dev-factory
Matou/dev-factory@6ea8ba0—forgejo-lib.sh,preflight-lib.sh,tests/forgejo-lib-test.sh,tests/preflight-lib-test.sh:forgejo_issue_write_probe(#20) now retries with exponential backoff (FORGEJO_PROBE_RETRIES=3,FORGEJO_PROBE_BACKOFF=2, each attempt bounded by_forgejo_get's--max-time—list-ready-tasks.sh:api()'s #52 posture). A sustained outage still fails closed but saysTRANSPORT, not a permission verdict (the bot's write access was never read)instead of "the bot has no write access".preflight_gaterecords thePREFLIGHT REDline(s) viaverdict_errorbefore returning, so the verdict, the runlog and the healer signature all name the failing guard; a red with noPREFLIGHT REDline still leaves a non-empty error line.idss
54040f3b— re-vendored FACTORY_REF51c8dc66→6ea8ba0(carried in the4d7b1afrehearsal-heal de-numbering idss was one commit behind; renderedrehearsal-heal-prompt.mdregenerated), GOTCHAS #217 appended, STATUS.md noted.check-harness-drift: OK.Proof (red-before-green, reproduced this session):
forgejo-lib: 55 passed, 3 failed;preflight-libFAILthe gate must record the failing guard as the verdict's error line, got ''— exactly the ticket's expected red.forgejo-lib 58/0,preflight-lib 9 groups,preflight-swarm 6 scenarios,run-swarm-stages 10 groups— green both in the factory tree and in the idss vendored copy.No one-way door touched: factory push used the host
swarmcredential (repo-scoped, not personal), the re-vendor was anonymous (clean# Source:line,git greptoken-free), no security posture widened.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) #2052