---
name: population-census-must-be-cfg-test-aware
description: "A grep-derived call-site population silently mixes prod and cfg(test) sites; classify by module boundary, and re-derive a population you carried forward rather than trusting it."
metadata: 
  node_type: memory
  type: feedback
  originSessionId: 490c6ce9-e590-4598-96f1-1c7f55671b1a
  modified: 2026-08-19T05:52:21.616Z
---

A `git grep` of call sites is NOT a population — it cannot see `#[cfg(test)]`. Working
releases#57 (access-store RMW husk), the filed issue, the JIT plan AND my own carried-forward
wake note all listed `cli.rs:24084` as a production mutation site. It is inside `mod tests`
(cli.rs's test module runs 22522..35192). Six of the eight sites I had been handed were right,
one was a test, and the true population had a site none of the three lists named.

**Why:** a grep result reads as an enumeration, so it inherits the authority of one. The
cfg(test) boundary is invisible in `file:line` output, and a huge file (cli.rs, 35k lines) puts
its test module so far from the top that "is this line in tests?" is not answerable by eye. The
carried-forward list compounds it: a population someone already re-located feels *more* verified
than a fresh grep, not less — but it was derived by the same blind method.

**How to apply:** for any "convert every site that does X" task, compute the cfg(test) regions
first (scan for `#[cfg(test)]`, find its `mod` line, close at the matching column-0 `}`), then
classify each hit PROD or TEST and print the classification. State the count and its definition
in the report and in any doc census you write, so the next reader can re-derive it instead of
trusting it. Say out loud which sites the filed list got wrong — that is the part a gater cannot
check without redoing the census.

Kin: [[truncated-grep-read-as-the-population]] (a `| head` sets scope silently — same failure,
different cause), [[string-census-pattern-encodes-an-assumption]] (the pattern itself encodes an
assumption; run a looser sibling probe and read the DELTA),
[[derived-figure-without-its-formula-dies-with-the-context]] (a census with no stated population
cannot be re-derived — why the corrected `atomic.rs` figure ships with its definition), and
[[resumed-session-reground-before-acting]] (state decays; this is the sharper case where the
carried-forward state was wrong when it was WRITTEN, not merely stale).
