test(hygiene): a code term is found beside an underscore or a letter

A term bounded by `\b` cannot see a code written as `X_...` or
`test_x...s`, because `_` is a word character. The local list's code and
word terms now count only letters and digits as a neighbour. Red with the
tightened list: 3 tracked files. The three lines are rewritten: green, 0.

The tracked side gains a synthetic known-positive for that shape and a
known-negative list of ordinary words and codes that stand next to a term's
shape, so a list grown too wide fails in the test and not on a later file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-23 14:25:53 +02:00
commit 5359394a4f
4 changed files with 50 additions and 6 deletions

View file

@ -112,7 +112,7 @@ use a delta, so the corpus had nothing to say about it.
`assert sum(tbx.values()) == 568` sat behind a `skipif` on a delivery only this
machine has, so on a fresh clone the sentence five files publish was unguarded
again — the state in which 574 survived in four docstrings until PM counted it.
`N101_TBX_TAGS` is now the one place the number lives, and a second test reads
One named constant is now the one place the number lives, and a second test reads
the published sentence out of `CHANGELOG.md`, `CLAUDE.md`, `tools/okf_witness.py`,
`tests/test_accounting_gate.py` and this round's predecessor report, holding all
five to it. It needs no corpus and no clock.

View file

@ -216,7 +216,7 @@ both gates. The only `refused whole` left is the second real corpus, and that is
- **Red first is per commit and per hole, not per assertion.** H2's red is the
mutant surviving, not a failing test: the check it protects already worked,
and a test for working code cannot be red.
- **`test_r761s_own_seventy_one_soft_hyphens...` skips** where the corpus is
- **The test reading the delivery's own seventy-one soft hyphens skips** where the corpus is
absent. The committed twin fixture is what holds the rule elsewhere.
- **The witness is still a second implementation of the same definitions.**
A definition wrong for a format is wrong on both sides at once, and the gate