✨ feat(agnipariksha): L-10's merge, sibling-suite and flake checks

Merged
AT
14d ago
+677-28

Slice: #183

For athya_mono work 0165, slice L-10 (athya-hq/athya_mono#3697): the three check-tier lessons whose home moved to agnipariksha when athya_mono's scripts/mutation went (athya-hq/athya_mono#3611) become the gate's own lines. None was ever built, and none regressed (athya-hq/athya_mono#3605, comment 6897151563).

Owner: AthyaBot (session for athya_mono #3697). The 0165 coordinator owns veda's release queue and gave this pull request v0.7.2 (v0.7.1 is the kavach and sarathi release, #187, now on npm). The bump is on the branch (d3f7786): agnipariksha 0.6.8 → 0.7.2, and pariksha 0.7.0 → 0.7.2 for #169, merged to main unpublished, so it ships on this tag. Alok 👍'd #183's Proposal (page: https://claude.ai/artifact/MJRfL5qETVYK28EUBsncR2). Next: merge, then tag v0.7.2.

What changes

  • An unfinished merge refuses. While MERGE_HEAD exists (git rev-parse --git-path, so a linked worktree's absolute path too), agnipariksha exits 2 before the machine lock: "Merge branch 'main' into side" (MERGE_HEAD 1a2b…) is not committed: the working tree is half-merged, so a verdict now would say nothing about the branch. Commit the merge (git commit) or abort it (git merge --abort), then run again. It runs only at pre-push, in CI and by hand, never at commit, so the way out is never itself refused.
  • A sibling suite that did not run is named. In a run narrowed to the owning suites (a lane whose env names {suites}, Lane.ownSuites; or a fallback rerun whose fallbackEnv names {suites}, Lane.fallbackOwnSuites; each file judged by the run that counts for it, LaneResult.ownSuites, c1fc846), a file with blocking mutants and a suite beside it that does not own it (<stem>-*.test.ts, <stem>.<qualifier>.test.ts, with no source of its own) gets one line: a-cases.test.ts is not the owner, so it did not run; only a.test.ts kills mutants of a.ts here: put the tests that should kill them there. Narrower than the approved row, on purpose (ede2702): under a related filter (athya_mono's app lanes and the tooling lane's first run) any suite that imports the file runs and can kill, a sibling included, so the line would be false there and says nothing. Alok sees this on #183's page before his 👍. suite-owner.ts siblingSuites is pure; the CLI reads the tracked list only when a lane blocks.
  • A flaky dry run says so. spawnStryker reads the tests Stryker logs under "One or more tests failed in the initial test run:" (failed-tests.ts, line-buffered per stream, capped). A timeout retry whose dry run fails this way refuses as flaky: retry of a.ts:3 (StringLiteral): the initial test run was flaky: it passed in the lane's run and failed in this retry on "clock is pinned"; fix the flake first (an injected, pinned clock is the usual cure), then run again, and apply each hung mutant by hand to see that it dies fast. A lane with no fallbackEnv reruns a first dry run that fails on a test once, with the same variables: a pass logs flaky: <lane>: … and its results count; a second failure refuses ("failed on both runs … fix those tests, then run again"). A MERGE_HEAD that exists but cannot be read refuses too; each stream decodes through a StringDecoder, and a line past the cap reaches the reader as its prefix only (review fixes, 43810b1). The other two dry-run failures never rerun such a lane: they are not flakes. A tooling fallback now names the tests too.
  • README: the three behaviours.

Evidence

  • pnpm --dir packages/agnipariksha check on a89aba4: 111 tests pass, 0 fail; coverage 99.41% lines, 98.93% branches, 98.73% functions (failed-tests.ts, lanes.ts, suite-owner.ts 100% lines).
  • The failed-test fixture test/fixture/stryker-failed-initial-run.txt is stock Stryker 10.1.1's real stdout (colour codes kept) from a vitest suite with one failing test, run from athya_mono; the reader names the clock is pinned from it, split mid-line across chunks.
  • The merge check runs on real git with a hermetic env: a conflicted merge in a plain repository and in a linked worktree refuses; committing or aborting clears it.
  • Root pnpm check and eslint .: see the comment below.

🤖 Generated with Claude Code