Skip to content

fix(catalogs): honor a wanted version the catalog entry already resolves past (pacquet) - #13853

Merged
zkochan merged 5 commits into
mainfrom
fix/pacquet-catalog-locked-version-noop
Aug 12, 2026
Merged

zkochan merged 5 commits into
mainfrom
fix/pacquet-catalog-locked-version-noop

Conversation

@zkochan

@zkochan zkochan commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

Summary

The pacquet side of #13841, which fixed this for the TypeScript CLI. Both stacks had the
same hole, in slightly different shapes:

# pnpm-workspace.yaml — the entry covers 1.1.0 but resolves to 1.0.0
catalogMode: strict
catalog:
  '@pnpm.e2e/foo': ^1.0.0
  • pacquet add @pnpm.e2e/[email protected] wrote nothing at all — the manifest specifier stays
    catalog:, so nothing looked stale and the install never reached the resolver.
  • pacquet update @pnpm.e2e/[email protected] against an entry resolved to a newer in-range version
    re-resolved to the highest version the range allows, not to the one asked for. DropOnly
    withholds the pin, but nothing steered the pick.

A version named on the command line only reached the lockfile through the specifier written to
the manifest. A cataloged dependency keeps its version in the catalog entry instead, so the
request had nowhere to land.

Install now takes an optional preferred-versions overlay, layered onto the seed built from the
lockfile and manifests in preferred_versions_seeds. add and update put a version named on
the command line there, weighted one above EXISTING_VERSION_SELECTOR_WEIGHT so it outranks the
lockfile's own pin. add additionally withholds that package's pin (DropOnly) and skips the
frozen shortcut, which would otherwise hold. Every other install passes None and resolves
exactly as before.

Related to #13715.

Squash Commit Body

A version named on the command line reached the lockfile only through the specifier written to
the manifest. A cataloged dependency writes `catalog:` there and keeps its version in the catalog
entry, so when that entry was a range covering the wanted version but resolved to another one,
the request was dropped in silence — `add <pkg>@<version>` wrote nothing at all, and `update
<pkg>@<version>` re-resolved to the highest version in range rather than to the one asked for.

Install grows a preferred-versions overlay, layered onto the seed built from the lockfile and
manifests. `add` and `update` put a version named on the command line there, weighted above the
lockfile's own pin so the re-resolve lands on it. `add` also withholds that package's pin and
skips the frozen shortcut, which would otherwise hold: its manifest specifier doesn't change when
the version behind a `catalog:` reference does, so nothing looked stale enough to resolve.

Every other install passes no overlay and is unaffected.

Related to pnpm/pnpm#13715.

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • 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.

Two end-to-end tests cover the paths above; pacquet-package-manager (580) and the cli
catalog:: / add:: / update:: suites (110) pass, along with cargo fmt, workspace clippy,
and dylint.


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


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

    • Targeted package additions and updates now move catalog resolutions to the requested compatible version instead of leaving the existing lockfile resolution unchanged.
    • Catalog references are preserved when selecting older or alternate compatible versions.
    • Version changes now apply consistently across selected workspace projects and per-project lockfiles without affecting untargeted projects.
  • Tests

    • Added regression coverage for catalog resolution changes during add and update operations, including filtered workspace commands and per-project lockfiles.

…ves past

#13841 fixed this for the TypeScript CLI; this is the pacquet side.

A version named on the command line reached the lockfile only through the
specifier written to the manifest. A cataloged dependency writes `catalog:`
there and keeps its version in the catalog entry, so when that entry was a
range covering the wanted version but resolved to another one, the request
was dropped in silence — `add <pkg>@<version>` wrote nothing at all, and
`update <pkg>@<version>` re-resolved to the highest version in range rather
than to the one asked for.

Install grows a preferred-versions overlay, layered onto the seed built
from the lockfile and manifests. `add` and `update` put a version named on
the command line there, weighted above the lockfile's own pin so the
re-resolve lands on it. `add` also withholds that package's pin and skips
the frozen shortcut, which would otherwise hold: its manifest specifier
doesn't change when the version behind a `catalog:` reference does, so
nothing looked stale enough to resolve.

Every other install passes no overlay and is unaffected.

Related to #13715.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings August 12, 2026 07:13

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 reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a895881b-bb3b-4aed-ada4-a2d9a2a4c806

📥 Commits

Reviewing files that changed from the base of the PR and between 7962e4a and 6ba0191.

📒 Files selected for processing (1)
  • pnpm/crates/cli/tests/suite/catalog.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • pnpm/crates/cli/tests/suite/catalog.rs

📝 Walkthrough

Walkthrough

Targeted catalog add and update commands now move lockfile resolutions to requested in-range versions. Preferred-version overrides flow through installation and fresh-lockfile resolution. Existing install callers explicitly leave the override unset.

Changes

Catalog resolution updates

