Skip to content

extend CI test-plan basename lookup to every text-reading contract test - #6384

Merged
atomantic merged 1 commit into
mainfrom
claim/issue-6363
Sep 6, 2026
Merged

extend CI test-plan basename lookup to every text-reading contract test#6384
atomantic merged 1 commit into
mainfrom
claim/issue-6363

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

  • scripts/ci-test-plan.js already had a git grep-by-basename fallback for python sidecar scripts, since Vitest's import graph can never reach them. The same gap applied to any test that reads its subject as text instead of importing it — the 30+ server/client mirror parity tests and server/lib/navManifest.test.js (which reads 20+ client files by path). A PR editing only one side of a mirror, or adding a page tab, merged green while the contract test that guards it never ran.
  • Generalizes the lookup (pythonReferencePattern/pythonContractTestssourceReferencePattern/pathContractTests) to every changed executable source. It's additive for non-python sources — an empty hit list is not an error, since those files are already reachable through the import graph or a feature directory.
  • Adds a structural rule selecting server/lib/mirrorCoverage.test.js whenever server/lib/ or client/src/lib/ changes, since that test reads directories rather than naming a file and stays unreachable even by basename.
  • Extends scripts/repo-scan-guards.test.js with a second classifier (readsUnnamedCrossRootFile) so a future text-reading guard that never names its target file can't land unreachable the same way — it must register in ALWAYS_RUN_TESTS/STRUCTURALLY_SELECTED instead.
  • Broadened the git grep pathspecs from a hardcoded *.test.js/.jsx pair to *.test.*/*.spec.* so a future .test.ts(x) contract test isn't silently missed (caught in local review).

Test plan

  • cd server && npx vitest run ../scripts/ci-test-plan.test.js ../scripts/repo-scan-guards.test.js — 55 tests pass, including the new cases for client/src/pages/Calendar.jsxnavManifest.test.js, either side of seasonStructure.jsseasonStructure.mirror.test.js, and the mirrorCoverage.test.js structural rule.
  • Verified against the live tree with real git grep (not mocked): a Calendar.jsx change finds navManifest.test.js, and a seasonStructure.js change finds seasonStructure.mirror.test.js.
  • cd server && npm test — full suite (2007 files / 39919 tests) passes.

Closes #6363

…ct test (#6363)

`scripts/ci-test-plan.js` already computed a `git grep`-by-basename fallback
for python sidecar scripts, since Vitest's import graph can never reach them.
The same gap applied to any JS-side test that reads its subject as text
instead of importing it — the server/client mirror parity tests (30+
`*.mirror.test.js` / `*.parity.test.js`) and `server/lib/navManifest.test.js`,
which reads 20+ client files by path. A PR editing only one side of a mirror,
or adding a page tab, merged green while the actual contract test never ran.

Generalizes that lookup (`sourceReferencePattern`, `pathContractTests`) from
python-only to every changed executable source, additively for non-python
sources so an empty hit list is not an error. Adds a structural rule for
`mirrorCoverage.test.js`, which reads directories rather than naming a file
and so stays unreachable even by basename. Extends
`scripts/repo-scan-guards.test.js` with a second classifier
(`readsUnnamedCrossRootFile`) so a future text-reading guard that never names
its target can't land unreachable the same way.
@atomantic
atomantic merged commit fb5969a into main Sep 6, 2026
12 checks passed
@atomantic
atomantic deleted the claim/issue-6363 branch September 6, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[code-quality-ci-plan-cross-tree-contracts] CI planner never selects the contract tests that read the other tree as text

1 participant