Skip to content

feat(search): interpret natural language within smart catalogue modes - #2482

Merged
BigSimmo merged 12 commits into
mainfrom
codex/chat-smart-natural-mode-search-pr-2480-landed-verify
Aug 31, 2026
Merged

feat(search): interpret natural language within smart catalogue modes#2482
BigSimmo merged 12 commits into
mainfrom
codex/chat-smart-natural-mode-search-pr-2480-landed-verify

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Summary

  • Separate Smart mode search from Clinical Ask: natural-language input now remains on the selected mode's deterministic catalogue results route.
  • Add provider-free, mode-specific vocabulary expansion for Services, Forms, Differentials, Formulation, DSM-5 Diagnosis, Specifiers, and Therapy while preserving literal compact codes and unsupported-mode behaviour.
  • Keep the existing single composer, accessibility cues, governed Clinical Ask retrieval contracts, production configuration, database schema, and provider boundaries unchanged.

Verification

  • npm run verify:pr-local
    • Verification not run: the broad local aggregate was intentionally not repeated; GitHub will provide authoritative final-head coverage.
  • npm run verify:ui when UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changed
    • UI verification not run: the broad UI aggregate was not repeated. The focused production Chromium suite passed 4/4 post-merge journeys, including all seven modes, compact codes, unsupported-mode honesty, phone/desktop, dark mode, reduced motion, forced colors, Axe, and zero Clinical Ask requests.
  • npm run verify:release before release or handoff confidence claims
    • Verification not run: this is a dormant code PR, not a release or activation.
  • npm run eval:retrieval:quality (must stay 36/36) when retrieval, ranking, selection, chunking, or scoring behavior changed
    • Verification not run: governed RAG retrieval is unchanged and this live-key evaluation is not applicable to deterministic catalogue aliases. The focused catalogue/interpreter suite passed 208/208 tests across 13 files before the current-main merge.
  • npm run eval:rag -- --limit 15 + npm run eval:quality -- --rag-only
    • Verification not run: answer generation, synthesis prompts, post-processing, and Clinical Ask evidence selection are unchanged.
  • npm run check:production-readiness
    • Verification not run: no production activation, provider, environment, migration, or Clinical Ask behaviour changed.
  • npm run check:deployment-readiness
    • Verification not run: deployment startup and hosting are unchanged.

Additional exact-tree evidence:

  • 53/53 post-merge Smart intent, shared-header DOM, and route-ownership tests passed.
  • The post-merge isolated production build and TypeScript phase passed as part of the focused Playwright run.
  • Pre-merge exact-tree TypeScript, ESLint, design-system contracts, documentation links, formatting, diff whitespace, and 77 catalogue/Clinical Ask boundary tests passed.
  • Branch-review-ledger integrity passed after the immutable review record was appended.
  • Initial-head CI exposed two exact compatibility regressions: the established shared-composer accessible-name prefix had changed, and a Forms alias expanded the already-explicit term transport. Final-head commit 5dd00a1e63a722d8b0a8d194706e79a2cfecde7b restores both contracts; 42/42 focused unit/DOM tests and four representative previously failing production-browser journeys pass locally.

Risk and rollout

  • Risk: Mode-specific aliases can broaden deterministic catalogue ranking for natural-language phrases; tests pin representative results, literal codes, unsupported modes, and the Clinical Ask isolation boundary.
  • Rollback: Revert this PR. Smart catalogue interpretation has no runtime activation flag; Clinical Ask flags are not rollback controls for this feature.
  • Provider or production effects: None. No OpenAI, Supabase, migration, provider configuration, deployment, or production data operation was performed.
  • RAG impact: behaviour change — deterministic mode-catalogue ranking only. Governed RAG retrieval, synthesis, evidence selection, and answer contracts are unchanged; no paid canary was run.

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

  • Smart coverage is limited to the seven existing catalogue modes: Services, Forms, Differentials, Formulation, DSM-5 Diagnosis, Specifiers, and Therapy.
  • Clinical Ask remains a separate dormant governed-answer workflow and is not invoked by Smart search.
  • Historical PR Mode-aware Clinical Ask: server streaming, transcription, UI, governance, and tests #2293 protected-staging/provider evidence is background only, not exact-head proof.
  • Named clinical/privacy approval and physical iPhone Safari/PWA acceptance remain Clinical Ask activation gates; they do not gate provider-free Smart catalogue search.
  • Microphone controls remain absent.
  • Current origin/main at d29f70eff898d9da5b343d2c8b6d260970b127b9 was merged normally. Auto-merge remains off.

Note

Medium Risk
Changes deterministic catalogue ranking and composer routing across seven clinical reference modes; behaviour is test-pinned and provider-free, but result ordering for natural-language queries may shift in production.

Overview
Smart natural-language input no longer routes to Clinical Ask. Enter in the seven catalogue modes always navigates to that mode’s ordinary results surface with the same query in the URL and composer; the shared composer drops submitSmartSearch, server-gated “Get Smart answer” affordances, and clinicalAskAvailable-driven Smart UI.

Provider-free interpretation replaces answer routing. smart-search-intent is reworked around interpretSmartSearch and per-mode alias rules: natural-language phrases get low-weight vocabulary expansions for deterministic ranking only, while compact codes and embedded identifiers stay literal. Rankers, APIs, mode pages, therapy search, and universal search opt in via interpretNaturalLanguage / expansion forwarding; UI copy shifts to “Smart search · catalogue results.”

Governance and tests match the split. Clinical governance, search-chrome, and handover docs state that CLINICAL_ASK_ENABLED does not control Smart search. Playwright and unit tests assert zero /api/clinical-ask/stream calls for NL queries and pin representative ranked results per mode.

Reviewed by Cursor Bugbot for commit f6ae2a7. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9725b390-af98-495f-8628-b8713a6ab958


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 Aug 31, 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 ↗︎.

@cursor

cursor Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_39d73e3e-1552-495b-b38d-56e4a716c8c6)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T07:25:47.108722Z fede402 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: fede4029f3

ℹ️ 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/specifiers/specifiers-home-page.tsx
@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

CI triage

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

  • Production UI (3)not baselined: this job did NOT run on the main comparison below (path-scoped skip), so that run says nothing about it either way. Treat the comparison as absent, not green, and inspect the failing step.
  • PR requiredneeds investigation: inspect the failing step and uploaded diagnostics; rerun only after classifying the cause.

Compared with main CI run #14602 (success). That run's conclusion is an aggregate and did not exercise Production UI (3).

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

@cursor

cursor Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_c0690071-2f72-42df-a28a-000ba83b4ba9)

…-landed-verify

Resolve ui-smoke conflict by taking main's containment/rAF asserts from #2471; bring in main package and differentials updates.
@BigSimmo
BigSimmo enabled auto-merge (squash) August 31, 2026 09:16
@BigSimmo
BigSimmo force-pushed the codex/chat-smart-natural-mode-search-pr-2480-landed-verify branch from 153b48b to f6ae2a7 Compare August 31, 2026 09:45
@cursor

cursor Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_d014282a-a0b6-4c3d-9efc-b43bb0850c6f)

@BigSimmo
BigSimmo force-pushed the codex/chat-smart-natural-mode-search-pr-2480-landed-verify branch from ef296ea to f6ae2a7 Compare August 31, 2026 09:50
@BigSimmo
BigSimmo merged commit f7f9d01 into main Aug 31, 2026
43 of 54 checks passed
@BigSimmo
BigSimmo deleted the codex/chat-smart-natural-mode-search-pr-2480-landed-verify branch August 31, 2026 10:03
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