Problem
TypeScriptNormalizer.isName (src/TypeScriptNormalizer.ts L37) plus keepsStructuralChild (L33) strip all identifiers, so two unrelated DTOs/value objects with the same shape but different field/type names match. This is the correct default — it's what lets the tool catch copy-paste-then-rename duplicates — but it's a frequent false-positive source for distinct domain types that merely share a shape (e.g. { id: OrderId; total: Money } vs { id: SkuId; total: Count }).
Proposed change
Add an optional, off-by-default normalization mode that retains type-position identifiers as structural markers:
- In
TypeScriptNormalizer, when the mode is on, keep TypeReference typeName identifiers (and optionally property names) instead of dropping them in keepsStructuralChild/isName, emitting them as markers via the existing markers() mechanism so they participate in the fingerprint.
- Thread a
typeAwareNormalization flag through Options → FileScanner → TypeScriptNormalizer (the normalizer is constructed in FileScanner).
- CLI:
--type-aware (or similar) in Options.parse.
This makes {a: Foo; b: Bar} and {a: Baz; b: Qux} diverge while leaving the name-blind default intact.
Acceptance
- With the flag on, two same-shaped/different-typed interfaces drop below threshold.
- With it off, behavior is byte-for-byte unchanged (fingerprints identical to today).
Related
Pairs with the kind-diversity floor; both target structurally-identical-but-semantically-distinct type declarations.
Problem
TypeScriptNormalizer.isName(src/TypeScriptNormalizer.tsL37) pluskeepsStructuralChild(L33) strip all identifiers, so two unrelated DTOs/value objects with the same shape but different field/type names match. This is the correct default — it's what lets the tool catch copy-paste-then-rename duplicates — but it's a frequent false-positive source for distinct domain types that merely share a shape (e.g.{ id: OrderId; total: Money }vs{ id: SkuId; total: Count }).Proposed change
Add an optional, off-by-default normalization mode that retains type-position identifiers as structural markers:
TypeScriptNormalizer, when the mode is on, keepTypeReferencetypeNameidentifiers (and optionally property names) instead of dropping them inkeepsStructuralChild/isName, emitting them as markers via the existingmarkers()mechanism so they participate in the fingerprint.typeAwareNormalizationflag throughOptions→FileScanner→TypeScriptNormalizer(the normalizer is constructed inFileScanner).--type-aware(or similar) inOptions.parse.This makes
{a: Foo; b: Bar}and{a: Baz; b: Qux}diverge while leaving the name-blind default intact.Acceptance
Related
Pairs with the kind-diversity floor; both target structurally-identical-but-semantically-distinct type declarations.