feat: duplication family — find_duplicates + drift_clones + find_similar #27
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
h-dv/code-index#27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rank 6 of the 2026-07-20 index-data brainstorm (
_prdoc/records/brainstorm-2026-07-20-index-data-catalog.md).What: one fingerprint mechanism (ordered ref-sequence per symbol) powering three products: exact clone clusters (consolidation worklist), drift_clones (near-clones that have diverged — "copy 2 already differs, here's the behavioral delta"), and a pre-write
find_similarpoint query ("does this helper already exist?") that prevents future duplication.Why — it found a real bug:
relative_pathhad drifted between index.rs and watcher.rs (Jaccard 0.82) — the watcher copy lackedParentDirand single-file-root handling; fixed in v0.5.19 by consolidation. Scale: 58 clone clusters / 193 duplicate symbols / ~1,402 redundant lines (theparse()test helper copied 10x;workspace_rootcopied 6x despitetests/common/mod.rsexisting).setup_loggingdrift (J=0.93) triaged as intentional (--log-json). The existingoutline_hashcolumn finds the m0016–m0019 migration template family for free.Cost: small for exact clusters + find_similar (pure SQL); medium for drift pairs (Jaccard, name-blocked); no new data.
Triage: P2 — split by agent value
Implement in this order:
find_similar(symbol|span)point query — prevents agents from creating another implementation.The first capability should be consumable by
context_pack(#35), not required for its v1. Repository-wide clone inventories are secondary to the pre-write question “does this already exist?”. Every similarity result needs the compared evidence/features; avoid an unexplained scalar score.