diff --git a/.github/workflows/pnpm-compatibility.yml b/.github/workflows/pnpm-compatibility.yml index 135e525ff..6808baf89 100644 --- a/.github/workflows/pnpm-compatibility.yml +++ b/.github/workflows/pnpm-compatibility.yml @@ -109,7 +109,7 @@ jobs: - node: '16.20.2' pnpm: 4.0.0 4.14.4 5.0.0 5.18.11 6.0.0 6.35.1 7.0.0 7.33.7 8.0.0 8.15.9 - node: '24.11.1' - pnpm: 9.0.0 9.15.9 10.0.0 10.33.0 10.34.5 11.0.0 11.27.0 12.0.0 12.4.2 + pnpm: 9.0.0 9.15.9 10.0.0 10.33.0 10.34.5 11.0.0 11.0.3 11.27.0 11.29.0 12.0.0 12.4.2 12.25.1 steps: - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: diff --git a/crates/socket-patch-cli/CLI_CONTRACT.md b/crates/socket-patch-cli/CLI_CONTRACT.md index 9ac66ac81..d0a9e4f14 100644 --- a/crates/socket-patch-cli/CLI_CONTRACT.md +++ b/crates/socket-patch-cli/CLI_CONTRACT.md @@ -3520,7 +3520,11 @@ entry; re-vendoring cannot reach it, #1511), or, for npm and PyPI, a dependency resolves any more (`dependency removed`; `scan --mode vendored --prune` reverts the entry), or, for PyPI, a project file that still names the artifact while nothing installs from it (`wiring incomplete`, naming the file; re-lock, then -re-vendor or revert, #1374). For a package-lock entry, drift also includes a +re-vendor or revert, #1374), or a `pnpm-lock.yaml` that still names the +artifact in an entry pnpm does not install from (`wiring incomplete`, naming +the lock: pnpm 11.0.0 to 11.0.2 rewrite the entry of a `file:` tarball +without its `tarball`, and a frozen install of that lock fails; re-run +`scan --mode vendored` or `vendor`). For a package-lock entry, drift also includes a `package-lock.json` / `npm-shrinkwrap.json` entry for the vendored `name@version` that `vendor` would rewire but that does not resolve to the vendored artifact (#588); the reason names that entry. It also includes any entry for that diff --git a/crates/socket-patch-cli/src/commands/vendor.rs b/crates/socket-patch-cli/src/commands/vendor.rs index 5bbb5e53e..87757d5aa 100644 --- a/crates/socket-patch-cli/src/commands/vendor.rs +++ b/crates/socket-patch-cli/src/commands/vendor.rs @@ -608,6 +608,11 @@ pub(crate) async fn dispatch_revert_one_opts( /// * a pnpm lock wires the artifact through an override the project's /// settings do not declare, so pnpm does not install that lock (#2382): /// the extractor's own diagnostic, which names the file and the remedy; +/// * a pnpm lock still names the artifact in an entry that records no +/// tarball (pnpm 11.0.0 to 11.0.2 rewrite the entry of a `file:` tarball +/// so): the extractor's own diagnostic again, since "no lockfile +/// references it, a fresh install gets the unpatched package" would be +/// false twice over; /// * otherwise a relock dropped the reference while the package stayed. async fn unwired_check_failure( discovery: &socket_patch_core::vex::discover::Discovery, @@ -650,6 +655,12 @@ async fn unwired_check_failure( if let Some(diag) = discovery.pnpm_override_undeclared(&entry.uuid) { return format!("wiring incomplete: {}", diag.detail); } + // A pnpm lock still names the artifact in an entry that records no + // tarball (pnpm 11.0.0 to 11.0.2 rewrite it so): the lock is not gone, + // and an install of it fails instead of getting the unpatched package. + if let Some(diag) = discovery.pnpm_tarball_dropped(&entry.uuid) { + return format!("wiring incomplete: {}", diag.detail); + } // Only the npm-family and Python extractors record every lock entry // (`resolved_elsewhere`), so only there does "no lock resolves it" // prove the dependency is gone rather than unreadable. diff --git a/crates/socket-patch-cli/tests/e2e_vendor_pnpm_build.rs b/crates/socket-patch-cli/tests/e2e_vendor_pnpm_build.rs index b3299aeb9..af820ceb0 100644 --- a/crates/socket-patch-cli/tests/e2e_vendor_pnpm_build.rs +++ b/crates/socket-patch-cli/tests/e2e_vendor_pnpm_build.rs @@ -141,6 +141,20 @@ fn keeps_relative_file_overrides(pm: &str) -> bool { matches!(parts.as_slice(), [7, minor, _] if *minor <= 17) } +/// pnpm 11.0.0-11.0.2 write the lock entry of a `file:` tarball without its +/// `tarball` when they resolve it themselves (measured 2026-12-01: 11.0.2 +/// drops it, 11.0.3 keeps it, as do 9.0.0-10.34.9 and 12.0.0 on). The lock +/// then names the artifact in its key, importer and override, but a frozen +/// install of it from an empty store asks the registry for the release and +/// fails on the vendored integrity (`ERR_PNPM_TARBALL_INTEGRITY`). +fn drops_file_tarball_on_relock(pm: &str) -> bool { + let Some(v) = pm.strip_prefix("pnpm@") else { + return false; + }; + let parts: Vec = v.split('.').filter_map(|p| p.parse().ok()).collect(); + matches!(parts.as_slice(), [11, 0, patch] if *patch <= 2) +} + /// pnpm 9.0.0-9.0.4: the last releases that absolutize a `file:` override's /// importer specifier (measured 2026-09-22: 9.0.4 refuses the relative /// spelling under `--frozen-lockfile`, 9.0.5 accepts it). @@ -1258,13 +1272,73 @@ fn assert_manifestless_vendored_vex( patched, "[{tag}] a plain install must re-apply the overrides (vendored bytes)" ); - // The lock pnpm just rewrote wires the artifact again. - let out = run_vex(&bin, fresh, &VexRun::online(&api)); - assert_eq!(out.code, Some(0), "[{tag}] reinstalled: {out}"); - assert_attested(out.doc(), purl, UUID, Marker::Vendored, VENDOR_VULNS); - eprintln!( - "VEX-CELL vendored [{tag}] lock-only-revert(overrides kept): attested once reinstalled" - ); + let relocked = std::fs::read_to_string(&lock).unwrap(); + if drops_file_tarball_on_relock(pm) { + // This pnpm wrote the entry without its tarball. The installed + // tree holds the vendored bytes, but the lock no longer says + // where the package comes from: a frozen install of it from an + // empty store fails (offline it has no tarball to take, online + // the registry's fails the vendored integrity). So the lock + // wires nothing an install is sure to consume, and nothing is + // attested until the entry is written again. + assert!( + !relocked.contains("tarball: file:"), + "[{tag}] this pnpm is listed as dropping the tarball when it writes the lock:\n\ + {relocked}" + ); + // With the patched tree still installed, and without it. + let not_attested = |state: &str| { + let out = run_vex(&bin, fresh, &VexRun::online(&api)); + assert_ne!(out.code, Some(0), "[{tag}] relocked, {state}: {out}"); + assert_absent(out.doc.as_ref(), purl); + assert_not_attested(&out.envelope, purl, "vendor_unwired"); + }; + not_attested("the patched tree installed"); + let empty = fresh.with_file_name("store-relocked"); + std::fs::remove_dir_all(fresh.join("node_modules")).unwrap(); + let frozen = corepack( + fresh, + pm, + &[ + "install", + "--frozen-lockfile", + "--offline", + "--store-dir", + empty.to_str().unwrap(), + ], + ); + let said = format!( + "{}{}", + String::from_utf8_lossy(&frozen.stdout), + String::from_utf8_lossy(&frozen.stderr) + ); + // Offline pnpm has no tarball to take; online it is the + // registry's, which fails the vendored integrity. + assert!( + !frozen.status.success() && said.contains("TARBALL"), + "[{tag}] a frozen install of the lock pnpm rewrote must fail for want of the \ + tarball, from an empty store: {said}" + ); + not_attested("no tree installed"); + eprintln!( + "VEX-CELL vendored [{tag}] lock-only-revert(overrides kept): not attested, pnpm \ + rewrote the lock without the tarball" + ); + } else { + // The lock pnpm just rewrote wires the artifact again (pnpm + // 9 and later write the tarball beside the integrity). + assert!( + pnpm_major(pm).is_none_or(|major| major < 9) || relocked.contains("tarball: file:"), + "[{tag}] the lock pnpm rewrote must record the tarball:\n{relocked}" + ); + let out = run_vex(&bin, fresh, &VexRun::online(&api)); + assert_eq!(out.code, Some(0), "[{tag}] reinstalled: {out}"); + assert_attested(out.doc(), purl, UUID, Marker::Vendored, VENDOR_VULNS); + eprintln!( + "VEX-CELL vendored [{tag}] lock-only-revert(overrides kept): attested once \ + reinstalled" + ); + } std::fs::write(&lock, &lock_wired).unwrap(); }); eprintln!("MANIFEST-LESS VENDORED VEX OK ({tag})"); diff --git a/crates/socket-patch-cli/tests/e2e_vex_vendor.rs b/crates/socket-patch-cli/tests/e2e_vex_vendor.rs index ba3acf8e5..3c6d25725 100644 --- a/crates/socket-patch-cli/tests/e2e_vex_vendor.rs +++ b/crates/socket-patch-cli/tests/e2e_vex_vendor.rs @@ -3181,6 +3181,117 @@ fn vendored_pnpm_pin_with_the_lock_off_needs_its_override() { assert_vendored_attested(cwd, purl, "the override routes it without a lock"); } +/// pnpm 11.0.0 to 11.0.2 write the lock entry of a `file:` tarball without +/// its `tarball` when they rewrite the lock (measured 2026-12-01 against +/// real pnpm: 11.0.2 drops it, 11.0.3 keeps it). The lock still names the +/// artifact in its key, its importer and its override, but a frozen install +/// of it from an empty store asks the registry for the release and fails on +/// the vendored integrity. So the lock wires nothing an install is sure to +/// consume: `vex` does not attest the patch, and `vendor --check` fails the +/// entry, naming the lock that still names the artifact instead of saying +/// that no lockfile does. The same lock with the tarball attests and +/// verifies (the control). +#[test] +fn pnpm_lock_entry_rewritten_without_its_tarball_is_not_attested() { + let tmp = tempfile::tempdir().unwrap(); + let cwd = tmp.path(); + let uuid = "55555555-5555-4555-8555-555555555555"; + let purl = "pkg:npm/foo@1.0.0"; + let rel = write_foo_ledger( + cwd, + uuid, + b"patched foo\n", + &[("package.json", "override"), ("pnpm-lock.yaml", "lock")], + ); + std::fs::write( + cwd.join("package.json"), + format!( + r#"{{"name":"app","version":"0.1.0","dependencies":{{"foo":"1.0.0"}},"pnpm":{{"overrides":{{"foo@1.0.0":"file:{rel}"}}}}}}"# + ), + ) + .unwrap(); + std::fs::write( + cwd.join("pnpm-workspace.yaml"), + format!("packages:\n - '.'\noverrides:\n foo@1.0.0: file:{rel}\n"), + ) + .unwrap(); + // The lock as pnpm writes it for the override, with and without the + // tarball of the entry. + let lock = |tarball: &str| { + format!( + "lockfileVersion: '9.0'\n\nsettings:\n autoInstallPeers: true\n \ + excludeLinksFromLockfile: false\n\noverrides:\n foo@1.0.0: file:{rel}\n\n\ + importers:\n\n .:\n dependencies:\n foo:\n \ + specifier: file:{rel}\n version: file:{rel}\n\npackages:\n\n \ + foo@file:{rel}:\n \ + resolution: {{integrity: sha512-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=={tarball}}}\n \ + version: 1.0.0\n\nsnapshots:\n\n foo@file:{rel}: {{}}\n" + ) + }; + let check = || { + let out = cli() + .args(["vendor", "--check", "--cwd", cwd.to_str().unwrap()]) + .output() + .expect("invoke vendor --check"); + let said = format!( + "{}{}", + String::from_utf8_lossy(&out.stdout), + String::from_utf8_lossy(&out.stderr) + ); + (out.status.code(), said) + }; + + std::fs::write( + cwd.join("pnpm-lock.yaml"), + lock(&format!(", tarball: file:{rel}")), + ) + .unwrap(); + assert_vendored_attested(cwd, purl, "the entry records its tarball"); + let (code, said) = check(); + assert_eq!(code, Some(0), "the wiring is intact: {said}"); + + std::fs::write(cwd.join("pnpm-lock.yaml"), lock("")).unwrap(); + assert_never_attested(cwd, purl); + let (code, said) = check(); + assert_eq!(code, Some(1), "{said}"); + for part in [ + "wiring incomplete: pnpm-lock.yaml: packages entry", + uuid, + "records no tarball for it", + "pnpm 11.0.3 and later keep the tarball", + "ERR_PNPM_TARBALL_INTEGRITY", + "socket-patch scan --mode vendored", + ] { + assert!(said.contains(part), "{part:?} is missing: {said}"); + } + assert!( + !said.contains("wiring missing") && !said.contains("gets the unpatched package"), + "{said}" + ); + + // A lock that pnpm resolved from the registry again and that keeps only + // the override line is another state: no pnpm release is to blame, and + // the message must not name one. + std::fs::write( + cwd.join("pnpm-lock.yaml"), + format!( + "lockfileVersion: '9.0'\n\nsettings:\n autoInstallPeers: true\n \ + excludeLinksFromLockfile: false\n\noverrides:\n foo@1.0.0: file:{rel}\n\n\ + importers:\n\n .:\n dependencies:\n foo:\n specifier: 1.0.0\n \ + version: 1.0.0\n\npackages:\n\n foo@1.0.0:\n \ + resolution: {{integrity: sha512-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==}}\n\n\ + snapshots:\n\n foo@1.0.0: {{}}\n" + ), + ) + .unwrap(); + let (code, said) = check(); + assert_eq!(code, Some(1), "{said}"); + assert!( + !said.contains("11.0."), + "no pnpm release caused this: {said}" + ); +} + /// REVIEW (#1033, audit B04): a pnpm lock that also holds a package with /// `bundledDependencies` naming the vendored package (or `true`, bundling /// every dependency) ships a copy pnpm unpacks from that package's own diff --git a/crates/socket-patch-core/src/vex/discover/mod.rs b/crates/socket-patch-core/src/vex/discover/mod.rs index 5a8fb8716..1ba1377a2 100644 --- a/crates/socket-patch-core/src/vex/discover/mod.rs +++ b/crates/socket-patch-core/src/vex/discover/mod.rs @@ -1823,6 +1823,24 @@ impl Discovery { }) } + /// The diagnostic of a vendored pnpm lock entry of patch `uuid` that + /// was withheld because it records no tarball + /// (`npm::PNPM_TARBALL_DROPPED`: pnpm 11.0.0 to 11.0.2 write it so): + /// it names the lock, what an install of it does, and the remedy. + pub fn pnpm_tarball_dropped(&self, uuid: &str) -> Option<&Diag> { + self.withheld + .iter() + .filter(|w| w.uuid == uuid && w.mode == WiringMode::Vendored) + .find_map(|w| { + self.diagnostics.iter().find(|d| { + d.code == DIAG_REF_INVALID + && d.file == w.file + && d.detail.contains(npm::PNPM_TARBALL_DROPPED) + && d.detail.contains(uuid) + }) + }) + } + /// Whether any lock discovery read resolves `purl` (any spelling) at /// all: wired to a Socket patch, contested, or from elsewhere /// ([`Discovery::resolved_elsewhere`]). diff --git a/crates/socket-patch-core/src/vex/discover/npm.rs b/crates/socket-patch-core/src/vex/discover/npm.rs index 104686142..9335e51b6 100644 --- a/crates/socket-patch-core/src/vex/discover/npm.rs +++ b/crates/socket-patch-core/src/vex/discover/npm.rs @@ -92,6 +92,11 @@ const PNPM_MANIFEST: &str = "package.json"; /// finds the diagnostic by it. pub(crate) const PNPM_OVERRIDE_UNDECLARED: &str = "the lock records the override"; +/// What the diagnostic of a vendored pnpm entry that records no tarball +/// says of it ([`pnpm_entry_ref`]); +/// [`Discovery::pnpm_tarball_dropped`] finds the diagnostic by it. +pub(crate) const PNPM_TARBALL_DROPPED: &str = "records no tarball for it"; + /// How the diagnostic of a hosted pnpm pin whose registry route the /// workspace file does not declare starts, after the lock's name /// ([`confirm_pnpm_routes`]). @@ -1985,6 +1990,44 @@ fn pnpm_entry_ref( return; }; let Some(tarball) = resolution.tarball() else { + // The entry of a vendored tarball, by its key, with an integrity + // and no tarball: what pnpm 11.0.0 to 11.0.2 write when they + // resolve a `file:` tarball themselves (11.0.3 and later, and pnpm + // 9, 10 and 12, keep the tarball). The override and the importer + // still route the package to the artifact, so the entry is not + // gone; but a frozen install of this lock from an empty store asks + // the registry for the release and fails on the vendored + // integrity. It is withheld: not attested, kept by the prune, and + // written again by the next vendored run. + let vendored = match classify_pnpm_key(key) { + PnpmKey::V9File { path, .. } | PnpmKey::LegacyFile { path } => { + ctx.locate(path, LocateOpts::LITERAL_CHECKED).vendored + } + PnpmKey::Registry { .. } | PnpmKey::Other => None, + }; + if let Some(vref) = vendored.filter(|_| resolution.integrity().is_some()) { + out.diag( + DIAG_REF_INVALID, + file, + format!( + "{label}: packages entry {key:?} names the vendored artifact of patch {} \ + but {PNPM_TARBALL_DROPPED} (pnpm 11.0.0 to 11.0.2 write the entry of a \ + `file:` tarball so when they rewrite the lock; pnpm 11.0.3 and later keep \ + the tarball). A frozen install of this lock from an empty store asks the \ + registry for the release and fails on the vendored integrity \ + (ERR_PNPM_TARBALL_INTEGRITY); not counted. Re-run `socket-patch scan \ + --mode vendored` or `socket-patch vendor` to write the entry again, and \ + commit the lock", + vref.uuid + ), + ); + out.withheld.push(super::Recognized { + uuid: vref.uuid, + mode: WiringMode::Vendored, + file: PathBuf::from(file), + }); + return; + } // A plain registry entry (integrity only) or a directory/git dep. out.resolved_elsewhere_in(file, tree.part, pnpm_registry_key_purl(key)); copies.extend(pnpm_file_copy(package, true)); @@ -5241,6 +5284,84 @@ mod tests { assert_eq!(live.vendor_entry_in_use(p.root(), &entry).await, Some(true)); } + /// pnpm 11.0.0 to 11.0.2 write the lock entry of a `file:` tarball + /// without its `tarball` when they rewrite the lock (measured against + /// real pnpm: 11.0.2 drops it, 11.0.3 keeps it). The override and the + /// importer still route the package to the artifact, but a frozen + /// install of that lock from an empty store asks the registry for the + /// release and fails on the vendored integrity. Such an entry was read + /// as a `file:` directory of the user's, so nothing kept the ledger + /// entry: `scan --mode vendored` skipped it as no longer used, and + /// `scan --prune` reverted the patch. It is dead to the liveness gate + /// and still wiring to the prune GC, with a reason that names the + /// cause and the remedy. A `file:` directory is not taken for one. + #[tokio::test] + async fn pnpm_entry_without_its_tarball_is_dead_but_kept_by_the_prune_gc() { + let rel = format!(".socket/vendor/npm/{UUID_B}/left-pad-1.3.0.tgz"); + let entry: crate::vendor::state::VendorEntry = serde_json::from_value(serde_json::json!({ + "ecosystem": "npm", + "basePurl": "pkg:npm/left-pad@1.3.0", + "uuid": UUID_B, + "artifact": { "path": rel, "sha256": "" }, + "wiring": [{ "file": "pnpm-lock.yaml", "kind": "lock", "action": "added" }], + })) + .unwrap(); + let p = Project::new(); + p.write( + "package.json", + format!(r#"{{"name":"app","pnpm":{{"overrides":{{"left-pad@1.3.0":"file:{rel}"}}}}}}"#), + ); + let wired = pnpm_vendored_lock(""); + let dropped = wired.replace(&format!(", tarball: file:{rel}"), ""); + assert_ne!(dropped, wired); + + p.write("pnpm-lock.yaml", &dropped); + let dead = p.discover().await; + assert_refs(&dead, &[]); + assert!(dead.shadowed.is_empty() && dead.unattested.is_empty()); + assert!(!dead.vendor_entry_live(p.root(), &entry).await); + assert_eq!( + dead.vendor_entry_liveness(p.root(), &entry).await, + Some(false) + ); + assert_eq!(dead.vendor_entry_in_use(p.root(), &entry).await, Some(true)); + assert_eq!(dead.withheld.len(), 1); + assert!(dead.pnpm_override_undeclared(UUID_B).is_none()); + let detail = &dead + .pnpm_tarball_dropped(UUID_B) + .expect("the entry's own diagnostic") + .detail; + for part in [ + "pnpm-lock.yaml: packages entry", + UUID_B, + "records no tarball for it", + "pnpm 11.0.3 and later keep the tarball", + "ERR_PNPM_TARBALL_INTEGRITY", + "socket-patch scan --mode vendored", + ] { + assert!(detail.contains(part), "{part:?} is missing: {detail}"); + } + + // With its tarball the entry is a ref again. + p.write("pnpm-lock.yaml", &wired); + let live = p.discover().await; + assert!(live.vendor_entry_live(p.root(), &entry).await); + assert!(live.withheld.is_empty() && live.pnpm_tarball_dropped(UUID_B).is_none()); + + // A `file:` directory dependency records no tarball either, and no + // integrity: it is the user's, as before. + p.write( + "pnpm-lock.yaml", + "lockfileVersion: '9.0'\n\nimporters:\n\n .:\n dependencies:\n left-pad:\n \ + specifier: file:../lp\n version: file:../lp\n\npackages:\n\n \ + left-pad@file:../lp:\n resolution: {directory: ../lp, type: directory}\n\n\ + snapshots:\n\n left-pad@file:../lp: {}\n", + ); + let directory = p.discover().await; + assert!(directory.withheld.is_empty()); + assert!(directory.pnpm_tarball_dropped(UUID_B).is_none()); + } + /// Which pnpm reads the overrides comes from the pins package.json /// commits, read conservatively, then from what only one generation of /// pnpm writes into a lock (#2382). Committed files only: the same diff --git a/docs/ecosystems.md b/docs/ecosystems.md index 5519a6f04..4dd8d7f50 100644 --- a/docs/ecosystems.md +++ b/docs/ecosystems.md @@ -264,6 +264,19 @@ Each Legacy format has an upgrade path and an undo path. Both work in v5: then gives the entry to add. Not checked this way: a Rush lock, a lock entry that records no override, and a declaration `socket-patch` cannot read (an inline `overrides:` mapping, a `package.json` that is not JSON). + **pnpm 11.0.0 to 11.0.2 unwire a vendored package when they rewrite the + lock.** An install that changes `pnpm-lock.yaml`, or `pnpm add`, writes + the entry of a `file:` tarball without its `tarball` on these three + releases (11.0.3 and later, and pnpm 9, 10 and 12, keep it). 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`), so it + never installs the unpatched package. `vendor --check` fails the entry + (`wiring incomplete`, naming the lock) and `vex` omits it + (`vendor_unwired`). The entry still counts as in use: `scan --prune` + keeps the vendored patch, and running `socket-patch scan --mode + vendored` again writes the entry back, with or without an installed + tree. pnpm 11.0.3 or later keeps it. **One mode for a package and its dependency.** pnpm 12.23 and newer refuse a lock in which a package fetched from a hosted patch depends on a local file (`ERR_PNPM_LOCAL_SUBDEP_NOT_ALLOWED`), on every install, frozen or diff --git a/docs/testing/pnpm-compatibility.md b/docs/testing/pnpm-compatibility.md index decfab2f4..e053b5133 100644 --- a/docs/testing/pnpm-compatibility.md +++ b/docs/testing/pnpm-compatibility.md @@ -25,14 +25,14 @@ discovery and tarball endpoints are local test servers. | 8.0.0, 8.15.9 | 16.20.2 | 6.0, per-peer package resolutions | | 9.0.0, 9.15.9 | 24.11.1 | 9.0, packages/snapshots split | | 10.0.0, 10.33.0, 10.34.5 | 24.11.1 | 9.0 | -| 11.0.0, 11.27.0, 12.0.0, 12.4.2 | 24.11.1 | 9.0, hosted URLs require lockfile trust or the registry route | +| 11.0.0, 11.0.3, 11.27.0, 11.29.0, 12.0.0, 12.4.2, 12.25.1 | 24.11.1 | 9.0, hosted URLs require lockfile trust or the registry route | This samples each released major from 1 through 12 and important major boundaries; it is not an exhaustive test of every historical patch release or future release. Pre-lockfile releases cannot use hosted lockfile redirection. Vendored mode has a separate compatibility contract in `docs/ecosystems.md`. -The 24 supported versions exercise scan and explicit-UUID hosted entry points, idempotency, +The 27 supported versions exercise scan and explicit-UUID hosted entry points, idempotency, warm installs, verified VEX, a clean reinstall, a fresh frozen install with a dead registry and empty store, an ordinary install, byte-exact rollback, lock-only discovery, and rejection of tampered hosted tarballs. pnpm >=6 also @@ -46,6 +46,21 @@ hosted URL even on a frozen install. For early shrinkwrapVersion 3 locks with no positive minor version, upgrade to a tested release (1.43.1 or newer) and regenerate the lock before redirecting, or use installed-file agent mode. +The same matrix runs the vendored suite (`e2e_vendor_pnpm_build`) on each +version. One of its cells puts the lock back as it was while the overrides +stay, lets a plain `pnpm install` write the lock again, and expects `vex` to +attest once more. pnpm 11.0.0 to 11.0.2 are the exception: they write the +entry of a `file:` tarball without its `tarball` (measured: 11.0.2 drops it, +11.0.3 keeps it, as do 9.0.0 to 10.34.9 and 12.0.0 on). A frozen install of +that lock from an empty store then fails (`ERR_PNPM_TARBALL_INTEGRITY` online, +no tarball offline), so the cell expects `vex` to omit the patch as +`vendor_unwired` there, and the matrix pins 11.0.0 and 11.0.3 as the two sides +of the boundary. The lock reader takes such an entry for the vendored one +it is (by its key, with an integrity and no tarball), not for a `file:` +directory of the user's: the patch is not attested, `scan --prune` keeps +it, and running the scan again writes the entry back. Before that, a prune +on a checkout with no installed tree reverted the patch. + Captured locks under `crates/socket-patch-core/tests/fixtures/pnpm-hosted/` keep grammar coverage in ordinary offline tests. Additional tests cover LF/CRLF, nested peer suffixes, quoted keys and URLs, unrelated versions,