Skip to content

fix(catalogs): move a covering catalog entry onto the version add or update names - #15372

Merged
zkochan merged 3 commits into
mainfrom
fix-13715
Sep 23, 2026
Merged

zkochan merged 3 commits into
mainfrom
fix-13715

Conversation

@zkochan

@zkochan zkochan commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #13715.

The error from the issue is already gone: #13716 taught both stacks to accept a version the catalog range covers, and 11.27.1 and 12.6.0 both run the reproduction without ERR_PNPM_CATALOG_VERSION_MISMATCH. What that fix left behind is a difference between the two stacks, and a misleading warning on v11.

With catalog: { '@babel/core': ^7.22.17 } and catalogMode: strict, pnpm update '@babel/[email protected]' -r --lockfile-only gives:

pnpm-workspace.yaml entry lockfile catalog snapshot output
v11 (before) ^7.29.6 ^7.29.6 / 7.29.6 WARN Skip adding @babel/core to the default catalog ... Please use pnpm update
v12 (before) ^7.22.17 ^7.22.17 / 7.29.6 none
both (after) ^7.29.6 ^7.29.6 / 7.29.6 none

pnpm add <pkg>@<version> diverged the same way.

  • v12: decide_catalog_entry now returns a moved entry when the entry's range covers the wanted version. The new range comes from calc_version_range, the rule pnpm update already uses when it bumps an entry to a resolved version, so ^ and ~ keep their operator. v11's own tests (updating to a version within the catalog range works with catalogMode: strict, adding a version the catalog range covers moves a catalog locked on another version) expect ^1.1.0. The v12 ports of those tests pinned ^1.0.0, and they are updated here.
  • v11: the resolver no longer prints "Skip adding ... to the default catalog" for a dependency it resolved through its catalog: reference. The update moves that entry through updatedCatalogs, so the warning contradicted what happened. It fired on a plain pnpm update <pkg> under strict mode too.

One known difference remains. A compound entry such as >=7.22.17 <8 keeps its text on v12, as it already does on a plain v12 pnpm update, while v11 rewrites it to ^7.29.6. This PR leaves that alone.

Squash Commit Body

