fix: fail closed on missing answer relevance#1125
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Warning Review limit reached
Next review available in: 35 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 (6)
📝 WalkthroughWalkthroughAnswer rendering now fails closed when source-backed relevance metadata is absent. Trust derivation and dashboard groundedness require ChangesAnswer relevance trust
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/answer-render-policy.test.ts (1)
292-304: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd an explicit-false regression case.
The new test covers absent metadata, but the stated contract also requires
isSourceBacked: falseto remain low trust. Add the same trust/block assertions for that case so future predicate changes cannot reopen it.🤖 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/answer-render-policy.test.ts` around lines 292 - 304, Add a regression test alongside the absent-metadata case using answer() with relevance metadata explicitly setting isSourceBacked to false. Assert model.trust is "low" and model.allowedBlocks excludes both "quoteCards" and "relatedDocuments", preserving the same fail-closed contract.
🤖 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.
Nitpick comments:
In `@tests/answer-render-policy.test.ts`:
- Around line 292-304: Add a regression test alongside the absent-metadata case
using answer() with relevance metadata explicitly setting isSourceBacked to
false. Assert model.trust is "low" and model.allowedBlocks excludes both
"quoteCards" and "relatedDocuments", preserving the same fail-closed contract.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: f0abb835-c9f0-45ad-9d30-c503e45fcedf
📒 Files selected for processing (4)
docs/branch-review-ledger.mdsrc/components/ClinicalDashboard.tsxsrc/lib/answer-render-policy.tstests/answer-render-policy.test.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4725f19ce0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation. |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0290694cb1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac0d430547
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…e-fail-closed Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
When relevance.isSourceBacked is false, clear answerSections, quoteCards, and smartPanel quotes before Clinical Notes renders — not only visualEvidence. Addresses Codex review on PR #1125. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41ad7a3ad9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Strip documentBreakdown and comparison metadata when relevance is not source-backed so Clinical Notes cannot rebuild comparison tables via ClinicalOutputPanel fallback. Co-authored-by: Cursor <cursoragent@cursor.com>
Assert the comparison-detail caption and matrix values stay hidden when relevance is missing, even if documentBreakdown and comparisonMatrix are present.
Ledger the cleared documentBreakdown/comparison-metadata fail-closed fix and hardened jsdom regression for PR #1125.
Use the full reviewed commit hash for the PR #1125 comparison clear-out row.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c469697202
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
isSourceBacked: truebefore an answer receives high render trust or a grounded dashboard state.RAG impact: no retrieval behaviour change — this only tightens render-time trust and evidence visibility when relevance metadata is not affirmatively source-backed.
Verification
npm run verify:pr-local— before the review follow-ups, runtime, formatting, lint, typecheck, 366 test files (3,254 passed/1 skipped), production build (1,677 pages), client-bundle secret scan, and RAG fixture validation passed.npm run verify:ui— before the review follow-ups, 267/267 Chromium scenarios passed against the isolated production build; fresh exact-head hosted Production UI is required after the final UI fix.npm run check:production-readiness— READY for configuredClinical KB Database; read-only, with no provider request or mutation.npm run eval:rag:offline— 36/36 fixtures, 21 suites, and 308 tests passed.npx vitest run tests/answer-render-policy.test.ts tests/provenance-flow.test.ts tests/clinical-safety.test.ts— 37/37 passed.npx vitest run tests/visual-evidence-tabs.dom.test.tsx tests/answer-render-policy.test.ts— 31/31 passed after the final UI fix.npm run verify:cheap— after the final UI fix, all 20 non-test gates, lint, typecheck, 365/366 files and 3,254 tests passed; only tracked load-sensitive issue Delete .github/workflows/label.yml #67 timed out.verify:ui, because the focused jsdom regression covers the changed drawer boundary and the mandatory exact-head hosted Production UI gate is running.Risk and rollout
Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes