healer: a resource-killed heavy job (probable OOM) mints a phantom bare-workflow 'triage' incident — verdict seam can't survive a SIGKILL #34

Closed
opened 2026-08-23 14:33:15 +00:00 by matou-build-agent · 2 comments

Symptom

Healer fired hook-mode on triage run 213 (if: failure()), signature
29efc559cace, trigger error line unknown, seam-degraded marker set. The
same degraded-triage incident also fired earlier today (~12:31, prior evidence
dir /tmp/matou-heal-Matou-dev-factory.4FXm5C — also seam-degraded, no
diagnosis produced). 29efc559cace == sha1("triage|")|cut -c1-12 — the bare
workflow-name signature, i.e. the verdict seam degraded and the healer went
blind.

What actually happened (evidence)

The /triage run succeeded. run-triage.sh captures the claude -p /triage
output to a mktemp and rms it in its EXIT trap. That temp file survived
as /tmp/tmp.Nhjcoye5Oc (owner swarm, 14:20:32, 409 B) and reads:

"There is nothing to triage in this run: every open issue and PR already
carries a triage-state label ... No action needed."

So claude finished cleanly at 14:20:32. run-triage.sh was then SIGKILL'd
before its EXIT trap ran
— proven two ways: (a) the captured log was not
rm'd, (b) no triage verdict exists (verdict_write writes only on non-zero
exit via the trap; SIGKILL can't be trapped). The job's updated_at is
14:20:36 — killed ~4 s after triage completed.

Context: a 4-job burst — triage 213 + swarm 214/215/216 all concurrent,
/tmp/matou-host-slot-2.lock held (both heavy host-capacity slots in use) on a
15 GB host. Reflog confirms the git-setup fallback checkout succeeded (14:19:49
→ 26b19e9); host/API/lock are all healthy now; sibling swarm runs all green;
preflight-triage.sh now returns []. The run self-healed (triage is
idempotent, and nothing was pending anyway).

Probable trigger: OOM SIGKILL of the heavy claude wrapper during the burst.
UNCONFIRMED — the headless healer runs as swarm with no dmesg/journal access
(runner-journal.txt came back empty), so this needs a human with privileged
logs to confirm.

Why this is a harness gap

