fix(search): exclude retracted claims and archived pages - #584
Conversation
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Walkthrough
ChangesSearch lifecycle filtering
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
|
ready for review — regression in |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
tests/test_context.py (1)
175-207: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winexercise
SUPERSEDEDandREDACTEDtoo.This test only transitions a claim to archived. Parameterize or add cases for the other retracted statuses so a regression affecting only those statuses cannot pass while violating the stated lifecycle contract.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_context.py` around lines 175 - 207, The test_search_kb_excludes_retracted_claims coverage only verifies ARCHIVED claims. Extend it to exercise SUPERSEDED and REDACTED claim transitions as well, using parameterized cases or separate cases while preserving the existing assertions that live claims/pages remain searchable and retracted claims do not.src/vouch/context.py (1)
522-523: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valuekeep code comments lowercase.
Start the added comment with lowercase prose.
As per path instructions, “use lowercase prose in comments and review notes.”
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/vouch/context.py` around lines 522 - 523, Update the added comment near the status-filtering search logic so its prose starts with lowercase text, while preserving the existing wording and behavior.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/vouch/context.py`:
- Around line 522-525: Update the retrieval flow around filter_hits and
_filter_live_hits so candidate collection continues beyond the backend’s
fetch_limit before lifecycle filtering, allowing retracted or archived hits to
be replaced by later live candidates. Reuse the shared
storage/proposals/lifecycle path rather than duplicating filtering logic, and
preserve the requested limit in the final live results.
---
Nitpick comments:
In `@src/vouch/context.py`:
- Around line 522-523: Update the added comment near the status-filtering search
logic so its prose starts with lowercase text, while preserving the existing
wording and behavior.
In `@tests/test_context.py`:
- Around line 175-207: The test_search_kb_excludes_retracted_claims coverage
only verifies ARCHIVED claims. Extend it to exercise SUPERSEDED and REDACTED
claim transitions as well, using parameterized cases or separate cases while
preserving the existing assertions that live claims/pages remain searchable and
retracted claims do not.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 3c0e0470-8afe-4a5f-910f-3bcda06062ae
📒 Files selected for processing (3)
CHANGELOG.mdsrc/vouch/context.pytests/test_context.py
address coderabbit on vouchdev#584: backends now pull a candidate pool so retracted top-hits cannot starve the requested limit; tests cover superseded/redacted and the refill case; comments stay lowercase. Co-authored-by: Cursor <cursoragent@cursor.com>
|
addressed coderabbit feedback:
ready for re-review. |
kb.context already drops ARCHIVED/SUPERSEDED/REDACTED claims; kb.search did not, so lifecycle controls leaked on the detail-search surface. backends over-fetch a candidate pool before that filter so retracted top-hits cannot starve the requested result limit. Fixes vouchdev#581
5742d10 to
ee3c528
Compare
|
rewrote commit history to remove the |
what changed
search_kb(the sharedkb.searchpath) now drops retracted claims and archived pages after scope filtering, matchingkb.context.why
#78taught context to honour archive/supersede/redact. search never got the same filter, so agents callingkb.searchafter recall could still retrieve retracted knowledge.validation
Fixes #581
Summary by CodeRabbit