`pnpm add <pkg>@<version>` and `pnpm update <pkg>@<version>` under
`catalogMode: strict` or `prefer` accept a version the catalog entry's range
covers (pnpm/pnpm#13715). pnpm v11 then writes that version back to the
entry, keeping its operator (`^7.22.17` becomes `^7.29.6`), the way a plain
`pnpm update` moves the entry to the version it resolves. The v12 port only
moved the entry's lockfile resolution and left `pnpm-workspace.yaml` on the
old range, so the next plain install was free to resolve elsewhere.

`decide_catalog_entry` now returns the moved entry, computed with
`calc_version_range`, the rule `update` uses when it bumps a range. A range
no single operator describes, such as `>=7.22.17 <8`, keeps its text, as it
does on a plain v12 update.

On v11, the resolver warned "Skip adding <pkg> to the default catalog ...
Please use `pnpm update`" for every dependency resolved through its
`catalog:` reference during a strict or prefer update, even though the same
update moves that entry through `updatedCatalogs`. The warning now only
applies to a dependency that is not already cataloged.

Closes pnpm/pnpm#13715

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.

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. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes
    • When adding or updating a dependency to a specific version already covered by a catalog range, pnpm now updates the catalog entry to that version while keeping its range style.
    • Workspace projects using the catalog reference continue to share the updated entry, including during recursive updates.
    • pnpm update no longer displays the “Skip adding … to the default catalog” warning for dependencies already managed by a catalog.

…update names

`pnpm add <pkg>@<version>` and `pnpm update <pkg>@<version>` under
`catalogMode: strict` or `prefer` accept a version the catalog entry's range
covers (#13715). pnpm v11 then writes that version back to the
entry, keeping its operator (`^7.22.17` becomes `^7.29.6`), the way a plain
`pnpm update` moves the entry to the version it resolves. The v12 port only
moved the entry's lockfile resolution and left `pnpm-workspace.yaml` on the
old range, so the next plain install was free to resolve elsewhere.

`decide_catalog_entry` now returns the moved entry, computed with
`calc_version_range`, the rule `update` uses when it bumps a range. A range
no single operator describes, such as `>=7.22.17 <8`, keeps its text, as it
does on a plain v12 update.

On v11, the resolver warned "Skip adding <pkg> to the default catalog ...
Please use `pnpm update`" for every dependency resolved through its
`catalog:` reference during a strict or prefer update, even though the same
update moves that entry through `updatedCatalogs`. The warning now only
applies to a dependency that is not already cataloged.

Closes #13715

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Warning

Review limit reached

Next included review available in 34 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: a91ce7f6-d5c4-4998-9238-f3df8fee1e02

📥 Commits

Reviewing files that changed from the base of the PR and between 747b2fa and e5d1b28.

📒 Files selected for processing (2)
  • .changeset/no-skip-adding-warning-on-catalog-update.md
  • pnpm/crates/cli/tests/suite/update/workspace.rs

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: 7d04d2de-1502-459a-b7ac-9f2cdea38a49

📥 Commits

Reviewing files that changed from the base of the PR and between 769892f and 747b2fa.

📒 Files selected for processing (8)
  • .changeset/catalog-entry-follows-the-wanted-version.md
  • .changeset/no-skip-adding-warning-on-catalog-update.md
  • pnpm/crates/cli/tests/suite/catalog.rs
  • pnpm/crates/cli/tests/suite/update/workspace.rs
  • pnpm/crates/package-manager/src/catalog_mode.rs
  • pnpm/crates/package-manager/src/catalog_mode/tests.rs
  • pnpm11/installing/deps-installer/test/catalogs.ts
  • pnpm11/installing/deps-resolver/src/resolveDependencyTree.ts

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


📝 Walkthrough

Walkthrough

When a requested version falls within an existing catalog range, catalog decisions can move the entry to that version. Resolver and CLI tests cover catalog lookup handling, warning behavior, and updates across workspace projects.

Changes

Catalog version updates

Layer / File(s) Summary
Compute and verify catalog entry updates
pnpm/crates/package-manager/src/catalog_mode.rs, pnpm/crates/package-manager/src/catalog_mode/tests.rs
When an existing range covers a requested version, the catalog decision can update the entry while preserving its range style. Tests cover strict and prefer modes, compound ranges, and entries that already name the requested version.
Handle existing catalog lookups during updates
pnpm11/installing/deps-resolver/src/resolveDependencyTree.ts, pnpm11/installing/deps-installer/test/catalogs.ts, .changeset/no-skip-adding-warning-on-catalog-update.md
The resolver skips default-catalog addition for dependencies with catalog lookup metadata. A test checks that an update does not emit the skip-adding warning. The changeset records patch releases for the affected packages.
Verify catalog updates in workspace commands
pnpm/crates/cli/tests/suite/catalog.rs, pnpm/crates/cli/tests/suite/update/workspace.rs, .changeset/catalog-entry-follows-the-wanted-version.md
CLI tests verify catalog entry updates during add and update commands, including recursive workspace updates. The changeset records a patch release for pacquet.

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

Assessment against linked issues

Objective Addressed Explanation
[#13715] Allow pnpm update <pkg>@<version> in strict catalog mode when the requested version is covered by the catalog range. ✅

Suggested labels: product: pnpm@11, product: pacquet

Merge Risk: ⚪ Minimal · up to 747b2

Covered catalog ranges update as intended, while exact and compound range behavior remains preserved. No actionable merge-blocking risk remains.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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 Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.60%. Comparing base (769892f) to head (e5d1b28).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15372      +/-   ##
==========================================
+ Coverage   91.58%   91.60%   +0.01%     
==========================================
  Files        1400     1400              
  Lines      188542   188549       +7     
==========================================
+ Hits       172670   172714      +44     
+ Misses      15872    15835      -37     

☔ 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 Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.14     16.2±3.22ms    23.1 MB/sec    1.00     14.2±0.89ms    26.5 MB/sec
packument/parse                                  1.00     45.3±1.29µs  1464.3 MB/sec    1.02     46.3±1.49µs  1432.2 MB/sec
tarball/download_dependency                      1.00      4.6±0.19ms   939.7 KB/sec    1.27      5.9±1.03ms   738.7 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00   236.6±11.42ms 67.6 KElem/sec    1.18   278.1±11.39ms 57.5 KElem/sec
workspace_resolution/hoist_heavy                 1.00   313.4±13.75ms        ? ?/sec    1.00   314.4±10.39ms        ? ?/sec
workspace_sort/chained_projects                  1.26     21.6±3.53ms        ? ?/sec    1.00     17.2±2.17ms        ? ?/sec

@github-actions

github-actions Bot commented Sep 23, 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 2528.80 ms 2431.26 ms -3.9% 126.44 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1518.51 ms 1479.16 ms -2.6% 75.93 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 230.89 ms 342.93 ms 48.5% 11.54 ms Inconclusive (not reproduced)
isolated-fresh-restore-hot-cache-hot-store pnpr 243.35 ms 238.94 ms -1.8% 12.17 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 8.48 ms 8.36 ms -1.4% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 10.09 ms 9.07 ms -10.1% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 8.54 ms 8.96 ms 5.0% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 9.45 ms 9.09 ms -3.8% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2701.29 ms 2566.49 ms -5.0% 135.06 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1667.45 ms 1541.00 ms -7.6% 83.37 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 407.46 ms 428.93 ms 5.3% 20.37 ms Inconclusive (overlapping samples)
isolated-fresh-install-hot-cache-hot-store pnpr 300.93 ms 293.57 ms -2.4% 15.05 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1677.05 ms 1686.61 ms 0.6% 83.85 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 354.36 ms 327.19 ms -7.7% 17.72 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 289.33 ms 360.16 ms 24.5% 14.47 ms Inconclusive (overlapping samples)
isolated-fresh-resolve-hot-cache-offline pnpr 107.30 ms 105.90 ms -1.3% 5.36 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 777.82 ms 712.21 ms -8.4% 38.89 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 155.98 ms 158.35 ms 1.5% 7.80 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4639.33 ms 4514.91 ms -2.7% 231.97 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3534.14 ms 3514.64 ms -0.6% 176.71 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 185.20 ms 185.45 ms 0.1% 9.26 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 210.30 ms 204.65 ms -2.7% 10.52 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: e5d1b28b83f9

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares 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.468 ± 0.142 2.297 2.748 1.67 ± 0.16
pacquet@main 2.505 ± 0.182 2.303 2.743 1.70 ± 0.18
pnpr@HEAD 1.477 ± 0.117 1.313 1.684 1.00
pnpr@main 1.523 ± 0.121 1.332 1.699 1.03 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.46763875324,
      "stddev": 0.14159348598425373,
      "median": 2.4312640969399997,
      "user": 1.58507432,
      "system": 1.7188879,
      "min": 2.29742743694,
      "max": 2.74820607894
    },
    {
      "command": "pacquet@main",
      "mean": 2.50483119144,
      "stddev": 0.18215803142341008,
      "median": 2.52879589244,
      "user": 1.6193492199999997,
      "system": 1.6902531999999997,
      "min": 2.30339254594,
      "max": 2.74332531194
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.47650725524,
      "stddev": 0.11659203393074952,
      "median": 1.47916108994,
      "user": 1.29887932,
      "system": 1.4555330000000002,
      "min": 1.3128433539400002,
      "max": 1.68370811794
    },
    {
      "command": "pnpr@main",
      "mean": 1.5226144165400002,
      "stddev": 0.12058999858038649,
      "median": 1.51850755544,
      "user": 1.45342842,
      "system": 1.5509125999999998,
      "min": 1.3321812639400001,
      "max": 1.6990627019400002
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 370.6 ± 68.1 309.2 527.0 1.57 ± 0.30
pacquet@main 236.7 ± 14.0 221.2 267.1 1.00
pnpr@HEAD 238.5 ± 6.7 226.8 249.1 1.01 ± 0.07
pnpr@main 243.4 ± 6.7 232.8 256.9 1.03 ± 0.07

Confirmation (reversed target order)

Command Mean [ms] Min [ms] Max [ms] Relative
pnpr@main 260.3 ± 30.0 217.9 310.9 1.15 ± 0.17
pnpr@HEAD 268.6 ± 44.9 236.5 363.3 1.18 ± 0.23
pacquet@main 250.3 ± 22.7 219.6 286.8 1.10 ± 0.15
pacquet@HEAD 226.9 ± 22.4 210.3 283.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.37060683514,
      "stddev": 0.06809923831249672,
      "median": 0.34293162584000003,
      "user": 0.40310084,
      "system": 0.7496966599999999,
      "min": 0.30917690984,
      "max": 0.52695594484
    },
    {
      "command": "pacquet@main",
      "mean": 0.23667535093999997,
      "stddev": 0.013990814509610473,
      "median": 0.23088985384,
      "user": 0.24328224,
      "system": 0.54721166,
      "min": 0.22118453084,
      "max": 0.26708669883999997
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.23846998644000003,
      "stddev": 0.006679646221957252,
      "median": 0.23893949334000003,
      "user": 0.24595544,
      "system": 0.5247546599999999,
      "min": 0.22677162184000002,
      "max": 0.24908325384000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.24338209084,
      "stddev": 0.006744337372692254,
      "median": 0.24335439734000003,
      "user": 0.23972054000000004,
      "system": 0.54704436,
      "min": 0.23281076084000002,
      "max": 0.25686881384
    }
  ],
  "confirmation": {
    "results": [
      {
        "command": "pnpr@main",
        "mean": 0.26033722404000004,
        "stddev": 0.029983518381048162,
        "median": 0.25540244454000005,
        "user": 0.27705108,
        "system": 0.5681762799999999,
        "min": 0.21792773004000002,
        "max": 0.31088971004
      },
      {
        "command": "pnpr@HEAD",
        "mean": 0.26857148954000004,
        "stddev": 0.044925214115405634,
        "median": 0.25110498104,
        "user": 0.25574287999999995,
        "system": 0.6148684799999999,
        "min": 0.23647924204,
        "max": 0.36334619604
      },
      {
        "command": "pacquet@main",
        "mean": 0.25027764164,
        "stddev": 0.022734417029909006,
        "median": 0.24418765704,
        "user": 0.26808348,
        "system": 0.5480828799999999,
        "min": 0.21961842404,
        "max": 0.28676883004000003
      },
      {
        "command": "pacquet@HEAD",
        "mean": 0.22688270613999997,
        "stddev": 0.022378720116304925,
        "median": 0.21908250854,
        "user": 0.23744337999999998,
        "system": 0.5119603799999999,
        "min": 0.21027974904000002,
        "max": 0.28343159304
      }
    ]
  }
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 8.6 ± 1.1 7.0 13.6 1.02 ± 0.17
pacquet@main 8.5 ± 0.9 6.2 11.8 1.00
pnpr@HEAD 9.2 ± 0.9 7.4 13.0 1.09 ± 0.16
pnpr@main 10.4 ± 1.4 8.1 16.7 1.22 ± 0.20
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.008645275461433446,
      "stddev": 0.0011216847294761492,
      "median": 0.008363247400000001,
      "user": 0.005204145733788396,
      "system": 0.003951497133105801,
      "min": 0.0070074404,
      "max": 0.0136396164
    },
    {
      "command": "pacquet@main",
      "mean": 0.008497096066666664,
      "stddev": 0.0008871550965570044,
      "median": 0.0084782634,
      "user": 0.005479528771929827,
      "system": 0.0035216580350877183,
      "min": 0.0062412254,
      "max": 0.0117914664
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.009229444216254408,
      "stddev": 0.0009140000606880817,
      "median": 0.0090676864,
      "user": 0.005349370318021203,
      "system": 0.004441417809187277,
      "min": 0.007413541399999999,
      "max": 0.0130017124
    },
    {
      "command": "pnpr@main",
      "mean": 0.010405573792405066,
      "stddev": 0.0013528399448554205,
      "median": 0.0100916654,
      "user": 0.006035883122362866,
      "system": 0.004978957974683545,
      "min": 0.0081131694,
      "max": 0.0167242704
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 9.1 ± 0.9 7.3 11.3 1.05 ± 0.16
pacquet@main 8.6 ± 1.0 6.4 12.0 1.00
pnpr@HEAD 9.4 ± 1.5 7.2 16.4 1.09 ± 0.22
pnpr@main 9.9 ± 1.6 7.6 14.1 1.15 ± 0.23
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.009105431666278025,
      "stddev": 0.0008788765995646834,
      "median": 0.008959742460000001,
      "user": 0.005530943587443944,
      "system": 0.004091832107623318,
      "min": 0.007293938460000001,
      "max": 0.01129948746
    },
    {
      "command": "pacquet@main",
      "mean": 0.008644633038014184,
      "stddev": 0.0010193951525882504,
      "median": 0.00853536096,
      "user": 0.005515238581560284,
      "system": 0.003635638014184397,
      "min": 0.006376019460000001,
      "max": 0.01198239446
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.00942575964275862,
      "stddev": 0.0015359554912699799,
      "median": 0.009085495960000002,
      "user": 0.005822836551724136,
      "system": 0.004121247862068966,
      "min": 0.007185452460000001,
      "max": 0.01639263146
    },
    {
      "command": "pnpr@main",
      "mean": 0.0099478406435206,
      "stddev": 0.0015863401499820555,
      "median": 0.009447357460000002,
      "user": 0.005838712284644193,
      "system": 0.004677092883895129,
      "min": 0.007608248460000001,
      "max": 0.01410950646
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.571 ± 0.030 2.529 2.628 1.62 ± 0.13
pacquet@main 2.716 ± 0.093 2.625 2.929 1.71 ± 0.15
pnpr@HEAD 1.591 ± 0.131 1.483 1.843 1.00
pnpr@main 1.678 ± 0.145 1.482 1.864 1.05 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5713448775400005,
      "stddev": 0.030271262364441207,
      "median": 2.56648961374,
      "user": 2.3452309399999995,
      "system": 2.00265004,
      "min": 2.52865127524,
      "max": 2.62805331924
    },
    {
      "command": "pacquet@main",
      "mean": 2.71629215034,
      "stddev": 0.09259535986934116,
      "median": 2.70129329574,
      "user": 2.80523284,
      "system": 2.31413324,
      "min": 2.62451986824,
      "max": 2.92879692324
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5906364076400004,
      "stddev": 0.13112856876089923,
      "median": 1.54100045274,
      "user": 1.83026074,
      "system": 1.7854692399999998,
      "min": 1.4832682292400001,
      "max": 1.84294228424
    },
    {
      "command": "pnpr@main",
      "mean": 1.67787278064,
      "stddev": 0.14458700361427973,
      "median": 1.66745218724,
      "user": 2.00306384,
      "system": 1.9002424399999995,
      "min": 1.4824394442400002,
      "max": 1.8638903292400002
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 450.5 ± 57.6 402.0 580.1 1.52 ± 0.21
pacquet@main 413.4 ± 19.5 378.0 451.9 1.40 ± 0.10
pnpr@HEAD 296.3 ± 16.6 270.8 321.5 1.00
pnpr@main 301.6 ± 11.2 286.1 323.7 1.02 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.45045632324000007,
      "stddev": 0.057596601256176175,
      "median": 0.42892820554000005,
      "user": 0.6543073799999999,
      "system": 0.8488832399999999,
      "min": 0.40201643304,
      "max": 0.58005054804
    },
    {
      "command": "pacquet@main",
      "mean": 0.4134003901400001,
      "stddev": 0.019504992029125284,
      "median": 0.40746100754000003,
      "user": 0.59902538,
      "system": 0.7463038399999999,
      "min": 0.37797494604000004,
      "max": 0.45193938904000003
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29629135264000006,
      "stddev": 0.016612182417705134,
      "median": 0.29356859504,
      "user": 0.25078078,
      "system": 0.52167644,
      "min": 0.27075271504000004,
      "max": 0.32149765304
    },
    {
      "command": "pnpr@main",
      "mean": 0.30162402754000006,
      "stddev": 0.011165033921467492,
      "median": 0.30093423404,
      "user": 0.24232107999999997,
      "system": 0.53046874,
      "min": 0.28611254004000003,
      "max": 0.32368066204
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.706 ± 0.093 1.612 1.940 5.20 ± 0.36
pacquet@main 1.694 ± 0.061 1.628 1.851 5.16 ± 0.29
pnpr@HEAD 0.328 ± 0.014 0.305 0.358 1.00
pnpr@main 0.355 ± 0.035 0.305 0.398 1.08 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7060647536600002,
      "stddev": 0.09285742580496707,
      "median": 1.68661132926,
      "user": 1.0338349,
      "system": 1.05770718,
      "min": 1.6122384652600001,
      "max": 1.9400969192600002
    },
    {
      "command": "pacquet@main",
      "mean": 1.6941967335600001,
      "stddev": 0.061242252396631995,
      "median": 1.67705479976,
      "user": 1.0451631,
      "system": 1.03672988,
      "min": 1.6276145742600001,
      "max": 1.8505755882600001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.32807544576000003,
      "stddev": 0.013895550744440778,
      "median": 0.32719099826,
      "user": 0.29058629999999996,
      "system": 0.57831878,
      "min": 0.30450980826,
      "max": 0.35769654126
    },
    {
      "command": "pnpr@main",
      "mean": 0.35484506546000005,
      "stddev": 0.034791712740404414,
      "median": 0.35436051576000005,
      "user": 0.30663809999999997,
      "system": 0.65890268,
      "min": 0.30467558126,
      "max": 0.39830858326
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 366.7 ± 53.6 270.8 473.0 3.46 ± 0.53
pacquet@main 323.4 ± 68.6 259.1 448.2 3.05 ± 0.66
pnpr@HEAD 105.9 ± 5.0 99.0 120.1 1.00
pnpr@main 109.0 ± 8.2 97.3 133.3 1.03 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.36665135798000004,
      "stddev": 0.05361783600881838,
      "median": 0.36016333698,
      "user": 0.38699764,
      "system": 0.13269844,
      "min": 0.27078621748000004,
      "max": 0.47299283948000004
    },
    {
      "command": "pacquet@main",
      "mean": 0.32344870208000004,
      "stddev": 0.06857928777872965,
      "median": 0.28932522248000003,
      "user": 0.35696164,
      "system": 0.10143183999999998,
      "min": 0.25907775948,
      "max": 0.44823059448
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.10589318173925927,
      "stddev": 0.004992645429086412,
      "median": 0.10589635748000001,
      "user": 0.04327168444444444,
      "system": 0.01768628296296296,
      "min": 0.09895664448000001,
      "max": 0.12013269448000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.10900775348000001,
      "stddev": 0.008177774552272183,
      "median": 0.10729572698,
      "user": 0.046023132857142844,
      "system": 0.019901961428571424,
      "min": 0.09727645548000001,
      "max": 0.13329053748000003
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 740.0 ± 100.8 614.0 900.1 1.00
pacquet@main 805.6 ± 106.2 625.6 977.4 1.09 ± 0.21
pnpm@HEAD 3150.5 ± 246.8 2899.5 3581.0 4.26 ± 0.67
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.7399930196022223,
      "stddev": 0.10078269212509951,
      "median": 0.7122097193800001,
      "user": 0.7665757955555557,
      "system": 0.16199258888888887,
      "min": 0.61398727338,
      "max": 0.90008923238
    },
    {
      "command": "pacquet@main",
      "mean": 0.8055512573800001,
      "stddev": 0.10615777228549088,
      "median": 0.77782386138,
      "user": 0.8313194622222223,
      "system": 0.1824239222222222,
      "min": 0.6255977263800001,
      "max": 0.9773824883800001
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.1504961788244445,
      "stddev": 0.24680046459050684,
      "median": 3.06061123938,
      "user": 4.890503128888889,
      "system": 0.24125147777777778,
      "min": 2.8995097523799997,
      "max": 3.58100579238
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 162.0 ± 7.3 155.1 174.9 1.03 ± 0.05
pacquet@main 156.6 ± 3.9 152.2 165.3 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.1619891302111111,
      "stddev": 0.007259946677484207,
      "median": 0.15835376810000001,
      "user": 0.11985787333333334,
      "system": 0.07748629111111112,
      "min": 0.15506927210000002,
      "max": 0.17494042810000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.1566163202111111,
      "stddev": 0.003945533411054815,
      "median": 0.1559815751,
      "user": 0.1145901511111111,
      "system": 0.07428145777777778,
      "min": 0.1521852341,
      "max": 0.1653204251
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.558 ± 0.161 4.364 4.940 1.29 ± 0.05
pacquet@main 4.633 ± 0.188 4.385 4.964 1.31 ± 0.06
pnpr@HEAD 3.526 ± 0.081 3.434 3.699 1.00
pnpr@main 3.575 ± 0.158 3.403 3.895 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.55844477968,
      "stddev": 0.1608332007681493,
      "median": 4.51491123878,
      "user": 1.7925745,
      "system": 1.88184824,
      "min": 4.36394831028,
      "max": 4.94024272228
    },
    {
      "command": "pacquet@main",
      "mean": 4.63304415288,
      "stddev": 0.18812113246190504,
      "median": 4.63932827828,
      "user": 1.9063106,
      "system": 1.9811389400000003,
      "min": 4.38526306628,
      "max": 4.96389750628
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.52648030988,
      "stddev": 0.08115836636804999,
      "median": 3.51463658028,
      "user": 1.5446377,
      "system": 1.5827894399999998,
      "min": 3.43440460328,
      "max": 3.69926623528
    },
    {
      "command": "pnpr@main",
      "mean": 3.5749514962799998,
      "stddev": 0.1577750687039765,
      "median": 3.53413505278,
      "user": 1.5543746999999999,
      "system": 1.66059904,
      "min": 3.40347804728,
      "max": 3.89480413128
    }
  ]
}

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 190.0 ± 13.1 175.6 226.1 1.02 ± 0.09
pacquet@main 186.1 ± 11.2 173.1 209.4 1.00
pnpr@HEAD 206.5 ± 14.3 182.5 226.7 1.11 ± 0.10
pnpr@main 209.2 ± 11.5 194.3 229.4 1.12 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.1900269551914286,
      "stddev": 0.013142284225302364,
      "median": 0.18545232262,
      "user": 0.23098891142857142,
      "system": 0.21286122857142856,
      "min": 0.17562616612,
      "max": 0.22613898312000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.18607513762000003,
      "stddev": 0.011233319239573235,
      "median": 0.18520240262,
      "user": 0.2215205542857142,
      "system": 0.21758529999999995,
      "min": 0.17310941212,
      "max": 0.20938354012000002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.20653255775636367,
      "stddev": 0.014336565653298107,
      "median": 0.20464842312,
      "user": 0.24750970363636363,
      "system": 0.21248870909090908,
      "min": 0.18248902612,
      "max": 0.22668722012
    },
    {
      "command": "pnpr@main",
      "mean": 0.20915281637000005,
      "stddev": 0.011465966118304721,
      "median": 0.21030098812000003,
      "user": 0.2373494233333334,
      "system": 0.22190155,
      "min": 0.19427930212000002,
      "max": 0.22938571312000003
    }
  ]
}

@zkochan
zkochan marked this pull request as ready for review September 23, 2026 14:02
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Move covered catalog entries to explicitly requested versions

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Moves covered catalog ranges to requested versions while preserving simple range operators.
• Keeps compound ranges unchanged and synchronizes workspace catalogs with lockfile resolutions.
• Suppresses misleading v11 warnings when updates already target catalog-backed dependencies.
Diagram

sequenceDiagram
    actor User
    participant CLI
    participant Decision as Catalog Decision
    participant Range as Range Calculator
    participant Workspace as Workspace Catalog
    participant Lockfile
    participant Resolver as v11 Resolver
    User->>CLI: Add or update version
    CLI->>Decision: Current entry and wanted version
    Decision->>Range: Calculate preserved range
    Range-->>Decision: Moved or unchanged entry
    Decision->>Workspace: Persist movable entry
    CLI->>Lockfile: Store resolved version
    CLI->>Resolver: Resolve catalog reference
    Resolver-->>CLI: Skip misleading warning
Loading
High-Level Assessment

The current approach is appropriate: it reuses calc_version_range, matching existing update semantics instead of introducing separate operator-preservation logic. Leaving only the lockfile resolution changed would retain inconsistent workspace state, while custom range rewriting would duplicate established behavior and increase semver edge-case risk.

Files changed (8) +134 / -9

Bug fix (2) +22 / -2
catalog_mode.rsMove covered catalog entries using existing range semantics +19/-1

Move covered catalog entries using existing range semantics

• Changes covered-version decisions to return an updated catalog entry calculated through 'calc_version_range'. Simple operators are preserved, while compound ranges and already-matching entries remain unchanged.

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

resolveDependencyTree.tsSuppress skip warnings for existing catalog references +3/-1

Suppress skip warnings for existing catalog references

• Excludes dependencies already resolved through 'catalog:' from default-catalog insertion checks. Their entries are updated through 'updatedCatalogs', so the previous warning contradicted actual behavior.

pnpm11/installing/deps-resolver/src/resolveDependencyTree.ts

Tests (4) +101 / -7
catalog.rsExpect add operations to persist moved catalog ranges +8/-3

Expect add operations to persist moved catalog ranges

• Updates catalog integration expectations from the original covered range to the requested version. It also verifies workspace YAML persistence, filtered-project behavior, and per-project lockfile behavior.

pnpm/crates/cli/tests/suite/catalog.rs

workspace.rsCover workspace and recursive catalog updates +54/-0

Cover workspace and recursive catalog updates

• Asserts targeted updates replace stale workspace catalog ranges. Adds a recursive multi-project regression test verifying catalog references remain intact, all lockfile resolutions move, and frozen installation succeeds afterward.

