Skip to content

feat(lockfile): negotiate format 13 for platform variants - #17596

Closed
zkochan wants to merge 8 commits into
mainfrom
feat/lockfile-format-negotiation
Closed

zkochan wants to merge 8 commits into
mainfrom
feat/lockfile-format-negotiation

Conversation

@zkochan

@zkochan zkochan commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Summary

This is #17584 rebased onto main. That PR was stacked on pnpr/platform-variants, and GitHub closed it automatically when the branch was deleted after #17559 was squash-merged. Maintainer edits are off on its fork, so its work is carried here instead. Credit for the format negotiation goes to #17584.

It covers pnpm/tasks#248 (a closing keyword can't close an issue in another repository, so that issue will be closed by hand once this merges):

  • pnpm writes a lockfile that records a registry package's platform variants with lockfileVersion: '13.0'. pnpm releases that predate this refuse to read 13.0, so a teammate on an older pnpm can't silently rewrite the lockfile without its variants, as the platform-variants RFC requires.
  • pnpm sends acceptedLockfileFormats (9.0, 12.0, 13.0) with a pnpr resolve. pnpr refuses with ERR_PNPR_INCOMPATIBLE_LOCKFILE_FORMAT, never a downgraded lockfile, when the result is in a format the client did not accept. This covers fresh, streamed, cached, and frozen-lockfile results. A client that sends no formats has not accepted 13.0.

What changed relative to #17584. Its final head held only four commits that copied the then-current base files. All four come out empty against main, because #17559 merged those files. The negotiation itself was in an earlier push of #17584 (251289c00bc), and that commit is cherry-picked here with its authorship intact. Agent fixes on top:

  • Only a package's variants mark the lockfile as 13.0. A runtime dependency (Node.js, Bun, Deno) has always recorded its binary archives as a variations resolution in format 9.0. Marking those too would have moved every lockfile with a runtime to 13.0, and pnpr would have refused it to 9.0-only clients. The old runtime test asserted 13.0 for a runtime with no archives; it now uses a real binary variant and asserts 9.0. A new test covers a package variant, which gives 13.0.
  • The check lives in pnpm_lockfile (LockfileResolution::is_package_variants, Lockfile::records_package_variants), and the lockfile writer and pnpr share it. pnpr compares accepted formats by major. The formats pnpm announces are a constant, ACCEPTED_LOCKFILE_FORMATS, next to the version check, with a test that each one is readable.
  • The existing platform-variants changeset gains a sentence on the 13.0 format. The feature has not been released yet.

Squash Commit Body

Write a lockfile that records a registry package's platform variants as
lockfileVersion 13.0, and negotiate lockfile formats with pnpr.

pnpm releases that predate 13.0 refuse to read it in every mode, so
nobody on an older pnpm rewrites the lockfile without its variants. A
runtime's `binary` archives use the same `variations` shape but have
been readable in format 9.0 all along, so they do not mark the
lockfile.

pnpm announces the formats it reads in `acceptedLockfileFormats`. pnpr
refuses a fresh, streamed, cached, or frozen-lockfile result whose
format the client did not accept, with the existing
ERR_PNPR_INCOMPATIBLE_LOCKFILE_FORMAT error, instead of downgrading it.
A client that names no formats has not accepted the variants format.

Carries the negotiation from #17584, whose base branch was deleted when
#17559 merged.

Refs pnpm/tasks#248

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • New features are implemented only in the Rust pnpm v12 CLI. Bug fixes
    are implemented in every affected version.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

Tests run locally: pnpm-lockfile, pnpm-package-manager, pnpm-pnpr-client and every pnpr-* crate together (3543 passed). The 4 install::tests::external_importers tests fail here on origin/main too. Also the pnpm-cli install_runtimes and pnpr e2e tests, and clippy.

Written by an agent (Claude Code, claude-opus-5-5).

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • New Features
    • Lockfiles containing platform-specific package variants are now saved in format 13.0; lockfiles without them continue to use format 9.0.
    • Lockfile reuse now respects the formats supported by the requesting pnpm version, so incompatible lockfiles are not returned.
  • Bug Fixes
    • Runtime binary archives remain compatible with format 9.0 and are not treated as platform-specific package variants.

kairosci and others added 5 commits November 3, 2026 07:23
A runtime dependency (Node.js, Bun, Deno) records its archives as a
`variations` resolution of `binary` variants, which format 9.0 has held
all along and which keeps first-match selection. Marking every
`variations` resolution would move every lockfile with a runtime to
13.0, which pnpm releases that predate the marker refuse to read, and
would make pnpr refuse to return such a lockfile to a client that only
accepts 9.0. The marker now covers only a registry package's variants,
as the platform-variants RFC describes.

The check lives on `LockfileResolution::is_package_variants` and
`Lockfile::records_package_variants`, used by both the lockfile writer
and pnpr's acceptance check. pnpr compares `acceptedLockfileFormats`
entries by major, so `13` and `13.0` both name the variants format. The
formats pnpm announces to pnpr are a constant next to the version check,
with a test that each one is a format the client reads.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

pnpm now writes lockfile format 13.0 when package metadata contains package variants. Runtime binary archives remain compatible with format 9.0. The pnpr client declares accepted formats, and pnpr checks input, cached, and streamed lockfiles against that declaration.

Changes: Platform-variant lockfile support

Layer / File(s) Summary
Lockfile format and variant classification
pnpm/crates/lockfile/src/lockfile_version.rs, pnpm/crates/lockfile/src/resolution.rs, pnpm/crates/lockfile/src/lib.rs, pnpm/crates/lockfile/src/lockfile_version/tests.rs, pnpm/crates/lockfile/src/resolution/tests/variant_selection.rs
The lockfile code defines format 13 and lists accepted formats 9.0, 12.0, and 13.0. It identifies package-variant resolutions separately from runtime archives and tests the format and classification behavior.
Generate and read variant lockfiles
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs, pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests/importer_records.rs, pnpm/crates/package-manager/src/install/materialize/frozen.rs, .changeset/pnpr-platform-variants.md
Lockfile generation selects format 13 when package metadata contains package variants, and otherwise selects format 9. Frozen installs accept format 13. Tests cover package variants and runtime archives; the changeset describes the format compatibility rule.
Declare client-supported formats
pnpm/crates/pnpr-client/src/lib.rs, pnpm/crates/cli/src/cli_args/install/pnpr_request.rs, pnpm/crates/pnpr-client/src/tests.rs, pnpm/crates/pnpr-client/tests/integration.rs
The client request includes accepted lockfile formats. The CLI populates the field, and client tests check the declared formats.
Validate formats in pnpr responses
pnpr/crates/pnpr/src/resolver/request_validation.rs, pnpr/crates/pnpr/src/resolver.rs, pnpr/crates/pnpr/src/resolver/streaming.rs, pnpr/crates/pnpr/src/resolver/tests.rs, pnpr/crates/pnpr/src/resolver/tests/request_validation.rs
pnpr validates input lockfiles and cached results. Streaming resolution checks the resolved lockfile after storing any cache candidate. It sends an incompatible-format error when the format is not accepted, instead of the terminal done frame. Tests cover declared formats, legacy requests, package variants, and runtime archives.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant PnpmCLI
  participant PnprResolver
  participant RequestValidation
  participant StreamingResolver
  PnpmCLI->>PnprResolver: Send acceptedLockfileFormats
  PnprResolver->>RequestValidation: Validate request and input lockfile
  PnprResolver->>StreamingResolver: Route resolved lockfile
  StreamingResolver->>RequestValidation: Check resolved lockfile format
  alt Format is not accepted
    StreamingResolver-->>PnpmCLI: Send incompatible-format error frame
  else Format is accepted
    StreamingResolver-->>PnpmCLI: Send done frame
  end
Loading

Possibly related PRs

  • pnpm/pnpm#17559: Adds platform-variant resolutions and lockfile data that this change detects.
  • pnpm/pnpm#17112: Adds the accepted-format request contract and server rejection that this change extends to format 13.0 and cached and streamed results.

Suggested labels: product: pacquet, product: pnpr

Suggested reviewers: 0xnoramiya

Merge Risk: Low · up to 66e13

Some filtered installs can mislabel variant lockfiles, and a 13-only client can receive a format-9 frozen result. The impact appears bounded but warrants correction.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 5bd38b1 and 1de8d6f.

