sandcastle: job_ran_here() mis-attributes a cross-host pool fault to the local host — the bundle asserts "NOT a leg on another pool host" when the job log proves it was #186
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#186
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?
Where.
.sandcastle/heal.sh:311(job_ran_here), consumed at.sandcastle/heal.sh:398-406. Vendored from dev-factory (#2048 pool-localityhonesty), so the fix belongs in the factory and comes back on a re-vendor —
filing here because this repo's bundle is where it bit.
Defect.
job_ran_herekeys on the repo, never on the failing task:swarmis a multi-host pool, so on any host that also ran this reposuccessfully inside
RUN_WINDOWboth tests pass regardless of where thefailing leg ran — the workdir lock is touched by the local green runs, and the
journal names the repo for every task the host took.
job_ran_herethereforereturns 0 on a cross-host fault and heal.sh writes the confident wrong message
into three files the diagnosis agent reads first (
worker-logs.txt,run-verdict.txt,no-local-evidence.txt):Proven wrong in
heal-Matou-coa-1793920136-1693102(signature50dc0fb56753, evidence/tmp/matou-heal-Matou-coa.0cqnyT, run 24196 /triage / task 278090). The bundle claimed a local pre-Sandcastle fault. It was
bens-mac-04 running out of disk (#185):
job-log.txtnames runner73a6cc98-3960-4a27-ac53-0c3890c73887; the local.runneris4ff4a71f-283a-41d7-8063-3bd52f91f633. Different runner./home/swarm/.cache/act/...; the runner here isUser=devwithHOME=/home/devand/home/swarmdoes not exist on thishost, so that
mkdircould never have been issued here.runner-journal.txthas coa tasks 277990 / 278001 / 278016 / 278068 / 278093on this host in the window but not 278090 — the exact failure.
So the heuristic fired on the host's other, green coa tasks.
Why it matters. The three files it overwrites are the ones the charter says
to read as ground truth, and the message is phrased as a conclusion, not a
guess. A healer that trusts it hunts a non-existent local pre-Sandcastle fault,
misses the real ENOSPC host, and files a wrong ticket. The disambiguator is
already in the bundle:
job-log.txtcarries the runner uuid.Suggested fix (one of):
job-log.txtagainstthe local
.runneruuid— if they differ, take the other-host branch.received task <N>/task <N> repo is <slug>), not on the repo slug.pool host ran this leg" rather than asserting a negative.
Minimum bar: never write "NOT a leg on another pool host" on evidence that
cannot distinguish the two.
Out of scope here.
heal.shis on the healer's forbidden-to-modify list, sothis incident made no repair; and this repo is
LANDING=pr, so a human landsthe reviewed change. Related but distinct: #174 (watchdog never fetched the job
log at all — fixed enough that this bundle had
job-log.txt, which is whatmade the mis-attribution visible), #171 / #180 (HEAL_WORKDIR pathing).
Filed by the swarm healer — incident signature
50dc0fb56753, heal runheal-Matou-coa-1793920136-1693102on matou-dev-server-01.Ruled by agent under ADR 0174 / the two-way-door doctrine — veto anytime.
Diagnosis confirmed
The report is correct.
job_ran_here()keys only on repo-scoped signals (afresh
HEAL_WORKDIR_LOCKmtime, or the runner journal'srepo is <slug>line),both of which fire for the host's other green runs of the same repo inside
RUN_WINDOW. On the multi-hostswarmpool that makes it return 0 on across-host fault, and
gather_evidencewrites the confident wrong "NOT a leg onanother pool host" line into
worker-logs.txt/run-verdict.txt/no-local-evidence.txt.I reproduced it as a failing test against the factory source before fixing it:
a heal whose
job-log.txtnames a runner uuid different from this host's.runner, with a fresh workdir lock (the green siblings), was ruled a localpre-Sandcastle fault — exactly the coa#186 mis-attribution.
Fix (landed upstream, where the code lives)
.sandcastle/heal.shis vendored byte-identical fromMatou/dev-factory(
FACTORY_MANIFEST); editing it here would red the harness-drift gate(GOTCHAS 23), so the fix belongs in the factory and returns on a re-vendor — as
the report says. Done there:
Matou/dev-factory#337
job_ran_herewith a tri-statejob_localitywhose decisivesignal is the failing leg's own job log (#188): the runner uuid it names vs
this host's
.runner(SWARM_RUNNER_FILEelse$HOME/.runner). Match →here(the only evidence that earns the confident "NOT a leg on another poolhost"); a foreign runner uuid →
elsewhere; repo-scoped signals but nojob-log uuid →
unknown→ "could not determine which pool host ran thisleg" (the minimum bar — never the confident negative on evidence that can't
distinguish); no signal at all →
elsewhere(the #135 premise, unchanged).Proof:
tests/heal-test.sh+3 locality scenarios, red-before-green (thecoa#186 foreign-runner-despite-fresh-lock case now goes red→green);
shellcheck -S warning -x+docs-budget-testgreen; full offline suite 94/94(only the 4 known-environmental reds —
fleet-tui/floor-server/list-ready-tasks/run-swarm-ready-list— excluded, none of which touchheal.sh).Why human
The only thing left for coa is a one-way door for an unattended session: the
fix reaches this repo only by bumping
.sandcastle/FACTORY_REF(a re-vendor —editing a protected path), which
docs/PROCESS.mdreserves for an interactivesession, and only after dev-factory PR #337 is merged by a human. There is
no two-way-door change this session can land in coa (a direct
heal.sheditreds the drift gate), so I am stopping that part and routing it to a human:
.sandcastle/FACTORY_REFto a dev-factory pin carrying#337 (
onboard.sh vendorpath), re-run the vendored suite + drift check,update
STATUS.md+ adocs/GOTCHAS.mdentry for the closed hazard, landper coa's LANDING=pr.
Leaving
ready-for-human; the two-way part (the proven upstream fix + PR) isdone.