pnpm/crates/cli/tests/suite/update/workspace.rs

tests.rsTest moved, compound, and unchanged catalog decisions +35/-2

Test moved, compound, and unchanged catalog decisions

• Updates strict and prefer expectations to include moved catalog entries. Adds coverage ensuring compound ranges remain intact and entries already naming the wanted version are not rewritten.

pnpm/crates/package-manager/src/catalog_mode/tests.rs

catalogs.tsVerify catalog updates emit no skip warning +4/-2

Verify catalog updates emit no skip warning

• Mocks 'globalWarn', clears prior calls, and verifies updating an existing catalog-backed dependency does not emit the misleading “Skip adding” warning.

pnpm11/installing/deps-installer/test/catalogs.ts

Documentation (2) +11 / -0
catalog-entry-follows-the-wanted-version.mdDocument covered catalog entries moving to requested versions +5/-0

Document covered catalog entries moving to requested versions

• Adds a patch changeset for 'pacquet' explaining that targeted add and update commands now move covered catalog entries to the requested version.

.changeset/catalog-entry-follows-the-wanted-version.md

no-skip-adding-warning-on-catalog-update.mdDocument removal of the incorrect catalog update warning +6/-0

Document removal of the incorrect catalog update warning

• Adds patch changesets for pnpm and the v11 dependency resolver describing suppression of the misleading default-catalog warning.

