You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Four Playwright smoke tests in the document viewer were failing in CI. Two distinct root causes.
Root causes and fixes
1. Duplicate document-overview DOM ID
DocumentClinicalSummary had id="document-overview" on its outer <article>, duplicating the same anchor already set on the wrapping <div> in DocumentViewer.tsx. The expectDomIntegrity() helper caught this as a duplicate-ID violation.
Fix: Removed id="document-overview" and the now-redundant scroll-mt-24 from document-clinical-summary.tsx. The scroll anchor is provided by the parent wrapper in DocumentViewer.
2. Tests targeting a retired navigation pattern
Tests were asserting on <nav aria-label="Document viewer sections"> with <a> link elements (Evidence, PDF, Text). That nav was replaced by a title-trigger + sheet pattern.
Fix: Updated tests to drive navigation via data-testid="document-section-trigger" → document-section-sheet → getByRole("button", { name: /.../ }).
3. Demo doc Images not in section sheet
Demo documents have no extracted visuals, so Tables and diagrams is omitted from the sheet index. The test was trying to navigate to it via the sheet.
Fix: Test now opens the #source-images<details> directly via its <summary> element.
Verification
npm run verify:pr-local
During development, use npm run verify:cheap as the faster iteration gate before the final PR-local preflight.
npm run verify:ui when UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changed
npm run verify:release before release or handoff confidence claims
For retrieval, ranking, selection, chunking, source/citation rendering, or answer-contract changes, verify:pr-local runs eval:rag:offline automatically. Run the offline command directly during iteration before spending a live eval.
npm run eval:retrieval:quality (must stay 36/36) when retrieval, ranking, selection, chunking, or scoring behavior changed — CI cannot run it (needs live keys), so run it locally and paste the summary. A metadata/governance-weighting change once buried correct docs (recall 1.0→0.76) and only this eval caught it.
npm run eval:rag -- --limit 15 + npm run eval:quality -- --rag-only when answer generation, the synthesis prompt, or answer post-processing changed (grounded-supported must not drop; citation-failure 0)
npm run check:production-readiness when clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior changed
npm run check:deployment-readiness when deployment startup, hosting, or rollout behavior changed
npm run verify:ui not run: changes are test-alignment fixes with no UI behavior change; the duplicate-ID removal does not alter rendered output.
Risk and rollout
Risk: None — removes a duplicate ID attribute and updates test selectors to match current implementation
Rollback: Not required
Provider or production effects: None
Clinical Governance Preflight
Not applicable — no ingestion, answer generation, ranking, source rendering, document access, privacy, or clinical output changes.
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 ↗︎.
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
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.
Four Playwright smoke tests in the document viewer were failing in CI. Two distinct root causes.
Root causes and fixes
1. Duplicate
document-overviewDOM IDDocumentClinicalSummaryhadid="document-overview"on its outer<article>, duplicating the same anchor already set on the wrapping<div>inDocumentViewer.tsx. TheexpectDomIntegrity()helper caught this as a duplicate-ID violation.Fix: Removed
id="document-overview"and the now-redundantscroll-mt-24fromdocument-clinical-summary.tsx. The scroll anchor is provided by the parent wrapper inDocumentViewer.2. Tests targeting a retired navigation pattern
Tests were asserting on
<nav aria-label="Document viewer sections">with<a>link elements (Evidence,PDF,Text). That nav was replaced by a title-trigger + sheet pattern.Fix: Updated tests to drive navigation via
data-testid="document-section-trigger"→document-section-sheet→getByRole("button", { name: /.../ }).3. Demo doc
Imagesnot in section sheetDemo documents have no extracted visuals, so
Tables and diagramsis omitted from the sheet index. The test was trying to navigate to it via the sheet.Fix: Test now opens the
#source-images<details>directly via its<summary>element.Verification
npm run verify:pr-localDuring development, use
npm run verify:cheapas the faster iteration gate before the final PR-local preflight.npm run verify:uiwhen UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changednpm run verify:releasebefore release or handoff confidence claimsFor retrieval, ranking, selection, chunking, source/citation rendering, or answer-contract changes,
verify:pr-localrunseval:rag:offlineautomatically. Run the offline command directly during iteration before spending a live eval.npm run eval:retrieval:quality(must stay 36/36) when retrieval, ranking, selection, chunking, or scoring behavior changed — CI cannot run it (needs live keys), so run it locally and paste the summary. A metadata/governance-weighting change once buried correct docs (recall 1.0→0.76) and only this eval caught it.npm run eval:rag -- --limit 15+npm run eval:quality -- --rag-onlywhen answer generation, the synthesis prompt, or answer post-processing changed (grounded-supported must not drop; citation-failure 0)npm run check:production-readinesswhen clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior changednpm run check:deployment-readinesswhen deployment startup, hosting, or rollout behavior changednpm run verify:uinot run: changes are test-alignment fixes with no UI behavior change; the duplicate-ID removal does not alter rendered output.Risk and rollout
Clinical Governance Preflight
Not applicable — no ingestion, answer generation, ranking, source rendering, document access, privacy, or clinical output changes.
Notes