✨ feat(ci): niyam runs the mutation gate on pull requests, reporting until the sweep ends
Slice: #581
niyam runs veda's mutation gate, agnipariksha, on its own pull requests, as Alok asked on 2026-11-20 (quoted on #580). For now it reports and does not block. A gate on changed files judges each changed file whole, so until the sweep has killed the old survivors, any change to an unswept file would be held by mutants it did not make.
Auto-merge is off. This adds three devDependencies, which need Alok's yes:
@veda-hq/agnipariksha0.8.8@stryker-mutator/core10.1.1 (2026-10-23)@stryker-mutator/tap-runner10.1.1
All three are pinned exactly.
What it does
agnipariksha.jsonhas two lanes,src(src/*.ts) andscripts(scripts/*.mjs). Tests,.d.mtsfiles and fixtures are in no lane. Every Stryker run drops theGIT_*variables (as on veda) andGH_TOKEN/GITHUB_TOKEN.stryker/lane.mjsand the two lane configs follow veda'sstryker/lane.mjs:- the
taprunner onnode --test, which strips the.tssuites' types itself; - per-test coverage;
- a 90 s timeout floor;
- no tsconfig rewrite, since the root's TypeScript 7 lacks the API Stryker calls.
- the
- The scripts sandbox leaves out
pnpm-lock.yaml, as veda's does. A mutant that forcesown-provenance.mjs's entry guard true then dies on ENOENT instead of calling npm. .github/workflows/mutation.yml:- one
Lanejob per lane runsagnipariksha --lane <lane> --tracked-only --no-reuseagainst the base branch, plus aMutationjob over both; - exit 1, a surviving or uncovered mutant, is a warning until the sweep ends; exit 2, a refusal, fails;
- the token is read-only (
contents: read), with no secrets andpersist-credentials: false.
- one
.gitignoreadds/reports/and.stryker-tmp/.
Evidence
- The gate judged one file to the end on this machine:
agnipariksha --lane src --files src/release-tag.ts --no-reuse. Excerpt:
This shows the tap runner works on niyam's node:test suites: the dry run passed and each mutant was judged. The five survivors are the sweep's to kill.Instrumented 1 source file(s) with 57 mutant(s) Initial test run succeeded. Ran 1 tests in 0 seconds (net 133.311084 ms, overhead 536.6889160000001 ms). Done in 13 seconds. Survived src/release-tag.ts:40 (Regex) Survived src/release-tag.ts:40 (Regex) Survived src/release-tag.ts:42 (OptionalChaining) Survived src/release-tag.ts:42 (OptionalChaining) Survived src/release-tag.ts:43 (OptionalChaining) src: 52 killed of 57 in 1 file(s) (52 Killed, 5 Survived; 0 timeout(s) retried) - 5 blocking exit 1 after 20 s pnpm checklocally: exits 0;pnpm test2189/2189,pnpm test:scripts138/138,own-provenanceverifies agnipariksha 0.8.8 as built and signed by veda's release workflow, andaggregate-gate-needspasses the newMutationgate (7 workflows).
Not here:
- the full inventory and the sweep;
- the pre-push stage;
- making
Mutationblocking; - requiring
Mutationinmain's ruleset (Alok's, once the sweep ends).
This pull request changes no source file under src/ or scripts/, so neither lane has a file to judge here.
🤖 Generated with Claude Code
Summary by cubic
niyam runs veda's mutation gate, agnipariksha, on its own pull requests. A surviving mutant is reported as a warning rather than a failure until the sweep has killed the existing survivors; a refusal still fails. This PR changes no source file, so neither lane has a file to judge here.
Dependencies
- Adds
@veda-hq/agnipariksha0.8.8,@stryker-mutator/core10.1.1, and@stryker-mutator/tap-runner10.1.1, pinned exactly.
.github/workflows/mutation.yml runs one Lane job per agnipariksha lane, judging each changed file whole against the base branch, and a Mutation gate over both. The token is read-only with no secrets and persist-credentials: false. agnipariksha.json defines two lanes, src (src/*.ts) and scripts (scripts/*.mjs), sharing Stryker's tap runner on node --test, per-test coverage, and a 90 s timeout floor. The scripts sandbox omits pnpm-lock.yaml, so a mutant that reaches own-provenance.mjs dies before calling npm. .gitignore adds /reports/ and .stryker-tmp/.