Skip to content

test: record ADR 0007 accepted regions in the e2e coverage report - #1805

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

mrbobbytables merged 1 commit into
cncf:mainfrom
mrbobbytables:copilot/option-c-e2e

Conversation

@mrbobbytables

Copy link
Copy Markdown
Member

Summary

Makes the ADR 0007 triage of the residual browser-coverage regions machine-readable so the e2e report shows zero uncovered src/ regions and Hive quality agents stop re-filing them (#1736, #1692, #1676 were all this class).

  • New registry tests/e2e/fixtures/accepted-regions.json: 20 entries, each with file, span, ADR 0007 class and a one-line reason (13 data-shape-guard, 7 span-drift), measured on a fresh lane run at 49ec390.
  • tests/tools/e2e-coverage-report.mjs: accepted zeros are dropped from both numerator and denominator and listed in an "Accepted regions (ADR 0007)" section with their reasons; a new "Uncovered regions" section prints spans so entries can be copied. An accepted region that the lane now covers, or that the build no longer reports, is flagged stale and fails the report after the artifacts are written, so the registry cannot rot.
  • Thresholds are unchanged (100% source lines / 96% source regions); no attribution rule changed.
  • Tests: tests/e2e-coverage-accepted-regions.test.mjs (schema, file existence, accepted/not-accepted fixtures, both stale causes, malformed registry). Five copied vlq/reportArgs helpers in the reporter tests were extracted to tests/tools/e2e-coverage-identity-fixture.mjs; CLONE_CEILING lowered 251 to 245.
  • Docs: ADR 0007 amendment note and a CONTRIBUTING.md paragraph on when an entry may be added.

Report (same run, CI flags)

before after
src files 100.00 lines / 97.06 regions (660/680) 100.00 / 100.00 (660/660), 20 accepted

Validation

  • npm run test:unit:coverage:check: pass
  • format, lint, duplication, unused, spelling, markdown: pass
  • Spans were measured on Node 26; CI's Node 22 lane is the confirmation. If V8 region boundaries differ there, the stale list names the entries to adjust.

Refs #1736

Adds tests/e2e/fixtures/accepted-regions.json, a reviewed registry of the
zero-count regions the browser lane reports that ADR 0007 triages out of
browser coverage: 13 data-shape-guard entries and 7 span-drift entries, each
with its span as the report prints it and a one-line reason. The reporter
counts an accepted region as neither covered nor uncovered, prints the entries
in their own section, and lists uncovered regions by span so new entries can
be quoted from the report. The 100% source line and 96% source region floors
are unchanged. An entry whose span the run now covers or no longer reports is
stale and fails the report, and a unit test fails when an entry names a file
that no longer exists.

Refs cncf#1736

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 49bb2c5
🔍 Latest deploy log https://app.netlify.com/projects/endusers/deploys/6ada7f320099d25e2d536f8e
😎 Deploy Preview https://deploy-preview-1805--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.

@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 full diff against the tree at merge-base and ran the new test file locally. This looks correct to me.

What I verified:

  • Registry validation is strict (tests/tools/e2e-coverage-report.mjs:558-608): parseAcceptedRegions rejects non-src/ files, malformed spans, unknown classes, empty reasons, and duplicate file+span keys, with the entry index in the error.
  • Stale detection covers both causes: an accepted span met with count > 0 is pushed to stale and kept in the denominator (the return true after the push), and any entry left in pendingAccepted after the fold is flagged not a region this run reports. main() throws on stale entries only after writeFile of both artifacts (lines 1218–1219 vs 1291), matching the PR's claim that artifacts survive the failure.
  • Accepted-region matching runs after the phantom/drift/contradiction folds, so an entry can only consume a zero those folds didn't already remove — the denominator math stays consistent with the existing pipeline.
  • Spans spot-check against the actual sources: e.g. src/components/CaseStudies/index.js:52 is the data.caseStudies || [] fallback the registry entry describes.
  • Node 22 confirmation already happened: the registry was measured on Node 26, but the green "End-to-end coverage" check on this PR is CI's Node 22 run — a span mismatch there would have failed the lane via the stale check, so the 20 entries are confirmed against the CI toolchain.
  • node --test tests/e2e-coverage-accepted-regions.test.mjs: 8/8 pass locally; CI is fully green.

Docs (ADR 0007 amendment, CONTRIBUTING.md) match the implemented behavior, including the "floors do not move" claim — thresholds are untouched.

No defects found. Note for the maintainer: Refs #1736 is deliberate per the body (that issue tracks the re-filed-findings class); if this PR fully resolves it, it will need a manual close.

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

@mrbobbytables
mrbobbytables added this pull request to the merge queue Oct 22, 2026
Merged via the queue into cncf:main with commit f86fa9b Oct 22, 2026
14 checks passed
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