Measured
A walk over every .t27 in specs/, comparing function bodies after comments and whitespace are normalised away (2026-09-20, master):
|
|
| function bodies with real content |
4021 |
| bodies that are byte-identical copies |
576 (14.4%) |
| groups |
165 |
The largest: magadd written 30 times, magsub 30, sadd 29, magmul 21, smul 19, tmul 13.
They were not refactored into one place — they were written again. An agent implementing specs/ternary/gft_train2.t27 has no way to ask whether sadd already exists, so it writes one. Every later fix to that function has to be made 29 times, and the corpus grows faster than the thing it describes.
Not every copy is a defect
specs/numeric/gf4.t27 through gf64.t27 are parallel formats and their validate_format reads the same by design. A gate that demanded zero would be argued with and then switched off. So this is a ledger, like tools/assertionless_spec_tests_baseline.txt: what exists today is recorded, and the gate fails when a NEW group appears or a known one GROWS. It moves down only.
What a bee needs before it writes
Two questions, answered with a file and a line:
$ python3 tools/dupe_scan.py --name magadd
magadd already exists in 30 place(s):
specs/ternary/gft_axpy.t27:11
...
$ python3 tools/dupe_scan.py --like specs/ternary/gft_sadd.t27
specs/ternary/gft_sadd.t27:11 magadd is already written in 29 place(s):
specs/ternary/gft_axpy.t27:11 magadd
Done when
-
python3 tools/dupe_scan.py --self-test prints a line beginning ok — the checker is exercised against a comment-only difference (which IS a duplicate) and a one-liner (which is not)
-
python3 tools/dupe_scan.py --bless && python3 tools/dupe_scan.py exits 0 — blessing and checking agree
-
- adding a copy of an existing body makes
python3 tools/dupe_scan.py exit 1 and name the group that grew
-
ls .github/workflows/dupe-ratchet.yml prints the path — it runs on pull requests and on pushes to master
-
python3 scripts/ci/check_pr_branch_filters.py exits 0 — the new workflow is classified
Boundary
tools/dupe_scan.py
Measured
A walk over every
.t27inspecs/, comparing function bodies after comments and whitespace are normalised away (2026-09-20, master):The largest:
magaddwritten 30 times,magsub30,sadd29,magmul21,smul19,tmul13.They were not refactored into one place — they were written again. An agent implementing
specs/ternary/gft_train2.t27has no way to ask whethersaddalready exists, so it writes one. Every later fix to that function has to be made 29 times, and the corpus grows faster than the thing it describes.Not every copy is a defect
specs/numeric/gf4.t27throughgf64.t27are parallel formats and theirvalidate_formatreads the same by design. A gate that demanded zero would be argued with and then switched off. So this is a ledger, liketools/assertionless_spec_tests_baseline.txt: what exists today is recorded, and the gate fails when a NEW group appears or a known one GROWS. It moves down only.What a bee needs before it writes
Two questions, answered with a file and a line:
Done when
python3 tools/dupe_scan.py --self-testprints a line beginningok— the checker is exercised against a comment-only difference (which IS a duplicate) and a one-liner (which is not)python3 tools/dupe_scan.py --bless && python3 tools/dupe_scan.pyexits 0 — blessing and checking agreepython3 tools/dupe_scan.pyexit 1 and name the group that grewls .github/workflows/dupe-ratchet.ymlprints the path — it runs on pull requests and on pushes to masterpython3 scripts/ci/check_pr_branch_filters.pyexits 0 — the new workflow is classifiedBoundary
tools/dupe_scan.py