Files selected for processing: 17
  • .changeset/pnpr-platform-variants.md
  • pnpm/crates/cli/src/cli_args/install/pnpr_request.rs
  • pnpm/crates/lockfile/src/lib.rs
  • pnpm/crates/lockfile/src/lockfile_version.rs
  • pnpm/crates/lockfile/src/lockfile_version/tests.rs
  • pnpm/crates/lockfile/src/resolution.rs
  • pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs
  • pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests/importer_records.rs
  • pnpm/crates/package-manager/src/install/materialize/frozen.rs
  • pnpm/crates/pnpr-client/src/lib.rs
  • pnpm/crates/pnpr-client/src/tests.rs
  • pnpm/crates/pnpr-client/tests/integration.rs
  • pnpr/crates/pnpr/src/resolver.rs
  • pnpr/crates/pnpr/src/resolver/request_validation.rs
  • pnpr/crates/pnpr/src/resolver/streaming.rs
  • pnpr/crates/pnpr/src/resolver/tests.rs
  • pnpr/crates/pnpr/src/resolver/tests/request_validation.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@garnet-runtime-review

garnet-runtime-review Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Nothing new recorded

0 of 1 recorded job changed
Garnet records 1 of 19 TS CI jobs
At 66e13d5, compared with the last 10 recorded runs on main (latest 70a2200)
Recorded at the kernel (best-effort capture)

TS CI / Test / ubuntu (24.0.0, 2) / Node 24 / chunk 2/3 · nothing new

Workload · 70a2200 → 66e13d5

  bash
  ├─ rustup
  │  └─ dualstack.k.sni.global.fastly[.]net
  └─ MainThread › pn
     ├─ dash › node
     │  ├─ node › node
     │  │  ├─ git
     │  │  │  ├─ git
     │  │  │  │  ├─ git › git-remote-http
     │  │  │  │  │  └─ github[.]com
     │  │  │  │  └─ 192.168.127[.]1
     │  │  │  └─ 192.168.127[.]1
     │  │  ├─ node
     │  │  │  ├─ git › git › git-remote-http
     │  │  │  │  └─ github[.]com
     │  │  │  ├─ node
     │  │  │  │  └─ registry.npmjs[.]org
     │  │  │  ├─ codeload.github[.]com
     │  │  │  ├─ github[.]com
     │  │  │  ├─ nodejs[.]org
     │  │  │  ├─ registry.npmjs[.]org
     │  │  │  └─ unofficial-builds.nodejs[.]org
     │  │  ├─ pnpr
     │  │  │  └─ registry.npmjs[.]org
     │  │  ├─ codeload.github[.]com
     │  │  ├─ github[.]com
     │  │  └─ registry.npmjs[.]org
     │  └─ pn › node
     │     ├─ dash
     │     │  ├─ dash › node
     │     │  │  └─ nodejs[.]org
     │     │  └─ node
     │     │     └─ registry.npmjs[.]org
     │     ├─ git
     │     │  ├─ git › git › git-remote-http
     │     │  │  └─ github[.]com
     │     │  └─ 192.168.127[.]1
     │     ├─ pnpr
     │     │  └─ registry.npmjs[.]org
     │     ├─ codeload.github[.]com
     │     ├─ github[.]com
     │     ├─ nodejs[.]org
     │     ├─ registry.npmjs[.]org
     │     └─ unofficial-builds.nodejs[.]org
     └─ nodejs[.]org

  node
  ├─ pnpm
  │  ├─ nodejs[.]org
  │  └─ unofficial-builds.nodejs[.]org
  └─ node
     └─ registry.npmjs[.]org

  systemd
  ├─ bash › bash › bash › bash › bash › bash
  │  ├─ bash
  │  │  ├─ gh
  │  │  │  └─ api.github[.]com
  │  │  └─ node
  │  │     ├─ git
  │  │     │  ├─ git › git › git-remote-http
  │  │     │  │  └─ github[.]com
  │  │     │  └─ 192.168.127[.]1
  │  │     └─ pn
  │  │        ├─ dash › node › pn
  │  │        │  ├─ dash › pn › dash › pnpm › dash › node
  │  │        │  │  ├─ codeload.github[.]com
  │  │        │  │  └─ registry.npmjs[.]org
  │  │        │  └─ node
  │  │        │     ├─ node
  │  │        │     │  └─ registry.npmjs[.]org
  │  │        │     └─ pnpr
  │  │        │        └─ registry.npmjs[.]org
  │  │        └─ nodejs[.]org
  │  └─ node
  │     ├─ pnpm
  │     │  ├─ dash › node › dash › node
  │     │  │  └─ nodejs[.]org
  │     │  ├─ git
  │     │  │  ├─ git › git › git-remote-http
  │     │  │  │  └─ github[.]com
  │     │  │  └─ 192.168.127[.]1
  │     │  ├─ dualstack.k.sni.global.fastly[.]net
  │     │  └─ registry.npmjs[.]org
  │     ├─ blacksmith.blob.core.windows[.]net
  │     └─ registry.npmjs[.]org
  └─ git
     └─ 192.168.127[.]1

Runner & GitHub's own traffic · blacksmith-8vcpu-ubuntu-2404 · Linux X64

  node
  └─ productionresultssa32.blob.core[.]windows (github infra)

  MainThread
  └─ productionresultssa16.blob.core[.]windows (github infra)

  systemd
  ├─ chronyd
  │  ├─ 162.254.225[.]152
  │  ├─ 169[.]254[.]169[.]123
  │  ├─ 170.187.147[.]56
  │  ├─ 185.125.190[.]56
  │  ├─ 185.125.190[.]57
  │  ├─ 185.125.190[.]58
  │  ├─ 198.71.50[.]75
  │  ├─ 209.51.161[.]238
  │  ├─ 23.168.24[.]210
  │  ├─ 23.172.120[.]59
  │  ├─ 24.63.87[.]46
  │  ├─ 45.83.234[.]123
  │  └─ 91.189.91[.]157
  ├─ nginx › nginx
  │  ├─ 140.82.112[.]21
  │  ├─ 140.82.112[.]22
  │  ├─ 140.82.113[.]21
  │  ├─ 140.82.113[.]22
  │  ├─ 140.82.114[.]22
  │  ├─ 192.168.127[.]1
  │  └─ 8.8.8[.]8
  ├─ snapd
  │  └─ api.snapcraft[.]io
  ├─ sudo › sudo
  │  └─ 192.168.127[.]1
  └─ systemd-resolve
     └─ 8.8.8[.]8

Job log · Full record in Garnet ↗


How to read this
bash › curl                 ← ancestry as captured, then the process that acted
└─ example[.]com            ← what it reached

Read down: what ran, then what it reached. + only in this commit · − only in the compared run · unmarked in both. Runner & GitHub's own traffic is activity outside your steps and never counts. · Docs ↗

Recorded by Garnet · Add it to your CI ↗

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                    pr
-----                                            ----                                    --
lockfile/parse_pnpm_lock                         1.19     15.6±0.94ms    24.1 MB/sec     1.00     13.0±0.93ms    28.7 MB/sec
packument/parse                                  1.04     43.2±1.65µs  1534.8 MB/sec     1.00     41.6±1.78µs  1594.5 MB/sec
tarball/download_dependency                      1.42  1171.0±208.20µs     3.6 MB/sec    1.00  822.8±100.44µs     5.1 MB/sec
tarball_batch/cold_store_many_medium_tarballs    1.24    260.7±8.70ms 61.4 KElem/sec     1.00    210.0±8.37ms 76.2 KElem/sec
version_pick/repeated_ranges_file                1.00      4.5±0.10ms  7.0 KElem/sec     1.05      4.7±0.12ms  6.6 KElem/sec
version_pick/repeated_ranges_raw                 1.00      4.5±0.09ms  7.0 KElem/sec     1.03      4.6±0.12ms  6.7 KElem/sec
workspace_resolution/hoist_heavy                 1.19   386.6±14.57ms        ? ?/sec     1.00   323.8±11.33ms        ? ?/sec
workspace_sort/chained_projects                  1.09     20.4±3.23ms        ? ?/sec     1.00     18.7±3.30ms        ? ?/sec

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Same-run regression check

HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.

Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2278.85 ms 2279.13 ms 0.0% 113.94 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1420.07 ms 1468.80 ms 3.4% 71.00 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 204.30 ms 202.87 ms -0.7% 10.22 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 219.12 ms 215.11 ms -1.8% 10.96 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 8.18 ms 8.25 ms 0.9% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 8.07 ms 8.29 ms 2.7% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 13.65 ms 12.46 ms -8.8% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 13.85 ms 13.89 ms 0.2% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2574.92 ms 2667.70 ms 3.6% 128.75 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1548.46 ms 1481.64 ms -4.3% 77.42 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 516.71 ms 533.10 ms 3.2% 25.84 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 320.71 ms 337.97 ms 5.4% 16.04 ms Inconclusive (overlapping samples)
isolated-fresh-install-cold-cache-hot-store pacquet 1749.00 ms 1713.40 ms -2.0% 87.45 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 309.33 ms 337.58 ms 9.1% 15.47 ms Inconclusive (overlapping samples)
isolated-fresh-resolve-hot-cache-offline pacquet 331.74 ms 480.27 ms 44.8% 16.59 ms Inconclusive (overlapping samples)
isolated-fresh-resolve-hot-cache-offline pnpr 101.24 ms 105.94 ms 4.6% 5.06 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 220.35 ms 223.96 ms 1.6% 11.02 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 84.62 ms 85.62 ms 1.2% 4.23 ms Within tolerance
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet 90.89 ms 90.48 ms -0.5% 4.54 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4558.07 ms 4415.92 ms -3.1% 227.90 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3452.59 ms 3540.29 ms 2.5% 172.63 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 120.75 ms 122.63 ms 1.6% 6.04 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 124.17 ms 132.65 ms 6.8% 6.21 ms Inconclusive (overlapping samples)
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet 1193.13 ms 1180.85 ms -1.0% 59.66 ms Within tolerance
cargo-repeat-install-hot-cache-hot-store pacquet 37.82 ms 38.40 ms 1.5% 2.00 ms Within tolerance

