Repository navigation
Expose FindDuplicate over gRPC for the person-dedup suggestion (core#1734) - #1969
Merged
Merged
Conversation
…1734) The store-aware `unique` rule (#1850) added NodeService::find_duplicate_for, but nothing could call it — it had no gRPC surface, so a client can't surface the "a person with this email already exists — adopt existing?" suggestion. Add a FindDuplicate RPC that wraps find_duplicate_for: it returns the existing node on a uniqueness-flagged match, or an EMPTY NodeResponse (empty node_id, no node_data) when there is no duplicate — never NotFound, never an error, matching the suggest-don't-block contract (ADR-065). "No duplicate" is an ordinary answer. The desktop suggestion UI (person-schema-form) is the consumer and lands separately; this is the backend enabler. Co-Authored-By: Claude Opus 4.8 <[email protected]>
7 tasks
11 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Advances #1734 (does not close it — the suggestion UI + remaining ACs follow).
Slice 1 (#1850) added the store-aware
uniquerule +NodeService::find_duplicate_for, but the primitive had no caller — no gRPC surface — so a client can't surface the "a person with this email already exists — adopt existing?" suggestion. This adds the backend enabler.Change
rpc FindDuplicate(FindDuplicateRequest{node_type,field,value}) returns (NodeResponse).find_duplicate_for— returns the existing node on a uniqueness-flagged match, or an emptyNodeResponse(emptynode_id, nonode_data) when there's no duplicate. NeverNotFound, never an error: "no duplicate" is an ordinary answer, matching the suggest-don't-block contract (ADR-065).Scope / coherence
This is the backend half only; the desktop suggestion UI (
person-schema-form.svelte) is the consumer and lands separately (frontend lane). A backend enabler ahead of its UI is normal layering — the RPC shape is stable (wraps an already-merged, tested primitive), so there's no contract-churn risk.Tests
find_duplicate_rpc_returns_match_or_empty— asserts the case-folded match surfaces the existing person AND the no-duplicate case returns an empty (not-error, not-NotFound) response.clippyclean; full pre-push gate (test:all + cargo build + test:e2e, incl. frontend proto regen) passed on push.🤖 Generated with Claude Code