healer watchdog mode keys ci incidents on worker prose — verdict_path is looked up by JOB name (seam), not workflow (ci) #1045
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#1045
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
The hourly watchdog fired an incident for workflow
seam(sig734573d690b5, evidence/tmp/matou-heal-Matou-idss.Scrixdon matou-workstation) whose trigger error line was not an error at all — it was a verbatim sentence from a Sandcastle worker's chain-of-thought report:That line is
worker-logs.txt:596. This is exactly the phantom-signature class #197 / #235 closed for push-mode — still wide open in watchdog mode.Root cause — two independent defects
1. Job name vs workflow name.
heal-lib.sh:watchdog_detectemits.namefrom theactions/taskspayload, which is the JOB name. Forci.ymlthat job is calledseam.heal.sh:94 verdict_path()cases on workflow names only:verdict_path seam→ empty →error_line()falls through to its legacy branch (heal.sh:264),grep -hE "error|Error|..." worker-logs.txt | tail -1, and mints the signature off worker prose. This is the SAME.name-is-the-job-name gotchawatchdog_detect's own comment spells out for the healer self-exclusion (coa #50) — the fix landed for.workflow_idthere but not for the verdict lookup.2. The verdict path is single-slot and cleared at run start.
scripts/seam-smoke.shdoesrm -f "$SEAM_VERDICT"on entry, so the next seam run erases the previous run's verdict. Here: seam failed at 17:35 (run 14671), a new seam started 17:55 (run 14684) and wiped the verdict, and the 18:00 watchdog found nothing. Even a name-correctverdict_pathwould have come up empty. There is no per-run/per-sha verdict slot.Net effect: every watchdog-mode ci incident keys its signature on unrelated worker chain-of-thought, so the ledger cannot distinguish faults, "still failing" is meaningless, and a healer investigation is spent on prose.
Evidence
/tmp/matou-heal-Matou-idss.Scrixd/prompt.txt— trigger error line/tmp/matou-heal-Matou-idss.Scrixd/worker-logs.txt:596— the identical sentencerun-verdict.txtin the evidence dir; no/tmp/matou-Matou-idss-seam-verdict.txton the hostrunner-journal.txt:62,80,99— tasks 36643 / 36702 / 36745 all claimed on this host in HOST mode, so the verdict path is the real host/tmpSuggested fix
verdict_pathcase that also acceptsseam→$SEAM_VERDICT, or havewatchdog_detectemit.workflow_idalongside.nameand key on that). Prefer.workflow_id: it cannot drift with a job rename, which is the whole reason the self-exclusion filter uses it.scripts/tests/— the existing seam-verdict tests only cover push mode.Note on ownership
.sandcastle/heal.shandheal-lib.share vendored fromMatou/dev-factory(ADR 0180) and gated bycheck-harness-drift.sh, so the fix must land upstream and be re-vendored — editing them in-repo goes red on the drift gate. The swarm healer charter also forbids the healer from editing them, which is why this is a ticket.Not this ticket
The two seam reds in the window (runs 14656
5f25a09c, 14671adc6ff57) were a genuine product failure —FoundingIdipExplainer.vuecarried twofont-size: 0.72remdeclarations below the #258 type-scale guard's 0.75rem floor. Already fixed and closed as #1041 (e55fc5f1). Filed by the swarm healer.Agent hand-off → ready-for-session
The core fix (defect #1:
watchdog_detectemits the job nameseam, butheal.sh:verdict_pathcases only on workflow names, soverdict_path seam→ empty →error_linefalls through to the legacy prose grep atheal.sh:264) lives entirely in protected, vendored paths:.sandcastle/heal.sh(verdict_path@94,error_line@239).sandcastle/heal-lib.sh(watchdog_detect@162)Both are in
.sandcastle/FACTORY_MANIFEST(lines 24–25) and are vendored fromMatou/dev-factoryper ADR 0180, gated bycheck-harness-drift.sh. Their regression tests (tests/heal-lib-test.sh,tests/heal-test.sh) also live upstream in the manifest. A Sandcastle worker cannot land this: editing.sandcastle/is rolled back by the protected-paths fingerprint (#445) and reds the drift gate, and the fix has to land upstream and be re-vendored anyway.Confirmed the ticket's analysis:
.workflow_id— is exactly what the sibling self-exclusion filter already does (heal-lib.sh:156-160, coa #50);verdict_pathjust never got the same treatment.scripts/seam-smoke.sh:29(rm -f "$SEAM_VERDICT"at run entry). This half is product-side/editable, but fixing it alone is pointless — the healer still can't find the seam verdict untilverdict_pathmapsseam, andheal.sh:verdict_is_fresh(@106) already rejects a stale earlier-run verdict, so "stop clearing at run start" in isolation only leaves stale files the healer discards. The per-run verdict slot must be co-designed with the healer's lookup (both live in dev-factory), so it belongs in the same upstream change.No product-side partial closes this ticket. Handing to
ready-for-session: an interactive session withMatou/dev-factorystanding lands both defects + the offline watchdog-mode test upstream and re-vendors (escalating toready-for-humanonly if it finds a one-way door — none apparent; this is revertible and offline-provable).Filed by the swarm worker (run 14675).
Close-report — landed & proven (ADR 0174)
Both root-cause defects are fixed at their two homes, red-first, and proven at offline seams.
Defect 1 — JOB name vs WORKFLOW name (the phantom-signature cause).
heal-lib.sh:watchdog_detectemitted.name, which theactions/tasksendpoint fills with the job name (seamforci.yml;swarm (1)/swarm (2)for a matrix). Butheal.sh:verdict_pathand the hook-modeWORKFLOWenv are workflow names (ci/swarm/triage) — I confirmed both against the live payload and.forgejo/workflows/*.yml(WORKFLOW: ci). Soverdict_path seam→ empty →error_linefell through to grepping worker prose.These files are vendored (ADR 0180), so the fix landed upstream in
Matou/dev-factory(commit9f4dfc6, onmain):watchdog_detectnow emits the workflow from.workflow_id(a.yml/.yamlsuffix trimmed) — exactly the field the self-exclusion already keys on because it cannot drift with a job rename — falling back to.namewhen absent. Grouping stays per-.name(each job keeps its own streak); only the emitted label folds to the workflow, which as a bonus collapses a matrix's legs onto one incident the per-workflow ledger dedup can catch (the old code emittedswarm (1)/swarm (2)as two distinct signatures, both also missingverdict_path).Re-vendored into idss:
.sandcastle/FACTORY_REFa7509a4→9f4dfc6(which also carries dev-factory's one intervening commit,#116test-swarm.db isolation),check-harness-drift.shgreen.Defect 2 — the verdict slot was wiped at run START.
scripts/seam-smoke.shdidrm -f "$SEAM_VERDICT"on entry, so a later seam run erased a prior failing run's verdict before the watchdog could read it (even a name-correct lookup came up empty). The start-clear is gone: a failing run overwrites the slot with its own fault (ERR trap →write_verdict), and a green run clears it only at the very end — so the slot always names the most recent completed run, and an in-flight later run can no longer wipe a finished run's evidence.Defect 3 — offline tests (both pinned, red-first).
tests/heal-lib-test.sh: job→workflow fold, matrix fold, absent-.workflow_idfallback; the four existing null-workflow_idfixtures prove the pre-fix output stays byte-identical. Proven red first (pre-fix emittedseam always-red), then green (20 groups;heal-test.sh16 scenarios).scripts/tests/seam-verdict-watchdog-slot-test.sh(new): start-survival, fail-overwrite, green-clear. Proven red first (pre-fix witness empty — verdict wiped at start), then green (3 checks). Existingseam-errexit-test.sh(10) +seam-verdict-causative-test.sh(4) stay green.Commits
Matou/dev-factory@9f4dfc6—heal-lib: watchdog_detect emits the WORKFLOW, not the JOB name …Matou/idss@88eacd77—sandcastle: #1045 — … stops keying ci/swarm incidents on worker chain-of-thought prose, and the seam verdict slot survives a later run's startProof on the landed tree:
check-harness-drift.shOK (byte-identical @9f4dfc6); vendoredheal-lib-test.sh20 groups; seam tests 3/4/10 green.Ruled by agent under ADR 0174 — veto anytime. Two-way door throughout: a revertible upstream
jqfix + ref bump/re-vendor + a revertible relocation of the seam-smoke clear; no one-way door touched (no credentials, no security-posture change, no data destruction, no trust surface widened), all proven at offline seams.STATUS.mdupdated in the landing commit.publishjobs share one streak bucket — a phantomrelease-publish streakbilled a full investigation #2056