swarm: healer-signature-fidelity — stage-aware signatures for swarm/triage; scope evidence to the triggering run; absorb Forgejo 5xx in triage preflight #235
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#235
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?
Why (evidence from 2026-07-31 evening)
Two healer escalations tonight (
triage/59febfdb8d87,swarm/9621ee30cf36) were false-positive signatures: for every workflow exceptci,error_line()(.sandcastle/heal.sh:96) greps the newest.sandcastle/logs/*.logforerror|Error|ERR|failed|Failed|fataland takestail -1— and Sandcastle worker chain-of-thought prose is saturated with those words. Both signatures were minted from a stale 03:38 worker narrating the already-closed #198 Go-toolchain gap ("no local Go to check"), unrelated to the failing runs. The healer's own dry-run diagnoses confirmed this twice, independently:/tmp/matou-heal.5QlrRZ/diagnosis.md(18:30, triage run 1637) — real cause was a transient Forgejo 503 storm; signature pointed at the stale worker log./tmp/matou-heal.SXO13O/diagnosis.md(19:34, swarm run 1643) — real cause was the workdir flipped tocore.bare = true(fixed by hand 2026-07-31 ~20:15 UTC, ledger entries retired to.state/healer/retired/); the healer reproducedcompute_signature swarm "<prose line>"→9621ee30cf36exactly.Consequences of the bad signatures: recurrence tracking keys on noise (the "same fault" is just the same stale log line), real distinct faults collapse into one thread, reply caps burn on phantom recurrences, and both incidents escalated to @ben with misleading fingerprints. This is the same defect #197 fixed for
ci(seam-verdict stage marker) and explicitly deferred for the rest (heal.sh:86-87).The healer cannot fix this itself: its charter forbids modifying
heal.sh/heal-lib.sh, hence this ticket.Acceptance criteria
swarmandtriage(extend #197 beyondci):run-swarm.sh/run-triage.shdrop a machine-readable stage/exit marker on failure (mirroring theciseam-verdict bridge), anderror_line()keys the signature on that marker — never on a grep over worker chain-of-thought. When no marker exists, degrade to the workflow name and mark the signature degraded (the$EVIDENCE/seam-degradedhonesty flag already exists forci— reuse it), rather than scraping prose.gather_evidencecurrently tails EVERY.sandcastle/logs/*.log(heal.sh:56), so hours-old worker logs pollute incidents. Collect only logs newer than the triggering run's start (or the run's own log), keeping at most a bounded tail of older context clearly labelled as such.preflight-triage.shpages the issue list with barecurl -sfunderset -euo pipefail(lines 26, 31) — one Forgejo 503 kills the whole triage job (root cause of run 1637). Add a small retry/backoff (e.g. 3 attempts, exponential) to the pagedapi()calls; a persistent outage should still fail the job.tests/limit-lib-test.sh-style offline tests pin the new signature path: a worker log full of "error"/"failed" prose plus a stage marker yields the marker-derived signature; prose alone yields the degraded workflow-name signature, flagged degraded.Non-goals
core.bareworkdir flip is NOT in scope here (fixed by hand; if it recurs it deserves its own investigation).Pointers
.sandcastle/heal.sh(error_line,gather_evidence,compute_signature),.sandcastle/heal-lib.sh,.sandcastle/preflight-triage.sh,.sandcastle/run-triage.sh,.sandcastle/run-swarm.shcistage-aware fix this extends), #198 (the closed gap the phantom signature narrated)/tmp/matou-heal.5QlrRZ/and/tmp/matou-heal.SXO13O/on matou-workstationLanded on
mainas021be8e(sandcastle: swarm:healer-signature-fidelity #235).What was done
swarm/triage: new shared.sandcastle/verdict-lib.sh(verdict_begin/verdict_stage/verdict_write, seam-smoke's exact format).run-swarm.shandrun-triage.shdrop astage=/exit=/--- error lines ---verdict on failure at/tmp/matou-{swarm,triage}-verdict.txtvia one EXIT trap (no-op on clean exit).run-swarmarms the trap beforepnpm install/image-build so the #142 lockfile-class break verdicts too; the worktree sweep stays gated (SWEEP_ARMED, unchanged timing).heal.shgrows averdict_pathmap +verdict_is_freshguard, anderror_linenow keys the signature on the fresh marker forci/swarm/triagealike — never worker chain-of-thought prose — degrading to the workflow name and setting$EVIDENCE/seam-degraded(the honesty flag) when no fresh verdict exists.gather_evidencewindows worker logs toHEAL_RUN_WINDOW(default 2h); only fresh logs feedworker-logs.txt(and the degrade-path grep), older tails go to a clearly-labelledworker-logs-older.txt, never the signature. A stale verdict is ignored the same way.preflight-triage.sh'sapi()gains 3-attempt exponential backoff (root cause of run 1637's 503 storm); a persistent outage still fails the job.tests/heal-test.shnow pins the swarm path (worker error-prose + stage marker → marker-derived signature; prose alone or a stale verdict → degraded workflow-name signature, flagged), plus a newtests/preflight-triage-test.sh(blip-within-budget survives, persistent outage fails). All healer offline tests green.No change to the ledger/reply-cap policy — only to what feeds it. The
core.bareworkdir flip stayed out of scope (non-goal). STATUS.md updated (header + milestone log).git worktree repairkilled run 1649's sibling worker #239seam), not workflow (ci) #1045deploy.targetHost#1497