Skip to content

test: kill the surviving mutants in the end user data sources - #1789

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

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

Conversation

@mrbobbytables

Copy link
Copy Markdown
Member

Group C of the surviving-mutant backlog in #1788: the end user data sources.

Strengthens the existing unit tests for scripts/lib/enduser-collector.mjs, scripts/lib/enduser-assets.mjs, scripts/lib/enduser-landscape.mjs and scripts/lib/landscape-source.mjs so each remaining mutant that changes observable behaviour is distinguished: the sanitized-bytes naming of mirrored logos, the hosted_logos directory checks, provenance and selection rules recorded verbatim, the readiness gate, first-snapshot publication without a backup, and backup rollback after a failed publication. Test-only change; no source file is modified.

Scoped mutation score for the four files: 80.48% (433 killed / 89 survived / 16 no coverage) to 93.31% (502 killed / 36 survived / 0 no coverage).

The 36 survivors left are equivalent mutants that cannot be killed without changing source: || [] fallbacks replaced with a one-string array whose properties are all undefined, optional chaining on values already guarded by an earlier throw, utf8 encodings that are the default, { force: true } on rmSync calls whose target is known to exist, and backup/restore steps that run after renameSync has already published the output.

Validation: focused tests, scoped Stryker run, npm run test:unit:coverage:check, and the six lint gates all pass.

Refs #1788

Pins the content-addressed logo name and the exact sanitized SVG bytes,
the hosted_logos directory checks, the snapshot provenance and selection
blocks, the publish backup lifecycle (no backup left after success or
rollback, original error surfaced without a prior output, staged
directories rejected, first publication without a staged tree), every
isSafeAssetPath clause, the manifest shape errors and its sorted,
de-duplicated, newline-terminated bytes, and a stale owned asset that is
already gone from disk. A new tests/landscape-source.test.mjs drives
readLandscape through a PATH git shim to assert the exact clone and
rev-parse arguments, the UTF-8 parse and each rejected revision shape.
The scoped score across the four files rises from 80.48% (433/538, 16
uncovered) to 93.31% (502/538, none uncovered).

The 36 survivors left are equivalent: `|| []` fallbacks replaced with a
string whose properties are undefined (assets L23/L29/L30, landscape
L24/L35, collector L60/L256), optional chaining on values already
guarded by an earlier check (landscape L75/L85/L112-L115, collector
L53), `utf8` encodings that String() and Buffer.from() default to anyway
(assets L53, collector L163/L176), `{ force: true }` on rmSync calls
whose target is known to exist or whose absence is a no-op (assets L89,
collector L304/L307/L312), the output backup and restore steps that
cannot change the published bytes because renameSync is the final
operation (collector L257/L260-L262/L302-L303/L306), and included or
relevant arms made redundant by the throw guards above them (landscape
L87/L91).

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 ea0388a
🔍 Latest deploy log https://app.netlify.com/projects/endusers/deploys/6ada5b2bd747fc6aa8dbe259
😎 Deploy Preview https://deploy-preview-1789--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 f157572 Oct 22, 2026
14 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Scanner pass: no findings. The three touched test files (enduser-assets, enduser-collector, landscape-source) are disjoint from every open hold-gated PR (#1782, #1784, #1786, #1792), the diff is test-only with no deletions, and all checks are green including Mutation testing. Ready for human review.


🐝 Hive Agent: scanner | Instance: hosted-available-lke648397-260827-5n31 | SHA: unknown

— hive: agent=scanner backend=copilot model=kimi-k3 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the diff against main at ea0388a (three test files, 438 insertions, no source changes) and ran the four touched suites locally after npm ci: enduser-collector, enduser-assets, enduser-landscape, landscape-source — 53/53 pass. The landscape-source tests shim PATH with a stub git driven by LANDSCAPE_SOURCE_* env vars and save/restore the environment afterwards, so nothing touches the network or a real clone. CI's mutation-testing check is green on this head.

The body's list of 36 remaining survivors as equivalent mutants (|| [] fallbacks, default utf8 encodings, { force: true } on known-existing targets, post-renameSync backup steps) reads as plausible; I did not re-run Stryker to confirm each, so treat that list as the author's claim.

Looks correct to me. Fork branch — needs a human merge; checks are already green on this head.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88

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