---
name: a-filename-substring-grep-mints-a-repo-cite
description: A citation census that greps a tracked corpus for a scratch filename as a raw substring reports false cites (test.raw, treqs.exit, build.raw) that a relocation lane would then act on; word-bound the name and read the hit's path context.
metadata:
  type: feedback
---

2026-09-09 (doyle, root-scratch census, 561 untracked root files): a python substring scan of every
tracked blob for every untracked basename returned 21 "cited" files. Three were FALSE: `test.raw`
matched inside longer tokens of the `nextest.raw` class, `treqs.exit` matched every `<lane>_treqs.exit`
mention, and `build.raw` matched a `"$OUT/build.raw"` path in .github/bench/twohost-web-local.sh -- a
file under an output dir, not the root file. A relocation lane built on the raw list would have moved
three gate legs into docs/ as "repo-cited".

**Why:** a filename is a substring of every longer filename that ends the same way, and a
basename-only match cannot tell root from any other directory. The #212 lane's rule ("anything the repo
names moves OUT before the ignore line goes in") makes the cite census load-bearing, so a false cite
is a false relocation and a MISSED cite is the launch-battery loss.

**How to apply:** substring scan first for recall (cheap, catches everything), then for every hit run
a word-bounded `git grep -n -F <name>` and read the line: the token must be bounded by non-name
characters on both sides AND the surrounding path must resolve to the file being classified (root vs
`$OUT/`, `.spt/preserved/`). Cites from the memory dir are not repo cites. ⚠ CORRECTED the same day (hertz caught it, 16:14Z): a cite
from a file AT ROOT is not thereby a scratch cite -- W3-196-JIT.md and W3-272-MEASUREMENTS.md are TRACKED
root files (140 tracked at root, 134 .md; the house convention is plans/JITs tracked at root), and my own
corpus had been tracked-only, so the hit was a repo cite by construction and I relabelled it on its PATH.
The discriminator is `git ls-files --error-unmatch <citing file>`, never the directory. Burying the cited
file would have left two tracked files pointing at vanished paths: the launch-battery loss, sides swapped.
Consequence: the relocation itself was withdrawn -- 18 cited files `git add`ed in place (option b), because
a lane that tidies AGAINST a measured convention splits it down the middle.
Related: [[check-ignore-on-a-bare-directory-is-not-a-probe]], [[a-selector-that-can-match-twice-must-assert-cardinality]].
