chore(#3339): extend BUG_FILE_RE to fix-/issue- prefixes, close H3 (#3315)

Widens the identity ratchet in scripts/lint-regression-test-names.cjs
from banning only new bug-NNNN-*.test.cjs files to also banning
fix-NNNN-*.test.cjs and issue-NNNN-*.test.cjs, per epic #3053's own
recorded decision: extend only after the 74-file fix-*/issue-* backlog
fully drains, never before.

That precondition is now real, not assumed: this branch is rebased
onto origin/next with Waves 1-6 (#3341, #3342, #3373, #3376, #3378,
#3383) all merged, and a repo-wide check confirms zero tests/fix-*.test.cjs
or tests/issue-<N>-*.test.cjs files remain -- only the two known false
matches (issue-dedupe.test.cjs, issue-version-gate.test.cjs, feature-named
suites with no digits after the prefix) survive the glob, and the widened
regex correctly excludes both.

Allowlist snapshotted at zero (scripts/lint-regression-test-names.allowlist.json
was already [] and stays [] -- confirmed via --update reporting "already
in sync"). Updated docs/TESTING-SUITES.md's Regression tests section to
name fix-/issue- alongside bug- as banned new-file prefixes.

This is the last commit of H3 (#3315)'s 7-wave decomposition.
This commit is contained in:
sim
2026-08-12 08:28:17 -04:00
parent c70e736c85
commit 23e26a9de8
2 changed files with 23 additions and 18 deletions

View File

@@ -33,7 +33,8 @@ The suite-suffix convention was chosen over a directory layout (`tests/security/
## Regression tests
**Do not create new top-level `tests/bug-NNNN-*.test.cjs` files.** Add the
**Do not create new top-level `tests/bug-NNNN-*.test.cjs`,
`tests/fix-NNNN-*.test.cjs`, or `tests/issue-NNNN-*.test.cjs` files.** Add the
regression case to the owning module's main test file instead (e.g. a
`describe('regressions')` block in `tests/<module>.test.cjs`).
@@ -42,14 +43,16 @@ count — is the unit of CI overhead, and it is worst on Windows lanes where
every spawn is Defender-scanned. The 2026-06 CI audit found 244 one-off
`bug-*` files (~38% of the suite). That population is grandfathered in
`scripts/lint-regression-test-names.allowlist.json` and enforced by an
identity ratchet (`npm run lint:regression-names`, part of `npm run lint:ci`):
identity ratchet (`npm run lint:regression-names`, part of `npm run lint:ci`),
which also bans `fix-*` and `issue-*` NNNN-prefixed files the same way:
- A **new** `bug-*` file fails CI — fold it into the owning module's file.
- A **new** `bug-*`, `fix-*`, or `issue-*` NNNN-prefixed file fails CI — fold
it into the owning module's file.
- **Deleting/consolidating** a grandfathered file requires pruning its
allowlist entry, so the baseline only ever shrinks.
- **Inherited drift** (the failure names files your PR didn't add — e.g. the
base branch merged `bug-*` files without feeding the allowlist, or you
rebased and carried a pre-rebase allowlist): run
base branch merged `bug-*`/`fix-*`/`issue-*` files without feeding the
allowlist, or you rebased and carried a pre-rebase allowlist): run
`node scripts/lint-regression-test-names.cjs --update` and commit the
regenerated allowlist. Snapshot artifacts like this allowlist (and
`docs/INVENTORY.md`) must be regenerated **after** rebasing, never carried