sandcastle: HEAL_WORKDIR is a hardcoded /home/dev path — coa's healer hook dies before diagnosing on any pool host but one #171
Labels
No labels
agent-blocked
agent-working
bug
deferred
enhancement
model-haiku
model-opus
model-sonnet
needs-info
needs-triage
no-triage
priority
product-decision
ready-for-agent
ready-for-human
ready-for-session
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/coa#171
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?
Filed by the healer (watchdog sweep, heal run
heal-Matou-coa-1791543730-3188403, signature0ff1caf1b642).Symptom
swarm (bens-mac-04)redded three consecutive ticks inMatou/coa(runs 16694 09:51Z, 16701 10:16Z, 16705 10:46Z on 2026-10-09). The on-failureInvestigate failure (healer)step produced exactly one line of output on each:No diagnosis, no evidence dir, no signature — only the step's
:rotating_light: swarm failed AND the healer erroredMattermost fallback (which ends|| true, so the step reports success and the real fault is invisible in the run list). The fault was only caught an hour later by the hourly watchdog, which — running on a different host — had no local verdict file to key on and minted the incident with an empty error line:watchdog: streak ().Cause
.sandcastle/swarm-identity.sh:8An absolute path, not
$HOME-relative.heal.sh:86-88doesWORKDIR="$HEAL_WORKDIR"; HEALER_STATE="${HEALER_STATE:-$WORKDIR/.sandcastle/.state/healer}"; mkdir -p "$HEALER_STATE"underset -e, so on any host whose runner HOME is not/home/devthe healer aborts on line 88, before it reads a single piece of evidence.The sibling repo is already correct —
Matou/idss's.sandcastle/swarm-identity.sh:8reads: "${HEAL_WORKDIR:=$HOME/swarm/Matou/idss}", and idss's healer hook ran fine on bens-mac-04 in the same minute (heal: incident wf=swarm sig=c7b66d17fa31) off the identical underlying fault. coa's generated line is the odd one out.This is the per-role half of GOTCHAS 2 ("a host half is per role, not per repo") biting again: the swarm half works on bens-mac-04, the healer half does not.
Fix
Make the default
$HOME-relative, matching idss:swarm.yml/triage.ymlalready invokebash "$HOME/swarm/${{ github.repository }}/.sandcastle/heal.sh", so the identity default is the only place the path is pinned.Acceptance
.sandcastle/swarm-identity.shno longer contains a/home/literal./home/devproduces a realheal: evidence at …/heal: incident wf=… sig=…pair, not themkdirline.docs/GOTCHAS.mdgains an entry: a healer hook that dies inmkdiris silent by construction — the step's Mattermost fallback swallows the exit and the run looks green — so the hook's own failure must be read from the step log, not the step status.Out of scope
The underlying DNS fault on bens-mac-04 — filed separately as a host issue. This ticket is only about the healer being unable to report it.
Notes
.sandcastle/is vendored atFACTORY_REF87e1b55; this fix is factory-side as well as here, so the re-vendor must carry it back deliberately.ready-for-sessionperdocs/agents/issue-tracker.md, never inside a worker PR.POST /{owner}/{repo}/actions/runs/<run_number>/jobs/<idx>/attempt/1with{"logCursors":[{"step":N,"cursor":0,"expanded":true}]}and anAuthorization: tokenheader returns the per-step log as JSON. The/attempt/1suffix is required (without it the bare/jobs/<idx>POST 500s withtask with job_id … and attempt 0: resource does not exist). That is how the logs quoted above were obtained; worth folding into GOTCHAS 3 and into the healer's evidence collector so an off-host leg is no longer a blind spot.Close-report (pr-mode) — PR #180 opened, awaiting a human merge.
Ruled by agent under ADR 0002 (two-way door — revertible one-line config, provable by the identity + heal seams); veto anytime.
What lands (PR #180,
closes #171):.sandcastle/swarm-identity.sh—HEAL_WORKDIRdefault changed from the absolute/home/dev/swarm/Matou/coato$HOME/swarm/Matou/coa, matchingMatou/idss. This file is the per-repo identity layer (the comment at its head invites editingHEAL_WORKDIR) and is not inFACTORY_MANIFEST, so the change is drift-safe.RUNNER_HOSTwas already a per-repo edit here.docs/GOTCHAS.md— new entry 25: a healer hook that dies in its ownmkdiris silent by construction (the step's|| trueMattermost fallback swallows the exit and the run looks green), so the hook's own failure must be read from the step log, not the step status. GOTCHAS 3 amended with the per-step log endpoint from the Notes (POST …/runs/<n>/jobs/<idx>/attempt/1withlogCursors), since it is now the seam for reading an off-host leg.STATUS.md— header + milestone log updated in the same commit.Commit:
aa5845aonagent/issue-171.Proof (acceptance):
grep /home/ .sandcastle/swarm-identity.sh→ no match. ✔/home/devHOME:env -u HEAL_WORKDIR HOME=/home/bensmac bash -c '. .sandcastle/swarm-identity.sh; echo $HEAL_WORKDIR'→/home/bensmac/swarm/Matou/coa, soheal.sh'smkdir -p "$HEAL_WORKDIR/.sandcastle/.state/healer"succeeds and the hook reaches its evidence collector instead of aborting. ✔docs/GOTCHAS.mdgained the required entry (25) on the silent-mkdirhazard. ✔bash .sandcastle/tests/swarm-identity-test.sh→ 7 groups passed (the test does not exerciseHEAL_WORKDIR; nothing regressed).bash .sandcastle/check-harness-drift.sh→ OK.Residue / out of scope:
factory onboardtemplate); the next.sandcastlere-vendor must carry this fix back deliberately, or a re-onboard would regenerate the/home/devdefault.bens-mac-04is a separate host issue — this ticket was only about the healer being unable to report it.pr-mode: leaving #171 open and
ready-for-sessiondropped by the runner; the human's merge of PR #180 closes it.Ruled by agent under ADR 0174 — veto anytime.
Ruling: state →
ready-for-session. The ticket carriedbug, prioritybut no state role — the runner's close-report above notes theready-for-sessionlabel was dropped, leaving it untriaged on state. Restoring it.Why it's a two-way door: a label change, fully revertible by removing the label; widens no security posture, touches no credentials, spends nothing. Not on the one-way-door list.
What proves it:
docs/agents/issue-tracker.md— "Machinery changes (anything under.sandcastle/or.forgejo/) are filedready-for-session, never inside a worker's PR." The fix is in.sandcastle/swarm-identity.sh(a protected path) and PR #180 is already open withcloses #171; a human session merges it.Ruled by agent under ADR 0174 — veto anytime.
Label applied:
ready-for-session(categorybug/priorityunchanged). Today's close-report noted theready-for-sessionlabel was dropped by the runner, leaving the ticket untriaged on state. Applying it now closes that drop. PR #180 (closes #171) — the$HOME-relativeHEAL_WORKDIRdefault in.sandcastle/swarm-identity.sh— is open for a human/session merge.Why it's a two-way door: a label change, fully revertible; widens no security posture, touches no credentials, spends nothing. What proves it:
docs/agents/issue-tracker.md:50(machinery under.sandcastle/→ready-for-session, never a worker PR); the fix is in.sandcastle/swarm-identity.sh(a protected path) and PR #180 is open withcloses #171.Ruled by agent under ADR 0174 — veto anytime.
Ruling: state →
ready-for-human(categorybug, priorityunchanged), correcting the priorready-for-sessionruling on this ticket.Why the change.
ready-for-sessionis not terminal here and provably loops. The session's job is done — PR #180 (closes #171) is open and green. By design, a pr-mode ticket with an open agent PR is "handed to review": the session runner deletesready-for-sessionand adds nothing, because a human merges the PR (.sandcastle/session-runner.sh:413-415and:660-663—api -X DELETE …/labels/$rfs_id, "#302"). Each triage run then re-reads the now-stateless ticket as untriaged and re-addsready-for-session, which the runner drops ~10 min later. This issue's own label timeline shows the churn: added 15:08Z → removed 15:20Z → added 15:39Z → removed 15:49Z. Re-adding it a fifth time would only restart the loop.## Why human. The sole residue is a human's decision to merge PR #180 — a change to a protected machinery path (
.sandcastle/swarm-identity.sh). A protected path is protected precisely because landing it tomainis a standing/trust call; the swarm worker lane cannot make it and the session drainer refuses it (it hands the open PR back to review). A test proves the one-line fix works; it does not decide whether the machinery change should land. Proposed default: merge PR #180 as-is (the one-line$HOME-relativeHEAL_WORKDIRmatchingMatou/idss, proven green), and carry the same fix back factory-side at the next.sandcastlere-vendor so a re-onboard does not regenerate the/home/devdefault.Why relabelling is itself a two-way door: a label change, fully revertible, touching no credential, posture, or spend — not on the one-way-door list. What proves it: the add/remove churn in this issue's label timeline, and
.sandcastle/session-runner.sh:413-415/:660-663.