feat(rag): ship D4/D5 governance levers behind default-off gates#649
Conversation
Audit 2026-07-13 deferred items D4 + D5, completed as zero-behavior-change plumbing per the #118 lesson (no governance weighting without golden-eval proof) — the levers ship OFF and are activated by the operator only behind a green golden eval once OpenAI quota recovers. - D4: secondStage.unknownCurrentnessPenalty in ranking-config (default 0, clamped non-negative) applied in the second-stage rerank when document_status is 'unknown'. Activation = RAG_RANKING_CONFIG JSON override, the module's designed eval-gated tuning path. - D5: deriveTrust broadening behind NEXT_PUBLIC_RAG_TRUST_CAP_ALL_CLAIMS (unset = false): when on, unverified-authority evidence caps trust to medium for ALL supported claims, not just high-risk ones. NEXT_PUBLIC because answer-render-policy renders client-side. - Tests lock both the zero-change defaults and the flag-on behavior. Verified: verify:cheap green (2,310 tests), eval:rag:offline green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughTrust derivation now supports environment-controlled gating for all claims, while second-stage ranking supports a configurable penalty for unknown document status. Tests cover the new trust flag and ranking configuration behavior. ChangesTrust gating
Ranking currentness
Estimated code review effort: 3 (Moderate) | ~20 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Audit 2026-07-13 deferred items D4 + D5, completed as zero-behavior-change plumbing per the #118 lesson (no governance weighting without golden-eval proof) — the levers ship OFF and are activated by the operator only behind a green golden eval once OpenAI quota recovers.
Verified: verify:cheap green (2,310 tests), eval:rag:offline green.
Summary
Verification
npm run verify:pr-localDuring development, use
npm run verify:cheapas the faster iteration gate before the final PR-local preflight.npm run verify:uiwhen UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changednpm run verify:releasebefore release or handoff confidence claimsFor retrieval, ranking, selection, chunking, source/citation rendering, or answer-contract changes,
verify:pr-localrunseval:rag:offlineautomatically. Run the offline command directly during iteration before spending a live eval.npm run eval:retrieval:quality(must stay 36/36) when retrieval, ranking, selection, chunking, or scoring behavior changed — CI cannot run it (needs live keys), so run it locally and paste the summary. A metadata/governance-weighting change once buried correct docs (recall 1.0→0.76) and only this eval caught it.npm run eval:rag -- --limit 15+npm run eval:quality -- --rag-onlywhen answer generation, the synthesis prompt, or answer post-processing changed (grounded-supported must not drop; citation-failure 0)npm run check:production-readinesswhen clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior changednpm run check:deployment-readinesswhen deployment startup, hosting, or rollout behavior changedClinical Governance Preflight
Complete this section when the change touches ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical output.
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
Summary by CodeRabbit
New Features
Bug Fixes
Tests