Skip to content

Tighten auto-merge with MinHash/Jaro-Winkler blocking to shrink the review queue #1560

Closed

Description

@JoeCotellese

Follow-on to #150 (server-side capture-then-reconcile).

Problem

The review queue's merge_candidates surface holds every entity pair in the ambiguous similarity band that resolve_entity won't auto-decide (~0.55–0.85 trgm). Many of those are genuinely easy "same thing" cases that only land in the queue because our blocking/verification is coarse (trigram + dmetaphone). Each one is human toil that a stronger matcher could have safely auto-merged.

Graphify's dedup.py clears these without a human via a richer pipeline: exact-norm → entropy gate → MinHash/LSH blocking → Jaro-Winkler verification → same-community boost → union-find. We can borrow the blocking + verification stages to raise our safe auto-merge threshold and shrink what reaches the queue.

Why this is safe for us when full auto-merge isn't

Our merges are soft (merged_into, reversible via unmerge_entity) and audited (correction_events). So a tightened auto-merge that's wrong is recoverable, unlike a destructive fuse. The irreducible core of the queue — two genuinely-different real people sharing a name, contradictions, low-confidence claims — stays human-gated. This only moves the easy cases out.

Proposed change

  • Add MinHash/LSH blocking + Jaro-Winkler verification (+ optional same-community / co-mention boost) as a second-stage matcher above resolve_entity's current trgm/dmetaphone.
  • Auto-merge (soft) only above a conservative combined-score threshold; everything below still queues.
  • Tune so the dangerous direction — false merges — stays at zero on the fixture.

How we'll know it's better or worse (acceptance)

  • Safety (must not regress — the costly direction): fixture of labeled pairs including trap cases — two distinct "Karen"s = different; "Joe"/"Joe Cotellese" = same; near-collisions across kinds. Assert zero false auto-merges. A false merge is a ship-blocker, not a tuning note.
  • The win (measurable): count merge_candidates landing in review_queue before/after on the live brain. Success = fewer queued candidates with no drop in correctness on the fixture. Report the delta in the PR.
  • Recoverability guardrail: every auto-merge remains soft + logged to correction_events; unmerge_entity reverses it. Integration test proves an auto-merge is reversible.

Notes

  • Pairs with #150; share the reconciliation seam rather than adding a parallel path.
  • graphify/dedup.py and graphify/_minhash.py are a usable reference (MIT-ish — confirm license before lifting code; reimplement against our brain.* seam regardless).
  • House rule: Postgres-touching change → integration test.

Activity

  1. JoeCotellese commented on Jun 30, 2026

    @JoeCotellese
    Author

    Apologies — this was created by mistake (wrong repo target from an automated tool). Closing right away. Not intended for this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions