Skip to content

fix(peers): check linked peers against remote tarball manifest versions - #17050

Merged
zkochan merged 3 commits into
pnpm:mainfrom
samanyudas:fix/remote-tarball-peer-versions
Oct 17, 2026
Merged

zkochan merged 3 commits into
pnpm:mainfrom
samanyudas:fix/remote-tarball-peer-versions

Conversation

@samanyudas

@samanyudas samanyudas commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #17037.

Say a workspace package declares a peer, and the project that links it provides that peer through a remote tarball URL (for example a codeload.github.com tarball). pnpm 12 then compares the peer range with the URL, not the tarball's version. pnpm install with strictPeerDependencies: true fails with ERR_PNPM_PEER_DEP_ISSUES, and pnpm peers check reports Installed: https://…. pnpm 11 is not affected.

Root cause

The lockfile check for linked workspace packages (deps-inspection-peers, resolved_peer_version in linked.rs) treated the importer's version: field as the found version. For a remote tarball, that field is the URL, even though the lockfile's packages entry records the manifest version (version: 10.0.0). #15299 fixed this for file: tarballs only, and for the snapshot-level check. Importer dependencies with a regular reference such as a URL still used the raw reference.

Fix

For every resolved importer dependency, resolved_peer_version now uses the version recorded in the lockfile's packages entry. If that entry has no version, it falls back to the reference, as before. That is the normal case for registry packages, so their behavior doesn't change. The existing file: helper does this lookup and was renamed from resolve_file_version to resolve_locked_version, since it now covers both cases.

Testing

  • Reproduced the issue's exact workspace with a debug build. Before the fix, both pnpm install and pnpm peers check failed. After it, both succeed.
  • New unit test remote_tarball_peer_versions_of_linked_packages_use_metadata in deps-inspection-peers. It checks that a satisfying version passes and that an unsatisfying one is reported with the manifest version.
  • New CLI test remote_tarball_peer_of_a_linked_package_uses_the_manifest_version in tarball_url_dependency.rs. It serves the tarball from a mock host and runs install and peers check against 1.0.0 (passes) and 2.0.0 (fails with Installed: 2.0.0).
  • Both new tests fail without the fix: the found version is the tarball URL.
  • pnpm test:rust -p pnpm-deps-inspection-peers: 54 passed. The peer and tarball CLI tests: 268 passed. Workspace cargo clippy --all-targets -D warnings is clean.

Squash Commit Body

`pnpm install` with `strictPeerDependencies` and `pnpm peers check`
reported an unmet peer when a workspace package's peer was provided by a
remote tarball URL in the consuming project. The importer-level peer
check for linked workspace packages used the importer's `version:` field
(the URL) as the found version, while the lockfile's `packages` entry
already records the tarball manifest's version.

Prefer that recorded version for every resolved importer dependency,
falling back to the version in the reference for registry packages.
This matches the snapshot-level check, which reads package metadata
since the local tarball fix in pnpm/pnpm#15299.

Closes pnpm/pnpm#17037.

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. (pnpm 11 is not affected.)
  • 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.

This PR was written with the help of an AI agent.


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

🤖 Generated with Claude Code


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

Summary by CodeRabbit

  • Bug Fixes
    • Peer-dependency checks now use the version declared in a remote tarball’s metadata when validating a linked workspace package. Checks pass when that version satisfies the peer range and report the installed version when it does not. This keeps validation results consistent with the package version actually provided by the tarball.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7252a2cc-6080-4c42-833b-a417a353fba6
📥 Commits

Reviewing files that changed from the base of the PR and between 0d68960 and c1b4027.

📒 Files selected for processing: 1
  • pnpm/crates/deps-inspection-peers/src/linked.rs

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

📝 Walkthrough

Peer version resolution now checks lockfile metadata for remote tarball dependencies. Tests cover matching and non-matching provider manifest versions in peer inspection and CLI flows.

Changes: Remote tarball peer version handling

Layer / File(s) Summary
Resolve peer versions from lockfile metadata
pnpm/crates/deps-inspection-peers/src/linked.rs
Peer resolution checks link targets first, then lockfile metadata for other dependency specifications. It falls back to an extracted peer version or a file: target.
Validate remote tarball peer handling
pnpm/crates/deps-inspection-peers/src/tests.rs, pnpm/crates/cli/tests/suite/tarball_url_dependency.rs, .changeset/remote-tarball-peer-versions.md
Tests check matching and non-matching tarball manifest versions through peer inspection, install, and peers check. The changeset describes the peer-version check.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix · Severity of issue fixed: Medium

Objective Addressed Explanation
Use a remote tarball’s manifest version to determine whether it satisfies a workspace package’s peer range [#17037] ✅

Suggested labels: product: pacquet

Merge Risk: ⚪ Minimal · up to c1b40

Remote tarball peer checks use the package manifest version, with matching and mismatching cases asserted in unit and CLI tests. No concrete merge-blocking risk was identified.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • 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

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

codecov-commenter commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.56%. Comparing base (a4414d8) to head (c1b4027).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/deps-inspection-peers/src/linked.rs 57.14% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17050   +/-   ##
=======================================
  Coverage   92.56%   92.56%           
=======================================
  Files        1787     1787           
  Lines      229357   229355    -2     
=======================================
+ Hits       212308   212309    +1     
+ Misses      17049    17046    -3     

☔ 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.

@github-actions

github-actions Bot commented Oct 17, 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 2330.93 ms 2354.40 ms 1.0% 116.55 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1386.59 ms 1405.58 ms 1.4% 69.33 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 252.24 ms 236.41 ms -6.3% 12.61 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 283.66 ms 367.66 ms 29.6% 14.18 ms Inconclusive (not reproduced)
isolated-repeat-install-hot-cache-hot-store pacquet 12.84 ms 8.94 ms -30.4% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 8.75 ms 16.51 ms 88.8% 2.00 ms Inconclusive (overlapping samples)
isolated-repeat-install-cold-cache-hot-store pacquet 15.64 ms 9.41 ms -39.9% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 8.36 ms 9.18 ms 9.8% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2791.92 ms 2805.52 ms 0.5% 139.60 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1566.03 ms 1572.55 ms 0.4% 78.30 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 478.35 ms 434.74 ms -9.1% 23.92 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 375.59 ms 294.23 ms -21.7% 18.78 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1617.38 ms 1631.88 ms 0.9% 80.87 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 288.63 ms 304.60 ms 5.5% 14.43 ms Inconclusive (overlapping samples)
isolated-fresh-resolve-hot-cache-offline pacquet 236.09 ms 224.90 ms -4.7% 11.80 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 88.43 ms 89.37 ms 1.1% 4.42 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 254.86 ms 233.58 ms -8.3% 12.74 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 262.10 ms 205.84 ms -21.5% 13.11 ms Within tolerance
isolated-injected-workspace-repeat-install-hot-cache-hot-store pacquet 76.36 ms 75.08 ms -1.7% 3.82 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4485.66 ms 4585.86 ms 2.2% 224.28 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3561.02 ms 3585.46 ms 0.7% 178.05 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 126.96 ms 130.16 ms 2.5% 6.35 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 133.76 ms 137.51 ms 2.8% 6.69 ms Within tolerance
store-only-unlocked-direct-deps-cold-cache-hot-store pacquet 1146.06 ms 1170.17 ms 2.1% 57.30 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: c1b402759540

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked and injected 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.393 ± 0.099 2.287 2.559 1.66 ± 0.17
pacquet@main 2.376 ± 0.141 2.259 2.655 1.65 ± 0.18
pnpr@HEAD 1.447 ± 0.151 1.295 1.656 1.00 ± 0.14
pnpr@main 1.441 ± 0.131 1.309 1.686 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.39327542502,
      "stddev": 0.09885236646425458,
      "median": 2.3543989234200002,
      "user": 1.3542005400000001,
      "system": 1.4162242199999997,
      "min": 2.2867501309200002,
      "max": 2.5590579799200004
    },
    {
      "command": "pacquet@main",
      "mean": 2.37561088762,
      "stddev": 0.14134621169941916,
      "median": 2.3309253844200004,
      "user": 1.3334515399999998,
      "system": 1.3499527199999999,
      "min": 2.25947342292,
      "max": 2.6552917169200003
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.44713910342,
      "stddev": 0.15125125620675406,
      "median": 1.40557994792,
      "user": 1.2201699400000001,
      "system": 1.21284732,
      "min": 1.29513677992,
      "max": 1.6557869139199999
    },
    {
      "command": "pnpr@main",
      "mean": 1.44101295422,
      "stddev": 0.13121335222273553,
      "median": 1.38658962992,
      "user": 1.3538854399999998,
      "system": 1.34352462,
      "min": 1.30915057292,
      "max": 1.68573722692
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 238.4 ± 11.2 223.1 254.0 1.00
pacquet@main 254.0 ± 15.0 238.2 288.5 1.07 ± 0.08
pnpr@HEAD 355.4 ± 40.2 260.1 400.9 1.49 ± 0.18
pnpr@main 284.0 ± 13.0 267.9 310.1 1.19 ± 0.08

Confirmation (reversed target order)

Command Mean [ms] Min [ms] Max [ms] Relative
pnpr@main 287.4 ± 20.1 258.9 312.8 1.04 ± 0.10
pnpr@HEAD 288.1 ± 14.6 266.7 314.2 1.04 ± 0.08
pacquet@main 279.4 ± 17.5 254.9 302.3 1.01 ± 0.09
pacquet@HEAD 276.4 ± 17.2 249.1 316.6 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.23840716353999997,
      "stddev": 0.011225919646919198,
      "median": 0.23641092634000002,
      "user": 0.26123766000000004,
      "system": 0.5878272200000001,
      "min": 0.22310190134000002,
      "max": 0.25398074234
    },
    {
      "command": "pacquet@main",
      "mean": 0.25402329254,
      "stddev": 0.014995888940894573,
      "median": 0.25223753484,
      "user": 0.31765586,
      "system": 0.59827652,
      "min": 0.23820888734,
      "max": 0.28851353334
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.35539171443999995,
      "stddev": 0.0402463873229059,
      "median": 0.3676594603400001,
      "user": 0.40132006000000003,
      "system": 0.76424452,
      "min": 0.26010593234,
      "max": 0.40086433534000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.28396386604,
      "stddev": 0.01304918761812614,
      "median": 0.28366462734,
      "user": 0.30805346,
      "system": 0.65885832,
      "min": 0.26785483834,
      "max": 0.31014092934000004
    }
  ],
  "confirmation": {
    "results": [
      {
        "command": "pnpr@main",
        "mean": 0.28736925162,
        "stddev": 0.02012238061879242,
        "median": 0.28667422842,
        "user": 0.32683904,
        "system": 0.62487762,
        "min": 0.25893558642,
        "max": 0.31279806342
      },
      {
        "command": "pnpr@HEAD",
        "mean": 0.28812255662,
        "stddev": 0.014571643817615365,
        "median": 0.28605467292,
        "user": 0.30687243999999997,
        "system": 0.6588910199999999,
        "min": 0.26667911142,
        "max": 0.31416689742
      },
      {
        "command": "pacquet@main",
        "mean": 0.27944552491999997,
        "stddev": 0.017535218856232687,
        "median": 0.28465017642,
        "user": 0.33192583999999997,
        "system": 0.66917972,
        "min": 0.25487090042,
        "max": 0.30231483342
      },
      {
        "command": "pacquet@HEAD",
        "mean": 0.27635287722,
        "stddev": 0.017240796989444394,
        "median": 0.27586640292,
        "user": 0.33714714,
        "system": 0.63024912,
        "min": 0.24906619142000003,
        "max": 0.31664617042
      }
    ]
  }
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 9.0 ± 0.7 7.5 11.2 1.00
pacquet@main 12.6 ± 3.4 8.1 19.6 1.40 ± 0.39
pnpr@HEAD 16.5 ± 1.8 11.5 21.4 1.83 ± 0.25
pnpr@main 10.9 ± 3.6 7.3 19.6 1.21 ± 0.41
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.009005954679601327,
      "stddev": 0.0006914591412795642,
      "median": 0.00893664956,
      "user": 0.005208324916943521,
      "system": 0.004671658272425246,
      "min": 0.007465921560000001,
      "max": 0.01123021656
    },
    {
      "command": "pacquet@main",
      "mean": 0.012648712304186042,
      "stddev": 0.0034097173285951,
      "median": 0.01283556256,
      "user": 0.00696149379844961,
      "system": 0.006754998372093021,
      "min": 0.00809414456,
      "max": 0.01960750356
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.016451845873513515,
      "stddev": 0.0018350031420929474,
      "median": 0.01650813956,
      "user": 0.009441470270270272,
      "system": 0.008285896432432428,
      "min": 0.01152793656,
      "max": 0.02135239856
    },
    {
      "command": "pnpr@main",
      "mean": 0.010863081300112992,
      "stddev": 0.003595244243537344,
      "median": 0.00874525856,
      "user": 0.0063607649717514125,
      "system": 0.005483535480225985,
      "min": 0.007342501560000001,
      "max": 0.01957436056
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 10.2 ± 2.4 7.6 20.5 1.20 ± 0.29
pacquet@main 15.6 ± 2.6 10.1 27.0 1.84 ± 0.34
pnpr@HEAD 10.3 ± 2.8 7.6 18.7 1.22 ± 0.34
pnpr@main 8.5 ± 0.6 7.6 12.1 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.010171896177777777,
      "stddev": 0.00239702691326324,
      "median": 0.00940724572,
      "user": 0.00602669111111111,
      "system": 0.00502584951111111,
      "min": 0.007635147720000001,
      "max": 0.02048111072
    },
    {
      "command": "pacquet@main",
      "mean": 0.015602708844223604,
      "stddev": 0.0026280502597161573,
      "median": 0.01564376672,
      "user": 0.00868777180124224,
      "system": 0.008186977763975156,
      "min": 0.010102937720000002,
      "max": 0.02697401472
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.010347742460506328,
      "stddev": 0.0027649575513428795,
      "median": 0.00918432072,
      "user": 0.006051138987341768,
      "system": 0.005164169746835441,
      "min": 0.007591154720000002,
      "max": 0.01873334772
    },
    {
      "command": "pnpr@main",
      "mean": 0.008482311559857651,
      "stddev": 0.0005976965321443765,
      "median": 0.008362216720000001,
      "user": 0.004879855729537367,
      "system": 0.004262477508896794,
      "min": 0.00758910072,
      "max": 0.012061417720000002
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.848 ± 0.111 2.741 3.104 1.80 ± 0.14
pacquet@main 2.807 ± 0.068 2.698 2.939 1.78 ± 0.13
pnpr@HEAD 1.584 ± 0.157 1.413 1.793 1.00 ± 0.12
pnpr@main 1.581 ± 0.109 1.412 1.722 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.84803705196,
      "stddev": 0.1107575460479705,
      "median": 2.8055191443600003,
      "user": 2.9427373800000005,
      "system": 2.2364958600000002,
      "min": 2.7412588768600004,
      "max": 3.10382594486
    },
    {
      "command": "pacquet@main",
      "mean": 2.80660978636,
      "stddev": 0.06843003286515789,
      "median": 2.7919166193600002,
      "user": 2.8669354800000004,
      "system": 2.16019926,
      "min": 2.6977403198600003,
      "max": 2.93877806486
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.58357841386,
      "stddev": 0.15735076057144948,
      "median": 1.57254691686,
      "user": 1.2915658799999998,
      "system": 1.3018270599999997,
      "min": 1.4127932028599999,
      "max": 1.79330537586
    },
    {
      "command": "pnpr@main",
      "mean": 1.5810412884600002,
      "stddev": 0.10894672247963805,
      "median": 1.56602672986,
      "user": 1.2970754800000002,
      "system": 1.2401247599999998,
      "min": 1.41182082386,
      "max": 1.72182142386
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 438.0 ± 22.8 395.8 471.3 1.48 ± 0.08
pacquet@main 462.5 ± 29.2 407.8 493.0 1.56 ± 0.11
pnpr@HEAD 296.0 ± 6.8 286.3 308.8 1.00
pnpr@main 350.6 ± 39.1 289.4 387.9 1.18 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.43798274608000004,
      "stddev": 0.022841108131087355,
      "median": 0.43474062198,
      "user": 0.6202236400000001,
      "system": 0.70163296,
      "min": 0.39583213248000004,
      "max": 0.47128101348
    },
    {
      "command": "pacquet@main",
      "mean": 0.4624833568800001,
      "stddev": 0.029239033863031942,
      "median": 0.47834898798000003,
      "user": 0.63114424,
      "system": 0.77569776,
      "min": 0.40781603648000003,
      "max": 0.49300635048
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.2960432814800001,
      "stddev": 0.006771943123148098,
      "median": 0.29423275148000005,
      "user": 0.25058374,
      "system": 0.5567247599999999,
      "min": 0.28634156248000003,
      "max": 0.30878892648
    },
    {
      "command": "pnpr@main",
      "mean": 0.35059164988,
      "stddev": 0.03905696899020019,
      "median": 0.37559109698000004,
      "user": 0.31005384,
      "system": 0.67267696,
      "min": 0.28938862448,
      "max": 0.38788586448
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.683 ± 0.127 1.588 1.936 5.82 ± 0.47
pacquet@main 1.617 ± 0.021 1.587 1.655 5.59 ± 0.17
pnpr@HEAD 0.303 ± 0.037 0.257 0.378 1.05 ± 0.13
pnpr@main 0.289 ± 0.008 0.275 0.302 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.6830184457199997,
      "stddev": 0.12652023738805387,
      "median": 1.6318849523199999,
      "user": 1.0177586999999997,
      "system": 1.0102799,
      "min": 1.58836824832,
      "max": 1.93558946532
    },
    {
      "command": "pacquet@main",
      "mean": 1.61718352702,
      "stddev": 0.02084708031655518,
      "median": 1.61737591732,
      "user": 0.9000248,
      "system": 0.8490103000000001,
      "min": 1.5873509503199998,
      "max": 1.65497536032
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30333893122,
      "stddev": 0.03742092964867372,
      "median": 0.30460006882,
      "user": 0.25556149999999994,
      "system": 0.5813035999999998,
      "min": 0.25712908732,
      "max": 0.37779821232000005
    },
    {
      "command": "pnpr@main",
      "mean": 0.28920057592000004,
      "stddev": 0.008127970343307504,
      "median": 0.28863035982,
      "user": 0.24202669999999998,
      "system": 0.5691544999999999,
      "min": 0.27512195232000003,
      "max": 0.30200486332000004
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 228.7 ± 11.3 217.0 250.3 2.55 ± 0.14
pacquet@main 237.9 ± 13.8 211.7 262.3 2.65 ± 0.17
pnpr@HEAD 89.6 ± 2.2 85.4 93.9 1.00
pnpr@main 89.7 ± 2.9 85.7 96.7 1.00 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.22870116255846154,
      "stddev": 0.011300019495787112,
      "median": 0.22490297902,
      "user": 0.2085420723076923,
      "system": 0.08168796,
      "min": 0.21699938402000002,
      "max": 0.25033222701999996
    },
    {
      "command": "pacquet@main",
      "mean": 0.23786007277000001,
      "stddev": 0.013818914100836039,
      "median": 0.23608938202000002,
      "user": 0.22435179666666663,
      "system": 0.08464654333333332,
      "min": 0.21174661202000003,
      "max": 0.26232518102
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08960481850387098,
      "stddev": 0.0022014827132306077,
      "median": 0.08937376902000001,
      "user": 0.03204976709677419,
      "system": 0.011730704516129032,
      "min": 0.08541482302,
      "max": 0.09386926102000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.08972070226242423,
      "stddev": 0.0029158484193486573,
      "median": 0.08843129102000001,
      "user": 0.030692167878787875,
      "system": 0.013649747878787876,
      "min": 0.08574232802000001,
      "max": 0.09673274302000001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 236.9 ± 19.4 203.7 265.4 1.00
pacquet@main 257.1 ± 20.9 220.2 299.0 1.09 ± 0.13
pnpm@HEAD 3763.0 ± 151.5 3565.3 4068.9 15.89 ± 1.45
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.23685424277111114,
      "stddev": 0.019359656828032278,
      "median": 0.23358315466000001,
      "user": 0.23620309777777773,
      "system": 0.0642743511111111,
      "min": 0.20371968266,
      "max": 0.26541217565999997
    },
    {
      "command": "pacquet@main",
      "mean": 0.25706948610444447,
      "stddev": 0.020875182433325434,
      "median": 0.25486306665999997,
      "user": 0.26821920888888884,
      "system": 0.050686684444444435,
      "min": 0.22024437966000002,
      "max": 0.29897937066
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.762964881882223,
      "stddev": 0.15147154542501562,
      "median": 3.78914365966,
      "user": 5.731565097777779,
      "system": 0.38946090666666666,
      "min": 3.5653417166600003,
      "max": 4.06890459366
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 223.1 ± 42.5 200.3 351.9 1.00
pacquet@main 278.7 ± 71.9 200.0 395.0 1.25 ± 0.40
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.22314128687999998,
      "stddev": 0.04251002814996159,
      "median": 0.20583564038000002,
      "user": 0.17178482285714283,
      "system": 0.08749551999999998,
      "min": 0.20028449338,
      "max": 0.35188829138
    },
    {
      "command": "pacquet@main",
      "mean": 0.27865614007999995,
      "stddev": 0.07186405125110931,
      "median": 0.26210189488,
      "user": 0.22671958000000006,
      "system": 0.10445422,
      "min": 0.19997735738,
      "max": 0.39498082938
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 83.5 ± 20.9 70.5 135.2 1.08 ± 0.28
pacquet@main 77.1 ± 4.9 72.2 96.2 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.08347223763047622,
      "stddev": 0.020938345192838218,
      "median": 0.07508027244000001,
      "user": 0.028265860000000004,
      "system": 0.06135326571428572,
      "min": 0.07053605844000001,
      "max": 0.13522379944000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.07708469196631577,
      "stddev": 0.004859665629789475,
      "median": 0.07636069544000001,
      "user": 0.029745570526315785,
      "system": 0.053071216842105265,
      "min": 0.07217339744000001,
      "max": 0.09618689944000001
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.563 ± 0.060 4.476 4.634 1.27 ± 0.03
pacquet@main 4.559 ± 0.158 4.433 4.887 1.27 ± 0.05
pnpr@HEAD 3.592 ± 0.066 3.502 3.719 1.00
pnpr@main 3.595 ± 0.111 3.496 3.861 1.00 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.56307586206,
      "stddev": 0.059683076232020536,
      "median": 4.58586242976,
      "user": 1.8375648599999999,
      "system": 2.0523930399999997,
      "min": 4.47580678576,
      "max": 4.6342879117599995
    },
    {
      "command": "pacquet@main",
      "mean": 4.5585654903599995,
      "stddev": 0.15757999726414962,
      "median": 4.485663151759999,
      "user": 1.8141478599999996,
      "system": 1.97340874,
      "min": 4.43346069576,
      "max": 4.88711902976
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.59206284416,
      "stddev": 0.06563454150921334,
      "median": 3.58545565926,
      "user": 1.7242999599999997,
      "system": 1.8762867399999998,
      "min": 3.50195029876,
      "max": 3.71853734076
    },
    {
      "command": "pnpr@main",
      "mean": 3.5948750462600003,
      "stddev": 0.11094387807379025,
      "median": 3.56101955526,
      "user": 1.7924956599999997,
      "system": 1.87074264,
      "min": 3.4963628087600003,
      "max": 3.8605902157600003
    }
  ]
}

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 129.3 ± 5.9 118.1 142.8 1.02 ± 0.06
pacquet@main 127.0 ± 4.7 119.3 137.3 1.00
pnpr@HEAD 137.6 ± 4.0 129.5 143.1 1.08 ± 0.05
pnpr@main 134.1 ± 4.2 126.9 144.1 1.06 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.12927949104285716,
      "stddev": 0.005905576142313751,
      "median": 0.1301632589,
      "user": 0.15474902380952382,
      "system": 0.1407204457142857,
      "min": 0.11805648490000001,
      "max": 0.1428010519
    },
    {
      "command": "pacquet@main",
      "mean": 0.12699241005,
      "stddev": 0.004675606679372171,
      "median": 0.1269565239,
      "user": 0.15199595,
      "system": 0.13631611,
      "min": 0.11927546590000002,
      "max": 0.1372773349
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.13761031767777776,
      "stddev": 0.0040160432983906294,
      "median": 0.1375133284,
      "user": 0.16607188888888888,
      "system": 0.1296742711111111,
      "min": 0.1295288759,
      "max": 0.1431493159
    },
    {
      "command": "pnpr@main",
      "mean": 0.13405205432105263,
      "stddev": 0.00420220276538619,
      "median": 0.1337625559,
      "user": 0.1551950263157895,
      "system": 0.13003252842105265,
      "min": 0.1269094909,
      "max": 0.1440661999
    }
  ]
}

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.211 ± 0.110 1.098 1.411 1.05 ± 0.10
pacquet@main 1.148 ± 0.024 1.104 1.187 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.2111687031999998,
      "stddev": 0.11017676115737768,
      "median": 1.1701673888,
      "user": 0.6575265799999999,
      "system": 0.2628939,
      "min": 1.0982243418,
      "max": 1.4114042688000001
    },
    {
      "command": "pacquet@main",
      "mean": 1.1483343902,
      "stddev": 0.02370712461007674,
      "median": 1.1460627383,
      "user": 0.5242195800000001,
      "system": 0.23661589999999996,
      "min": 1.1037991148,
      "max": 1.1871130498
    }
  ]
}

@samanyudas
samanyudas marked this pull request as ready for review October 17, 2026 16:46
@samanyudas
samanyudas requested a review from zkochan as a code owner October 17, 2026 16:46
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@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.

samanyudas and others added 2 commits October 17, 2026 18:51
`pnpm install` with `strictPeerDependencies` and `pnpm peers check`
reported an unmet peer when a workspace package's peer was provided by a
remote tarball URL in the consuming project. The importer-level peer
check for linked workspace packages used the importer's `version:` field
(the URL) as the found version, while the lockfile's `packages` entry
already records the tarball manifest's version.

Prefer that recorded version for every resolved importer dependency,
falling back to the version in the reference for registry packages.
This matches the snapshot-level check, which reads package metadata
since the local tarball fix in pnpm#15299.

Closes pnpm#17037.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Oct 17, 2026
@zkochan
zkochan force-pushed the fix/remote-tarball-peer-versions branch from 7a0b270 to 0d68960 Compare October 17, 2026 16:58

@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.

@qodo-code-review

qodo-code-review Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. A crafted lockfile hides unmet peers 🐞 Bug ≡ Correctness ⭐ New
Description
resolved_peer_version now accepts a version from resolve_locked_version, which strips what it
interprets as a peer suffix from an opaque URL before looking up package metadata. If a lockfile
contains both provider@https://host/pkg@v1(foo) and provider@https://host/pkg@v1, a dependency
on the first URL can use the second entry's version, allowing an incompatible provider to pass a
strict peer check.
Code

pnpm/crates/deps-inspection-peers/src/linked.rs[R231-232]

+    resolve_locked_version(lockfile, lockfile_dir, peer_pkg_name, spec)
+        .or_else(|| spec.version.ver_peer().map(extract_peer_version))
Relevance

●●● Strong

Accepted precedents flag opaque URL parentheses parsing and peer-validation bypasses as correctness
bugs.

PR-#16359
PR-#14440

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The parser puts the portion of a value from its first ( into peer, even when the preceding
version is a non-semver URL. The newly preferred lookup clears that field and reads packages under
the shortened key; record_bad_peer then treats the retrieved version as the provider's version.

pnpm/crates/lockfile/src/pkg_ver_peer.rs[195-217]
pnpm/crates/lockfile/src/pkg_ver_peer.rs[241-253]
pnpm/crates/lockfile/src/pkg_name_ver_peer.rs[29-36]
pnpm/crates/deps-inspection-peers/src/linked.rs[37-49]
pnpm/crates/deps-inspection-peers/src/linked.rs[185-210]

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

## Issue description
An opaque dependency URL ending in parentheses is parsed as though it has a peer suffix. The new metadata lookup strips that portion and can read a different package entry's version, incorrectly satisfying a linked package's peer range.

## Fix Focus Areas
- pnpm/crates/deps-inspection-peers/src/linked.rs[37-49]
- pnpm/crates/deps-inspection-peers/src/linked.rs[231-237]
- pnpm/crates/lockfile/src/pkg_ver_peer.rs[241-253]

## Recommended Fix
Distinguish an opaque locator's literal parentheses from a genuine peer suffix before deriving its metadata key. Preserve the full locator when matching URL package entries, and add a regression test with two otherwise identical URL keys that have different manifest versions.

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

Dismiss ↗ | View ↗


2. Release notes omit prior peer failure 📘 Rule violation ⚙ Maintainability
Description
remote-tarball-peer-versions.md describes the fix with “no longer report an unmet peer” but does
not state the prior failure in its own past-tense sentence. Because the release note is the
user-facing bug-fix entry, readers receive the corrected behavior without a separate account of what
previously failed.
Code

.changeset/remote-tarball-peer-versions.md[5]

+`pnpm install` and `pnpm peers check` no longer report an unmet peer when a workspace package's peer is provided by a remote tarball URL. pnpm now compares the peer range with the version in the tarball's manifest [#17037](https://github.com/pnpm/pnpm/issues/17037).
Relevance

●● Moderate

Recent precedent is mixed: identical wording guidance was both accepted and rejected in changeset
reviews.

PR-#17042
PR-#16992
PR-#16977

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changeset uses “no longer report,” which describes the former behavior as part of the
new-behavior sentence instead of giving that behavior its own past-tense sentence, contrary to the
checklist requirement.

Rule 3058498: Describe previous buggy behavior in a separate past-tense sentence
.changeset/remote-tarball-peer-versions.md[5-5]

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 combines the corrected behavior with an implicit description of the previous failure using “no longer report,” rather than describing the old behavior in its own past-tense sentence.

## Fix Focus Areas
- .changeset/remote-tarball-peer-versions.md[5-5]

## Recommended Fix
Rewrite the release note so the prior behavior is a separate past-tense sentence, followed by a sentence describing the corrected behavior. For example: “Previously, `pnpm install` and `pnpm peers check` reported an unmet peer when a workspace package's peer was provided by a remote tarball URL. They now compare the peer range with the version in the tarball's manifest.”

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

Dismiss ↗ | View ↗


Grey Divider

Context sources
❌ Tickets: failed to load — Ticket collection could not establish complete evidence
✅ Compliance rules (platform): 66 rules
✅ Cross-repo context — repo relationships
Review mode: Auto: ⚖️ Balanced: Core dependency-resolution behavior changes, requiring careful correctness and regression review.

Grey Divider

Tip of the day
💡 Did you know, you can see how risky a PR is at a glance with blast radius labels

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit c1b4027

Results up to commit 0d68960 ⚖️ Balanced


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


Remediation recommended
1. Release notes omit prior peer failure 📘 Rule violation ⚙ Maintainability
Description
remote-tarball-peer-versions.md describes the fix with “no longer report an unmet peer” but does
not state the prior failure in its own past-tense sentence. Because the release note is the
user-facing bug-fix entry, readers receive the corrected behavior without a separate account of what
previously failed.
Code

.changeset/remote-tarball-peer-versions.md[5]

+`pnpm install` and `pnpm peers check` no longer report an unmet peer when a workspace package's peer is provided by a remote tarball URL. pnpm now compares the peer range with the version in the tarball's manifest [#17037](https://github.com/pnpm/pnpm/issues/17037).
Relevance

●● Moderate

Recent precedent is mixed: identical wording guidance was both accepted and rejected in changeset
reviews.

PR-#17042
PR-#16992
PR-#16977

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changeset uses “no longer report,” which describes the former behavior as part of the
new-behavior sentence instead of giving that behavior its own past-tense sentence, contrary to the
checklist requirement.

Rule 3058498: Describe previous buggy behavior in a separate past-tense sentence
.changeset/remote-tarball-peer-versions.md[5-5]

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 combines the corrected behavior with an implicit description of the previous failure using “no longer report,” rather than describing the old behavior in its own past-tense sentence.

## Fix Focus Areas
- .changeset/remote-tarball-peer-versions.md[5-5]

## Recommended Fix
Rewrite the release note so the prior behavior is a separate past-tense sentence, followed by a sentence describing the corrected behavior. For example: “Previously, `pnpm install` and `pnpm peers check` reported an unmet peer when a workspace package's peer was provided by a remote tarball URL. They now compare the peer range with the version in the tarball's manifest.”

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

Dismiss ↗ | View ↗


Grey Divider

Qodo Logo

@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.

@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.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit c1b4027

@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 merged commit 13d7ca3 into pnpm:main Oct 17, 2026
57 checks passed
@zkochan

zkochan commented Oct 17, 2026

Copy link
Copy Markdown
Member

Review-and-fix pass on this PR:

  • Rebased onto main with no conflicts.
  • Pushed c1b4027. resolved_peer_version now looks up the locked version once for every importer dependency that is not a link:. The file: and regular branches no longer repeat that lookup, and behavior is unchanged.

Qodo findings, both declined:

  1. "A crafted lockfile hides unmet peers." Stripping the peer suffix before the packages lookup is required. pnpm writes tarball dependencies that have peers as provider@<url>(peer@x), and their packages entry is keyed without that suffix. The snapshot-level check (get_pkg_version in snapshot.rs) already does the same without_peer() lookup. The lockfile is also not a trust boundary for the peer check. Anyone who can edit it can set the version: field directly.
  2. "Release notes omit prior peer failure." The guide asks for a past-tense sentence only when readers need the old behavior to recognize the bug. "no longer report an unmet peer when …" already names the symptom they saw.

Status on c1b4027:

  • All required checks pass. The capture job of the PR review automation workflow was still running when I posted this.
  • CodeRabbit reviewed this commit and reported no actionable comments.
  • Qodo's findings are covered above.
  • Greptile's trial has ended, so it posted no review.

The PR stays ready for review. Nothing remains within the requested scope.


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

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review state: automerge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm 12 treats remote tarball URLs as peer dependency versions (follow-up to #15298)

3 participants