Repository navigation
test(search): prove rank-first plan ordering - #1567
Conversation
Problem: #873 requires search default ordering to stay rank-first unless the user explicitly chooses date or another sort. The implementation already had this branch, but tests did not directly prove that date ordering cannot silently replace provider rank.\n\nWhat changed: added plan-execution tests showing unsorted search plans preserve candidate rank order even when dates would sort differently, while explicit sort=date still overrides rank order.\n\nVerification: pytest -q tests/unit/archive/test_query_search_runtime.py --tb=short; ruff check tests/unit/archive/test_query_search_runtime.py; mypy tests/unit/archive/test_query_search_runtime.py; devtools verify --json (9 selected tests passed).\n\nRef #873
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 36 minutes and 34 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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 |
Summary
This adds focused #873 acceptance evidence for rank-first search ordering.
Problem
#873 requires search default ordering to stay rank-first unless the user explicitly chooses date or another sort. The implementation already had a branch for
query_terms + sort=None, but no direct test proved that date ordering cannot silently replace provider rank order.Solution
Added plan-execution tests that feed candidates in ranked order while their timestamps would sort the opposite way. The unsorted search plan preserves candidate rank order; an explicit
sort=dateplan still overrides that rank order.Verification
pytest -q tests/unit/archive/test_query_search_runtime.py --tb=short— 9 passed.ruff check tests/unit/archive/test_query_search_runtime.py— passed.mypy tests/unit/archive/test_query_search_runtime.py— passed.devtools verify --json— exit 0; 9 pytest-testmon selected tests passed; total 40.39s.devtools verify --quick— exit 0; total 34.88s.Ref #873