✅ test(board): every mutant in board.ts, review-thread.ts and approvals.ts dies
Slice: #608
Every Survived and NoCoverage mutant in src/board.ts, src/review-thread.ts and src/approvals.ts now dies.
Re-measured on main: none of the three files, their suites or fake-board.test.ts changed since 0a9c8be. The count is the inventory's: 199 blocking, of which 180 Survived and 19 NoCoverage.
| File | Survived | NoCoverage | Now |
|---|---|---|---|
src/board.ts | 135 | 11 | 1070 killed of 1070 (8 Timeout, retried) |
src/review-thread.ts | 41 | 8 | 637 killed of 637 |
src/approvals.ts | 4 | 0 | 40 killed of 40 |
How they die
-
Constants written out in the test. The tests used to compare
LABELS,VIEWSandviewsChecklistwith themselves. They now assert the labels' colours and descriptions, the views'showandhide, and the checklist's lines as literals. -
What each call sends. The tests now record the step each
confirmnames. They assert the questions' text, the label bodies, the retitle and items queries, the view query and the token on every request. -
One condition at a time. Each
a || bguard has a case where only one operand fails. This covers the repository read, GraphQL in both files, REST status bounds, the cloud comment read and the parent check. -
Answers the fakes never give. The tests now feed:
- a repository with no owner;
- plain option names, and an option with no name;
- an item hidden, with no fields or with no sub-issues;
- a Project closed by
statealone or byclosed_atalone; - a Link header with no space;
- a thread with no comments;
- a reply with spaces around it;
- a proxy thread list where the thread is not first.
They come through
RestBoard.refuseor by wrapping the/graphqlroute in the test. The shared fakes are unchanged. -
A move GitHub refuses (board.ts's
movecatch, which was NoCoverage) is named while the other moves are still made. -
Rewrites where a mutant was equivalent. None changes what a caller sees on a real answer:
approvals.ts:batchAnswersreads a body only when it is a string.review-thread.ts:threadArgskeeps its switches in aSet.- Both branches share one empty last page of comments.
- A cloud comment's pull request URL, which must be a string, is matched once, so a URL that does not match is a comment that cannot be read. Before, it became a request to
/repos//pulls/0. - A POST passes its body as it is.
- Two guards drop checks that
threadArgsalready makes.
board.ts:itemsOfreads each page's fields once, and casts the names and draft text that GitHub's schema never leaves out.setUpViewsno longer asks whether a view it just made is settled. A new view has no filter, so it never is.visibleNameskeeps a nameless field, whichcolumnsalready maps to no id.settledcompares the filter as it is.- The Link header is read as text.
projectItemsskips an item on its own content's number.stepDuerelies onrank(undefined)being -1.- A field gains options only when both it and the work model have them. A test now covers a Review date the owner gave options.
Evidence
pnpm exec agnipariksha --lane src --files src/board.ts,src/review-thread.ts,src/approvals.ts --no-reuse
src: 1747 killed of 1747 in 3 file(s) (1739 Killed, 8 Timeout; 8 timeout(s) retried) - pass
agnipariksha total: 1747 killed of 1747 in 1 lane(s), 0 blocking, 0 refused - exit 0
- The 8 Timeouts are board.ts's existing loop-body mutants, the same 8 as on main, and their retry ends well inside agnipariksha's budget.
- The total fell from 1794 mutants on main to 1747 because the rewrites removed the equivalent ones.
approvals.ts's new lone\r/ U+2028 test pins existing behaviour: such a first line approves nothing. It was the only input that tells the$inBATCHfrom no$.pnpm checkpasses locally, and so does the pre-push.
🤖 Generated with Claude Code