āœ… test(pr-autocreate): every mutant in src/pr-autocreate.ts lines 606 on dies

Merged
AT
2d ago
+743-36

Slice: #625

Part of #580's one-time sweep. Part 2 of src/pr-autocreate.ts, lines 606 to the end (part 1 merged as #696). Every Survived and NoCoverage mutant in the file now dies, and the timeout-retry pass that refused #624's runs twice now settles inside its budget.

Evidence

The gate judges the whole file (agnipariksha 0.8.8's --files takes no line range). Two runs:

agnipariksha --lane src --files src/pr-autocreate.ts --no-reuse

6019a2f: src: 1578 killed of 1592 in 1 file(s) (1569 Killed, 7 Timeout, 14 Survived, 2 RuntimeError; 7 timeout(s) retried) - 14 blocking
         exit 1 after 723 s
98e087c: src: 1586 killed of 1586 in 1 file(s) (1577 Killed, 7 Timeout, 2 RuntimeError; 7 timeout(s) retried) - pass
         agnipariksha total: 1586 killed of 1586 in 1 lane(s), 0 blocking, 0 refused - exit 0
         exit 0 after 593 s

On #624's head, the same gate found 71–74 blocking mutants in lines 606 and on, and both runs were REFUSED on Timeouts, after 41 and 56 min. Now the gate takes 10 min, with 7 Timeouts, all retried and counted as killed.

  • Before the second run, the 11 surviving mutants that needed tests were applied by hand, one at a time. Each one fails the suite. The other 3 were equivalent and the source rewrite below removes them.
  • pnpm check exits 0: pnpm test 3060 of 3060 and pnpm test:scripts 138 of 138. Typecheck, lint, pins and pariksha pass too.
  • Guard's test-count check on the test file's diff gives {"fewer":false,"skipped":false}. The diff is 693 lines, and no added line holds skip, only or todo.

How they die

  • Part 2 runs in process now. A new describe, pr-autocreate hooks, in-process, runs part 2's code on FakeSys, before the deferred real-git suites (describeLater). It covers:

    • pushTarget's refspecs;
    • every sentence of the instruction;
    • sarathi's Auto-fix list: where it lives, the row it adds, the state it folds;
    • the token GitHub is asked with, and the git call that finds the repository;
    • claudeHook end to end, with git and GitHub faked;
    • spawn-watchers, flags and timings, refuse-retired and watch.

    A part-2 mutant now dies there in seconds, where it used to wait on git and time out.

  • The second commit kills the 14 the first gate left. Its tests pin:

    • the Auto-fix row's source, as text;
    • a failed gh auth token whose stdout still holds a token;
    • a recorded pull request that is closed or has no link, which gets no instruction;
    • a cloud session on a list that shows Auto-fix on;
    • a PostToolUse with no tool_input;
    • an upstream on a remote whose name is as long as origin;
    • no git call after a missing tracking ref;
    • a record with no notes saved once.

Source changes, for equivalent mutants only

  • pushTarget slices the destination after the first colon (the whole spec when there is none).
  • pullOf reads the link with one pattern.
  • listRow reads a line that is not JSON as null for the schema.
  • autofixState reads each row through a schema that answers undefined for a line that is no row.
  • autofixMessage takes the session as the string or undefined that claudeHook made it.
  • pullsFor asks githubSlug only of a url git gave.
  • claudeHook hands pushTarget the command as text.
  • flags splits --name=value at its first =.
  • refuse-retired and spawn-watchers take an unnamed --remote as it is.
  • spawn-watchers leaves the state folder to recordOptout's lock.
  • watch matches ls-remote's sha and tab, and logs with no empty part.

No // Stryker disable, no weakened check, no new dependency, and no guard file changed. Stryker's concurrency, timeoutMS and the lane are as they were.

šŸ¤– Generated with Claude Code


Summary by cubic

Makes every mutation in src/pr-autocreate.ts from line 606 to the end die, completing part 2 of the #580 sweep (part 1 merged in #696). The mutation gate that refused two earlier runs after timing out now passes in about 10 minutes, killing 1586 of 1586 mutants with no // Stryker disable, no weakened check, and no new dependency.

Testing

  • A new in-process suite runs part 2's code on FakeSys before the slow real-git suites, so mutants die in seconds instead of waiting on git and timing out.
  • A second pass pins the 14 survivors of the first gate with tests that each fail before their fix.

Source changes (equivalent mutants only)

  • pushTarget, pullOf, listRow, autofixMessage, pullsFor, claudeHook, flags, refuse-retired, spawn-watchers, and watch each read what they got, losing the branch or default only the dead mutant kept.
  • pnpm check passes: 3060 unit and 138 script tests, typecheck, lint, pins, and pariksha.