Skip to content

test(markdown-common, adopt): meet the mutation floors the weekly run failed on - #678

Merged
adamw7 merged 2 commits into
mainfrom
claude/github-actions-workflow-fix-pfd8xp
Aug 23, 2026
Merged

test(markdown-common, adopt): meet the mutation floors the weekly run failed on#678
adamw7 merged 2 commits into
mainfrom
claude/github-actions-workflow-fix-pfd8xp

Conversation

@adamw7

@adamw7 adamw7 commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Fixes the Mutation Testing run, which failed with:

Failed to execute goal org.pitest:pitest-maven:1.25.9:mutationCoverage on project
tools.markdown-common: Mutation score of 82 is below threshold of 91

Nothing had regressed in the code. MarkdownConformer lives in markdown-common but its behaviour is tested from the adopt side, so the module's own suite covered the reshape only through a handful of end-to-end conforms: every decision inside it — which heading is a near miss, which blank line goes with a heading that is removed, how the settle loop ends — was free to change without a test saying so.

Two failures, not one

The reactor stops at the module that fails, so claude-code-enforcer, adopt, protogen-maven-plugin-test, grpc-example and assembly were all SKIPPED. With the first floor met the run reaches adopt, which fails too, at 87 against a floor of 88 — a failure the weekly job had never got to see. Both are fixed here.

markdown-common — 82% → 97% (floor 91)

Tests written to the decisions PIT found unwatched, each stating the reading it pins:

  • the title — one carried lower down is moved rather than copied, a second is removed, and the blank line under a removed heading goes with it only where the line above was blank too;
  • the near match — renamed in place with its body, in another case as readily as with extra words, never onto a heading that is already a required section of its own, and never onto one that merely begins with the wording;
  • the insertions — a bare heading is stubbed beneath itself, the reference takes the blank line already under the title rather than adding a second, and a document that is nothing but its title has no line below it to read;
  • the blocks — a fence or a comment the document left open is closed before anything is appended, so the appended section is structure a check can see;
  • the loop — a document nothing settles comes back as the last pass left it.

MarkdownDocument gains the readings PIT found unwatched — a raw line, the first non-blank one, a comment held open across a fenced sample inside it, a list kept open by a continuation indented exactly to its content, and a tab counting on to the next four-column stop both at the margin and inside a list item. LineTerminators, until now exercised only from adopt, gets both directions of its conversion.

The nine survivors left are boundary mutants on an index the title always occupies and on calls the settle loop makes twice over — equivalent under the loop rather than gaps.

adopt — 87% → 90% (floor 88)

Three gaps that share a shape: a value an operator types, or a file a checkout may or may not carry, read by a method no test asks anything of.

  • GuardRules had no test at all, though what it returns decides how much of somebody else's build the installed guard enforces. of now answers in any case and with room around the name, and refuses an unknown one naming what it accepts.
  • --parallel was parsed and bounded but never exercised, so neither end of the bound was pinned. Both ends are now accepted and everything outside them refused — zero, a negative, a word, one past the maximum — beside the default that adopts one repository at a time. --rules is read the same way, blank included.
  • WorkflowGuardInstaller.isInstalled is what a verification asks, and nothing called it. A checkout carrying both guard files reads as guarded, one carrying neither or having lost the script does not, and the project's own workflow at the guard's path does not stand in for the adoption's — the marker is what tells the two apart.

Verification

mvn -B install -Ppitest over the whole reactor: all 13 modules SUCCESS, markdown-common at 97% and adopt at 90%. Tests only — no production code and no threshold was changed, so both floors still guard exactly what they did.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Jbmrw5FtTYTmWyvQ37uZXb


Generated by Claude Code

claude added 2 commits August 23, 2026 11:59
…ched

The weekly mutation run failed the module at a score of 82 against its floor
of 91. Nothing had regressed: `MarkdownConformer` moved into this module with
its behaviour tested from the adopt side, so the module's own suite covered
the reshape only through a handful of end-to-end conforms, and every decision
inside it — which heading is a near miss, which blank line goes with a heading
that is removed, how the settle loop ends — was free to change without a test
saying so.

The tests are written to those decisions, and each one states the reading it
pins rather than the mutant it kills:

- the title: one carried lower down is moved rather than copied, a second is
  removed, and the blank line under a removed heading goes with it only where
  the line above was blank too;
- the near match: renamed in place with its body, in another case as readily
  as with extra words, never onto a heading that is already a required section
  of its own, and never onto one that merely begins with the wording;
- the insertions: a bare heading is stubbed beneath itself, the reference
  takes the blank line already under the title rather than adding a second,
  and a document that is nothing but its title has no line below it to read;
- the blocks: a fence or a comment the document left open is closed before
  anything is appended, so the appended section is structure a check can see;
- the loop: a document nothing settles comes back as the last pass left it.

The reader gains the readings PIT found unwatched — a raw line, the first
non-blank one, a comment held open across a fenced sample inside it, a list
kept open by a continuation indented exactly to its content, and a tab
counting on to the next four-column stop both at the margin and inside a list
item — and `LineTerminators`, until now exercised only from adopt, gets both
directions of its conversion.

Score 97% (265 mutations, 256 killed); the nine survivors left are boundary
mutants on an index the title always occupies and calls the settle loop makes
twice over.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jbmrw5FtTYTmWyvQ37uZXb
…verification

With markdown-common's floor met the mutation run reaches `adopt`, which the
weekly job had never got to: the reactor stopped at the module before it. It
scores 87 against a floor of 88, on three gaps that share a shape — a value an
operator types, or a file a checkout may or may not carry, read by a method no
test asks anything of.

`GuardRules` had no test at all, though what it returns decides how much of
somebody else's build the installed guard enforces: `of` now answers in any
case and with room around the name, and refuses an unknown one naming what it
accepts, since a misspelt rule set read as the default would quietly widen or
narrow that guard.

`--parallel` was parsed and bounded but never exercised, so neither end of the
bound was pinned. Both ends are now accepted and everything outside them
refused — zero, a negative, a word, and one past the maximum — beside the
default that adopts one repository at a time. `--rules` is read the same way,
blank included.

`WorkflowGuardInstaller.isInstalled` is what a verification asks, and nothing
called it: a checkout carrying both guard files reads as guarded, one carrying
neither or having lost the script does not, and the project's own workflow at
the guard's path does not stand in for the adoption's — the marker is what
tells the two apart.

Score 90% (998 mutations, 896 killed).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jbmrw5FtTYTmWyvQ37uZXb
@adamw7
adamw7 merged commit 360fc57 into main Aug 23, 2026
1 check passed
@adamw7
adamw7 deleted the claude/github-actions-workflow-fix-pfd8xp branch August 23, 2026 12: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.

2 participants