Lands L3 of the agent-first coverage architecture (ADR-020) — the
mutation-testing layer. Stryker on entities + use-cases (the pure
business-logic surface) catches the third dimension of test quality:
tests that exist + execute the code but assert nothing.
Deps (root devDependencies):
- @stryker-mutator/core ^8.7.0
- @stryker-mutator/vitest-runner ^8.7.0
Shared base: packages/core-testing/stryker.base.json
- testRunner: vitest (uses each feature's vitest.config.ts)
- mutate: src/entities/** + src/application/use-cases/** (excludes
tests, factories, contracts)
- thresholds: high 90 / low 80 / break 80
- reporters: progress + html + json (reports/mutation/{index.html,
mutation.json})
- incremental mode enabled, concurrency 4, timeout 10s
- exposed via @repo/core-testing/stryker.base.json subpath export
Per-feature config: packages/auth/stryker.config.json
- 4-line file that extends the shared base
- Proof-of-concept; other features get a config when L0 unification
closes their existing test gaps
Driver: scripts/coverage/mutate.mjs (zero-dep Node ESM)
- discoverStrykerConfigs: walks packages/* and apps/* for
stryker.config.json
- Supports --filter <name>, --since <ref> (incremental), --json
- Runs Stryker per-feature via node_modules/.bin/stryker run
- Surfaces per-package pass/fail summary; exits 1 on any failure
- Tests: scripts/coverage/mutate.test.mjs (3 tests, all green)
CI: .github/workflows/mutation-nightly.yml
- Cron at 02:30 UTC + workflow_dispatch with filter input
- Uploads reports/mutation/** as artifact (30-day retention)
- On failure, opens a tracking issue labelled mutation-testing
- permissions: contents: read, issues: write
- 60-min timeout (Stryker is slow by design)
Generator: turbo gen feature now scaffolds stryker.config.json from
turbo/generators/templates/feature/stryker.config.json.hbs — new
features ship mutation-ready out of the box.
Guide: docs/guides/coverage.md L3 section fleshed out with run
syntax, config shape, base config inventory, CI behavior, and a
"what you're looking for" primer on mutation scores.
Lockfile churn: pnpm regenerated the lockfile for the new deps;
~5K-line net reduction is collateral (pnpm version drift) but
mechanical.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
51 lines
1.7 KiB
JSON
51 lines
1.7 KiB
JSON
{
|
|
"name": "template",
|
|
"private": true,
|
|
"packageManager": "pnpm@9.15.4",
|
|
"engines": {
|
|
"node": ">=20"
|
|
},
|
|
"scripts": {
|
|
"build": "turbo run build",
|
|
"dev": "turbo run dev",
|
|
"lint": "turbo run lint",
|
|
"test": "turbo run test",
|
|
"test:e2e": "turbo run test:e2e",
|
|
"test:stories": "turbo run test:stories",
|
|
"test:visual": "pnpm --filter @repo/storybook exec concurrently -k -s first -n 'SB,VRT' -c 'magenta,blue' 'pnpm --filter @repo/storybook exec http-server storybook-static --port 6006 --silent' 'pnpm --filter @repo/storybook exec wait-on tcp:6006 && pnpm exec playwright test'",
|
|
"typecheck": "turbo run typecheck",
|
|
"conformance": "node scripts/conformance.mjs",
|
|
"coverage:diff": "node scripts/coverage/diff.mjs",
|
|
"coverage:aggregate": "node scripts/coverage/aggregate.mjs",
|
|
"mutate": "node scripts/coverage/mutate.mjs",
|
|
"fallow": "fallow",
|
|
"fallow:audit": "fallow audit --base main",
|
|
"work": "node scripts/work/cli.mjs",
|
|
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
|
|
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,md}\"",
|
|
"prepare": "husky"
|
|
},
|
|
"devDependencies": {
|
|
"@ai-hero/sandcastle": "*",
|
|
"@playwright/test": "^1.49.0",
|
|
"@stryker-mutator/core": "^8.7.0",
|
|
"@stryker-mutator/vitest-runner": "^8.7.0",
|
|
"@turbo/gen": "^2.4.0",
|
|
"@types/node": "^22.0.0",
|
|
"fallow": "^2.73.0",
|
|
"husky": "^9.0.0",
|
|
"lint-staged": "^16.0.0",
|
|
"prettier": "^3.5.0",
|
|
"turbo": "^2.4.0",
|
|
"typescript": "^5.8.0"
|
|
},
|
|
"lint-staged": {
|
|
"*.{ts,tsx,js,mjs,jsx}": [
|
|
"eslint --fix --max-warnings=0 --no-warn-ignored"
|
|
],
|
|
"*.{ts,tsx,js,mjs,jsx,json,md,yml,yaml}": [
|
|
"prettier --write"
|
|
]
|
|
}
|
|
}
|