Layer / File(s) Summary
Catalog request handling
pnpm/crates/package-manager/src/add.rs, pnpm/crates/package-manager/src/catalog_mode.rs, pnpm/crates/cli/tests/suite/catalog.rs, .changeset/...
Catalog-aware add operations detect differing in-range requests, drop matching direct pins, pass preferred versions, and disable frozen reuse. Regression tests cover newer, older, filtered-workspace, and per-project lockfile requests.
Update preference propagation
pnpm/crates/package-manager/src/update.rs
Single-project and selected-project updates collect requested versions and pass merged preferences to installation.
Preferred-version resolution pipeline
pnpm/crates/package-manager/src/install.rs, pnpm/crates/package-manager/src/install/materialize.rs, pnpm/crates/package-manager/src/install/run.rs, pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs, pnpm/crates/package-manager/src/install_with_fresh_lockfile/resolve.rs
Install and fresh-lockfile resolution accept overrides and merge them into workspace and importer preferred-version seeds.
Install callsite wiring
pnpm/crates/cli/src/cli_args/*, pnpm/crates/napi/src/install.rs, pnpm/crates/package-manager/src/remove.rs, pnpr/crates/pnpr/src/resolver/resolve.rs, pnpm/crates/package-manager/src/install/tests.rs
Existing install configurations set preferred_versions_override to None, and test initializers include the new field.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Command as Add or Update command
  participant Catalog as Catalog request preparation
  participant Install as Install pipeline
  participant Resolver as Fresh-lockfile resolver
  Command->>Catalog: Collect requested catalog versions
  Catalog->>Install: Pass preferred versions and pin changes
  Install->>Resolver: Forward preferred_versions_override
  Resolver->>Resolver: Merge overrides into resolution seeds
  Resolver-->>Command: Resolve requested catalog version
Loading

Possibly related PRs

  • pnpm/pnpm#12357: Both changes modify preferred-version resolution and resolver seed overlays.
  • pnpm/pnpm#13841: Both changes address catalog-pinned version resolution in targeted add and update flows.
  • pnpm/pnpm#13431: Both changes modify fresh-lockfile resolution and preferred-version seeding.

Suggested labels: product: pacquet, product: pnpr

Suggested reviewers: greptile-apps

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pacquet-catalog-locked-version-noop

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix pacquet catalogs: honor CLI-requested versions via preferred-versions override

🐞 Bug fix 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Honor add/update @ for cataloged deps even when manifests stay catalog:
• Add an optional preferred-versions overlay to steer resolver picks past lockfile pins
• Add regression tests for add and update against strict catalogs and lockfile-only installs
Diagram

graph TD
  CLI["CLI: add/update"] --> PM["package-manager: Install"] --> Fresh["InstallWithFreshLockfile"] --> Seed["preferred_versions_seeds"] --> Res["Resolver pick"]
  Overlay[("Preferred versions\noverride")] --> Seed
  Lock[("Lockfile + manifests\nseed")] --> Seed
  Cat[("Catalog entry\n(pnpm-workspace.yaml)")] --> Res
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Write requested version into manifest (temporary or explicit)
  • ➕ Avoids threading a new override through the install pipeline
  • ➕ Keeps resolver inputs unchanged (manifest remains the single source for intent)
  • ➖ Breaks the catalog: abstraction by forcing a non-catalog specifier
  • ➖ Requires extra cleanup/rollback logic if the install fails
  • ➖ Still interacts poorly with freshness/frozen short-circuits unless carefully handled
2. Add a dedicated "requested versions" channel to the resolver API
  • ➕ Makes the intent explicit (distinct from general preferred versions)
  • ➕ Can enforce stricter semantics (e.g., error if not satisfiable)
  • ➖ Bigger API surface change and more domain concepts to maintain
  • ➖ Likely more invasive across both pacquet and pnpr resolver stacks

Recommendation: The PR’s approach (a narrow preferred-versions overlay used only by add/update, weighted above the lockfile pin) is the best trade-off: it preserves catalog: manifests, avoids broad behavioral changes for normal installs, and cleanly integrates with existing preferred-version selection logic. The additional add behavior (dropping pins + bypassing the frozen shortcut when an explicit version is named) directly addresses the catalog freshness hole without impacting other flows.

Files changed (21) +325 / -19

Enhancement (1) +5 / -0
install.rsAdd preferred-versions override to Install options +5/-0

Add preferred-versions override to Install options

• Extends 'Install' with an optional 'preferred_versions_override' field, documented as an 'add'/'update' mechanism to steer re-resolve outcomes.

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

Bug fix (4) +151 / -18
add.rsHonor explicit '<pkg>@<version>' for cataloged deps via override + pin drop +63/-6

Honor explicit '<pkg>@<version>' for cataloged deps via override + pin drop

• Detects explicit version requests from selectors and constructs a 'PreferredVersions' overlay to steer resolution. When a version is named, drops the lockfile pin for that package ('DropOnly') and disables the frozen shortcut so catalog resolution can change even if the manifest specifier remains 'catalog:'.

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

install_with_fresh_lockfile.rsAdd override field and helper to prefer CLI-requested versions +35/-0

Add override field and helper to prefer CLI-requested versions

• Adds 'preferred_versions_override' to 'InstallWithFreshLockfile' and introduces 'prefer_requested_version', which inserts a version selector weighted above the lockfile’s existing pin. Passes the override into preferred-version seed construction.

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

resolve.rsMerge preferred-versions overrides into seed maps +30/-10

Merge preferred-versions overrides into seed maps

• Extends 'preferred_versions_seeds' to accept optional overrides and merges them into both workspace-wide and importer-specific seeds so caller-supplied selectors win.

pnpm/crates/package-manager/src/install_with_fresh_lockfile/resolve.rs

update.rsCollect requested versions during update and pass as override +23/-2

Collect requested versions during update and pass as override

• Builds a 'PreferredVersions' overlay when 'update' is invoked with explicit versions and forwards it to 'Install', ensuring the resolver lands on the requested in-range version (including downgrades within range). Aggregates overrides across selected manifests.

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

Refactor (13) +20 / -0
dedupe.rsPlumb new install option with default 'None' for dedupe +1/-0

Plumb new install option with default 'None' for dedupe

• Extends the install invocation options to include 'preferred_versions_override: None', keeping dedupe behavior unchanged.

pnpm/crates/cli/src/cli_args/dedupe.rs

deploy.rsPlumb new install option with default 'None' for deploy +1/-0

Plumb new install option with default 'None' for deploy

• Adds 'preferred_versions_override: None' to the deploy install options wiring.

pnpm/crates/cli/src/cli_args/deploy.rs

fetch.rsPlumb new install option with default 'None' for fetch +1/-0

Plumb new install option with default 'None' for fetch

• Adds 'preferred_versions_override: None' to the fetch install options wiring.

pnpm/crates/cli/src/cli_args/fetch.rs

import.rsPlumb new install option with default 'None' for import +1/-0

Plumb new install option with default 'None' for import

• Adds 'preferred_versions_override: None' to the import install options wiring.

pnpm/crates/cli/src/cli_args/import.rs

install.rsPlumb new install option with default 'None' for install paths +3/-0

Plumb new install option with default 'None' for install paths

• Threads 'preferred_versions_override: None' through multiple install entry points so existing installs resolve exactly as before unless explicitly overridden.

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

link.rsPlumb new install option with default 'None' for link +1/-0

Plumb new install option with default 'None' for link

• Adds 'preferred_versions_override: None' to the link install options wiring.

pnpm/crates/cli/src/cli_args/link.rs

prune.rsPlumb new install option with default 'None' for prune +1/-0

Plumb new install option with default 'None' for prune

• Adds 'preferred_versions_override: None' to the prune install options wiring.

pnpm/crates/cli/src/cli_args/prune.rs

rebuild.rsPlumb new install option with default 'None' for rebuild +1/-0

Plumb new install option with default 'None' for rebuild

• Adds 'preferred_versions_override: None' to the rebuild install options wiring.

pnpm/crates/cli/src/cli_args/rebuild.rs

install.rsDefault N-API install wiring to no preferred-versions override +1/-0

Default N-API install wiring to no preferred-versions override

• Adds 'preferred_versions_override: None' to the N-API install call path so behavior stays unchanged.

pnpm/crates/napi/src/install.rs

materialize.rsThread preferred-versions override through materialization inputs +4/-0

Thread preferred-versions override through materialization inputs

• Adds 'preferred_versions_override' to 'MaterializationInputs' and passes it through to the fresh-lockfile install pipeline.

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

run.rsPropagate preferred-versions override through install runner +2/-0

Propagate preferred-versions override through install runner

• Wires 'preferred_versions_override' from 'Install' into materialization and downstream execution paths.

pnpm/crates/package-manager/src/install/run.rs

remove.rsDefault remove flow to no preferred-versions override +2/-0

Default remove flow to no preferred-versions override

• Adds 'preferred_versions_override: None' to remove install calls to satisfy the new Install API without behavioral changes.

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

resolve.rsDefault pnpr resolver install call to no preferred-versions override +1/-0

Default pnpr resolver install call to no preferred-versions override

• Adds 'preferred_versions_override: None' to the pnpr resolver’s install invocation to match the updated Install API.

pnpr/crates/pnpr/src/resolver/resolve.rs

Tests (2) +144 / -1
catalog.rsAdd regression tests for add/update moving catalog resolution +51/-0

Add regression tests for add/update moving catalog resolution

• Adds two tests covering 'add <pkg>@<version>' and 'update <pkg>@<version>' when the dependency is 'catalog:' and the catalog range resolves to a different in-range version. Ensures the catalog snapshot’s resolved version moves to the explicitly requested one.

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

tests.rsUpdate install tests to include new override field +93/-1

Update install tests to include new override field

• Adjusts many test install invocations to set 'preferred_versions_override: None' (plus minor formatting), keeping test semantics unchanged.

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

Documentation (1) +5 / -0
pacquet-catalog-locked-version-noop.mdAdd changeset entry describing catalog version request fix +5/-0

Add changeset entry describing catalog version request fix

• Adds a patch-level changeset documenting that 'add'/'update <pkg>@<version>' now moves a catalog entry’s resolved version instead of silently no-oping.

.changeset/pacquet-catalog-locked-version-noop.md

@greptile-apps

greptile-apps Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (5): Last reviewed commit: "style(catalogs): close a multi-line macr..." | Re-trigger Greptile

Comment thread pnpm/crates/package-manager/src/add.rs Resolved
Comment thread pnpm/crates/cli/tests/suite/catalog.rs Resolved
@github-actions

github-actions Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.02     18.1±2.77ms    20.7 MB/sec    1.00     17.8±3.74ms    21.1 MB/sec
packument/parse                                  1.14     45.2±5.81µs  1466.0 MB/sec    1.00     39.5±3.40µs  1678.5 MB/sec
tarball/download_dependency                      2.09      5.0±1.08ms   871.9 KB/sec    1.00      2.4±0.10ms  1821.4 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.53   311.3±23.11ms 51.4 KElem/sec    1.00   203.4±13.97ms 78.7 KElem/sec
workspace_resolution/hoist_heavy                 1.36   555.9±79.96ms        ? ?/sec    1.00   409.8±22.47ms        ? ?/sec

@qodo-code-review

qodo-code-review Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Wrong importer root dir ✓ Resolved 🐞 Bug ≡ Correctness ⭐ New
Description
Add now computes ByImporter seed-policy keys using config.workspace_dir as the importer-id
root, but installs compute importer IDs relative to the per-project lockfile dir when
shared_workspace_lockfile is false. In that configuration the policy key won’t match any importer,
so the pin isn’t withheld and the requested catalog version may be ignored again.
Code

pnpm/crates/package-manager/src/add.rs[R248-253]

+            let manifest_dir =
+                manifest.path().parent().expect("manifest path always has a parent dir");
+            let workspace_root = config.workspace_dir.as_deref().unwrap_or(manifest_dir);
+            BTreeMap::from([(
+                pacquet_workspace::importer_id_from_root_dir(workspace_root, manifest_dir),
+                ImporterUpdateSeedPolicy::DropOnly(dropped_pins),
Relevance

●● Moderate

Correctness concern, but similar “change importer_id root” suggestion was rejected previously;
unclear team agrees this mismatch exists.

PR-#13081

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new add logic keys per-importer seed policies by computing an importer ID relative to
config.workspace_dir, but importer IDs are defined relative to the lockfile directory; the install
pipeline explicitly switches the lockfile/importer-id root to manifest_dir when
shared_workspace_lockfile is disabled. That mismatch prevents the ByImporter policy from being
applied to the intended importer in per-project-lockfile mode.

pnpm/crates/package-manager/src/add.rs[243-255]
pnpm/crates/package-manager/src/add.rs[388-411]
pnpm/crates/package-manager/src/install/run.rs[136-152]
pnpm/crates/workspace/src/importer_id.rs[9-18]

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

## Issue description
`Add` builds `UpdateSeedPolicy::ByImporter` policies keyed by `importer_id_from_root_dir(workspace_root, project_dir)`, but it currently derives `workspace_root` from `config.workspace_dir` (or `manifest_dir`). When `sharedWorkspaceLockfile: false`, the install pipeline treats the per-project directory (`manifest_dir`) as the lockfile dir / importer-id root, so these keys can diverge and the policy won’t apply.

## Issue Context
- `importer_id_from_root_dir` is defined as the relative path from the *lockfile dir* to the project dir.
- Install selects that root as `manifest_dir` when `shared_workspace_lockfile` is disabled.

## Fix Focus Areas
- pnpm/crates/package-manager/src/add.rs[248-255]
- pnpm/crates/package-manager/src/add.rs[388-411]

## Suggested fix
1. Derive the importer-id root the same way `Install` does:
  - If `config.shared_workspace_lockfile` is `false`, use `manifest_dir` (or the selected project’s dir) as the importer-id root.
  - If `true`, use the workspace lockfile dir (typically `config.workspace_dir`/workspace manifest dir).
2. Apply the same logic in both the single-project and selected-project `add` flows.
3. Add a regression test that sets `sharedWorkspaceLockfile: false` and verifies `add <pkg>@<version>` for a cataloged dependency moves the catalog resolution to the requested version (i.e., the new override actually takes effect).

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



Remediation recommended

2. DropOnly scope too broad ✓ Resolved 🐞 Bug ➹ Performance
Description
Add::run uses UpdateSeedPolicy::DropOnly with UpdateDepth::UNLIMITED for exact-version
selectors, which makes the resolver treat that package name as an update target at any depth the
update reaches. This can increase resolver work and cause lockfile churn by disturbing reuse for
transitive occurrences of the same name.
Code

pnpm/crates/package-manager/src/add.rs[R282-285]

+                UpdateSeedPolicy::DropOnly {
+                    names: dropped_pins,
+                    max_depth: UpdateDepth::UNLIMITED,
+                }
Relevance

●● Moderate

Scope/perf tradeoff is semantic; team may keep current behavior without clearer churn precedent.

PR-#12995
PR-#13708

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed add code opts into DropOnly + UNLIMITED, and DropOnly is translated into an
UpdateReuseScope::Except set; the resolver documents that Except matches names at any depth the
update reaches and that UpdateDepth controls that reach. With UNLIMITED, the name can match at
any depth, broadening the scope beyond “direct only”.

pnpm/crates/package-manager/src/add.rs[276-286]
pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[332-346]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[57-76]

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

## Issue description
For `pnpm add <pkg>@<exact>`, the PR switches `update_seed_policy` from `KeepAll` to `DropOnly { ..., max_depth: UNLIMITED }`. In the resolver, `DropOnly` maps to `UpdateReuseScope::Except`, and with `UpdateDepth::UNLIMITED` the “except” match applies at any depth, potentially disturbing reuse for transitive occurrences of the same package name.

## Issue Context
The intent appears to be: force the *direct* dependency to move to the requested version even when the manifest specifier is `catalog:` and the lockfile previously pinned a different in-range version.

## Fix Focus Areas
- pnpm/crates/package-manager/src/add.rs[276-286]
- pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[332-346]
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[57-76]

## Suggested fix
- Limit the scope of `DropOnly` in `add` to direct dependencies by using a bounded `UpdateDepth` (e.g. `UpdateDepth::new(0)` if depth-0 corresponds to direct deps in the resolver’s `currentDepth <= updateDepth` semantics).
- If depth-0 is not the right mapping for “direct only”, consider introducing an `add`-specific policy (or a `ByImporter` policy scoped to the root importer) that disables reuse only for the direct edge(s) being added.
- Add a regression test where the target package name exists both as a transitive dependency and as the newly-added direct dependency; assert only the direct one is forced to the requested version, and that unrelated transitive occurrences are not unnecessarily re-resolved/churned.

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


3. Add skips fast path ✓ Resolved 🐞 Bug ➹ Performance
Description
Add::run forces prefer_frozen_lockfile off for any exact-version selector, which disables
try_fast_update_lockfile (and lockfile synthesis) and forces a full resolve even when the existing
lockfile already contains a satisfying version. This adds avoidable resolver/registry work on a hot
path (pnpm add [email protected]).
Code

pnpm/crates/package-manager/src/add.rs[R263-264]

+            prefer_frozen_lockfile: named_a_version.then_some(false),
            ignore_manifest_check: false,
Relevance

●● Moderate

Perf concern is plausible but change may be intentional for correctness; no close precedent either
way.

PR-#13803
PR-#12995

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new Add::run logic forces prefer_frozen_lockfile off whenever an exact version was parsed
from CLI selectors, but the installer’s fast lockfile-update path is explicitly gated on
prefer_frozen_lockfile being true; forcing it false therefore disables that optimization for all
exact-version adds, not just the catalog-backed case mentioned in the comment.

pnpm/crates/package-manager/src/add.rs[236-287]
pnpm/crates/package-manager/src/install/run.rs[540-575]

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

## Issue description
`pnpm add <pkg>@<exact>` currently forces `prefer_frozen_lockfile=false` whenever any exact version is present on the command line. That disables fast lockfile update and other “prefer frozen” shortcuts even in the common non-catalog case where the manifest specifier changes and the install can safely use the existing fast path.

## Issue Context
The code comment explains the bypass is needed because `catalog:` dependencies don’t change their manifest specifier when the catalog resolution changes, so freshness checks would otherwise keep the run from reaching the resolver.

## Fix Focus Areas
- pnpm/crates/package-manager/src/add.rs[236-287]
- pnpm/crates/package-manager/src/install/run.rs[540-575]

## Suggested fix
- Compute the “must bypass prefer-frozen/fast-update” condition based on *whether any affected dependency is saved as a `catalog:`/`catalog:<name>` specifier* (and an exact version was requested), rather than based on “any exact version was requested” globally.
 - For example, thread a boolean out of `prepare_manifest` / `resolve_added_dependency` indicating that at least one resolved selector both (a) had an explicit exact version and (b) produced a `catalog:` manifest specifier.
 - Only in that case set `prefer_frozen_lockfile: Some(false)`; otherwise keep `prefer_frozen_lockfile: None` (defer to config/CLI flags) so the fast-update path can still absorb the manifest edit when possible.
- Add a regression test that demonstrates `add [email protected] --lockfile-only` can still take the fast-update path (or at least avoids a full resolve) when `foo` is not cataloged and the lockfile already contains a satisfying `[email protected]`.

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



Informational

4. Catalogs deep-cloned unnecessarily 🐞 Bug ➹ Performance
Description
prepare_selected_manifests now deep-clones the full Catalogs (nested BTreeMap) to produce
catalogs_override, which adds avoidable CPU and memory overhead when running selected/recursive
add operations that update catalogs in large workspaces.
Code

pnpm/crates/package-manager/src/add.rs[R586-588]

+    let catalogs_override = (!updated_catalogs.is_empty()).then_some(catalogs.clone());
    Ok(SelectedAddPreparation {
+        catalogs,
Relevance

●●● Strong

Team recently accepted avoiding unnecessary deep clones for perf; likely to optimize this
catalogs.clone() too.

PR-#13850

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new code calls catalogs.clone() to create catalogs_override. Since Catalogs is a nested
BTreeMap alias, cloning it duplicates all entries, not just the updated subset.

pnpm/crates/package-manager/src/add.rs[586-592]
pnpm/crates/catalogs-types/src/lib.rs[13-19]

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

### Issue description
`prepare_selected_manifests` builds `catalogs_override` by calling `catalogs.clone()` when `updated_catalogs` is non-empty. `Catalogs` is a nested `BTreeMap` type alias, so this clone copies all catalog groups and all entries, which can be costly for large workspaces.

### Issue Context
The clone appears to be needed because `SelectedAddPreparation` now also retains `catalogs` (effective catalogs) for later logic, while `catalogs_override` needs owned data.

### Fix Focus Areas
- pnpm/crates/package-manager/src/add.rs[586-592]

### Suggested fix directions
- Prefer structural sharing instead of deep cloning:
 - Change the data flow to store catalogs in `Arc<Catalogs>` (or equivalent) so `SelectedAddPreparation` and `catalogs_override` can share without copying.
 - Alternatively, change `Install`/call sites to accept a borrowed catalogs override (e.g., `Option<&Catalogs>`) or `Option<Arc<Catalogs>>`.
- If API changes are too large, consider benchmarking/guarding: only build `catalogs_override` when it is actually consumed downstream, and document the tradeoff.

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


5. Changeset missing pnpm entry 📘 Rule violation § Compliance
Description
The new changeset only declares a pacquet bump and does not include a pnpm entry as required,
which can cause the pnpm package version to not be updated for this user-visible change.
Code

.changeset/pacquet-catalog-locked-version-noop.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

● Weak

Similar “add pnpm entry” compliance suggestions were rejected for pacquet-only changesets.

PR-#13417
PR-#13790

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires that changeset files include an explicit pnpm bump entry. The
added changeset front-matter contains only "pacquet": patch, so it does not meet the rule’s
requirement.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/pacquet-catalog-locked-version-noop.md[1-3]

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 new changeset front-matter is missing a required `pnpm` package bump entry.

## Issue Context
This PR introduces a user-visible behavior change for `pnpm add`/`pnpm update` behavior in the pacquet stack, and the compliance checklist requires that changeset files explicitly declare a `pnpm` bump (`patch`/`minor`/`major`).

## Fix Focus Areas
- .changeset/pacquet-catalog-locked-version-noop.md[1-3]

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


Grey Divider

Context
✅ Compliance rules (platform): 34 rules

Grey Divider

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous review results

Review updated until commit 6ba0191

Results up to commit 6a6fc9a ⚖️ Balanced


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


Remediation recommended
1. DropOnly scope too broad ✓ Resolved 🐞 Bug ➹ Performance
Description
Add::run uses UpdateSeedPolicy::DropOnly with UpdateDepth::UNLIMITED for exact-version
selectors, which makes the resolver treat that package name as an update target at any depth the
update reaches. This can increase resolver work and cause lockfile churn by disturbing reuse for
transitive occurrences of the same name.
Code

pnpm/crates/package-manager/src/add.rs[R282-285]

+                UpdateSeedPolicy::DropOnly {
+                    names: dropped_pins,
+                    max_depth: UpdateDepth::UNLIMITED,
+                }
Relevance

●● Moderate

Scope/perf tradeoff is semantic; team may keep current behavior without clearer churn precedent.

PR-#12995
PR-#13708

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed add code opts into DropOnly + UNLIMITED, and DropOnly is translated into an
UpdateReuseScope::Except set; the resolver documents that Except matches names at any depth the
update reaches and that UpdateDepth controls that reach. With UNLIMITED, the name can match at
any depth, broadening the scope beyond “direct only”.

pnpm/crates/package-manager/src/add.rs[276-286]
pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[332-346]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[57-76]

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

## Issue description
For `pnpm add <pkg>@<exact>`, the PR switches `update_seed_policy` from `KeepAll` to `DropOnly { ..., max_depth: UNLIMITED }`. In the resolver, `DropOnly` maps to `UpdateReuseScope::Except`, and with `UpdateDepth::UNLIMITED` the “except” match applies at any depth, potentially disturbing reuse for transitive occurrences of the same package name.

## Issue Context
The intent appears to be: force the *direct* dependency to move to the requested version even when the manifest specifier is `catalog:` and the lockfile previously pinned a different in-range version.

## Fix Focus Areas
- pnpm/crates/package-manager/src/add.rs[276-286]
- pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[332-346]
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[57-76]

## Suggested fix
- Limit the scope of `DropOnly` in `add` to direct dependencies by using a bounded `UpdateDepth` (e.g. `UpdateDepth::new(0)` if depth-0 corresponds to direct deps in the resolver’s `currentDepth <= updateDepth` semantics).
- If depth-0 is not the right mapping for “direct only”, consider introducing an `add`-specific policy (or a `ByImporter` policy scoped to the root importer) that disables reuse only for the direct edge(s) being added.
- Add a regression test where the target package name exists both as a transitive dependency and as the newly-added direct dependency; assert only the direct one is forced to the requested version, and that unrelated transitive occurrences are not unnecessarily re-resolved/churned.

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


2. Add skips fast path ✓ Resolved 🐞 Bug ➹ Performance
Description
Add::run forces prefer_frozen_lockfile off for any exact-version selector, which disables
try_fast_update_lockfile (and lockfile synthesis) and forces a full resolve even when the existing
lockfile already contains a satisfying version. This adds avoidable resolver/registry work on a hot
path (pnpm add [email protected]).
Code

pnpm/crates/package-manager/src/add.rs[R263-264]

+            prefer_frozen_lockfile: named_a_version.then_some(false),
            ignore_manifest_check: false,
Relevance

●● Moderate

Perf concern is plausible but change may be intentional for correctness; no close precedent either
way.

PR-#13803
PR-#12995

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new Add::run logic forces prefer_frozen_lockfile off whenever an exact version was parsed
from CLI selectors, but the installer’s fast lockfile-update path is explicitly gated on
prefer_frozen_lockfile being true; forcing it false therefore disables that optimization for all
exact-version adds, not just the catalog-backed case mentioned in the comment.

pnpm/crates/package-manager/src/add.rs[236-287]
pnpm/crates/package-manager/src/install/run.rs[540-575]

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

## Issue description
`pnpm add <pkg>@<exact>` currently forces `prefer_frozen_lockfile=false` whenever any exact version is present on the command line. That disables fast lockfile update and other “prefer frozen” shortcuts even in the common non-catalog case where the manifest specifier changes and the install can safely use the existing fast path.

## Issue Context
The code comment explains the bypass is needed because `catalog:` dependencies don’t change their manifest specifier when the catalog resolution changes, so freshness checks would otherwise keep the run from reaching the resolver.

## Fix Focus Areas
- pnpm/crates/package-manager/src/add.rs[236-287]
- pnpm/crates/package-manager/src/install/run.rs[540-575]

## Suggested fix
- Compute the “must bypass prefer-frozen/fast-update” condition based on *whether any affected dependency is saved as a `catalog:`/`catalog:<name>` specifier* (and an exact version was requested), rather than based on “any exact version was requested” globally.
 - For example, thread a boolean out of `prepare_manifest` / `resolve_added_dependency` indicating that at least one resolved selector both (a) had an explicit exact version and (b) produced a `catalog:` manifest specifier.
 - Only in that case set `prefer_frozen_lockfile: Some(false)`; otherwise keep `prefer_frozen_lockfile: None` (defer to config/CLI flags) so the fast-update path can still absorb the manifest edit when possible.
- Add a regression test that demonstrates `add [email protected] --lockfile-only` can still take the fast-update path (or at least avoids a full resolve) when `foo` is not cataloged and the lockfile already contains a satisfying `[email protected]`.

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



Informational
3. Changeset missing pnpm entry 📘 Rule violation § Compliance
Description
The new changeset only declares a pacquet bump and does not include a pnpm entry as required,
which can cause the pnpm package version to not be updated for this user-visible change.
Code

.changeset/pacquet-catalog-locked-version-noop.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

● Weak

Similar “add pnpm entry” compliance suggestions were rejected for pacquet-only changesets.

PR-#13417
PR-#13790

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires that changeset files include an explicit pnpm bump entry. The
added changeset front-matter contains only "pacquet": patch, so it does not meet the rule’s
requirement.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/pacquet-catalog-locked-version-noop.md[1-3]

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 new changeset front-matter is missing a required `pnpm` package bump entry.

## Issue Context
This PR introduces a user-visible behavior change for `pnpm add`/`pnpm update` behavior in the pacquet stack, and the compliance checklist requires that changeset files explicitly declare a `pnpm` bump (`patch`/`minor`/`major`).

## Fix Focus Areas
- .changeset/pacquet-catalog-locked-version-noop.md[1-3]

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


Results up to commit 7da1fd8 ⚖️ Balanced


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


Informational
1. Catalogs deep-cloned unnecessarily 🐞 Bug ➹ Performance
Description
prepare_selected_manifests now deep-clones the full Catalogs (nested BTreeMap) to produce
catalogs_override, which adds avoidable CPU and memory overhead when running selected/recursive
add operations that update catalogs in large workspaces.
Code

pnpm/crates/package-manager/src/add.rs[R586-588]

+    let catalogs_override = (!updated_catalogs.is_empty()).then_some(catalogs.clone());
    Ok(SelectedAddPreparation {
+        catalogs,
Relevance

●●● Strong

Team recently accepted avoiding unnecessary deep clones for perf; likely to optimize this
catalogs.clone() too.

PR-#13850

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new code calls catalogs.clone() to create catalogs_override. Since Catalogs is a nested
BTreeMap alias, cloning it duplicates all entries, not just the updated subset.

pnpm/crates/package-manager/src/add.rs[586-592]
pnpm/crates/catalogs-types/src/lib.rs[13-19]

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

### Issue description
`prepare_selected_manifests` builds `catalogs_override` by calling `catalogs.clone()` when `updated_catalogs` is non-empty. `Catalogs` is a nested `BTreeMap` type alias, so this clone copies all catalog groups and all entries, which can be costly for large workspaces.

### Issue Context
The clone appears to be needed because `SelectedAddPreparation` now also retains `catalogs` (effective catalogs) for later logic, while `catalogs_override` needs owned data.

### Fix Focus Areas
- pnpm/crates/package-manager/src/add.rs[586-592]

### Suggested fix directions
- Prefer structural sharing instead of deep cloning:
 - Change the data flow to store catalogs in `Arc<Catalogs>` (or equivalent) so `SelectedAddPreparation` and `catalogs_override` can share without copying.
 - Alternatively, change `Install`/call sites to accept a borrowed catalogs override (e.g., `Option<&Catalogs>`) or `Option<Arc<Catalogs>>`.
- If API changes are too large, consider benchmarking/guarding: only build `catalogs_override` when it is actually consumed downstream, and document the tradeoff.

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


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 commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 6ba019128a6e

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time).

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.656 ± 0.153 2.447 2.865 1.65 ± 0.18
pacquet@main 2.545 ± 0.109 2.399 2.684 1.59 ± 0.16
pnpr@HEAD 1.605 ± 0.145 1.425 1.759 1.00
pnpr@main 1.637 ± 0.151 1.403 1.875 1.02 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.65595778788,
      "stddev": 0.15336545925857675,
      "median": 2.63103881188,
      "user": 2.23872936,
      "system": 1.70684852,
      "min": 2.44661170438,
      "max": 2.86485708938,
      "times": [
        2.49666267238,
        2.86485708938,
        2.51367605838,
        2.44661170438,
        2.85145712838,
        2.5772266833799997,
        2.81515431338,
        2.73185460538,
        2.60070235438,
        2.66137526938
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.5454561152799995,
      "stddev": 0.10943554816418599,
      "median": 2.48989511938,
      "user": 2.33950656,
      "system": 1.74127592,
      "min": 2.39882044338,
      "max": 2.6842361923799998,
      "times": [
        2.47126570538,
        2.67168602338,
        2.49168638738,
        2.48810385138,
        2.67293642438,
        2.46071822238,
        2.6460982773799997,
        2.39882044338,
        2.6842361923799998,
        2.46900962538
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6049799651799996,
      "stddev": 0.14530389153372983,
      "median": 1.64918068238,
      "user": 1.59051406,
      "system": 1.45960942,
      "min": 1.42487231938,
      "max": 1.75891065138,
      "times": [
        1.6996857193800001,
        1.71678513638,
        1.49192981538,
        1.7350280253800001,
        1.7581033693800001,
        1.42487231938,
        1.75891065138,
        1.4357936113799998,
        1.59867564538,
        1.43001535838
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.6374082902800002,
      "stddev": 0.15096063045785618,
      "median": 1.6177883418799999,
      "user": 1.6579181600000001,
      "system": 1.4293188199999998,
      "min": 1.4032686323799999,
      "max": 1.8749444843799998,
      "times": [
        1.64222808338,
        1.52167111938,
        1.59334860038,
        1.4785571443799999,
        1.77564615138,
        1.70040596738,
        1.58195272138,
        1.8749444843799998,
        1.4032686323799999,
        1.8020599983799999
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 291.2 ± 28.5 239.8 321.4 1.06 ± 0.11
pacquet@main 273.6 ± 9.1 259.5 291.3 1.00
pnpr@HEAD 308.7 ± 12.9 281.1 326.2 1.13 ± 0.06
pnpr@main 301.2 ± 25.9 261.7 352.5 1.10 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.29123232618000006,
      "stddev": 0.028453783402447315,
      "median": 0.30452540728,
      "user": 0.24090894000000002,
      "system": 0.5863966399999999,
      "min": 0.23979126978,
      "max": 0.32138513778000005,
      "times": [
        0.31145248178,
        0.32138513778000005,
        0.30870027478,
        0.31763221978,
        0.25318247178000003,
        0.23979126978,
        0.30203529978000004,
        0.30701551478,
        0.27836326178000004,
        0.27276532978
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.27358022568000007,
      "stddev": 0.009057775388702215,
      "median": 0.27277375378,
      "user": 0.23674493999999996,
      "system": 0.55229394,
      "min": 0.25945715978,
      "max": 0.29133341378000005,
      "times": [
        0.29133341378000005,
        0.28380511578,
        0.27122511178,
        0.26857213878,
        0.27432239578,
        0.26946533478,
        0.27649139778000004,
        0.27527874478000003,
        0.26585144378000003,
        0.25945715978
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30870308228000004,
      "stddev": 0.012906715655253432,
      "median": 0.31086332778000003,
      "user": 0.2722058399999999,
      "system": 0.5686615399999999,
      "min": 0.28106786278,
      "max": 0.32618456878,
      "times": [
        0.31146719878,
        0.31462922178,
        0.30089011378,
        0.30128574678000003,
        0.32372934978,
        0.31025945678000005,
        0.30412691078000004,
        0.31339039278,
        0.32618456878,
        0.28106786278
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.30118588058000006,
      "stddev": 0.025873736907569608,
      "median": 0.30353426878,
      "user": 0.24039634,
      "system": 0.5786516399999998,
      "min": 0.26172436178,
      "max": 0.35252399178000005,
      "times": [
        0.30754925778000003,
        0.30452413478,
        0.27792917778000004,
        0.26172436178,
        0.35252399178000005,
        0.30254440278,
        0.27966232078000003,
        0.32668208478000005,
        0.30703715978,
        0.29168191378
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.834 ± 0.055 2.755 2.907 1.75 ± 0.17
pacquet@main 2.763 ± 0.057 2.694 2.864 1.70 ± 0.16
pnpr@HEAD 1.641 ± 0.139 1.416 1.844 1.01 ± 0.13
pnpr@main 1.624 ± 0.152 1.438 1.860 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.8341234952,
      "stddev": 0.05450784040336379,
      "median": 2.845504665,
      "user": 2.20485354,
      "system": 1.7367457000000002,
      "min": 2.7545588629999997,
      "max": 2.90709783,
      "times": [
        2.845396605,
        2.897577271,
        2.764841051,
        2.796608489,
        2.88837909,
        2.90709783,
        2.795275212,
        2.7545588629999997,
        2.845887816,
        2.845612725
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.7632717391999995,
      "stddev": 0.056843822647809655,
      "median": 2.7440134325,
      "user": 2.02466564,
      "system": 1.6247719,
      "min": 2.6936447739999996,
      "max": 2.8642117419999997,
      "times": [
        2.7729839849999998,
        2.8642117419999997,
        2.844574428,
        2.800649398,
        2.73230396,
        2.718526533,
        2.726209345,
        2.723890322,
        2.755722905,
        2.6936447739999996
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6406147692000002,
      "stddev": 0.13894935977432707,
      "median": 1.6759346985,
      "user": 1.4077706399999999,
      "system": 1.3863075,
      "min": 1.41573945,
      "max": 1.844406422,
      "times": [
        1.6814514720000002,
        1.41573945,
        1.724961033,
        1.5073976900000001,
        1.671179337,
        1.773010701,
        1.653508189,
        1.68069006,
        1.844406422,
        1.453803338
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.6241325404000002,
      "stddev": 0.1522169919395789,
      "median": 1.65175072,
      "user": 1.2992068399999999,
      "system": 1.2782902999999999,
      "min": 1.4383477470000001,
      "max": 1.8595752150000002,
      "times": [
        1.691980979,
        1.8595752150000002,
        1.698737498,
        1.49257184,
        1.805577369,
        1.711700491,
        1.457755929,
        1.473557875,
        1.611520461,
        1.4383477470000001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 462.6 ± 27.6 417.4 502.7 1.54 ± 0.11
pacquet@main 439.9 ± 31.1 400.4 503.0 1.46 ± 0.12
pnpr@HEAD 308.0 ± 15.9 287.1 334.5 1.02 ± 0.07
pnpr@main 301.1 ± 12.2 286.7 325.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.46261246612000007,
      "stddev": 0.02756209618830837,
      "median": 0.46325042392000004,
      "user": 0.5717246599999999,
      "system": 0.72671738,
      "min": 0.41735897392000004,
      "max": 0.50270823492,
      "times": [
        0.48182367292,
        0.46051659692,
        0.50045518792,
        0.46393829092,
        0.46290344092,
        0.41735897392000004,
        0.50270823492,
        0.46359740692,
        0.43614973592,
        0.43667311992
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.43987447592000006,
      "stddev": 0.0311102126261991,
      "median": 0.43880803092,
      "user": 0.51997366,
      "system": 0.70577558,
      "min": 0.40044186692,
      "max": 0.5029788189200001,
      "times": [
        0.42997108792,
        0.45403381892,
        0.44764497392,
        0.40044186692,
        0.40846921492,
        0.45238026592,
        0.5029788189200001,
        0.46550922992000004,
        0.42622242792000004,
        0.41109305392
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30804050091999996,
      "stddev": 0.015886733810856674,
      "median": 0.30351645592,
      "user": 0.21059055999999998,
      "system": 0.5271669800000001,
      "min": 0.28714714792,
      "max": 0.33446582292,
      "times": [
        0.33446582292,
        0.32447351592,
        0.30588517392000003,
        0.31924702692,
        0.32112413992,
        0.29575578792,
        0.29027736192000003,
        0.30088129392,
        0.30114773792,
        0.28714714792
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.30108147702000004,
      "stddev": 0.012168794929066392,
      "median": 0.29804459692,
      "user": 0.20570125999999997,
      "system": 0.51583468,
      "min": 0.28667414392,
      "max": 0.32542427092000004,
      "times": [
        0.30838891992,
        0.32542427092000004,
        0.29672924592,
        0.30681502892,
        0.29763295192,
        0.29845624192000003,
        0.31202706692,
        0.28667414392,
        0.28680989992,
        0.29185699992
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.883 ± 0.021 1.843 1.913 6.42 ± 0.13
pacquet@main 1.862 ± 0.026 1.827 1.898 6.35 ± 0.14
pnpr@HEAD 0.293 ± 0.005 0.286 0.301 1.00
pnpr@main 0.295 ± 0.008 0.283 0.311 1.00 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.8827372793200001,
      "stddev": 0.02127779833345945,
      "median": 1.8910519484200001,
      "user": 0.8099082599999999,
      "system": 0.79894206,
      "min": 1.84303186792,
      "max": 1.91331223192,
      "times": [
        1.89476879792,
        1.91331223192,
        1.86337542792,
        1.8764611079200002,
        1.89593697492,
        1.8948321859200001,
        1.89700705492,
        1.86131204492,
        1.8873350989200002,
        1.84303186792
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.86170559992,
      "stddev": 0.02618111381954016,
      "median": 1.86262246642,
      "user": 0.8131576599999999,
      "system": 0.7992709600000001,
      "min": 1.82671816192,
      "max": 1.89756131092,
      "times": [
        1.88863370892,
        1.85761687492,
        1.83396625692,
        1.86762805792,
        1.89756131092,
        1.86879564192,
        1.82671816192,
        1.89531542692,
        1.84401900192,
        1.83680155692
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29339649232000004,
      "stddev": 0.005074352854904954,
      "median": 0.29356675342,
      "user": 0.21450205999999997,
      "system": 0.48679046000000004,
      "min": 0.28619537292,
      "max": 0.30092243992,
      "times": [
        0.28640914592,
        0.28619537292,
        0.29734731792,
        0.30011450692,
        0.30092243992,
        0.29393805892,
        0.29352047692,
        0.29178232192000003,
        0.29012225192,
        0.29361302992
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.29485259452000007,
      "stddev": 0.008370737646005606,
      "median": 0.29649192192,
      "user": 0.19746085999999996,
      "system": 0.50772266,
      "min": 0.28315633392,
      "max": 0.31123823492,
      "times": [
        0.31123823492,
        0.28478788692,
        0.28937793192,
        0.29548071292,
        0.29750313092,
        0.28940890992,
        0.28315633392,
        0.29886521692,
        0.29979251092000003,
        0.29891507592
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 226.6 ± 28.4 190.2 294.4 2.54 ± 0.33
pacquet@main 217.1 ± 11.1 203.1 244.0 2.43 ± 0.15
pnpr@HEAD 90.4 ± 3.0 85.3 97.1 1.01 ± 0.05
pnpr@main 89.3 ± 3.2 84.5 96.9 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.22662648839000002,
      "stddev": 0.028385949670368886,
      "median": 0.22475328164000002,
      "user": 0.1727433266666667,
      "system": 0.07007464000000001,
      "min": 0.19016247914,
      "max": 0.29438116514,
      "times": [
        0.23613185814,
        0.23247814414,
        0.29438116514,
        0.25053717414,
        0.19016247914,
        0.21999270514000002,
        0.19799028414,
        0.22951385814,
        0.21338118814,
        0.19694184914,
        0.24138209614,
        0.21662505914000002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.21713233597333337,
      "stddev": 0.011117484940629859,
      "median": 0.21546596064,
      "user": 0.17148774333333336,
      "system": 0.060191473333333335,
      "min": 0.20307133514,
      "max": 0.24399033114000002,
      "times": [
        0.24399033114000002,
        0.22612918314000002,
        0.22123258314000002,
        0.21334547214000002,
        0.21954728314000002,
        0.20533832614,
        0.21648283514,
        0.21444908614000002,
        0.22281479214000002,
        0.20307133514,
        0.21346058714000002,
        0.20572621714
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09041848930129032,
      "stddev": 0.003022287602970595,
      "median": 0.08992667414,
      "user": 0.02061407935483871,
      "system": 0.012699285161290324,
      "min": 0.08530534014,
      "max": 0.09705332514000001,
      "times": [
        0.08947322014,
        0.09377798914,
        0.09140917614,
        0.09426676814,
        0.09204983114,
        0.08976036514,
        0.09052245614,
        0.09528299114000001,
        0.09299006414000001,
        0.09588045214,
        0.08977985214,
        0.08564469914,
        0.09705332514000001,
        0.08719886114,
        0.08806609014,
        0.08907221214,
        0.09186063514000001,
        0.08785607714,
        0.08933198014,
        0.08617014114,
        0.08608732514,
        0.08657270214,
        0.09149474814,
        0.08969130314,
        0.08984650614,
        0.08992667414,
        0.09194822614,
        0.09046694914,
        0.09183235014,
        0.08530534014,
        0.09235385714
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.0892585383521212,
      "stddev": 0.0032361564331979125,
      "median": 0.08870357114,
      "user": 0.02016241757575758,
      "system": 0.012372499393939395,
      "min": 0.08452699214,
      "max": 0.09693234514,
      "times": [
        0.08505133414,
        0.08643616914,
        0.08579207614,
        0.09306247214,
        0.08862369014,
        0.09067733914000001,
        0.08452699214,
        0.08779161114,
        0.09181413714,
        0.08932303914,
        0.09100069614,
        0.09115694814,
        0.09080336014,
        0.09412556014000001,
        0.08760435614,
        0.08720904514,
        0.09618816014,
        0.08649281914,
        0.08974708014,
        0.08797330614,
        0.09008232314,
        0.08607431914000001,
        0.08586820314,
        0.08719692114000001,
        0.08612054914,
        0.08870357114,
        0.08887806414,
        0.09693234514,
        0.09197927014,
        0.09345149314000001,
        0.09242495514,
        0.08500044414,
        0.08741911514
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 518.0 ± 118.5 398.9 770.7 1.02 ± 0.29
pacquet@main 506.0 ± 87.9 391.8 633.3 1.00
pnpm@HEAD 2941.4 ± 107.9 2871.3 3219.0 5.81 ± 1.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.5179963432044444,
      "stddev": 0.11846332350728864,
      "median": 0.46725572676,
      "user": 0.48087900666666666,
      "system": 0.13004951777777776,
      "min": 0.39888526476,
      "max": 0.7707097357600001,
      "times": [
        0.6433134057600001,
        0.44588072376,
        0.7707097357600001,
        0.5477722417600001,
        0.46660484276,
        0.44259957976000003,
        0.46725572676,
        0.47894556776,
        0.39888526476
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.5060022679822223,
      "stddev": 0.08791038059484453,
      "median": 0.52173123576,
      "user": 0.46438533999999987,
      "system": 0.11572118444444444,
      "min": 0.39178746076,
      "max": 0.63325681576,
      "times": [
        0.52173123576,
        0.39178746076,
        0.5993376907600001,
        0.41170380576,
        0.41274566976,
        0.63325681576,
        0.56352906276,
        0.47323209276,
        0.54669657776
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 2.941402729537777,
      "stddev": 0.10790547706247829,
      "median": 2.90275671776,
      "user": 4.224596451111111,
      "system": 0.2907176288888889,
      "min": 2.8712797017600002,
      "max": 3.2190484177600003,
      "times": [
        2.90275671776,
        2.87133479076,
        3.2190484177600003,
        2.92585081976,
        2.9323114027600004,
        2.90106254876,
        2.8712797017600002,
        2.8911927947600002,
        2.95778737176
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.594 ± 0.170 4.426 4.814 1.31 ± 0.06
pacquet@main 4.549 ± 0.168 4.413 4.949 1.30 ± 0.06
pnpr@HEAD 3.549 ± 0.106 3.446 3.807 1.01 ± 0.04
pnpr@main 3.511 ± 0.091 3.456 3.759 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.59381443706,
      "stddev": 0.16955269416349908,
      "median": 4.50539482036,
      "user": 1.9680573399999997,
      "system": 1.43680384,
      "min": 4.42606064036,
      "max": 4.814254908360001,
      "times": [
        4.43101726536,
        4.814254908360001,
        4.76611010536,
        4.45498701936,
        4.468453208360001,
        4.79679222736,
        4.42606064036,
        4.54233643236,
        4.46791202036,
        4.770220543360001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.54866512476,
      "stddev": 0.16803292111271426,
      "median": 4.48087158986,
      "user": 1.95853294,
      "system": 1.50077284,
      "min": 4.4134459693600006,
      "max": 4.94940007836,
      "times": [
        4.69223089936,
        4.44740712536,
        4.44457510036,
        4.54301776536,
        4.94940007836,
        4.618359942360001,
        4.51433605436,
        4.42130562036,
        4.442572692360001,
        4.4134459693600006
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5487670664600004,
      "stddev": 0.10606112831145567,
      "median": 3.5116216408600005,
      "user": 1.34033254,
      "system": 1.24865674,
      "min": 3.4461049473600003,
      "max": 3.8073836353600004,
      "times": [
        3.4932057283600004,
        3.4461049473600003,
        3.8073836353600004,
        3.6131864573600003,
        3.4733573623600003,
        3.4798038953600003,
        3.4879112573600004,
        3.56538166136,
        3.53003755336,
        3.59129816636
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.5113285963600007,
      "stddev": 0.09057316474302597,
      "median": 3.47972223636,
      "user": 1.3369917399999998,
      "system": 1.2656162400000002,
      "min": 3.45643971436,
      "max": 3.75931342236,
      "times": [
        3.4819080333600003,
        3.4679666323600005,
        3.47753643936,
        3.47241557136,
        3.53662894036,
        3.5127973953600002,
        3.75931342236,
        3.45813997836,
        3.45643971436,
        3.49013983636
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13853
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,754.56 ms
(+1.40%)Baseline: 2,716.59 ms
3,259.91 ms
(84.50%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,843.03 ms
(+0.57%)Baseline: 1,832.55 ms
2,199.06 ms
(83.81%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
417.36 ms
(-7.98%)Baseline: 453.54 ms
544.25 ms
(76.69%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
190.16 ms
(-14.41%)Baseline: 222.18 ms
266.62 ms
(71.32%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,446.61 ms
(-1.18%)Baseline: 2,475.79 ms
2,970.94 ms
(82.35%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,426.06 ms
(-2.00%)Baseline: 4,516.61 ms
5,419.93 ms
(81.66%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
239.79 ms
(-17.98%)Baseline: 292.36 ms
350.84 ms
(68.35%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
398.89 ms
(-39.99%)Baseline: 664.74 ms
797.69 ms
(50.00%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13853
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,415.74 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
286.20 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
287.15 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
85.31 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,424.87 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,446.10 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
281.07 ms
🐰 View full continuous benchmarking report in Bencher

…hange

The first cut withheld the lockfile pin and skipped the frozen shortcut for
any `add <pkg>@<version>`, which defeated the resolution reuse added in
#13807: adding a version the lockfile already holds resolved the
graph again instead of reporting the lockfile up to date.

The trigger is now the case that needs it — the dependency resolves through
a catalog entry that covers the wanted version but is recorded at a
different one. An add that isn't cataloged, whose entry already resolves to
the wanted version, or whose entry excludes it, keeps every pin and the
frozen shortcut. The predicates behind that decision are the ones the
catalog-mode gate already uses, so the two agree by construction.

The withheld pin is also bounded to direct dependencies now: a catalog entry
governs those, and transitive occurrences of the same package have no reason
to lose their resolutions.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings August 12, 2026 09:34

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 reached their quota limit.

Comment thread pnpm/crates/package-manager/src/add.rs Resolved
@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Aug 12, 2026
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 7da1fd8

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

@codecov-commenter

codecov-commenter commented Aug 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.26%. Comparing base (286d7ea) to head (6ba0191).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/package-manager/src/add.rs 86.08% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13853      +/-   ##
==========================================
+ Coverage   88.25%   88.26%   +0.01%     
==========================================
  Files         627      627              
  Lines      103341   103550     +209     
==========================================
+ Hits        91203    91402     +199     
- Misses      12138    12148      +10     

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

The seed policy was workspace-wide, so a project the command never named
lost the pin for that package and re-resolved: a sibling declaring the same
package directly was rewritten as a side effect. It is now a per-importer
policy covering only the projects being added to, matching how a filtered
update scopes its own seed, and the preferred version rides along with
those importers instead of being layered onto the workspace seed.

The regression test adds an untargeted project that declares the package
directly and asserts its resolution survives.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings August 12, 2026 10:03

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 reached their quota limit.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 12, 2026
Comment thread pnpm/crates/package-manager/src/add.rs Resolved
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 6ec7dd2

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

🧹 Nitpick comments (1)
pnpm/crates/cli/tests/suite/catalog.rs (1)

481-570: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Add matching TypeScript CLI regression tests for catalog resolution.

Existing TypeScript tests cover catalog helpers and manifest writing, but not CLI add, CLI update, or filtered-importer isolation. Add equivalent scenarios before merge.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/tests/suite/catalog.rs` around lines 481 - 570, Add
equivalent TypeScript CLI regression tests for the Rust scenarios in
add_moves_a_catalog_locked_on_another_version,
update_moves_a_catalog_to_an_older_in_range_version, and
add_moving_a_catalog_leaves_an_untargeted_project_alone. Cover catalog
resolution changes through CLI add and update, preserve the catalog: dependency
spec, and verify a filtered add changes only the targeted importer while the
untargeted project retains its resolution.

Sources: Coding guidelines, Path instructions, Learnings

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@pnpm/crates/cli/tests/suite/catalog.rs`:
- Around line 481-570: Add equivalent TypeScript CLI regression tests for the
Rust scenarios in add_moves_a_catalog_locked_on_another_version,
update_moves_a_catalog_to_an_older_in_range_version, and
add_moving_a_catalog_leaves_an_untargeted_project_alone. Cover catalog
resolution changes through CLI add and update, preserve the catalog: dependency
spec, and verify a filtered add changes only the targeted importer while the
untargeted project retains its resolution.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c0b997de-75c6-4026-9734-70edfcc4fcda

📥 Commits

Reviewing files that changed from the base of the PR and between 7da1fd8 and 6ec7dd2.

📒 Files selected for processing (3)
  • pnpm/crates/cli/tests/suite/catalog.rs
  • pnpm/crates/package-manager/src/add.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile/resolve.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile/resolve.rs
  • pnpm/crates/package-manager/src/add.rs

Importer ids are relative to the directory the lockfile sits in, which is
the workspace root only while one lockfile is shared. The policy keyed
against the workspace root regardless, so under `sharedWorkspaceLockfile:
false` it named no importer and did nothing at all: the pin stayed, the
entry kept its recorded resolution, and the wanted version was dropped
again — the very bug this branch fixes, in the configuration it missed.

The root is now derived the way the install derives it, in both add paths,
and a test covers a project that keeps its own lockfile.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings August 12, 2026 10:42
@greptile-apps
greptile-apps Bot dismissed their stale review August 12, 2026 10:42

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

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 reached their quota limit.

greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 12, 2026
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 7962e4a

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

…comma

Caught by the dylint gate in CI, not locally: a stale lint library meant the
run here reported the crate clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings August 12, 2026 10:53
@greptile-apps
greptile-apps Bot dismissed their stale review August 12, 2026 10:53

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

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 reached their quota limit.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 6ba0191

@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 d96974d into main Aug 12, 2026
34 checks passed
@zkochan
zkochan deleted the fix/pacquet-catalog-locked-version-noop branch August 12, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet product: pnpr reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants