feat(search): alert on silent clinical-search degradation (council pre-beta req)#88
Merged
Merged
Conversation
…e-beta req) - New degradation-alert.ts: Sentry alerts for (a) semantic->keyword-only fallback on embedding 403/circuit-open, (b) resolved-agency clinical query returning ZERO results. - Wire both fallback sites in embeddings/search.ts + the empty-result path in semantic.ts. - 5 DB-free unit tests (all pass), incl. false-alarm guards. Required before TestFlight beta per resubmission AI-council 2026-06-01.
✅ Deploy Preview for protocol-guide ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
thefiredev-cloud
added a commit
that referenced
this pull request
Jun 1, 2026
…89) Council #88 follow-up: isClinical was dosing-keyword-only, so bare emergent queries (chest pain, stroke, cardiac arrest) that blank-screen for a resolved agency did NOT alert. New pure isClinicalQuery() reuses the normalizer's intent / isEmergent / extractedConditions / extractedMedications signals. +5 unit tests (10/10 pass). Co-authored-by: Claude Assistant <claude@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Silent-degradation detection for clinical search — required before TestFlight beta per the resubmission AI-council (2026-06-01).
Two failure modes no longer fail silently:
Changes
server/_core/embeddings/degradation-alert.ts(Sentry + logger, false-alarm-safe: only fires for resolved-agency clinical queries).embeddings/search.ts: alert at both BM25-fallback sites.routers/search/semantic.ts: alert on resolved-agency empty results.tests/embedding-degradation-alert.test.ts— 5 DB-free unit tests, all pass.Safety / scope
Additive only (alerts on existing failure paths). No behavior change to results. Does NOT deploy on its own — backend ships via the pg-ship/backend gate after review.
Verification
pnpm vitest run tests/embedding-degradation-alert.test.ts→ 5/5 pass. No new type errors from these files.