---
name: a-needle-in-source-form-cannot-match-a-raw-with-escaped-quotes
description: "2026-09-08 x3 in ninety minutes — hertz's grep -c 'type=\"msg\" type=\"msg\"' read 0 on a raw carrying ESCAPED quotes (type=\\\"msg\\\"); my and deployah's `FAIL [` grep dropped a `FAIL + LEAK [` row (3 vs Summary 4); a zero-match nextest filter prints \"0 tests run: 0 passed\" — a filter that cannot match reads as a clean result"
metadata: 
  node_type: memory
  type: feedback
  originSessionId: b8201d4f-8b73-4b24-b257-ffeee9448400
  modified: 2026-09-08T15:22:17.243Z
---

Three count-vs-text splits in one afternoon (2026-09-08, #272 golden r1), one shape. hertz: `grep -c 'type="msg" type="msg"'` on a nextest raw returned ZERO because a panic's Debug-formatted string carries the quotes escaped (`type=\"msg\"`); he had printed the text beside the count and the text carried the doubled attr verbatim — trusting the count would have withheld a valid BEFORE from todlando. Me AND deployah independently: `FAIL [` grep counted three failed cells against a Summary saying four, because the fourth printed as `FAIL + LEAK [`. hertz again: a `test(<binary-name>)` filter matched nothing, exit 4, Summary "0 tests run: 0 passed", which a FAIL-grep reads as clean.

**Why:** a needle is written in one rendering (source form, one label form, a fn name guessed from a file name) and the raw carries another (Debug-escaped, a compound label, nothing at all); the count then measures the needle, not the raw, and zero reads as absence. A filter that cannot match reads as a clean result.

**How to apply:** read the Summary line's own counts FIRST (`N tests run`, `N failed`) and reconcile every per-cell grep against them; a run count of 0 is VOID, never a pass; print the matching TEXT beside any count you act on; write needles against a line you have already seen in the raw, never from the source that produced it; for nextest verdicts match `(FAIL|TIMEOUT|ABORT|SIGSEGV)( \+ \w+)? \[`. hertz's common remedy, adopted: every guard fires a positive control on purpose once, and every absence needs a stated way to appear before it counts. Related: [[a-column-that-reads-one-value-on-every-row-is-a-broken-extractor]], [[a-path-predicate-builder-census-is-intermittently-blind]].

**hertz's two additions (measured 15:24Z on one raw):** (a) the escape form VARIES BY CALL SITE — a `{:?}` panic prints `type=\"msg\"`, a `{}` panic prints `type="msg"` bare — so no fixed needle carrying quotes is safe; match the token twice on one line or read the failure text. (b) a nextest raw prints each failure TWICE (inline and in the closing block), so `grep -c 'FAIL \['` counts APPEARANCES: my narrow needle UNDER-counted, a naive one OVER-counts. The Summary line `N tests run: P passed, F failed` is the ONLY count authority; FAIL lines are for names.

**Seventh face, the worst-shaped (hertz 2026-09-08 15:42Z):** a background WATCHER on a clippy chain that had been tree-killed at ~15:29Z completed minutes later and reported head / dirty 0 / holders [] / toolchain / "=== first diagnostics, if any ===" (empty) / "[exited with code 0]" — the exact artifact a "clippy green on a quiet box" gate looks for, and worthless: the exit 0 was the WATCHER's, the diagnostics section was empty because the chain died inside `Checking` (clippy.raw 11,081 B ending mid-dependency, clippy.exit ABSENT). An absence manufactured by a kill renders identically to a clean lint. Remedy: the driver writes the leg's exit file UNCONDITIONALLY (a killed leg writes VOID), and the watcher REFUSES to report unless that file exists; a report with no exit code for the thing it watched is not a report.