Same-run syscall check

Each install runs 2 more times per revision, untimed, under strace --follow-forks --summary-only. A file syscall regresses when HEAD's fewest calls exceed main's most by more than 2% of main or 50 calls, whichever is larger. mkdir and mkdirat count only the calls that created a directory, since concurrent installs fail a varying number with EEXIST. A syscall whose identical runs differ by more than that tolerance is reported unstable and not gated, unless HEAD's fewest calls also exceed main's most by more than the tolerance plus that difference. Each scenario lists its largest change relative to its tolerance and every row that is not within tolerance.

Scenario Engine Syscall main calls (max) HEAD calls (min) Change Tolerance Identical-run spread Result
isolated-fresh-restore-cold-cache-cold-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet readlink 15288 15302 +0.1% 305 118 Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr access 11 11 +0.0% 50 0 Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr access 8 8 +0.0% 50 0 Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr access 8 8 +0.0% 50 0 Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet readlink 16800 15763 -6.2% 336 740 Unstable (identical runs differ by 740, not gated)
isolated-fresh-install-cold-cache-cold-store pnpr statx 95578 95581 +0.0% 1911 3 Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr readlink 15285 15301 +0.1% 305 26 Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr statx 48991 49003 +0.0% 979 4 Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr access 8 8 +0.0% 50 0 Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet access 8 8 +0.0% 50 0 Within tolerance
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet readlink 15291 15306 +0.1% 305 1 Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr readlink 15267 15308 +0.3% 305 29 Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet access 11 11 +0.0% 50 0 Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr access 11 11 +0.0% 50 0 Within tolerance
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet access 8 8 +0.0% 50 0 Within tolerance
cargo-repeat-install-hot-cache-hot-store pacquet access 22 22 +0.0% 50 0 Within tolerance

Integrated-Benchmark Report (Linux)

Commit: 1de8d6ff871d

Compared against main at: 5bd38b197e7e

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked, injected, and Cargo workspace scenarios compare current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.312 ± 0.112 2.223 2.610 1.62 ± 0.14
pacquet@main 2.363 ± 0.152 2.215 2.575 1.65 ± 0.16
pnpr@HEAD 1.431 ± 0.103 1.247 1.526 1.00
pnpr@main 1.482 ± 0.129 1.334 1.651 1.04 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.31234262986,
      "stddev": 0.11156053319528318,
      "median": 2.2791333508599996,
      "user": 1.9622333399999998,
      "system": 1.5307329199999997,
      "min": 2.22311416686,
      "max": 2.61013269986
    },
    {
      "command": "pacquet@main",
      "mean": 2.3625881886599998,
      "stddev": 0.15182487202738715,
      "median": 2.2788505483600003,
      "user": 1.8481988399999998,
      "system": 1.33859412,
      "min": 2.2148127348599997,
      "max": 2.57529006486
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.4305837003600002,
      "stddev": 0.10315943107883808,
      "median": 1.46880202736,
      "user": 1.75600974,
      "system": 1.3931476200000001,
      "min": 1.2465798208599999,
      "max": 1.52565700086
    },
    {
      "command": "pnpr@main",
      "mean": 1.4823833164599998,
      "stddev": 0.12853685158863906,
      "median": 1.42006707036,
      "user": 1.9354559399999995,
      "system": 1.4925331199999998,
      "min": 1.3340076938599998,
      "max": 1.65091707786
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 207.3 ± 15.4 198.9 250.2 1.01 ± 0.09
pacquet@main 206.1 ± 9.2 195.8 224.8 1.00
pnpr@HEAD 215.6 ± 6.2 207.5 223.8 1.05 ± 0.06
pnpr@main 221.0 ± 8.5 211.9 240.7 1.07 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.20734682004,
      "stddev": 0.015408826697357015,
      "median": 0.20286947514,
      "user": 0.24186348,
      "system": 0.51373128,
      "min": 0.19893423414000003,
      "max": 0.25015940614
    },
    {
      "command": "pacquet@main",
      "mean": 0.20605386584000004,
      "stddev": 0.009243231446404935,
      "median": 0.20430416414000002,
      "user": 0.23736318,
      "system": 0.51912118,
      "min": 0.19580717014000001,
      "max": 0.22482735914000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.21560467234000003,
      "stddev": 0.006227460765163669,
      "median": 0.21511184714000003,
      "user": 0.24834608000000005,
      "system": 0.5138733799999999,
      "min": 0.20752864214000002,
      "max": 0.22381304614000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.22097939164000002,
      "stddev": 0.008523161683742828,
      "median": 0.21912385764000003,
      "user": 0.23347277999999996,
      "system": 0.5437424799999999,
      "min": 0.21190896914000001,
      "max": 0.24074342814000002
    }
  ]
}

Scenario: Isolated linker: repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 8.3 ± 0.4 7.5 10.3 1.01 ± 0.10
pacquet@main 8.4 ± 0.7 7.2 12.5 1.02 ± 0.12
pnpr@HEAD 8.4 ± 0.4 7.7 10.2 1.01 ± 0.10
pnpr@main 8.2 ± 0.7 7.6 14.0 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.00833783421877677,
      "stddev": 0.0004001648910315837,
      "median": 0.00825334702,
      "user": 0.004859331376146787,
      "system": 0.004150308868501529,
      "min": 0.00748360802,
      "max": 0.01027309402
    },
    {
      "command": "pacquet@main",
      "mean": 0.008405868707258688,
      "stddev": 0.0007419270772187699,
      "median": 0.00818378402,
      "user": 0.005072996602316602,
      "system": 0.004036648648648652,
      "min": 0.007221325020000001,
      "max": 0.01250667702
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.008364894058095235,
      "stddev": 0.00040434162649923043,
      "median": 0.00828915402,
      "user": 0.005240810158730155,
      "system": 0.003816165079365081,
      "min": 0.007658767020000001,
      "max": 0.01023263002
    },
    {
      "command": "pnpr@main",
      "mean": 0.008245835126796117,
      "stddev": 0.0006875317299827523,
      "median": 0.00806809702,
      "user": 0.005191644401294499,
      "system": 0.0037457378640776712,
      "min": 0.00762280902,
      "max": 0.01396511102
    }
  ]
}

