✨ feat(agnipariksha): a cut-off leaves large lanes to CI, 0.7.9

Merged
AT
11d ago
+185-11

Slice #268 under #238. Alok settled question 2 on 2026-11-19: small lanes are judged at pre-push and large ones in CI. agnipariksha had no cut-off, and #272 needs one released.

What changes

  • A cut-off in agnipariksha.json. maxLines can be set at the top and per lane. A run that names no lane leaves out any lane whose targets hold more lines than its limit. It prints a line like scripts: 3 lines in 1 file(s), over its cut-off of 2 - not judged in this run, CI judges it (--lane "scripts" judges it here) and adds , 1 over the cut-off for CI to the total. A lane at the limit is judged. A lane left out doesn't fail the run.
  • --lane always judges. A run that names a lane judges it whatever its size, so CI's one job per lane never skips. --files without --lane still applies the cut-off.
  • Errors fall towards judging. The count is taken before Stryker starts, over the targets whole, since Stryker mutates them whole. A file that can't be read counts 0, so a failed read never leaves a lane out. 0, negatives, fractions, strings, null and anything past 2^53 are refused.
  • No change for existing configs. With maxLines absent there is no cut-off.
  • Release. The README documents all of this, and agnipariksha is now 0.7.9. Once this merges I tag v0.7.9, and then #272 can pin it.

Why lines

The six samples from #238's CI run 44507830088, each on a 4-CPU runner with the tap runner:

SampleFilesLinesMutantsTimes/lines/mutant
sarathi-24813123851m470.340.28
dvara-14335174761m290.170.19
kavach-14126956091m370.140.16
pair (pariksha)27411,0495m020.410.29
agnipariksha-18559911,1354m590.300.26
pariksha-16931,6672,19424m470.890.68
  • Lines are known before Stryker starts. Mutants are only known after it instruments the code, and Stryker has no count-only mode.
  • Lines sort these samples the same way mutants do. Any limit from 991 to 1,666 puts the five runs of 5 minutes or less under it and pariksha-169 over it.
  • A file count would not work. Three files took 89 s in dvara and 1,487 s in pariksha.
  • Lines are still a coarse measure. Time per line ranged 0.14–0.89 s. Even within pariksha, the two samples differ about 2.2× per line. So the per-lane maxLines is the main knob for a lane with slow tests.
  • The value isn't set here. veda's own limit is timed on Alok's Mac in #272.

Checks

The root pnpm check passes. So does pnpm --filter @veda-hq/agnipariksha check: 117 tests, with coverage at 99.4% of lines and 99.0% of branches. The new tests cover:

  • a lane over the limit, a lane at the limit, and a lane with no limit;
  • the --lane exemption, --files without --lane, and every lane left out;
  • an unreadable target;
  • the line count's edge cases, and each refused maxLines value.

Slice: #268

🤖 Generated with Claude Code


Summary by cubic

Adds a configurable line-count cut-off to agnipariksha so pre-push runs judge small lanes and leave large ones for CI.

  • maxLines can be set at the config root or per lane; a run naming no lane skips any lane whose targets exceed it, logs the count and limit, and adds the lane to a "over the cut-off for CI" total.
  • --lane always judges the named lane regardless of size, so each CI job runs its own lane.
  • Lines are counted before Stryker starts, over the targets whole; an unreadable file counts 0 so a failed read never causes a skip.
  • Absent maxLines means no cut-off, so existing configs behave as before.
  • Invalid maxLines values (0, negatives, fractions, strings, null, unsafe integers) are refused at config load.
  • README documents the cut-off; @veda-hq/agnipariksha is bumped to 0.7.9.

Migration

  • Tag v0.7.9 after merge; #272 can then pin it and set veda's own maxLines.