Skip to content

test(cli): kill the surviving mutants of the kernel and the runtime - #819

Merged
blafourcade merged 4 commits into
nextfrom
test/kernel-runtime-survivors-2
Sep 10, 2026
Merged

test(cli): kill the surviving mutants of the kernel and the runtime#819
blafourcade merged 4 commits into
nextfrom
test/kernel-runtime-survivors-2

Conversation

@blafourcade

Copy link
Copy Markdown
Contributor

🎯 What & why

Fourth and fifth lots of #799. The kernel and runtime mutation scopes held floors of 71 and 67. GitAdapter had no test at all. This PR adds the tests their survivors named. It changes no source.

Stacked on #818. The runtime lot found a real defect: telemetry off dropped the executable bit of a person's own commit hook. Its fix ships on its own in #818, and this branch sits on it. Review #818 first. Once it merges, this PR's diff against next is tests only.

🛠️ How it works

Scope Before After Floor
kernel 75.2 (340 survived, 38 uncovered) 97.1 (45 survived, 0 uncovered) 71 → 95
runtime 69.8 (199 survived, 193 uncovered) 92.2 (88 survived, 13 uncovered) 67 → 90
  • Kernel: every error class's exact name and message, plus the markdown, semver, source, file, merge, paths, and JSON/JSONC reading helpers.
  • Runtime: the first GitAdapter test, on a real temporary repository. The auth adapters, self-updater, file adapter, prompter, HTTP client, update check and release resolver are asserted on exact commands, messages and headers, and so is the composition root.
  • Red first: each test was red against a mutant applied by hand, 251 in kernel and 137 in runtime.
  • What survives is written down: each remaining survivor is noted with its reason. Most are equivalent mutants, the rest composition-root literals with no observable seam.
  • Two POSIX-only checks skip where the platform cannot show them: a mode bit on Windows, and a read-only directory on Windows or as root.

🧪 How to verify

git diff --stat origin/fix/telemetry-off-keeps-hook-executable... -- cli/src   # empty
cd cli && pnpm vitest run --project unit --project integration tests/kernel tests/runtime
node scripts/run-mutation.mjs kernel && node scripts/run-mutation.mjs runtime
Gate Result
kernel and runtime suites, after the rebase 68 files, 808 tests passed
typecheck, test:arch, knip clean
full suite, before the rebase 5381 tests passed

⚠️ Heads-up

  • CI runs the kernel and runtime mutation gates on this PR.
  • The three symlink tests in file-adapter-edges are not skipped on Windows. The Windows job decides whether they need to be.
  • Two infinite-loop mutants in jsonc.ts are killed by stryker's timeout, not by an assertion.

🔗 Linked issue

Refs #799. Only the profile pockets remain after this.

✅ I certify

  • I have read the contributing guide and followed the PR template.
  • Tests were written red first and every gate listed above passed locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb

@blafourcade

Copy link
Copy Markdown
Contributor Author

Extra commit 2c33f9e: stacked with #815, the two PRs put tests/ at 2989 comment lines against the 2987 baseline. Each one passed alone. Naming the repeated mode-bit skip once brings the stack to 2986, with no baseline raise. Found on a local branch stacking all the open PRs.

@blafourcade
blafourcade deleted the branch next September 10, 2026 20:10
@blafourcade blafourcade reopened this Sep 10, 2026
@blafourcade
blafourcade changed the base branch from fix/telemetry-off-keeps-hook-executable to next September 10, 2026 20:12
blafourcade and others added 4 commits September 10, 2026 22:14
Every error class now has its exact name and message pinned, and the pure kernel helpers
that had no test of their own (jsonc stripping, confined file names, the JSON narrowers,
describeError, isMergeContentEmpty, removeRedundantGitkeeps) get one. The frontmatter
parser, semver precedence, plugin-source messages and the built-cache path parsers are
asserted structure by structure, so a dropped anchor, a swapped join or a missing branch
turns a test red.

Kernel scope, every mutant replayed: 75.2 to 97.1 (killed 1449, timeout 32, survived 45,
uncovered 0 of 1526). The 45 left are documented equivalents plus seven stryker records
as survived although the hand-applied mutation turns the named test red. Floor raised
from 71 to 95.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb
AIDD-Session-Id: 4acc9a1c-19bc-4468-b8b6-e86644bcba60
GitAdapter gets its first test, against a real temporary repository: hook install and
removal under this CLI and under lefthook or husky, core.hooksPath, the trailer count and
every answer of readCommitTrailerSetup. The auth adapters, the self-updater, the file
adapter, the prompter, the HTTP client, the update check, the release resolver, the
project-root and git-environment helpers and the composition root (createDeps, wireTools,
the build registry) are asserted on their exact commands, messages, headers and shapes.

The removal test found a defect rather than a mutant: prepare-commit-msg lost its
executable bit. The fix ships on its own in #818, which this branch sits on.

Runtime scope, every mutant replayed: 69.8 to 92.2 (killed 1182, timeout 16, survived 88,
uncovered 13 of 1299). Floor raised from 67 to 90.

Two POSIX-only checks skip where the platform cannot show them: a mode bit on Windows, and
a read-only directory on Windows or as root.

Refs #799

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb
AIDD-Session-Id: 4acc9a1c-19bc-4468-b8b6-e86644bcba60
Windows CI failed two readCommitTrailerSetup tests that expect a hook or
a delegate to read as not executable: there `access(X_OK)` answers like
`F_OK`, so every existing file reads as executable, and git needs no mode
bit to run a hook. They skip on Windows, as the removal test already does.

Refs #799

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb
AIDD-Session-Id: 4acc9a1c-19bc-4468-b8b6-e86644bcba60
The same Windows explanation sat above three skips. Stacked with the
telemetry tests, the repetition pushed tests/ past its comment baseline
(2989 against 2987); one named predicate says it once.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb
AIDD-Session-Id: 4acc9a1c-19bc-4468-b8b6-e86644bcba60
@blafourcade
blafourcade force-pushed the test/kernel-runtime-survivors-2 branch from 2c33f9e to 1ff666a Compare September 10, 2026 20:16
@blafourcade
blafourcade merged commit d37cbe9 into next Sep 10, 2026
36 checks passed
blafourcade added a commit that referenced this pull request Sep 11, 2026
GitHub closes a pull request whose base branch is deleted, unless the merge
itself deletes it. Deleting the base of #819 through the API after #818
merged closed #819 instead of retargeting it. `vcs.md` now says to retarget
first, and how to replay a dependent branch after its base was squashed.

Fixes #843


Claude-Session: https://claude.ai/code/session_011x4ms5qcGuZgYhCxfdHMUb
AIDD-Session-Id: 4acc9a1c-19bc-4468-b8b6-e86644bcba60

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@blafourcade
blafourcade deleted the test/kernel-runtime-survivors-2 branch September 11, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant