sandcastle: #336 — rule pool-locality on the failing leg's job-log runner uuid (origin coa#186) #337

Open
matou-build-agent wants to merge 1 commit from fix/336-job-locality-runner-uuid into main

closes #336

What

heal.sh's job_ran_here decided pool-locality from repo-scoped signals
only — a fresh HEAL_WORKDIR_LOCK mtime, or the runner journal naming the repo
(repo is <slug>). On swarm (a multi-host pool) both fire for the host's
other green runs of the same repo in the window, so on a cross-host fault it
returned true and gather_evidence wrote the confident wrong line into the
three files the diagnosis agent reads first:

… THIS repo's job ran on this host … NOT a leg on another pool host

Proven wrong by consumer incident Matou/coa#186 (heal run
heal-Matou-coa-1793920136-1693102, sig 50dc0fb56753, run 24196 / triage /
task 278090): it was bens-mac-04 out of disk — job-log.txt named runner
73a6c98a-… vs the local .runner 4ff4a71f-…; the failing path
/home/swarm/.cache/act/… could not exist on this User=dev host; the journal
carried the host's other coa tasks but not the failing 278090.

How

Replace job_ran_here with a tri-state job_locality:

  • decisive signal = the failing leg's own job log (#188): the runner uuid it
    names vs this host's .runner (SWARM_RUNNER_FILE else $HOME/.runner);
  • our uuid in the log (fixed-string, so a stray KERI AID / task uuid can't be
    confused for it) → here — the only evidence that earns the confident
    "NOT a leg on another pool host";
  • a runner uuid on a runner-labelled line that is not ours → elsewhere;
  • repo-scoped signals fire but no job-log uuid → unknown → "could not
    determine which pool host ran this leg" (the minimum bar: never the confident
    negative on evidence that cannot distinguish);
  • no signal at all → elsewhere (the #135 premise, unchanged).

The ruling moves from gather_evidence into handle_incident (after
collect_job_logs, so job-log.txt exists); gather_evidence drops a
no-local-run marker. error_line/the signature are untouched (they read the
verdict seam, not these message files).

Tests

tests/heal-test.sh +3 locality scenarios (here / elsewhere-despite-fresh-lock
/ undecidable), red-before-green; the SWARM_RUNNER_FILE default is pinned to an
absent sandbox path so the suite never reads the host's real .runner.
shellcheck -S warning -x green on both files; tests/docs-budget-test.sh
green; full offline suite otherwise green (the pre-existing environmental reds
— fleet-tui / floor-server / list-ready-tasks / run-swarm-ready-list,
live tracker / absent node_modules — fail identically on the clean tree).

Matou/coa (LANDING=pr) receives this on its next FACTORY_REF bump.

Screenshots: none — a harness shell-script fix with no visible surface;
evidence is the red→green tests/heal-test.sh scenarios above.

🤖 Generated with Claude Code

closes #336 ## What `heal.sh`'s `job_ran_here` decided pool-locality from **repo-scoped** signals only — a fresh `HEAL_WORKDIR_LOCK` mtime, or the runner journal naming the repo (`repo is <slug>`). On `swarm` (a multi-host pool) both fire for the host's **other green runs of the same repo** in the window, so on a cross-host fault it returned true and `gather_evidence` wrote the confident wrong line into the three files the diagnosis agent reads first: > … THIS repo's job ran on this host … **NOT a leg on another pool host** Proven wrong by consumer incident **Matou/coa#186** (heal run `heal-Matou-coa-1793920136-1693102`, sig `50dc0fb56753`, run 24196 / triage / task 278090): it was `bens-mac-04` out of disk — `job-log.txt` named runner `73a6c98a-…` vs the local `.runner` `4ff4a71f-…`; the failing path `/home/swarm/.cache/act/…` could not exist on this `User=dev` host; the journal carried the host's *other* coa tasks but not the failing 278090. ## How Replace `job_ran_here` with a tri-state `job_locality`: - **decisive** signal = the failing leg's own job log (#188): the runner uuid it names vs this host's `.runner` (`SWARM_RUNNER_FILE` else `$HOME/.runner`); - our uuid in the log (fixed-string, so a stray KERI AID / task uuid can't be confused for it) → `here` — the only evidence that earns the confident "NOT a leg on another pool host"; - a runner uuid on a runner-labelled line that is not ours → `elsewhere`; - repo-scoped signals fire but no job-log uuid → `unknown` → "could not determine which pool host ran this leg" (the minimum bar: never the confident negative on evidence that cannot distinguish); - no signal at all → `elsewhere` (the #135 premise, unchanged). The ruling moves from `gather_evidence` into `handle_incident` (after `collect_job_logs`, so `job-log.txt` exists); `gather_evidence` drops a `no-local-run` marker. `error_line`/the signature are untouched (they read the verdict seam, not these message files). ## Tests `tests/heal-test.sh` +3 locality scenarios (here / elsewhere-despite-fresh-lock / undecidable), red-before-green; the `SWARM_RUNNER_FILE` default is pinned to an absent sandbox path so the suite never reads the host's real `.runner`. `shellcheck -S warning -x` green on both files; `tests/docs-budget-test.sh` green; full offline suite otherwise green (the pre-existing environmental reds — `fleet-tui` / `floor-server` / `list-ready-tasks` / `run-swarm-ready-list`, live tracker / absent `node_modules` — fail identically on the clean tree). `Matou/coa` (LANDING=pr) receives this on its next `FACTORY_REF` bump. **Screenshots:** none — a harness shell-script fix with no visible surface; evidence is the red→green `tests/heal-test.sh` scenarios above. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
sandcastle: #336 — rule pool-locality on the failing leg's job-log runner uuid, not repo-scoped signals
All checks were successful
ci / static (pull_request) Successful in 3m13s
ci / test (pull_request) Successful in 8m31s
54ccaf8b64
`job_ran_here` keyed the "did THIS repo's job run here?" claim on repo-scoped
signals (a fresh HEAL_WORKDIR_LOCK mtime, or the runner journal naming the
repo). On the multi-host swarm pool both fire for the host's OTHER green runs
of the same repo in the window, so a cross-host fault was mis-attributed as a
local pre-Sandcastle fault — the confident wrong "NOT a leg on another pool
host" line in worker-logs.txt / run-verdict.txt / no-local-evidence.txt
(proven by consumer incident Matou/coa#186: bens-mac-04 ENOSPC).

Replace it with a tri-state `job_locality` whose decisive signal is the
failing leg's own job log (#188): the runner uuid it names vs this host's
.runner (SWARM_RUNNER_FILE else $HOME/.runner). Match -> here; a foreign
runner uuid -> elsewhere; repo-scoped signals but no job-log uuid -> unknown
("could not determine which pool host ran this leg"); no signal -> elsewhere
(#135 premise). The ruling moves into handle_incident after collect_job_logs
(job-log.txt does not exist at gather time); gather_evidence drops a
no-local-run marker. error_line/the signature are untouched.

tests/heal-test.sh +3 locality scenarios (red-before-green); shellcheck
-S warning -x + docs-budget green; full offline suite otherwise green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
Member

Landed on main, not yet reaching the running copy — the bug fired again
today, verbatim.

Watchdog heal run heal-Matou-dev-factory-1793998891-2417577 (2026-11-06 21:01Z,
workflow swarm, signature 0990ca97e6aa, healer host matou-dev-server-01).
Its run-verdict.txt, worker-logs.txt and no-local-evidence.txt all carry the
exact sentence this ticket exists to delete:

… local evidence (workdir lock / runner journal) shows THIS repo's job ran on
this host — the fault was in the job BEFORE Sandcastle span, outside the verdict
seam, NOT a leg on another pool host (healer-host: matou-dev-server-01)

It is wrong in the #336 way. job-log.txt names runner
73a6cc98-3960-4a27-ac53-0c3890c73887 for the failing leg (task 280325); this
host's /home/dev/forgejo-runner/.runner is 4ff4a71f-283a-41d7-8063-3bd52f91f633
(name matou-workstation, labels matou-workstation:host, swarm:host). The
failing path /home/swarm/.cache/act/965bd8c6569312e9 cannot exist here — there
is no /home/swarm on this box (/home holds only dev and restic-bkp). It is
bens-mac-04, out of disk — #335.

Why it still fires

The fix is on main but not vendored:

ref
main HEAD c0855fb (#339), f8a4df7 (#336)
.sandcastle/FACTORY_REF de5ebb8 — 19 commits behind, predates both

grep -c 'job_locality\|job_ran_here' .sandcastle/heal-lib.sh → 0, and
.sandcastle/heal.sh:406 still holds the pre-#336 job_ran_here sentence. So
every heal run on every pool host is still emitting the confidently-wrong
locality line into the three files the diagnosis agent reads first — which is
exactly how a cross-host fault gets blamed on the local host.

What a human needs to do

Per GOTCHAS 4 / CLAUDE.md, a root change reaches the running copy only when a
human bumps the pin. This healer cannot do it:

bash onboarding/onboard.sh vendor .sandcastle c0855fb

(then the same bump in the other consumers, so Matou/coa — #336's origin
incident — stops mis-blaming too.)

Not a repair this healer attempted: heal.sh / heal-lib.sh are charter-forbidden
to this agent, and the pin bump is human-gated.

**Landed on `main`, not yet reaching the running copy — the bug fired again today, verbatim.** Watchdog heal run `heal-Matou-dev-factory-1793998891-2417577` (2026-11-06 21:01Z, workflow `swarm`, signature `0990ca97e6aa`, healer host `matou-dev-server-01`). Its `run-verdict.txt`, `worker-logs.txt` and `no-local-evidence.txt` all carry the exact sentence this ticket exists to delete: > … local evidence (workdir lock / runner journal) shows THIS repo's job ran on > this host — the fault was in the job BEFORE Sandcastle span, outside the verdict > seam, **NOT a leg on another pool host** (healer-host: matou-dev-server-01) It is wrong in the #336 way. `job-log.txt` names runner `73a6cc98-3960-4a27-ac53-0c3890c73887` for the failing leg (task 280325); this host's `/home/dev/forgejo-runner/.runner` is `4ff4a71f-283a-41d7-8063-3bd52f91f633` (name `matou-workstation`, labels `matou-workstation:host`, `swarm:host`). The failing path `/home/swarm/.cache/act/965bd8c6569312e9` cannot exist here — there is no `/home/swarm` on this box (`/home` holds only `dev` and `restic-bkp`). It is bens-mac-04, out of disk — #335. ## Why it still fires The fix is on `main` but **not vendored**: | | ref | | --- | --- | | `main` HEAD | `c0855fb` (#339), `f8a4df7` (#336) | | `.sandcastle/FACTORY_REF` | `de5ebb8` — 19 commits behind, predates both | `grep -c 'job_locality\|job_ran_here' .sandcastle/heal-lib.sh` → `0`, and `.sandcastle/heal.sh:406` still holds the pre-#336 `job_ran_here` sentence. So every heal run on every pool host is still emitting the confidently-wrong locality line into the three files the diagnosis agent reads first — which is exactly how a cross-host fault gets blamed on the local host. ## What a human needs to do Per GOTCHAS 4 / `CLAUDE.md`, a root change reaches the running copy only when a human bumps the pin. This healer cannot do it: ``` bash onboarding/onboard.sh vendor .sandcastle c0855fb ``` (then the same bump in the other consumers, so `Matou/coa` — #336's origin incident — stops mis-blaming too.) Not a repair this healer attempted: `heal.sh` / `heal-lib.sh` are charter-forbidden to this agent, and the pin bump is human-gated.
Author
Member

Live field instance of exactly this, from the Matou/dev-factory watchdog
healer (heal run heal-Matou-dev-factory-1794122915-2230587, signature
7af4f7ee9a1f, workflow resume-asks, 2026-11-08 07:2xZ) — recorded here
because the fix is landed at the root but has not reached the running copy.

This bundle's no-local-evidence.txt / worker-logs.txt / run-verdict.txt
all carried the confident wrong line:

… local evidence (workdir lock / runner journal) shows THIS repo's job ran on
this host — the fault was in the job BEFORE Sandcastle span … NOT a leg on
another pool host
(healer-host: matou-dev-server-01)

The failing leg provably ran on another pool host: the job log's runner uuid
is 73a6cc98-3960-4a27-ac53-0c3890c73887 (= bens-mac-04, out of disk, #335),
while this host's .runner uuid is 4ff4a71f-283a-41d7-8063-3bd52f91f633 and
/home/swarm — the act cache path in the fault — does not exist here at all.
job_ran_here fired on the repo-scoped journal grep matching this host's own
four green Matou/dev-factory tasks in the same window (283559, 283581,
283602, 283639).

Why it still fires: the pin, not the code

  • #336 (f8a4df7, 2026-11-06) and #339 (c0855fb, 2026-11-06) both landed
    on heal.sh / host-capacity-lib.sh at the repo root, not under
    .sandcastle/.
  • .sandcastle/FACTORY_REF = de5ebb8 (2026-11-04), and
    git merge-base --is-ancestor de5ebb8 f8a4df7 → true, so the pin predates
    both fixes.
  • .sandcastle/heal.sh:311 in the running copy is still the boolean
    job_ran_here; grep -c uuid over it is 0 — no job_locality tri-state.

So every cross-host heal bundle on this repo keeps shipping the inverted
locality claim as its first three artefacts until a human re-vendors
(bash onboarding/onboard.sh vendor .sandcastle <sha>, GOTCHAS 4). Worth
noting in whatever carries the next pin bump; the diagnosis agent reading those
files first is precisely who the wrong line misleads.

(No repair attempted — re-vendoring the self-copy is a human pin bump, and the
healer charter does not cover it.)

Live field instance of exactly this, from the `Matou/dev-factory` watchdog healer (heal run `heal-Matou-dev-factory-1794122915-2230587`, signature `7af4f7ee9a1f`, workflow `resume-asks`, 2026-11-08 07:2xZ) — recorded here because the fix is landed at the root but **has not reached the running copy**. This bundle's `no-local-evidence.txt` / `worker-logs.txt` / `run-verdict.txt` all carried the confident wrong line: > … local evidence (workdir lock / runner journal) shows THIS repo's job ran on > this host — the fault was in the job BEFORE Sandcastle span … **NOT a leg on > another pool host** (healer-host: matou-dev-server-01) The failing leg provably ran on **another** pool host: the job log's runner uuid is `73a6cc98-3960-4a27-ac53-0c3890c73887` (= bens-mac-04, out of disk, #335), while this host's `.runner` uuid is `4ff4a71f-283a-41d7-8063-3bd52f91f633` and `/home/swarm` — the `act` cache path in the fault — does not exist here at all. `job_ran_here` fired on the repo-scoped journal grep matching this host's own four **green** `Matou/dev-factory` tasks in the same window (283559, 283581, 283602, 283639). ### Why it still fires: the pin, not the code - `#336` (`f8a4df7`, 2026-11-06) and `#339` (`c0855fb`, 2026-11-06) both landed on **`heal.sh` / `host-capacity-lib.sh` at the repo root**, not under `.sandcastle/`. - `.sandcastle/FACTORY_REF` = `de5ebb8` (2026-11-04), and `git merge-base --is-ancestor de5ebb8 f8a4df7` → true, so the pin predates both fixes. - `.sandcastle/heal.sh:311` in the running copy is still the boolean `job_ran_here`; `grep -c uuid` over it is 0 — no `job_locality` tri-state. So every cross-host heal bundle on this repo keeps shipping the inverted locality claim as its first three artefacts until a human re-vendors (`bash onboarding/onboard.sh vendor .sandcastle <sha>`, GOTCHAS 4). Worth noting in whatever carries the next pin bump; the diagnosis agent reading those files first is precisely who the wrong line misleads. (No repair attempted — re-vendoring the self-copy is a human pin bump, and the healer charter does not cover it.)
All checks were successful
ci / static (pull_request) Successful in 3m13s
ci / test (pull_request) Successful in 8m31s
This pull request has changes conflicting with the target branch.
  • heal.sh
  • tests/heal-test.sh
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/336-job-locality-runner-uuid:fix/336-job-locality-runner-uuid
git switch fix/336-job-locality-runner-uuid

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff fix/336-job-locality-runner-uuid
git switch fix/336-job-locality-runner-uuid
git rebase main
git switch main
git merge --ff-only fix/336-job-locality-runner-uuid
git switch fix/336-job-locality-runner-uuid
git rebase main
git switch main
git merge --no-ff fix/336-job-locality-runner-uuid
git switch main
git merge --squash fix/336-job-locality-runner-uuid
git switch main
git merge --ff-only fix/336-job-locality-runner-uuid
git switch main
git merge fix/336-job-locality-runner-uuid
git push origin main
Sign in to join this conversation.
No reviewers
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!337
No description provided.