fix(stats): stop misreporting broken citations for unreadable source meta#469
fix(stats): stop misreporting broken citations for unreadable source meta#469RealDiligent wants to merge 2 commits into
Conversation
|
Warning Review limit reached
Next review available in: 57 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 (2)
✨ 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 |
|
CI note: the py3.13 failure was an unrelated flaky timing test (\ est_websocket_broadcasts_on_approve\ — broadcast took 1.17s vs 1.0s budget on a loaded runner). py3.11 and py3.12 passed; retriggered CI with an empty commit. |
citation_summary called list_sources(), which skips unreadable meta via _load_or_skip. Claims citing those sources were misreported as broken_citation in kb.stats / vouch stats — lint already treats the source as present (unreadable_source finding instead). Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Root cause:
citation_summary()(used byvouch stats/kb.stats) builtsources_presentfromstore.list_sources(), which skips unreadablemeta.yamlfiles via_load_or_skip. When a source directory exists but its meta is corrupt (hand edit, mojibake), claims citing that source were counted asbroken_citationeven though the source is on disk.health.lint()already fixed this asymmetry via_collect_sources_for_lint()— the source id is its directory name, so citations stay honest and lint reportsunreadable_sourceinstead ofbroken_citation.Fix: Use
_collect_sources_for_lint()for the presence set incitation_summary().Impact:
kb.statscitation coverage metrics no longer lie when a source meta is unreadable; operators aren't sent to delete citations for sources that still exist.Risk / tradeoffs
broken_citationmay drop for KBs that previously looked worse than lint said — that was the bug.vouch lintremains the repair surface for unreadable metas.Test plan
test_citation_summary_honest_when_source_meta_unreadable(new)tests/test_stats.pypass