✅ test(onboard): every mutant in src/onboard.ts lines 703–1263 dies
Slice: #621
Part of #580's one-time sweep. Part 2 of src/onboard.ts: every Survived and NoCoverage mutant in its lines now dies, and none times out. Part 3 (#622) is left alone.
Re-measured on main (b8b5fe2, with #672)
#672 moved the range down by 4 lines, to 696–1221 on main. It holds 155 blocking mutants (145 Survived, 10 NoCoverage), down from 161 on 0a9c8be. One Timeout is the invitation loop. The same run counted 50 more Timeouts on one contiguous block of lines, each lasting about 900 s on a busy machine. With nothing changed in that code, a later run counts none.
The range now ends at line 1263
Rebased on 5c292b9, whose #686 adds 8 lines above the range and its queue-draft repin inside it. Part 2 now starts at line 703, the line after FIGMA_SECRETS: OLDER_SECRETS and its comment are gone. It ends at 1263. Part 3 (#622) starts at line 1264, main's line 1235.
How they die
jobsWithoutLibrary, line by line. Onlyjobs:alone on its line starts the jobs: not a line that ends with it or starts with it, and with or without a trailing space. The cases cover:- a job key with spaces after it;
- a job read past a blank line, and to a last line with no newline;
- a key nested under a key that is not a job;
secrets: inherited, a deepersecrets: inherit, andsecrets: inherit.
- Pins and the header.
workflowPinsreads a pin only on its own line, with or without a space after the colon.- A header with no last dot is moved.
- The header phrase indented elsewhere is not read as the header.
- The push branch.
- It moves only where it stands alone on its line: one with a trailing comment stays.
- Spaced brackets,
[ main ], move. - A commented look-alike before the trigger is left alone.
- A branch is written bare only where YAML reads it as that word (
nope,canon).
- Not the template, at every age. Each of these is replaced, not repinned:
- the pull request job renamed;
- two or three jobs, the weekly one renamed;
- two or three jobs with one of the client's own named as the merged or needs-owner job;
- two or three jobs with an extra pin.
- The merged job alone. Two jobs whose schedule the needs-owner job cannot be added to get the merged job alone, as the code returns.
- Schedules and triggers. These stay as they are:
- a schedule onboard cannot read;
- a quoted cron with spaces inside, which reads as the default;
- an asks job whose label clause no release wrote.
- The agent's access. These cases are covered:
- invitations read as the agent, one page, a short page the last;
- a 500 that lists the invitation, which is not accepted, and a 200 that lists nothing;
- GitHub's answer for the repository with no body, no permissions or no default branch, where no branch is read unless it is named;
- classic-token refusal phrased for one token.
- Pins.
- The newest pin wins wherever it stands among them, and the refusal names where: here, and on main.
- The open onboard pull request GitHub gave no answer about, answered 500, or answered with no list is refused, naming which.
- sarathi.
^Bashand the empty matcher cover the guard.Basand an invalid(do not.- A SessionStart runner with a matcher does not cover niyam's handler, which has none.
sarathiRunnerpasses non-hooks, a non-text matcher and a non-number timeout.runsSarathiForneeds both sarathi and the event.- Only niyam's handler is timed, a text timeout included.
- Handlers and hooks are found past null entries, and none is found in a list that is not one.
- A
sarathi.jsonwith no hooks yet gets its handler.
- Not a JSON object.
7andnullare refused assettings.jsonand assarathi.json.
Source changes, for mutants no test can see or that hang
- Invitations. They are read recursively, a full page reading the next, not in a loop that a mutant could make endless.
jobsWithoutLibrary. A job's block is read as lines ending in a newline, and the text read always ends in one. The last line needs no alternative of its own, whose mutants were equivalent.jobAt. It takes any two-space key, since every one underjobs:is a job's.- Lists that may not be arrays. They are read as
[value].filter(Array.isArray).flat(), so no[]fallback is left for a mutant to fill unseen. Entries are filtered of null alone, the one JSON value with no members to read. - Absent text. It is read as
String(text)wherever it is only scanned. The cloud setup file's release is read asString(release): "undefined" pins nothing, so no guard is left that a mutant could drop unseen. The pins found on GitHub gather in aSet. - Matchers.
matcherTakesis now called only with a matcher that is there and is not*.matcherCoversknows niyam's handlers name one tool or none.- The empty matcher is the empty regular expression, which takes all.
- The fail-open catch holds only its comment.
claudeSettings.- It reads sarathi's entry whether or not
sarathi.jsonis there, and uses it only when it is. - It names each hook without "the", so no regex has to strip it.
- It takes older commands by
includes()alone.
- It reads sarathi's entry whether or not
- Smaller ones.
ownSecretscompares its lines joined by default.repinneddrops abefore === wantedstep that the 8-pin path already makes.- A four- or six-pin workflow's first pin is read without an undefined check that its length rules out.
- The cron is read without optional chains that its match rules out.
accessnames a read without a branch asbranch: undefined.
- Dead code.
OLDER_SECRETS, which nothing read, is gone, and so isescape()of aPRODUCTthat holds no pattern character. A test pinsPRODUCT's shape. - Lint.
lint/eslint-suppressions.json: onboard's swallowed-catch count goes from 6 to 5. The matcher catch now says why it fails open. - Behaviour. Unchanged apart from the order of reads.
No // Stryker disable, no new dependency, and no guard file changed.
Evidence
pnpm exec agnipariksha --lane src --files src/onboard.ts --no-reuse on this commit over 5c292b9 (exit 1, as part 3 is left). It was then rebased on babd97b, which changes neither src/onboard.ts nor its tests.
src: 2886 killed of 3043 in 1 file(s) (18 NoCoverage, 2883 Killed, 139 Survived, 3 Timeout; 3 timeout(s) retried) - 157 blocking
agnipariksha total: 2886 killed of 3043 in 1 lane(s), 157 blocking, 0 refused - exit 1
The blocking mutants it lists, by line range:
| Lines | Part | Blocking |
|---|---|---|
| 1–702 | 1 (#620) | 0 |
| 703–1263 | 2 (this one) | 0 |
| 1264–end | 3 (#622) | 157 (139 Survived, 18 NoCoverage) |
#686's queue-draft repin left one path that a six-pin workflow reaches only once it already has the skip, { text: withAsks } at line 897; a test now gives the asks job to such a workflow. The onboard tests pass, 300 of 300.
🤖 Generated with Claude Code
Summary by cubic
Part 2 of a three-part mutation testing sweep over src/onboard.ts (part of #580, part 3 in #622): every mutant in lines 703–1263 now dies, with no timeouts or skipped cases.
- Adds 213 tests covering job parsing, pins, schedules, push branches, sarathi matchers and handlers, GitHub invitations and access, and non-object JSON settings.
- Rewrites source where no test can see a mutant or where a mutant hangs: invitations are read recursively instead of in a loop, lists that may not be arrays use a single
[value].filter(Array.isArray).flat()pattern, absent text reads asString(text), and sarathi matcher logic is simplified. - Removes dead code (
OLDER_SECRETS,escape()) and one lint suppression; behavior is unchanged apart from the order of reads.