ADR 0007: Frontend Coverage Gate in CI and Pre-Push¶
Status¶
Accepted
Problem¶
Frontend tests existed, but CI and pre-push only enforced pass/fail execution. This allowed untested React/TypeScript paths to grow without a measurable coverage floor.
Non-goals¶
- Enforcing per-file coverage thresholds.
- Introducing snapshot-heavy UI testing patterns.
- Replacing Python coverage policy.
Decision¶
Add deterministic frontend coverage enforcement using Vitest v8 coverage:
- add
@vitest/coverage-v8towebdev dependencies - add
test:coveragescript inweb/package.json - configure coverage thresholds in
web/vitest.config.ts - enforce
test:coveragein CI frontend job - enforce
test:coveragein Python pre-push quality runner
Public API¶
No external runtime API changes.
Developer workflow changes:
npm run --prefix web test:coveragemake web-coveragemake checknow includes frontend and native quality gates
Invariants¶
- frontend coverage gate must run in CI on push and pull request
- local pre-push must run the same coverage command as CI
- threshold configuration must live in versioned frontend test config
Test plan¶
- contract tests assert CI workflow uses
test:coverage - contract tests assert pre-push runner uses
test:coverage - contract tests assert vitest thresholds and coverage dependency are present
- frontend unit tests cover success and failure paths for API and UI flows