Skip to content

📝 CodeRabbit Chat: Simplify PR code#534

Merged
BigSimmo merged 1 commit into
claude/rag-review-improvements-f1bf84from
coderabbitai/simplify/10f39fd
Jul 12, 2026
Merged

📝 CodeRabbit Chat: Simplify PR code#534
BigSimmo merged 1 commit into
claude/rag-review-improvements-f1bf84from
coderabbitai/simplify/10f39fd

Conversation

@coderabbitai

@coderabbitai coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Code changes was requested by @BigSimmo.

The following files were modified:

  • src/components/ClinicalDashboard.tsx
  • src/components/clinical-dashboard/answer-content.tsx
  • src/components/clinical-dashboard/answer-result-surface.tsx
  • src/components/clinical-dashboard/evidence-panels.tsx
  • src/components/clinical-dashboard/output-panel.tsx
  • src/lib/rag-answer-text.ts

@coderabbitai
coderabbitai Bot requested a review from BigSimmo July 12, 2026 18:10
@supabase

supabase Bot commented Jul 12, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor Author

Important

Review skipped

This PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 53b93c13-475f-4a4a-9f79-d1bc7e89d754

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@BigSimmo
BigSimmo merged commit 3016507 into claude/rag-review-improvements-f1bf84 Jul 12, 2026
3 checks passed
BigSimmo added a commit that referenced this pull request Jul 12, 2026
…afety caveats + retrieval telemetry (#514)

* fix(rag): honor preformatted answers, render high-yield bold, guard safety caveats + retrieval telemetry

Client display fixes (offline-proven, no retrieval-ranking impact):
- F1: the client now honors the server `preformatted` flag, so document-support-list
  and table/visual answers are no longer re-mangled by the prose sanitizer on
  display (document names and facility codes were being deleted). Adds a lossless
  normalizePreformattedDisplayText and threads the flag through the display chain.
- F3: high-yield **bold** now reaches the rendered answer via SafeBoldText
  (display-only preserveBold; the shared server answer-gen path is unchanged),
  and the copy/paste clinical draft no longer leaks literal `**`.
- F4: the compact primary-answer cap never drops a safety-signal fragment
  (withhold/stop/threshold/escalate/...); byte-identical when none is present.

Retrieval observability (additive, retrieval results byte-identical):
- F8: lexical RPC errors (match_document_chunks_text, match_document_table_facts_text,
  match_documents_for_query) now record hybrid_rpc_errors telemetry before returning
  empty, instead of silently degrading to zero candidates with no signal.

Infra:
- F7: replay-safe migration documenting the retrieval owner-filter drift with a
  verified, owner-runnable byte-perfect codification procedure. Live already gates
  all 8 primary retrieval RPCs with the fail-closed retrieval_owner_matches; the
  gap is committed-source reproducibility only.

Verification: typecheck, lint, format, full vitest (1655 passed), eval:rag:offline,
and the @critical demo answer-flow E2E all green. Live eval:retrieval:quality 36/36.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix: apply CodeRabbit auto-fixes

Fixed 5 file(s) based on 4 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

* 📝 Add docstrings to `claude/rag-review-improvements-f1bf84`

Docstrings generation was requested by @BigSimmo.

* #514 (comment)

The following files were modified:

* `src/components/ClinicalDashboard.tsx`
* `src/components/clinical-dashboard/answer-content.tsx`
* `src/components/clinical-dashboard/answer-result-surface.tsx`
* `src/components/clinical-dashboard/display-text.ts`
* `src/components/clinical-dashboard/evidence-panels.tsx`
* `src/components/clinical-dashboard/output-panel.tsx`
* `src/lib/answer-render-policy.ts`
* `src/lib/rag-answer-text.ts`
* `src/lib/rag.ts`
* `src/lib/source-text-sanitizer.ts`

* fix: preserve safety cues in compact answers

* fix(rag): keep short safety caveats past the usefulness/length filter

The compact-answer safety loop only rescued fragments that survived the
`.map`/`.filter` usefulness gate, so a short caveat like "Contraindicated in
pregnancy" (7 words, not flagged "useful") was dropped before it could be
preserved. Make the map/filter safety-aware so safety-bearing fragments pass
through untouched, and add regression tests for short and full-word
escalation/contraindication caveats beyond the compact head.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* style: format source-text-sanitizer.test.ts (CodeRabbit autofix left it unformatted)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(ci): resolve PR #514 review findings and Supabase preview drift

- Skip whole-text clinicalProseUsefulness in primaryAnswerDisplayText so
  short safety sentences (Stop/Cease/held) survive to the fragment bypass
- Add held to the safety signal matcher for passive withhold caveats
- Strip catalogue/source artifacts on a de-bolded copy when preserveBold
  is set, then restore surviving emphasis spans
- Restore the 20260712000000 migration stub so the Supabase preview branch
  matches local migration history (verify guard only; RPC bodies deferred)
- Add regression tests for stop/held caveats and bolded catalogue stripping

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>

* 📝 CodeRabbit Chat: Simplify PR code (#534)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: apply Prettier formatting to answer-content.tsx

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@BigSimmo
BigSimmo deleted the coderabbitai/simplify/10f39fd branch July 13, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant