āœ… test(onboard): every mutant in src/onboard.ts dies

Merged
AT
6d ago
+545-151

Slice: #622

Part of #580's one-time sweep. This is part 3 of 3 of src/onboard.ts, line 1264 to its end. Every Survived and NoCoverage mutant in it now dies, and none times out but at Stryker's hit limit. This is the file's last part, so the gate on the whole file exits 0.

Re-measured on main

src/onboard.ts and src/onboard.test.ts on main (859a7e9) are the same as on #621's head (7031228, merged as #698). The gate on that head counted 157 blocking mutants, all from line 1264 on: 139 Survived and 18 NoCoverage, against 159 on 0a9c8be.

src: 2886 killed of 3043 in 1 file(s) (18 NoCoverage, 2883 Killed, 139 Survived, 3 Timeout; 3 timeout(s) retried) - 157 blocking

How they die

The tests cover:

  • Hooks under sarathi. Groups and entries in settings.json that are not niyam's hooks (null, empty, not a list), and a sarathi entry that gives no time.
  • Which token onboard reads with. Settings that do not parse, an agent named that has no token here, and another agent set up, or listed in the settings, first.
  • The account prompts. A single suggestion, answers in spaces, no terminal, and no arguments at all.
  • Sign-in. One turned down.
  • Older settings' Figma key. A library that is not text, no library, and a rename alone, in the plan and the pull request's words.
  • Personal repositories. An --add of a feature already on or needing no issue types, and several features that need issue types.
  • Organisations. No warning for features that need issue types.
  • The workflow. Each feature that needs it, and none for identity alone.
  • Why the Mac is not set up. A token GitHub answers for someone else, and no signing key.
  • Agent access.
    • A member given access at once, with no second invitation read.
    • A refusal with no message.
    • A refusal once access was given.
    • The plan before the agent can push.
  • The board.
    • The board app's secrets GitHub will not list.
    • A Project title that is not text.
    • Issue types the owner reads before the plan, with the reason in the pull request.
  • The cloud setup file. It sits beside the file from before P-56, or the release writes none.
  • Cloud signing keys. A listed key with no text, and a list GitHub does not give.
  • The workflow's words in the plan and the pull request.
    • Written, replaced, or repinned in its header alone.
    • No longer passing the board app's secrets.
    • Figma off with a workflow of its own.
  • The test commit.
    • Its mktemp and git arguments to the letter.
    • A repository with no commits.
    • A signing that fails, or gives no id.
    • GitHub's reason kept as given.
    • Five asks.

Source rewrites, for mutants no test can see or that hang

  • Checks that change nothing.
    • Older commands and the lock's env are read without a typeof that includes() and Object() already cover.
    • A try around sarathi edits that cannot refuse goes.
    • The review rule's rename runs only where the rule is missing, so no empty result rides along.
  • Checks made twice.
    • settingsAgents drops an exists check that loadSettings makes.
    • The token spellings drop a check for the login itself, and choose takes its suggestions as given.
    • remove drops the check its one caller makes.
  • Values no one reads.
    • The sign-in's scopes are filled once rather than starting with a value no one reads.
    • The test commit's failure starts with none.
    • "Merges itself" starts unset.
  • Missing files. A file onboard has not read is read as String(undefined), which pins nothing, is no caller and names no release.
  • What earlier code already ensures.
    • The cloud keys' pin reads settings that both branches leave readable, with no catch that cannot run.
    • readyToken says why the agent's token cannot be used, in place of checks whose halves agree.
    • A failed access step says why in one expression.
    • The pull request step takes the push access the step before it ensures.
    • The board step takes a board that a no to replacing the Project does not stop, typed as src/onboard.ts already does for sarathi's entry.
    • The description always lists what the test commit did, and every held change, since each changes its file.
  • No Timeout but the hit limit. onboardArgs and commitInfo recurse instead of looping.
  • workflowDetail. It names a write or a replace outright, so a kind it is never given would not read as none.
  • Lint.
    • The review routine's catch keeps its // fail-open: comment on its handler.
    • lint/eslint-suppressions.json's count of raw error strings in src/onboard.ts drops from 7 to 6.
  • Behaviour. Unchanged.

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

Evidence

agnipariksha --lane src --files src/onboard.ts --no-reuse
src: 2915 killed of 2915 in 1 file(s) (2913 Killed, 2 Timeout; 2 timeout(s) retried) - pass
agnipariksha total: 2915 killed of 2915 in 1 lane(s), 0 blocking, 0 refused - exit 0
(exit 0 after 557 s, at 3238d22 on 859a7e9; rebased since onto b4a44ab, which changes none of this pull request's files)

Before the gate, direct Stryker runs of the part's lines on this branch:

  • 1634 mutants, with 1630 Killed and 0 NoCoverage.

  • 2 Survived, both on the plan's workflow line. The workflowDetail rewrite and a test of the replace kill them: a rerun of those lines killed 49 of 49 and 20 of 20.

  • 2 Timeouts, both in commitInfo and both "Hit limit reached", which agnipariksha counts as killed.

  • pnpm test passes 3050 of 3050, with src/onboard.ts at 100% line coverage. pnpm typecheck and pnpm lint pass too.

  • The pre-push hook passed on the push.

šŸ¤– Generated with Claude Code


Summary by cubic

Finishes the mutation-testing sweep on src/onboard.ts: every mutant in the file now dies under Stryker, the gate exits 0, and no behavior changes. This is part 3 of 3 for the file, so the gate on the whole file passes.

  • Adds tests covering the rest of the file: account prompts, sign-in refusal, agent token selection, agent access, the board, cloud keys, the test commit, personal versus organisation features, and the workflow's plan and pull-request wording.
  • Rewrites source where a surviving mutant could not be tested: drops checks earlier code already makes, reads missing files through String(undefined), and makes onboardArgs and commitInfo recursive so the gate stops at Stryker's hit limit instead of timing out.
  • Matches the turned-down sign-in line by its start so the Guard's skip check reads it as no skip.
  • Lowers lint/eslint-suppressions.json's raw-error-string count for src/onboard.ts from 7 to 6.