✨ feat(agnipariksha): a .test.mjs suite owns its .mjs source

Merged
AT
11d ago
+77-16

agnipariksha finds a source's owner among .test.ts and .test.tsx only, so a .mjs source with a .test.mjs beside it is "not judged (no colocated suite)". No lane can judge veda's scripts/*.mjs today. This adds .test.mjs as the third colocated suffix, in suite-owner.ts, the one file in src/ that matches suite names (reuse-key.ts's TEST_FILE already took .mjs).

  • Owners. suiteCandidatesFor lists <stem>.test.mjs last for every source, .ts included. A source that has an owner today keeps it: a .ts keeps .test.ts, and a .js or .mjs with a .test.ts, such as shuddhi's hermetic-git.js, keeps the .test.ts.
  • Siblings. siblingSuites and its own-source check read one suite ending, \.test\.(?:tsx?|mjs)$. So <stem>-cases.test.mjs and <stem>.e2e.test.mjs are now named as siblings, and a .test.mjs beside a source of its own is left out. .test.js, .test.mts, .test.cjs and .test.mjsx stay out.
  • README. It says which suffixes own which sources, in what order.
  • Tests.
    • An .mjs source is owned by its .test.mjs.
    • A .js source with both suites takes the .test.ts.
    • The near-miss endings do not own.
    • The sibling rules hold with .mjs.
    • planLane makes a scripts/*.mjs a target through its .test.mjs.

Once a lane pins this release (#327), these suites gain owners: scripts/fresh-tmpdir.test.mjs, githooks.test.mjs, own-provenance.test.mjs, released-pins.test.mjs, sarathi-hook.test.mjs and version-rule.test.mjs.

The version bump follows in a release PR once this merges, as #338 did. v0.8.3 is untagged and kavach and sarathi already sit at it, so the next legal version is set when the release PR opens.

Slice: #325

🤖 Generated with Claude Code


Summary by cubic

Adds .test.mjs as the third colocated suite suffix so .mjs sources are judged through their .test.mjs instead of being reported as "not judged (no colocated suite)".

  • .test.mjs lists last among a source's suite candidates, so any source that already has a TypeScript suite (.test.ts or .test.tsx) keeps it.
  • Sibling and own-source detection now recognize .test.mjs endings, naming -cases.test.mjs and .e2e.test.mjs as siblings while .test.js, .test.mts, .test.cjs, and .test.mjsx stay out.
  • README documents the ownership order, and tests cover .mjs ownership, TypeScript preference, near-miss endings, and planLane targeting.