test(tar-xz): close 7 coverage partials with surgical v8 ignores#130
Merged
Conversation
Add v8 ignore start/stop wraps for unreachable code paths across checksum, format, file, and tar-parser modules. Each wrap targets a specific invariant (state-machine phases, validated input bounds, TS index guards) or negative-ROI Windows-only branch. Closes 7 partials; 1 new partial honestly exposed (legacy typeflag null arm).
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
Close 7 coverage partials in
packages/tar-xz/via surgicalv8 ignore start/stopwraps. Each wrap discloses its category in the rationale comment per the project convention authorized 2026-04-30: WRAP is acceptable for branches that are EITHER physically unreachable via the public API OR reachable-but-negative-ROI (fixture cost > catch value).Wraps applied (7)
file.tswriteFileEntryWin32mtime=0 false branch (Windows-only, fixture cost > value)file.tsextractFileuncommon entry types (CHARDEV/BLOCKDEV/FIFO/CONTIGUOUS — no public API produces them)format.tswriteStringTSnoUncheckedIndexedAccessguard (bytes[i]always defined within bound)format.tsparseHeaderheader[156]guard (after 512-byte validation)format.tsparseHeaderempty-string predicate via extractedisEmptyCharconst (String.fromCharCodealways returns 1-char)checksum.tscalculateChecksumheader[i]guard (after 512-byte validation)tar-parser.tsparseTarstate-machine invariant (phase === 'PADDING'always true here) — surgical 2-pragma splitSenior pre-push review
Two-pass senior Opus review: first pass flagged 3 over-suppressed wraps that masked EXECUTED code (
if-true bodies, ternary's tested arm). Implementer applied 3 fixes per verbatim recipe — narrowed to surgical scope, extracted const for ternary case, split wide wrap into two 1-line pragmas. Re-pass senior: SAFE-TO-PUSH, all wraps verified minimal-scope and correctly classified.Honest disclosure
One NEW partial is now exposed at
format.ts:186— the ternary's=== '\0'arm (legacy null typeflag,header[156] === 0). No existing test exercises this case. The previous wide wrap suppressed it silently; this PR narrows the wrap so the partial becomes visible. A 1-test follow-up could close it cleanly via a hand-crafted 512-byte header buffer withheader[156] = 0. Tracked for PR-θ2.Net coverage delta
format.ts:186exposure).packages/tar-xz/partials: ~13 → ~7 (6 remaining TEST candidates from prior analysis + the new exposure).Test plan
checksum.ts,tar-parser.tsat 100% lines/branches;format.tsshows the:186partial honestly;file.tspartial count unchanged for the 2 wrap targetspackages/tar-xz/test/(208 tests still pass)