Remove 63 dead duplicate dose records, and guard against regrowth - #12
Merged
Conversation
Committing work found complete and uncommitted in the working tree. Not authored in this session — recorded as its own commit so it stays separate from the protocol-data changes that follow. UI pass across 15 files, net -121 lines: removes redundant `dark:` variants where the base class already resolves correctly, adds focus-visible ring offsets, drops a backdrop-blur, and applies whitespace-nowrap to the footer strapline. Removes the RecentTestingActivity dashboard component and its test; no references remain. Verified before committing: tsc clean, full suite green at 98 files / 851 tests. Untracked items deliberately left alone: .github/agents/, .github/hooks/, .github/skills/ and four home-*.png screenshots. Those look like local tooling and visual-review artefacts rather than part of this change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
dreamOnlyProtocols.ts held 109 records but drugMasterlist.ts referenced only 46. The other 63 were dead copies of drugs since migrated to SCRATCH — Cefepime, Ceftriaxone, Cefotaxime, Alfentanil, Azithromycin, Chlorhexidine and more — left behind as each tranche moved a drug from findDreamOnly to findGenerated. Nothing read them, so no test covered them and SCRATCH's clinical sign-off gate did not apply. They could drift from the source of truth silently, and someone correcting a dose could edit the dead copy, see no effect, and believe it fixed. That is precisely the duplication this whole project exists to eliminate, regrowing one tranche at a time — with 28 SCRATCH pages still to migrate, it would have kept growing. Pruned to exactly the 50 referenced records (46 three-argument references plus 4 two-argument ones for drugs with an empty protocolLabel: Atropine, IV Contrast, Methylene Blue, Methoxybenzylpenicillin). Verified 0 unreferenced and 0 referenced-but-missing, in both directions. The guard matters more than the deletion: a new test fails when dreamOnlyProtocols.ts contains an unreferenced record. Proven by re-adding a dead Cefepime entry — it failed and named the record. Without this the problem simply returns. Ordering untouched: 117 positions, 0 mismatches. DREAM selects protocol variants by array index, so a shift would silently re-point a saved clinical plan at a different dose. tsc, lint, build clean. 854 tests across 98 files. Coverage 78.8/70.9/72.8/80.0 against thresholds 76/67/67/79. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
CI caught these; I did not. When I committed the pre-existing polish work I verified tsc and the unit suite and called it green — but e2e is a separate suite and I never ran it. That gap is what let these through. Both failures trace to 51ba2a4, and in both cases the code is right and the test was wrong: 1. smoke.spec.ts — the polish commit promoted <p>The DREAM App</p> to <CardTitle as="h2">, an accessibility improvement. Playwright matches accessible names by SUBSTRING, so "The DREAM App" started matching getByRole('heading', { name: 'DREAM' }) alongside the real page heading, giving a strict-mode violation. Fixed with `exact: true` rather than reverting the heading, and commented so the next person does not reintroduce it. 2. testing-day.spec.ts — asserted "Recent Testing Activity" is visible, but that commit deleted the RecentTestingActivity component. The assertion was testing a deliberately removed feature. Removed it; reaching the dashboard is still asserted on the line above. Full chromium e2e suite now 59/59. tsc and lint clean. Co-Authored-By: Claude Opus 5 <noreply@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.
Two commits. The first is pre-existing work found uncommitted in the working tree; the second is the actual fix.
1.
polish: dashboard and chrome cleanupWork found complete and uncommitted in the working tree, not authored in this session. Committed separately so it stays distinct and is easy to revert if it was not meant to land.
UI pass across 15 files, net −121 lines: removes redundant
dark:variants where the base class already resolves, adds focus-visible ring offsets, drops a backdrop-blur, applieswhitespace-nowrapto the footer strapline. Removes theRecentTestingActivitydashboard component and its test; no references remain.Verified before committing:
tscclean, full suite green at 98 files / 851 tests.2.
fix: remove 63 dead duplicate dose recordsdreamOnlyProtocols.tsheld 109 records butdrugMasterlist.tsreferenced only 50. The other 63 were dead copies of drugs since migrated to SCRATCH — Cefepime, Ceftriaxone, Cefotaxime, Alfentanil, Azithromycin, Chlorhexidine and more — left behind as each tranche moved a drug fromfindDreamOnlytofindGenerated.Nothing read them, so no test covered them and SCRATCH's clinical sign-off gate did not apply. They could drift from the source of truth silently, and someone correcting a dose could edit the dead copy, see no effect, and believe it fixed. That is exactly the duplication this project exists to eliminate, regrowing one tranche at a time — with 28 SCRATCH pages still to migrate, it would have kept growing.
The guard matters more than the deletion
A new test fails when
dreamOnlyProtocols.tscontains an unreferenced record, and whendrugMasterlist.tsreferences one that does not exist — both directions. Proven by re-adding a dead Cefepime entry: it failed and named the record. Without it, the problem simply returns.Verification
Ordering matters because DREAM selects protocol variants by array index — a positional shift would silently re-point a saved clinical plan at a different dose.
Left untracked deliberately
.github/agents/,.github/hooks/,.github/skills/and fourhome-*.pngscreenshots — local tooling and visual-review artefacts. Probably worth gitignoring rather than committing.🤖 Generated with Claude Code