Repository navigation
Description
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_candidateslanding inreview_queuebefore/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_entityreverses 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.pyandgraphify/_minhash.pyare a usable reference (MIT-ish — confirm license before lifting code; reimplement against ourbrain.*seam regardless).- House rule: Postgres-touching change → integration test.
Activity
JoeCotellese commentedon Jun 30, 2026
Apologies — this was created by mistake (wrong repo target from an automated tool). Closing right away. Not intended for this project.