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#2052
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 50573 (
Matou/idss, 2026-10-20T21:47:27Z) died after 18 seconds withreason=invalid-policy exit=1(~/swarm/logs/run-swarm-verdicts.log) and handed the healer a verdict of exactly this:Nothing under the marker — so the trigger line the healer keyed on was
policy validation (#12) ::with an empty tail, and the Mattermost notice read "Swarm aborted — invalidswarm-policy.sh. Fix the named policy key"..sandcastle/swarm-policy.shhas not been touched since 2026-08-26 and is valid: run live against the same token during the heal,policy_load && policy_validatereturns 0, and all threeHUMAN_LABELSnames (ready-for-human,agent-blocked,needs-info) are minted. Nothing was ever wrong with the policy.Root cause — a ~24s Forgejo 5xx blip, reported as a policy misconfiguration
policy_validateends in one live call —forgejo_get '/labels?limit=100', the HUMAN_LABELS minted check — and on a non-zero rc returns 2 with no distinction between "the file is wrong" and "I could not read the tracker".Forgejo was 503-ing for that window instance-wide, not just for idss:
runner-journal.txt: 38 ×ReportState/ReportLog error: unavailable: 503 Service Unavailablefrom 21:47:19 to 21:47:43 (~24s), across unrelated tasks (235247, 235262) — the runner's own log shipping was down too.api-timing.txt→api_http=503, andruns.json→{"workflow_runs":[]}.dev-factorygreen at 21:47:05,matou-websitegreen at 21:48:47. Only idss's tick landed inside it.Gap 1 — the retry budget is shorter than a real blip.
forgejo_get's bounded retry (#2048) isFORGEJO_GET_RETRIES=3/FORGEJO_GET_BACKOFF=2→ attempt, 2s, attempt, 4s, attempt ≈ 6s of riding out. The blip was 24s, so all three attempts fell inside it and the gate failed closed.Gap 2 —
preflight_policy_gatenever callsverdict_error. This is the #12 half of the pair #1359 closed for the #446 half:preflight_gatewas taught to record itsPREFLIGHT REDline(s) so the verdict, the runlog and the healer signature all name the cause (GOTCHAS #217).preflight_policy_gatewas not in that scope, so it still returns 1 with an empty--- error lines ---block — andpolicy_validate's stderr (policy: could not list the repo's labels to validate HUMAN_LABELS) is written nowhere the healer can read.Gap 3 — the words are false. A transport fault becomes
SWARM_EXIT_REASON=invalid-policyand a notice telling a human to "fix the named policy key". Same defect class as the #20 probe before #1359: a verdict reported about a thing that was never actually read.Fix
policy-lib.shandpreflight-lib.share both vendored fromMatou/dev-factory(FACTORY_MANIFESTlines 40/42, pin7d40af3, drift gate green) — so this lands at the factory root source and is then re-vendored (ADR 0180, the #2048 route), never edited in place here.policy-lib.sh— split the two failures.policy_validatereturns a distinct rc (or sets a named reason) when the labels GET itself failed, and saysTRANSPORT — the repo's label set was never read; HUMAN_LABELS was not validated, never "not minted". Consider giving this one call a longer budget than the shared default (a 24s blip needs ~30s+ of riding out; the call is an idempotent GET).preflight-lib.sh—preflight_policy_gatecallsverdict_errorwithpolicy_validate's stderr before returning, so the verdict names the cause. On the transport branch, setSWARM_EXIT_REASON=policy-tracker-unreachable(notinvalid-policy) and post a notice that says the tracker was unreachable and the policy was not read.tests/policy-lib-test.sh(a 5xx on the labels GET is named TRANSPORT and never claims an unminted label; a genuinely unminted label still reds as before) andtests/preflight-lib-test.sh(the gate records a non-empty verdict error line on both branches).FACTORY_REF.Why this is worth closing rather than filing under "it self-heals"
The outage genuinely self-heals — but the report does not. It burns a heal cycle chasing a policy key that is correct, and it tells a human to edit a file that is fine. #1359 closed exactly this for the sibling gate; this is the other one.
Cannot land as a swarm worker — this is a protected-path (
.sandcastle/) machinery change →ready-for-sessionEvery substantive file in the proposed fix lives inside
.sandcastle/, the fingerprinted-protected tree (#445):.sandcastle/policy-lib.sh(split the transport-vs-unminted failure inpolicy_validate).sandcastle/preflight-lib.sh(preflight_policy_gate→verdict_error,SWARM_EXIT_REASON=policy-tracker-unreachable).sandcastle/tests/policy-lib-test.sh,.sandcastle/tests/preflight-lib-test.sh.sandcastle/FACTORY_REF(re-vendor bump)PP_PROTECTED_DIRS_DEFAULT=".sandcastle .forgejo"— a swarm worker that writes any of these has its edits rolled back and the run failed loud byprotected-paths-lib.sh(#445). Thedocs/GOTCHAS.mdappend the ticket calls for is to ride in the same commit as the re-vendor, so there is nothing a swarm worker can land here in isolation.This is exactly the case the protected-path escape and ADR 0174 route to an interactive session: a
.sandcastle/change needs a session's standing (the vendored-from-dev-factory round-trip — fix at theMatou/dev-factoryroot, re-vendor here, bumpFACTORY_REF, drift gate). The precedent the ticket itself cites, #2048, landed as aharness #2048:session commit (c6b9535a), not asandcastle:swarm commit — the same route this one needs.No scope or analysis dispute: the root-cause writeup (24s Forgejo 5xx > 6s retry budget;
policy_validate's one liveforgejo_get '/labels?limit=100'failing closed asinvalid-policy;preflight_policy_gatenever callingverdict_error— the #12 half of the pair #1359 closed for the #446 half) all stands. It is only the actor that is wrong: a swarm worker cannot touch the machinery that judges it.Swapping
ready-for-agent→ready-for-session. No separate issue filed — this ticket is itself the machinery-change issue.Close-report — landed (advances #2052)
Ruled by agent under ADR 0174 — veto anytime. A two-way door: a revertible dev-factory commit + a
FACTORY_REFbump + a revertible idss commit, proven by offline tests. Same class as #1359 / ADR 0287 / #2048 — a verdict-honesty tightening, not a security-posture widening; not on ADR 0174's one-way-door list.What was wrong (reproduced in the code, not taken on faith)
policy_validate(policy-lib.sh) ended in one live call — the HUMAN_LABELS minted check,forgejo_get '/labels?limit=100'— and on a non-zero rc returned 2 with no distinction between "the file is wrong" and "I could not read the tracker".preflight_policy_gate(preflight-lib.sh) called noverdict_error, so a transport fault surfaced asSWARM_EXIT_REASON=invalid-policy, an empty--- error lines ---block, and a notice telling a human to "fix the named policy key" for a valid file. The forgejo_get shared budget (#2048: retries=3/backoff=2 ≈ 6s) was also shorter than the ~24s blip. This is exactly the #1359 defect inpreflight_gate's twin, which #1359 left out of scope.The fix (both files factory-vendored, ADR 0180)
policy-lib.sh—policy_validatenow returns a distinct rc 3 (TRANSPORT) —policy: TRANSPORT — the repo's label set was never read; HUMAN_LABELS was not validated— when the labels GET itself fails, vs rc 2 for a structurally-invalid file or a genuinely-unminted label. That one idempotent GET rides out a real blip longer (retries=5, backoff=2 ≈ 30s; a healthy tracker still answers on the first attempt).preflight-lib.sh—preflight_policy_gaterecordspolicy_validate's stderr viaverdict_erroron every refusal, and on rc 3 setsSWARM_EXIT_REASON=policy-tracker-unreachablewith a notice that the tracker was unreachable and the policy was not read — neverinvalid-policy.Proof (offline, green in place)
tests/policy-lib-test.sh: 65 checks — pins the rc 2 / rc 3 split (a 5xx on the labels GET is named TRANSPORT and never claims a label is unminted; a genuinely-unminted label still reds rc 2).tests/preflight-lib-test.sh: 10 groups — a non-empty verdict error line on BOTH the invalid and transport branches; the transport branch namespolicy-tracker-unreachable, says "unreachable", and never says "invalid".run-swarm-stages-test.sh(12 groups),onboarding/tests/onboard-lib-test.sh(238 passed).check-harness-drift.sh: OK against the new pin.Commits / artifacts
backport/idss-2052@d5be6884b60fd3fe36dd0dc12f72061a073c66e8(authored off the pin7d40af3, the #2048 route).main@3b30cda3—FACTORY_REF 7d40af3 → d5be688, the two libs + their vendored tests re-vendored,GOTCHAS #397appended,STATUS.mdupdated (same commit).Owed / routed
Forward-port of
d5be688's diff onto dev-factorymainfiled as #2053 (ready-for-session; df is LANDING=push since df #276, so it no longer needs the human merge that routed sibling #2049 to a human). Out of scope here, exactly as #2048 split its own main forward-port to #2049.The outage self-heals; this made the report honest so it no longer burns a heal cycle on a correct policy key or tells a human to edit a fine file.