test: complete Vitest 5 coverage tooling - #215
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 13, 2026, 5:04 PM ET / 21:04 UTC. ClawSweeper reviewWhat this changesAdds Vitest V8 coverage reporting, runs it in Node 26 CI, and documents development requirements without changing the published CLI’s runtime requirements. Merge readiness⛔ Blocked before merge - 2 items remain The tooling is still missing from main and v0.8.0, and the patch has no identified correctness defect. After-change coverage output remains a merge blocker. Likely related people: steipete (medium-confidence routing candidate based on prior tooling work). Priority: P3 Review scores
Verification
How this fits togetherClawpatch’s development tooling runs the TypeScript test suite locally and in CI. The coverage provider measures exercised source files and produces terminal, JSON, and HTML reports. flowchart LR
A[TypeScript source and tests] --> B[Vitest runner]
C[Local coverage command] --> B
D[Node 26 CI] --> B
B --> E[V8 coverage collection]
E --> F[Terminal and file reports]
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep coverage within the existing Vitest configuration and verify that the full suite produces the documented reports, including unimported source files. Do we have a high-confidence way to reproduce the issue? Not applicable to a reported runtime bug: this PR adds development tooling, and source inspection confirms the missing coverage setup on main. Is this the best way to solve the issue? Yes. Using the matching official coverage provider and existing CI job is a focused solution; no competing supported coverage setup was found. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6c57d8bd2adf. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Vitest 5.0.0 is already installed on main (adopted in 536acaf), but the repository had no matching coverage provider or CI coverage run, and its development instructions permitted Node versions the test runner cannot run on. This completes the tooling against the official Vitest 5 migration guide.
Adds
@vitest/coverage-v85.0.0 andpnpm test:coverage, covering all 85 production TypeScript files undersrc/, including unimported files. The Node 26 CI job runs the full suite with coverage; the existing Node 22/24 full suites and Windows execution check remain. Coverage prints a text report and writes JSON summary/HTML undercoverage/; Vitest 5's.vitest/artifacts are ignored.Development docs now distinguish Vitest's Node 22.x (22.12+), 24.x, or 26+ support from the published CLI's unchanged
engines.node >=22contract. There was no Node 25 matrix entry or third-party pool to migrate. No coverage thresholds existed; no test assertions, skips, timeouts, production code, runtime dependencies, or package version changed. The Unreleased changelog records the completed tooling. Vitest and the V8 provider resolve to 5.0.0; Vite remains 8.3.0.Validation on head
3590234d66a367e2d4f3eb3dda0c1ace372c3100:pnpm test --maxWorkers=2pnpm test:coverage --maxWorkers=2pnpm test:coverageThese local runs were on a busy shared macOS host; timings are observations, not a performance claim. The before/after comparison starts from the existing Vitest 5 baseline, not Vitest 4.
Local coverage: 89.15% statements, 82.26% branches, 91.90% functions, 89.45% lines. Verified that the JSON report includes exactly all 85 production TypeScript files, with no missing or unexpected files, and that the HTML report exists. Linux Node 26 coverage: 89.17% statements, 82.25% branches, 91.98% functions, 89.45% lines.
Frozen install, typecheck, lint, formatting, and dependency audit (zero vulnerabilities) pass. Node 26 build and built CLI
--helppass;pnpm pack:smokeinstalls the actual tarball offline and maps 13 features, including 3 CUDA features, in 43.68 seconds locally. The same packaged CLI smoke passes in CI. Independent Codex autoreview is scoped-clean through P2.Exact-head CI is green for Node 22/24/26 and Windows. CodeQL, dependency review, and secret scanning pass. No CI retries were needed.