✅ test(sweep): every mutant in src/identity.ts, src/lockout.ts and 4 more dies
Slice: #613
Part of #580's one-time sweep. Every Survived and NoCoverage mutant in src/identity.ts, src/lockout.ts, src/jsonedit.ts, src/board-audit.ts, src/version.ts and src/cloud-key.ts now dies, and none times out.
Re-measured on main (b97fe6c)
None of the six files changed since 0a9c8be. The counts below come from one direct Stryker run per file with its own suite. They are not from the slice's agnipariksha command, which was queued behind the other sweep lanes' lock. They match the slice: 196 blocking, of which 158 Survived and 38 NoCoverage.
| File | Blocking on main | Timeout on main | Now |
|---|---|---|---|
src/identity.ts | 41 (35 Survived, 6 NoCoverage) | 8 | 285 killed of 285 |
src/lockout.ts | 37 (35 Survived, 2 NoCoverage) | 0 | 272 killed of 272 |
src/jsonedit.ts | 32 (31 Survived, 1 NoCoverage) | 61 | 289 killed of 289 |
src/board-audit.ts | 31 (30 Survived, 1 NoCoverage) | 12 | 322 killed of 322 |
src/version.ts | 29 (6 Survived, 23 NoCoverage) | 0 | 39 killed of 39 |
src/cloud-key.ts | 26 (21 Survived, 5 NoCoverage) | 0 | 202 killed of 202 |
The slice listed three timeout retries that the inventory left unsettled: identity.ts:152 and jsonedit.ts:36 and :41. They are settled because no Timeout is left to retry. identity.ts:152 had two ConditionalExpression "false" mutants that shared a line and column. agnipariksha's retry matches a mutant by line, column, mutator and replacement, so it picked up the nested one, which was ignored.
No mutant can hang
-
jsonedit.tsused to scan character by character inwhileloops. 61 of its mutants stopped the position moving and waited out the 90 s timeout. It now reads:- strings, spaces and bare values with sticky patterns;
- where an object or array ends with
matchAll; - members and elements with
for...ofover the text, at most one step per character.
A mutant that stops the position moving now gives a wrong answer, which a test sees. There is no depth or size limit: a 50,000-element
permissions.allowlist reads in 32 ms. -
identity.tsandboard-audit.tspage their lists by recursion, notfor (;;), and board-audit parses its arguments by recursion. A mutant that never stops paging still fails at once:- FakeSys answers an unrouted page with 404.
- identity's fake sleep fails a sixth wait, one past the five a run takes.
- board-audit's tests answer GitHub's GraphQL with a refusal after 30 reads.
The shared fakes are unchanged.
How the rest die
- Exact calls. The tests now check exactly what
lockout.tsasks gh, the keychain, ssh-keygen, ssh and ps: the arguments, the owner's environment and the timeout. - Each operand of
a || bon its own.- A refusal that still carries a list.
- A 200 that carries no list.
- A 201 with no numeric id, and a 200 with one.
- Each Actions variable missing on its own.
- A pull request event missing only its number, its base or its head.
- Boundaries.
- Exactly 249 and exactly 250 commits, for the pull request and for a tested one.
- An app started in the very second of the move.
- Index paths of two digits.
- Order and length.
- Missing and archived issues given out of order.
- Values replaced with ones of another length.
- Stray and pushed shas longer than seven characters.
- One commit, named in the singular.
- Shapes the fakes never gave.
- Strings that hold spaces, commas and brackets.
- A
Hi …!that does not start a line. - A Link header with no space before
rel, or with nonext. - A sha that only starts or ends with zeros.
- Items with no number, no repository or no title.
- A git that fails while still printing a root.
- A clone with no settings.
Source changes, for equivalent mutants only
- identity.ts: a compare that GitHub answers with no list of commits now fails the way a refusal does. Before, it read as bringing no commits, and the run then failed with "no push GitHub has recorded". The check fails either way, and the message now names the compare. The old
?? []was an equivalent mutant, since nothing read the fallback list. This is the one place where an existing test's expectation changed (throws on a compare that lists no commits, as on a refusal). - Guards that something else already covers:
existschecks that a catch, orrmSync'sforce, already covers (lockout.ts,board-audit.ts);trim()aftertrimEnd()(jsonedit.ts);?? ''fallbacks that change nothing;'version' in raw(version.ts);pull?.baseoncepull.numberhas been read.
- Fallback lists that nothing reads:
- the starting list in commit and item paging;
readMoved(…)?.logins ?? []once a move is known to be pending, nowpendingMove.
isNewertakes the first part that differs, so there is noat !== -1and no>that>=could replace with the same result.readPackagereads withtoString():'utf8'→''gives the same text.
No // Stryker disable, no new dependency, and no guard file changed.
Evidence
pnpm exec agnipariksha --lane src --files src/identity.ts,src/lockout.ts,src/jsonedit.ts,src/board-audit.ts,src/version.ts,src/cloud-key.ts --no-reuse
src: 1409 killed of 1409 in 6 file(s) (1409 Killed; 0 timeout(s) retried) - pass
agnipariksha total: 1409 killed of 1409 in 1 lane(s), 0 blocking, 0 refused - exit 0
exit 0 after 713 s
- This ran on this branch's head, based on
b97fe6c, which is main's tip now. Most of the 713 s was spent waiting for another lane's lock. pnpm checkexits 0 locally:pnpm test2523 of 2523,pnpm test:scripts138 of 138, typecheck, lint, pins, pariksha, hooks, build and smoke.
🤖 Generated with Claude Code
Summary by cubic
Kills every surviving and uncovered mutant in src/identity.ts, src/lockout.ts, src/jsonedit.ts, src/board-audit.ts, src/version.ts, and src/cloud-key.ts, removing all timeouts.
Refactors
jsonedit.tsnow scans JSON with sticky regex patterns and recursion instead of character-by-character loops, so mutants that stall the scan fail tests instead of hitting the 90s timeout.identity.tsandboard-audit.tspage lists by recursion; unrouted pages, caped waits, and capped GraphQL reads make endless paging fail immediately.identity.tscompares with no commit list throw like refusals; removedexistschecks, redundant fallbacks, and equivalent guards across the six files.
Tests
- Added exact command assertions for
lockout.tscalls to gh, keychain, ssh-keygen, ssh, and ps. - Added boundary tests: 249/250 commits, moves at the exact second, two-digit indices.
- Added shape tests for lists, lookups, and links the fakes previously never returned.