āœ… test(sweep): every mutant in src/reviews.ts, src/secrets.ts and src/machine.ts dies

Merged
AT
21h ago
+598-38

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). Since 0a9c8be, #648 changed one line, exporting all. 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.ts now covers what only other suites reached:
    • secretNames, repoSecretNames and orgSecretNames, 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.parse reads 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-owner label, 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-owner label's body;
    • a veto at the very end of its week;
    • routineTrace times with text before or after them, a fraction of four digits at the cutoff's very millisecond, an issue_url past the issue, and a comment with no user.
  • machine.test.ts:
    • moveLeftoverRecords and leftoverToken called directly;
    • machine with 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 -y alone;
    • 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:
    • reviewsDue lists open decisions through all, which asks the same URL and throws the same error.
    • vettedHash keeps only the job's comments that hold a mark, then takes the last.
    • A new reviewDate reads a decision's review date once, for watchReviews's listing and for the body GitHub gave with its editor.
    • The dated.length === 0 early return is gone. With nothing dated, lastEditors asks nothing and the loops have nothing to do.
    • instant checks 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 now String(...). "null" and "undefined" match none of those patterns.
  • machine.ts:
    • machine takes the token store as an optional fourth argument, tokenStore(sys) by default. doctor's leftoverFindings already does this for its tests.
    • listedNow no longer checks for a missing public half. Past the key's checks, an existing key has one: either derived, or in a file keyPairProblem found.
  • No // Stryker disable, and no check weakened. lint/eslint-suppressions.json lost one strict-scalar-parse entry for reviews.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's found.ghLogins.length > 0 as false. 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 check passes locally (exit 0), run with GIT_TRACE2_EVENT=0 for 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.

  • machine now takes its token store as an optional fourth argument, defaulting to tokenStore(sys), following doctor's leftoverFindings.
  • reviewsDue pages through decisions via all; vettedHash and the new reviewDate read only what they need.
  • watchReviews no longer returns early when nothing is dated; the loops below ask nothing anyway.
  • instant, reviewDate, and other fallback sites use String(...) where only scanned text was meant, so "null" and "undefined" match no patterns.