Skip to content

fix: implement automated audit remediations#1158

Merged
BigSimmo merged 20 commits into
mainfrom
codex/audit-remediation-final
Jul 25, 2026
Merged

fix: implement automated audit remediations#1158
BigSimmo merged 20 commits into
mainfrom
codex/audit-remediation-final

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix cross-mode search performance findings: prescribing catalogue debounce/abort/fields=index, differentials abort/debounce, universal documents typeahead soft-timeout (750ms), shared (search-app) shell to avoid composer remount, and Answer rate-limit in-memory fallback outside production.
  • Fix Bugbot regressions: shared-shell pathname navigation (/services/dsm) syncs searchMode during render (no stale-mode paint) even when the query string is unchanged; extracted ClinicalDashboard lazy imports to stay under the maintainability budget.

RAG impact: no retrieval behaviour change — typeahead documents domain timeout and shell URL sync only; ranking formulas and full /api/search retrieval path unchanged.

Verification

  • npm run verify:pr-local — focused Vitest on touched sources (362) plus api-rate-limit / search-shell / universal / route / site-map suites green; docs:check-index OK
  • UI verification not run: full verify:ui not required for this pass; mode-home smoke via npm run ensure returned HTTP 200 for /, /services, /dsm, /documents/search, /therapy-compass, /?mode=prescribing, and /api/answer/stream returned 200 after the rate-limit fallback fix
  • Verification not run: eval:retrieval:latency / soak / live OpenAI canary — approval-gated provider work; not needed for timeout-only typeahead change

Risk and rollout

  • Risk: medium — shared layout remount change and rate-limit fallback behaviour in non-production; production Answer/upload still fail closed when the durable limiter is unavailable
  • Rollback: revert this PR; mode routes return to per-segment GlobalSearchShell layouts and prior timeout/fallback behaviour
  • 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 [REDACTED] ([REDACTED])
  • 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

  • Prescribing list rows keep the full catalogue payload so Safety/Monitoring filters and patient alerts still see section-derived signals; keystroke storms are controlled by debounce + abort. fields=index remains for identity-only consumers (cross-mode links).
  • Live hybrid RPC cold tails remain a separate approval-gated follow-up.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

1 similar comment
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@BigSimmo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 8 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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 Plus

Run ID: f5c52e40-cc24-4c43-842c-b21067cad5db

📥 Commits

Reviewing files that changed from the base of the PR and between 43f261c and d19c7d2.

📒 Files selected for processing (10)
  • docs/branch-review-ledger.md
  • scripts/guard-next-build.mjs
  • src/app/globals.css
  • src/lib/env.ts
  • src/lib/rag/rag.ts
  • supabase/migrations/20260724000000_optimize_rpc_work_mem.sql
  • tests/corpus-grounding.test.ts
  • tests/rag-answer-fallback.test.ts
  • tests/rag-classifier-memo.test.ts
  • worker/main.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/audit-remediation-final

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.

❤️ Share

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

@supabase

supabase Bot commented Jul 24, 2026

Copy link
Copy Markdown

Updates to Preview Branch (codex/audit-remediation-final) ↗︎

Deployments Status Updated
Database Sat, 25 Jul 2026 04:26:01 UTC
Services Sat, 25 Jul 2026 04:26:01 UTC
APIs Sat, 25 Jul 2026 04:26:01 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Sat, 25 Jul 2026 04:26:03 UTC
Migrations Sat, 25 Jul 2026 04:26:06 UTC
Seeding Sat, 25 Jul 2026 04:26:07 UTC
Edge Functions Sat, 25 Jul 2026 04:26:08 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

cursoragent and others added 5 commits July 24, 2026 07:56
# Conflicts:
#	supabase/drift-manifest.json

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

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Bugbot / sweep note (RAG surface): src/lib/rag/rag.ts appears to force queryClass: "broad_summary" for ≤4-token clinical queries (skipping the LLM classifier). That is a retrieval/answer routing behaviour change under the RAG ranking protection rules.

Please add an explicit RAG impact: line with a canary pair before merge, or revert that routing shortcut. Do not merge on offline-green alone for this path. Leaving this as a human decision — no code change made in the sweep.

@BigSimmo
BigSimmo enabled auto-merge July 24, 2026 16:03
@BigSimmo
BigSimmo merged commit aa74592 into main Jul 25, 2026
19 checks passed
@BigSimmo
BigSimmo deleted the codex/audit-remediation-final branch July 25, 2026 04:33
BigSimmo added a commit that referenced this pull request Jul 25, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
cursor Bot pushed a commit that referenced this pull request Jul 25, 2026
…1141)

* fix(ui): implement orientation adaptive design audit recommendations

* fix: remove duplicate command dropdown height cap

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

* chore: note review reply permission denial

GraphQL review-thread replies returned 403; resolved the fixed duplicate-height threads directly after validation.

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

* docs: record PR babysit sweep

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

* docs: record Run PR behind-main sweep for #1141

* docs: ledger re-sync sweep for PR #1141

* fix(ui): collapse dock child safe-area padding

* docs: record PR 1141 maintenance

* fix(ui): avoid Sheet max-height racing caller caps

Skip the default phone max-h utility when contentClassName already sets max-h, and record the PR #1140 babysit ledger row.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(ui): poll guide dialog focus trap across viewport sizes

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(ui): do not steal focus from a newly opened sheet on restore retry

The Sources opener retry must not reclaim focus when another dialog already became active (mobile Guide opened from the Clinical Guide menu).

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(ui): retry Sheet autofocus when open races a closing sibling

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(ui): harden Sources opener focus restore assertion after Escape

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs(review): record babysit merges for #1140 #1171 #1180 #1158

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(ui): stabilize Sources sheet autofocus on open

Default UtilityDrawer sheet mode for breakpoint=all and retry sheet autofocus so the Find-a-document field keeps focus after drawer mount races.

* ci: retrigger PR policy check on tip

* fix(ui): stop stacked Sheet focus steal; assert Escape restore honestly

Gate Sheet autofocus retries on isTopmostSheet, and remove test-side focus repair so production restore failures stay visible.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants