Feat/propose similarity warnings#148
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@plind-junior Would you please review? |
ac6c367 to
591f901
Compare
ReviewSummary: Implements propose-time similarity warnings for What works
Suggestions
Verdictapprove — Feature is correctly scoped to v1 (claims only), strictly additive, all existing call sites continue to work, and the test suite covers the key paths including the no-embedder fallback. The non-blocking suggestions are quality-of-life items that do not affect correctness. |

What changed
propose_claim/kb.propose_claimnow return optional non-blockingwarningswhen proposed claim text is semantically similar to an approved claim (similar_approved) or another pending claim proposal (similar_pending). Similarity uses the existing embedding index and on-the-fly embedding of pending payloads; it is gated on the embeddings extra andreview.similarity_threshold(default0.95). The CLI prints warnings to stderr after the proposal id; dry-run includes the same checks.propose_claimreturns aProposeClaimResultwith a backward-compatible.idproperty.Why
Multi-agent KBs often accumulate near-duplicate proposals that reviewers only catch manually in
vouch pending. Post-hocvouch dedup/kb.dedup_scanhelp after the fact but do not guide agents or humans at file time. Early warnings reduce duplicate review work without weakening the review gate — proposals still land as pending and nothing auto-merges or rejects.Closes #147
What might break
kb.propose_claimresponses may include a newwarningsarray. Clients that ignore unknown fields are unaffected; clients that strict-validate response shape should allowwarnings.propose_claimreturn type: Python callers now getProposeClaimResultinstead ofProposal, but.idand.proposalpreserve common usage; no behaviour change when embeddings are not installed.Not a breaking change for typical KB directories or review workflows.
VEP
Not required — additive optional field on an existing method; no on-disk format or audit-log shape change.
Tests
make checkpasses locally (lint + mypy + pytest)tests/test_propose_similarity.py)CHANGELOG.mdupdated under## [Unreleased]