(ci): c8 coverage + patch-coverage gate (80% on changed lines) - #51
Merged
Conversation
- c8 (devDep) wraps node --test; `npm run coverage` / `task coverage` emit text + lcov to ./coverage (gitignored). - .c8rc.json excludes the Electron-only layer that node:test cannot exercise (main.js, preload.js, mcp-bridge.js, claude-auth.js, the DOM glue, bundles, workers, scripts). - .github/workflows/test.yml: run coverage on both Node versions; gate PRs with diff-cover at 80% on CHANGED lines only (Node 22). A global threshold is meaningless here — main.js alone is 2047 LOC of untestable IPC/native code; patch coverage gates new work without that noise. Prereq #50 (suite no longer hangs) makes coverage measurable. Validated locally: lcov produced, gate command passes on this infra-only diff.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
c8(devDep) wrapsnode --test;npm run coverage/task coverageemit text + lcov to./coverage(gitignored)..c8rc.jsonexcludes the Electron-only layer node:test can't exercise (main.js, preload.js, mcp-bridge.js, claude-auth.js, DOM glue, bundles, workers, scripts)..github/workflows/test.yml: coverage on both Node versions; diff-cover gate at 80% on CHANGED lines only (Node 22, PRs).Why patch coverage, not global
A global threshold is meaningless here —
main.jsalone is 2047 LOC of untestable IPC/native code. Patch coverage gates new work without that noise. Builds on #50 (suite no longer hangs → coverage measurable).Validated locally: lcov produced; diff-cover gate command passes on this infra-only diff (no .js logic changed).
Generated with Claude Code