Skip to content

Preserve LCOV source-path whitespace - #57

Merged
hzw0813 merged 5 commits into
mainfrom
fix/lcov-source-path-whitespace
Aug 15, 2026
Merged

Preserve LCOV source-path whitespace#57
hzw0813 merged 5 commits into
mainfrom
fix/lcov-source-path-whitespace

Conversation

@hzw0813

@hzw0813 hzw0813 commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • stop trimming LCOV SF: source-path records before repository-path resolution
  • preserve leading/trailing ASCII and Unicode whitespace as literal path characters so coverage for one path cannot alias another changed file
  • add regressions for trailing ASCII space, trailing NBSP, and leading ASCII space
  • regenerate tracked dist and document the evidence-boundary fix

Why

parseLcov() used record.slice(3).trim(). That normalization changes LCOV path identity: for example, SF:src/value.js  (NBSP) was interpreted as src/value.js. If the artifact then reported hits for changed lines, ProofDiff could attach coverage evidence to a different repository path than the one named by the artifact.

Coverage artifacts are explicitly user-supplied and not independently attested, but ProofDiff still must not strengthen them by rewriting path identity. The parser now preserves the SF: payload exactly and lets normal repository containment checks decide whether it matches a changed file.

Verification

  • full npm test passed after the change
  • clean npm run clean && npm run build passed
  • final branch diff contains only src/coverage.ts, tests/coverage.test.ts, CHANGELOG.md, and regenerated dist/coverage.*; temporary updater files were removed

@hzw0813
hzw0813 merged commit df3267e into main Aug 15, 2026
13 checks passed
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.

1 participant