Drop seven unreachable alternatives from the Smart search rules - #2716
Drop seven unreachable alternatives from the Smart search rules#2716BigSimmo wants to merge 1 commit into
Conversation
Seven expansion patterns listed a long phrase alongside a shorter one that the long phrase always contains, so the shorter alternative matched first and the longer one could never be reached. Two are in Prescribing, one in Tools, and four in Calculators. The trimmed patterns are behaviour-identical: in each pair the surviving phrase is a suffix of the deleted one and carries the same word boundaries, so every string the old pattern matched the new one matches too. The existing unit tests already exercise three of these rules using the long phrasing and still pass unchanged, which is the proof that nothing moved. No rule is added, removed, or retargeted. This deletes dead text only. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012j3M3zd5PkGfN5vJe3BiSU
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Bugbot couldn't run - usage limit reachedBugbot 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_5df8c4af-ce19-4dd1-914b-31ce64c07e18) |
|
Consolidated into #2736 at db6376e. The complete original head fef557b is retained as an ancestor, including its code, tests and audit requests. Closing this duplicate review/CI stream under the authorised consolidation; source branch retained. Current verification and remaining merge prerequisites are recorded on #2736. This closure does not claim that the successor is merged or that its required CI is green. |
Summary
modeExpansionRulespatterns insrc/lib/smart-search-intent.tslisted a long phrase alongside a shorter phrase that the long one always contains. Alternation tries the shorter branch first and it always wins, so the longer branch could never be reached. Two are in Prescribing, one in Tools, and four in Calculators.medicine that needs regular blood tests|regular blood testsregular blood testsmedicine for alcohol dependence|alcohol dependencealcohol dependencecheck medication interactions|medication interactionsmedication interactionsscreen depression severity|depression severitydepression severitymeasure anxiety symptoms|anxiety symptomsanxiety symptomsscreen hazardous drinking|hazardous drinkinghazardous drinkingrate obsessive compulsive symptoms|obsessive compulsive symptomsobsessive compulsive symptomsWhy this is behaviour-identical: in every pair the surviving phrase is a suffix of the deleted one and is preceded there by a space, so the
\bboundaries land in the same places. Any string the old pattern matched, the new one matches. This was checked over 126 framed strings per-pattern (prefixesmedicine that needs,check,screen,measure,rate, adjacent-character, hyphenation, case and whitespace variants) with zero differences, and the existing unit tests already assert three of these rules using the long phrasing and pass unchanged.RAG impact: no retrieval behaviour change —
src/lib/smart-search-intent.tsis offline catalogue vocabulary expansion for the Smart modes, not a document retrieval or ranking surface, and this change is a proven no-op within it. No file undersrc/lib/rag/, no retrieval RPC, no golden fixture, and no ranking contract test is touched.Verification
npm run test:focused -- --files src/lib/smart-search-intent.ts— 113 test files, 1225 tests passednpm run lint— clean,--max-warnings 0npm run typecheck— cleannpm run format— whole-tree, committedVerification not run:
npm run verify:pr-local— its dry run selects full heavy scope includingnpm run build, deferred to CI, which runs the same required gates on this head.UI verification not run: no UI, routing, or styling file changed, so
npm run verify:uidoes not apply.npm run eval:retrieval:qualitydoes not apply. This is catalogue term expansion, not document retrieval, ranking, selection, chunking, or scoring.No tests were added or changed. The equivalence proof is that the existing tests, which use the long phrasing this PR deletes, still pass against the trimmed patterns.
Risk and rollout
Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)Basis for the seven items above: the diff deletes unreachable regex alternatives in one pure, offline module. It makes no provider call, no network request, and no schema or Supabase change, and it neither reads nor writes document content, source metadata, review status, or credentials. Deployment classification was considered and is unchanged, because the change is behaviour-identical and produces no clinical recommendation.
Notes
🤖 Generated with Claude Code
https://claude.ai/code/session_012j3M3zd5PkGfN5vJe3BiSU
Generated by Claude Code
Note
Low Risk
Offline catalogue vocabulary expansion only; seven regex simplifications with no intended change to which queries match or which terms expand.
Overview
Removes seven dead regex alternates in
modeExpansionRulesinsidesmart-search-intent.ts. Each pattern previously listed a longer phrase and a shorter substring; matching always hit the shorter branch first, so the longer arm was unreachable.Prescribing (
regular blood tests,alcohol dependence), Tools (medication interactions), and Calculators (four severity/symptom phrases) now use only the surviving substring. Associatedtermsand which queries trigger expansion are unchanged—this is a readability/cleanup pass, not a retargeting of rules.Reviewed by Cursor Bugbot for commit fef557b. Configure here.