Skip to content

Expose FindDuplicate over gRPC for the person-dedup suggestion (core#1734) - #1969

Merged
mstomar125 merged 1 commit into
mainfrom
issue-1734-find-duplicate-rpc
Aug 4, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-1734-find-duplicate-rpc

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Advances #1734 (does not close it — the suggestion UI + remaining ACs follow).

Slice 1 (#1850) added the store-aware unique rule + 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

  • proto: rpc FindDuplicate(FindDuplicateRequest{node_type,field,value}) returns (NodeResponse).
  • daemon: handler wrapping find_duplicate_for — returns the existing node on a uniqueness-flagged match, or an empty NodeResponse (empty node_id, no node_data) when there's no duplicate. Never NotFound, 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

  • New 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.
  • clippy clean; full pre-push gate (test:all + cargo build + test:e2e, incl. frontend proto regen) passed on push.

🤖 Generated with Claude Code

…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant