Commit f192c3b
committed
test(drivers): a conformance run that discovers zero drivers is a failure, not an OK (#4646)
check-driver-conformance discovers driver packages from disk under a hardcoded
DRIVERS_DIR. listDir swallows ENOENT and returns [], and all three invariants
iterate the discovered set — CONSUMED over `drivers`, RECONCILED over LEDGER
(empty since #4405, the intended steady state), CLASSIFIED not over drivers at
all. A stale DRIVERS_DIR therefore printed `OK — 0 covered cell(s)` and exit 0.
CI never had this exposure: lint.yml runs `pnpm check:driver-conformance`, which
is `--self-test && audit`, and the self-test carried a discovery assertion. The
false green was on the bare `node scripts/check-driver-conformance.mjs` the
script's own header documents as a usage.
Leaving the guard there was wrong twice over. It read
`drivers.length >= 3 && drivers.includes('driver-sql')` — a hardcoded name and
count inside the one script whose stated rule is that drivers come from disk and
are never listed, so both wanted hand-editing on the next driver added or
package moved, which is when the guard earns its keep. And its failure text
named neither DRIVERS_DIR nor the stale path.
DISCOVERED is now a fourth invariant in audit(), and its message names the
directory searched. The self-test drives the invariant in both directions
instead of standing in for it, and asserts nothing about which drivers exist.
The case-set axis cannot rot this way and is left alone: CASE_SETS is a declared
expectation, so a vanished spec/src/data fails CLASSIFIED's reverse direction
with one error per case-set. The driver axis is disk-discovery with nothing
declared to reconcile against — that asymmetry is why zero was reachable on one
axis and not the other, and it is what DISCOVERED supplies.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VTj56JLhVk585TA8Ez3yGK1 parent 0a936ea commit f192c3b
2 files changed
Lines changed: 72 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
37 | 46 | | |
38 | 47 | | |
39 | 48 | | |
| |||
157 | 166 | | |
158 | 167 | | |
159 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
160 | 190 | | |
161 | 191 | | |
162 | 192 | | |
| |||
217 | 247 | | |
218 | 248 | | |
219 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
220 | 253 | | |
221 | 254 | | |
222 | 255 | | |
| |||
370 | 403 | | |
371 | 404 | | |
372 | 405 | | |
373 | | - | |
374 | | - | |
375 | | - | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
376 | 412 | | |
377 | 413 | | |
378 | 414 | | |
| |||
0 commit comments