Skip to content

docs: search performance review ledger (cross-mode)#1134

Merged
BigSimmo merged 34 commits into
mainfrom
cursor/search-performance-review-4ee9
Jul 24, 2026
Merged

docs: search performance review ledger (cross-mode)#1134
BigSimmo merged 34 commits into
mainfrom
cursor/search-performance-review-4ee9

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.

Append a branch-review ledger row for the cross-mode search load/typeahead/submit performance review at 6ceaaff.
@supabase

supabase Bot commented Jul 24, 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 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: 31 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: 83ae0c5a-1304-483d-ba1c-89528627adff

📥 Commits

Reviewing files that changed from the base of the PR and between 335a505 and fec25f4.

📒 Files selected for processing (1)
  • docs/branch-review-ledger.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/search-performance-review-4ee9

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.

@BigSimmo
BigSimmo marked this pull request as ready for review July 24, 2026 05:35
@BigSimmo

Copy link
Copy Markdown
Owner Author

@cursoragent please resolve branch conflicts here for me

@BigSimmo
BigSimmo enabled auto-merge (squash) July 24, 2026 05:35
@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

❌ Unable to add follow-up after multiple attempts. The agent may be experiencing issues.

Please try again later or Open in Web to view the status.

Open in Web Open in Cursor 

Learn more about Cursor Agents

cursoragent and others added 8 commits July 24, 2026 05:45
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Debounce/abort prescribing medication catalogue fetches with fields=index,
harden differentials catalogue and evidence search cancellation, soft-timeout
universal documents typeahead (750ms), keep GlobalSearchShell mounted via a
shared (search-app) layout, and allow Answer rate-limit in-memory fallback in
non-production when the durable RPC is unavailable.

RAG impact: no retrieval behaviour change — typeahead documents domain timeout
only; ranking formulas and full /api/search path unchanged.
Keep searchMode in sync when the shared (search-app) layout navigates
between mode homes with an unchanged empty query string (/services → /dsm).
Index the (search-app) route group for docs:check-index and merge latest main.

RAG impact: no retrieval behaviour change — shell URL sync and docs index only.
Provide PR_POLICY_BODY.md so Sync PR policy body can rewrite the
stale ledger-only description with RAG impact, verification,
risk, and clinical governance preflight. Update babysit ledger row.
@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

CI triage

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

  • Unit coverageneeds 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 #4756 (success).

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

cursoragent and others added 10 commits July 24, 2026 06:09
Sync shared-shell URL mode during render so pathname-only navigations
do not paint a stale searchMode frame. Extract ClinicalDashboard lazy
imports and abort-controller helpers so the hotspot stays under budget.
Drop fields=index from the prescribing workspace so Safety/Monitoring
chips and patient alerts still see section-derived signals. Debounce and
abort remain the keystroke-storm controls; identity-only consumers keep
fields=index.
Resolve add/add on pr-babysit agent and ledger row ordering so PR #1134
is no longer conflicting with main.
Keep the richer main pr-babysit agent text with local maintainability
and PR_POLICY_BODY notes; record post-merge babysit SHA.
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Track previous pathname/search params in state (not refs) so during-render
mode sync stays Compiler-legal, and include setCommandScopes in memo deps.
Resolve ledger conflict by keeping PR #1134 babysit rows and main's
newest review entries.
Fast-forward PR #1134 past newly landed main commits after green CI.
@BigSimmo
BigSimmo disabled auto-merge July 24, 2026 06:50
Bring in main search-chrome docs and related updates. Guard Sheet's
deferred focus restore so a 50ms timer cannot touch document after
jsdom teardown (unit suite unhandled ReferenceError).
@BigSimmo

Copy link
Copy Markdown
Owner Author

@codex please resolve the merge conflict

docs/branch-review-ledger.md

please also fix and resolve the failing CI testing from the last run

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Added a PR docs: search performance review ledger (cross-mode) #1134 follow-up ledger entry documenting that the local docs/branch-review-ledger.md checkout had no unresolved conflict markers, preserving the PR rows and recording the Unit coverage fix/verifications. docs/branch-review-ledger.mdL23-L23
  • Hardened the PDF extraction deadline test by giving the synthetic child process enough time to publish its PID under loaded coverage runs, while avoiding assertions that depend on Linux kernel reaping timing. tests/pdf-extraction-budget.test.tsL123-L137
  • Committed the changes on the current branch with commit f14d76253c4ddd8a6fe16232332aad3b47133bd0 (test: harden pdf extraction deadline coverage).
  • Created PR metadata via make_pr with title: test: harden PR #1134 coverage follow-up.

