Skip to content

refactor: single staging layer for fast lockfile updates - #13762

Merged
zkochan merged 2 commits into
mainfrom
fast-update-stage1
Aug 10, 2026
Merged

zkochan merged 2 commits into
mainfrom
fast-update-stage1

Conversation

@zkochan

@zkochan zkochan commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Related to #13696. Builds on the group-moves work from #13761 (merged); rebased onto main.

First stage of consolidating the fast lockfile update paths: one staging layer instead of two, and no lockfile clone before drift is detected.

  • One staging layer. The coordinator (tryFastUpdateLockfile) already clones the lockfile and discards the candidate unless it passes the freshness gates, yet the importers handler staged its own inner clone and copied back on success. The handler now mutates the coordinator's candidate directly; the discard-on-failure invariant lives in one place and is pinned by coordinator-level tests.
  • Bug fix the restructure surfaced: the coordinator committed with Object.assign, which cannot delete top-level keys — removing the last referent of a catalog entry through the fast path left the stale catalogs: section in the written lockfile (a full resolution drops it). The commit now replaces the lockfile's keys wholesale. Regression-tested at unit and install level; the install-level test failed before the fix.
  • Detect before clone (pacquet). try_fast_update_importers cloned the whole lockfile before checking for drift, so every stale install paid a clone in this handler even when its drift lay elsewhere (a settings or patch change). It now scans for manifest drift on a borrow and clones only when it will act. The other three sync handlers already detected before cloning.
  • The canTryFastUpdateLockfile trigger list is deduplicated into a FAST_UPDATABLE_SETTINGS constant.

No behavior changes apart from the catalog fix; both stacks fall back to the resolver under the same conditions as before. Stage 2 (composing handlers on one candidate instead of the exactly-one-fires rule) is filed separately.

Squash Commit Body

The fast-update coordinator already stages every rewrite on a clone
and discards it unless the candidate passes the freshness gates, so
the importers handler staging its own inner clone and copying back
was a second, redundant layer; it now mutates the coordinator's
candidate directly. The coordinator also commits by replacing the
lockfile's keys wholesale instead of Object.assign, which silently
kept top-level keys the update had deleted: removing the last
referent of a catalog entry through the fast path left the stale
catalogs section in the written lockfile.

pacquet's importers handler now scans for manifest drift before
cloning the lockfile, so installs whose drift lies elsewhere no
longer pay a full lockfile clone in the handler; the other pacquet
handlers already detected before cloning.

Related to pnpm/pnpm#13696.

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


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
    • Fast lockfile updates now support moving dependencies between production, development, and optional dependency sections.
    • Lockfiles are updated in place without unnecessarily re-resolving the full dependency graph.
  • Bug Fixes
    • Corrected optional dependency metadata and cleanup of unused packages, snapshots, and catalog entries.
    • Improved handling of compatible version changes, aliases, peer dependencies, and shared dependency subtrees.
    • Fast updates now fall back safely when changes cannot be applied without resolution.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Fast lockfile updates

