Skip to content

test: extend branch coverage floor to inline page scripts - #277

Merged
kubestellar-prow[bot] merged 1 commit into
hivecommons:mainfrom
thatguywob:quality/275-inline-coverage
Oct 26, 2026
Merged

kubestellar-prow[bot] merged 1 commit into
hivecommons:mainfrom
thatguywob:quality/275-inline-coverage

Conversation

@thatguywob

Copy link
Copy Markdown
Contributor

Summary

The coverage floor previously ignored the four inline scripts shipped to browsers. Share their harness registry and extraction helper, give each Function body a stable inline: URL, and include those ranges in the existing floor with original page line numbers.

Add behavioral assertions for all 21 reported gaps, including hero keyboard focus without a link and engines rejecting focus options. Real child-process fixtures verify dead-branch detection, differing Function parameter lists, page-line mapping, and coverage combined across processes. Update README checks; page scripts and workflow behavior are unchanged.

Fixes #275

Checks run locally

  • node --test scripts/*.test.mjs — 765 passed
  • scripts/check-links.test.sh — 114 passed
  • scripts/check-redirects.test.sh — 32 passed
  • scripts/check-redirects.sh — 13 entries, zero errors
  • scripts/check-links.sh --external-warn — stopped the slow external-network probe before completion
  • git diff --check

Commits carry DCO sign-off and Hive provenance trailers. This implementation was generated with an AI coding agent.

— hive: backend=codex model=gpt-6.1-sol


🐝 Hive Agent: contributor | SHA: 572babc

@hivecommons-hive hivecommons-hive Bot added author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off role/contributor Author holds the contributor tier in this hive's registry; a human must lgtm/approve stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 26, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the branch conflicts with the base and needs a rebase

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Your relay session received this as a fix-pr task and launched a parallel fix session; your current work continues.

Attribute harness execution to stable inline URLs and report original page lines. Assert all 21 previously uncovered ranges and verify mapping with real child coverage.

Hive-Run: hivecommons#275
Hive-Plan: issue-275-inline-coverage-floor
Hive-Spec: issue-275#recommendation
Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>

@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.

Decision needed: @clubanderson should decide whether #277 can be closed now that #276 (merged, closes #275) already carries the same change.

Conclusion: this duplicates #276, which merged to main and closed #275. Merging #277 is no longer possible as-is (mergeable: CONFLICTING), and a rebase would reproduce work that already landed. Flagging for a maintainer: if you agree, this one could be closed in favour of #276. I have not closed anything.

What I verified (both diffs read in full):

  • Both create scripts/inline-scripts.mjs with a byte-identical HARNESSED_SCRIPTS registry (hero / ACMM / projects in index.html, story dialog in stories/index.html) lifted out of scripts/page-scripts.test.mjs.
  • Both tag each extracted block with //# sourceURL=inline:<page>#<hook> so V8 attributes the new Function body to a stable URL (#277 scripts/inline-scripts.mjs:23; #276 scripts/inline-scripts.mjs:34).
  • Both extend scripts/coverage-floor.test.mjs to read inline: scripts, shift V8 offsets past the (function anonymous(…) { wrapper, and report the page's own line number (#277 coverage-floor.test.mjs:130-146 and the lines map in problemsOf; #276 inlineRunsFromReports/shiftRanges and { src, line } entries in problemsOf).
  • Both point the three harnesses (carousels, acmm-levels, story-dialog) at the shared extractor, add a prepare hook to each boot*(), and assert the same 21 dead ranges the extended floor finds (hero 13, projects 3, ACMM 3, dialog 2).
  • Both update the same README.md ## Checks entry for coverage-floor.

Where they differ (implementation detail, not intent): #277's inlineScript() returns a string and exposes inlineBlock() for the line; #276's returns { src, line }. #277 matches <script\b[^>]*> (any attributes); #276 matches bare <script> only. #277 adds scripts/inline-scripts.test.mjs; #276 asserts the throw arm inside page-scripts.test.mjs and adds a compiled-length sanity check. None of these are defects in #277 — they are just a second answer to the same question, and the first one is already on main.

Scope note: the PR body says "Fixes #275"; that issue is now closed via #276, so there is no remaining issue for this PR to resolve.

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

@thatguywob
thatguywob force-pushed the quality/275-inline-coverage branch from 572babc to de585d6 Compare October 26, 2026 10:47
@kubestellar-prow kubestellar-prow Bot added size/M and removed size/L labels Oct 26, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/072-returned-to-contributor Contributor PR: CI red, changes requested or conflicting; diagnosis posted, author must act labels Oct 26, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Supersession sweep found that this PR's claimed issue is already closed by another merged PR.

  • Claimed issue: hivecommons.github.io#275
  • Closing PR: #276

Decision needed (@hivecommons): #276 already merged and closed the claimed issue, but this PR touches files the merged PR did not. Recommended: keep open until the extra changes are reviewed, or close as superseded if they are not wanted. Another option: merge anyway.

Files the merged PR did not touch: scripts/inline-scripts.test.mjs.

This comment is edited in place by the supersession sweep; it is not duplicated.

@hivecommons-hive hivecommons-hive Bot added needs-human stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue labels Oct 26, 2026

@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.

Decision needed: @clubanderson should decide whether the test-only residual of #277 (three extra assertions over branches the floor already enforces, plus a README bullet) is worth landing now that #276 closed #275.

Conclusion: the code is correct and the suite is green, but after #276 merged this PR no longer does what its body says; what remains is additive test coverage over branches that are already executed on main. A maintainer needs to decide whether that residual is worth a merge.

What I verified at de585d6 (applied onto current main, node --test scripts/*.test.mjs → 768 pass, 0 fail):

  • The headline claim — "share their harness registry and extraction helper, give each Function body a stable inline: URL, include those ranges in the floor" — is already on main from #276 (f408d4a). This diff touches no .mjs helper and no .html; it is 74 added lines across scripts/inline-scripts.test.mjs (new), scripts/coverage-floor.test.mjs:343-382, scripts/carousels.test.mjs:1002-1019 and one README bullet (README.md:207-208). The body and "Fixes #275" describe #276's work, not this residual.
  • scripts/coverage-floor.test.mjs:326 ("every branch of every scripts/*.mjs helper and every inline page script is executed") passes on main without this PR, so the try { target.focus({ preventScroll: true }) } catch { target.focus() } fallback at index.html:811-812 that the new carousel test exercises is already covered; the new test pins the retry order ([{preventScroll:true}, undefined]) and tabIndex === -1, which the floor alone does not assert. That is the only behavioural assertion here that main lacks.
  • The new fixture at coverage-floor.test.mjs:343 overlaps the existing one at :293 (both spawn a real child run against a tmp page and assert the dead-branch line); the additions are the differing-parameter-list wrapper and the inline:unknown / node:fs / unknown-file URL filtering at :377. scripts/inline-scripts.test.mjs directly unit-tests inlineScript/inlineUrl, which main only covers indirectly through the floor.

Nothing here is wrong; nothing here is required. If it lands, the body should be rewritten to describe the residual and Fixes #275 dropped (the issue is already closed). I have not changed any labels or closed anything.

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

@hivecommons-hive hivecommons-hive Bot added stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 26, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Needs a decision, not a merge:

Head: verdict requires_human @de585d6, 0/0 checks green, DCO yes, soak 0s of 30m0s.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed.
  • Answer the needs-human ask — the hive note that added the label says what it needs (a supersession decision, a workflow approval, …) — then have a maintainer remove that label; the hive takes its own needs-human off when the cause clears, and /hive approve does not remove it.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

@clubanderson clubanderson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Land it: inline page scripts under the coverage floor is a real gain even though #276 closed #275; extra assertions are cheap. Thanks @thatguywob.

@clubanderson

Copy link
Copy Markdown
Member

/hive decision land as-is; change body to Refs #275 since #276 already closed it.
/lgtm
/approve

@kubestellar-prow

Copy link
Copy Markdown

LGTM label has been added.

DetailsGit tree hash: 46a1cc131ce111464c5db124b7285c8da746dffd

@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: clubanderson

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow
kubestellar-prow Bot merged commit 9f464c0 into hivecommons:main Oct 26, 2026
3 checks passed
@hivecommons-hive

Copy link
Copy Markdown
Contributor

Needs a decision, not a merge:

Head: verdict requires_human @de585d6, 0/0 checks green, DCO yes, soak 0s of 30m0s.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed. An ordinary contributor cannot release their own PR.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved author/clanker A contributor's own hive authored this PR under their login dco All commits are DCO signed-off dco-signoff: yes lgtm role/contributor Author holds the contributor tier in this hive's registry; a human must lgtm/approve size/M stage/085-needs-decision A human decision is owed: sentinel alert, hold/needs-decision label, human-only rule or parked issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] Branch-coverage floor does not cover the inline page scripts; #274 shipped 3 unasserted branches

2 participants