Skip to content

Fold zero regions contradicted by a silent artifact of their own script - #1204

Merged
mrbobbytables merged 1 commit into
cncf:mainfrom
mrbobbytables:e2e-union-uniform-witness
Oct 8, 2026
Merged

mrbobbytables merged 1 commit into
cncf:mainfrom
mrbobbytables:e2e-union-uniform-witness

Conversation

@mrbobbytables

Copy link
Copy Markdown
Member

Summary

Closes #1202.

The e2e coverage report counted useFocusTrap.js line 51's previousFocus arm (51:25-51:41) as uncovered even though the member-directory specs demonstrably execute it. The diagnosis differs from the containment hypothesis in the issue: V8 emits a deviation range only where a count differs from the enclosing one, so the trigger-unmounted page's artifact — which runs the cleanup uniformly — records no range over the arm at all. The zero recorded by every truthy-path artifact then survives the union with no covered twin for the #1163 crossing fold to catch.

The fold

Silence is proof, but only within one script: one script has one source map, so identical skipped text always maps to the same original span. The new isContradictedRegion 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 to different spans per chunk — and an earlier any-artifact draft of this rule wrongly folded RadarReports' empty-corpus arms (#1097/#1187) and other genuinely dead arms. The same-script restriction keeps all of those standing; regression tests pin the fold and both edges of its evidence requirement (same-script zero provenance, no line-touching zero on the witness).

Measured effect (full local run, 340 specs)

Folds exactly three regions:

file region why it really executes
src/components/hooks/useFocusTrap.js 51:25-51:41 cleanup with trigger unmounted focuses previousFocus
src/lib/profile-links.mjs 51:33-51:45 members without a website hit return null in-browser
src/lib/profile-links.mjs 53:16-53:28 same, blank-string arm

RadarReports 6/24, CaseStudies 46/64, CommunityPeople 134, and DirectoryFreshness 19/30/44/49 all remain uncovered, as they should.

Source regions: 438/457 = 95.84% (was 438/460 = 95.22%); the floor stays at 95 (floor(95.84)), so no gate or doc changes.

The enclosure-pinning fixture now serves its containing covered region from a second chunk: under V8 semantics a same-script artifact that is uniform over the arm asserts the arm executed — which is exactly this fold's evidence, pinned separately.

Validation

  • node --test tests/e2e-coverage-report.test.mjs — 53 pass
  • npm run test:unit:coverage:check — passes
  • e2e-coverage-report.mjs --check-source 100 --check-source-regions 95 --require-source-files against the sealed local run — passes at 95.84%

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

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
@mrbobbytables
mrbobbytables added this pull request to the merge queue Oct 8, 2026
Merged via the queue into cncf:main with commit 593b9fe Oct 8, 2026
7 checks passed
@mrbobbytables
mrbobbytables deleted the e2e-union-uniform-witness branch October 8, 2026 12:38
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.

[quality] e2e union: useFocusTrap.js line 51 drift survives #1163's crossing fold — the non-crossing drift shape still needs folding

1 participant