Layer / File(s) Summary
Update eligibility and lockfile commit
pnpm11/installing/deps-installer/src/install/index.ts, pnpm11/installing/deps-installer/src/install/tryFastUpdateLockfile.ts
Centralizes fast-update settings and removes deleted lockfile keys when a validated candidate is committed.
TypeScript importer moves and pruning
pnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.ts
Updates dependency groups in place, removes empty groups, preserves semver checks, and prunes obsolete package data.
Rust importer updates and optionality propagation
pnpm/crates/package-manager/src/fast_update_importers.rs, pnpm/crates/package-manager/src/fast_update_lockfile.rs
Detects group changes, moves importer records, and recomputes snapshot optional flags across dependency paths.
Importer movement and removal validation
pnpm/crates/package-manager/src/fast_update_importers/tests.rs, pnpm11/installing/deps-installer/test/install/*, pnpm/crates/cli/tests/suite/lockfile_resolution_reuse.rs
Adds coverage for group moves, optional subtrees, range changes, package reuse, fallback behavior, and stale lockfile cleanup.
Release metadata
.changeset/*
Adds patch-release changesets for the affected packages.

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

Possibly related issues

Possibly related PRs

  • pnpm/pnpm#13761 — Implements the same dependency-group fast-update behavior across Rust and TypeScript.
  • pnpm/pnpm#13141 — Covers related dependency-group movement and importer lockfile updates.
  • pnpm/pnpm#13712 — Modifies related fast lockfile removal behavior and tests.

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

✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch fast-update-stage1
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fast-update-stage1

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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

Single staging layer for fast lockfile updates (fix stale catalogs deletion)

🐞 Bug fix ✨ Enhancement 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Remove redundant inner lockfile staging; fast-update handlers now mutate the coordinator
 candidate.
• Fix fast-update commit to drop deleted top-level lockfile keys (e.g. empty catalogs).
• Avoid cloning lockfile until importer drift is detected; add regression/unit+install tests.
Diagram

graph TD
A["mutateModules()"] --> B["tryFastUpdateLockfile()"] --> C["Clone candidate"] --> D["Fast-update handlers"] --> G{"Freshness gates"} --> H["Commit (replace keys)"]
D --> E["Importers handler (TS)"]
D --> F["Importers handler (Rust)"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Return new lockfile object instead of committing into existing reference
  • ➕ Avoids tricky in-place commit semantics (no need to delete missing keys)
  • ➕ Clearer API contract: handlers/coordinator produce a new lockfile snapshot
  • ➖ Wider API changes: many call sites expect mutation of an existing lockfile reference
  • ➖ Potentially higher churn and risk across TS codepaths that hold references to the lockfile object
2. Keep handler-local cloning but add explicit 'no-mutation on failure' guards
  • ➕ Stronger encapsulation: each handler guarantees safety independently
  • ➕ Less reliance on coordinator invariants
  • ➖ Redundant clones and copies remain (higher cost on the fast path)
  • ➖ Harder to reason about overall performance and staging ownership

Recommendation: The PR’s approach (single coordinator-owned staging clone + handler in-place mutation of the candidate) is the best trade-off: it centralizes the discard-on-failure invariant, reduces redundant cloning/copying, and makes the commit semantics explicit (including key deletion). A full API shift to returning a new lockfile object could be cleaner but is not worth the churn for this incremental refactor stage.

Files changed (8) +227 / -49

Bug fix (1) +13 / -0
tryFastUpdateLockfile.tsCommit by removing missing keys before assigning candidate +13/-0

Commit by removing missing keys before assigning candidate

• Fixes coordinator commit semantics so top-level keys deleted by a fast update (e.g. emptied 'packages'/'catalogs') are removed from the final lockfile. This prevents stale sections from persisting due to 'Object.assign' not deleting properties.

pnpm11/installing/deps-installer/src/install/tryFastUpdateLockfile.ts

Refactor (3) +101 / -38
fast_update_importers.rsScan for importer drift before cloning lockfile (pacquet) +81/-14

Scan for importer drift before cloning lockfile (pacquet)

• Refactors importer fast-update to precompute manifest dependency expectations and detect divergence before cloning the lockfile. Adds helper functions to detect divergences and locate recorded dependencies by group, reducing work when fast update won’t apply.

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

index.tsDeduplicate fast-update trigger fields into constant set +9/-4

Deduplicate fast-update trigger fields into constant set

• Introduces 'FAST_UPDATABLE_SETTINGS' and uses it to simplify the 'canTryFastUpdateLockfile' gating logic.

pnpm11/installing/deps-installer/src/install/index.ts

tryFastUpdateImporters.tsRemove inner staging clone; mutate candidate importers directly +11/-20

Remove inner staging clone; mutate candidate importers directly

• Eliminates the handler-local 'clone(lockfile)' staging layer and rewrites the function to mutate the passed lockfile object in place. Keeps pruning and catalog cleanup logic operating on the same candidate and documents the 'may partially mutate on failure' contract.

pnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.ts

Tests (3) +106 / -11
tests.rsAdd regression test for missing lockfile dependency fallback +10/-0

Add regression test for missing lockfile dependency fallback

• Adds a unit test ensuring fast update rejects manifests that introduce dependencies not recorded in the lockfile (forcing resolver fallback).

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

catalogFastUpdate.tsRun fallback-mutation assertion through coordinator staging +12/-9

Run fallback-mutation assertion through coordinator staging

• Updates the incompatible range test to call 'tryFastUpdateLockfile' around 'tryFastUpdateImporters', ensuring the 'no mutation on fallback' invariant is validated at the coordinator level.

pnpm11/installing/deps-installer/test/install/catalogFastUpdate.ts

importerRemovalFastUpdate.tsAdd coordinator commit/delete-key and install-level regressions +84/-2

Add coordinator commit/delete-key and install-level regressions

• Updates fallback tests to assert non-mutation via the coordinator and adds a unit regression verifying deleted keys are removed after commit. Adds install-level tests ensuring uninstalling the last dependency drops 'packages'/'snapshots', and removing the last catalog referent drops 'catalogs' without triggering package requests.

pnpm11/installing/deps-installer/test/install/importerRemovalFastUpdate.ts

Documentation (1) +7 / -0
fast-update-single-staging.mdAdd changeset for catalogs cleanup regression fix +7/-0

Add changeset for catalogs cleanup regression fix

• Introduces a patch changeset noting that fast lockfile updates no longer leave stale 'catalogs' entries after the last referent is removed.

.changeset/fast-update-single-staging.md

@greptile-apps

greptile-apps Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains, and the previously reported narrating comment has been removed.

Reviews (3): Last reviewed commit: "perf: address review findings on the fas..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.04     12.6±1.94ms    29.6 MB/sec    1.00     12.1±0.22ms    30.8 MB/sec
packument/parse                                  1.00     41.8±0.73µs  1586.7 MB/sec    1.03     43.2±0.58µs  1536.3 MB/sec
tarball/download_dependency                      1.00      3.3±0.34ms  1308.1 KB/sec    1.07      3.5±0.33ms  1222.3 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00    196.5±9.22ms 81.4 KElem/sec    1.09    213.6±3.98ms 74.9 KElem/sec
workspace_resolution/hoist_heavy                 1.00   264.7±10.02ms        ? ?/sec    1.01    266.6±4.53ms        ? ?/sec

@codecov-commenter

codecov-commenter commented Aug 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.12%. Comparing base (664edd5) to head (6a6932f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13762   +/-   ##
=======================================
  Coverage   88.12%   88.12%           
=======================================
  Files         622      622           
  Lines      101217   101260   +43     
=======================================
+ Hits        89197    89238   +41     
- Misses      12020    12022    +2     

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

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Informational

1. Prototype-chain key retention ✓ Resolved 🐞 Bug ⛨ Security
Description
tryFastUpdateLockfile uses key in candidate to decide whether to delete a top-level key before
committing; in consults the prototype chain, so own keys like constructor/toString/__proto__
can be treated as “present” even when the candidate does not define them. This breaks the “replace
wholesale” invariant and can let crafted lockfile keys persist unexpectedly after a commit.
Code

pnpm11/installing/deps-installer/src/install/tryFastUpdateLockfile.ts[R25-28]

+  for (const key of Object.keys(lockfile)) {
+    if (!(key in candidate)) {
+      delete lockfile[key as keyof LockfileObject]
+    }
Relevance

●●● Strong

Repo has accepted prototype-pollution hardening; replacing in with own-key check matches that
pattern.

PR-#12558

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new commit path explicitly deletes keys from lockfile when they are not in the staged
candidate, but it uses key in candidate, which is prototype-chain based and therefore not
equivalent to “candidate has this key as its own property”.

pnpm11/installing/deps-installer/src/install/tryFastUpdateLockfile.ts[22-31]

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

### Issue description
`tryFastUpdateLockfile()` currently deletes keys only when `!(key in candidate)`. The `in` operator checks inherited properties too, so it can incorrectly skip deletion for keys that exist on `Object.prototype`.

### Issue Context
The intent (per comment) is a wholesale key replacement so top-level keys removed by the update (e.g. `packages`, `catalogs`) disappear from the committed lockfile.

### Fix Focus Areas
- pnpm11/installing/deps-installer/src/install/tryFastUpdateLockfile.ts[22-31]

### Suggested fix
Replace `key in candidate` with an own-property check:
- `if (!Object.hasOwn(candidate, key)) { ... }` (preferred), or
- `if (!Object.prototype.hasOwnProperty.call(candidate, key)) { ... }`.

Alternative (simple and robust): delete all own keys from `lockfile` first, then `Object.assign(lockfile, candidate)`.

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


2. Bugfix mixed with refactor 📘 Rule violation ⚙ Maintainability
Description
The PR’s changeset describes a specific bug fix, but the diff also includes broader
refactors/performance work in the same change. This violates the scope-discipline requirement for
bug-fix changes and makes the release note/patch harder to audit and revert safely.
Code

pnpm/crates/package-manager/src/fast_update_importers.rs[R31-34]

+    // Cloning the lockfile is the expensive part, so nothing is cloned
+    // until this cheap scan finds drift the loop below would act on.
+    if !manifest_dependencies
+        .iter()
Relevance

● Weak

Team previously rejected “keep bugfix PR focused / split refactor” feedback.

PR-#13416

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changeset describes a targeted bug fix, but the PR also introduces non-bugfix
refactor/performance logic (e.g., a new pre-scan to avoid cloning and a staging-layer mutation
refactor), which expands scope beyond the bug fix described.

Rule 2255067: Bug fix changes must not include unrelated refactors or reformatting
.changeset/fast-update-single-staging.md[1-7]
pnpm/crates/package-manager/src/fast_update_importers.rs[31-39]
pnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.ts[30-45]

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

## Issue description
This PR includes a user-visible bug fix (lockfile `catalogs` cleanup) alongside broader refactors/performance optimizations in the same change, which violates the “bug fix must not include unrelated refactors” scope rule.

## Issue Context
The changeset text is narrowly framed as a bug fix, but the code changes also include staging-layer refactors and a performance optimization (avoid cloning until drift is detected).

## Fix Focus Areas
- .changeset/fast-update-single-staging.md[1-7]
- pnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.ts[30-45]
- pnpm/crates/package-manager/src/fast_update_importers.rs[31-39]

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


3. Alloc-heavy drift pre-scan ✓ Resolved 🐞 Bug ➹ Performance
Description
The new Rust importer_diverges pre-scan allocates (alias.to_string()) for each recorded
dependency and parses manifest aliases, then the update loop parses aliases again when drift exists.
This adds avoidable CPU/alloc work on a fast-update hot path, especially for large workspaces with
many importer dependencies.
Code

pnpm/crates/package-manager/src/fast_update_importers.rs[R103-104]

+    .flat_map(HashMap::keys)
+    .any(|alias| !manifest_dependencies.contains_key(alias.to_string().as_str()));
Relevance

● Weak

Similar allocation/micro-optimization in same file was previously rejected.

PR-#13698

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
importer_diverges() uses alias.to_string() for membership tests and parses manifest aliases,
introducing per-dependency allocations/parsing. PkgName::parse consumes/allocates Strings, so
avoiding repeated parse/format operations requires changing the key representation rather than
borrowing a &str view.

pnpm/crates/package-manager/src/fast_update_importers.rs[83-115]
pnpm/crates/lockfile/src/pkg_name.rs[30-50]

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 `importer_diverges()` scan is intended to be “cheap” vs cloning, but it performs per-dependency allocations (`alias.to_string()`) and repeated parsing (`PkgName::parse`) that can be avoided by structuring the manifest-dependencies representation to match lockfile key types.

### Issue Context
- The pre-scan runs before cloning.
- When drift exists, the main update loop runs immediately after and re-parses aliases again.

### Fix Focus Areas
- pnpm/crates/package-manager/src/fast_update_importers.rs[8-115]

### Suggested fix
Consider building `manifest_dependencies` keyed by `PkgName` up-front (parse once), e.g. `HashMap<PkgName, (&str, DependencyGroup)>`, so:
- `importer_diverges` can compare `PkgName` keys without `to_string()` allocations.
- The update loop can reuse the already-parsed `PkgName` keys (no second `PkgName::parse`).

If ownership/lifetimes are a concern, an alternative is to build a parallel `HashSet<PkgName>` of declared aliases for the pre-scan only.

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


Grey Divider

Context used
✅ Compliance rules (platform): 26 rules

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

No code suggestions found for the PR.

@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 6a6932ffd870

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.618 ± 0.114 2.392 2.821 1.71 ± 0.16
pacquet@main 2.466 ± 0.101 2.351 2.703 1.61 ± 0.15
pnpr@HEAD 1.534 ± 0.126 1.353 1.761 1.00
pnpr@main 1.574 ± 0.141 1.378 1.798 1.03 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6181829964600003,
      "stddev": 0.11406929250300374,
      "median": 2.64967195766,
      "user": 2.1691954,
      "system": 1.7401042200000003,
      "min": 2.39177369316,
      "max": 2.82092692916,
      "times": [
        2.64859834116,
        2.65074557416,
        2.39177369316,
        2.5395643581600003,
        2.55448067516,
        2.6674647361600003,
        2.6655509591600004,
        2.82092692916,
        2.68390447716,
        2.55882022116
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.4657173612600003,
      "stddev": 0.10095174772593647,
      "median": 2.4364785921600003,
      "user": 1.9321908000000003,
      "system": 1.5328973199999998,
      "min": 2.35133803816,
      "max": 2.70317795916,
      "times": [
        2.4413035301600003,
        2.70317795916,
        2.4316536541600002,
        2.40346050116,
        2.4306421131600002,
        2.4554299701600004,
        2.35133803816,
        2.52579530816,
        2.53310669816,
        2.38126584016
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.53411117066,
      "stddev": 0.12621875731010843,
      "median": 1.54373558116,
      "user": 1.3578282000000002,
      "system": 1.2609201200000002,
      "min": 1.35258294616,
      "max": 1.7607557551600002,
      "times": [
        1.5952401891599999,
        1.7607557551600002,
        1.35258294616,
        1.36283768916,
        1.56982549416,
        1.47566158416,
        1.56078420616,
        1.4730180691599999,
        1.52668695616,
        1.6637188171600001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5743111093599997,
      "stddev": 0.14109761189037728,
      "median": 1.60890688666,
      "user": 1.3379068999999997,
      "system": 1.2770726199999998,
      "min": 1.37818408716,
      "max": 1.79804368016,
      "times": [
        1.61014084616,
        1.37884783716,
        1.6843705711599999,
        1.50793462816,
        1.69864024316,
        1.79804368016,
        1.6281564821599999,
        1.60767292716,
        1.37818408716,
        1.45111979116
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 262.8 ± 12.3 246.5 287.8 1.00
pacquet@main 283.3 ± 16.4 253.9 306.4 1.08 ± 0.08
pnpr@HEAD 286.4 ± 9.1 274.1 301.2 1.09 ± 0.06
pnpr@main 274.4 ± 9.2 260.4 290.5 1.04 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.26278042372,
      "stddev": 0.012309360885763532,
      "median": 0.26366037082,
      "user": 0.22080218000000001,
      "system": 0.51863078,
      "min": 0.24650767232,
      "max": 0.28783918731999997,
      "times": [
        0.25354622332,
        0.27022855132,
        0.25641844731999996,
        0.26004295132,
        0.24881343132000003,
        0.26856880932,
        0.24650767232,
        0.26856117332,
        0.26727779032,
        0.28783918731999997
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.28331925301999994,
      "stddev": 0.016354047467927978,
      "median": 0.28477767381999997,
      "user": 0.25273028000000003,
      "system": 0.58336448,
      "min": 0.25389889732,
      "max": 0.30642973832,
      "times": [
        0.30642973832,
        0.29862761532,
        0.28348335532,
        0.28607199231999997,
        0.29751427432,
        0.29209991232,
        0.27454236532,
        0.27613097731999997,
        0.26439340231999997,
        0.25389889732
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.28639962342,
      "stddev": 0.009079901521962365,
      "median": 0.28590859982,
      "user": 0.24338308,
      "system": 0.54568398,
      "min": 0.27405508932,
      "max": 0.30119841531999997,
      "times": [
        0.28288563332,
        0.29479706932,
        0.30119841531999997,
        0.27405508932,
        0.28858785232,
        0.29601828632,
        0.27501780532,
        0.28322934732,
        0.27961474432,
        0.28859199132
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.27440417262000005,
      "stddev": 0.00920900863556922,
      "median": 0.27238018131999997,
      "user": 0.23652477999999996,
      "system": 0.5442813799999999,
      "min": 0.26036629631999997,
      "max": 0.29045918032,
      "times": [
        0.28288365332,
        0.27964519532,
        0.27145743631999997,
        0.26630151132,
        0.26614907632,
        0.27282488332,
        0.28201901432,
        0.27193547932,
        0.26036629631999997,
        0.29045918032
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.619 ± 0.032 2.572 2.666 1.64 ± 0.15
pacquet@main 2.644 ± 0.036 2.593 2.721 1.66 ± 0.15
pnpr@HEAD 1.593 ± 0.145 1.439 1.776 1.00
pnpr@main 1.682 ± 0.158 1.491 1.929 1.06 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.61877504406,
      "stddev": 0.031820837367437876,
      "median": 2.6153892586599996,
      "user": 1.8887839199999998,
      "system": 1.49064776,
      "min": 2.57212900116,
      "max": 2.6664924471599996,
      "times": [
        2.6050696101599997,
        2.57212900116,
        2.5813658571599998,
        2.5937815291599997,
        2.6099824521599997,
        2.62079606516,
        2.6664924471599996,
        2.6551375571599998,
        2.63904470416,
        2.6439512171599997
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6440451934599998,
      "stddev": 0.036165046055514787,
      "median": 2.6356406881599996,
      "user": 2.02742392,
      "system": 1.59407556,
      "min": 2.5933273981599996,
      "max": 2.7205540571599998,
      "times": [
        2.67132454516,
        2.5933273981599996,
        2.6117081221599996,
        2.63239191116,
        2.63450781716,
        2.7205540571599998,
        2.67473270216,
        2.63677355916,
        2.6266272001599997,
        2.6385046221599997
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.59331759416,
      "stddev": 0.14500470716544675,
      "median": 1.5073360251599999,
      "user": 1.45704062,
      "system": 1.35143506,
      "min": 1.43862663416,
      "max": 1.77626862916,
      "times": [
        1.74663720516,
        1.77410253916,
        1.50750572416,
        1.46638291416,
        1.77626862916,
        1.50716632616,
        1.74224079716,
        1.43862663416,
        1.48993339516,
        1.48431177716
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.68230592046,
      "stddev": 0.15779009778771305,
      "median": 1.6742125941600001,
      "user": 1.5043676199999998,
      "system": 1.43599376,
      "min": 1.49059570116,
      "max": 1.92879590416,
      "times": [
        1.5226609901600001,
        1.62226455216,
        1.84782554716,
        1.61157470816,
        1.7261606361600002,
        1.4947401851600002,
        1.73866061516,
        1.92879590416,
        1.49059570116,
        1.83978036516
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 529.7 ± 18.3 490.4 552.3 1.58 ± 0.08
pacquet@main 534.0 ± 30.4 491.0 586.4 1.59 ± 0.10
pnpr@HEAD 336.0 ± 11.2 322.3 354.4 1.00
pnpr@main 352.9 ± 17.9 322.9 385.8 1.05 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.5297104996800002,
      "stddev": 0.018345347025572185,
      "median": 0.53062681188,
      "user": 0.7304970799999999,
      "system": 0.8746594799999997,
      "min": 0.49040989488000003,
      "max": 0.55229107188,
      "times": [
        0.5241073018800001,
        0.5183604418800001,
        0.54100650888,
        0.55229107188,
        0.5520342908800001,
        0.52093645588,
        0.53670540688,
        0.49040989488000003,
        0.52511395888,
        0.5361396648800001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.53400980828,
      "stddev": 0.030413608623959545,
      "median": 0.53606044538,
      "user": 0.7623892800000001,
      "system": 0.85268088,
      "min": 0.49099637688000003,
      "max": 0.5863954828800001,
      "times": [
        0.52683090688,
        0.49155111288000003,
        0.5179683018800001,
        0.5638579008800001,
        0.54528998388,
        0.5863954828800001,
        0.5509136118800001,
        0.5206274378800001,
        0.54566696688,
        0.49099637688000003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.33599162158,
      "stddev": 0.011200149414498603,
      "median": 0.33732772538,
      "user": 0.23890307999999996,
      "system": 0.5853920799999999,
      "min": 0.32231391988,
      "max": 0.35436660088000005,
      "times": [
        0.33914473888,
        0.32924597088000007,
        0.35436660088000005,
        0.32389515588000006,
        0.32258687188000007,
        0.34215824788000004,
        0.33551071188000003,
        0.34316660188000003,
        0.34752739588000003,
        0.32231391988
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.35292952808000005,
      "stddev": 0.01793203875452187,
      "median": 0.3538606443800001,
      "user": 0.26696297999999996,
      "system": 0.5986630799999999,
      "min": 0.32290393788000005,
      "max": 0.38578552988000003,
      "times": [
        0.32290393788000005,
        0.3621359168800001,
        0.35358183088000006,
        0.35413945788000006,
        0.35850953288000004,
        0.38578552988000003,
        0.35166571688000003,
        0.36731821388,
        0.34187384088000006,
        0.33138130288000006
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.808 ± 0.064 1.737 1.931 5.47 ± 0.37
pacquet@main 1.753 ± 0.029 1.714 1.808 5.31 ± 0.32
pnpr@HEAD 0.330 ± 0.019 0.301 0.370 1.00
pnpr@main 0.334 ± 0.027 0.302 0.392 1.01 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.80811321762,
      "stddev": 0.06401082328222722,
      "median": 1.80026644332,
      "user": 1.0100222999999997,
      "system": 0.9626024999999998,
      "min": 1.73661847982,
      "max": 1.9314786108200002,
      "times": [
        1.7496989278200001,
        1.73661847982,
        1.74319724582,
        1.8779847388200002,
        1.8438583238200001,
        1.9314786108200002,
        1.83383824182,
        1.79692330782,
        1.80360957882,
        1.7639247208200002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.7528279525200001,
      "stddev": 0.029427320092820265,
      "median": 1.7466092183200002,
      "user": 0.8796668999999999,
      "system": 0.86776,
      "min": 1.7137849558200002,
      "max": 1.80845907582,
      "times": [
        1.75648879082,
        1.7137849558200002,
        1.72173781182,
        1.74467217282,
        1.80845907582,
        1.74147374382,
        1.73210492282,
        1.74854626382,
        1.77740912382,
        1.7836026638200002
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.33034988682,
      "stddev": 0.01924043811603221,
      "median": 0.32386342982000005,
      "user": 0.236232,
      "system": 0.5800546,
      "min": 0.30149835282000004,
      "max": 0.36974704682000004,
      "times": [
        0.31960108582,
        0.32095581582000005,
        0.32677104382,
        0.36974704682000004,
        0.34494587482,
        0.31999967382,
        0.30149835282000004,
        0.31858583582,
        0.34607844682,
        0.33531569182000004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.33402572892,
      "stddev": 0.027143406535798022,
      "median": 0.32433248582000007,
      "user": 0.2402405,
      "system": 0.5754541999999999,
      "min": 0.30248644582,
      "max": 0.39209095682,
      "times": [
        0.34796223482,
        0.39209095682,
        0.34233084582,
        0.31350310382,
        0.32455396082000004,
        0.32411101082000005,
        0.32265844782,
        0.36037820982,
        0.31018207282000004,
        0.30248644582
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 255.5 ± 29.3 215.3 320.5 2.73 ± 0.33
pacquet@main 223.8 ± 19.7 195.2 253.0 2.40 ± 0.23
pnpr@HEAD 93.4 ± 3.4 88.7 103.8 1.00
pnpr@main 93.9 ± 3.4 88.4 105.3 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2555167979618182,
      "stddev": 0.029278030450175456,
      "median": 0.24482158078000002,
      "user": 0.2252288109090909,
      "system": 0.09197062909090911,
      "min": 0.21532933678000002,
      "max": 0.32046460578,
      "times": [
        0.24262594778000002,
        0.24482158078000002,
        0.24154833678,
        0.26428794578000003,
        0.26695644478,
        0.29126115078000003,
        0.32046460578,
        0.25116544978,
        0.23443619778000002,
        0.23778778078,
        0.21532933678000002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.22384291468909093,
      "stddev": 0.019667902003448146,
      "median": 0.23028686178000002,
      "user": 0.1888509018181818,
      "system": 0.06593381090909091,
      "min": 0.19516539578,
      "max": 0.25303806878,
      "times": [
        0.24707696678000002,
        0.23803615078,
        0.20023966178000002,
        0.22265099078,
        0.23426851078000002,
        0.20243848278,
        0.23028686178000002,
        0.25303806878,
        0.19516539578,
        0.20839483678,
        0.23067613478000001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09343779729612905,
      "stddev": 0.0034228562591097893,
      "median": 0.09223054278000001,
      "user": 0.024191171612903215,
      "system": 0.012187908387096774,
      "min": 0.08873583578000001,
      "max": 0.10378345678,
      "times": [
        0.09065886978000001,
        0.09167856378000001,
        0.08969998878,
        0.09208097578,
        0.09539881078000001,
        0.09079718278000001,
        0.09077219578000001,
        0.09115548078,
        0.09027949078000001,
        0.09251735178,
        0.08968519278,
        0.09160335378000001,
        0.09175149378000001,
        0.09489271278000001,
        0.09410765678,
        0.09411496478,
        0.09159199278,
        0.09223054278000001,
        0.08873583578000001,
        0.09209300178,
        0.09517254778,
        0.09048228978,
        0.09233818178,
        0.09719719978000001,
        0.09583679378000001,
        0.10378345678,
        0.09858615478,
        0.09870486378000001,
        0.09992591978000001,
        0.09502684078000001,
        0.09367180878
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.09391971611333333,
      "stddev": 0.003426163264184644,
      "median": 0.09411867528000001,
      "user": 0.024354386666666665,
      "system": 0.01278452,
      "min": 0.08843319678,
      "max": 0.10533845678,
      "times": [
        0.09433154078,
        0.09117313578000001,
        0.08918124278,
        0.09202518978,
        0.09203170778000001,
        0.08843319678,
        0.09557902678,
        0.09062501278,
        0.09610838878000001,
        0.09706522678000001,
        0.08965310678,
        0.09599430178000001,
        0.09303569078000001,
        0.09278564378000001,
        0.09297909178000001,
        0.10533845678,
        0.08902025578,
        0.09085732678000001,
        0.09410337978000001,
        0.09259974578,
        0.09349551278000001,
        0.09513127378000001,
        0.10004983878000001,
        0.09612160278000001,
        0.09413397078,
        0.09624344078000001,
        0.09523509878000001,
        0.09515948578000001,
        0.09431085078000001,
        0.09478973978
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 961.2 ± 337.7 629.7 1619.8 1.00
pacquet@main 970.7 ± 172.8 614.6 1210.8 1.01 ± 0.40
pnpm@HEAD 3558.4 ± 233.5 3230.7 3968.1 3.70 ± 1.32
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.9612426064355556,
      "stddev": 0.3377272223416577,
      "median": 0.8313479198800001,
      "user": 0.911773588888889,
      "system": 0.18314351999999998,
      "min": 0.62968936088,
      "max": 1.61978435388,
      "times": [
        0.7218366188800001,
        0.62968936088,
        0.8022342828800001,
        0.8313479198800001,
        1.24149351888,
        1.61978435388,
        0.9067817588800001,
        1.2552717478800002,
        0.6427438958800001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.9707271875466669,
      "stddev": 0.17276760996127105,
      "median": 1.00896041988,
      "user": 0.9364888111111109,
      "system": 0.18751418666666664,
      "min": 0.6146365718800001,
      "max": 1.2107690398800002,
      "times": [
        0.6146365718800001,
        0.8622614788800002,
        0.9793022538800001,
        1.00896041988,
        1.0995829668800001,
        1.2107690398800002,
        1.03721933988,
        1.06162542188,
        0.8621871948800001
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.558401402213333,
      "stddev": 0.2335038777367015,
      "median": 3.52962977988,
      "user": 5.17971358888889,
      "system": 0.36951607555555555,
      "min": 3.23072499988,
      "max": 3.96806525088,
      "times": [
        3.72511459888,
        3.68561346688,
        3.52962977988,
        3.27902049388,
        3.48595809188,
        3.23072499988,
        3.43252538588,
        3.96806525088,
        3.68896055188
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.662 ± 0.129 4.561 4.905 1.31 ± 0.06
pacquet@main 4.677 ± 0.176 4.523 4.996 1.31 ± 0.07
pnpr@HEAD 3.562 ± 0.144 3.454 3.935 1.00
pnpr@main 3.574 ± 0.063 3.472 3.674 1.00 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.66212395154,
      "stddev": 0.1289417563727637,
      "median": 4.60632844424,
      "user": 2.7526735600000003,
      "system": 2.0204648599999997,
      "min": 4.56061217374,
      "max": 4.90530790074,
      "times": [
        4.566796827739999,
        4.60449624174,
        4.90530790074,
        4.60816064674,
        4.57238153674,
        4.65392064074,
        4.89143662474,
        4.66052115874,
        4.59760576374,
        4.56061217374
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.67665020524,
      "stddev": 0.1764577363368434,
      "median": 4.59055521774,
      "user": 2.5718423599999998,
      "system": 1.9454490599999996,
      "min": 4.5233301057399995,
      "max": 4.99573586174,
      "times": [
        4.68389741674,
        4.59108131374,
        4.564588477739999,
        4.56118293374,
        4.75445115774,
        4.99573586174,
        4.5233301057399995,
        4.53086929774,
        4.59002912174,
        4.97133636574
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5621511447400005,
      "stddev": 0.14404961714292666,
      "median": 3.50449776424,
      "user": 1.46748096,
      "system": 1.3618903599999999,
      "min": 3.45439143174,
      "max": 3.93466709174,
      "times": [
        3.93466709174,
        3.65423073074,
        3.4832785577400003,
        3.50937297374,
        3.49962255474,
        3.5952177087400004,
        3.45439143174,
        3.52416702974,
        3.48376850574,
        3.48279486274
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.5743819601399998,
      "stddev": 0.06273368268694057,
      "median": 3.56934105724,
      "user": 1.69875096,
      "system": 1.5138014599999998,
      "min": 3.4724508857400003,
      "max": 3.67417796474,
      "times": [
        3.55807220774,
        3.53463303374,
        3.63137150974,
        3.67417796474,
        3.51697871074,
        3.4724508857400003,
        3.58327776874,
        3.58060990674,
        3.54312294574,
        3.64912466774
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13762
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,572.13 ms
(-2.05%)Baseline: 2,626.04 ms
3,151.25 ms
(81.62%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,736.62 ms
(-0.74%)Baseline: 1,749.50 ms
2,099.40 ms
(82.72%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
490.41 ms
(+12.84%)Baseline: 434.60 ms
521.52 ms
(94.04%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
215.33 ms
(+0.29%)Baseline: 214.72 ms
257.66 ms
(83.57%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,391.77 ms
(-0.96%)Baseline: 2,414.99 ms
2,897.98 ms
(82.53%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,560.61 ms
(+1.14%)Baseline: 4,509.36 ms
5,411.23 ms
(84.28%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
246.51 ms
(-9.25%)Baseline: 271.62 ms
325.94 ms
(75.63%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
629.69 ms
(-9.51%)Baseline: 695.87 ms
835.04 ms
(75.41%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13762
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,438.63 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
301.50 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
322.31 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
88.74 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,352.58 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,454.39 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
274.06 ms
🐰 View full continuous benchmarking report in Bencher

Base automatically changed from group-moves to main August 10, 2026 12:44
Copilot AI lite review requested due to automatic review settings August 10, 2026 12:49

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 10, 2026

Copy link
Copy Markdown
Member Author

Addressed in b17c360:

  1. Prototype-chain key retention — fixed: the wholesale-replacement check now uses Object.hasOwn instead of in.
  2. Bugfix mixed with refactor — declining the split. The bug is not incidental to the refactor: the stale-catalogs retention is a defect of the double-staging design this PR removes, and the fix (wholesale key replacement in the coordinator) only makes sense once handlers stop copying back explicitly. Splitting would mean landing a throwaway patch against code this PR deletes.
  3. Alloc-heavy drift pre-scan — fixed: the manifest map is now keyed by PkgName, parsed once at map build, so the pre-scan, the update loop, and the removal filter all test membership without per-dependency to_string()/re-parse work.

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

@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 (2)
.changeset/group-moves-fast-update.md (1)

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

Use user-visible wording for the release note.

The phrase “updates the lockfile in place instead of re-resolving the whole dependency graph” describes the implementation. State the observable benefit instead: the install reuses existing resolutions during dependency-group moves.

Suggested wording
-`pnpm install` after moving a dependency between `dependencies`, `devDependencies`, and `optionalDependencies` now updates the lockfile in place instead of re-resolving the whole dependency graph [`#13696`](https://github.com/pnpm/pnpm/issues/13696).
+`pnpm install` now reuses existing dependency resolutions when a dependency moves between `dependencies`, `devDependencies`, and `optionalDependencies` [`#13696`](https://github.com/pnpm/pnpm/issues/13696).

As per path instructions and retrieved learnings, Changeset entries should describe concise user-visible behavior rather than internal implementation rationale.

🤖 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 @.changeset/group-moves-fast-update.md at line 7, Rewrite the changeset entry
to describe the user-visible behavior: when moving a dependency between
dependencies, devDependencies, and optionalDependencies, pnpm install reuses the
existing dependency resolutions. Remove the implementation-focused wording about
updating the lockfile in place and re-resolving the graph.

Sources: Path instructions, Learnings

pnpm11/installing/deps-installer/test/install/importerGroupMoveFastUpdate.ts (1)

182-190: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated trackRequestedPackages helper across two fast-update test files. Both test files define the same helper, which wraps storeController.requestPackage to record requested aliases. A single shared helper prevents the two copies from diverging.

  • pnpm11/installing/deps-installer/test/install/importerGroupMoveFastUpdate.ts#L182-L190: remove the local helper and import a shared one from test/utils.
  • pnpm11/installing/deps-installer/test/install/importerRemovalFastUpdate.ts#L174-L182: remove the local helper and import the same shared one.
🤖 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 `@pnpm11/installing/deps-installer/test/install/importerGroupMoveFastUpdate.ts`
around lines 182 - 190, Remove the duplicated trackRequestedPackages helper from
pnpm11/installing/deps-installer/test/install/importerGroupMoveFastUpdate.ts
lines 182-190 and
pnpm11/installing/deps-installer/test/install/importerRemovalFastUpdate.ts lines
174-182, add one shared implementation under test/utils, and import it in both
test files while preserving existing usage.
🤖 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 @.changeset/group-moves-fast-update.md:
- Line 7: Rewrite the changeset entry to describe the user-visible behavior:
when moving a dependency between dependencies, devDependencies, and
optionalDependencies, pnpm install reuses the existing dependency resolutions.
Remove the implementation-focused wording about updating the lockfile in place
and re-resolving the graph.

In
`@pnpm11/installing/deps-installer/test/install/importerGroupMoveFastUpdate.ts`:
- Around line 182-190: Remove the duplicated trackRequestedPackages helper from
pnpm11/installing/deps-installer/test/install/importerGroupMoveFastUpdate.ts
lines 182-190 and
pnpm11/installing/deps-installer/test/install/importerRemovalFastUpdate.ts lines
174-182, add one shared implementation under test/utils, and import it in both
test files while preserving existing usage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2d254fc2-1027-40e6-bf58-9d171faad576

📥 Commits

Reviewing files that changed from the base of the PR and between 4063779 and b17c360.

📒 Files selected for processing (12)
  • .changeset/fast-update-single-staging.md
  • .changeset/group-moves-fast-update.md
  • pnpm/crates/cli/tests/suite/lockfile_resolution_reuse.rs
  • pnpm/crates/package-manager/src/fast_update_importers.rs
  • pnpm/crates/package-manager/src/fast_update_importers/tests.rs
  • pnpm/crates/package-manager/src/fast_update_lockfile.rs
  • pnpm11/installing/deps-installer/src/install/index.ts
  • pnpm11/installing/deps-installer/src/install/tryFastUpdateImporters.ts
  • pnpm11/installing/deps-installer/src/install/tryFastUpdateLockfile.ts
  • pnpm11/installing/deps-installer/test/install/catalogFastUpdate.ts
  • pnpm11/installing/deps-installer/test/install/importerGroupMoveFastUpdate.ts
  • pnpm11/installing/deps-installer/test/install/importerRemovalFastUpdate.ts

The fast-update coordinator already stages every rewrite on a clone
and discards it unless the candidate passes the freshness gates, so
the importers handler staging its own inner clone and copying back
was a second, redundant layer; it now mutates the coordinator's
candidate directly. The coordinator also commits by replacing the
lockfile's keys wholesale instead of Object.assign, which silently
kept top-level keys the update had deleted: removing the last
referent of a catalog entry through the fast path left the stale
catalogs section in the written lockfile.

pacquet's importers handler now scans for manifest drift before
cloning the lockfile, so installs whose drift lies elsewhere (a
settings or patch change) no longer pay a full lockfile clone in the
handler; the other pacquet handlers already detected before cloning.
The canTryFastUpdateLockfile trigger list is deduplicated into a
FAST_UPDATABLE_SETTINGS constant.

Related to #13696.
The importers handler's manifest map is now keyed by PkgName, parsed
once when the map is built, so the drift pre-scan, the update loop,
and the removal filter test membership without per-dependency string
conversions. The TypeScript empty-group cleanup only runs for a
project whose groups were actually edited. The coordinator's
wholesale-replacement check uses Object.hasOwn instead of the
prototype-chain-sensitive in operator.
Copilot AI review requested due to automatic review settings August 10, 2026 12:55
@zkochan
zkochan force-pushed the fast-update-stage1 branch from b17c360 to 6a6932f Compare August 10, 2026 12:55

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.

@qodo-code-review

Copy link
Copy Markdown

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

@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 d8e360d into main Aug 10, 2026
35 checks passed
@zkochan
zkochan deleted the fast-update-stage1 branch August 10, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants