Repository navigation
Description
Background
clients/web/vite.config.ts already lists '../../core/mcp/**/*.{ts,tsx}' and (since #1300) '../../core/react/**/*.{ts,tsx}' in coverage.include. After running npm run test:coverage, however, coverage/coverage-summary.json contains no entries for any file outside clients/web/src/ — only src/components/** and src/utils/** show up.
This means the per-file 90% / 85% / 80% / 50% threshold gate in AGENTS.md is silently not enforced for anything under core/. The condition predates #1300 — it already applied to:
core/mcp/apps.ts(from PR feat(apps): add isAppTool helper in core (#1260) #1272)core/mcp/taskNotificationSchemas.ts(from PR test(coverage): bootstrap vitest unit infra and add tests at 90%+ per file (#1245) #1269)
After #1300 it also applies to the entire ported hook layer:
- 14 hooks in
core/react/ - 13 state stores in
core/mcp/state/ core/mcp/inspectorClientProtocol.ts,inspectorClientEventTarget.ts,typedEventTarget.ts,samplingCreateMessage.ts,sessionStorage.tscore/mcp/__tests__/fakeInspectorClient.ts
Tests for every one of these files exist and pass; the gate just isn't checking them.
Likely cause
coverage.include is configured with a relative glob (../../core/...) that walks above the project root. v8's coverage collector probably normalizes paths against the project root and drops the resulting ..-prefixed entries before the reporter sees them. There may be a coverage.all / root / include interaction with vitest projects that strips these paths.
Acceptance criteria
-
npm run test:coverageemits per-file coverage rows for every.ts/.tsxfile undercore/mcp/andcore/react/that isn't excluded by the existing exclude list. - The per-file threshold gate (
perFile: true, lines ≥ 90, statements ≥ 85, functions ≥ 80, branches ≥ 50) is honored for those files — i.e. introducing an untested core file fails CI. - If any current core file falls below the gate when measured, raise its coverage or strike it from the include list with a comment explaining why.
-
coverage-summary.jsonkeys include/Users/.../core/mcp/...and/Users/.../core/react/...paths.
Out of scope
- Restructuring the project layout to move
core/insideclients/web/. - Adding workspaces.
Activity
fix(coverage): include core/ files in v8 per-file gate (#1301)
fix(coverage): include core/ files in v8 per-file gate (#1301) (#1305)