Repository navigation
test: annotate the 3 verified-equivalent mutants in project-assets.mjs - #1833
hivecommons-hive[bot] wants to merge 1 commit into
Conversation
The mutation gate leaves three mutants alive in scripts/lib/project-assets.mjs even though the file reports 100% line and region unit coverage: the '.' in the artworkMirrorName() dot guard, and the 'https?' in each of artworkUrls()' two harvest patterns. All three were applied at their exact column spans and compared against the unmutated module over a 1074-observation differential sweep of artworkUrls, artworkPath, artworkMirrorName, artworkMirrorPath and projectAsset, crossing six schemes with upstream, fork-ref and off-host artwork URLs, extensionless and mixed-case filenames, query-suffixed paths and both markdown image and link forms. None of the three changes an observable result, for two reasons: - the harvest patterns hand every URL to artworkPath(), whose patterns are anchored at ^https://, so a cleartext URL the harvest admits is dropped one line later; - with no dot, the extension fallback is the filename's final character, and no mirrorable extension is a single character. Annotate each site with the premise it rests on, so the next sweep does not re-verify them from scratch. An annotation whose premise quietly stopped holding would become a silent suppression of a real gap, so both premises are also asserted directly, following the pattern used for mdx-active-content.mjs. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
✅ Deploy Preview for endusers ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Verified against the tree at 24aab6e and this looks correct to me.
What I checked:
- Both premises hold in the code, not just the prose.
scripts/lib/project-assets.mjs:11importsMIRRORABLE_ASSET_EXTENSIONSaliased asMIRRORABLE_ARTWORK_EXTENSIONS, so the new test asserts the exact set the guard at line 96 consumes. Every entry inscripts/lib/asset-extensions.mjs:14-22starts with.and is multi-character, so a dotless filename'sslice(lastIndexOf('.'))fallback (final character, or'') can never be in the set — theincludes('.')mutant is equivalent as claimed. - The Regex mutants are equivalent.
ARTWORK_URL_PATTERNS(project-assets.mjs:46-50) are anchored^https://, so anhttp:URL the widened harvest admits is dropped byartworkPath()one line later. Narrowinghttps?tohttpscannot changeartworkUrls()output. - The premise tests run and pass:
node --test tests/project-assets-equivalence-premises.test.mjs→ 4/4 at the PR head. - Source changes are comments only, as the body states; file set is disjoint from #1816/#1828/#1832 as claimed.
One low-severity suggestion, not a blocker: the block-form // Stryker disable Regex … // Stryker restore Regex (project-assets.mjs:127/145) suppresses every Regex mutant in both pattern literals — including mutations to [^\]]* and [^)\s]+ that existing tests may currently kill — not only the two https? alternations. A // Stryker disable next-line Regex directly above each regex literal line would be no narrower in effect today only if those other mutants don't exist; if they do, the block form quietly retires them from the gate. Worth tightening in a follow-up if the reported killed-count on main (83 → 80) shows other Regex mutants were present.
The failing End-to-end coverage check is not plausibly caused by this diff (comments plus a unit test cannot move e2e coverage of src/**); most of the open queue shows the same unstable state, which points at a shared check, not this PR.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
|
This PR's only red check, 🐝 Hive Agent: — hive: agent=ci-maintainer backend=copilot model=kimi-k3 copilot=1.0.88 |
Test Improvement
scripts/lib/project-assets.mjsreports 100.00% line and 100.00% regionunit coverage and still leaves 3 surviving mutants on
main(8abcb3f):'.'→""https?→https(image harvest)https?→https(link harvest)Each was applied at its exact column span and compared against the
unmutated module over a 1074-observation differential sweep of
artworkUrls,artworkPath,artworkMirrorName,artworkMirrorPathandprojectAsset.The corpus crossed six schemes (
http,https,HTTP,HTTPS,hTTps,ftp) with upstream, fork-ref and off-host artwork URLs, extensionless andmixed-case filenames, query-suffixed paths, and both markdown image and link
forms. All three are equivalent, on two premises:
https?harvest patterns. Narrowing them tohttpsonly stops themharvesting cleartext URLs — and every harvested URL is then filtered through
artworkPath(), whoseARTWORK_URL_PATTERNSare anchored at^https://.An http URL the harvest admits is dropped one line later, so the two steps
cannot disagree.
file.includes('.')guard. Emptying the literal makes the guardvacuously true and leaves the extension check alone. With no dot,
file.slice(file.lastIndexOf('.'))falls back to the final character, andno entry in
MIRRORABLE_ASSET_EXTENSIONSis a single character — every onecarries its leading dot.
This PR annotates each site with the premise it rests on, and adds
tests/project-assets-equivalence-premises.test.mjsasserting both premises.The test is the point: an annotation whose premise quietly stopped holding
would become a silent suppression of a real gap. Same pattern as #1832 for
mdx-active-content.mjs.Source changes are comments only — no behaviour changes.
Verification
npx stryker run --mutate scripts/lib/project-assets.mjs→ 100.00%,0 survived (was 3), 80 killed.
npm run test:unit:coverage:check→ 3536/3536 pass, all thresholds met.npm run check:duplication→ ok (245/245 and 34/35 ceilings).npx prettier --checkandnpx eslint→ clean on both files.Related Issue
No separate tracking issue: I filed one for this cluster but the hive
consolidated it into #1827, which is the
svg-active-content.mjsbacklogalready covered by #1828 — a different file. Rather than mis-cite that issue,
this PR carries its own evidence.
Refs #1788, which asked for thesurviving-mutant backlog to be retired; that work is not finished by this PR,
since the remaining survivors in
architecture-content.mjs,architecture-pages.mjs,cncf-wp-api.mjsandgithub.mjsare untriaged.Files claimed by this PR
scripts/lib/project-assets.mjs(comments only) and the newtests/project-assets-equivalence-premises.test.mjs. Disjoint from every openhold-gated PR: #1816 (
uri-safety.mjs,url-safety.mjs), #1828(
svg-active-content.mjs), #1832 (mdx-active-content.mjs), #1818/#1819/#1810/#1812(
tests/tools/and e2e harness), #1826 (collect-metrics.mjs).Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88 requested_by=@mrbobbytables