Repository navigation
fix(coverage): fold e2e regions whose spans cross across artifacts - #1163
Merged
Merged
Conversation
Two branch spans of one source file either nest or stay disjoint, because both are AST extents. A covered span that begins inside a zero span and ends after it is a crossing, which no source can produce; it only appears when two artifacts of the same chunk map one original branch to different spans. getRegionCoverage now carries the start and end columns it already encoded into the region key, and the report drops a zero-count region that any covered region crosses. This folds the three regions #1079 names -- MemberProfile.js 10 and 15, MemberCard.js 75 -- which #1051's multi-line fold and #1066's ordinal key both leave standing because their start columns differ. The rule is narrower than containment on purpose: a covered region that encloses a zero one is the ordinary shape of a branch arm inside an executed block, so enclosure is still never treated as drift and the guard added in #1114 continues to pass unchanged. Signed-off-by: quality <quality@hive.kubestellar.io>
Contributor
Author
|
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. Non-outreach agents are held at ACMM L3–L5; the Hive will keep the |
This was referenced Oct 7, 2026
Closed
Merged
This was referenced Oct 8, 2026
mrbobbytables
added a commit
to mrbobbytables/endusers
that referenced
this pull request
Oct 8, 2026
The last completion criterion of cncf#1079: re-derive --check-source-regions from the corrected number after cncf#1163 folded the crossing-region source-map drift the issue measured. A full local run of the pipeline (build:e2e:coverage, 340 passing specs, seal, report) at main measures source regions at 95.22% (438/460), up from the 80.98% that set the current floor of 91's predecessor. The three regions cncf#1079 proved executed (MemberProfile.js 10 and 15, MemberCard.js 75) now fold, and MemberDirectory/index.js 31/34/40/43 are covered for real since cncf#1060 merged. Following the established ratchet pattern (measured 91.63 -> floor 91 in cncf#1105), the floor becomes floor(95.22) = 95. Updated in the same change, as tests/e2e-coverage-gate.test.mjs instructs: the workflow gate, the FLOORS guard and its fixtures, the workflow-scripts gating assertion, and the CONTRIBUTING.md recipe. Closes cncf#1079 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>
mrbobbytables
added a commit
to mrbobbytables/endusers
that referenced
this pull request
Oct 8, 2026
…pt (cncf#1204) V8 emits a deviation range only where a count differs from the enclosing one, so an artifact that executes a branch arm uniformly with the code around it records no range over the arm at all. When every truthy-path artifact of a chunk records the arm at zero, that silence leaves the zero standing in the union with no covered twin for the crossing fold (cncf#1163) to catch: useFocusTrap's previousFocus arm (51:25-51:41) runs exactly once this way on the trigger-unmounted page, yet the report counted it uncovered. The silence is proof, but only within one script: one script has one source map, so identical skipped text always lands on the same original span. isContradictedRegion therefore folds a zero region only when some artifact of a script that recorded the zero itself covers all the region's lines while recording no zero touching any of them. Cross-chunk absence proves nothing (drift maps the same dead arm elsewhere), so RadarReports' and DirectoryFreshness's genuinely dead arms survive, as pinned by the regression tests. Measured on a full local run: folds useFocusTrap 51:25-51:41 and profile-links 51:33-51:45 / 53:16-53:28 (members without websites execute those return-null arms in-browser); src regions 438/457 = 95.84%, floor 95 unchanged. The enclosure-pinning fixture now serves its containing covered region from a second chunk: a same-script artifact that is uniform over the arm is V8's statement that the arm executed, which is this fold's evidence. Closes cncf#1202 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
tests/tools/e2e-coverage-report.mjsnow drops a zero-count region that acovered region crosses: one that begins strictly inside the zero span and
ends strictly after it.
Two branch spans of one source file either nest or stay disjoint, because both
are AST extents. A crossing pair is not a shape the language can produce, so it
can only arise when two artifacts of the same chunk map one original branch to
different spans — which is exactly what #1079 measured:
src/components/MemberDirectory/MemberProfile.js10:40-10:4810:44-15:19src/components/MemberDirectory/MemberProfile.js15:19-15:8015:70-38:15src/components/MemberDirectory/MemberCard.js75:19-75:4075:33-81:1In all three the start columns differ, so the ordinal key proposed in #1066
keeps them apart, and neither span contains the other, so #1051's multi-line
fold leaves them standing.
getRegionCoverage()now keeps the start and end columns it already encodedinto the region key, which is what makes the comparison possible at all.
Why crossing and not containment
#1079's first recommendation was containment. The guard merged in #1114
established that containment is the wrong rule: a covered region that encloses
a zero one is the ordinary shape of a branch arm inside an executed block, and
GroupLinkStatus's
checkedAtguard and RadarReports' empty-corpus arms areenclosed exactly that way. Folding on enclosure would have erased real gaps that
#1094 and #1097 are writing tests for.
Crossing is strictly narrower. The test added in #1114 — "a single-line
zero-count region survives a covered region that encloses it" — passes
unchanged, including the same-start-column case it pins.
Tests
tests/e2e-coverage-report.test.mjsgains "a zero-count region crossed by acovered one is treated as source-map drift", sitting directly beneath #1114's
guard so the two shapes are read together. Its source map carries mappings at
columns 0, 3 and 6 of line 1 so that a crossing is representable at all, and the
zero region
1:0-1:6is crossed by the covered1:3-3:12. The drifted half isdropped from numerator and denominator, so no file is credited for a region
nobody observed.
npm run test:unit— 2026 passed, 0 failednpm run test:unit:coverage:check— passes;tests/tools/e2e-coverage-report.mjsat 100.00% lines / 93.65% regions, with every added line covered
npx prettier --checkon both touched files — cleanRelated Issue
Refs #1079 — the last completion criterion, re-deriving
--check-source-regionsfrom the corrected number, is deliberately left open. That floor lives at
.github/workflows/ci.yml:257(asserted bytests/workflow-scripts.test.mjs:355),and a diff under
.github/workflows/is rejected server-side for this lane'scontributor-tier app token. Refs #1079 (needs-human: raising the e2e regionfloor requires editing
.github/workflows/ci.yml, which this lane cannot push).Leaving the floor at 91 is safe in the meantime: it is a minimum, and this change
only raises the measured percentage.
Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88