You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Burn down coverage-based CRAP findings and make the touched-function check blocking #3414
#3408 made CRAP come from measured test coverage. The first whole-repo report on main (Coverage job on 5f84627d8, pnpm check:coverage-crap --all) lists 59 functions at or above CRAP 30, 49 of them at 0% coverage. This umbrella burns that list down, then makes the check blocking for the functions a PR touches.
CRAP = CC² × (1 − coverage)³ + CC. A function at CC ≤ 4 can never reach 30, and full coverage reduces the score to CC. So a finding is fixed by testing its uncovered branches through the owning module's real entry point, or by splitting it when CC itself is ≥ 30 (docs/agents/testing.md: no test-only exports or test-only DI).
pnpm test:coverage # writes coverage/coverage-istanbul.json
pnpm check:coverage-crap --all # every function >= 30
pnpm check:coverage-crap --base origin/main # only functions the branch touches
A child is done when its functions are absent from --all on its PR head, and CI's Report coverage-based CRAP step lists no touched function.
Children
Each child owns disjoint files and ships one PR (Closes #<child>).
Run at most two implementation workers at once. Serialize full gates (pnpm check:affected --run, pnpm test:coverage) across the machine (AGENTS.md: concurrent suites cause contention timeouts).
The H2 PR patches @vitest/coverage-v8 so the wrapper offset no longer depends on merge order, and ast-v8-to-istanbul so async implicit-else counts come out right.
It doesn't clamp or zero counts and adds no application-code workarounds. The sanitizer keeps dropping a whole file it can't trust, and the vitest#11541 wording is corrected.
The upstream issues are drafted for the maintainer to file.
The six files are re-scored, and any new findings ≥ 30 get routed as follow-ups.
G2: split session-state.ts. The dispatcher, the boot and shutdown handlers, and the app-state selection, response and query paths each get their own function.
G3: split the http-server.ts request-end handler into envelope parsing, authorized request preparation, and invocation/response. One owner keeps request lifetime, cancellation and cleanup.
Every touched function scoring ≥ 30 blocks the PR, using rename-aware changed-line attribution.
Missing, stale, partial or corrupt coverage fails with "no trustworthy verdict."
The two file-wide exemptions are listed with their scope.
main stays report-only.
It turns on after G and the re-scored inventory are done.
Optional review suggestions on merged child PRs: per-area follow-ups after I. Wall-clock flakiness, shared scenario state and ineffective assertions come first; cosmetic items are dropped.
Order: H2 + G1, then G2 + G3, then I. At most two workers at a time.
Purpose
#3408 made CRAP come from measured test coverage. The first whole-repo report on
main(Coverage job on5f84627d8,pnpm check:coverage-crap --all) lists 59 functions at or above CRAP 30, 49 of them at 0% coverage. This umbrella burns that list down, then makes the check blocking for the functions a PR touches.CRAP = CC² × (1 − coverage)³ + CC. A function at CC ≤ 4 can never reach 30, and full coverage reduces the score to CC. So a finding is fixed by testing its uncovered branches through the owning module's real entry point, or by splitting it when CC itself is ≥ 30 (
docs/agents/testing.md: no test-only exports or test-only DI).A child is done when its functions are absent from
--allon its PR head, and CI's Report coverage-based CRAP step lists no touched function.Children
Each child owns disjoint files and ships one PR (
Closes #<child>).platform-applecore (launch diagnostics, CoreDevice, install artifact) — test(platform-apple): cover core launch diagnostics, CoreDevice normalization, runner-file copy, and IPA hint resolution #3434platform-applemacOS host provider and xctestrun products — test(platform-apple): cover macOS host app discovery and xctestrun product collectors #3435Sequencing
pnpm check:affected --run,pnpm test:coverage) across the machine (AGENTS.md: concurrent suites cause contention timeouts).platform-apple/src/os/macos/host-provider.ts(CRAP: platform-apple macOS host provider and xctestrun products #3418) andcore/app-launch.ts/os/macos/helper.ts(CRAP: find why 6 files are unscored (vitest#11541 negative counts) #3425). Rebase onto it, or coordinate, before editing those files.Rules for every child
docs/agents/testing.md). Test helpers go in*.fixtures.ts.docs/agents/pull-requests.md). Runpnpm check:affected --runon the pushed head.