✅ test(sweep): every mutant in src/board-app.ts, src/decisions.ts and 3 more dies

Closed
AT
2d ago
+557-90

Slice: #607

Part of #580's one-time sweep. Every Survived and NoCoverage mutant in
src/board-app.ts, src/decisions.ts, src/cubic-dismiss.ts,
src/guard.ts and src/session-start.ts now dies, and none times out.

Re-measured on main (bda2af2)

None of the five files, nor their tests, changed since 0a9c8be, and
main still holds the slice's 195 blocking mutants: 180 Survived and 15
NoCoverage. The slice's gate command on main reported 194 and was
REFUSED (see the flake below). These counts are from one Stryker run of
the five files with the flake fixed and the sources untouched:

FileBlocking on mainTimeoutNow
src/board-app.ts64 (61 Survived, 3 NoCoverage)70
src/decisions.ts58 (48 Survived, 10 NoCoverage)40
src/cubic-dismiss.ts55 (54 Survived, 1 NoCoverage)10
src/guard.ts9 (8 Survived, 1 NoCoverage)00
src/session-start.ts9 (9 Survived)00

A flake the first run hit

  • The first gate run was REFUSED: a timeout retry's dry run failed on
    cubic-dismiss.test.ts's real-git link test with ENOTEMPTY. The
    same flake killed one mutant in that run, so it counted 194.
  • Its two real-git tests ran git with the machine's global config. A
    trace2 event target there has a daemon write into the fixture's
    .git while the test removes it.
  • The suite now calls maskProcessGitEnv() before it runs and removes
    its fixtures with removeFixtureRoot, as the other real-git suites
    do. Before the fix it failed in 1 of 13 Stryker dry runs here and in
    my first plain run of the suite. After it, the suite passed 200 runs of 200.

How they die

  • Literal expectations. Tests compared output to text rebuilt by
    the code under test, such as boardAppSteps(...) or
    boardAppManifest(...), so a mutant changed both sides. They now
    assert the literal steps, manifest, start page and every answer page.
  • Edge fixtures first. Entries a .find or .some must pass over
    (a null body, a comment with no author, another app's installation)
    now come before the match.
  • Branches no test reached. Decisions on a personal account's
    repository, and each mix of the decisions and review features. Also
    the needs-owner listing refused, and lastEditors read directly.
  • Boundaries. Exactly 45 minutes spent, an Override 30 days out, a
    78-column line, a 96-column title, 200 install looks in ten minutes.
  • No loop a mutant can make endless. The paged lists in
    decisions.ts and board-app.ts recurse, and lastEditors batches
    with Array.from. dismissArgs walks its words with for...of. The
    fake browser's sleep fails past the longest a run can wait, so a
    mutated wait fails at once instead of timing out.

Source changes, for equivalent mutants only:

  • A ?? '' fallback whose mutant changes nothing is gone:
    • String(issue.body) and String(undo.body): a null body reads as
      "null", which holds no field and undoes nothing.
    • join writes an absent context as nothing.
  • A catch that set what the variable already held is empty, with the
    value set before the try (guard.ts, session-start.ts).
  • session-start.ts works out the record's folder before its
    swallow-all try. localIdentity returns from its catch instead of
    keeping an always-overwritten initialiser.
  • A trim, split or -- guard that never mattered is gone: git remote
    words and the dismissal reason are read with matchAll(/\S+/g), and
    a dismiss flag's name is cut at the first =.
  • parseDecision returns from its match, not through a dead second
    ?.. The half-set board app message names the one secret held and
    the one lacking, not a join of a one-name list.

No // Stryker disable, no new dependency, and no guard file changed.

Evidence

agnipariksha --lane src --files src/board-app.ts,src/decisions.ts,src/cubic-dismiss.ts,src/guard.ts,src/session-start.ts --no-reuse
src: 1513 killed of 1513 in 5 file(s) (1513 Killed; 0 timeout(s) retried) - pass
agnipariksha total: 1513 killed of 1513 in 1 lane(s), 0 blocking, 0 refused - exit 0
exit 0 after 47 s
  • Run on 18ebc5a, which has Cubic's fixes and sits on 3d446d8.
    That commit (#646) changed src/asks.ts, which guard.ts calls.
    The verdict was all killed before the rebase too.
  • 1513 mutants, not the 1548 measured on main: the rewrites remove
    the equivalent ones and a few more.
  • Stryker run directly with only the files' own suites (guard.ts and
    session-start.ts together, the other three alone) left no
    Survived, NoCoverage or Timeout mutant in any.
  • pnpm check exits 0 locally on the rebased branch: pnpm test
    2388 of 2388, pnpm test:scripts 138 of 138, with typecheck, lint,
    pins, pariksha, hooks, build and smoke.
  • The pre-push hook (records, frozen, pins, niyam's agent check)
    passed on the push.

🤖 Generated with Claude Code