Files
msd-core/.changeset/3733-lint-test-file-count.md
Tom Boucher 6313baad63 chore(tests): lint rule — cap test files per production module at 2 (#3738)
* chore(tests): lint rule — cap test files per production module at 2

Adds scripts/lint-test-file-count.cjs with a ratcheted allowlist
(scripts/lint-test-file-count.allowlist.json) capturing today's
30 violating clusters as a ceiling. New entries blocked at PR time;
reductions ratchet automatically.

Wires into .github/workflows/test.yml as a new step in lint-tests.

Refs #3737

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore(tests): add docs-exempt to changeset fragment

Internal CI lint rule — no user-facing docs impact.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 20:37:07 -04:00

1.1 KiB
Raw Blame History

type, pr
type pr
Added 3733

New CI lint rule lint-test-file-count prevents per-feature test-file proliferation — a recurring pattern where one production module (e.g. phase.cjs, init.cjs) accumulates 5–20 separate test files over time as PRs add issue-stamped files (bug-NNNN-*.test.cjs, feat-NNNN-*.test.cjs) next to an existing primary. The rule scans sdk/src/query/, sdk/src/, get-shit-done/bin/lib/, and bin/ for production modules, then counts matching test files in tests/ and sdk/src/**/. Each module is capped at 2 (primary + one integration). Existing over-limit clusters are frozen in scripts/lint-test-file-count.allowlist.json at their current count (30 modules; phase is the worst at 20 files). The allowlist ratchets downward automatically — reducing a cluster is always allowed; increasing it requires a PR-description justification. Added "lint:test-file-count" npm script and a Lint — test file count per module step in the lint-tests CI job.