A resource-killed heavy job mints a phantom bare-workflow-name incident and
burns a full (expensive) healer investigation on a NON-fault — twice today. The
verdict seam (#18/#235) cannot survive a SIGKILL because it depends on the EXIT
trap.

Asks

  1. Confirm the trigger: check journalctl -k/dmesg on matou-workstation for
    an OOM-kill at 2026-08-23 14:20:32 (and ~12:31). If OOM: is 2 concurrent
    heavy host-capacity slots + a triage claude session safe on 15 GB?
  2. Make the seam survive a kill so this stops minting phantom incidents,
    e.g. drop a lightweight last-stage breadcrumb at verdict_begin/
    verdict_stage (so a SIGKILL'd stage still yields a real signature), and/or
    have the healer recognise "captured claude log shows success + no verdict +
    no runner error line → resource kill, not a fault" and downgrade instead of
    escalating.

Notes

Diagnosed by the swarm healer (run 213). Root-tree fix (run-triage.sh /
verdict-lib.sh / heal.sh) does NOT reach the running .sandcastle/ copy until a
human re-vendors the pin (FACTORY_REF currently bd48fd6). Evidence dir on
matou-workstation: /tmp/matou-heal-Matou-dev-factory.VW8ZFq.

## Symptom Healer fired **hook-mode** on `triage` run 213 (`if: failure()`), signature `29efc559cace`, trigger error line `unknown`, `seam-degraded` marker set. The same degraded-`triage` incident also fired earlier today (~12:31, prior evidence dir `/tmp/matou-heal-Matou-dev-factory.4FXm5C` — also `seam-degraded`, no diagnosis produced). `29efc559cace == sha1("triage|")|cut -c1-12` — the bare workflow-name signature, i.e. the verdict seam degraded and the healer went blind. ## What actually happened (evidence) The `/triage` run **succeeded**. run-triage.sh captures the `claude -p /triage` output to a `mktemp` and `rm`s it in its EXIT trap. That temp file **survived** as `/tmp/tmp.Nhjcoye5Oc` (owner swarm, 14:20:32, 409 B) and reads: > "There is nothing to triage in this run: every open issue and PR already > carries a triage-state label ... No action needed." So claude finished cleanly at 14:20:32. run-triage.sh was then **SIGKILL'd before its EXIT trap ran** — proven two ways: (a) the captured log was not `rm`'d, (b) no triage verdict exists (`verdict_write` writes only on non-zero exit *via the trap*; SIGKILL can't be trapped). The job's `updated_at` is 14:20:36 — killed ~4 s after triage completed. Context: a 4-job burst — triage 213 + swarm 214/215/216 all concurrent, `/tmp/matou-host-slot-2.lock` held (both heavy host-capacity slots in use) on a 15 GB host. Reflog confirms the git-setup fallback checkout succeeded (14:19:49 → 26b19e9); host/API/lock are all healthy now; sibling swarm runs all green; `preflight-triage.sh` now returns `[]`. The run **self-healed** (triage is idempotent, and nothing was pending anyway). **Probable trigger: OOM SIGKILL** of the heavy claude wrapper during the burst. UNCONFIRMED — the headless healer runs as `swarm` with no dmesg/journal access (`runner-journal.txt` came back empty), so this needs a human with privileged logs to confirm. ## Why this is a harness gap A resource-killed heavy job mints a **phantom** bare-workflow-name incident and burns a full (expensive) healer investigation on a NON-fault — twice today. The verdict seam (#18/#235) cannot survive a SIGKILL because it depends on the EXIT trap. ## Asks 1. **Confirm the trigger**: check `journalctl -k`/dmesg on matou-workstation for an OOM-kill at 2026-08-23 14:20:32 (and ~12:31). If OOM: is 2 concurrent heavy host-capacity slots + a triage claude session safe on 15 GB? 2. **Make the seam survive a kill** so this stops minting phantom incidents, e.g. drop a lightweight last-stage breadcrumb at `verdict_begin`/ `verdict_stage` (so a SIGKILL'd stage still yields a real signature), and/or have the healer recognise "captured claude log shows success + no verdict + no runner error line → resource kill, not a fault" and downgrade instead of escalating. ## Notes Diagnosed by the swarm healer (run 213). Root-tree fix (run-triage.sh / verdict-lib.sh / heal.sh) does NOT reach the running `.sandcastle/` copy until a human re-vendors the pin (`FACTORY_REF` currently `bd48fd6`). Evidence dir on matou-workstation: `/tmp/matou-heal-Matou-dev-factory.VW8ZFq`.
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=219
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=219 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #34 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 34,
  "status": "success",
  "commits": [
    "04a8743"
  ],
  "changed_files": [
    "verdict-lib.sh",
    "heal.sh",
    "tests/verdict-lib-test.sh",
    "tests/heal-test.sh",
    "docs/GOTCHAS.md",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "bash tests/verdict-lib-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/heal-test.sh",
      "exit_code": 0
    },
    {
      "command": "bash tests/heal-lib-test.sh",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\"; done",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Make the seam survive a kill so it stops minting phantom bare-workflow-name incidents": "verdict-lib.sh verdict_breadcrumb_write drops an eager <verdict>.breadcrumb at every verdict_begin/verdict_stage; verdict_write erases it on any trapped exit, so a breadcrumb surviving next to an absent verdict is an unambiguous mid-stage SIGKILL. heal.sh error_line keys the signature on the killed STAGE, never the bare name — verified by tests/verdict-lib-test.sh scenario 5 and tests/heal-test.sh #34 block (killedsig ledgered, bare-name degraded sig NOT ledgered).",
    "Healer recognises the resource kill and downgrades instead of escalating": "heal.sh handle_incident downgrades on the seam-killed marker: a low-severity ':zzz: probable resource kill / OOM, not a fault' note and NO investigation agent. tests/heal-test.sh #34 asserts the note posts and the stub agent does NOT run.",
    "Breadcrumb never misclassifies a clean run or a genuine fault": "verdict_write erases the breadcrumb on both exit 0 and non-zero; a genuine fault still writes its verdict (which the reader prefers). tests/verdict-lib-test.sh scenario 6 pins clean-run-erases and fault-erases-but-keeps-verdict.",
    "Every lib change updates its test in the same commit": "verdict-lib.sh -> tests/verdict-lib-test.sh (+2 scenarios), heal.sh -> tests/heal-test.sh (+1 block); full offline suite green.",
    "Operational hazard documented": "docs/GOTCHAS.md #14 (Symptom/Cause/Rule); STATUS.md header + milestone log updated in the same commit."
  },
  "summary": "The EXIT-trap verdict seam now leaves an eager breadcrumb so a SIGKILL'd (OOM) heavy job is recognised as a resource kill and downgraded, not investigated as a phantom bare-workflow-name incident.",
  "blockers": []
}
**close-report** for #34 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 34, "status": "success", "commits": [ "04a8743" ], "changed_files": [ "verdict-lib.sh", "heal.sh", "tests/verdict-lib-test.sh", "tests/heal-test.sh", "docs/GOTCHAS.md", "STATUS.md" ], "tests": [ { "command": "bash tests/verdict-lib-test.sh", "exit_code": 0 }, { "command": "bash tests/heal-test.sh", "exit_code": 0 }, { "command": "bash tests/heal-lib-test.sh", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\"; done", "exit_code": 0 } ], "criteria": { "Make the seam survive a kill so it stops minting phantom bare-workflow-name incidents": "verdict-lib.sh verdict_breadcrumb_write drops an eager <verdict>.breadcrumb at every verdict_begin/verdict_stage; verdict_write erases it on any trapped exit, so a breadcrumb surviving next to an absent verdict is an unambiguous mid-stage SIGKILL. heal.sh error_line keys the signature on the killed STAGE, never the bare name — verified by tests/verdict-lib-test.sh scenario 5 and tests/heal-test.sh #34 block (killedsig ledgered, bare-name degraded sig NOT ledgered).", "Healer recognises the resource kill and downgrades instead of escalating": "heal.sh handle_incident downgrades on the seam-killed marker: a low-severity ':zzz: probable resource kill / OOM, not a fault' note and NO investigation agent. tests/heal-test.sh #34 asserts the note posts and the stub agent does NOT run.", "Breadcrumb never misclassifies a clean run or a genuine fault": "verdict_write erases the breadcrumb on both exit 0 and non-zero; a genuine fault still writes its verdict (which the reader prefers). tests/verdict-lib-test.sh scenario 6 pins clean-run-erases and fault-erases-but-keeps-verdict.", "Every lib change updates its test in the same commit": "verdict-lib.sh -> tests/verdict-lib-test.sh (+2 scenarios), heal.sh -> tests/heal-test.sh (+1 block); full offline suite green.", "Operational hazard documented": "docs/GOTCHAS.md #14 (Symptom/Cause/Rule); STATUS.md header + milestone log updated in the same commit." }, "summary": "The EXIT-trap verdict seam now leaves an eager breadcrumb so a SIGKILL'd (OOM) heavy job is recognised as a resource kill and downgraded, not investigated as a phantom bare-workflow-name incident.", "blockers": [] } ``` </details>
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/dev-factory#34
No description provided.