ā test(sweep): every mutant in src/reviews.ts, src/secrets.ts and src/machine.ts dies
Merged
AT
21h ago+598+598+012345678901234567890123456789-38-38-01234567890123456789
Slice: #627
Every mutant in src/reviews.ts, src/secrets.ts and src/machine.ts now dies. This is slice 21 of #580's sweep.
#627 was in sweep queue A's range (#618, #619, #623ā#628). Queue A was on #624 and had not started #627, so it gave #627 to this session.
Re-measured on main (7d74b16). Run per file with Stryker, the three files hold 199 blocking mutants, as on 0a9c8be:
src/reviews.ts: 72 (58 Survived, 14 NoCoverage). Since0a9c8be, #648 changed one line, exportingall. The count is unchanged.src/secrets.ts: 71 (7 Survived, 64 NoCoverage), unchanged.src/machine.ts: 56 (47 Survived, 9 NoCoverage), unchanged.
How they die
secrets.test.tsnow covers what only other suites reached:secretNames,repoSecretNamesandorgSecretNames, page by page: a full page then the next, an empty next page, names that are not text, and each answer that is not a list;setOrgSecret: the body it sends, with the value opened again with the key's pair, and each refusal;shareOrgSecret: 204, 409 and other statuses;- each public key GitHub gives without a text id or key, or with another status.
reviews.test.ts:reviewsDue:- with review off, and on a repository a personal account owns;
- every request carrying the agent token;
- an answer that is not a list, and a list with another status;
- review dates that
Date.parsereads but that are not YYYY-MM-DD alone ("Mon 2026-10-01", "2026-10-01T00:00Z"); - the job's mark read only from its own comments that hold one;
- events that are not the job's
needs-ownerlabel, after it; - an agent's comment at the label's very time, or at the review date's very start;
- verdicts that only start a comment: indented counts, mid-sentence or bold does not;
- each decision's comments read once;
- the
needs-ownerlabel's body; - a veto at the very end of its week;
routineTracetimes with text before or after them, a fraction of four digits at the cutoff's very millisecond, anissue_urlpast the issue, and a comment with no user.
machine.test.ts:moveLeftoverRecordsandleftoverTokencalled directly;machinewith no arguments;- a test store with no old-entry members, kept somewhere whose name has "this Mac's" past its start;
- a token with exactly 14 days left;
- a public half derived with
ssh-keygen -yalone; - a made key that is not usable;
- a pasted token with spaces around it;
- a new key GitHub already lists, so nothing is posted;
- the browser steps' exact lines;
- an old entry that came or went between the plan and the yes;
- the old folder removed with nothing left worth fixing;
- the git password alone removed, and gh alone signed out with no git password saved;
- each way the shell's lookup of the installed CLI is not used.
Source rewrites, only where no test could tell a mutant apart. Behaviour is unchanged.
reviews.ts:reviewsDuelists open decisions throughall, which asks the same URL and throws the same error.vettedHashkeeps only the job's comments that hold a mark, then takes the last.- A new
reviewDatereads a decision's review date once, forwatchReviews's listing and for the body GitHub gave with its editor. - The
dated.length === 0early return is gone. With nothing dated,lastEditorsasks nothing and the loops have nothing to do. instantchecks the time it read against the text the pattern matched, not the whole text. That is the same text while the pattern is anchored.?? ''on a body, a time or an issue URL that is only scanned is nowString(...). "null" and "undefined" match none of those patterns.
machine.ts:machinetakes the token store as an optional fourth argument,tokenStore(sys)by default.doctor'sleftoverFindingsalready does this for its tests.listedNowno longer checks for a missing public half. Past the key's checks, an existing key has one: either derived, or in a filekeyPairProblemfound.
- No
// Stryker disable, and no check weakened.lint/eslint-suppressions.jsonlost onestrict-scalar-parseentry forreviews.ts, which the rewrite no longer needs.
Evidence
src: 1086 killed of 1086 in 3 file(s) (1084 Killed, 2 Timeout; 2 timeout(s) retried) - pass
agnipariksha total: 1086 killed of 1086 in 1 lane(s), 0 blocking, 0 refused - exit 0
- Before: 199 blocking when run per file with Stryker.
- The gate's first full run left one:
machine.ts:372'sfound.ghLogins.length > 0asfalse. Every test that signed gh out also had a git password saved, so the||hid it. The new gh-only test kills it. - The two Timeouts are the paging loops with their bodies emptied: real endless loops, stopped by Stryker's hit limit.
pnpm checkpasses locally (exit 0), run withGIT_TRACE2_EVENT=0for this machine's global trace2 target, as sweep-607 found.
š¤ Generated with Claude Code
Summary by cubic
Kills every mutant in src/reviews.ts, src/secrets.ts, and src/machine.ts by adding tests that pin the remaining boundaries and rewriting a few spots where no test could tell a mutant apart. Behavior is unchanged.
machinenow takes its token store as an optional fourth argument, defaulting totokenStore(sys), followingdoctor'sleftoverFindings.reviewsDuepages through decisions viaall;vettedHashand the newreviewDateread only what they need.watchReviewsno longer returns early when nothing is dated; the loops below ask nothing anyway.instant,reviewDate, and other fallback sites useString(...)where only scanned text was meant, so"null"and"undefined"match no patterns.