Skip to content

test: kill the surviving mutants in the MDX and architecture content gates - #1795

Merged
mrbobbytables merged 1 commit into
cncf:mainfrom
mrbobbytables:copilot/mutants-group-b
Oct 22, 2026
Merged

mrbobbytables merged 1 commit into
cncf:mainfrom
mrbobbytables:copilot/mutants-group-b

Conversation

@mrbobbytables

Copy link
Copy Markdown
Member

Summary

Group B of #1788: kills the surviving mutants in the MDX and architecture content gates (scripts/lib/mdx-active-content.mjs, architecture-content.mjs, architecture-pages.mjs, mdx-code-blocks.mjs). Tests only; no source changes.

  • New tests/mdx-active-content-allowlists.test.mjs: table-driven acceptance of every allowlisted MDX node type, HTML element and attribute, so dropping an entry fails a test.
  • New tests/mdx-code-blocks.test.mjs: pins fence handling, info-string parsing and the exact rewritten output.
  • The architecture-content-* and architecture-pages tests gain exact message, path and encoding assertions for each conditional branch.

Mutation score (scoped to the four files)

killed timeout survived no coverage score
before 431 4 84 0 83.82%
after 501 4 14 0 97.30%

Per file: mdx-active-content 240/251, architecture-content 193/194, architecture-pages 55/57, mdx-code-blocks 17/17.

The 14 survivors are equivalent mutants, left without suppression:

  • mdx-active-content.mjs:108 'mdxjsEsm' entry in MDX_NODE_TYPES: dead entry, the node.type === 'mdxjsEsm' branch precedes it.
  • :164 regex anchors: a pre-filter for JSON.parse, which only accepts a lone string anyway.
  • :282, :298, :304 left-operand true: only pass null/undefined into disallowedScheme/remoteTarget, which normalizeUri turns into text with no scheme.
  • :344 loop bound: unreachable, unwrap is a pure line deletion so a match is always found.
  • :390 default sentinel array: mdast ignores a string extension.
  • :391 sentinel for nullish input: inert text yields [] like ''.
  • :403 form === text to false: the duplicate scan is removed by the dedup filter.
  • architecture-pages.mjs:44 /\.mdx?/ applied to the constant ['index.md', 'submit.md']; :78 catch {} yields undefined vs false under ||.
  • architecture-content.mjs:230 encoding '': Node treats a falsy encoding as utf8.

Validation

  • Focused tests: 204 pass
  • npm run test:unit:coverage:check: pass
  • npm run check:format, check:lint, check:duplication (247/251 clones, unchanged), check:unused, check:spelling, check:markdown: pass

Refs #1788

…gates

Pins every exported allowlist entry of mdx-active-content.mjs with a
table of inert documents, the string-literal expression boundary, the
URL-attribute guard, the ESM trim, the expression-type fallback, snippet
trimming and capping, the unwrapped-line mapping and finding order; the
exact cleanMarkdown rewrites (regex anchors, shortcode removal, GFM
grammar, bracket escaping, link unwrapping), firstParagraph edges and the
joined mirror warnings in architecture-content.mjs; the page-extension
anchor and sorted listing in architecture-pages.mjs; and the missing
position guards in mdx-code-blocks.mjs. The scoped score over these four
files rises from 83.82% (431 killed, 84 survived) to 97.30% (501 killed,
14 survived). The 14 left are equivalent: dead allowlist entry, regex
pre-filters JSON.parse already enforces, guards on values normalizeUri
already neutralises, an unreachable loop bound, an inert default text,
a duplicate scan the dedup removes, an undefined-vs-false catch result,
a regex anchor on a constant set, and an empty encoding Node reads as
utf8.

Refs cncf#1788

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
@netlify

netlify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for endusers ready!

Name Link
🔨 Latest commit 711f8fc
🔍 Latest deploy log https://app.netlify.com/projects/endusers/deploys/6ada6551fa916aa1ec481f50
😎 Deploy Preview https://deploy-preview-1795--endusers.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mrbobbytables
mrbobbytables added this pull request to the merge queue Oct 22, 2026
Merged via the queue into cncf:main with commit 3a127aa Oct 22, 2026
14 checks passed
github-merge-queue Bot pushed a commit that referenced this pull request Oct 22, 2026
…rayDeclaration (#1807)

Annotate the 41 surviving mutants that the backlog groups in #1788
verified as equivalent (#1789, #1790, #1793, #1794, #1795) with
Stryker disable directives that carry the reason, so they report as
Ignored instead of Survived and no longer surface as mutation findings.
Exclude the ArrayDeclaration mutator in stryker.config.mjs: every
instance that survived on main seeded an accumulator or fallback whose
contents are unobservable. Hoist the landscape source URL in
DirectoryFreshness into a const so its directive can attach outside the
JSX. Document the directive placement rules in CONTRIBUTING.

Refs #1788

Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
Co-authored-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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