Repository navigation
[quality] e2e union: useFocusTrap.js line 51 drift survives #1163's crossing fold — the non-crossing drift shape still needs folding #1202
Description
Finding
The fourth drift case recorded on #1079 (comment, the previousFocus operand of useFocusTrap's effect cleanup) is not folded by the crossing rule PR #1163 landed, while the issue's three primary regions are.
Verified on a full local run at main 29fd4d8 (build:e2e:coverage, 340 passed, seal, report):
src/components/hooks/useFocusTrap.js | 100.00 | 90.48 | | 35 51
src files | 100.00 | 95.22 | 2099/2099 lines | 438/460 regions
MemberProfile.js10/15 andMemberCard.js75: folded (both files 100% regions) — fix(coverage): fold e2e regions whose spans cross across artifacts #1163 works for strict crossings.useFocusTrap.js51: still zero in the union, though [quality] e2e region union still counts three demonstrably-executed single-line arms uncovered; their covered twin differs in START column, which #1066's proposed key would miss #1079's control run (thefocus-trap-trigger-unmountedspec alone, real build only) records it covered. The execution proof stands; the drift pair evidently nests or shares an endpoint rather than strictly crossing, so#1163's rule (covered span starts strictly inside the zero span and ends after it) does not fire.
Why it matters
#1079 closes with PR #1201 (floor ratcheted to 95 from the corrected 95.22%). This region is inside the new floor's headroom, but it is a measured-executed region counted uncovered — the exact defect class #1079 documented — and it is the first case on a path with no data-variant of its own, so the fix cannot be reasoned away as variant-build divergence.
Recommendation
- Dump the region pairs for
useFocusTrap.jsline 51 from the union intests/tools/e2e-coverage-report.mjs(same instrumentation [quality] e2e region union still counts three demonstrably-executed single-line arms uncovered; their covered twin differs in START column, which #1066's proposed key would miss #1079 describes) to classify the drift shape — likely containment with differing start column, the case [quality] e2e region union still counts three demonstrably-executed single-line arms uncovered; their covered twin differs in START column, which #1066's proposed key would miss #1079's original recommendation ('fold a zero-count region into a covered one when the covered region's span contains it') was written for. - Extend the fold accordingly, keeping the guard fix(coverage): fold e2e regions whose spans cross across artifacts #1163's test pins: a single-line zero region that is enclosed by a covered region over fully-covered lines must still survive when it is a genuinely independent arm (the
MemberDirectory/index.js31/34/40/43 shape, now covered by test: cover the member directory's four undriven toolbar controls #1060, remains the canonical counterexample to naive enclosure folding). - Regression test in
tests/e2e-coverage-report.test.mjswith two artifacts of one chunk reproducing the non-crossing drift pair. - Re-derive
--check-source-regionsafterwards (expected: 439/460 if only line 51 folds; line 35 is a phantom guard arm with no browser path — both lightboxes always render a close button — and should not be expected to fold).
Provenance
Local pipeline at 29fd4d8, node v26, pinned Playwright chromium: npm run build:e2e:coverage; e2e-coverage-run.mjs init; npm run test:e2e:coverage (340 passed); seal; e2e-coverage-report.mjs --input <dir> --build build. Gate --check-source 100 --check-source-regions 95 --require-source-files exits 0 on the same run.
Activity
Fold zero regions contradicted by a silent artifact of their own scri…