Repository navigation
Clone-divergence sweep over the hand-copied type families #140
Description
Why
Bugs at one API site recur at its hand-copied siblings, and the history here agrees: each NodaTime set file has been touched by five or six fix commits, wrapper arities repeatedly lag their primitive set, and the 9.1.0 whitespace fix landed as two commits — one for range bounds, one for set elements — because the second site was found only after the first was fixed. The claim-driven oracles hold a documented promise per type; none of them can notice that one sibling lacks a line the other nine have.
A normalized diff across a family is a cheap candidate generator for exactly that class of defect.
What
A clone-divergence sweep over the hand-copied type families in src/:
- the primitive value sets and their wrapper arities under
src/CodoMetis.ValueRanges/Sets/ - the five NodaTime sets and arities under
src/CodoMetis.ValueRanges.NodaTime/Sets/ - the per-type range unions (
Int32Range.cs…DateTimeOffsetRange.cs, and the NodaTime ranges) - the EF-side per-type definitions (
new RangeTypeDefinition<…>(…)/new SetTypeDefinition<…>(…)registrations and the wrapper-family bridge entries) - each primitive set paired with its own arity
For each family, every member is normalized (the type's own name, its stem inside identifiers, its element type, its store type and format constants become placeholders; doc comments and formatting are stripped) and compared with the family's consensus member by member: a member present in all but one or two siblings, a member only one sibling has, and a body that no sibling shares while a near-identical body is shared by several are each a divergence.
Shipped as:
dotnet run tools/oracles.cs clones— prints every divergence with its waiver statusCloneDivergenceTestsin the conventions project — fails CI on any divergence not listed intest/oracles/clone-waivers.jsonwith a reason, and on a stale waiver; holds without running the shipping code- a registration in
oracles.jsonand a seed patch that removes one sibling'sLiteralWhiteSpace.TrimAsInputFunctioncall (the shape of the 9.1.0 whitespace fix), proven caught withdotnet run tools/oracles.cs seeds - a section in
docs/oracles.md
Every real divergence the first run finds gets its own bug issue and a candidates.json entry; nothing beyond the sweep itself is fixed in this change.
Done when
The sweep runs, every current divergence is either waived with a reason or filed as a bug, the seed is proven, the doc describes the sweep, and the PR closes this issue.
Activity
CaffeinatedCoder commentedon Oct 18, 2026
First run, measured on main (3ecfa10): 61 divergences in 10 families (core sets 9, core arities 7, NodaTime sets 6, NodaTime arities 4, core ranges 8, NodaTime ranges 21, EF range definitions 0, EF set definitions 0, EF wrapper bridges 6, primitive vs arity 0). Every one is a deliberate per-type difference and is waived with its reason in
test/oracles/clone-waivers.json; no sibling lags a fix today, so no bug issue and nocandidates.jsonentry came out of this run. One latent sibling-site risk is recorded on #129 (theGuidSet<>EF bridge parses withGuid.Parsedirectly). Two seeds prove the sweep: the newsibling-drops-input-function-trim.patchand the existingvariant-without-type-converter.patch, both CAUGHT.