Scenario: Isolated linker: repeat install, cold cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 12.7 ± 2.3 9.0 25.1 1.00
pacquet@main 15.3 ± 4.8 8.9 35.2 1.20 ± 0.43
pnpr@HEAD 14.2 ± 2.8 9.5 23.5 1.12 ± 0.30
pnpr@main 14.5 ± 3.8 9.4 28.2 1.14 ± 0.36
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.012722728671279623,
      "stddev": 0.002271587107377254,
      "median": 0.012455060240000001,
      "user": 0.006936776018957346,
      "system": 0.006836804549763033,
      "min": 0.00896736824,
      "max": 0.025090254240000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.015306354798011053,
      "stddev": 0.0047910066490666845,
      "median": 0.013652679240000002,
      "user": 0.008340925635359115,
      "system": 0.008269640000000003,
      "min": 0.00886380424,
      "max": 0.03519802224
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.014187570722954547,
      "stddev": 0.0027729782682276846,
      "median": 0.013886593740000001,
      "user": 0.008596781249999998,
      "system": 0.006782197045454543,
      "min": 0.00946717824,
      "max": 0.023477214240000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.014459100313394495,
      "stddev": 0.0037576010146516247,
      "median": 0.01385378724,
      "user": 0.008307018899082563,
      "system": 0.0074713152293577985,
      "min": 0.009379151240000001,
      "max": 0.028245883240000002
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.652 ± 0.069 2.489 2.718 1.72 ± 0.11
pacquet@main 2.575 ± 0.041 2.512 2.661 1.67 ± 0.11
pnpr@HEAD 1.545 ± 0.138 1.400 1.808 1.00 ± 0.11
pnpr@main 1.543 ± 0.094 1.411 1.680 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6524691134,
      "stddev": 0.06906179376204295,
      "median": 2.6677016710000006,
      "user": 2.72667312,
      "system": 1.8016650600000002,
      "min": 2.4889713650000003,
      "max": 2.717967599
    },
    {
      "command": "pacquet@main",
      "mean": 2.5752812046000004,
      "stddev": 0.04130300225186069,
      "median": 2.574920225,
      "user": 2.5543192199999996,
      "system": 1.5688830599999997,
      "min": 2.5122774800000003,
      "max": 2.6614144360000003
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5453269782,
      "stddev": 0.1382381075317992,
      "median": 1.4816381895,
      "user": 1.9568638199999995,
      "system": 1.53922946,
      "min": 1.400497122,
      "max": 1.80826613
    },
    {
      "command": "pnpr@main",
      "mean": 1.5428985285999999,
      "stddev": 0.09431499893442587,
      "median": 1.5484553585,
      "user": 1.8183051200000002,
      "system": 1.48089966,
      "min": 1.410680263,
      "max": 1.6795448229999999
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 529.6 ± 26.7 486.6 567.0 1.67 ± 0.12
pacquet@main 525.7 ± 27.4 496.6 570.4 1.66 ± 0.12
pnpr@HEAD 339.9 ± 14.2 318.1 363.1 1.07 ± 0.07
pnpr@main 317.4 ± 16.1 293.8 338.9 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.52964512442,
      "stddev": 0.026730355623754372,
      "median": 0.53310163392,
      "user": 0.75536516,
      "system": 0.95852112,
      "min": 0.48658851442000006,
      "max": 0.56699213942
    },
    {
      "command": "pacquet@main",
      "mean": 0.52574970672,
      "stddev": 0.027385341635681442,
      "median": 0.5167070089200001,
      "user": 0.7617168599999999,
      "system": 0.96172292,
      "min": 0.49660782442000007,
      "max": 0.57035108342
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.33986045952000005,
      "stddev": 0.014227462826288562,
      "median": 0.33797367192000005,
      "user": 0.3150961599999999,
      "system": 0.65822072,
      "min": 0.31814462842,
      "max": 0.36309163042000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.31741548522000007,
      "stddev": 0.016111462138844894,
      "median": 0.32070884492000007,
      "user": 0.31987336,
      "system": 0.61926262,
      "min": 0.29382760542,
      "max": 0.33889233642000005
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.725 ± 0.038 1.693 1.812 5.37 ± 0.41
pacquet@main 1.736 ± 0.038 1.674 1.775 5.40 ± 0.41
pnpr@HEAD 0.345 ± 0.020 0.324 0.379 1.07 ± 0.10
pnpr@main 0.321 ± 0.023 0.298 0.357 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7246803264000001,
      "stddev": 0.03777281401890055,
      "median": 1.7133986068999998,
      "user": 1.0963705799999999,
      "system": 0.97249968,
      "min": 1.6925209224,
      "max": 1.8117903234
    },
    {
      "command": "pacquet@main",
      "mean": 1.7361605942,
      "stddev": 0.037616255886378965,
      "median": 1.7490037009,
      "user": 1.0926461800000002,
      "system": 0.9664764800000001,
      "min": 1.6736966463999998,
      "max": 1.7746884673999999
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3448881021,
      "stddev": 0.02023371912700692,
      "median": 0.33758226990000006,
      "user": 0.35552288,
      "system": 0.67602688,
      "min": 0.32352259440000003,
      "max": 0.3789829444
    },
    {
      "command": "pnpr@main",
      "mean": 0.3212960002,
      "stddev": 0.0233724961549313,
      "median": 0.3093300349,
      "user": 0.32136267999999996,
      "system": 0.61720718,
      "min": 0.2977229994,
      "max": 0.3573770954
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 439.4 ± 85.4 298.9 528.1 4.32 ± 0.87
pacquet@main 327.2 ± 23.5 292.9 371.3 3.21 ± 0.28
pnpr@HEAD 106.2 ± 6.0 95.5 117.8 1.04 ± 0.08
pnpr@main 101.8 ± 5.0 95.6 112.7 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.4394022046,
      "stddev": 0.0853980979923091,
      "median": 0.4802738485,
      "user": 0.44027468000000003,
      "system": 0.5712430399999999,
      "min": 0.298896463,
      "max": 0.528072927
    },
    {
      "command": "pacquet@main",
      "mean": 0.327186439,
      "stddev": 0.023531069793458342,
      "median": 0.33174099,
      "user": 0.33754417999999997,
      "system": 0.36388693999999994,
      "min": 0.29294845599999997,
      "max": 0.371304558
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10616058891666669,
      "stddev": 0.0059577469717428146,
      "median": 0.10593813300000002,
      "user": 0.047775179999999993,
      "system": 0.030505839999999996,
      "min": 0.09547885100000002,
      "max": 0.11783514300000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.10177075300000002,
      "stddev": 0.004994173125862787,
      "median": 0.10124294100000002,
      "user": 0.044095430000000005,
      "system": 0.02706398285714285,
      "min": 0.09557828900000001,
      "max": 0.11272313100000002
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 224.1 ± 9.8 211.0 237.2 1.02 ± 0.06
pacquet@main 220.8 ± 7.2 208.0 235.9 1.00
pnpm@HEAD 4903.7 ± 555.1 4353.5 5913.7 22.21 ± 2.62
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2241221571288889,
      "stddev": 0.009813179001850336,
      "median": 0.22396304424000002,
      "user": 0.26770617111111106,
      "system": 0.029681653333333335,
      "min": 0.21103273524000002,
      "max": 0.23717069524
    },
    {
      "command": "pacquet@main",
      "mean": 0.22076078590666667,
      "stddev": 0.007228966213153909,
      "median": 0.22035257324000002,
      "user": 0.2606188377777777,
      "system": 0.036961986666666655,
      "min": 0.20796844224000002,
      "max": 0.23586301524000003
    },
    {
      "command": "pnpm@HEAD",
      "mean": 4.90369997624,
      "stddev": 0.5550832110639364,
      "median": 4.732744480239999,
      "user": 7.942212948888888,
      "system": 0.4205857644444444,
      "min": 4.35348434224,
      "max": 5.9137437972399995
    }
  ]
}

Scenario: Isolated linker: linked-workspace resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 86.8 ± 5.3 80.7 102.5 1.02 ± 0.08
pacquet@main 85.0 ± 3.9 79.6 94.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.08678417828857143,
      "stddev": 0.005347337201378288,
      "median": 0.08562482406000001,
      "user": 0.08253666571428571,
      "system": 0.04399733714285714,
      "min": 0.08065297506,
      "max": 0.10246266906000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.08504063486645164,
      "stddev": 0.003938133119618241,
      "median": 0.08462473906000001,
      "user": 0.08068543806451613,
      "system": 0.04721851870967742,
      "min": 0.07957407006000002,
      "max": 0.09436660806000001
    }
  ]
}

Scenario: Isolated linker: injected workspace repeat install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 91.1 ± 2.9 86.8 98.3 1.00
pacquet@main 92.0 ± 5.6 85.4 110.9 1.01 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.09110620911575758,
      "stddev": 0.002868540535592228,
      "median": 0.09048287054,
      "user": 0.03441210787878789,
      "system": 0.06392085939393938,
      "min": 0.08679397054,
      "max": 0.09834944754
    },
    {
      "command": "pacquet@main",
      "mean": 0.09204511702484847,
      "stddev": 0.005551375582819295,
      "median": 0.09089461354,
      "user": 0.03520468363636363,
      "system": 0.0646059503030303,
      "min": 0.08541625254,
      "max": 0.11085709254000001
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.466 ± 0.133 4.352 4.773 1.28 ± 0.06
pacquet@main 4.582 ± 0.170 4.350 4.862 1.31 ± 0.07
pnpr@HEAD 3.560 ± 0.146 3.408 3.822 1.02 ± 0.06
pnpr@main 3.502 ± 0.131 3.408 3.836 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.465841541320001,
      "stddev": 0.13317798084247529,
      "median": 4.41592394902,
      "user": 1.9191466,
      "system": 1.38667878,
      "min": 4.351969635520001,
      "max": 4.77250171052
    },
    {
      "command": "pacquet@main",
      "mean": 4.58239845652,
      "stddev": 0.16995803495633727,
      "median": 4.55806696302,
      "user": 1.8901790000000003,
      "system": 1.38714418,
      "min": 4.34956980952,
      "max": 4.861855468520001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5595646035199997,
      "stddev": 0.14645311678532544,
      "median": 3.54029468152,
      "user": 1.7871724,
      "system": 1.3319620799999998,
      "min": 3.40758243852,
      "max": 3.82231668252
    },
    {
      "command": "pnpr@main",
      "mean": 3.5019323375199995,
      "stddev": 0.13090681347794786,
      "median": 3.45259039452,
      "user": 1.7676892,
      "system": 1.3564281800000002,
      "min": 3.40774191352,
      "max": 3.83582533852
    }
  ]
}

