Repository navigation
Fold zero regions contradicted by a silent artifact of their own script - #1204
Merged
Merged
Conversation
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>
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.
Summary
Closes #1202.
The e2e coverage report counted
useFocusTrap.jsline 51'spreviousFocusarm (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
isContradictedRegionfolds 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:
src/components/hooks/useFocusTrap.jspreviousFocussrc/lib/profile-links.mjswebsitehitreturn nullin-browsersrc/lib/profile-links.mjsRadarReports 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 passnpm run test:unit:coverage:check— passese2e-coverage-report.mjs --check-source 100 --check-source-regions 95 --require-source-filesagainst the sealed local run — passes at 95.84%