Revert "chore: production readiness improvements and E2E fixes" - #106
Revert "chore: production readiness improvements and E2E fixes"#106BigSimmo wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:1af528ae51
ℹ️ 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".
| ) || | ||
| /\b(?:what\s+action|action\s+is\s+required|required\s+action|suspected\s+\w+\s+toxicity)\b/.test(normalized) | ||
| ) { | ||
| if (/\b(?:red|amber|green|anc|fbc|wbc|result|results|threshold|withhold|cease|stop|stopped)\b/.test(normalized)) { |
There was a problem hiding this comment.
Classify toxicity actions as red-result intent
For queries phrased like What action is required for suspected lithium toxicity? (the existing quality-lithium-toxicity-action eval case expects red_result_action), this condition no longer matches because both toxicity and the what action / action is required wording were removed. Those queries now fall through to general, so the extraction path uses generic entity overlap instead of red-result action evidence tokens and can return generic lithium/toxicity prose rather than the required action guidance.
Useful? React with 👍 / 👎.
| if (!hasRelevantQueryOverlap(sentence, query, intent)) continue; | ||
| const kind = factKindForSentence(sentence, query, intent); | ||
| if (!kind) continue; |
There was a problem hiding this comment.
Restore per-fact intent validation
Once the result-level gate admits a source, this loop now keeps any sentence that merely overlaps the query and has any fact kind. For red/ANC action queries, a sentence such as monitoring cadence can pass overlap and be ranked even though it is monitoring, not a threshold/action; the removed per-fact intent check was the guard that rejected mismatched fact kinds before answer synthesis.
Useful? React with 👍 / 👎.
| const existingGapAnswer = | ||
| !answer.grounded && | ||
| /could not find enough clean|no relevant clinical source|no current source|cannot provide a clinical answer|cannot provide a source-backed clinical answer|nearby indexed passages|not strong enough to support a reliable answer/i.test( | ||
| /could not find enough clean|no relevant clinical source|no current source|cannot provide a clinical answer|cannot provide a source-backed clinical answer/i.test( |
There was a problem hiding this comment.
Normalize nearby unsupported answers
When retrieval finds only nearby passages, the unsupported route still seeds the answer with I found nearby indexed passages, but they are not strong enough...; after this regex stopped recognizing nearby indexed passages / not strong enough, finalizeRagAnswerQuality no longer rewrites that sentinel into the specific fail-closed gap copy. That leaks source-inventory wording for unsupported-but-nearby clinical queries and also misses the quality scorer's expected fail-closed phrases such as no current source or could not find.
Useful? React with 👍 / 👎.
| if (/\b[A-Za-z]{4,}[A-Z]{2,}[A-Za-z]{2,}\b/.test(normalized)) return true; | ||
| if ((normalized.match(/>/g) ?? []).length >= 2) return true; | ||
| if (/^\s*(?:references?|bibliography)\b/i.test(normalized)) return true; | ||
| if (hasClinicalAnswerQualityIssue(normalized)) return true; |
There was a problem hiding this comment.
Keep reference boilerplate out of extractive facts
For retrieved chunks whose content is a references/bibliography block that happens to contain query terms like monitoring or dose, this function now lets the text through because the structural artifact checks for references, PubMed, randomized trial citations, contact details, etc. were removed. Those sentences can then be classified as clinical facts and cited in extractive answers instead of being filtered as non-clinical source metadata.
Useful? React with 👍 / 👎.
| <DetailLedger view={clinicalDetailView} onViewChange={setClinicalDetailView} /> | ||
| <MobileDetailList activeSection={activeMobileSection} /> | ||
| <MobileDetailList /> |
There was a problem hiding this comment.
Render only the selected mobile medication tab
On mobile medication pages, MedicationSummaryTabs still updates activeMobileSection, but the detail list no longer receives it, so every section is rendered regardless of the selected tab. Tapping Dosing/Safety/More only scrolls through a long page and leaves unrelated cards (including More/Sources) visible under every tab, which regresses the tabbed mobile workflow that this state is meant to drive.
Useful? React with 👍 / 👎.
Confirms the squash merge landed by content: the diff between squash commit f4a3f50 and branch tip bebc6c0 is empty, so nothing was orphaned by the auto-merge race despite four concurrent pushes during the merge window. Also records that the coverage follow-ups were renumbered #98/#99 -> #106/#107 (main claimed #98-#105 concurrently) with both rows verified intact, and that the three red `PR required` results were concurrency cancellations rather than defects. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YRCXgX4AWZ579bKN6sk6b
Summary
Verification
npm run verify:cheapnpm run verify:uiwhen UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changednpm run verify:releasebefore release or handoff confidence claimsnpm run format:checknpm run check:production-readinesswhen clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior changedClinical Governance Preflight
Complete this section when the change touches ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical output.
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes