One implementation per subsystem needs to see the duplicates. Aroma's cluster-and-intersect step (arXiv 1812.01158, §3.3.3) groups near-duplicate code and intersects each group into the one shape they share; §2 measured that 35.3% of changesets had a close match (score ≥ 0.71, from 50 labeled pairs).
Change.
An offline report over src/ and test/: clusters of 3+ near-duplicate functions with their shared shape. Tune the threshold on the forge's own labeled pairs, not the paper's.
Use it first on tests: the fixed-sleep tests (#14321) likely share a few shapes; turn the biggest into one wait-for-a-signal helper.
Then a warn-only gate line for a new function above the threshold, naming the existing one. Blocking only after its false-positive rate is measured.
Before building, run fallow dupes and fallow dead-code (fallow.tools, MIT, Rust, young) once, read-only and off the checks path, to see what it finds that the gate misses; port any rule worth keeping into the gate rather than adding the tool (the gate stays the one enforcer).
Done when: the report runs, its top clusters are listed here with the forge's measured duplication rate, and at least one cluster is folded into one implementation.
One implementation per subsystem needs to see the duplicates. Aroma's cluster-and-intersect step (arXiv 1812.01158, §3.3.3) groups near-duplicate code and intersects each group into the one shape they share; §2 measured that 35.3% of changesets had a close match (score ≥ 0.71, from 50 labeled pairs).
Change.
src/andtest/: clusters of 3+ near-duplicate functions with their shared shape. Tune the threshold on the forge's own labeled pairs, not the paper's.fallow dupesandfallow dead-code(fallow.tools, MIT, Rust, young) once, read-only and off the checks path, to see what it finds that the gate misses; port any rule worth keeping into the gate rather than adding the tool (the gate stays the one enforcer).Done when: the report runs, its top clusters are listed here with the forge's measured duplication rate, and at least one cluster is folded into one implementation.
🤖 Generated with Claude Code