✅ test(sys): the mutation gate judges src/sys.ts, and every mutant dies
Slice: #635
The mutation gate can now judge src/sys.ts, and every one of its mutants dies. The inventory on #580 could not judge the file at all.
Why the gate could not judge it
sys.test.ts's Ctrl-C test calledprocess.emit('SIGINT'), which reaches every SIGINT listener in the process.- Stryker's tap-runner hook exits on SIGINT, and with
128 + undefined, soNaN. The dry run failed on both tries. - The test now calls only the listener
onInterruptadded (963218f).
Measured once the dry run passed: 349 mutants, of which 158 blocked: 72 Survived and 86 NoCoverage.
How they die
-
One seam.
realSys(machine = {})takes the machine calls it makes, with the real ones as defaults:spawnandspawnSync;- the fs calls behind
write,replaceanddetach; isattyand the prompts loader;- the proxy setup;
- the terminal's streams, which stay unopened until a prompt needs them.
Callers are unchanged. Tests now drive the terminal, spinner, prompts and process paths in-process. They were NoCoverage because per-test coverage cannot credit code that runs only in a child process.
-
Rewrites where the code hid a mutant.
writeopens the file andfchmods the fd: a file already there keeps its own mode when opened. Overwriting a 0644 file with 0600 is now tested.modifiedandpresentreturn from outside theircatch.realPath()of nothing is'':realpathSync('')gives the working folder.nearestPresentand the cause walk recurse instead of looping, so a broken stop fails at once.serveawaits'listening', using one loopback constant for both the listen and the request URL.- The abort wait drops a
{ once: true }that changed nothing.
-
Direct tests of the exported helpers:
useProxy,isTimeout,exitCode,realPath,nearestPresent,readHidden,loadPrompts;- every branch of
notMade's reason.
-
Waits have a deadline. Every wait in the suite has one, and the lane passes
--test-force-exit(stryker/lane.mjs). A mutant that breaks a wait, or leaves a server open, now fails at once instead of timing out. Before this, the retries of those timeouts outgrew agnipariksha's 15-minute budget, and the run was refused even with nothing blocking.
Evidence
agnipariksha --lane src --files src/sys.ts --no-reuse
src: 365 killed of 365 in 1 file(s) (364 Killed, 1 Timeout; 1 timeout(s) retried) - pass
agnipariksha total: 365 killed of 365 in 1 lane(s), 0 blocking, 0 refused - exit 0
exit 0 after 311 s
pnpm checkpasses locally.- 365 mutants is not the 349 measured before the change: the seam adds code, and the rewrites remove some mutants.
🤖 Generated with Claude Code
Summary by cubic
Makes the mutation gate judge src/sys.ts, killing all 366 of its mutants; before, the gate could not judge the file at all.
A Ctrl-C test emitted SIGINT process-wide, which exits Stryker's tap-runner hook and failed the dry run. The test now calls only the listener onInterrupt added.
realSys()takes the machine calls it makes, with the real ones as defaults, so tests drive the terminal, spinner, prompts and process paths in-process.- Rewrites fixed hidden mutants:
writesets the mode on the fd only after the data is written,realPath('')is'', and recursive walks fail at once on a broken stop. servekeeps its error listener after it starts, so a later error no longer ends the process.- Waits have deadlines and the lane passes
--test-force-exit, so broken waits and unclosed servers fail fast instead of timing out.