Repository navigation
Keep a vendored pnpm patch when pnpm 11.0.0 to 11.0.2 rewrite its lock entry without the tarball - #2434
Conversation
…lock entry The pinned pnpm matrix failed on pnpm 11.0.0 in one cell of the vendored suite: the lock is put back while the overrides stay, a plain `pnpm install` writes it again, and `vex` was expected to attest once more. It exits 1 with `vendor_unwired` there. That verdict is right. pnpm 11.0.0 to 11.0.2 write the lock entry of a `file:` tarball without its `tarball` when they resolve it themselves (measured: 11.0.2 drops it, 11.0.3 keeps it, as do pnpm 9.0.0 to 10.34.9 and 12.0.0 on). The installed tree holds the patched bytes, but a frozen install of that lock from an empty store asks the registry for the release and fails on the vendored integrity (ERR_PNPM_TARBALL_INTEGRITY), so the lock wires nothing an install is sure to consume. The released 5.1.0 answers the same way, and running the scan again writes the entry back. - The cell expects `vendor_unwired` on those three releases, after checking that the lock has no tarball and that a frozen install of it from an empty store fails. Every other pnpm must still attest. - `vendor --check` said "no lockfile or config references" the artifact and that "a fresh install gets the unpatched package". Neither holds here: the lock still names it, and the install fails. It now reports `wiring incomplete`, names the lock and the pnpm releases, and points at `scan --mode vendored` as well as `vendor` (a project vendored through the scan has no manifest for `vendor` to read). - The matrix gains 11.0.3 as the other side of the boundary, and 11.29.0 and 12.25.1, the newest release of each line. The matrix workflow had been switched off since 2026-10-09, so the cell never ran on 11.0.0 in CI. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Review of the first commit found that its `vendor --check` wording fired for any dead entry whose patch a pnpm lock still mentions, and that the remedy it names did not always work. Both come from one place: the lock reader took a `name@file:<artifact>` entry with an integrity and no tarball (what pnpm 11.0.0 to 11.0.2 write) for a `file:` directory of the user's. Nothing then kept the ledger entry: - `scan --mode vendored` on a checkout with no installed tree skipped it as "no longer used by the lockfile" and left the lock as it was; - `scan --mode vendored --prune` there reverted the vendored patch (measured against the production patch service on pnpm 11.0.0: the artifact and the override were removed). The reader now recognises the entry by its key, withholds it, and says why. So `vex` still omits the patch (`vendor_unwired`), `vendor --check` reports the reader's own reason (`wiring incomplete`, naming the lock, the pnpm releases and the remedy), the prune keeps the patch, and the next vendored scan writes the entry back, with or without an installed tree. A `file:` directory dependency, which records no integrity, is read as before, and a lock that was resolved from the registry again gets the old message and no mention of a pnpm release. The real-pnpm cell also runs `vex` with the patched tree still installed, and checks that the frozen install fails for want of the tarball. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
PR SummaryMedium Risk Overview The pnpm lock reader now treats
CI and tests add matrix pins 11.0.3, 11.29.0, 12.25.1; the vendored cell expects no attestation and failed frozen install on 11.0.0–11.0.2; new offline/unit tests lock the boundary. Docs and Reviewed by Cursor Bugbot for commit c0e50d4. Configure here. |
…d-lock-rewrite # Conflicts: # crates/socket-patch-core/src/vex/discover/npm.rs
|
[agent] PR shepherd: review brief for the approver What it does Now such an entry is read as the vendored entry, withheld:
The CI matrix gains pnpm 11.0.3, 11.29.0 and 12.25.1. Risk
Every other entry takes the old path unchanged. The user-visible change is more conservative output (attest less, prune less). Look here
Verified
Open questions (nits, not blocking)
Generated by Claude Code |
Problem
The pinned pnpm matrix (
pnpm hosted compatibility) fails on pnpm 11.0.0, onmain, in one cell of the vendored suite. The cell putspnpm-lock.yamlback as it was while the overrides stay, lets a plainpnpm installwrite the lock again, and expectsvexto attest once more. On 11.0.0vexexits 1 withvendor_unwired.The workflow had been switched off since 2026-10-09, so the cell never ran on 11.0.0 in CI. It is on again, and this is its only failure: pnpm 1.0.0 to 8.15.9 and every other pnpm 9 to 12 pass.
Cause
vexis right. pnpm 11.0.0, 11.0.1 and 11.0.2 write the lock entry of afile:tarball without itstarballwhen they resolve it themselves:The installed tree still holds the patched files. But a frozen install of that lock from an empty store asks the registry for the release and fails on the vendored integrity (
ERR_PNPM_TARBALL_INTEGRITY). It never installs the unpatched package, and it never installs the patched one either, so the lock wires nothing an install is sure to consume.Measured with real pnpm against the production patch service (
minimist@1.2.2):tarballERR_PNPM_TARBALL_INTEGRITYtarballtarballvexrefusing is not a regression: the released 5.1.0 gives the samevendor_unwiredfor that lock.A bug behind it
The lock reader took that entry for a
file:directory of the user's, so nothing kept the vendored patch in use. Measured on pnpm 11.0.0 against the production patch service, on a checkout with no installed tree (a CI clone):scan --mode vendoredscan --mode vendored --pruneWith an installed tree both builds write the entry back. So a project on pnpm 11.0.0 to 11.0.2 that let pnpm rewrite the lock and then ran a prune in CI lost its patch without being told.
Changes
name@file:<vendored artifact>entry with an integrity and no tarball is the vendored entry, withheld:vexomits the patch (vendor_unwired), the prune keeps it, and the next vendored scan writes the entry back, with or without an installed tree. Afile:directory dependency, which records no integrity, is read as before.vendor --checkgives the reader's reason. It used to say "no lockfile or config references" the artifact, so "a fresh install gets the unpatched package", and to re-runsocket-patch vendor. None of that holds here: the lock still names the artifact, a fresh install fails instead, and a project vendored throughscan --mode vendoredhas no manifest forvendorto read. It now sayswiring incomplete, names the lock, the pnpm releases and what the install does, and points atscan --mode vendoredas well asvendor. Other states keep their messages.vexomits the patch with the patched tree installed and without it, and that a frozen install from an empty store fails for want of the tarball. Every other pnpm must still attest, and from pnpm 9 on must write the tarball.docs/ecosystems.mdtells a user on those three releases what happens and how to get out of it;docs/testing/pnpm-compatibility.mdrecords the measurement; the contract lists the newvendor --checkreason.Proof
pnpm_lock_entry_rewritten_without_its_tarball_is_not_attested) builds the lock both ways: with the tarballvexattests andvendor --checkpasses; without itvexomits the patch andvendor --checkfails with the new reason. A lock resolved from the registry again gets the old message and no mention of a pnpm release.pnpm_entry_without_its_tarball_is_dead_but_kept_by_the_prune_gc) pins that the entry is not live, is still in use for the prune, carries the reason, and that afile:directory is not taken for one.cargo fmt --check,cargo clippy --locked --workspace --all-features -- -D warnings, the core unit tests (8,819), the CLI unit tests and thecli,cli_parse_vendor,command_module_layeringande2e_vex_vendorsuites pass locally.Code review
/code-review highran on the first commit. It found that the first version of thevendor --checkwording fired for any dead entry a pnpm lock still mentions, that the remedy it named did not work on a checkout with no installed tree, and that the prune reverted the patch there. The second commit fixes all three at the lock reader. Its smaller points are fixed too: the cell checks why the frozen install fails and runsvexwith the tree installed, the texts agree on what the install does, and a git-branch lock is read likepnpm-lock.yaml.For a maintainer
🤖 Generated with Claude Code