perf: add fresh coverage scope pilot for mutation testing

Merged
TH
1mo ago
+728-22

Summary

Depends on #3475. Add an opt-in local coverage-scope pilot: a fresh whole-module probe selects runtime-covering test files for subsequent fresh mutation runs. Match module, epoch, seed, repository inputs, toolchain and environment; reject invalid explicit indexes.

Add reproducible fast-check seeds and scope/producer-cost reporting. Keep weekly and PR defaults broad; defer cross-run indexes, incremental results and static audits. Register the actual Stryker/Vitest hooks as test-framework entrypoints. Scope: 15 mutation tooling/configuration files.

Run pnpm mutation:run --help for the protocol and rollout criteria.

Validation

  • pnpm check:affected --run passed at 617b5f4737579ba0bc0d7e0f13cecdf9af1d09bb; mutation harness: 64/64 tests, including Node 22.12 with inherited environment state. Real Stryker verifies reporter loading without TypeScript flags; rebased fixtures use test-kit.
  • Missing provenance check planted: 62 pass / 1 fail; restored: 63 pass.
  • Seeded macOS canary measurement before final refactoring: all 390 identities preserved, no lost kills or additional uncovered mutants. One hit-limit timeout became an assertion kill; other 389 outcomes matched.
  • Consumer: 363s broad → 262s scoped (28% faster). Fresh producer: 145s; first producer-plus-consumer is 407s (12% slower). Costs must amortize across consumers.
  • Current CI passed all 17 selected shards and aggregation: 4,995 unique identities, zero harness errors. Five error shards preserve 391 identities; slowest 16m57s versus a prior deadline failure. All CI passed; no open review threads. Full same-head Ubuntu parity and net runner-minute/critical-path measurements are required before CI defaults change.