forked from molecule-ai/molecule-core
[Molecule-Platform-Evolvement-Manager] Closes step 1+2 of #1815. Step 3 (CI gate + threshold) is split into a follow-up because today's baseline is ~46% lines / ~45% statements, not the 70% the issue's draft thresholds assumed. ## What this lands - `canvas/vitest.config.ts` — `coverage` block with v8 provider, reporters: text (terminal) / html (./coverage/index.html) / json-summary (machine-readable for tooling). NO threshold — pure observability. - `canvas/package.json` — adds `test:coverage` script (`vitest run --coverage`); existing `test` script is unchanged so the default workflow is identical. - `canvas/package-lock.json` — adds @vitest/coverage-v8@^4.1.5 (the v8 provider Vitest uses for native coverage). ## Why no threshold yet Issue draft threshold was 70%/70%/65%/70% (lines/funcs/branches/stmts). Local baseline today: ``` Statements : 45.19% (3248/7186) Branches : 39.87% (2034/5101) Functions : 40.99% (724/1766) Lines : 46.36% (2905/6265) ``` Turning on a 70% gate today would either fail CI immediately or get papered over with an ad-hoc exclude list. Better path: land observability now, run coverage in PR review for any new code (via the new script), gate later when the baseline catches up. ## Heatmap (from local run, top gaps) - `src/lib/runtime-names.ts` — 0% (untouched by tests) - `src/lib/utils.ts` — 0% - `src/lib/canvas-actions.ts` — 25% - `src/store/classNames.ts` — 17% - `src/store/canvas.ts` — 73% (already-tested but the largest absolute gap by lines) Each is a concrete follow-up issue / PR target. ## Test plan - [x] `npx vitest run --coverage` runs cleanly locally (~10s) and produces `./coverage/index.html` + a `coverage-summary.json` - [x] Existing `npm run test` workflow unchanged — instrumentation only activates with `--coverage` flag - [x] No production-code changes — pure tooling addition ## Follow-ups (each tracked separately; this PR keeps minimal scope) - Step 3a — write tests for the 0% files above (~tiny each) - Step 3b — once baseline ≥ thresholds, add `thresholds` block to vitest.config.ts + a `npm run test:coverage` step in `.github/workflows/ci.yml`'s Canvas job 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| e2e | ||
| public | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| components.json | ||
| Dockerfile | ||
| next.config.ts | ||
| package-lock.json | ||
| package.json | ||
| playwright.config.ts | ||
| playwright.staging.config.ts | ||
| postcss.config.js | ||
| tailwind.config.ts | ||
| tsconfig.json | ||
| vitest.config.ts | ||