`duplicate_bodies` extracted a source segment for EVERY function in the module
population, including one-liners that can never reach the ten-line literal-copy
floor. `ast.get_source_segment` re-splits the whole file per call, so the scan
paid O(source) for each short function.
The span a node already carries (`end_lineno - lineno + 1`) decides whether the
slice is worth taking. This is output-identical by construction, not merely by
test: `_normalize_body` dedents, rstrips and DROPS blank lines, so a normalized
body can never have more lines than its raw span, and a node whose span is below
the floor could never have satisfied the existing normalized-line check. The
recursion into nested functions stays unconditional, so a long inner function
inside a short outer one is still scanned.
Oracle, over the full module population with every module given its own domain
so every digest group surfaces as a row: byte-identical output (3 rows, same
sha256) before and after, 31.1s -> 21.4s. `scripts/check_domains.py` exits 0
with "OK: domain manifest complete", and the `[duplicates] allowed = []`
baseline is untouched in both directions.
The new boundary test pins the floor exactly: a cross-domain copy of exactly
DUPLICATE_MIN_LINES lines is still detected, one line shorter is not. Verified
load-bearing - changing the filter to `span > min_lines` reddens it.
Promote the F0 report-only scripts/v7next_domains.toml to the production
manifest ouroboros/domains.toml (ships as package data): 1:1 module->domain
for all 488 tracked runtime modules across D01-D20, plus generated baseline
sections pinning today's factual dependency data - 164 strict cross-domain
directions, the single 20-domain strict-quotient SCC as the cycle ceiling
(target []), 92 lazy-only hidden-coupling pairs, zero dynamic pairs, and an
EMPTY cross-domain literal-copy baseline.
scripts/domain_graph.py is the shared import-graph core (extracted from the
report generator so gate and report cannot drift); scripts/check_domains.py
is the gate + --write regenerator (also renders docs/DOMAIN_MAP.md from the
manifest alone - the gen half of the gen/verify pair);
tests/test_domain_manifest.py is the verify half: population completeness
(a tracked module without a row = red), baseline exactness for directions/
cycles/classification/duplicates, DOMAIN_MAP byte-identity, and synthetic
red-branch coverage for every detector. scripts/v7next_domain_report.py now
consumes the shared core and stays report-only.