Scenario: GVS linker: fresh restore, hot cache + hot store

Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 122.9 ± 3.6 117.8 132.8 1.01 ± 0.05
pacquet@main 121.5 ± 5.2 114.5 133.9 1.00
pnpr@HEAD 133.3 ± 4.8 126.7 143.0 1.10 ± 0.06
pnpr@main 127.7 ± 7.7 119.6 143.9 1.05 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.12291280827000002,
      "stddev": 0.003603199375620917,
      "median": 0.12262825512,
      "user": 0.15239095000000002,
      "system": 0.13542685999999998,
      "min": 0.11783184762000001,
      "max": 0.13278027962
    },
    {
      "command": "pacquet@main",
      "mean": 0.12152883219142854,
      "stddev": 0.0052103820427528485,
      "median": 0.12074753262000001,
      "user": 0.15687793333333333,
      "system": 0.12522411714285714,
      "min": 0.11448619262000001,
      "max": 0.13391339162000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.13333490156736844,
      "stddev": 0.004806509894663628,
      "median": 0.13265483962000002,
      "user": 0.15542870526315786,
      "system": 0.13880910210526318,
      "min": 0.12665310062000001,
      "max": 0.14300824562
    },
    {
      "command": "pnpr@main",
      "mean": 0.12771813917000002,
      "stddev": 0.0077345383889209736,
      "median": 0.12416844712000001,
      "user": 0.15589789999999998,
      "system": 0.12414071000000002,
      "min": 0.11962962062,
      "max": 0.14386954662
    }
  ]
}

Scenario: Store only: unlocked direct deps, cold cache + hot store

Store-only install (enableModulesDir: false, per-file store index, trusted lockfile) against a lockfile missing the direct dependencies that have peers, with the metadata cache wiped per iteration: the install resolves those from the registry, reuses their subtrees from the lockfile and checks the store, linking nothing. Direct installs only.

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.206 ± 0.053 1.162 1.287 1.00 ± 0.06
pacquet@main 1.205 ± 0.041 1.168 1.279 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.20580631536,
      "stddev": 0.05336258648339657,
      "median": 1.18084991286,
      "user": 0.51740116,
      "system": 0.21485333999999998,
      "min": 1.16203255036,
      "max": 1.28747332636
    },
    {
      "command": "pacquet@main",
      "mean": 1.2050222938600001,
      "stddev": 0.041001742048695666,
      "median": 1.1931324348599999,
      "user": 0.5124040599999999,
      "system": 0.22860724000000002,
      "min": 1.16834744636,
      "max": 1.27853211336
    }
  ]
}

Scenario: Cargo: repeat install, hot cache + hot store

Frozen repeat install of a Cargo workspace (cargo.enabled: true) whose crates are already materialized in <storeDir>/v11/crates/ and linked into .pnpm/crates/crates-io. Direct installs only.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 38.2 ± 2.5 33.3 43.4 1.00 ± 0.11
pacquet@main 38.1 ± 3.2 31.9 45.6 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.03819662785897436,
      "stddev": 0.0025412249575090507,
      "median": 0.038397553,
      "user": 0.026467696410256408,
      "system": 0.022398591282051277,
      "min": 0.033309684000000006,
      "max": 0.043406732
    },
    {
      "command": "pacquet@main",
      "mean": 0.03808531964102564,
      "stddev": 0.00318304326390581,
      "median": 0.037817735000000005,
      "user": 0.026606119487179496,
      "system": 0.02240712974358974,
      "min": 0.031889325,
      "max": 0.04564093600000001
    }
  ]
}

@codecov-commenter

codecov-commenter commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.79592% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.74%. Comparing base (5bd38b1) to head (66e13d5).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pnpr/crates/pnpr/src/resolver/streaming.rs 58.82% 7 Missing ⚠️
pnpr/crates/pnpr/src/resolver.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17596   +/-   ##
=======================================
  Coverage   92.74%   92.74%           
=======================================
  Files        2032     2033    +1     
  Lines      262179   262273   +94     
=======================================
+ Hits       243166   243256   +90     
- Misses      19013    19017    +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zkochan
zkochan marked this pull request as ready for review November 3, 2026 07:07
Copilot AI balanced review requested due to automatic review settings November 3, 2026 07:07

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Negotiate lockfile format 13 for package platform variants

✨ Enhancement 🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Mark lockfiles containing registry package variants as format 13, preventing older pnpm versions
 from dropping them.
• Negotiate accepted formats with pnpr and reject incompatible results across resolution paths.
• Keep runtime binary variants on format 9 and document the compatibility contract.
Diagram

graph TD
  G["Dependency graph"] --> C{"Package variants?"} -->|"13 or 9"| L["Versioned lockfile"] --> P["pnpm client"] -->|"Accepted formats"| R["pnpr resolve paths"] --> A{"Format accepted?"} -->|"Yes"| D["Done frame"]
  A -->|"No"| E["Incompatible error"]
Loading
High-Level Assessment

The shared package-variant check and refusal of unaccepted results fit the compatibility requirement. Marking every variations resolution as format 13 would unnecessarily affect runtime lockfiles; downgrading server results would risk losing package variants.

Files changed (17) +316 / -37

Enhancement (9) +131 / -26
pnpr_request.rsAnnounce readable formats in pnpr resolves +3/-0

Announce readable formats in pnpr resolves

• Populates resolve options with the shared list of lockfile formats accepted by this pnpm client.

pnpm/crates/cli/src/cli_args/install/pnpr_request.rs

lib.rsDetect package variants in a lockfile +11/-0

Detect package variants in a lockfile

• Adds a lockfile-level check for package resolutions that require format 13.

pnpm/crates/lockfile/src/lib.rs

lockfile_version.rsRecognize and advertise format 13 +12/-1

Recognize and advertise format 13

• Defines the package-variants format major and accepted-format list, and permits format 13 in the existing version compatibility check.

pnpm/crates/lockfile/src/lockfile_version.rs

dependencies_graph_to_lockfile.rsChoose lockfile version from package resolutions +6/-3

Choose lockfile version from package resolutions

• Writes format 13 when generated package entries contain platform variants; otherwise retains format 9.

pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs

frozen.rsRecognize format 13 during frozen installs +2/-1

Recognize format 13 during frozen installs

• Includes format 13 in the frozen materialization path's supported-major assertion.

pnpm/crates/package-manager/src/install/materialize/frozen.rs

lib.rsCarry accepted formats in resolve options +3/-0

Carry accepted formats in resolve options

• Adds accepted lockfile formats to the client options serialized into pnpr requests.

pnpm/crates/pnpr-client/src/lib.rs

resolver.rsCheck cached results before returning them +5/-12

Check cached results before returning them

• Rejects cached lockfiles in formats the client did not accept and moves request-level validation into its dedicated module.

pnpr/crates/pnpr/src/resolver.rs

request_validation.rsValidate lockfile format negotiation +69/-7

Validate lockfile format negotiation

• Compares accepted formats by major and checks input or resulting lockfiles against client capabilities. Requests without a format list cannot receive package-variant lockfiles.

pnpr/crates/pnpr/src/resolver/request_validation.rs

streaming.rsRefuse unaccepted streamed results +20/-2

Refuse unaccepted streamed results

• Emits an incompatibility error instead of a done frame when a resolved lockfile uses an unaccepted format.

pnpr/crates/pnpr/src/resolver/streaming.rs

Bug fix (1) +9 / -0
resolution.rsDistinguish package variants from runtime archives +9/-0

Distinguish package variants from runtime archives

• Adds a resolution-level check that excludes runtime binary variations from the format 13 requirement.

pnpm/crates/lockfile/src/resolution.rs

Tests (6) +175 / -10
tests.rsVerify advertised formats are readable +13/-1

Verify advertised formats are readable

• Tests format 13 compatibility and checks that every format announced to pnpr passes the client's version check.

pnpm/crates/lockfile/src/lockfile_version/tests.rs

importer_records.rsTest package and runtime version selection +53/-5

Test package and runtime version selection

• Asserts that a registry package variant produces format 13 while a runtime with a real binary archive remains format 9.

pnpm/crates/package-manager/src/dependencies_graph_to_lockfile/tests/importer_records.rs

tests.rsAssert accepted formats appear in requests +6/-0

Assert accepted formats appear in requests

• Extends the request fixture and expectation to cover the acceptedLockfileFormats field.

pnpm/crates/pnpr-client/src/tests.rs

integration.rsProvide accepted formats in integration fixtures +5/-0

Provide accepted formats in integration fixtures

