---
name: pre-seed-the-exit-file-with-a-void-sentinel-before-the-leg-starts
description: hertz 2026-09-08 — a tree-kill (TerminateProcess) never reaches `echo $? > leg.exit` and runs no trap, so the absence it leaves reads as a clean pass; write `VOID:unfinished` to the exit file BEFORE the leg, let the real integer overwrite it, and have the watcher refuse anything but a bare integer; 15/15 positive controls
metadata:
  type: feedback
---

hertz's rebuilt lint driver (2026-09-08 15:47Z), after a killed clippy chain's watcher reported "[exited with code 0]" over an empty diagnostics section. Four defects in the old form, each a guard that could not fire: (1) `echo $? > clippy.exit` sat AFTER cargo — a force-kill is TerminateProcess, reaches no later line and runs no trap, so the exit file is simply absent; (2) the holders line was LABELLED "(exe-in-pool, REFUSES)" and refused nothing — computed into census.txt and fell through; (3) `dirty: $(git status --porcelain | grep -c '^ M')` counts unstaged modifications only — `dirty: 0` printed over a worktree with seven untracked entries; (4) verdict counts from `grep -c '^warning'` — under `-D warnings` a lint prints `error`, so the warning count is structurally zero on every real failure.

**Why:** an absence manufactured by a kill renders identically to a clean result, and a trap cannot fix it because the kill runs no trap. Inverting the order makes the sentinel the default state of the world: from the instant the leg starts the file EXISTS holding `VOID:unfinished`, and only a leg that actually returns overwrites it with an integer.

**How to apply (the standing driver form):** pre-seed `<leg>.exit` with `VOID:unfinished` before the command; the watcher/reader names a verdict ONLY for a bare integer (absent -> VOID rc 3, sentinel -> VOID rc 3, 0 -> GREEN, 101 -> RED); holders-in-pool EXITS (5, writes `VOID:holders-in-pool`), a stale outdir exits 4; tree state as four fields (staged/unstaged/untracked/ignored-relevant), never one grep; counts are labelled `orientation_*` and the verdict comes only from the exit code; make the leg command an env seam so every guard gets a POSITIVE CONTROL fired on purpose without a compile (hertz: A1-A7, 15/15, A5 = driver killed mid-run leaves the sentinel on disk). Related: [[a-needle-in-source-form-cannot-match-a-raw-with-escaped-quotes]], [[a-stopped-local-ssh-does-not-stop-its-remote-command]].
