Goal
Bring every server up to the ≥ 90% per-file test-coverage gate used in the inspector repo, enforce it in tooling, and then reintroduce the rule into AGENTS.md — #4473 deliberately deferred it so the rule wouldn't be aspirational fiction on day one. Once this issue lands, the rule is true and stays true.
- Per-file threshold of ≥ 90 on all four dimensions: lines, statements, functions, branches
- Genuinely-unreachable branches are not waved through by lowering the gate — they get a justified inline ignore at the source (
/* v8 ignore ... -- <reason> */ for TS; # pragma: no cover # <reason> for Python)
- Coverage is a separate, deliberate command (
npm run coverage), not baked into the fast validate loop — mirroring inspector's split (validate = fast unit tests; coverage = instrumented gate)
Scope
TypeScript servers (vitest + @vitest/coverage-v8 already in place):
Python servers (pytest + pyright + ruff in place; coverage tooling TBD):
fetch, git, time
- Add
pytest-cov/coverage.py; note coverage.py's fail_under is global, not per-file — pick the per-file enforcement mechanism as part of this work (e.g. coverage json + a small check script, matching the TS gate's semantics)
uv run coverage equivalent documented per server
Tasks
Dependencies
Acceptance
Goal
Bring every server up to the ≥ 90% per-file test-coverage gate used in the inspector repo, enforce it in tooling, and then reintroduce the rule into
AGENTS.md— #4473 deliberately deferred it so the rule wouldn't be aspirational fiction on day one. Once this issue lands, the rule is true and stays true.The gate (per the inspector v2/main reference)
/* v8 ignore ... -- <reason> */for TS;# pragma: no cover # <reason>for Python)npm run coverage), not baked into the fastvalidateloop — mirroring inspector's split (validate = fast unit tests; coverage = instrumented gate)Scope
TypeScript servers (vitest +
@vitest/coverage-v8already in place):everything,filesystem,memory,sequentialthinkingcoverage.thresholdswithperFile: true, 90 across lines/statements/functions/branches) in each server's vitest confignpm run coveragechaining the per-workspace coverage runs (companion to Adopt AGENTS.md (with CLAUDE.md pointer) modeled on the inspector repo #4473'svalidatechain)Python servers (pytest + pyright + ruff in place; coverage tooling TBD):
fetch,git,timepytest-cov/coverage.py; note coverage.py'sfail_underis global, not per-file — pick the per-file enforcement mechanism as part of this work (e.g.coverage json+ a small check script, matching the TS gate's semantics)uv run coverageequivalent documented per serverTasks
coveragescript (TS chain) + per-server Python invocationvalidatein CI and keeps the coverage gate local-only — adopt the same unless there's a reason not toAGENTS.md("Always test new or modified code" section): per-file ≥ 90 on all four dimensions, justified-ignore policy,coveragevsvalidatesplit — wording adapted from the inspector referenceDependencies
Acceptance
npm run coverageAGENTS.mdstates the rule, and the rule is true on the day it's stated