Fix pnpm hosted redirects across legacy and peer lock entries - #240
Merged
Mikola Lysenko (mikolalysenko) merged 4 commits intoSep 16, 2026
Merged
Conversation
Wenxin Jiang (Wenxin-Jiang)
approved these changes
Sep 16, 2026
Mikola Lysenko (mikolalysenko)
deleted the
fix/pnpm-hosted-compatibility
branch
September 16, 2026 20:40
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.
Hosted pnpm redirects missed block-style resolutions in older lockfiles and refused nested peer keys and CRLF files. A separate confirmation bug allowed an already-hosted URL in one instance to report a patch as redirected even when another instance of the same dependency was refused.
This change reads pnpm package blocks without reserializing unrelated YAML, supports legacy
shrinkwrap.yamland modern lock formats, and rewrites every matching peer instance atomically across the lockfile set. Refused pnpm patch UUIDs are excluded from CLI confirmation. Exact original resolution fragments remain available for rollback.The sweep also found two installation constraints:
--forcealone is not portable.Adds a CI matrix with 25 pinned releases across pnpm majors 1–12, exact-version checks, and setup failures treated as failures. The suite covers cold and warm installs, verified VEX, scan and explicit-UUID entry points, idempotency, lock-only discovery, byte-exact rollback, and rejection of tampered tarballs. Workspace cases on majors 6–12 include scoped packages, npm aliases, multiple peer contexts, and peers of peers. Captured locks preserve offline grammar coverage.
The atomic-refusal regression uses a malformed peer key, preserving the refusal check while valid nested peers now succeed. The alternate-installer fixture also recognizes Bundler 1's direct
vendor/bundle/gemslayout alongside the Ruby ABI subdirectory layout; both Bundler 1.17.2 and 2.4.22 were verified.Validation completed locally on macOS:
The matrix samples major boundaries and representative releases; it does not claim exhaustive coverage of every historical release or configuration. Hosted SBOM recognition and dashboard alert action/count behavior are outside this repository and are not changed by this PR.
Note
Medium Risk
Changes core hosted lockfile rewrite and confirmation logic that directly affects which tarballs install; mitigated by fail-closed partial rewrites, explicit legacy refusals, and a broad pinned-version CI matrix.
Overview
Expands hosted pnpm lock rewriting from modern
pnpm-lock.yamlflow mappings to legacyshrinkwrap.yaml, block-style resolutions, LF/CRLF, scoped keys, aliases, and nested peer instance keys—rewriting every matching instance atomically or refusing the dependency across the whole lockfile set.The redirect engine moves pnpm parsing into a dedicated
pnpmmodule (byte-range splices instead of the old regex writer). pnpm 1.0.0 earlyshrinkwrapVersion: 3locks are now explicitly refused (redirect_pnpm_legacy_lockfile_unsupported) because those installers drop hosted URLs.refused_pnpm_uuidsstops the CLI from confirming/VEX-attesting a patch when another instance was left upstream or the rewrite was incomplete.Trust and install guidance now treats legacy locks as pnpm 1–8 (no trust step), includes clean
node_modules/empty-store reinstall advice inredirect_pnpm_trust_lockfile, and documents limits (VEX vs dashboard SBOM).CI and tests: new
pnpm-compatibilityworkflow with 25 pinned pnpm releases (majors 1–12), required e2e matrix legs (install, VEX, rollback, tamper, workspace peers), captured lock fixtures, and updated contracts/docs (CLI_CONTRACT.md,pnpm-compatibility.md,ecosystems.md).Reviewed by Cursor Bugbot for commit 3b176c2. Configure here.