.changeset/no-skip-adding-warning-on-catalog-update.md

@greptile-apps

greptile-apps Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge, with no outstanding correctness, security, or repository-rule issues identified.

Reviews (2) · Last reviewed commit: "chore: fix changeset punctuation"

@qodo-code-review

qodo-code-review Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. A release note includes rationale ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
.changeset/no-skip-adding-warning-on-catalog-update.md explains that the warning was wrong instead
of limiting the entry to observable behavior. This rationale appears after the user-facing warning
change and reaches the published release note for the pnpm v11 packages.
Code

.changeset/no-skip-adding-warning-on-catalog-update.md[6]

+`pnpm update` no longer warns "Skip adding ... to the default catalog" for a dependency that already uses `catalog:`. pnpm updates that catalog entry, so the warning was wrong [#13715](https://github.com/pnpm/pnpm/issues/13715).
Relevance

●●● Strong

Recent precedents accept removing rationale from changesets and limiting notes to observable
behavior.

PR-#15315
PR-#15246
PR-#15075

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Compliance rule 3058322 requires changeset entries to state only concrete observable behavior. The
second sentence on line 6 supplies design rationale—so the warning was wrong—rather than another
observable outcome.

Rule 3058322: Changeset entries must describe observable behavior changes only
.changeset/no-skip-adding-warning-on-catalog-update.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 includes an explanation that the previous warning was wrong, while release-note text must contain only concrete observable behavior.

## Fix Focus Areas
- .changeset/no-skip-adding-warning-on-catalog-update.md[6-6]

## Recommended Fix
Keep the sentence stating that `pnpm update` no longer emits the warning, and remove the explanatory sentence about why the warning was wrong.

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


Grey Divider

Context sources
✅ Compliance rules (platform): 64 rules
✅ Skills: review-code
Review mode: ⏭️ Skipped: The push only edits changelog prose and removes a test documentation comment, with no behavioral or semantic code changes.

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Finding overflow, which tucks the rest behind 'View more'

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

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.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Sep 23, 2026
zkochan and others added 2 commits September 23, 2026 16:17
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@zkochan

zkochan commented Sep 23, 2026

Copy link
Copy Markdown
Member Author

Qodo's finding on .changeset/no-skip-adding-warning-on-catalog-update.md holds: the justification is removed in c0bb8ee, and e5d1b28 fixes the punctuation that left behind.


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 e5d1b28

@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 88f7dd4 into main Sep 23, 2026
68 checks passed
@zkochan
zkochan deleted the fix-13715 branch September 23, 2026 15:29
u9g pushed a commit to u9g/pnpm that referenced this pull request Sep 25, 2026
…update names (pnpm#15372)

`pnpm add <pkg>@<version>` and `pnpm update <pkg>@<version>` under
`catalogMode: strict` or `prefer` accept a version the catalog entry's range
covers (pnpm#13715). pnpm v11 then writes that version back to the
entry, keeping its operator (`^7.22.17` becomes `^7.29.6`), the way a plain
`pnpm update` moves the entry to the version it resolves. The v12 port only
moved the entry's lockfile resolution and left `pnpm-workspace.yaml` on the
old range, so the next plain install was free to resolve elsewhere.

`decide_catalog_entry` now returns the moved entry, computed with
`calc_version_range`, the rule `update` uses when it bumps a range. A range
no single operator describes, such as `>=7.22.17 <8`, keeps its text, as it
does on a plain v12 update.

On v11, the resolver warned "Skip adding <pkg> to the default catalog ...
Please use `pnpm update`" for every dependency resolved through its
`catalog:` reference during a strict or prefer update, even though the same
update moves that entry through `updatedCatalogs`. The warning now only
applies to a dependency that is not already cataloged.

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

Labels

product: pacquet product: pnpm@11 reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

catalogMode: strict rejects pnpm update <pkg>@<version> for in-range versions when the catalog entry is a range, instead of checking semver.satisfies

2 participants