swarm: healer ci signatures go stage-aware — a moved fault must re-trigger investigation #197

Closed
opened 2026-07-30 23:17:52 +00:00 by ben · 2 comments
Owner

What happened (2026-07-30 evening)

Seam run 1445 (commit 35cb1cd) went red; the healer's hook diagnosis was excellent — it reproduced in nix develop and named the exact staticcheck defect (#193's SA4010 dead store). But runs 1450 and 1452 then failed on a different defect (#195's revive shadowed-builtin in wiring_test.go), and the healer replied "🔄 still failing (26418c5a86f3, ci)" to both — same signature, no re-investigation. The fault had moved; the signature couldn't see it.

Why

For ci failures the healer has no local seam artifact, so heal.sh's error_line() degrades the incident signature to the workflow name alone (its own comment says so). Any subsequent ci failure within the cooldown — whatever the cause — matches the ledgered signature and lands in reply-recurring, which posts a one-liner and re-diagnoses nothing. Tonight that masked a moved fault for ~40 minutes; with a slower human it could mask one for the whole cooldown.

What to build

Make the ci incident signature stage/fault-aware so a changed fault re-triggers investigate:

  1. Prefer real evidence: fetch the failed run's log (or have the seam script write a compact seam-verdict.txt artifact — failing stage + first error lines — that survives for the healer to read; the runner is host-mode on the workstation, so a well-known path works even without a log API).
  2. Compute the signature from workflow + failing stage + normalized error line. Unchanged fault → reply-recurring as today; changed fault → fresh investigate with a new thread reply.
  3. Keep the reply cap and cooldown semantics (the #149-era storm guards) — this changes what counts as the same incident, not how noisy an incident may be.

Acceptance criteria

  • Given two consecutive ci failures with different failing stages or error lines, When the healer runs, Then the second gets a fresh investigation, not a reply-recurring one-liner
  • Given the same fault recurring, When the healer runs, Then behaviour is unchanged (reply → cap → quiet)
  • Given no readable evidence at all, When the healer runs, Then it degrades as today but says so in the post ("signature degraded to workflow name — treat 'still failing' as unverified")

Task manifest

task: swarm:healer-stage-aware-signatures
implements_seam: ".sandcastle/heal.sh incident ledger + ci workflow evidence"
interface: "compute_signature / error_line over real run evidence"
seam: "heal.sh test seam (HEAL_AGENT_CMD stub) — deterministic signature tests"
acceptance:
  - given: two ci failures with different faults; when: the healer handles both; then: two investigations, distinct signatures
depends_on: []
out_of_scope: [changing reply caps/cooldowns (limit-guard storm lessons stand), non-ci workflows whose signatures already carry error lines]
needs_human_decision: []
## What happened (2026-07-30 evening) Seam run 1445 (commit `35cb1cd`) went red; the healer's hook diagnosis was excellent — it reproduced in `nix develop` and named the exact staticcheck defect (#193's SA4010 dead store). But runs 1450 and 1452 then failed on a **different** defect (#195's revive shadowed-builtin in `wiring_test.go`), and the healer replied ":arrows_counterclockwise: still failing (`26418c5a86f3`, ci)" to both — same signature, no re-investigation. The fault had moved; the signature couldn't see it. ## Why For `ci` failures the healer has no local seam artifact, so `heal.sh`'s `error_line()` degrades the incident signature to the workflow name alone (its own comment says so). Any subsequent `ci` failure within the cooldown — whatever the cause — matches the ledgered signature and lands in `reply-recurring`, which posts a one-liner and re-diagnoses nothing. Tonight that masked a moved fault for ~40 minutes; with a slower human it could mask one for the whole cooldown. ## What to build Make the `ci` incident signature **stage/fault-aware** so a changed fault re-triggers `investigate`: 1. Prefer real evidence: fetch the failed run's log (or have the seam script write a compact `seam-verdict.txt` artifact — failing stage + first error lines — that survives for the healer to read; the runner is host-mode on the workstation, so a well-known path works even without a log API). 2. Compute the signature from workflow + failing stage + normalized error line. Unchanged fault → `reply-recurring` as today; changed fault → fresh `investigate` with a new thread reply. 3. Keep the reply cap and cooldown semantics (the #149-era storm guards) — this changes *what counts as the same incident*, not how noisy an incident may be. ## Acceptance criteria - [ ] Given two consecutive `ci` failures with different failing stages or error lines, When the healer runs, Then the second gets a fresh investigation, not a `reply-recurring` one-liner - [ ] Given the same fault recurring, When the healer runs, Then behaviour is unchanged (reply → cap → quiet) - [ ] Given no readable evidence at all, When the healer runs, Then it degrades as today but says so in the post ("signature degraded to workflow name — treat 'still failing' as unverified") ## Task manifest ```yaml task: swarm:healer-stage-aware-signatures implements_seam: ".sandcastle/heal.sh incident ledger + ci workflow evidence" interface: "compute_signature / error_line over real run evidence" seam: "heal.sh test seam (HEAL_AGENT_CMD stub) — deterministic signature tests" acceptance: - given: two ci failures with different faults; when: the healer handles both; then: two investigations, distinct signatures depends_on: [] out_of_scope: [changing reply caps/cooldowns (limit-guard storm lessons stand), non-ci workflows whose signatures already carry error lines] needs_human_decision: [] ```
Author
Owner

This was generated by AI during triage.

Triage

Category: enhancement (already applied)
State: → ready-for-agent

Verification: read .sandcastle/heal.sh's error_line() — its own comment (lines ~68-71) confirms the exact limitation the issue reports: "ci/triage failures have no local artifact ... their signature degrades to the workflow name alone: distinct ci faults within one cooldown share an incident. Accepted limitation." This matches the reported incident (runs 1450/1452 both matching run 1445's signature despite a different underlying fault). Confirmed, not already fixed.

Prior rejection check: no .out-of-scope/ directory exists yet.

Design gate: not applicable — healer/CI infra, no UX flow or wireframe.

Human-decision gate: task manifest's needs_human_decision is empty.

The issue body's task manifest + Given/When/Then acceptance criteria (including the explicit "no readable evidence → say so" degrade-and-announce case) is a complete agent brief already. No separate brief comment needed.

> *This was generated by AI during triage.* ## Triage **Category:** enhancement (already applied) **State:** → `ready-for-agent` **Verification:** read `.sandcastle/heal.sh`'s `error_line()` — its own comment (lines ~68-71) confirms the exact limitation the issue reports: "ci/triage failures have no local artifact ... their signature degrades to the workflow name alone: distinct ci faults within one cooldown share an incident. Accepted limitation." This matches the reported incident (runs 1450/1452 both matching run 1445's signature despite a different underlying fault). Confirmed, not already fixed. **Prior rejection check:** no `.out-of-scope/` directory exists yet. **Design gate:** not applicable — healer/CI infra, no UX flow or wireframe. **Human-decision gate:** task manifest's `needs_human_decision` is empty. The issue body's task manifest + Given/When/Then acceptance criteria (including the explicit "no readable evidence → say so" degrade-and-announce case) is a complete agent brief already. No separate brief comment needed.
Author
Owner

Done in 1af9a2a (on main).

What shipped — the ci incident signature is now stage/fault-aware:

  • scripts/seam-smoke.sh writes a verdict artifact on failure (stage= + first error lines) to a well-known host path (/tmp/matou-seam-verdict.txt). The runner is host-mode, so the path survives without a log API. The failing stage is read back from the log’s ==> banners, so the pipe subshell can’t strand it.
  • seam_verdict_signal (heal-lib.sh) folds <stage> :: <error>; error_line prefers it for ci only (non-ci signatures already carry error lines — out of scope, untouched).
  • AC1: two ci failures with different stages/error lines → distinct signatures → the second gets a fresh investigate, not a reply-recurring one-liner.
  • AC2: the same fault recurring is unchanged — reply → cap → quiet (the #149-era storm guards stand; caps/cooldowns not touched).
  • AC3: no readable verdict → degrades exactly as before, but the post now says so: signature degraded to workflow name — treat "still failing" as unverified.

Seam tests (offline, deterministic): heal-lib-test.sh — 12 groups (stage/fault-aware + degrade signals; a moved fault → different signature, same fault → same, line-number jitter normalizes). heal-test.sh — 6 scenarios (a moved ci fault re-investigates; the same fault escalates unchanged; a degraded post is flagged). Both green.

Done in `1af9a2a` (on `main`). **What shipped** — the `ci` incident signature is now stage/fault-aware: - `scripts/seam-smoke.sh` writes a **verdict artifact** on failure (`stage=` + first error lines) to a well-known host path (`/tmp/matou-seam-verdict.txt`). The runner is host-mode, so the path survives without a log API. The failing stage is read back from the log’s `==> ` banners, so the pipe subshell can’t strand it. - `seam_verdict_signal` (`heal-lib.sh`) folds `<stage> :: <error>`; `error_line` prefers it **for `ci` only** (non-ci signatures already carry error lines — out of scope, untouched). - **AC1**: two `ci` failures with different stages/error lines → distinct signatures → the second gets a fresh `investigate`, not a `reply-recurring` one-liner. - **AC2**: the same fault recurring is unchanged — reply → cap → quiet (the #149-era storm guards stand; caps/cooldowns not touched). - **AC3**: no readable verdict → degrades exactly as before, but the post now says so: `signature degraded to workflow name — treat "still failing" as unverified`. **Seam tests** (offline, deterministic): `heal-lib-test.sh` — 12 groups (stage/fault-aware + degrade signals; a moved fault → different signature, same fault → same, line-number jitter normalizes). `heal-test.sh` — 6 scenarios (a moved ci fault re-investigates; the same fault escalates unchanged; a degraded post is flagged). Both green.
ben closed this issue 2026-07-31 08:39:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#197
No description provided.