• Updates integration resolve options to announce formats 9, 12, and 13.

pnpm/crates/pnpr-client/tests/integration.rs

tests.rsAdjust resolver test imports +4/-3

Adjust resolver test imports

• Updates test imports for request-validation functions moved out of the resolver module.

pnpr/crates/pnpr/src/resolver/tests.rs

request_validation.rsTest format acceptance and runtime compatibility +94/-1

Test format acceptance and runtime compatibility

• Covers accepted and rejected majors, unmarked package variants, clients without a format list, shorthand format names, and runtime archives that remain compatible with format 9.

pnpr/crates/pnpr/src/resolver/tests/request_validation.rs

Documentation (1) +1 / -1
pnpr-platform-variants.mdDocument the format 13 compatibility contract +1/-1

Document the format 13 compatibility contract

• Explains that package variants require lockfile format 13 and pnpr returns such lockfiles only to clients that accept it.

.changeset/pnpr-platform-variants.md

@qodo-code-review

qodo-code-review Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (2) 📎 Requirement gaps (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Runtime updates can force format 13 ✓ Resolved
Description
The new is_package_variants treats every Variations entry without a Binary archive as a
registry package variant. When runtime resolution is built with calc_specifier, its variants are
intentionally empty, so lockfile generation marks the runtime-only lockfile as 13.0 instead of the
9.0 format intended for runtime archives.
Code

pnpm/crates/lockfile/src/resolution.rs[R421-423]

+    pub fn is_package_variants(&self) -> bool {
+        matches!(self, LockfileResolution::Variations(variations) if !variations.is_runtime())
+    }
Relevance

●●● Strong

The classifier can misclassify intentionally empty runtime variations; this is a concrete
lockfile-format correctness risk.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed classifier recognizes runtime resolutions only by finding a Binary variant, while the
runtime resolver can intentionally produce an empty variants list. The changed lockfile-generation
code uses that classifier to select major 13, so an empty runtime resolution can incorrectly trigger
the platform-variants format.

Use lockfile format 13.0 for platform variants
pnpm/crates/lockfile/src/resolution.rs[416-423]
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs[167-172]
pnpm/crates/engine-runtime-node-resolver/src/node_resolver.rs[178-194]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

Issue description
Empty runtime `Variations` resolutions created during `calc_specifier` are classified as package platform variants, causing runtime-only lockfiles to be written as format `13.0` instead of `9.0`.

Fix Focus Areas
- pnpm/crates/lockfile/src/resolution.rs[416-423]
- pnpm/crates/engine-runtime-node-resolver/src/node_resolver.rs[178-194]
- pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs[167-172]

Recommended Fix
Ensure runtime resolutions remain distinguishable when their variants are empty, or otherwise exclude them from `is_package_variants`; retain format `13.0` only for registry package platform variants and add a regression test for the `calc_specifier` path.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. A compatibility comment describes past behavior 📘 Rule violation ⚙ Maintainability ⭐ New
Description
The new documentation says runtime archives have been readable in format 9.0 all along instead of
stating only the current compatibility contract. The historical phrasing is attached to
is_package_variants and can become stale as supported formats or runtime resolution behavior
change.
Code

pnpm/crates/lockfile/src/resolution.rs[R418-421]

+    /// format can hold: a `variations` resolution with an archive that is
+    /// not a runtime's `binary` one. A runtime's archives use the same shape
+    /// and have been readable in format 9.0 all along, including the empty
+    /// list a runtime resolver returns when it only computes a specifier.
Relevance

●●● Strong

Recent Rust documentation precedent accepts removing historical framing from comments describing
current contracts.

PR-#13730

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed Rust documentation explicitly uses the temporal phrase `have been readable in format 9.0
all along`, which describes past history rather than only the current contract.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/lockfile/src/resolution.rs[418-421]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

Issue description
The documentation for `is_package_variants` uses the historical phrase `have been readable in format 9.0 all along`, while comments must describe current behavior rather than historical implementations.

Fix Focus Areas
- pnpm/crates/lockfile/src/resolution.rs[418-421]

Recommended Fix
Replace the historical wording with a current-behavior statement, such as `Runtime archives use the same shape and remain compatible with format 9.0, including the empty list returned when a runtime resolver only computes a specifier.`

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


3. The changeset uses non-list colons 📘 Rule violation ✧ Quality ⭐ New
Description
The modified changeset line uses serverType: and lockfileVersion: as field separators rather
than introducing a list or example. This violates the changeset punctuation convention for the
release note.
Code

.changeset/pnpr-platform-variants.md[6]

+pnpm installs the platform variants of packages from a registry declared with `serverType: pnpr`. The lockfile records every variant of a package, and pnpm links the one that fits the host, or the package's own archive when none does. A lockfile that records platform variants has `lockfileVersion: '13.0'`. Older pnpm versions refuse to read it, so they cannot rewrite the lockfile without its variants. pnpr returns such a lockfile only to a pnpm that accepts that format.
Evidence
The added changeset line contains both serverType: and lockfileVersion: as inline field labels,
not as list or example introductions.

Rule 3058313: Changeset text formatting conventions
.changeset/pnpr-platform-variants.md[6-6]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

Issue description
The modified changeset contains `serverType:` and `lockfileVersion:` colons that do not introduce a list or example, contrary to the changeset formatting convention.

Fix Focus Areas
- .changeset/pnpr-platform-variants.md[6-6]

Recommended Fix
Rewrite the sentence so these values are expressed without decorative colons while preserving the user-visible behavior description, for example by using wording such as `a registry configured with server type pnpr` and `the 13.0 lockfile format`. Keep the existing straight quotes and separate observable changes into clear sentences.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


4. Format-12-only requests waste a resolve 🐞 Bug ➹ Performance ⭐ New
Description
reject_incompatible_lockfile_format now admits clients accepting only 12.0 even when they supply
no lockfile, although a fresh resolve writes only format 9 or 13. Such a request performs resolution
before the result-format check rejects it, despite having no path to a compatible result.
Code

pnpr/crates/pnpr/src/resolver/request_validation.rs[307]

+            .any(|major| matches!(major, 9 | 12 | PLATFORM_VARIANTS_LOCKFILE_MAJOR))
Relevance

●● Moderate

Performance concern is plausible, but no close precedent establishes rejecting this
format-negotiation behavior.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new filter accepts 12 alone, and with no input lockfile its subsequent input check does nothing.
The handler then reaches the cache or streamed resolution path; the lockfile writer selects major 9
unless package variants require 13, and the stream checks format acceptance only after resolving.

pnpr/crates/pnpr/src/resolver/request_validation.rs[298-317]
pnpr/crates/pnpr/src/resolver.rs[369-415]
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs[165-170]
pnpr/crates/pnpr/src/resolver/streaming.rs[68-104]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A request accepting only format 12 without an input lockfile cannot receive a compatible fresh result, but currently runs a full resolve before being rejected.

## Fix Focus Areas
- pnpr/crates/pnpr/src/resolver/request_validation.rs[303-317]
- pnpr/crates/pnpr/src/resolver.rs[369-415]

## Recommended Fix
Preserve format-12-only acceptance for eligible frozen input lockfiles, but reject requests without an input lockfile when their accepted formats exclude both generated formats, 9 and 13, during initial validation.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


View medium (3)
5. Rejected installs still fetch tarballs 🐞 Bug ➹ Performance
Description
stream_resolution checks the resolved lockfile's format only after resolution has emitted package
frames. When resolution produces platform variants for a client that did not accept format 13,
pnpm's package-frame callback may already have started tarball prefetches before the incompatibility
error arrives.
Code

pnpr/crates/pnpr/src/resolver/streaming.rs[R85-87]

+    if reject_unaccepted_lockfile_format(&task.inputs.request, &lockfile, tx) {
+        return;
+    }
Relevance

●●● Strong

Rejecting after package frames permits unnecessary tarball prefetches; recent performance findings
on resolver work were accepted.

PR-#15747

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The observer sends package frames during resolution; the changed rejection runs afterward. The pnpm
CLI immediately forwards those frames to its tarball prefetcher, so the eventual error does not
prevent the downloads from starting.

pnpr/crates/pnpr/src/resolver/streaming.rs[64-87]
pnpr/crates/pnpr/src/resolver/wire.rs[42-56]
pnpm/crates/pnpr-client/src/resolve.rs[108-119]
pnpm/crates/cli/src/cli_args/install/pnpr_resolution.rs[192-229]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A streamed resolve can start client tarball downloads before its terminal format check rejects the result.
## Fix Focus Areas
- pnpr/crates/pnpr/src/resolver/streaming.rs[64-119]
- pnpr/crates/pnpr/src/resolver/wire.rs[42-56]
## Recommended Fix
For clients that cannot accept the variants format, prevent package frames from triggering speculative fetches until the result's format is known to be accepted. Retain early streaming for requests that accept both possible generated formats, and avoid unbounded buffering.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


6. Format-12-only clients cannot reuse locks ✓ Resolved
Description
reject_incompatible_lockfile_format rejects every accepted-format list lacking 9 or 13, even
though the frozen path can return an unchanged format-12 lockfile. A client advertising only 12.0
is refused before its compatible input lockfile reaches frozen reuse, despite the later output check
accepting that format.
Code

pnpr/crates/pnpr/src/resolver/request_validation.rs[R303-305]

+            .iter()
+            .filter_map(|format| format_major(format))
+            .any(|major| major == 9 || major == PLATFORM_VARIANTS_LOCKFILE_MAJOR)
Relevance

●●● Strong

Frozen-lockfile compatibility is treated as correctness-critical, and this check contradicts the
later format-12 acceptance path.

PR-#12144
PR-#13386

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new initial check excludes major 12, while the frozen path can return its input lockfile and the
new result check explicitly accepts a matching major 12.

pnpr/crates/pnpr/src/resolver/request_validation.rs[301-315]
pnpr/crates/pnpr/src/resolver/request_validation.rs[345-360]
pnpr/crates/pnpr/src/resolver/resolve.rs[252-270]
pnpr/crates/pnpr/src/resolver.rs[351-367]
pnpr/crates/pnpr/src/resolver.rs[461-478]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The initial format check rejects a 12.0-only client before pnpr can return its unchanged, compatible frozen lockfile.
## Fix Focus Areas
- pnpr/crates/pnpr/src/resolver/request_validation.rs[301-315]
- pnpr/crates/pnpr/src/resolver/tests/request_validation.rs[111-203]
## Recommended Fix
Allow a 12.0-only request to reach frozen reuse when its input lockfile is compatible. Preserve rejection when the actual result is in an unaccepted format, and test the complete request path rather than only the output predicate.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. The changeset joins two behavior changes ✓ Resolved
Description
The new changeset paragraph puts the lockfile format marker and pnpr client negotiation in one
sentence joined by and, rather than giving each user-visible change its own sentence. This makes
the release note combine the lockfile-version change with the server compatibility behavior instead
of presenting them as separate changes.
Code

.changeset/pnpr-platform-variants.md[6]

+pnpm installs the platform variants of packages from a registry declared with `serverType: pnpr`. The lockfile records every variant of a package, and pnpm links the one that fits the host, or the package's own archive when none does. A lockfile that records platform variants has `lockfileVersion: '13.0'`, which older pnpm versions refuse instead of rewriting the lockfile without its variants, and pnpr returns such a lockfile only to a pnpm that accepts that format.
Relevance

●●● Strong

Recent changeset precedents accept splitting compound user-visible behaviors into separate
sentences.

PR-#17578
PR-#17551

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The modified changeset line contains two distinct user-visible behaviors in one compound sentence:
the lockfile format marker and pnpr's format negotiation. The checklist requires each sentence in a
changeset entry to describe only one logical change.

Rule 3058304: Avoid compound sentences in individual changeset entries
.changeset/pnpr-platform-variants.md[6-6]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

Issue description
The changeset sentence combines the lockfile format change and pnpr negotiation behavior, contrary to the convention that each sentence describe one logical change.

Fix Focus Areas
- .changeset/pnpr-platform-variants.md[6-6]

Recommended Fix
Rewrite the added text as separate sentences, with one sentence describing the `lockfileVersion: '13.0'` behavior and another describing pnpr's accepted-format negotiation.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

8. Refused resolves redo the full resolve on retry ✓ Resolved
Description
In stream_resolution, the new format check reject_unaccepted_lockfile_format returns before
store_resolution_candidate, so pnpr throws away a lockfile it fully resolved and never caches it.
resolution_cache_key does not include acceptedLockfileFormats, so the cached copy would have let
cached_resolution_response refuse the next identical request cheaply. Instead, each retry from a
client that only accepts 9.0, for a project with variants, repeats the whole metadata fetch and tree
walk, and a later client that does accept 13.0 misses the cache too.
Code

pnpr/crates/pnpr/src/resolver/streaming.rs[R85-87]

+    if reject_unaccepted_lockfile_format(&task.inputs.request, &lockfile, tx) {
+        return;
+    }
Relevance

●● Moderate

The cache optimization is plausible, but historical evidence does not closely establish caching
rejected resolutions.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The streamed path checks the format, then OSV, then stores the result in the cache. The cache key
(cache.rs) leaves out the accepted formats, and the cached path (resolver.rs) already runs the same
format check on each hit, so storing the result first would still refuse the client safely.

pnpr/crates/pnpr/src/resolver/streaming.rs[85-101]
pnpr/crates/pnpr/src/resolver/cache.rs[184-221]
pnpr/crates/pnpr/src/resolver.rs[489-508]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A streamed resolve whose result needs format 13.0 is refused for a client that does not accept 13.0, but the resolved lockfile is never cached. Each retry repeats the full resolve.

## Fix Focus Areas
- pnpr/crates/pnpr/src/resolver/streaming.rs[85-101]

## Recommended Fix
Run the OSV check and `store_resolution_candidate` first, then call `reject_unaccepted_lockfile_format`, and send the `done` frame only if the format is accepted. The cache key leaves out `acceptedLockfileFormats`, and `cached_resolution_response` already checks the format on each hit, so later identical requests are refused from the cache without resolving again.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Linked PRs:
  🌐 PR #17584
  🌐 PR #17559
✅ Compliance rules (platform): 70 rules
✅ Cross-repo context — repo relationships
  Explored: repo: pnpm/update (sha: 2457663d) — View relationship
  Explored: repo: pnpm/exec (sha: d9dca8d2) — View relationship
  Explored: repo: pnpm/benchmarks (sha: 42bef84d) — View relationship
  Explored: repo: pnpm/setup (sha: 186022e4) — View relationship
  Explored: repo: pnpm/xray (sha: e98dca73) — View relationship
Review mode: Auto: ⚖️ Balanced: Protocol negotiation spans multiple resolution paths with compatibility risk.

Grey Divider

Tip of the day
💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 66e13d5 ⚖️ Balanced

Results up to commit 1de8d6f 🧠 Deep


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Runtime updates can force format 13 ✓ Resolved
Description
The new is_package_variants treats every Variations entry without a Binary archive as a
registry package variant. When runtime resolution is built with calc_specifier, its variants are
intentionally empty, so lockfile generation marks the runtime-only lockfile as 13.0 instead of the
9.0 format intended for runtime archives.
Code

pnpm/crates/lockfile/src/resolution.rs[R421-423]

+    pub fn is_package_variants(&self) -> bool {
+        matches!(self, LockfileResolution::Variations(variations) if !variations.is_runtime())
+    }
Relevance

●●● Strong

The classifier can misclassify intentionally empty runtime variations; this is a concrete
lockfile-format correctness risk.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed classifier recognizes runtime resolutions only by finding a Binary variant, while the
runtime resolver can intentionally produce an empty variants list. The changed lockfile-generation
code uses that classifier to select major 13, so an empty runtime resolution can incorrectly trigger
the platform-variants format.

Use lockfile format 13.0 for platform variants
pnpm/crates/lockfile/src/resolution.rs[416-423]
pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs[167-172]
pnpm/crates/engine-runtime-node-resolver/src/node_resolver.rs[178-194]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

Issue description
Empty runtime `Variations` resolutions created during `calc_specifier` are classified as package platform variants, causing runtime-only lockfiles to be written as format `13.0` instead of `9.0`.

Fix Focus Areas
- pnpm/crates/lockfile/src/resolution.rs[416-423]
- pnpm/crates/engine-runtime-node-resolver/src/node_resolver.rs[178-194]
- pnpm/crates/package-manager/src/dependencies_graph_to_lockfile.rs[167-172]

Recommended Fix
Ensure runtime resolutions remain distinguishable when their variants are empty, or otherwise exclude them from `is_package_variants`; retain format `13.0` only for registry package platform variants and add a regression test for the `calc_specifier` path.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
2. Rejected installs still fetch tarballs 🐞 Bug ➹ Performance
Description
stream_resolution checks the resolved lockfile's format only after resolution has emitted package
frames. When resolution produces platform variants for a client that did not accept format 13,
pnpm's package-frame callback may already have started tarball prefetches before the incompatibility
error arrives.
Code

pnpr/crates/pnpr/src/resolver/streaming.rs[R85-87]

+    if reject_unaccepted_lockfile_format(&task.inputs.request, &lockfile, tx) {
+        return;
+    }
Relevance

●●● Strong

Rejecting after package frames permits unnecessary tarball prefetches; recent performance findings
on resolver work were accepted.

PR-#15747

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The observer sends package frames during resolution; the changed rejection runs afterward. The pnpm
CLI immediately forwards those frames to its tarball prefetcher, so the eventual error does not
prevent the downloads from starting.

pnpr/crates/pnpr/src/resolver/streaming.rs[64-87]
pnpr/crates/pnpr/src/resolver/wire.rs[42-56]
pnpm/crates/pnpr-client/src/resolve.rs[108-119]
pnpm/crates/cli/src/cli_args/install/pnpr_resolution.rs[192-229]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A streamed resolve can start client tarball downloads before its terminal format check rejects the result.
## Fix Focus Areas
- pnpr/crates/pnpr/src/resolver/streaming.rs[64-119]
- pnpr/crates/pnpr/src/resolver/wire.rs[42-56]
## Recommended Fix
For clients that cannot accept the variants format, prevent package frames from triggering speculative fetches until the result's format is known to be accepted. Retain early streaming for requests that accept both possible generated formats, and avoid unbounded buffering.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


3. Format-12-only clients cannot reuse locks ✓ Resolved
Description
reject_incompatible_lockfile_format rejects every accepted-format list lacking 9 or 13, even
though the frozen path can return an unchanged format-12 lockfile. A client advertising only 12.0
is refused before its compatible input lockfile reaches frozen reuse, despite the later output check
accepting that format.
Code

pnpr/crates/pnpr/src/resolver/request_validation.rs[R303-305]

+            .iter()
+            .filter_map(|format| format_major(format))
+            .any(|major| major == 9 || major == PLATFORM_VARIANTS_LOCKFILE_MAJOR)
Relevance

●●● Strong

Frozen-lockfile compatibility is treated as correctness-critical, and this check contradicts the
later format-12 acceptance path.

PR-#12144
PR-#13386

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new initial check excludes major 12, while the frozen path can return its input lockfile and the
new result check explicitly accepts a matching major 12.

pnpr/crates/pnpr/src/resolver/request_validation.rs[301-315]
pnpr/crates/pnpr/src/resolver/request_validation.rs[345-360]
pnpr/crates/pnpr/src/resolver/resolve.rs[252-270]
pnpr/crates/pnpr/src/resolver.rs[351-367]
pnpr/crates/pnpr/src/resolver.rs[461-478]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The initial format check rejects a 12.0-only client before pnpr can return its unchanged, compatible frozen lockfile.
## Fix Focus Areas
- pnpr/crates/pnpr/src/resolver/request_validation.rs[301-315]
- pnpr/crates/pnpr/src/resolver/tests/request_validation.rs[111-203]
## Recommended Fix
Allow a 12.0-only request to reach frozen reuse when its input lockfile is compatible. Preserve rejection when the actual result is in an unaccepted format, and test the complete request path rather than only the output predicate.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. The changeset joins two behavior changes ✓ Resolved
Description
The new changeset paragraph puts the lockfile format marker and pnpr client negotiation in one
sentence joined by and, rather than giving each user-visible change its own sentence. This makes
the release note combine the lockfile-version change with the server compatibility behavior instead
of presenting them as separate changes.
Code

.changeset/pnpr-platform-variants.md[6]

+pnpm installs the platform variants of packages from a registry declared with `serverType: pnpr`. The lockfile records every variant of a package, and pnpm links the one that fits the host, or the package's own archive when none does. A lockfile that records platform variants has `lockfileVersion: '13.0'`, which older pnpm versions refuse instead of rewriting the lockfile without its variants, and pnpr returns such a lockfile only to a pnpm that accepts that format.
Relevance

●●● Strong

Recent changeset precedents accept splitting compound user-visible behaviors into separate
sentences.

PR-#17578
PR-#17551

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The modified changeset line contains two distinct user-visible behaviors in one compound sentence:
the lockfile format marker and pnpr's format negotiation. The checklist requires each sentence in a
changeset entry to describe only one logical change.

Rule 3058304: Avoid compound sentences in individual changeset entries
.changeset/pnpr-platform-variants.md[6-6]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

Issue description
The changeset sentence combines the lockfile format change and pnpr negotiation behavior, contrary to the convention that each sentence describe one logical change.

Fix Focus Areas
- .changeset/pnpr-platform-variants.md[6-6]

Recommended Fix
Rewrite the added text as separate sentences, with one sentence describing the `lockfileVersion: '13.0'` behavior and another describing pnpr's accepted-format negotiation.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational
5. Refused resolves redo the full resolve on retry ✓ Resolved
Description
In stream_resolution, the new format check reject_unaccepted_lockfile_format returns before
store_resolution_candidate, so pnpr throws away a lockfile it fully resolved and never caches it.
resolution_cache_key does not include acceptedLockfileFormats, so the cached copy would have let
cached_resolution_response refuse the next identical request cheaply. Instead, each retry from a
client that only accepts 9.0, for a project with variants, repeats the whole metadata fetch and tree
walk, and a later client that does accept 13.0 misses the cache too.
Code

pnpr/crates/pnpr/src/resolver/streaming.rs[R85-87]

+    if reject_unaccepted_lockfile_format(&task.inputs.request, &lockfile, tx) {
+        return;
+    }
Relevance

●● Moderate

The cache optimization is plausible, but historical evidence does not closely establish caching
rejected resolutions.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The streamed path checks the format, then OSV, then stores the result in the cache. The cache key
(cache.rs) leaves out the accepted formats, and the cached path (resolver.rs) already runs the same
format check on each hit, so storing the result first would still refuse the client safely.

pnpr/crates/pnpr/src/resolver/streaming.rs[85-101]
pnpr/crates/pnpr/src/resolver/cache.rs[184-221]
pnpr/crates/pnpr/src/resolver.rs[489-508]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A streamed resolve whose result needs format 13.0 is refused for a client that does not accept 13.0, but the resolved lockfile is never cached. Each retry repeats the full resolve.

## Fix Focus Areas
- pnpr/crates/pnpr/src/resolver/streaming.rs[85-101]

## Recommended Fix
Run the OSV check and `store_resolution_candidate` first, then call `reject_unaccepted_lockfile_format`, and send the `done` frame only if the format is accepted. The cache key leaves out `acceptedLockfileFormats`, and `cached_resolution_response` already checks the format on each hit, so later identical requests are refused from the cache without resolving again.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread pnpm/crates/lockfile/src/resolution.rs Resolved
@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread .changeset/pnpr-platform-variants.md Resolved
- Count a `variations` resolution as a package's variants only when one
  of its archives is not a runtime's `binary` one. A runtime resolver
  that only computes a specifier returns no archives at all, and that
  empty list must not mark the lockfile as format 13.
- Accept a request that reads only 12.0: a frozen resolve returns the
  client's 12.0 lockfile unchanged, and the result check still refuses
  any other format.
- Cache a streamed result before refusing its format. The cache key
  leaves out the accepted formats and a cache hit runs the same check,
  so a retry is refused without resolving again.
- Split the changeset's lockfile-format sentence in two.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 3, 2026 07:17

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Copilot AI balanced review requested due to automatic review settings November 3, 2026 07:17

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@zkochan

zkochan commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Replies to the Qodo review of 1de8d6f (the findings that were only in the summary):

  1. Compound changeset sentence. Fixed in ba0b05b and 66e13d5.
  2. A client that reads only 12.0 is refused up front. Fixed in ba0b05b. The up-front check now accepts any of 9, 12, or 13, because a frozen resolve returns a 12.0 input lockfile unchanged. The result check still refuses any other format. A request-level test covers a 12.0-only client with a 12.0 lockfile.
  3. Package frames start tarball prefetches before the format refusal. Not acting on this. The refusal only reaches a client that doesn't accept 13.0, which in practice means a pnpm older than this PR, and it ends the install with an error. Buffering or suppressing package frames until the format is known would slow down the streamed path for every accepting client to save some wasted downloads on an error path.
  4. A refused streamed result is never cached. Fixed in ba0b05b. The result is cached before the format check. The cache key leaves out the accepted formats and cached_resolution_response runs the same check, so a retry is refused from the cache.

Written by an agent (Claude Code, claude-opus-5-5).

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 66e13d5

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

No code suggestions found for the PR.

@zkochan

zkochan commented Nov 3, 2026 •

Copy link
Copy Markdown
Member Author

Closing this: the maintainers chose not to bump the lockfile format. Lockfiles stay at lockfileVersion: '9.0'. Only pnpr's package variants would have needed a new format. A new version wouldn't protect them from older pnpm v12 releases either. With --frozen-lockfile those releases already refuse a variant entry, because of its fallback field. Without it, they re-resolve a lockfile they can't read, whether the problem is the entry or the version, and that drops the variants either way. The platform-variants RFC is being updated to match (pnpm/rfcs#68).

Thanks for #17584, which this PR carried rebased onto main.

Written by an agent (Claude Code, claude-opus-5-5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants