Skip to content

chore: execute audit remediation fixes and RAG governance - #1352

Closed
BigSimmo wants to merge 4 commits into
mainfrom
execute-audit-remediation-fixes
Closed

chore: execute audit remediation fixes and RAG governance#1352
BigSimmo wants to merge 4 commits into
mainfrom
execute-audit-remediation-fixes

Conversation

@BigSimmo

Copy link
Copy Markdown
Owner

Summary

  • Implemented RAG UI fail-closed governance checks to block untrusted table/checklist evidence leaks ( rustGatedAnswerForClinicalNotes).
  • Resolved all remaining git merge conflict markers across the codebase.
  • Verified zero regressions across the offline evaluation and test suites.
  • Executed strict repo-wide audit remediation and ledger tracking.

Verification

  • npm run verify:pr-local
  • npm run verify:ui when UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changed
  • npm run verify:release before release or handoff confidence claims
  • npm run eval:retrieval:quality (must stay 36/36) when retrieval, ranking, selection, chunking, or scoring behavior changed
  • npm run eval:rag -- --limit 15 + npm run eval:quality -- --rag-only
  • npm run check:production-readiness when clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior changed
  • npm run check:deployment-readiness when deployment startup, hosting, or rollout behavior changed

Risk and rollout

  • Risk: Low. The primary change enforces a stricter fail-closed validation boundary for RAG clinical visualizations.
  • Rollback: Revert PR.
  • Provider or production effects: None

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use
  • No patient-identifiable document workflow was introduced or expanded without explicit governance approval
  • Supabase target remains Clinical KB Database (sjrfecxgysukkwxsowpy)
  • Service-role keys and private document access remain server-only
  • Demo/synthetic content remains clearly separated from real clinical sources
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative
  • Deployment classification/TGA SaMD impact was checked when clinical decision-support behavior changed

Notes

RAG impact: no retrieval behaviour change — remediation of merge conflicts and UI RAG governance fail-closed boundary

@supabase

supabaseBot commented Jul 28, 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

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in:2 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f5716203-68c1-4af3-a69a-47450a646d61

📥 Commits

Reviewing files that changed from the base of the PR and between f39ca98 and dcdcb5b.

📒 Files selected for processing (33)
  • .agents/skills/catalog.json
  • docs/audit/repo-wide-review-remediation-plan-2026-07-23.md
  • docs/branch-review-ledger.md
  • docs/outstanding-issues.md
  • docs/search-chrome-behaviour.md
  • eslint-rules/require-z-index-ladder.mjs
  • eslint.config.mjs
  • scripts/check-github-action-pins.mjs
  • src/app/api/answer/route.ts
  • src/app/api/upload/route.ts
  • src/components/ClinicalDashboard.tsx
  • src/components/clinical-dashboard/SettingsStateProvider.tsx
  • src/components/clinical-dashboard/answer-status.tsx
  • src/components/clinical-dashboard/evidence-panels.tsx
  • src/components/clinical-dashboard/global-search-shell.tsx
  • src/components/clinical-dashboard/image-lightbox.tsx
  • src/components/clinical-dashboard/mode-action-popup.tsx
  • src/components/clinical-dashboard/settings-dialog.tsx
  • src/components/clinical-dashboard/signed-image.tsx
  • src/components/document-viewer/pdf-canvas-viewer.tsx
  • src/components/privacy-input-notice.tsx
  • src/components/services/service-detail-page.tsx
  • src/components/services/services-navigator-page.tsx
  • src/components/ui-primitives.tsx
  • src/components/ui/OverlayProvider.tsx
  • src/components/ui/badge.tsx
  • src/components/ui/card.tsx
  • src/lib/service-catalog-mapper.ts
  • tests/privacy-ui.test.ts
  • tests/private-access-routes.test.ts
  • tests/ui-tools.spec.ts
  • tests/visual-evidence-tabs.dom.test.tsx
  • worker/main.ts

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

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit:dcdcb5b2b0

ℹ️ 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".

appBackdrop,
// Phone: fixed inset-0 (not 100dvh) — matches GlobalSearchShell; avoids Safari toolbar dead band.
"mobile-app-shell flex flex-col overflow-hidden text-[color:var(--text)] max-sm:fixed max-sm:inset-0 max-sm:h-auto max-sm:min-h-0 max-sm:overflow-hidden md:grid md:grid-cols-[5.25rem_minmax(0,1fr)] md:overflow-hidden",
"mobile-app-shell @container/dashboard flex flex-col overflow-hidden text-[color:var(--text)] @max-@sm:fixed @max-@sm:inset-0 @max-@sm:h-auto @max-@sm:min-h-0 @max-@sm:overflow-hidden @md:grid @md:grid-cols-[5.25rem_minmax(0,1fr)] @md:overflow-hidden",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep viewport breakpoints on the dashboard root

On every dashboard route, the @md/@lg variants are attached to the same element that establishes @container/dashboard; a container cannot respond to a query against itself, so these variants never switch the root from flex-col to the sidebar grid. At tablet/desktop widths the sidebar consequently stacks above the main content, while the phone fixed-shell behavior is also lost. Keep viewport variants on this root or establish the query container on an ancestor; a 390px and 1024px layout smoke test would catch both failures.

AGENTS.md reference: AGENTS.md:L214-L221

Useful? React with 👍 / 👎.

Comment on lines +228 to +230
publisher_code: canonicalAuthority ? (identityAuthority.code ?? canonicalAuthority.codes[0] ?? null) : null,
publisher: canonicalAuthority?.publisher ?? null,
jurisdiction: canonicalAuthority?.jurisdictions[0] ?? "Australia/WA",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not authenticate sources from filenames

When an administrator uploads a file whose filename or title contains an exact registered code such as WACHS, this inference writes canonical publisher metadata before anyone verifies the document. classifySourceAuthority then designates it Official even while clinical_validation_status remains unverified, and the UI describes that designation as an authenticated source. Keep the inferred identity as a review candidate rather than canonical provenance; an upload test using WACHS-notes.pdf should assert that its designation remains Unclassified until approval.

Useful? React with 👍 / 👎.

@BigSimmoBigSimmo mentioned this pull request Jul 28, 2026
3 tasks
Repository owner locked and limited conversation to collaborators Jul 28, 2026
@BigSimmo
BigSimmo deleted the execute-audit-remediation-fixes branch July 30, 2026 09:10
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@BigSimmo