Skip to content

fix(update): write the new range back to package.json - #13882

Merged
zkochan merged 5 commits into
mainfrom
fix-13879
Aug 13, 2026
Merged

zkochan merged 5 commits into
mainfrom
fix-13879

Conversation

@zkochan

@zkochan zkochan commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

Summary

pnpm update re-resolved pnpm-lock.yaml but left package.json declaring the range it started from, so a dependency the output reported as updated still read as its old version in the manifest (#13879). The TypeScript CLI rewrites the declared range around the version it resolved; the Rust CLI did not.

This makes the Rust CLI match. Verified byte-for-byte against [email protected] on a fixture covering ^, ~, =, exact pins, >=, 1.x, *, a || b, npm: aliases, dist-tags, workspace:, link:, file:, git shorthands, catalog: entries, and a filtered workspace update.

Why the range is computed after resolving, not before. --latest can write its range up front because a dist-tag names a version on its own. A compatible bump cannot: the version depends on the ranges the workspace's other importers declare, on the overrides, and on the peer graph. Pre-resolving each dependency on its own (the first shape I tried) disagreed with the install often enough to leave the manifest and the lockfile out of sync — it broke filtered_compatible_update_keeps_workspace_manifest_preferences, where an unselected project's pin holds the shared version down, and pnpm@11 agrees with the existing test. It also added one registry round trip per direct dependency to the common path.

So the update names the direct dependencies it targets (ManifestSpecBumps), the fresh-resolve path moves their ranges onto what it settled on — in the lockfile it is about to write — and reports each one back for the package.json / pnpm-workspace.yaml write. The two carry the same text, and the version recorded against it satisfies it by construction, so --frozen-lockfile still passes right after an update. No extra resolution or network.

Left alone: dist-tags (they already track the newest version), workspace: / link: / file: / git / tarball / jsr: / named-registry declarations, and anything under --no-save. A catalog: reference moves the catalog entry rather than the manifest entry, matching pnpm update -r on the TypeScript side.

Also fixes two adjacent bugs this surfaced:

  • pnpm update --latest was rewriting "foo": "latest" to "^3.0.1". A dist-tag now keeps tracking its tag under both update modes.
  • The manifest write went through add_dependency, which moves an alias into the target group by deleting it from the others — add's semantics, not an update's. A manifest declaring the same alias in two groups had one silently dropped. The range is now written in place, in the group the lockfile entry was read from.

TypeScript CLI: no change needed — this is the behavior it already has.

Closes #13879

Squash Commit Body

`pnpm update` re-resolved the lockfile but left `package.json` declaring
the range it started from, so a dependency the output reported as updated
still read as its old version in the manifest — unlike the TypeScript CLI,
which rewrites the declared range around the version it resolved.

A compatible bump cannot name that version before resolving: the pick
depends on the ranges the workspace's other importers declare, on the
overrides, and on the peer graph. Guessing it up front (the way `--latest`
reads a dist-tag) would disagree with the install often enough to leave the
manifest and the lockfile out of sync. So the update names the direct
dependencies it targets, and the fresh-resolve path moves their ranges onto
what it settled on, in the lockfile it is about to write, and reports each
one back for the manifest write. The two carry the same text, and the
version recorded against it satisfies it by construction.

A dependency declared through a dist-tag now keeps tracking the tag under
`--latest` too, which had been pinning it to the version behind the tag.

The importer ids the rewrite is keyed by come from the same
`lockfile_root_dir` rule the install derives its own from, so
`sharedWorkspaceLockfile: false` — which anchors them at the project rather
than the workspace root — does not leave the range unwritten. The group a
range is declared under travels with it from the lockfile entry, so an alias
declared in more than one group cannot have the manifest and the lockfile
move different entries, and the range is written in place rather than through
`add_dependency`, which would relocate the dependency.

Closes pnpm/pnpm#13879

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.

Written by an agent (Claude Code, claude-opus-5[1m]).


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

  • New Features

    • pnpm update now writes updated dependency ranges to package.json and relevant catalog: entries.
    • Compatible updates refresh catalog ranges while preserving frozen-install compatibility.
    • Existing range operators, aliases, selectors, and dependency groupings are preserved.
    • --latest retains dist-tag declarations instead of replacing them with fixed versions.
  • Bug Fixes

    • Improved handling of workspace updates, dedicated lockfiles, prereleases, unsupported protocols, and dependency aliases.
    • --no-save behavior remains unchanged.

`pnpm update` re-resolved the lockfile but left `package.json` declaring
the range it started from, so a dependency the output reported as updated
still read as its old version in the manifest — unlike the TypeScript CLI,
which rewrites the declared range around the version it resolved.

A compatible bump cannot name that version before resolving: the pick
depends on the ranges the workspace's other importers declare, on the
overrides, and on the peer graph. Guessing it up front (the way `--latest`
reads a dist-tag) would disagree with the install often enough to leave the
manifest and the lockfile out of sync. So the update names the direct
dependencies it targets, and the fresh-resolve path moves their ranges onto
what it settled on, in the lockfile it is about to write, and reports each
one back for the manifest write. The two carry the same text, and the
version recorded against it satisfies it by construction.

A dependency declared through a dist-tag now keeps tracking the tag under
`--latest` too, which had been pinning it to the version behind the tag.

Closes #13879
Copilot AI lite review requested due to automatic review settings August 12, 2026 22:04

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: e80f3bd7-4408-41d1-8e78-81341a242e4d

📥 Commits

Reviewing files that changed from the base of the PR and between 81d18e7 and 151e942.

📒 Files selected for processing (7)
  • pnpm/crates/cli/tests/suite/update.rs
  • pnpm/crates/package-manager/src/install.rs
  • pnpm/crates/package-manager/src/install/run.rs
  • pnpm/crates/package-manager/src/install/workspace_state.rs
  • pnpm/crates/package-manager/src/manifest_spec_bumps.rs
  • pnpm/crates/package-manager/src/update.rs
  • pnpm/crates/package-manager/src/update/tests.rs
🚧 Files skipped from review as they are similar to previous changes (4)
  • pnpm/crates/package-manager/src/install/run.rs
  • pnpm/crates/package-manager/src/install.rs
  • pnpm/crates/cli/tests/suite/update.rs
  • pnpm/crates/package-manager/src/update.rs

📝 Walkthrough

Walkthrough

pnpm update now persists compatible resolved versions in manifest and catalog ranges while preserving operators, aliases, tags, selectors, and unsupported protocols. The install pipeline carries bump data through lockfile generation, with coverage for workspace, catalog, frozen-lockfile, and --no-save cases.

Changes

Update range persistence

Layer / File(s) Summary
Range bump engine
pnpm/crates/package-manager/src/manifest_spec_bumps.rs, pnpm/crates/package-manager/src/manifest_spec_bumps/tests.rs, pnpm/crates/package-manager/src/lib.rs
Adds manifest and catalog range recalculation, alias handling, protocol filtering, lockfile updates, applied-result tracking, and unit tests.
Update target tracking and persistence
pnpm/crates/package-manager/src/update.rs, pnpm/crates/package-manager/src/update/tests.rs
Tracks direct dependency targets, passes per-importer bump state through updates, persists changed manifests and catalogs, preserves dependency groups, and retains dist-tags.
Install pipeline propagation
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/workspace_state.rs, pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
Carries optional manifest bumps through standard, selected, materializing, and fresh-lockfile install paths, including dedicated lockfile root selection.
Update regression coverage and release note
pnpm/crates/cli/tests/suite/update.rs, .changeset/update-writes-the-new-range.md
Tests range operators, selectors, tags, catalogs, frozen installs, and --no-save; documents the persistence behavior.

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

Mergeability Score: ⚪ Minimal · up to 151e9

This updates the Rust CLI to write resolved dependency ranges back to manifests while preserving supported declaration forms; no actionable merge-blocking risk remains beyond normal checks and review.

Possibly related issues

Possibly related PRs

Suggested labels: product: pacquet

Suggested reviewers: greptile-apps

Sequence Diagram(s)

sequenceDiagram
  participant Update
  participant Install
  participant Lockfile
  participant ManifestSpecBumps
  participant Manifest
  Update->>Install: pass dependency bump targets
  Install->>Lockfile: resolve packages and build lockfile
  Lockfile->>ManifestSpecBumps: apply resolved versions
  ManifestSpecBumps-->>Update: return applied manifest and catalog ranges
  Update->>Manifest: persist changed ranges
Loading
✨ 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-13879

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 pnpm update to persist resolved ranges back to package.json

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Rewrite updated direct-dependency ranges in manifests to match the fresh lockfile resolve.
• Preserve existing range operators and keep dist-tags (e.g. "latest") tracking their tag.
• Add regression coverage for selectors, --no-save, and catalog: updates.
Diagram

graph TD
  upd["pacquet update"] --> prep["prepare_manifest(s)"] --> bumps["ManifestSpecBumps"] --> install["Install (fresh lockfile)"] --> lock[("pnpm-lock.yaml")]
  lock --> apply["apply_manifest_spec_bumps"] --> manifest[("package.json / workspace catalog")]
  bumps --> apply
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Pre-resolve each direct dependency before install
  • ➕ Can compute manifest ranges up-front without touching lockfile importer specifiers
  • ➖ Adds extra registry round trips per dependency in the common path
  • ➖ Often disagrees with the actual workspace/peer/override-constrained install result, risking manifest/lockfile divergence
2. Update manifests from the final picked versions without rewriting lockfile specifiers
  • ➕ Avoids mutating lockfile importer specifier text during lockfile build
  • ➖ Lockfile importer specifiers may no longer match the manifest text, weakening immediate --frozen-lockfile consistency guarantees after update
3. Centralize range-calculation in the resolver layer and reuse it from update/install
  • ➕ Single source of truth for specifier rendering across flows
  • ➖ Requires broader refactor and API surface changes across crates compared to the targeted ManifestSpecBumps hook

Recommendation: Keep the PR’s current approach: compute the final ranges after the fresh resolve, rewrite the lockfile importer specifiers before writing, and report the same strings back for manifest/catalog persistence. This avoids extra network calls, matches the actual resolved graph (workspace/peers/overrides), and preserves the invariant that a post-update --frozen-lockfile install succeeds because lockfile and manifests agree by construction.

Files changed (10) +639 / -26

Enhancement (4) +39 / -0
install.rsThread optional manifest-spec bump context through install entrypoints +32/-0

Thread optional manifest-spec bump context through install entrypoints

• Extends 'InstallRunOptions' to carry an optional 'ManifestSpecBumps' reference. Adds 'run_with_manifest_spec_bumps' and 'run_selected_with_manifest_spec_bumps' helper APIs used by 'pacquet update'.

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

materialize.rsPlumb 'manifest_spec_bumps' into materialization inputs +3/-0

Plumb 'manifest_spec_bumps' into materialization inputs

• Adds 'manifest_spec_bumps' to 'MaterializationInputs' and propagates it into the install pipeline so the fresh-lockfile path can apply rewrites.

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

run.rsPass manifest-spec bump option into the materialize phase +2/-0

Pass manifest-spec bump option into the materialize phase

• Threads the new 'manifest_spec_bumps' option from the install runner into 'materialize', enabling post-resolve lockfile specifier adjustments when requested.

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

lib.rsExport new 'manifest_spec_bumps' module APIs +2/-0

Export new 'manifest_spec_bumps' module APIs

• Registers the new module and re-exports 'ManifestSpecBumps' and 'AppliedSpecBumps' for use by the update flow.

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

Bug fix (3) +390 / -25
install_with_fresh_lockfile.rsApply manifest spec bumps during fresh lockfile build +18/-3

Apply manifest spec bumps during fresh lockfile build

• Introduces an optional 'manifest_spec_bumps' hook on the fresh-lockfile install path. After building/merging the lockfile, applies specifier rewrites and records applied bumps for later persistence.

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

manifest_spec_bumps.rsImplement post-resolve range rewriting for targeted direct dependencies +221/-0

Implement post-resolve range rewriting for targeted direct dependencies

• Adds 'ManifestSpecBumps' and 'AppliedSpecBumps' plus logic to rewrite lockfile importer (or catalog entry) specifiers based on resolved versions while preserving declared operator style. Skips dist-tags and non-registry protocols, handles 'npm:' alias wrapping, and pins prereleases exactly.

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

update.rsCollect bump targets during update and persist applied ranges to manifests/catalogs +151/-22

Collect bump targets during update and persist applied ranges to manifests/catalogs

• Extends update preparation to record which direct dependencies should have their ranges rewritten after the resolve (compatible updates, selectors, save modes). Runs install with 'ManifestSpecBumps', applies returned specifier changes to 'package.json' and writes updated workspace catalogs when applicable, and fixes '--latest' to keep dist-tag specifiers unchanged.

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

Tests (2) +205 / -1
update.rsAdd regression tests for manifest range rewrites and dist-tag/catalog behavior +118/-1

Add regression tests for manifest range rewrites and dist-tag/catalog behavior

• Updates existing compatible-update expectations to assert the manifest range is rewritten (and remains frozen-installable). Adds new tests covering operator preservation, dist-tag retention under both update modes, selector scoping, '--no-save', and compatible 'catalog:' bumps.

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

tests.rsUnit tests for range bump calculation and protocol exclusions +87/-0

Unit tests for range bump calculation and protocol exclusions

• Adds focused tests for operator preservation, default-style fallback, dist-tag passthrough, prerelease pinning, 'npm:' alias splitting/rewrapping, protocol exclusions, and peer-suffix dropping.

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

Documentation (1) +5 / -0
update-writes-the-new-range.mdAdd changeset documenting manifest range persistence on update +5/-0

Add changeset documenting manifest range persistence on update

• Introduces a patch changeset explaining that 'pnpm update' now writes the resolved range back to 'package.json' (or the referenced 'catalog:' entry). Notes operator preservation and dist-tag tracking behavior.

.changeset/update-writes-the-new-range.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 (3): Last reviewed commit: "style(update): add the trailing comma th..." | Re-trigger Greptile

Comment thread pnpm/crates/cli/tests/suite/update.rs Resolved
The doc comments on the new update tests, and the range-operator
enumeration on `bumped_range`, narrated behavior the test names and
assertions already carry. Each keeps only the rationale a reader cannot
recover from the code.

Also narrow the lockfile-side range rewrite to the dependency group the
range was read from, so a dependency declared in more than one group can
never have an unread declaration overwritten.
Copilot AI review requested due to automatic review settings August 12, 2026 22:09

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

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.

Actionable comments posted: 2

🧹 Nitpick comments (3)
pnpm/crates/cli/tests/suite/update.rs (2)

184-195: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert that the dist-tag tests still observe an update.

Both tests assert only that the manifest specifier is unchanged. A regression that makes update skip the dependency entirely would also satisfy that assertion. Add a resolved-version assertion so each test proves two things: the tag stays, and the dependency still moved.

update_bumps_within_range already uses virtual_store_has for this purpose.

💚 Proposed assertion for `update_keeps_a_dist_tag_specifier`
     pacquet(&workspace, ["update"]).assert().success();
 
     assert_eq!(dep_spec(&workspace, DEP).as_deref(), Some("latest"));
+    eprintln!("virtual store contents: {:?}", list_virtual_store(&workspace));
+    assert!(
+        virtual_store_has(&workspace, "`@pnpm.e2e`[email protected]"),
+        "the tag must keep tracking the version it points at",
+    );

Apply the equivalent assertion in update_latest_keeps_a_dist_tag_specifier. Use the version the mocked registry advertises as latest.

Also applies to: 423-434

🤖 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/update.rs` around lines 184 - 195, Update the
tests update_keeps_a_dist_tag_specifier and
update_latest_keeps_a_dist_tag_specifier to retain their existing dist-tag
assertions and additionally verify the resolved dependency version via
virtual_store_has, using the mocked registry’s latest version to prove update
actually occurred.

1065-1066: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert that the old catalog range is gone.

yaml.contains("^100.1.0") passes when the writer appends a second entry and leaves ^100.0.0 in place. Add the negative assertion so the test proves the entry moved rather than grew.

💚 Proposed assertion
     let yaml = read_workspace_yaml(&workspace);
     assert!(yaml.contains("^100.1.0"), "catalog entry should be bumped to ^100.1.0: {yaml}");
+    assert!(!yaml.contains("^100.0.0"), "the previous catalog range should be replaced: {yaml}");
🤖 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/update.rs` around lines 1065 - 1066, Update the
assertions in the workspace YAML verification test around read_workspace_yaml so
they also confirm the old ^100.0.0 catalog range is absent, while retaining the
existing assertion for ^100.1.0.
pnpm/crates/package-manager/src/manifest_spec_bumps.rs (1)

185-196: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use is_valid_semver_range for npm-alias body detection.

Import it from pacquet_resolving_resolver_base and replace rest.parse::<Range>().is_ok(). This keeps npm-alias disambiguation consistent with the shared strict semver-range policy.

🤖 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/package-manager/src/manifest_spec_bumps.rs` around lines 185 -
196, Update split_npm_alias to import and use is_valid_semver_range from
pacquet_resolving_resolver_base when detecting bare npm range bodies, replacing
the direct rest.parse::<Range>().is_ok() check while preserving the existing
alias splitting behavior.

Source: 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.

Inline comments:
In `@pnpm/crates/package-manager/src/update.rs`:
- Around line 337-347: The importer ID and workspace root calculations in
pnpm/crates/package-manager/src/update.rs:337-347 and
pnpm/crates/package-manager/src/update.rs:462-464 must follow the same rule as
Install::run_inner, including shared_workspace_lockfile handling and workspace
discovery when workspace_dir is unset. Extract and reuse a shared helper for
this rule, then use it in both update paths so ManifestSpecBumps.targets,
prepare_selected_manifests, and the per-project lookup derive consistent
importer IDs.
- Around line 395-401: Update the manifest update flow around
apply_bumped_manifest_specs so that, for bump-only updates where
should_persist_manifest is false, the initial manifest event is emitted before
applying the bump mutations. Preserve the existing persistence behavior and
ensure normal updates do not emit duplicate initial events.

---

Nitpick comments:
In `@pnpm/crates/cli/tests/suite/update.rs`:
- Around line 184-195: Update the tests update_keeps_a_dist_tag_specifier and
update_latest_keeps_a_dist_tag_specifier to retain their existing dist-tag
assertions and additionally verify the resolved dependency version via
virtual_store_has, using the mocked registry’s latest version to prove update
actually occurred.
- Around line 1065-1066: Update the assertions in the workspace YAML
verification test around read_workspace_yaml so they also confirm the old
^100.0.0 catalog range is absent, while retaining the existing assertion for
^100.1.0.

In `@pnpm/crates/package-manager/src/manifest_spec_bumps.rs`:
- Around line 185-196: Update split_npm_alias to import and use
is_valid_semver_range from pacquet_resolving_resolver_base when detecting bare
npm range bodies, replacing the direct rest.parse::<Range>().is_ok() check while
preserving the existing alias splitting behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 015182f0-9e26-4882-a618-e25e0b3be1ff

📥 Commits

Reviewing files that changed from the base of the PR and between e240d17 and 33991a6.

📒 Files selected for processing (10)
  • .changeset/update-writes-the-new-range.md
  • pnpm/crates/cli/tests/suite/update.rs
  • 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/lib.rs
  • pnpm/crates/package-manager/src/manifest_spec_bumps.rs
  • pnpm/crates/package-manager/src/manifest_spec_bumps/tests.rs
  • pnpm/crates/package-manager/src/update.rs

greptile-apps[bot]
greptile-apps Bot previously approved these changes Aug 12, 2026
@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. Importer ID root mismatch ✓ Resolved 🐞 Bug ≡ Correctness
Description
Update::run keys ManifestSpecBumps.targets by an importer id computed relative to
config.workspace_dir, but when sharedWorkspaceLockfile=false the install pipeline anchors
importer ids at manifest_dir (so the lockfile importer key is typically "."). Because
apply_manifest_spec_bumps silently skips unknown importer ids, dedicated-lockfile updates will not
rewrite manifest/catalog ranges, leaving the original behavior unfixed in that configuration.
Code

pnpm/crates/package-manager/src/update.rs[R335-340]

+        let manifest_dir =
+            manifest.path().parent().expect("manifest path always has a parent dir").to_path_buf();
+        let importer_id = pacquet_workspace::importer_id_from_root_dir(
+            config.workspace_dir.as_deref().unwrap_or(&manifest_dir),
+            &manifest_dir,
+        );
Relevance

●●● Strong

Accepted precedent fixing importer-id root mismatches for sharedWorkspaceLockfile=false; same
failure mode likely applies here.

PR-#13853

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
update.rs computes bump targets keyed by an importer id derived from config.workspace_dir, while
install/run.rs shows that in sharedWorkspaceLockfile=false mode the effective workspace_root
becomes manifest_dir, which implies the lockfile’s root importer id is ".". Since
apply_manifest_spec_bumps looks up lockfile.importers by the provided importer id and silently
continues when missing, the mismatched key prevents any bump from being applied and reported back to
the update command.

pnpm/crates/package-manager/src/update.rs[335-345]
pnpm/crates/package-manager/src/install/run.rs[138-155]
pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[86-92]
pnpm/crates/package-manager/src/manifest_spec_bumps.rs[63-71]
PR-#13853

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

## Issue description
`ManifestSpecBumps.targets` is keyed by an importer id derived from `config.workspace_dir` in `pnpm/crates/package-manager/src/update.rs`. However, the installer computes lockfile importer ids relative to the *effective* `workspace_root` (lockfile root), which becomes `manifest_dir` when `sharedWorkspaceLockfile=false`. This mismatch causes `apply_manifest_spec_bumps()` to skip the intended importer and produce no applied bumps.

## Issue Context
- In dedicated-lockfile mode, the lockfile importer for the active project is keyed as `"."` (root importer).
- `apply_manifest_spec_bumps()` uses `lockfile.importers.get(importer_id)` and `continue`s if the key is absent, so the failure is silent.

## Fix Focus Areas
- pnpm/crates/package-manager/src/update.rs[335-345]
- pnpm/crates/package-manager/src/update.rs[460-575]
- pnpm/crates/package-manager/src/install/run.rs[138-155]
- pnpm/crates/cli/tests/suite/update.rs[145-225]

## Implementation guidance
1. Compute the importer-id root in `Update::run` the same way `Install::run_inner` does:
  - If `config.shared_workspace_lockfile` is `true`, use the workspace root (configured/discovered).
  - If `false`, use `manifest_dir` as the root (so the importer id becomes `"."`).
2. Apply the same alignment in the selected-workspace update path (`run_selected`), or explicitly avoid the multi-importer install path when `sharedWorkspaceLockfile=false` (if the installer already splits runs per project, ensure the bump sink keys match those per-project lockfiles).
3. Add a regression test for `pnpm update` with `sharedWorkspaceLockfile=false` asserting that `package.json` (or the catalog entry) is rewritten and that `install --frozen-lockfile` succeeds immediately after.

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



Remediation recommended

2. Changeset missing pnpm entry 📘 Rule violation § Compliance
Description
The new changeset lists only pacquet, but the checklist requires an explicit pnpm bump entry.
This can cause the pnpm release/versioning pipeline to miss this user-visible fix.
Code

.changeset/update-writes-the-new-range.md[R1-3]

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

●●● Strong

Recent accepted reviews require adding explicit pnpm bump entry in changeset front-matter.

PR-#13748
PR-#13403

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires changeset front-matter to include a pnpm entry with a valid bump
type. The added changeset front-matter currently contains only pacquet: patch and omits pnpm.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/update-writes-the-new-range.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 file does not declare a bump for the `pnpm` package.

## Issue Context
Per compliance, each new/modified changeset must include an explicit `pnpm` entry with a valid bump type (`patch`/`minor`/`major`). This PR adds `.changeset/update-writes-the-new-range.md` but its front-matter lists only `pacquet`.

## Fix Focus Areas
- .changeset/update-writes-the-new-range.md[1-3]

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



Informational

3. Quadratic persist checks 🐞 Bug ➹ Performance ⭐ New
Description
In Update::run_selected, persist_indices.contains(&index) is called inside a loop over all projects;
since persist_indices is a Vec, this can degrade to O(P×I) (worst-case quadratic) in large
workspaces during manifest bump application.
Code

pnpm/crates/package-manager/src/update.rs[R565-568]

+                let Some(bumped) = applied.manifests.get(&importer_id) else { continue };
+                let already_persisting = persist_indices.contains(&index);
+                if apply_bumped_manifest_specs::<Reporter>(
+                    &mut project.manifest,
Relevance

● Weak

Similar “replace linear scan with HashSet to avoid O(n*m)” perf suggestions were previously rejected
as unnecessary micro-optimizations.

PR-#13790
PR-#13698

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The post-install bump loop performs Vec::contains for each bumped project, and persist_indices is
defined as a Vec, making membership checks linear per iteration.

pnpm/crates/package-manager/src/update.rs[559-575]
pnpm/crates/package-manager/src/update.rs[609-615]

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

## Issue description
`Update::run_selected` builds `persist_indices` as a `Vec<usize>` and then, while iterating over all projects, repeatedly calls `persist_indices.contains(&index)` to decide whether to emit the initial manifest and whether to push a new index. This introduces an avoidable O(P×I) cost that can become quadratic when many projects are involved.

## Issue Context
This logic runs after the install completes and applies post-resolve manifest spec bumps. Large workspaces (many projects) combined with many rewritten manifests can make this membership check hot.

## Fix Focus Areas
- pnpm/crates/package-manager/src/update.rs[559-575]
- pnpm/crates/package-manager/src/update.rs[609-615]

## Suggested fix
Maintain a `HashSet<usize>` alongside the `Vec<usize>`:
- Initialize `persist_set` from `prepared.persist_indices`.
- Replace `persist_indices.contains(&index)` with `persist_set.contains(&index)`.
- When adding a new index, do `if persist_set.insert(index) { persist_indices.push(index); }`.

This keeps stable ordering for persistence while making membership checks O(1) average-case and preventing duplicates.

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


Grey Divider

Context
✅ Compliance rules (platform): 26 rules

Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous review results

Review updated until commit 151e942

Results up to commit 81d18e7 ⚖️ Balanced


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


Action required
1. Importer ID root mismatch ✓ Resolved 🐞 Bug ≡ Correctness
Description
Update::run keys ManifestSpecBumps.targets by an importer id computed relative to
config.workspace_dir, but when sharedWorkspaceLockfile=false the install pipeline anchors
importer ids at manifest_dir (so the lockfile importer key is typically "."). Because
apply_manifest_spec_bumps silently skips unknown importer ids, dedicated-lockfile updates will not
rewrite manifest/catalog ranges, leaving the original behavior unfixed in that configuration.
Code

pnpm/crates/package-manager/src/update.rs[R335-340]

+        let manifest_dir =
+            manifest.path().parent().expect("manifest path always has a parent dir").to_path_buf();
+        let importer_id = pacquet_workspace::importer_id_from_root_dir(
+            config.workspace_dir.as_deref().unwrap_or(&manifest_dir),
+            &manifest_dir,
+        );
Relevance

●●● Strong

Accepted precedent fixing importer-id root mismatches for sharedWorkspaceLockfile=false; same
failure mode likely applies here.

PR-#13853

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
update.rs computes bump targets keyed by an importer id derived from config.workspace_dir, while
install/run.rs shows that in sharedWorkspaceLockfile=false mode the effective workspace_root
becomes manifest_dir, which implies the lockfile’s root importer id is ".". Since
apply_manifest_spec_bumps looks up lockfile.importers by the provided importer id and silently
continues when missing, the mismatched key prevents any bump from being applied and reported back to
the update command.

pnpm/crates/package-manager/src/update.rs[335-345]
pnpm/crates/package-manager/src/install/run.rs[138-155]
pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[86-92]
pnpm/crates/package-manager/src/manifest_spec_bumps.rs[63-71]
PR-#13853

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

## Issue description
`ManifestSpecBumps.targets` is keyed by an importer id derived from `config.workspace_dir` in `pnpm/crates/package-manager/src/update.rs`. However, the installer computes lockfile importer ids relative to the *effective* `workspace_root` (lockfile root), which becomes `manifest_dir` when `sharedWorkspaceLockfile=false`. This mismatch causes `apply_manifest_spec_bumps()` to skip the intended importer and produce no applied bumps.

## Issue Context
- In dedicated-lockfile mode, the lockfile importer for the active project is keyed as `"."` (root importer).
- `apply_manifest_spec_bumps()` uses `lockfile.importers.get(importer_id)` and `continue`s if the key is absent, so the failure is silent.

## Fix Focus Areas
- pnpm/crates/package-manager/src/update.rs[335-345]
- pnpm/crates/package-manager/src/update.rs[460-575]
- pnpm/crates/package-manager/src/install/run.rs[138-155]
- pnpm/crates/cli/tests/suite/update.rs[145-225]

## Implementation guidance
1. Compute the importer-id root in `Update::run` the same way `Install::run_inner` does:
  - If `config.shared_workspace_lockfile` is `true`, use the workspace root (configured/discovered).
  - If `false`, use `manifest_dir` as the root (so the importer id becomes `"."`).
2. Apply the same alignment in the selected-workspace update path (`run_selected`), or explicitly avoid the multi-importer install path when `sharedWorkspaceLockfile=false` (if the installer already splits runs per project, ensure the bump sink keys match those per-project lockfiles).
3. Add a regression test for `pnpm update` with `sharedWorkspaceLockfile=false` asserting that `package.json` (or the catalog entry) is rewritten and that `install --frozen-lockfile` succeeds immediately after.

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



Remediation recommended
2. Changeset missing pnpm entry 📘 Rule violation § Compliance
Description
The new changeset lists only pacquet, but the checklist requires an explicit pnpm bump entry.
This can cause the pnpm release/versioning pipeline to miss this user-visible fix.
Code

.changeset/update-writes-the-new-range.md[R1-3]

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

●●● Strong

Recent accepted reviews require adding explicit pnpm bump entry in changeset front-matter.

PR-#13748
PR-#13403

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires changeset front-matter to include a pnpm entry with a valid bump
type. The added changeset front-matter currently contains only pacquet: patch and omits pnpm.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/update-writes-the-new-range.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 file does not declare a bump for the `pnpm` package.

## Issue Context
Per compliance, each new/modified changeset must include an explicit `pnpm` entry with a valid bump type (`patch`/`minor`/`major`). This PR adds `.changeset/update-writes-the-new-range.md` but its front-matter lists only `pacquet`.

## Fix Focus Areas
- .changeset/update-writes-the-new-range.md[1-3]

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

@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/package-manager/src/manifest_spec_bumps.rs (1)

124-126: 🗄️ Data Integrity & Integration | 🔵 Trivial | 🏗️ Heavy lift

Keep the dependency-group identity in the applied result.

manifests stores (DependencyGroupIndex, String), but render_aliases removes the group index before applied.manifests reaches pnpm/crates/package-manager/src/update.rs:1103-1106, where the group is selected again from only the alias.

If an alias exists in multiple groups, any precedence difference between declared_dependency and declared_group can update different groups in the lockfile and manifest. Preserve the group in the applied result, or share one group-selection helper. Add a regression case with the same alias in dependencies, devDependencies, and optionalDependencies.

As per path instructions: “Review this user-visible update behavior for pnpm/pacquet parity, scope discipline, and manifest/lockfile correctness.”

Also applies to: 198-221

🤖 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/package-manager/src/manifest_spec_bumps.rs` around lines 124 -
126, Preserve the DependencyGroupIndex when assigning applied.manifests instead
of stripping it through render_aliases, or reuse a shared group-selection helper
with update.rs. Ensure manifest and lockfile updates select the same group when
an alias appears in multiple groups. Add a regression case covering the alias in
dependencies, devDependencies, and optionalDependencies.

Source: Path instructions

🤖 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/package-manager/src/manifest_spec_bumps.rs`:
- Around line 124-126: Preserve the DependencyGroupIndex when assigning
applied.manifests instead of stripping it through render_aliases, or reuse a
shared group-selection helper with update.rs. Ensure manifest and lockfile
updates select the same group when an alias appears in multiple groups. Add a
regression case covering the alias in dependencies, devDependencies, and
optionalDependencies.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c53cb388-568a-4ed8-9f59-f8cff747ff40

📥 Commits

Reviewing files that changed from the base of the PR and between 33991a6 and 81d18e7.

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

@codecov-commenter

codecov-commenter commented Aug 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.15385% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.33%. Comparing base (e6f2249) to head (151e942).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
.../crates/package-manager/src/manifest_spec_bumps.rs 94.73% 6 Missing ⚠️
pnpm/crates/package-manager/src/update.rs 95.90% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13882      +/-   ##
==========================================
+ Coverage   88.29%   88.33%   +0.04%     
==========================================
  Files         627      628       +1     
  Lines      103689   103969     +280     
==========================================
+ Hits        91552    91841     +289     
+ Misses      12137    12128       -9     

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

`sharedWorkspaceLockfile: false` anchors importer ids at the active
project rather than the workspace root, so the ids the update built its
bump targets from named importers the lockfile did not have. The lookup
silently found nothing and the range was left unwritten — the very bug
this was meant to fix, still present under dedicated lockfiles.

Both rules now come from one `lockfile_root_dir` helper that the install
derives its own `workspace_root` from, so they cannot drift apart again.

A bump-only update also announces the manifest it started from. The
reporter pairs that with the updated manifest it already emitted, so an
NDJSON consumer no longer sees an update with nothing to diff against.
@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.00     12.9±0.98ms    29.0 MB/sec    1.04     13.4±0.18ms    27.9 MB/sec
packument/parse                                  1.00     41.7±0.33µs  1589.9 MB/sec    1.09     45.4±1.23µs  1461.2 MB/sec
tarball/download_dependency                      1.00      2.8±0.22ms  1536.6 KB/sec    1.08      3.0±0.38ms  1422.9 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00   210.9±10.83ms 75.9 KElem/sec    1.01   213.1±10.73ms 75.1 KElem/sec
workspace_resolution/hoist_heavy                 1.00   275.9±16.66ms        ? ?/sec    1.08    297.7±3.30ms        ? ?/sec

The group a bumped range belongs to was decided twice — once from the
lockfile entry the range was read from, once again from the alias alone
when writing `package.json`. A dependency declared in more than one group
could have the two pick differently, leaving the manifest and the lockfile
naming different entries. The group now travels with the range, so there
is one rule and one decision.

The write also stops going through `add_dependency`, which moves an alias
into the target group by deleting it from the others. An update moves a
range; it must not relocate a dependency that happens to be declared
twice.
Copilot AI review requested due to automatic review settings August 12, 2026 22:26
@greptile-apps
greptile-apps Bot dismissed their stale review August 12, 2026 22:26

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.

@zkochan

zkochan commented Aug 12, 2026

Copy link
Copy Markdown
Member Author

Follow-up on the remaining review points, all pushed:

Group selection duplicated between the lockfile and the manifest write (CodeRabbit, manifest_spec_bumps.rs:124-126) — real, and worse than the nitpick label suggested. Fixed in 20c7f50 by removing the second rule rather than documenting the coupling: the group now travels with the range in AppliedSpecBumps.manifests, and declared_group is gone. Two unit tests pin it (a_bumped_range_lands_in_the_group_it_was_read_from, a_bump_for_an_undeclared_group_writes_nothing).

Writing the test surfaced a second problem in the same place: the manifest write went through add_dependency, which moves an alias into the target group by deleting it from the others — add's semantics, not an update's. A manifest declaring the same alias in dependencies and optionalDependencies had one of them silently dropped. The range is now written in place.

Changeset must declare pnpm (Qodo, rule 713436) — declining. This repo's AGENTS.md:225 says the opposite for Rust-only changes:

Do not add "pnpm" to a Rust-only changeset: in changesets, pnpm always means the TypeScript CLI package. A changeset whose implementation is Rust-only and targets pacquet must omit "pnpm".

This PR is Rust-only — the TypeScript CLI already has this behavior, which is what the fix is matching — so "pacquet": patch is correct and adding "pnpm" would cut a TypeScript CLI release for a change that does not touch it. The generic rule applies to TypeScript-side and parity changes.

Patch coverage 95.3% (Codecov) — the 12 uncovered lines are continue/else guards for lockfile shapes that cannot co-occur with a bump target (an importer or catalog entry the resolve did not write, a version that does not parse). I left them as guards rather than expects since they are reached from deserialized data.


Written by an agent (Claude Code, claude-opus-5[1m]).

@zkochan

zkochan commented Aug 12, 2026

Copy link
Copy Markdown
Member Author

Qodo re-fired rule 713436 (changeset must declare pnpm) on the new commits. Still declining, now with in-tree precedent as well as the AGENTS.md:225 quote above: the Rust-only changesets currently pending on main — .changeset/cycle-verdict-cache.md and .changeset/deterministic-children-ownership-handover.md — both list "pacquet": patch alone. The ones that also carry "pnpm" (calm-spiders-smile.md, atomic-global-install-activation.md) are parity changes that touch TypeScript packages too. This PR does not.

Qodo's other finding from the previous run (importer ID root mismatch) is struck through as resolved, and it reports 0 bugs on the current head.


Written by an agent (Claude Code, claude-opus-5[1m]).

@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 151e942

@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

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 151e9424ddd9

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.592 ± 0.133 2.355 2.786 1.75 ± 0.16
pacquet@main 2.614 ± 0.224 2.371 3.050 1.76 ± 0.20
pnpr@HEAD 1.526 ± 0.169 1.349 1.745 1.03 ± 0.14
pnpr@main 1.483 ± 0.116 1.362 1.666 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5917373894999995,
      "stddev": 0.13251526197524396,
      "median": 2.5717049775999996,
      "user": 1.71444514,
      "system": 1.2910678,
      "min": 2.3554088076,
      "max": 2.7862117826,
      "times": [
        2.3554088076,
        2.5442393016,
        2.7647332695999998,
        2.5859352076,
        2.6745515336,
        2.5507491626,
        2.7862117826,
        2.6459750445999997,
        2.4520950376,
        2.5574747475999997
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6142570516,
      "stddev": 0.22441793279207448,
      "median": 2.5781988301,
      "user": 1.8560030400000003,
      "system": 1.4942174999999998,
      "min": 2.3710246745999997,
      "max": 3.0504941666,
      "times": [
        2.7526705556,
        3.0504941666,
        2.3872854946,
        2.6281979466,
        2.7938558896,
        2.5281997136,
        2.3909100625999997,
        2.7671503516,
        2.3710246745999997,
        2.4727816606
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5256214413000002,
      "stddev": 0.16854260719674194,
      "median": 1.4294326991000001,
      "user": 1.13637964,
      "system": 1.1629117,
      "min": 1.3491766706000001,
      "max": 1.7449857126000001,
      "times": [
        1.7441396036,
        1.7449857126000001,
        1.3491766706000001,
        1.3914411076000002,
        1.4205572706,
        1.7407035146,
        1.3730956076,
        1.6332495276,
        1.4297810886000002,
        1.4290843096
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.4832374272,
      "stddev": 0.116107192995563,
      "median": 1.4469011946,
      "user": 1.17099604,
      "system": 1.1585025999999998,
      "min": 1.3624176116,
      "max": 1.6664783506,
      "times": [
        1.5960033996,
        1.3624176116,
        1.4851117746000002,
        1.3849896576,
        1.4022223456,
        1.6664783506,
        1.4270335176000002,
        1.3828622336,
        1.6584865096,
        1.4667688716
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 264.8 ± 7.2 254.8 279.0 1.00 ± 0.04
pacquet@main 264.1 ± 7.7 252.6 274.5 1.00
pnpr@HEAD 281.3 ± 7.2 272.1 295.0 1.07 ± 0.04
pnpr@main 278.6 ± 10.4 261.0 296.1 1.06 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.26484312018000006,
      "stddev": 0.007223674737908223,
      "median": 0.26382858538000004,
      "user": 0.2326005,
      "system": 0.54221002,
      "min": 0.25484597838,
      "max": 0.27895954138,
      "times": [
        0.26261943938000004,
        0.27895954138,
        0.26990752838000004,
        0.26208267138,
        0.27228676738,
        0.26503773138000003,
        0.25927119138000004,
        0.25809899838000006,
        0.25484597838,
        0.26532135438000004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.26405511258000003,
      "stddev": 0.007658479594504737,
      "median": 0.26198910638000006,
      "user": 0.22238239999999995,
      "system": 0.54681102,
      "min": 0.25255670938,
      "max": 0.27452318838,
      "times": [
        0.27452318838,
        0.27088761038000003,
        0.27346137438,
        0.26205890738000004,
        0.26043719038,
        0.27014870138,
        0.25767837938000004,
        0.25687975938,
        0.26191930538,
        0.25255670938
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.28128216718000004,
      "stddev": 0.007155147696200961,
      "median": 0.28162040388000004,
      "user": 0.24700050000000004,
      "system": 0.54902692,
      "min": 0.27213817738,
      "max": 0.29504671638,
      "times": [
        0.27299326438000004,
        0.27904695438000005,
        0.28082637738000005,
        0.28241443038,
        0.29504671638,
        0.28499479738000005,
        0.28337765938000004,
        0.28785293438000004,
        0.27413036038000005,
        0.27213817738
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.27858295558,
      "stddev": 0.010436379111251611,
      "median": 0.27815641588000006,
      "user": 0.22395739999999997,
      "system": 0.56049322,
      "min": 0.26096642338000003,
      "max": 0.29613480838,
      "times": [
        0.28682146538000003,
        0.26500058038,
        0.28563486638,
        0.27853037338000003,
        0.27439790038,
        0.27604663838000004,
        0.27778245838000004,
        0.28451404138,
        0.29613480838,
        0.26096642338000003
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.750 ± 0.042 2.715 2.857 1.68 ± 0.16
pacquet@main 2.733 ± 0.013 2.712 2.748 1.67 ± 0.15
pnpr@HEAD 1.637 ± 0.151 1.466 1.844 1.00
pnpr@main 1.726 ± 0.111 1.515 1.870 1.05 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.7499572406599997,
      "stddev": 0.04199939833390682,
      "median": 2.73879715416,
      "user": 1.6166177199999996,
      "system": 1.3819590600000002,
      "min": 2.7149477476599997,
      "max": 2.85668083466,
      "times": [
        2.7614947546599997,
        2.85668083466,
        2.76862357466,
        2.71948628666,
        2.74300040966,
        2.75451656066,
        2.7159165436599997,
        2.7345938986599996,
        2.7149477476599997,
        2.73031179566
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.7331261257599997,
      "stddev": 0.01332047113379102,
      "median": 2.7387760761599997,
      "user": 1.58832762,
      "system": 1.38991336,
      "min": 2.71240704466,
      "max": 2.7476630946599996,
      "times": [
        2.7427234066599997,
        2.7476630946599996,
        2.71922980066,
        2.74716738966,
        2.74211676566,
        2.72291050266,
        2.71240704466,
        2.74247932666,
        2.73543538666,
        2.71912853966
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.63696596056,
      "stddev": 0.15092482809899233,
      "median": 1.57239608566,
      "user": 1.1157692200000002,
      "system": 1.1751475599999996,
      "min": 1.46637650666,
      "max": 1.8436818246600002,
      "times": [
        1.83829508666,
        1.8436818246600002,
        1.52917818966,
        1.5590784876600001,
        1.49249942066,
        1.76189305966,
        1.58571368366,
        1.46637650666,
        1.78001861266,
        1.51292473366
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.7255817631600003,
      "stddev": 0.11108847606278131,
      "median": 1.74342002316,
      "user": 1.08792902,
      "system": 1.1759986599999999,
      "min": 1.51510210266,
      "max": 1.86988509466,
      "times": [
        1.69172604466,
        1.51510210266,
        1.56636204866,
        1.78918853466,
        1.72417949666,
        1.77678043166,
        1.86988509466,
        1.8357538316600002,
        1.74310665966,
        1.74373338666
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 436.3 ± 25.1 388.5 470.6 1.40 ± 0.09
pacquet@main 430.9 ± 19.2 397.4 456.3 1.39 ± 0.07
pnpr@HEAD 311.1 ± 6.0 300.1 319.9 1.00
pnpr@main 311.4 ± 7.1 298.6 322.5 1.00 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.4363086064,
      "stddev": 0.025067328491254894,
      "median": 0.4339239764,
      "user": 0.54042894,
      "system": 0.71540874,
      "min": 0.3884786459,
      "max": 0.4705902009,
      "times": [
        0.3884786459,
        0.4214686149,
        0.4216458959,
        0.4453677689,
        0.4705902009,
        0.4238369019,
        0.4243327429,
        0.4594946519,
        0.4643554309,
        0.4435152099
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.43088593900000005,
      "stddev": 0.01921285758399411,
      "median": 0.4313033644,
      "user": 0.5468068400000001,
      "system": 0.6948197399999998,
      "min": 0.3974076059,
      "max": 0.4563445249,
      "times": [
        0.4349266789,
        0.4452164549,
        0.4276800499,
        0.4133787909,
        0.4563445249,
        0.4162056099,
        0.4475715189,
        0.4506519439,
        0.4194762119,
        0.3974076059
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3110560005,
      "stddev": 0.006046387995477897,
      "median": 0.3106163959,
      "user": 0.21622333999999999,
      "system": 0.53740864,
      "min": 0.3001000999,
      "max": 0.3198564249,
      "times": [
        0.3125453339,
        0.3086096219,
        0.3131076299,
        0.3086874579,
        0.3076117779,
        0.3001000999,
        0.3058028109,
        0.3166002389,
        0.3176386089,
        0.3198564249
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.3113870811,
      "stddev": 0.007145696558847336,
      "median": 0.3120422994,
      "user": 0.21571794000000005,
      "system": 0.53783514,
      "min": 0.2986177859,
      "max": 0.3224798319,
      "times": [
        0.30815036889999997,
        0.2986177859,
        0.3113685939,
        0.3034826029,
        0.3224798319,
        0.3131474439,
        0.3127160049,
        0.3182383749,
        0.31755135489999997,
        0.3081184489
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.895 ± 0.020 1.862 1.920 6.19 ± 0.24
pacquet@main 1.874 ± 0.016 1.852 1.910 6.12 ± 0.24
pnpr@HEAD 0.306 ± 0.011 0.290 0.324 1.00
pnpr@main 0.320 ± 0.035 0.301 0.418 1.04 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.89524996096,
      "stddev": 0.019885494360950145,
      "median": 1.9039683374600003,
      "user": 0.7898270999999999,
      "system": 0.8345671199999998,
      "min": 1.8616280909600003,
      "max": 1.9196660019600003,
      "times": [
        1.9196660019600003,
        1.8734058689600002,
        1.8616280909600003,
        1.90650390496,
        1.8818479289600003,
        1.87756656896,
        1.9090561379600002,
        1.9148884319600001,
        1.9059545529600002,
        1.9019821219600002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.8744325545600002,
      "stddev": 0.016433629789130544,
      "median": 1.87156537796,
      "user": 0.7972813999999999,
      "system": 0.7910162199999999,
      "min": 1.8522628159600003,
      "max": 1.9099848729600002,
      "times": [
        1.86656025796,
        1.88300962996,
        1.8660837729600002,
        1.8592115259600002,
        1.8522628159600003,
        1.8807105129600001,
        1.9099848729600002,
        1.8651261249600002,
        1.88480553396,
        1.8765704979600002
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30624827566,
      "stddev": 0.011473871828052798,
      "median": 0.30458872845999996,
      "user": 0.21214429999999998,
      "system": 0.5292048200000001,
      "min": 0.28978393996,
      "max": 0.32394614896,
      "times": [
        0.29746564596,
        0.28978393996,
        0.29355254696,
        0.30581786196,
        0.32394614896,
        0.31829503596000003,
        0.30335959496,
        0.29997764396,
        0.31279006696,
        0.31749427096
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.3199778098600001,
      "stddev": 0.03512537902359505,
      "median": 0.30886971846,
      "user": 0.2186146,
      "system": 0.5827909199999999,
      "min": 0.30096348496,
      "max": 0.41828650696,
      "times": [
        0.30492998496,
        0.30850861596,
        0.31148095796,
        0.32457689296000003,
        0.31013757596,
        0.30315464196,
        0.41828650696,
        0.30874782496000003,
        0.30899161196,
        0.30096348496
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 222.6 ± 22.6 194.7 258.6 2.54 ± 0.26
pacquet@main 226.8 ± 12.2 211.9 241.1 2.59 ± 0.15
pnpr@HEAD 87.5 ± 1.8 84.5 91.5 1.00
pnpr@main 88.1 ± 2.1 83.1 92.3 1.01 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.22255086558909093,
      "stddev": 0.022560234121470384,
      "median": 0.21691795268000003,
      "user": 0.16567732,
      "system": 0.055431278181818186,
      "min": 0.19470779068000002,
      "max": 0.25855356868,
      "times": [
        0.24778701768000003,
        0.21624181268,
        0.19470779068000002,
        0.21691795268000003,
        0.21111431268000003,
        0.19562654568,
        0.25400477468,
        0.25855356868,
        0.22964618768,
        0.22122228668000002,
        0.20223727168000002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.22675800284666667,
      "stddev": 0.012166877339131419,
      "median": 0.22753632068000001,
      "user": 0.17165423666666668,
      "system": 0.05074896,
      "min": 0.21188223568,
      "max": 0.24110987668000003,
      "times": [
        0.23972843368000002,
        0.21306588868,
        0.24106832968000003,
        0.22733090968000003,
        0.22774173168,
        0.21636510568,
        0.23874281268000003,
        0.21461830368,
        0.24110987668000003,
        0.23549135568000001,
        0.21395105068,
        0.21188223568
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08749243845419352,
      "stddev": 0.00176472008713342,
      "median": 0.08734902368000001,
      "user": 0.020149707096774192,
      "system": 0.010648172258064517,
      "min": 0.08451859768,
      "max": 0.09154177768,
      "times": [
        0.09059671168000001,
        0.08786698468000001,
        0.08764284468000001,
        0.08500230568,
        0.08776914068000001,
        0.08669615668000001,
        0.08983613368000001,
        0.08495627768000001,
        0.08861574268000001,
        0.08587713868,
        0.09154177768,
        0.08995204168000001,
        0.08696288668,
        0.08630783668000001,
        0.08604349168,
        0.08734902368000001,
        0.08919334568000001,
        0.08463670868,
        0.08968861568000001,
        0.08697989968,
        0.08595290068000001,
        0.08779198468,
        0.08865731968000001,
        0.08451859768,
        0.08809561468,
        0.08821823468000001,
        0.08647460068000001,
        0.08695012368,
        0.08880141068000001,
        0.08614279668000001,
        0.08714694368
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08808257118000001,
      "stddev": 0.0020856346626832176,
      "median": 0.08810916518,
      "user": 0.022200601249999993,
      "system": 0.008390558749999999,
      "min": 0.08307495468000001,
      "max": 0.09233970568000001,
      "times": [
        0.08777218768,
        0.09020861268000001,
        0.09119672968,
        0.08800606668000001,
        0.08916384068000001,
        0.08953676068000001,
        0.09233970568000001,
        0.08568930568000001,
        0.08893207568,
        0.08332862168,
        0.08742045668000001,
        0.08798190068,
        0.08821226368000001,
        0.09086956468,
        0.08899013468000001,
        0.08788885668,
        0.08923946368,
        0.09003163068,
        0.08783118768,
        0.08924571468,
        0.08307495468000001,
        0.08907760968,
        0.08541639368000001,
        0.08874671768,
        0.08698712268,
        0.08652312168000001,
        0.08648695368,
        0.08856365368,
        0.08685011568,
        0.08624208368000001,
        0.09055019468,
        0.08623827568
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 520.9 ± 91.9 358.1 693.3 1.00
pacquet@main 567.7 ± 64.1 471.9 653.2 1.09 ± 0.23
pnpm@HEAD 3027.7 ± 131.9 2857.9 3257.0 5.81 ± 1.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.5209377418066667,
      "stddev": 0.09193622424127496,
      "median": 0.5198434041400001,
      "user": 0.5079788644444444,
      "system": 0.09098061777777776,
      "min": 0.35813063514000004,
      "max": 0.69331281314,
      "times": [
        0.53572307714,
        0.5198434041400001,
        0.5993314391400001,
        0.52769403814,
        0.35813063514000004,
        0.69331281314,
        0.5090863521400001,
        0.48229418414,
        0.46302373314
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.5677145866955556,
      "stddev": 0.06407992104108537,
      "median": 0.59900697914,
      "user": 0.5419495311111111,
      "system": 0.11818317333333332,
      "min": 0.47194049914,
      "max": 0.65318258614,
      "times": [
        0.62611585214,
        0.65318258614,
        0.48464210314000006,
        0.60043058214,
        0.55879033014,
        0.51447926014,
        0.47194049914,
        0.59900697914,
        0.6008430881400001
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.027731442584445,
      "stddev": 0.13186478111979377,
      "median": 2.96528207714,
      "user": 4.635982531111111,
      "system": 0.24441883999999994,
      "min": 2.85785850914,
      "max": 3.25695232714,
      "times": [
        3.25695232714,
        3.02860912114,
        2.95946476214,
        3.15753688714,
        2.96528207714,
        2.91520608514,
        3.14978141914,
        2.85785850914,
        2.95889179514
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.673 ± 0.169 4.467 4.996 1.29 ± 0.06
pacquet@main 4.535 ± 0.063 4.444 4.670 1.26 ± 0.03
pnpr@HEAD 3.626 ± 0.127 3.505 3.855 1.00 ± 0.04
pnpr@main 3.611 ± 0.083 3.501 3.736 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.6731815609,
      "stddev": 0.16913341108413169,
      "median": 4.6992171017999995,
      "user": 2.31997786,
      "system": 1.6927914599999998,
      "min": 4.4665052007999995,
      "max": 4.9956199007999995,
      "times": [
        4.7046616318,
        4.7228012378,
        4.4665052007999995,
        4.8435156948,
        4.4801085288,
        4.5370329707999995,
        4.9956199007999995,
        4.693772571799999,
        4.744780061799999,
        4.543017809799999
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.5348656821999995,
      "stddev": 0.06322203945992934,
      "median": 4.5318017158,
      "user": 2.04582996,
      "system": 1.5477161599999998,
      "min": 4.4435999778,
      "max": 4.6702655678,
      "times": [
        4.4879832868,
        4.4435999778,
        4.6702655678,
        4.536744318799999,
        4.5316584068,
        4.6035621708,
        4.4944389207999995,
        4.5319450248,
        4.5402075168,
        4.508251630799999
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.625569926,
      "stddev": 0.12661773050804545,
      "median": 3.5629669608000003,
      "user": 1.5957869599999999,
      "system": 1.4638563599999999,
      "min": 3.5053595058,
      "max": 3.8545891948000004,
      "times": [
        3.7188776358,
        3.6255816078,
        3.5473672518000003,
        3.5053595058,
        3.8545891948000004,
        3.8168880068,
        3.5670624768000003,
        3.5263974228,
        3.5347047128000004,
        3.5588714448000003
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.6111592173,
      "stddev": 0.08331209323092315,
      "median": 3.5994782663000002,
      "user": 1.7053902599999997,
      "system": 1.62954016,
      "min": 3.5008619838,
      "max": 3.7358358458,
      "times": [
        3.5757207038,
        3.5168739888,
        3.6792216008,
        3.5008619838,
        3.5372168378000004,
        3.6192348738000004,
        3.7358358458,
        3.5797216588,
        3.7222255198000003,
        3.6446791598000003
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13882
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,714.95 ms
(-1.26%)Baseline: 2,749.61 ms
3,299.53 ms
(82.28%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,861.63 ms
(-0.10%)Baseline: 1,863.56 ms
2,236.27 ms
(83.25%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
388.48 ms
(-16.29%)Baseline: 464.10 ms
556.92 ms
(69.76%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
194.71 ms
(-14.32%)Baseline: 227.24 ms
272.69 ms
(71.40%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,355.41 ms
(-4.63%)Baseline: 2,469.67 ms
2,963.61 ms
(79.48%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,466.51 ms
(-0.84%)Baseline: 4,504.53 ms
5,405.44 ms
(82.63%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
254.85 ms
(-13.44%)Baseline: 294.43 ms
353.31 ms
(72.13%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
358.13 ms
(-44.59%)Baseline: 646.34 ms
775.61 ms
(46.17%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13882
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,466.38 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
289.78 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
300.10 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
84.52 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,349.18 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,505.36 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
272.14 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit 9ef6a0a into main Aug 13, 2026
39 checks passed
@zkochan
zkochan deleted the fix-13879 branch August 13, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm update doesn't update dependency version of package.json in v12

3 participants