Skip to content

fix: harden search cancellation and design-audit regressions#861

Merged
BigSimmo merged 12 commits into
mainfrom
codex/design-audit-main-safe-20260720-final
Jul 18, 2026
Merged

fix: harden search cancellation and design-audit regressions#861
BigSimmo merged 12 commits into
mainfrom
codex/design-audit-main-safe-20260720-final

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Keep unsupported Forms pathway claims and refine controls out of desktop and mobile search results, while retaining neutral record-detail match copy.
  • Propagate caller abort signals through lexical, table-fact, document, embedding-field, index-unit, hybrid, and fallback retrieval RPCs; stop post-RPC hydration/cache work after cancellation.
  • Preserve caller cancellation through classifier coalescing and add process-local answer coalescing metrics without exposing query keys or clinical content.
  • Harden the design-audit regression coverage for reduced motion, route-error focus, universal-search ordering, local private-capability handling, and current migration assertions.

Verification

  • git diff --check on the exact PR diff.
  • Prettier check on all changed files using the complete root checkout toolchain.
  • npm run ensure on the exact pre-fix branch snapshot; project identity verified at http://localhost:4298.
  • Exact-head hosted checks are running after commit 593d5aa00.
  • UI verification not run: focused local Playwright was attempted twice but could not acquire the repository heavy-command lock because an active sibling worktree owned it; it was not retried a third time.
  • Local typecheck was not repeated after the previously recorded timeout and 4 GB out-of-memory failures; hosted static/build checks are the intended exact-head proof.
  • Live Supabase/OpenAI production-readiness and retrieval-quality gates were not run; they remain separately approval-required and this PR performs no live provider mutation.

Risk and rollout

  • Risk: Medium. The UI changes only remove unsupported claims/controls, while the retrieval changes affect cancellation behavior across all database candidate layers and deliberately prevent post-abort hydration/cache writes.
  • Rollback: Revert this PR. No database rollback, data restoration, provider configuration, or environment change is required.
  • Provider or production effects: None. No migration was applied and no Supabase/OpenAI API or production service was contacted by the implementation workflow.

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
  • No clinical answer, ranking, or decision-support semantics changed; cancellation now fails closed sooner when a caller disconnects. The configured project was not contacted.

Review disposition

  • The unsupported pathway-copy finding is fixed with neutral copy plus desktop/mobile negative assertions.
  • The missing RPC-cancellation propagation finding is fixed at every production callVersionedRetrievalRpc call site with an abort-signal regression test.
  • The duplicate favourites “also matches” finding is fixed by leaving the shared wrapper to Tools and keeping the Favourites-owned panel, with a source-contract regression test.

@supabase

supabase Bot commented Jul 18, 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 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

Next review available in: 12 seconds

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: 05400a7d-5ac9-4446-bf8c-0c0cdb2056dc

📥 Commits

Reviewing files that changed from the base of the PR and between f365f26 and d8c1916.

📒 Files selected for processing (8)
  • src/components/ClinicalDashboard.tsx
  • src/components/forms/forms-search-results-page.tsx
  • src/lib/rag-candidate-sources.ts
  • src/lib/rag.ts
  • tests/audit-content-services-regressions.test.ts
  • tests/audit-navigation-auth-regressions.test.ts
  • tests/rag-abort-signal.test.ts
  • tests/ui-tools.spec.ts
📝 Walkthrough

Walkthrough

This change adds abort-signal propagation to retrieval and classifier fallback paths, records answer-coalescing telemetry, gates unsupported pathway UI, adjusts universal search result placement, broadens page query typing, updates focus styling, and revises related regression and browser-test assertions.

Changes

Retrieval and results experience

Layer / File(s) Summary
Abortable retrieval and answer telemetry
src/lib/rag.ts, src/lib/rag-candidate-sources.ts
Retrieval RPCs and classifier fallback handling accept caller abort signals, while coalesced answer lifecycle events are recorded.
Forms pathway capability gating
src/components/forms/forms-search-results-page.tsx
Pathway filters, tabs, refine controls, pathway panels, and verified footer rendering are disabled when pathway claims support is false.
Result placement and page contracts
src/components/ClinicalDashboard.tsx, src/app/page.tsx, src/components/route-error-boundary.tsx
Universal search matches are placed by result kind, query parameters accept generic string-keyed records, and heading focus styles use focus-visible.
Regression and browser validation
playwright.config.ts, tests/*
Reduced-motion configuration and assertions for provenance, navigation, schema SQL, forms UI, search state, and scroll transitions are updated.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Retrieval
  participant Classifier
  participant AbortSignal
  participant SupabaseRPC
  Retrieval->>Classifier: Await classifier verdict with caller signal
  AbortSignal-->>Classifier: Reject pending wait on abort
  Retrieval->>SupabaseRPC: Execute retrieval RPC with caller signal
  SupabaseRPC-->>Retrieval: Return RPC result or abort
Loading

Possibly related PRs

Suggested labels: codex

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title captures the main themes: search cancellation hardening and regression fixes across UI/tests.
Description check ✅ Passed The description follows the required sections and includes summary, verification, risk, governance, and rollout details.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/design-audit-main-safe-20260720-final

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@src/lib/rag-candidate-sources.ts`:
- Around line 91-104: Propagate the abort signal through both retrieval RPC call
sites by passing args.signal as the fifth argument to callVersionedRetrievalRpc
in the hybrid and fallback flows in src/lib/rag.ts (around lines 2837 and 2945).
Leave callVersionedRetrievalRpc and its executeRpc wrapper in
src/lib/rag-candidate-sources.ts (lines 91-104) unchanged, as they already apply
the signal correctly.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d0827e9b-26d0-4d84-a17f-dcff29499329

📥 Commits

Reviewing files that changed from the base of the PR and between 2f5b22a and f365f26.

📒 Files selected for processing (11)
  • playwright.config.ts
  • src/app/page.tsx
  • src/components/ClinicalDashboard.tsx
  • src/components/forms/forms-search-results-page.tsx
  • src/components/route-error-boundary.tsx
  • src/lib/rag-candidate-sources.ts
  • src/lib/rag.ts
  • tests/audit-content-services-regressions.test.ts
  • tests/audit-navigation-auth-regressions.test.ts
  • tests/supabase-schema.test.ts
  • tests/ui-tools.spec.ts

Comment thread src/lib/rag-candidate-sources.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot 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: f365f26a83

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

Comment thread src/components/forms/forms-search-results-page.tsx
@BigSimmo

Copy link
Copy Markdown
Owner Author

@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.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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: d04d128174

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

Comment thread src/components/forms/forms-search-results-page.tsx
@BigSimmo BigSimmo changed the title fix: complete design-audit merge-safe path for forms and tools fix: harden search cancellation and design-audit regressions Jul 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot 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: c66aad9dd2

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

Comment thread src/components/ClinicalDashboard.tsx Outdated
@github-actions

Copy link
Copy Markdown

CI triage

CI failed on this PR. Automated classification of the 2 failed job(s):

  • Static PR checksneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #3300 (success).

Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 18, 2026 14:02
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found.

@BigSimmo
BigSimmo merged commit 3b2dd9e into main Jul 18, 2026
15 checks passed
@BigSimmo
BigSimmo deleted the codex/design-audit-main-safe-20260720-final branch July 18, 2026 14:10
@BigSimmo BigSimmo mentioned this pull request Jul 18, 2026
2 tasks
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