Testing

  • PATH=$HOME/.nvm/versions/node/v24.15.0/bin:$PATH npm ci
  • PATH=$HOME/.nvm/versions/node/v24.15.0/bin:$PATH npm run test -- tests/pdf-extraction-budget.test.ts
  • PATH=$HOME/.nvm/versions/node/v24.15.0/bin:$PATH npx prettier --check tests/pdf-extraction-budget.test.ts docs/branch-review-ledger.md
  • PATH=$HOME/.nvm/versions/node/v24.15.0/bin:$PATH npm run test:coverage
  • git diff --check

View task →

cursoragent and others added 4 commits July 24, 2026 07:37
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
# Conflicts:
#	src/app/therapy-compass/layout.tsx

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo enabled auto-merge July 24, 2026 11:07

@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: 9311d01212

ℹ️ 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 scripts/check-docs-links.mjs
@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

Copy link
Copy Markdown

Summary

  • Resolved the actionable Codex P2 docs-link finding by adding the legacy pre-route-group paths to the docs link checker allowlist, with comments explaining these are intentional historical references after the (search-app) route-group move. scripts/check-docs-links.mjsL48-L56
  • Committed the scoped fix on the current branch: 0e72afc fix: allow legacy docs route references.
  • Created PR metadata with title: fix: allow legacy docs route references.
  • Included the required thread disposition marker in the PR body for the resolved Codex thread. I did not call GitHub APIs or post directly to the thread because the trigger explicitly prohibited external APIs.

Testing

  • npm run docs:check-links
  • npx prettier --check scripts/check-docs-links.mjs

View task →

@BigSimmo

Copy link
Copy Markdown
Owner Author

@cursoragent resolve merge conflict

@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

❌ Unable to add follow-up after multiple attempts. The agent may be experiencing issues.

Please try again later or Open in Web to view the status.

Open in Web Open in Cursor 

Learn more about Cursor Agents

@BigSimmo

Copy link
Copy Markdown
Owner Author

@cursoragent resolve merge conflict please

@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

❌ Unable to add follow-up after multiple attempts. The agent may be experiencing issues.

Please try again later or Open in Web to view the status.

Open in Web Open in Cursor 

Learn more about Cursor Agents

@BigSimmo

Copy link
Copy Markdown
Owner Author

@cursoragent please resolve merge conflict

@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

❌ Unable to add follow-up after multiple attempts. The agent may be experiencing issues.

Please try again later or Open in Web to view the status.

Open in Web Open in Cursor 

Learn more about Cursor Agents

cursoragent and others added 5 commits July 24, 2026 17:15
- Keep main differential debounce/abort/LRU (supersedes simpler branch debounce)
- Union docs-link allowlist with legacy pre-(search-app) paths

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
@BigSimmo
BigSimmo merged commit cd52a0e into main Jul 24, 2026
25 checks passed
@BigSimmo
BigSimmo deleted the cursor/search-performance-review-4ee9 branch July 24, 2026 17:35
cursor Bot pushed a commit that referenced this pull request Jul 24, 2026
Static PR checks failed on Prettier for five docs files. Also remove
leftover PR_POLICY_BODY.md from merged #1134 so Sync PR policy body
stops overwriting this docs PR description.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Jul 24, 2026
Temporary template so CI Sync PR policy body replaces the polluted
search-performance description left from merged #1134.

Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Jul 25, 2026
* docs: close ledger #9 #10 #32 #41 #63

Record ops-only /api/jobs decision, coming-soon audit, governance
ranking REFUTED guardrail, Factsheets reading-model brief, and Current
Clinical Work privacy/persistence brief. Archive the five open items;
no RAG or application behavior changes.

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

* fix(ci): prettier ledger docs and drop stale PR_POLICY_BODY

Static PR checks failed on Prettier for five docs files. Also remove
leftover PR_POLICY_BODY.md from merged #1134 so Sync PR policy body
stops overwriting this docs PR description.

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

* docs: record PR #1175 review ledger outcome

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

* chore: restore PR #1175 description via PR_POLICY_BODY sync

Temporary template so CI Sync PR policy body replaces the polluted
search-performance description left from merged #1134.

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

* chore: remove temporary PR_POLICY_BODY after description sync

Keep the corrected PR #1175 description without leaving the sync
template on the branch for merge to main.

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

* docs: supersede PR #1175 review ledger after body sync

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

* style: prettier-format outstanding-issues after ledger merge

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Jul 25, 2026
#1175 deleted the #1134 leftover, then #1153 reintroduced a sync
template. Leaving it on main lets Sync PR policy body overwrite
unrelated PR descriptions. Remove it again after descriptions are set.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: BigSimmo <BigSimmo@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