Conversation
A package whose npm tarball ships CRLF can never byte-match the committed copy: git normalises line endings on commit, so the vendored blob is the LF form while the tarball is not. The registry check reported every such file as modified. whatwg-url@5.0.0, vendored under node-fetch by benchmark-action/github- action-benchmark (#1283), is the live case -- lib/url-state-machine.js is 33573 bytes with 1297 CRs as published and 32276 bytes with none as committed. Folding the tarball's CRLF to LF hashes to 27d977a25f9011fc31ed28c17ba11f729b85edea, exactly the committed blob. Hashing the folded bytes is a proof, not a heuristic: a match means the committed file is the published content, line endings aside. A real edit still fails, which the precision-guard test pins. Reported separately from verified so the output says why the file did not byte-match rather than hiding it. Generated-by: Claude Opus 5
Member
Author
|
Nudge on my open PRs, @dfoulks1 @ppkarwasz - five are green and waiting, and they are easier to read as one set than separately. Two are checker fixes, and these are the ones worth your time:
Two record how the checkers get used:
And one tool change:
No rush on any of them, and happy to split #1263 up if the rebase makes it awkward to review. #1297 is the one I would land first if you only have time for one. |
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.
Vendored npm registry checkbyte-compares each committed file against the integrity-verified registry tarball. A package whose tarball ships CRLF can never pass that comparison: git normalises line endings on commit, so the committed blob holds the LF form while the tarball does not. Every such file was reported asmodified, which reads as tampering.\r\nfolded to\n, and credits the file when that hashes to the committed blob.crlf_normalizedcategory rather than silently folding them intoverified, so the output says why the file did not byte-match.This is a proof rather than a heuristic: if the folded bytes hash to the committed blob, the committed file is the published content, line endings aside.
Live case — #1283.
benchmark-action/github-action-benchmarkvendorsnode-fetch's nestedwhatwg-url@5.0.0, a 2016-era package whose tarball shipslib/url-state-machine.jswith CRLF:c25dbc2c4862...27d977a25f90...33573 - 32276 = 1297, exactly the CR count, anddiff --strip-trailing-crreports the two identical. Folding the tarball's CRLF hashes to27d977a25f9011fc31ed28c17ba11f729b85edea- the committed blob GitHub reports. The other 26 vendored packages in that action matched byte-for-byte, so this was a single file failing for a reason unrelated to the action's security posture, on every bump.Test plan:
uv run pytest utils/tests/- 353 passed.prek run --files ...passes. The two new tests fail without the fix (reproducing #1283's exact output:content differs from registry tarball) and pass with it.🤖 Generated with Claude Code