test(coverage): re-ratchet domain coverage floors past their 5pp drift trigger - #1964
Conversation
…t trigger (ledger #192) Ledger #192 (maturity X6) asked for higher, CI-enforced coverage floors on the clinical-safety/retrieval/answer surfaces. That was already substantially in place: vitest.config.mts already carries four per-domain threshold groups plus a whole-repo floor, all enforced by the required CI "coverage" job. Re-measured with `npm run test:coverage` (606 files, 6549 tests passed, all current thresholds green — no false failure). Two branch thresholds had drifted past this file's own documented 5pp re-ratchet trigger, so those two were raised (never lowered): evidence/verification branches 81 -> 84 (measured 86.04%, gap 5.04pp) and core RAG/answer branches 72 -> 76 (measured 78.22%, gap 6.22pp). Every other value already sat within the 5pp band and is unchanged. No file in the four domain groups showed a genuine untested critical path (lowest: 76.4% statements, 57.7% branches), so no tests were added — only the floors were re-measured and tightened where real. Marks maturity-backlog-workorders.md X6 DONE with the evidence trail.
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in:40 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. 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 Run ID: 📒 Files selected for processing (3)
Comment |
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QLbw9qpfjv5CeNz6XpmteN
Uh oh!
There was an error while loading. Please reload this page.
Summary
main—vitest.config.mtsalready carries four per-domain coverage-threshold groups (retrieval, evidence/verification, core RAG/answer, clinical-safety/governance) plus a whole-repo floor, all enforced by the required CIcoveragejob (npm run test:coverage, gated in.github/workflows/ci.yml).npm run test:coveragerun (606 files / 6549 tests passed, all current thresholds green — confirmed no false failure from the existing config before touching anything).answer-verification,evidence,evidence-relevance,rag-claim-support,rag-evidence-gates,rag-quote-verification,rag-source-segmentation): branches 81 → 84 (measured 86.04%, gap was 5.04pp)rag,rag-extractive-answer,rag-comparison,rag-answer-support): branches 72 → 76 (measured 78.22%, gap was 6.22pp)rag-quote-verification.ts, 57.7% branches onrag-answer-support.ts— well clear of a "scary" <30% bar), so no tests were added, per the ledger's own stop condition ("expand tests only where gaps are real... do not lower floors to pass").docs/maturity-backlog-workorders.mdX6 asDONEwith the full evidence trail (measured numbers, which floors moved and why, which didn't and why not).Before/after coverage numbers
Whole-repo (unchanged, for reference): Statements 54.85% → 54.86%, Branches 51.91% → 51.92%, Functions 57.00% → 57.00%, Lines 56.26% → 56.26% (negligible run-to-run noise; floor unchanged at 52/49/54/53, gap 2-3pp, within the documented 5pp trigger).
All numbers above were measured with fraction-level precision from the coverage HTML report (
coverage/lcov-report/**), not approximated from LCOV's line-only export, since v8's "Statements" metric is not the same as its "Lines" metric.RAG impact: no retrieval behaviour change — this PR only edits
vitest.config.mtscoverage-threshold numbers (which reference RAG file paths as glob strings for measurement purposes) and a maturity-tracking doc; no file undersrc/lib/rag/**or any other RAG-ranking-protected surface is touched, confirmed againstscripts/pr-policy.mjs'sragRankingPatterns(onlyoperationalRiskPatternsmatchesvitest.config.mts).Verification
npm run test:coverage— before: 606 files / 6549 tests passed, all thresholds green (confirms the existing floors are already honest, no false failure). After: 606 files / 6549 tests passed, all thresholds green (confirms the two raised floors don't cause a false failure either). Whole-repo summary before/after:Statements 54.85%→54.86%, Branches 51.91%→51.92%, Functions 57%→57%, Lines 56.26%→56.26%.npm run verify:pr-local— completed:check:runtime,check:installed-lock-parity,format:changed,sitemap:check,docs:check-index,docs:check-inventory,docs:check-scripts,docs:check-links,check:branch-review-ledger,check:outstanding-issues,check:ledger-write-discipline,lint,typecheck,test(606 files / 6549 tests passed),check:rag:fixtures(36 golden cases, 23 suites passed),check:medication-interactions. One unrelated pre-existing failure:check:medication-lexicon-report— confirmed viagit stashthat this fails identically on unmodifiedorigin/main(docs/medication-interaction-lexicon-review.mdis stale from an unrelated prior change); this PR touches no medication file and does not cause or fix that drift.npm run format— no changes (both files already formatted).verify:pr-local's own scope classifier: no build-affecting change, no RAG-scoped change.Risk and rollout
Notes
npm run check:medication-lexicon-reportreportsdocs/medication-interaction-lexicon-review.mdis stale on currentorigin/main(confirmed viagit stashbefore/after this diff). Not fixed here — out of this PR's scope per the ledger sweep's "do not touch anything outside your own scope" instruction; flagging for a separate follow-up.src/lib/rag/rag-hydration.tssits at 58.71% statements / 42.15% branches and isn't covered by any of the four domain threshold groups — worth a future look, but adding it now would have meant either padding tests to clear an arbitrary bar or setting a floor without real headroom, neither of which this ledger item's stop condition allows.Generated by Claude Code