Preserve ignored path identity on POSIX - #64
Merged
Conversation
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
normalizeRepoPath()instead of rewriting every backslash as/Why
The immutable workspace gate compared ignored filesystem inputs against a small allowlist for explicitly supplied data artifacts. Two code paths used unconditional
replaceAll("\\", "/")normalization. That is correct on Windows, where\\is a path separator, but incorrect on POSIX, where a backslash is a legal filename character.As a result, a repository could contain two distinct POSIX paths such as
coverage/proof.lcovand the single filenamecoverage\\proof.lcov. The old ignored-file parser collapsed both identities tocoverage/proof.lcov. If the slash-separated LCOV artifact was explicitly allowed, the distinct ignored backslash-named file could be filtered out of the pre-execution rejection set as though it were the same artifact. Repository-defined checks can read that ignored file, so an immutable--run-checksanalysis could consume off-snapshot runtime input without the gate noticing it.The fix reuses
normalizeRepoPath(): it converts the native separator only (\\on Windows,/on POSIX) and therefore preserves literal POSIX backslashes. The allowlisted artifact path uses the same identity rule, avoiding both false aliasing and false rejection of a legitimately supplied POSIX filename containing a backslash.Verification
coverage/proof.lcovis allowed but a distinct ignoredcoverage\\proof.lcovis read by the repository test; analysis must reject before repository executionnpm testpassednpm run clean && npm run buildpassedgit diff --checkpassed