Repository navigation
fix(coverage): skip one unreadable server map without dropping later scripts - #1422
Conversation
|
Note Live StyleProof-on-StyleProof (advisory). This report is captured from the surfaces declared in 🗺️ StyleProof reportNothing changed, so no report was uploaded. The verdict is in the run summary. Advisory-only mode: no reviewable changes detected — the StyleProof dogfood check remains green. |
|
Note Synthetic action dogfood receipt. This report is the final deliberately failing fixture in the action contract suite. It proves that unproven evidence is rejected; it does not certify this pull request. 🗺️ StyleProof report📊 View the side-by-side visual report →Coverage, determinism, report/diff consistency, or Change Reach ( |
2d59d43 to
ba0335b
Compare
…scripts readServerCoverage caught errors around the whole per-file loop, so one bad script or map discarded every later entry. Parse the file separately and skip only the failing entry. Fixes #1415.
ba0335b to
2416bac
Compare
Why
readServerCoverage()wrapped the whole per-file loop in one try/catch. If one entry threw — a missing script, asourceMappingURLwhose.mapwas not on disk, adata:map that was not base64, or a malformed map — every later entry in that coverage file was abandoned. The catch was meant for a truncated coverage JSON, not for one bad script. The result is under-reported server script reach, which Change Reach can then read as not exercised.Fixes #1415.
What changed
readCoverageEntriesreads and parses one coverage JSON file; a truncated or invalid file still contributes no execution evidence.tryResolveServerScriptcatches a bad entry so later entries in the same file are still mapped.readServerCoveragestays at or under the fallow cognitive-complexity threshold of 15.data:map, or malformed map, then another good entry: both neighbours survive. Invalid/truncated coverage JSON still supplies no evidence.Reviewer view
Proof
node --test test/server-coverage.test.mjs— red 8 passed, 4 failed (each bad-entry case keptbefore.jsand lostafter.js); green 12 passed, 0 failed. Both neighbour scripts are kept for missing-script, missing-map, invalid-data, and malformed-map cases. Invalid coverage JSON still supplies no evidence. Hooks-on pre-push on the Studio: 1254 passed, 1 skipped (11.7m).Behaviour changes
Not asked for
Review guide
readServerCoverageinbin/server-coverage.mjs.test/server-coverage.test.mjs.Verification summary
pnpm run build(test prerequisitedist/capture/map-io.js; no TypeScript was changed);pnpm exec prettier --writeon the touched files;node --test test/server-coverage.test.mjs.readCoverageEntriesandtryResolveServerScriptfor fallow). Hooks-on pre-push on the Studio: 1254 passed, 1 skipped (11.7m). Raw insertions versusorigin/mainafter prettier: 80/400 (bin/server-coverage.mjs21, tests 59). CHANGELOG is excluded from that cap.pnpm run verifyin the worktree before the hooks-on push; the Studio push ran the full pre-push suite instead.