Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
| 2026-08-14 | PR-1964 | 1dfc0c9b984152f6518060712ab050311f3f77c9 | vitest.config.mts, docs/maturity-backlog-workorders.md (ledger #192 / maturity X6 coverage floors) | APPROVED — coverage-threshold re-ratchet, no RAG/clinical behaviour change; verify:pr-local green except pre-existing unrelated check:medication-lexicon-report staleness | test:coverage,verify:pr-local |
36 changes: 29 additions & 7 deletions docs/maturity-backlog-workorders.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -158,15 +158,37 @@ structural change, not a single mixed PR.
- **Verification:** `npm run check:drift` + the CI `db-reset-verify` replay; **live-DB work is
confirmation-required** per the AGENTS.md provider boundary.

### X6 · Raise coverage floors for clinical domains — `OPEN`
### X6 · Raise coverage floors for clinical domains — `DONE`

- **Outcome:** higher targeted thresholds where correctness matters most (clinical-safety,
retrieval, answer) than the current global 38–50%.
- **Approach:** add per-path coverage thresholds in `vitest.config.mts`; add the targeted tests
needed to clear them (ratchet up, don't drop the bar retroactively).
- **Files:** `vitest.config.mts` (+ new `tests/*` specs).
- **Risk:** MEDIUM — needs real tests, not just a threshold bump.
- **Verification:** `npm run test:coverage` meets the new per-path floors.
- **Landed (ledger #192, 2026-08-14):** `vitest.config.mts` already carried four per-domain
coverage-threshold groups — retrieval (`clinical-search`, `retrieval-selection`,
`answer-ranking`, `clinical-value-binding`, `medication-entities`,
`rag-candidate-sources`, `rag-context-selection`, `rag-retrieval-variants`,
`rag-routing`), evidence/verification (`answer-verification`, `evidence`,
`evidence-relevance`, `rag-claim-support`, `rag-evidence-gates`,
`rag-quote-verification`, `rag-source-segmentation`), core RAG/answer (`rag`,
`rag-extractive-answer`, `rag-comparison`, `rag-answer-support`), and
clinical-safety/governance (`clinical-safety`, `source-governance`, `source-review`,
`clinical-review-queue`, `answer-response`) — plus a whole-repository floor, all
CI-enforced by the required `coverage` job (`npm run test:coverage`) on every PR that
touches executable scope. This closed out most of X6 before this ledger item was
worked; re-measuring on 2026-08-14 confirmed the floors were honest (no false
failure) and found two branch thresholds that had drifted past this file's own
documented 5pp re-ratchet trigger, so those two were raised (never lowered) to
restore headroom: evidence/verification branches 81 → 84 (measured 86.04%, gap was
5.04pp) and core RAG/answer branches 72 → 76 (measured 78.22%, gap was 6.22pp). No
other value in this file needed a change — every other floor already sat within the
5pp band. No file in the four domain groups showed a genuine untested critical path:
the per-file low points were 76.4% statements (`rag-quote-verification.ts`) and 57.7%
branches (`rag-answer-support.ts`), well clear of the "under 30%" bar this ledger item
treats as scary, so no padding tests were added, per the ledger's own stop condition.
- **Files:** `vitest.config.mts`, `docs/maturity-backlog-workorders.md`.
- **Risk:** MEDIUM — needs real tests, not just a threshold bump. (No new tests were
needed this pass; the floors were already backed by real, passing coverage.)
- **Verification:** `npm run test:coverage` — 606 files / 6549 tests passed, all
thresholds green, both before and after the two branch-floor raises.

### X7 · Complete the `src/lib` domain-directory reorg — `OPEN`

Expand DownExpand Up@@ -291,7 +313,7 @@ collaborators join — `AGENTS.md` + the PR template already carry that load.
| X3 Monolith decomposition | Next | IN PROGRESS (DocumentViewer #1025 + Dashboard #1034/#1042/#1047 done; rag.ts open) |
| X4 SAST-blocking on parser | Next | **DONE** (gate + policy check) |
| X5 ACL-migration consolidation | Next | PROVIDER-GATED (DB owner) |
| X6 Coverage floors | Next | OPEN |
| X6 Coverage floors | Next | **DONE** (ledger #192) |
| X7 `src/lib` domain reorg (rest) | Next | OPEN (follow-on to X2; needs RAG flag on answer/retrieval clusters) |
| L1 Archive one-shot scripts | Later | IN PROGRESS (#1033 archived m13/july8; refs reconciled; backfills open) |
| L2 Action-SHA uniformity | Later | **DONE** (#992) |
Expand Down
19 changes: 17 additions & 2 deletions vitest.config.mts
Original file line numberDiff line numberDiff line change
Expand Up@@ -50,27 +50,42 @@ const config = {
// Aggregate behavioral floors ratchet the full post-fixture group rather
// than making individual large RAG modules brittle. Each value is the
// greater of the measured whole-group floor or the broad floor + 5pp.
// Ledger #192 (maturity X6, 2026-08-14): re-measured against
// `npm run test:coverage` on this exact file set. Group B branches (81)
// and Group C branches (72) had drifted >5pp below measured — the same
// re-ratchet trigger documented above for the whole-repo floor — so
// those two values were raised to sit ~2pp under the fresh measurement.
// Every other value here already sat within that 5pp band and is
// unchanged: raising a floor that already tracks its baseline closely
// would risk a false failure from ordinary day-to-day branch-count
// variance, not close a real gap.
"src/lib/{clinical-search,retrieval-selection,answer-ranking,clinical-value-binding,medication-entities,rag/rag-candidate-sources,rag/rag-context-selection,rag/rag-retrieval-variants,rag/rag-routing}.ts":
{
// Measured 2026-08-14: 90.32/81.02/92.86/93.88 (stmt/branch/func/line).
statements: 86,
branches: 78,
functions: 88,
lines: 90,
},
"src/lib/{answer-verification,evidence,evidence-relevance,rag/rag-claim-support,rag/rag-evidence-gates,rag/rag-quote-verification,rag/rag-source-segmentation}.ts":
{
// Measured 2026-08-14: 93.89/86.04/95.24/96.44. Branches raised
// 81 -> 84 (gap was 5.04pp, just past the 5pp trigger).
statements: 92,
branches: 81,
branches: 84,
functions: 94,
lines: 94,
},
"src/lib/rag/{rag,rag-extractive-answer,rag-comparison,rag-answer-support}.ts": {
// Measured 2026-08-14: 87.55/78.22/92.57/91.84. Branches raised
// 72 -> 76 (gap was 6.22pp, the largest in this file).
statements: 83,
branches: 72,
branches: 76,
functions: 90,
lines: 88,
},
"src/lib/{clinical-safety,source-governance,source-review,clinical-review-queue,answer-response}.ts": {
// Measured 2026-08-14: 96.72/85.11/98.73/98.95.
statements: 94,
branches: 83,
functions: 96,
Expand Down
Loading