The last deep-tail item: bin/cli.ts — 3,520 lines, 32 commands, 106 options — called cli.parse() at import time, so nothing could import it and every test had to spawn a subprocess. That's exactly why the audit's flag-shaped drift (defaults shadowing config, documented-but-unwired flags) always lived here: the wiring layer was unreachable by any in-process assertion.
What changes
bin/cli.ts — two lines of substance: cli.parse() moves behind import.meta.main, and cli is exported (with the explicit annotation isolatedDeclarations demands). Direct execution is byte-for-byte unchanged; importing now just registers commands.
test/cli-wiring.test.ts (11 tests) — pins what the subprocess smoke suite can't see:
- the exact 32-command surface, as a literal list — a renamed or dropped command fails loudly
- every command and every option carries a description (the docs invariant, enforced)
initaliasessetup; the global--configis wired- no
--strategyflag anywhere carries a CAC default — #1441's config-shadowing regression, now guarded in-process — and exactly{check, scan, schedule, update}take the flag - real
parse(argv, { run: false })runs: flag values land,--no-respect-latestnegates, omitted flags surface their declared defaults, positionals are captured
Coverage
bin/cli.ts enters the measured world for the first time: 0% → its registration surface (9.25% lines — the wiring, which is what these tests are about; action bodies remain subprocess territory). Overall stands at 91.8% functions / 91.0% lines now that the file's 3,520 lines are in the denominator at all.
Full suite 2395 pass / 0 fail across 146 files; the subprocess suite still passes unchanged — the guard didn't alter executed behavior.
🤖 Generated with Claude Code