Skip to content

perf(lockfile): rewrite exact catalog version changes without resolving - #13689

Merged
zkochan merged 5 commits into
mainfrom
perf-lockfile5
Aug 7, 2026
Merged

zkochan merged 5 commits into
mainfrom
perf-lockfile5

Conversation

@zkochan

@zkochan zkochan commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes the last stage of #13474, after #13477 (catalogs), #13482 (ignored optional dependencies), #13600 (setting-only updates), and #13680 (patched dependencies).

The existing catalog fast path only handles a specifier the locked version still satisfies: it updates the specifier and keeps the version. A catalog entry moved to a different exact version left it with nothing to do, so the install fell back to a full resolution.

Replacing the package is the same rewrite an exact pnpm.overrides entry performs, so this reuses that machinery rather than growing a second rewriter — including the check that every locked child still satisfies the new version's manifest, and the existing refusals for peer-suffixed keys, registry-qualified keys, patched or optional snapshots, and packages declaring peer dependencies.

  • Split the override path into its plan building and a shared apply step, so the catalog caller can drive the rewrite and record the updated catalog snapshot instead of writing synthetic overrides into the lockfile.
  • Build the same plan from the catalog entries whose version moved, chained after the range-only rewrite, which declines exactly the changes this handles.
  • Implemented in both the TypeScript CLI (tryFastUpdateCatalogVersions) and pacquet (fast_update_catalog_versions).

The guard that makes this different from an override

An override moves a package everywhere it appears. A catalog entry only governs the importers that reference it, so if anything else reaches the package — an importer depending on it directly, or any package depending on it — the graph would have to hold both the old and the new version, which this rewrite cannot express. Both stacks fall back in that case, with a test for each direction.

Squash Commit Body

A catalog entry that moves to a version the locked one cannot satisfy left
the range-only fast path with nothing to do, so the install fell back to a
full resolution. Replacing the package is the same rewrite an exact
`pnpm.overrides` entry performs, so reuse that machinery rather than
growing a second rewriter: the same dependency-shape validation decides
whether every locked child still fits the new version.

Split the override path into its plan building and a shared apply step so
the catalog caller can drive the rewrite without writing synthetic
overrides into the lockfile, and record the updated catalog snapshot
instead.

An override moves a package everywhere it appears; a catalog entry only
governs the importers that reference it. Fall back when anything else
reaches the package -- an importer pinning it directly, or any package
depending on it -- since the graph would then have to hold both versions.

Implemented in both the TypeScript CLI and pacquet.

Closes pnpm/pnpm#13474.

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

  • Performance

    • Compatible exact-version catalog changes can update lockfiles without full dependency resolution.
    • Unchanged and range-only catalog updates preserve existing locked versions where possible.
    • Unsupported, ambiguous, or incompatible changes automatically fall back to full resolution.
  • Bug Fixes

    • Improved validation prevents updates when dependencies or catalog references conflict.
    • Lockfile and catalog metadata are validated before changes are applied.
  • Tests

    • Added coverage for successful updates, compatibility checks, unchanged entries, snapshot validation, and fallback scenarios.

Copilot AI lite review requested due to automatic review settings August 6, 2026 21: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 6, 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: 0cbb4cdf-8e4d-418a-a74d-6b3bda0a62fd

📥 Commits

Reviewing files that changed from the base of the PR and between 3adc962 and 5f5d577.

📒 Files selected for processing (2)
  • pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts
  • pnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • pnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts
  • pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts

📝 Walkthrough

Walkthrough

Adds fast exact-version catalog updates in the Rust and TypeScript installers. The flow reuses fast override rewriting, validates exclusive catalog references and dependency compatibility, updates lockfiles directly when safe, and falls back to full resolution otherwise.

Changes

Catalog version fast update

Layer / File(s) Summary
Shared fast rewrite infrastructure
pnpm/crates/package-manager/src/fast_update_overrides.rs, pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts, pnpm/crates/package-manager/src/fast_update_overrides/tests.rs
A shared rewrite context and reusable planning and application functions now support catalog updates. Lockfile settings apply generically, and manifest-hook validation covers additional fields.
Rust catalog rewrite and lockfile reuse
pnpm/crates/package-manager/src/fast_update_catalog_versions.rs, pnpm/crates/package-manager/src/install_with_fresh_lockfile/resolve.rs, pnpm/crates/package-manager/src/fast_update_catalogs.rs, pnpm/crates/package-manager/src/lib.rs
The Rust flow rewrites exact catalog versions when references and dependency ranges are compatible. Lockfile reuse invokes the new path before full resolution.
Rust catalog rewrite validation
pnpm/crates/package-manager/src/fast_update_catalog_versions/tests.rs
Tests cover successful replacement, incompatible child ranges, direct references, missing entries, conflicting catalogs, and range updates.
TypeScript catalog rewrite and install integration
pnpm11/installing/deps-installer/src/install/index.ts, pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts, pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogs.ts
The installer performs range-only updates first, then attempts exact-version rewrites. Unsupported cases fall back to full resolution.
TypeScript validation and release metadata
pnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts, .changeset/exact-catalog-version-rewrite.md
Tests cover replacement and fallback cases. The changeset records the release behavior.

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

Possibly related issues

Possibly related PRs

  • pnpm/pnpm#13464 — Provides the fast rewrite infrastructure reused by this change.
  • pnpm/pnpm#13477 — Modifies compatible-range catalog updates in the same fast-update flow.
  • pnpm/pnpm#13172 — Modifies catalog-version fast updates and workspace catalog handling.

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

Suggested reviewers: copilot

✨ 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 perf-lockfile5

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

Fast-path lockfile rewrite for exact catalog version changes (no resolution)

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Add a fast path to rewrite lockfile snapshots when a catalog entry moves to a new exact version.
• Reuse the exact-override rewrite engine (plan + apply) for both catalogs and overrides.
• Fall back to full resolution when the package is reachable outside the catalog scope.
Diagram

graph TD
A["Install path"] --> B["Catalog range fast path"] --> C{{"Did rewrite?"}}
C -->|"yes"| L[("Lockfile updated")]
C -->|"no"| D["Catalog exact-version fast path"] --> E["Rewrite plan+apply"] --> F["Registry manifest resolver"] --> L
subgraph Legend
  direction LR
  _p(["Process"]) ~~~ _d{{"Decision"}} ~~~ _l[("Lockfile")]
end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Write synthetic overrides into lockfile and reuse override fast path
  • ➕ Minimal new surface area: drive everything through existing override entrypoint
  • ➕ Potentially fewer code paths to maintain
  • ➖ Would mutate/record the wrong setting source (overrides) instead of catalogs
  • ➖ Harder to reason about correctness and audit behavior (synthetic config)
2. Build a dedicated catalog-only package rewriter
  • ➕ Could tailor rules precisely to catalog semantics without sharing override restrictions
  • ➖ Duplicate complex safety checks (manifest validation, snapshot/package rewrite rules)
  • ➖ Higher long-term maintenance and risk of behavior drift vs overrides
3. Allow dual versions (old + new) during fast rewrite
  • ➕ Could handle cases where non-catalog edges still reference the old version
  • ➖ Essentially reintroduces partial resolution complexity; lockfile graph reshaping becomes non-trivial
  • ➖ High risk and likely exceeds “fast path” intent

Recommendation: Reusing the existing exact-override rewrite engine (by splitting it into plan-building + shared apply) is the best tradeoff: it avoids duplicating correctness-critical validation and keeps the new catalog path small. The explicit “sole reference” guard is appropriate to preserve catalog scoping; supporting mixed old/new versions would require substantially more complexity and is better handled by falling back to full resolution.

Files changed (11) +656 / -51

Enhancement (4) +263 / -8
fast_update_catalog_versions.rsImplement Rust fast path for exact catalog version moves +114/-0

Implement Rust fast path for exact catalog version moves

• Adds a new fast updater that detects catalog entries whose specifier changed to a different exact version and builds a replacement plan using the override rewrite machinery. Includes a guard that declines the fast path unless the catalog is the sole reference to the package, then updates lockfile catalogs to the new resolved snapshot.

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

resolve.rsWire catalog exact-version fast path into lockfile reuse seeding +34/-7

Wire catalog exact-version fast path into lockfile reuse seeding

• Adds an additional fast-path attempt when catalogs differ due to an exact version move (after the range-only path declines). Uses the shared RewriteContext and shared manifest hook composition, and declines when overrides use catalogs or other eligibility checks fail.

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

index.tsInvoke catalog exact-version fast path after range-only attempt +22/-1

Invoke catalog exact-version fast path after range-only attempt

• When the changed setting is catalogs, first tries the existing range-only fast update; if it declines, attempts the new exact-version rewrite (unless overrides use catalogs). Threads resolver/trust/policy options through to the new function.

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

tryFastUpdateCatalogVersions.tsAdd TS fast path to rewrite exact catalog version moves +93/-0

Add TS fast path to rewrite exact catalog version moves

• Implements catalog-driven replacement using the existing override rewrite machinery via applyFastRewrite. Detects exact-version changes, enforces “sole reference” semantics (no direct importer pins and no transitive dependents), and records updated lockfile.catalogs when successful.

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

Refactor (3) +95 / -37
fast_update_overrides.rsRefactor override fast path into shared plan/apply rewrite engine +62/-25

Refactor override fast path into shared plan/apply rewrite engine

• Exports FastOverride/RewritePlan and introduces a RewriteContext to decouple rewrite execution from override-specific settings. Splits the logic into build_replacement_plan (shared) and apply_rewrite_plan (shared), letting different callers (overrides vs catalogs) record the appropriate lockfile setting block.

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

lib.rsRegister new fast_update_catalog_versions module +1/-0

Register new fast_update_catalog_versions module

• Adds the new Rust module to the crate module list so it can be invoked from the install/resolve flow.

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

tryFastUpdateOverrides.tsExtract shared applyFastRewrite and generalize rewrite options +32/-12

Extract shared applyFastRewrite and generalize rewrite options

• Exports FastOverride and introduces FastRewriteOptions plus a new applyFastRewrite helper that performs the rewrite and records whichever lockfile settings block drove it. Updates tryFastUpdateOverrides to delegate to applyFastRewrite and set overrides via settings assignment.

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

Tests (3) +291 / -6
tests.rsAdd Rust unit tests for catalog exact-version rewrite +198/-0

Add Rust unit tests for catalog exact-version rewrite

• Introduces a stub resolver and fixture lockfile to validate successful replacement when locked children still satisfy the new manifest. Adds fallback coverage for child incompatibility, direct importer pins, transitive dependents, and range-only changes that belong to the existing path.

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

tests.rsUpdate override tests to use RewriteContext +8/-6

Update override tests to use RewriteContext

• Adjusts test helpers to pass the new RewriteContext structure into try_fast_update_overrides, matching the refactored API.

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

catalogVersionFastUpdate.tsAdd TS tests for exact catalog version rewrite behavior +85/-0

Add TS tests for exact catalog version rewrite behavior

• Adds Jest coverage verifying successful package replacement and catalog snapshot update when the locked child still fits the new manifest. Includes fallback tests for child incompatibility, direct importer pins, transitive dependents, and range-only changes that should be handled elsewhere.

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

Documentation (1) +7 / -0
exact-catalog-version-rewrite.mdAdd changeset for exact catalog version rewrite fast path +7/-0

Add changeset for exact catalog version rewrite fast path

• Documents the new behavior: exact catalog version moves now rewrite pnpm-lock.yaml directly without full re-resolution, reusing override fast-path validation and falling back when other edges reference the package.

.changeset/exact-catalog-version-rewrite.md

@greptile-apps

greptile-apps Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (5): Last reviewed commit: "fix(deps-installer): absorb satisfied ca..." | Re-trigger Greptile

@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: 3

🧹 Nitpick comments (2)
pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts (1)

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

Use one options object for applyFastRewrite.

applyFastRewrite has four arguments. Use one specific options object for these inputs. This follows the TypeScript argument-limit rule and makes shared call sites less error-prone.

As per coding guidelines, functions must use an options object when they need more than three arguments.

🤖 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/src/install/tryFastUpdateOverrides.ts`
around lines 78 - 83, Update applyFastRewrite to accept a single options object
containing lockfile, fastOverrides, opts, and settings instead of four
positional arguments. Adjust every call site and internal destructuring to use
the new object shape while preserving existing behavior.

Source: Coding guidelines

.changeset/exact-catalog-version-rewrite.md (1)

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

Reduce this changeset to the observable install behavior.

The shared override mechanism and graph-reference conditions are implementation details. Keep the release note concise and user-facing.

Proposed changeset text
-Changing a catalog entry to a different exact version no longer re-resolves the dependency graph. The package is replaced in `pnpm-lock.yaml` directly, reusing the same check the `pnpm.overrides` fast path applies: every locked dependency of the package must still satisfy the new version's manifest. Installs fall back to a full resolution when anything other than the catalog reaches the package — an importer that depends on it directly, or another package that depends on it — since the graph would then need both versions.
+Changing a catalog entry to a different exact version can update compatible `pnpm-lock.yaml` entries without full dependency resolution.

As per coding guidelines, changeset text must describe user-visible behavior and keep implementation rationale in commits. Based on learnings, avoid internal resolver details in Changeset entries.

🤖 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/exact-catalog-version-rewrite.md at line 7, Rewrite the changeset
to describe only the user-visible install behavior when changing a catalog entry
to a different exact version: reuse the existing lockfile when the dependency
graph remains compatible, otherwise perform a full resolution. Remove references
to shared override logic, graph traversal, importers, manifests, and other
resolver implementation details.

Sources: Coding guidelines, Path instructions, Learnings

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

Inline comments:
In `@pnpm/crates/package-manager/src/fast_update_catalog_versions.rs`:
- Around line 27-34: Before rewriting entries in the fast catalog update helper,
invoke the same catalog-reference snapshot guard used by
try_fast_update_catalogs. Preserve its fallback behavior so unsupported snapshot
or key shapes return no reuse candidate and trigger full resolution, including
when another catalog reference lacks its required snapshot.

In `@pnpm11/installing/deps-installer/src/install/index.ts`:
- Around line 771-793: Update the catalog rewrite flow around
tryFastUpdateCatalogs and tryFastUpdateCatalogVersions so the exact-version
helper always runs after the range-only helper, even when the latter returns
true; return true when either helper succeeds, and only return the range-only
result when the exact-version helper declines. Preserve the overridesUseCatalogs
guard, and add an install-level regression covering a mixed update with both a
range-only catalog change and an exact-version package move.

In `@pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts`:
- Around line 78-83: Update applyFastRewrite and its manifest-processing flow to
rerun the complete safety validation on the manifest after readPackageHook,
rejecting changes to name, version, deprecated, bundled dependencies, and
engines.runtime consistently with Rust’s is_safe_registry_result behavior.
Preserve the existing fallback path for unsafe rewrites, and add matching
TypeScript and Rust tests covering hooks that introduce each protected field and
verify identical lockfile and fallback semantics.

---

Nitpick comments:
In @.changeset/exact-catalog-version-rewrite.md:
- Line 7: Rewrite the changeset to describe only the user-visible install
behavior when changing a catalog entry to a different exact version: reuse the
existing lockfile when the dependency graph remains compatible, otherwise
perform a full resolution. Remove references to shared override logic, graph
traversal, importers, manifests, and other resolver implementation details.

In `@pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts`:
- Around line 78-83: Update applyFastRewrite to accept a single options object
containing lockfile, fastOverrides, opts, and settings instead of four
positional arguments. Adjust every call site and internal destructuring to use
the new object shape while preserving existing 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: d15c2745-6296-4980-a92d-fdb23f979019

📥 Commits

Reviewing files that changed from the base of the PR and between 8ae2e28 and 290f574.

📒 Files selected for processing (11)
  • .changeset/exact-catalog-version-rewrite.md
  • pnpm/crates/package-manager/src/fast_update_catalog_versions.rs
  • pnpm/crates/package-manager/src/fast_update_catalog_versions/tests.rs
  • pnpm/crates/package-manager/src/fast_update_overrides.rs
  • pnpm/crates/package-manager/src/fast_update_overrides/tests.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile/resolve.rs
  • pnpm/crates/package-manager/src/lib.rs
  • pnpm11/installing/deps-installer/src/install/index.ts
  • pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts
  • pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts
  • pnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Partial catalog update committed ✓ Resolved 🐞 Bug ≡ Correctness
Description
When changedSetting === 'catalogs', the update callback returns `(await
tryFastUpdateCatalogVersions(...) || rewroteRanges)`, so a failed exact-version rewrite can still
return true if the range-only rewrite succeeded. This causes tryFastUpdateLockfile to commit a
lockfile that still contains the old exact catalog version, skipping the full resolution that was
required.
Code

pnpm11/installing/deps-installer/src/install/index.ts[R792-794]

+                trustPolicyIgnoreAfter: opts.trustPolicyIgnoreAfter,
+                isLockfileUpToDate,
+              }) || rewroteRanges
Relevance

●●● Strong

Atomicity/partial-commit bugs in fast-update paths are typically fixed; they’ve accepted
transactional guards before.

PR-#13477

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
index.ts currently treats a failed exact-move rewrite the same as a no-op by OR-ing the result
with rewroteRanges. Since tryFastUpdateLockfile commits the candidate whenever the update
callback returns true, this can persist the range-only changes while leaving required exact catalog
moves unapplied.

pnpm11/installing/deps-installer/src/install/index.ts[770-795]
pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts[31-61]
pnpm11/installing/deps-installer/src/install/tryFastUpdateLockfile.ts[4-18]
pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogs.ts[18-46]

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 catalogs fast-update path can incorrectly succeed with a *partially* rewritten lockfile. In `mutateModules()` when `changedSetting === 'catalogs'`, the code first applies the range-only rewrite, then attempts the exact-version rewrite. If the exact-version rewrite declines (needs full resolution), the expression `await tryFastUpdateCatalogVersions(...) || rewroteRanges` still returns `true` when `rewroteRanges` is `true`, causing `tryFastUpdateLockfile` to commit the partially-updated candidate.

This can leave the lockfile not reflecting the updated catalogs configuration (specifically: exact catalog moves remain at the old version), but the install proceeds without running the resolver.

### Issue Context
- `tryFastUpdateLockfile` clones the lockfile and commits the candidate whenever `update(candidate)` returns `true`.
- `tryFastUpdateCatalogVersions()` returns `false` both when (a) there are no exact moves to apply *and* when (b) an exact move is present but unsafe and should fall back.
- The `|| rewroteRanges` fallback therefore conflates “no exact work” with “exact work failed; must resolve”.

### Fix approach
Make the catalogs fast-update decision **all-or-nothing**:
- Only fall back to `rewroteRanges` when `tryFastUpdateCatalogVersions` indicates **no exact moves were applicable**.
- If exact moves are applicable but the fast exact rewrite fails, return `false` so the installer falls back to full resolution.

Concrete options:
1. Change `tryFastUpdateCatalogVersions` to return a tri-state, e.g. `Promise<'no_exact_moves' | 'applied' | 'unsupported'>`, and in `index.ts`:
  - `'applied'` => return `true`
  - `'no_exact_moves'` => return `rewroteRanges`
  - `'unsupported'` => return `false`
2. Keep boolean API but add a cheap “needsExactCatalogMove” pre-scan in `index.ts` (or expose one from `tryFastUpdateCatalogVersions`) so you only do `|| rewroteRanges` when no exact moves exist.

### Fix Focus Areas
- pnpm11/installing/deps-installer/src/install/index.ts[770-795]
- pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts[27-61]

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



Remediation recommended

2. Duplicate range-only comment 📘 Rule violation ⚙ Maintainability ⭐ New
Description
The explanatory comment above the range-only rewrite/range-satisfaction check is duplicated
verbatim, adding noise and increasing maintenance cost and the risk that future edits update only
one copy. This violates the guideline to avoid redundant comments that simply restate what’s already
clear from the code.
Code

pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts[R56-59]

+      // A specifier the locked version still satisfies moves nothing but the
+      // specifier, exactly as the range-only path would.
+      // A specifier the locked version still satisfies moves nothing but the
+      // specifier, exactly as the range-only path would.
Relevance

●●● Strong

Team often trims redundant/duplicated comments; exact precedent removing duplicated header/call-site
comments was accepted.

PR-#11739
PR-#13468
PR-#13350

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713467 requires avoiding comments that restate what is already clear from the code,
and tryFastUpdateCatalogVersions.ts[56-59] shows the same two-line explanation of the range-only
behavior repeated back-to-back immediately before the `semver.validRange(...) &&
semver.satisfies(...)` condition, demonstrating the redundancy.

Rule 713467: Avoid redundant comments that restate the code
pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts[56-59]
pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts[55-62]

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

## Issue description
A two-line comment explaining the “range-only” behavior is duplicated verbatim immediately before the `semver.validRange(...)` / `semver.satisfies(...)` check in `tryFastUpdateCatalogVersions`, which is redundant and increases noise, maintenance cost, and the chance the two copies diverge in future edits.

## Issue Context
This is inside `tryFastUpdateCatalogVersions` directly above the `semver.validRange(...) && semver.satisfies(...)` condition; the comment appears twice consecutively and says the same thing.

## Fix Focus Areas
- pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts[56-59]

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


3. Duplicated override-plan comment 📘 Rule violation ⚙ Maintainability
Description
The duplicate-explanation comment above the overrides de-duplication check repeats itself with only
minor reflow, which is redundant and makes future edits error-prone.
Code

pnpm/crates/package-manager/src/fast_update_overrides.rs[R180-183]

+    // Two entries naming one package would each claim its key, and only
+    // one of them could win.
+    // Two entries naming one package would each claim its key, and only one
+    // of them could win. Both callers reject that earlier for their own
Relevance

●●● Strong

Redundant back-to-back comment is low-risk cleanup aligned with prior accepted doc/comment
tightening.

PR-#13256
PR-#13572

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713467 requires avoiding redundant comments. The comment explaining why duplicate
override entries are rejected is stated twice back-to-back above the same if overrides.iter()...
check.

Rule 713467: Avoid redundant comments that restate the code
pnpm/crates/package-manager/src/fast_update_overrides.rs[180-189]

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 comment above the override de-duplication check repeats the same point twice.

## Issue Context
Redundant comments are discouraged because they add noise and can become inconsistent during later edits.

## Fix Focus Areas
- pnpm/crates/package-manager/src/fast_update_overrides.rs[180-184]

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


4. Rust-only mixed-update test ✓ Resolved 📘 Rule violation ▣ Testability
Description
A new Rust test covers the mixed scenario (range-only catalog rewrite alongside an exact version
move) but there is no mirrored TypeScript test asserting the same behavior, weakening cross-stack
parity guarantees.
Code

pnpm/crates/package-manager/src/fast_update_catalog_versions/tests.rs[R231-234]

+#[tokio::test]
+async fn absorbs_a_range_only_entry_alongside_an_exact_move() {
+    let mut subject = lockfile();
+    subject.catalogs.as_mut().expect("catalogs").get_mut("default").expect("default").insert(
Relevance

●●● Strong

They enforce Rust/TS parity via mirrored tests for cross-stack behavior; missing TS mirror likely
requested.

PR-#13597

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 2255044 requires mirrored tests across Rust and TypeScript when cross-stack
behavior changes are involved. The Rust test absorbs_a_range_only_entry_alongside_an_exact_move
asserts a specific mixed-update contract that is not currently mirrored by an equivalent TypeScript
test in this PR.

Rule 2255044: Cross-stack behavior changes must have mirrored tests in Rust and TypeScript
pnpm/crates/package-manager/src/fast_update_catalog_versions/tests.rs[231-257]

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

## Issue description
A Rust test was added for the "range-only entry alongside exact move" scenario, but there is no equivalent TypeScript test covering the same scenario for `tryFastUpdateCatalogVersions`.

## Issue Context
This PR implements parallel fast-path behavior in both Rust (pacquet) and TypeScript (pnpm). When a behavior scenario is asserted in one stack, the other stack should have a mirrored test to prevent regressions/divergence.

## Fix Focus Areas
- pnpm/crates/package-manager/src/fast_update_catalog_versions/tests.rs[231-257]
- pnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts[50-105]

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


View more (2)
5. Duplicated gate comment block 📘 Rule violation ⚙ Maintainability
Description
The comment explaining the catalog snapshot gate is duplicated verbatim, adding noise and increasing
maintenance cost when the gate behavior changes.
Code

pnpm/crates/package-manager/src/fast_update_catalog_versions.rs[R25-28]

+    // The same gate the range-only path opens with: an importer pointing at
+    // a catalog entry with nothing recorded for it needs the resolver, and
+    // this path would otherwise never look at that entry.
+    // The same gate the range-only path opens with: an importer pointing at
Relevance

●●● Strong

Team frequently trims/rewrites noisy comments/docs to prevent drift; duplicated block is clear
maintenance noise.

PR-#13661
PR-#13256

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713467 forbids redundant comments that don't add new intent/rationale. The same
three-line comment appears twice consecutively immediately above the gate check.

Rule 713467: Avoid redundant comments that restate the code
pnpm/crates/package-manager/src/fast_update_catalog_versions.rs[25-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
The same explanatory comment about the catalog snapshot gate is duplicated back-to-back, which is redundant and creates unnecessary maintenance overhead.

## Issue Context
Compliance requires avoiding redundant comments that restate themselves without adding additional rationale.

## Fix Focus Areas
- pnpm/crates/package-manager/src/fast_update_catalog_versions.rs[25-30]

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


6. Default catalog spec mismatch 🐞 Bug ➹ Performance
Description
In Rust, catalog_entry_is_sole_reference only accepts the default catalog specifier as exactly
catalog:; importers that reference the default catalog as catalog:default will make the fast
rewrite decline and fall back to full resolution. This undermines the PR’s performance goal for
lockfiles that legitimately encode the default catalog in the long form.
Code

pnpm/crates/package-manager/src/fast_update_catalog_versions.rs[R85-90]

+    let protocol = if catalog_name == "default" {
+        "catalog:".to_string()
+    } else {
+        format!("catalog:{catalog_name}")
+    };
+    let importers_agree = lockfile.importers.values().all(|importer| {
Relevance

●● Moderate

Mixed precedent in #13477 on treating catalog:default equivalent to catalog:; unclear team
stance.

PR-#13477

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new Rust sole-reference check hardcodes catalog: for the default catalog and compares raw
strings, but the repo’s protocol parser and tests demonstrate catalog:default is a valid
default-catalog spelling. Therefore, lockfiles/importers using catalog:default will fail the check
and disable the fast rewrite.

pnpm/crates/package-manager/src/fast_update_catalog_versions.rs[85-110]
pnpm/crates/package-manager/src/fast_update_catalogs/tests.rs[194-219]
pnpm/crates/catalogs-protocol-parser/src/lib.rs[8-16]
PR-#13477

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

### Issue description
`catalog_entry_is_sole_reference()` compares importer dependency specifiers to a synthesized string (`"catalog:"` for the default catalog). This rejects the valid long-form `"catalog:default"`, causing the new fast catalog-version rewrite to fall back unnecessarily.

### Issue Context
The repository already treats `catalog:` and `catalog:default` as equivalent spellings for the default catalog (both in protocol parsing and in existing tests). The TypeScript implementation uses `parseCatalogProtocol`, which normalizes `catalog:` to `default` and also accepts `catalog:default`.

### Fix Focus Areas
- pnpm/crates/package-manager/src/fast_update_catalog_versions.rs[85-110]

### Suggested fix
Use the existing catalog protocol parser to normalize the importer specifier before comparing to `catalog_name` (or explicitly accept both spellings for the default catalog). For example:
- Parse `dependency.specifier` with `pacquet_catalogs_protocol_parser::parse_catalog_protocol`.
- Treat a dependency as “agreeing” when:
 - it is absent, or
 - `parse_catalog_protocol(&dependency.specifier) == Some(catalog_name)`.

This removes the raw-string equivalence pitfall and keeps behavior aligned with the rest of the codebase.

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



Informational

7. Quadratic override duplicate check 🐞 Bug ➹ Performance
Description
build_replacement_plan rejects duplicate override names via an O(n²) nested scan over overrides.
This adds unnecessary CPU cost to a performance-sensitive fast path for large rewrite sets (e.g.,
many moved catalog entries).
Code

pnpm/crates/package-manager/src/fast_update_overrides.rs[R185-188]

+    if overrides
+        .iter()
+        .enumerate()
+        .any(|(index, entry)| overrides[..index].iter().any(|other| other.name == entry.name))
Relevance

●● Moderate

Perf concern is plausible, but team sometimes rejects micro-optimizations without clear impact;
unclear override list sizes.

PR-#13482
PR-#13532

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new guard explicitly performs a nested scan across the overrides vector to detect duplicates,
which is quadratic. The new catalog exact-version path builds a potentially multi-entry overrides
list and then calls this planner.

pnpm/crates/package-manager/src/fast_update_overrides.rs[171-191]
pnpm/crates/package-manager/src/fast_update_catalog_versions.rs[35-83]

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

### Issue description
`build_replacement_plan` checks for duplicate `PkgName`s using a nested scan (`enumerate()` + scanning all previous entries), which is O(n²) in the number of overrides.

While typical override sets are small, this code is on the fast path and can be invoked with larger lists (e.g., multiple catalog entries moving in one change), so the duplicate check should be O(n).

### Issue Context
The code comment indicates this is purely a guardrail to prevent plans that contain two entries for the same package.

### Fix suggestion
Replace the O(n²) duplicate detection with a `HashSet<PkgName>` (or `HashSet<&PkgName>`), e.g.:
- Iterate once and `insert` each name; if `insert` returns `false`, return `None`.

### Fix Focus Areas
- pnpm/crates/package-manager/src/fast_update_overrides.rs[176-205]

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


8. Repeated reference scans 🐞 Bug ➹ Performance
Description
The new catalog-version rewrite calls a “sole reference” guard once per moved catalog entry, and
that guard re-scans all importers and all snapshots/packages each time. On large lockfiles with
multiple moved entries this makes the fast path worst-case O(moved_entries × (importers +
snapshots/packages)) and can significantly reduce the performance win versus resolution avoidance.
Code

pnpm/crates/package-manager/src/fast_update_catalog_versions.rs[R58-61]

+            let wanted = Version::parse(specifier).ok()?;
+            let name = PkgName::parse(alias).ok()?;
+            if !catalog_entry_is_sole_reference(context.lockfile, catalog_name, &name) {
+                return None;
Relevance

● Weak

Similar “avoid repeated full lockfile scans” caching optimization in fast-update code was rejected
previously.

PR-#13600

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
In Rust, the per-entry loop invokes catalog_entry_is_sole_reference for each moved entry, and that
function iterates through every importer and every snapshot to verify exclusivity. The TypeScript
implementation mirrors the same pattern: it calls catalogEntryIsSoleReference per alias and that
helper scans all importers and all lockfile.packages entries each time.

pnpm/crates/package-manager/src/fast_update_catalog_versions.rs[37-63]
pnpm/crates/package-manager/src/fast_update_catalog_versions.rs[88-117]
pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts[46-64]
pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts[73-88]

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

### Issue description
`try_fast_update_catalog_versions` performs repeated whole-lockfile scans (all importers + all snapshots) inside the per-entry loop via `catalog_entry_is_sole_reference`. This can make the new fast path scale poorly when many catalog entries move in a large repo.

### Issue Context
This path is explicitly performance-motivated (“rewrite without resolving”), so repeated O(N) scans per moved entry can become the dominant cost.

### Fix Focus Areas
- pnpm/crates/package-manager/src/fast_update_catalog_versions.rs[37-118]
- pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts[35-89]

### Suggested fix
1. **Rust**: In `try_fast_update_catalog_versions`, compute reusable indexes once before the inner loop, e.g.:
  - A set/map of package names that are depended on by any snapshot (and optionally whether the dependency is optional).
  - A set/map of importers’ non-catalog references (anything where dependency exists and specifier != expected catalog protocol).
  Then `catalog_entry_is_sole_reference` becomes a cheap O(1) check per alias, or you can inline it.
2. **TypeScript**: Similarly, precompute:
  - For importers: a map `alias -> catalogName` (or a set of aliases that are *not* catalog-referenced for the given catalog).
  - For packages: a set of dependency names referenced in any `packages[*].dependencies/optionalDependencies`.
  Then `catalogEntryIsSoleReference` avoids re-walking all importers/packages per moved alias.
3. Keep behavior identical (still conservative/fallback) — just reduce repeated work.

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


9. lockfile() declared before use 📘 Rule violation ⚙ Maintainability
Description
In the new Jest test file, helper functions are declared before any usage in the file, violating the
local style rule that function declarations must appear after their first usage.
Code

pnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts[R7-10]

+/** `target` is a direct dependency of the importer, reached only through the default catalog. */
+function lockfile (): LockfileObject {
+  return {
+    lockfileVersion: '9.0',
Relevance

● Weak

Very similar “function declared before first use” change was rejected repeatedly in TS tests.

PR-#12872
PR-#12864

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713432 requires that, if a function is used in the same file, at least one usage
must appear before the function declaration. In the new test file, lockfile() (and also
updateOptions()) are declared at the top, while their first usages occur later in the tests.

Rule 713432: Declare TypeScript functions only after their first usage
pnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts[7-12]
pnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts[30-48]
pnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts[50-57]

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

## Issue description
Top-level function declarations in the new TypeScript test file appear before their first usage.

## Issue Context
The codebase rule requires declaring functions only after their first usage (within the same file) for top-level function declarations.

## Fix Focus Areas
- pnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts[7-12]
- pnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts[30-48]
- pnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts[50-57]

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


View more (1)
10. Missing trailing commas in params 📘 Rule violation ⚙ Maintainability
Description
Several new multi-line TypeScript parameter lists omit a trailing comma on the last parameter, which
violates the repository’s TypeScript formatting contract and makes future diffs noisier.
Code

pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts[R28-31]

+export async function tryFastUpdateCatalogVersions (
+  lockfile: LockfileObject,
+  opts: FastRewriteOptions & { catalogs: Catalogs }
+): Promise<boolean> {
Relevance

● Weak

Team previously rejected adding trailing commas to multiline TS params/signatures in similar
helpers.

PR-#13477
PR-#13600

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713434 requires trailing commas in multi-line TypeScript constructs. The new
function signatures shown in the cited regions place each parameter on its own line but do not end
the final parameter line with a comma.

Rule 713434: Require trailing commas in TypeScript collections and multi-line constructs
pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts[28-31]
pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts[70-74]
pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts[78-83]

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

## Issue description
Multi-line TypeScript parameter lists added in this PR are missing trailing commas on the last parameter.

## Issue Context
The repo requires trailing commas in multi-line constructs to keep diffs stable when adding/reordering parameters.

## Fix Focus Areas
- pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts[28-31]
- pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts[70-74]
- pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts[78-83]

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


Grey Divider

Context used
✅ Compliance rules (platform): 24 rules

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

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.

zkochan added a commit that referenced this pull request Aug 7, 2026
Gate the rewrite on the same catalog-reference check the range-only path
opens with. An importer pointing at a catalog entry with nothing recorded
for it needs the resolver, and this path iterates the recorded entries, so
it would never have looked at that one.

Absorb the range-only entries a mixed update carries. The TypeScript
range-only rewrite keeps the entries it cannot handle and still reports
success, so returning early on it stranded the exact move and sent the
install to a full resolution; run both and take either. pacquet declines
a mixed update outright, so it now handles the range-only entries in the
same pass.

Re-run the whole manifest safety check after `readPackageHook`, which the
TypeScript side only did for peer dependencies. pacquet validates after
its hook, so a hook introducing a name, version, deprecation, bundled
dependency, or runtime engine change took the fast path on one stack and
not the other.

Move the duplicate-name check into the shared plan builder, where it
belongs to the plan rather than to overrides. Both callers already reject
that case earlier for their own reasons -- verified by removing it -- so
this is depth, not a fix.

Reported by CodeRabbit and Greptile on #13689.
Copilot AI review requested due to automatic review settings August 7, 2026 08:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai coderabbitai Bot 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)
pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts (1)

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

Remove the historical comment.

The validation condition documents the current fallback rule. The comment describes pacquet history and repeats the condition.

🤖 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/src/install/tryFastUpdateOverrides.ts`
around lines 323 - 324, Remove the historical comment immediately above the
validation condition in the fast-update override logic, leaving the condition
and surrounding fallback behavior unchanged.

Source: Coding guidelines

🤖 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 `@pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts`:
- Around line 323-324: Remove the historical comment immediately above the
validation condition in the fast-update override logic, leaving the condition
and surrounding fallback behavior unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bde2059a-5590-43da-9860-c2916686fbc5

📥 Commits

Reviewing files that changed from the base of the PR and between 290f574 and f639db5.

📒 Files selected for processing (9)
  • pnpm/crates/package-manager/src/fast_update_catalog_versions.rs
  • pnpm/crates/package-manager/src/fast_update_catalog_versions/tests.rs
  • pnpm/crates/package-manager/src/fast_update_catalogs.rs
  • pnpm/crates/package-manager/src/fast_update_overrides.rs
  • pnpm11/installing/deps-installer/src/install/index.ts
  • pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts
  • pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogs.ts
  • pnpm11/installing/deps-installer/src/install/tryFastUpdateOverrides.ts
  • pnpm11/installing/deps-installer/test/install/catalogVersionFastUpdate.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • pnpm11/installing/deps-installer/src/install/tryFastUpdateCatalogVersions.ts
  • pnpm11/installing/deps-installer/src/install/index.ts
  • pnpm/crates/package-manager/src/fast_update_catalog_versions.rs
  • pnpm/crates/package-manager/src/fast_update_overrides.rs

@github-actions

github-actions Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     11.4±0.15ms    32.9 MB/sec    1.02     11.6±0.14ms    32.3 MB/sec
packument/parse                                  1.14    44.2±10.71µs  1501.3 MB/sec    1.00     38.9±0.09µs  1705.7 MB/sec
tarball/download_dependency                      1.00      2.2±0.09ms  1950.9 KB/sec    1.07      2.4±0.18ms  1831.4 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00    177.3±4.20ms 90.2 KElem/sec    1.01   178.7±11.47ms 89.6 KElem/sec
workspace_resolution/hoist_heavy                 1.00    251.3±2.96ms        ? ?/sec    1.09   274.5±17.55ms        ? ?/sec

@qodo-code-review

Copy link
Copy Markdown

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

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

No code suggestions found for the PR.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Aug 7, 2026
@codecov-commenter

codecov-commenter commented Aug 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.30070% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.19%. Comparing base (2103e3d) to head (5f5d577).

Files with missing lines Patch % Lines
...rates/package-manager/src/fast_update_overrides.rs 97.14% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13689      +/-   ##
==========================================
+ Coverage   88.17%   88.19%   +0.02%     
==========================================
  Files         613      614       +1     
  Lines       99833    99951     +118     
==========================================
+ Hits        88024    88149     +125     
+ Misses      11809    11802       -7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: f639db5971c0

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.505 ± 0.131 2.350 2.670 1.67 ± 0.17
pacquet@main 2.465 ± 0.147 2.348 2.779 1.65 ± 0.18
pnpr@HEAD 1.525 ± 0.113 1.385 1.746 1.02 ± 0.12
pnpr@main 1.495 ± 0.133 1.372 1.730 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5046342079,
      "stddev": 0.1312760511850856,
      "median": 2.4848975455,
      "user": 1.6206213999999999,
      "system": 1.32184986,
      "min": 2.34963525,
      "max": 2.6698291490000003,
      "times": [
        2.506465654,
        2.463329437,
        2.34963525,
        2.6698291490000003,
        2.378779859,
        2.6152652040000004,
        2.65477402,
        2.3893845380000003,
        2.647511866,
        2.3713671020000002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.4653394248000002,
      "stddev": 0.1465293961163958,
      "median": 2.3937521790000003,
      "user": 1.5772532,
      "system": 1.33979786,
      "min": 2.3477404980000003,
      "max": 2.778654038,
      "times": [
        2.4069820550000003,
        2.353738071,
        2.527733146,
        2.3805223030000002,
        2.469655211,
        2.3477404980000003,
        2.652541389,
        2.3567751620000004,
        2.379052375,
        2.778654038
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5250881474,
      "stddev": 0.11334466462088526,
      "median": 1.5314956425000001,
      "user": 1.0950748,
      "system": 1.15368446,
      "min": 1.3849477140000002,
      "max": 1.7463287480000003,
      "times": [
        1.521195129,
        1.437982882,
        1.5873419100000001,
        1.4673880990000001,
        1.5417961560000002,
        1.3849477140000002,
        1.7463287480000003,
        1.5427297650000003,
        1.6355215740000002,
        1.3856494970000002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.4954422285000002,
      "stddev": 0.13320050372819314,
      "median": 1.4296345525,
      "user": 1.1589106,
      "system": 1.13204206,
      "min": 1.3720652560000002,
      "max": 1.7301244750000002,
      "times": [
        1.3817264880000002,
        1.6084042150000002,
        1.659118373,
        1.40571284,
        1.5655174190000003,
        1.7301244750000002,
        1.3720652560000002,
        1.4385866310000002,
        1.3724841140000001,
        1.4206824740000001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 257.9 ± 9.5 249.1 275.7 1.00 ± 0.05
pacquet@main 257.2 ± 8.3 243.0 270.8 1.00
pnpr@HEAD 275.5 ± 9.0 262.6 287.4 1.07 ± 0.05
pnpr@main 276.3 ± 7.3 264.7 285.8 1.07 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2579037259,
      "stddev": 0.009484061945358935,
      "median": 0.2550604581,
      "user": 0.21620932,
      "system": 0.5032424799999999,
      "min": 0.24907537210000003,
      "max": 0.27568198909999997,
      "times": [
        0.2531219731,
        0.2585773861,
        0.24907537210000003,
        0.27568198909999997,
        0.2533809501,
        0.2567399661,
        0.25020178309999996,
        0.2501740421,
        0.2583326851,
        0.27375111209999997
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.2572380245,
      "stddev": 0.008289384640179953,
      "median": 0.2583862121,
      "user": 0.20033381999999994,
      "system": 0.5305596800000001,
      "min": 0.24300112410000002,
      "max": 0.2708298511,
      "times": [
        0.24904370210000001,
        0.24300112410000002,
        0.2502838081,
        0.2565456611,
        0.2542428441,
        0.2615813541,
        0.26182222709999997,
        0.2708298511,
        0.2602267631,
        0.2648029101
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.275547277,
      "stddev": 0.008983864561651598,
      "median": 0.2785923846,
      "user": 0.22908692,
      "system": 0.51516608,
      "min": 0.26255044909999997,
      "max": 0.2873529781,
      "times": [
        0.2698501151,
        0.27748356209999997,
        0.2629789461,
        0.26255044909999997,
        0.2805525921,
        0.2798820881,
        0.2873529781,
        0.2863559301,
        0.2797012071,
        0.2687649021
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.2762511447,
      "stddev": 0.007297910281831041,
      "median": 0.2752374666,
      "user": 0.21167631999999995,
      "system": 0.5432668799999999,
      "min": 0.2646793081,
      "max": 0.2858273461,
      "times": [
        0.2855306061,
        0.2728921351,
        0.27559272009999997,
        0.2748822131,
        0.2858273461,
        0.2646793081,
        0.2689826121,
        0.2702327061,
        0.2821824601,
        0.2817093401
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.611 ± 0.017 2.581 2.640 1.65 ± 0.16
pacquet@main 2.610 ± 0.018 2.588 2.643 1.65 ± 0.16
pnpr@HEAD 1.654 ± 0.162 1.429 1.889 1.04 ± 0.14
pnpr@main 1.587 ± 0.154 1.435 1.851 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.6110711876200012,
      "stddev": 0.016856724996600805,
      "median": 2.6059184357200005,
      "user": 1.56609166,
      "system": 1.3306296000000002,
      "min": 2.5810738247200002,
      "max": 2.63998498772,
      "times": [
        2.5810738247200002,
        2.60616819272,
        2.6174736647200003,
        2.6056686787200003,
        2.5987822647200005,
        2.62359743772,
        2.6034251787200002,
        2.6053510337200003,
        2.63998498772,
        2.6291866127200003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6103509830200005,
      "stddev": 0.018162144446555336,
      "median": 2.6071464757200005,
      "user": 1.55753696,
      "system": 1.3511207,
      "min": 2.5884022567200002,
      "max": 2.64326325172,
      "times": [
        2.6228833227200004,
        2.6184860917200004,
        2.60782894072,
        2.5905147947200002,
        2.64326325172,
        2.62968788672,
        2.6064640107200003,
        2.5884022567200002,
        2.6045509887200002,
        2.59142828572
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6536620237200002,
      "stddev": 0.16177094620190613,
      "median": 1.6251938057200002,
      "user": 1.07126476,
      "system": 1.138349,
      "min": 1.42910232572,
      "max": 1.8894942787200002,
      "times": [
        1.42910232572,
        1.6437985107200002,
        1.6014938837200001,
        1.45698535072,
        1.6065891007200002,
        1.52119763672,
        1.75982396772,
        1.86646605972,
        1.76166912272,
        1.8894942787200002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.5867134152199998,
      "stddev": 0.15422675647754167,
      "median": 1.50466777772,
      "user": 1.06918446,
      "system": 1.1316544000000002,
      "min": 1.43505151372,
      "max": 1.8513712637200002,
      "times": [
        1.44395261572,
        1.51182194072,
        1.43505151372,
        1.8513712637200002,
        1.49751361472,
        1.49676149872,
        1.70922591972,
        1.45127647872,
        1.76347889072,
        1.70668041572
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 418.4 ± 14.8 402.1 439.1 1.37 ± 0.06
pacquet@main 428.7 ± 13.8 405.4 452.8 1.40 ± 0.06
pnpr@HEAD 310.8 ± 6.5 304.6 324.2 1.02 ± 0.03
pnpr@main 305.4 ± 8.1 294.1 317.2 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.4184211123,
      "stddev": 0.014823023994738288,
      "median": 0.4158968739,
      "user": 0.5276605199999999,
      "system": 0.7259750599999999,
      "min": 0.40206985840000004,
      "max": 0.4391184804,
      "times": [
        0.40206985840000004,
        0.40234956540000005,
        0.41574859940000003,
        0.4160451484,
        0.42364978940000003,
        0.4380623014,
        0.4391184804,
        0.40374672640000003,
        0.40828310040000004,
        0.43513755340000004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.4286723887,
      "stddev": 0.01380242635647042,
      "median": 0.43013620490000004,
      "user": 0.5463052199999999,
      "system": 0.6920574599999999,
      "min": 0.40535036640000005,
      "max": 0.45283955140000004,
      "times": [
        0.40535036640000005,
        0.4330291424,
        0.41682989540000004,
        0.42886398740000004,
        0.43964829040000003,
        0.43722869340000003,
        0.41365499840000003,
        0.4278705394,
        0.45283955140000004,
        0.43140842240000005
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31082856180000007,
      "stddev": 0.006466885164386984,
      "median": 0.3096464014,
      "user": 0.20328142000000002,
      "system": 0.54105076,
      "min": 0.30460328940000003,
      "max": 0.3242019184,
      "times": [
        0.3114773344,
        0.31408343240000003,
        0.3072362474,
        0.30469271740000003,
        0.30781879440000004,
        0.30460328940000003,
        0.30474592840000003,
        0.3242019184,
        0.31795194740000005,
        0.3114740084
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.30542350420000003,
      "stddev": 0.008063286433517414,
      "median": 0.30552707889999997,
      "user": 0.20830272,
      "system": 0.5147353599999999,
      "min": 0.2940985064,
      "max": 0.31715383540000003,
      "times": [
        0.31715383540000003,
        0.3051596774,
        0.3058944804,
        0.3158902364,
        0.29910246040000005,
        0.2940985064,
        0.30920188940000004,
        0.31081495740000004,
        0.2946414594,
        0.3022775394
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.736 ± 0.012 1.724 1.767 5.58 ± 0.07
pacquet@main 1.729 ± 0.010 1.717 1.756 5.56 ± 0.07
pnpr@HEAD 0.311 ± 0.003 0.305 0.316 1.00
pnpr@main 0.317 ± 0.009 0.302 0.336 1.02 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7359206573400001,
      "stddev": 0.011994200297617595,
      "median": 1.73473744254,
      "user": 0.7668765399999999,
      "system": 0.7714725599999999,
      "min": 1.72357288154,
      "max": 1.76747474754,
      "times": [
        1.72357288154,
        1.73709462654,
        1.73613056154,
        1.73773011254,
        1.73091947654,
        1.73548147854,
        1.73399340654,
        1.72851191354,
        1.72829736854,
        1.76747474754
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.7293030641399998,
      "stddev": 0.010445398649244694,
      "median": 1.72628877304,
      "user": 0.7435578399999999,
      "system": 0.79098746,
      "min": 1.71734172954,
      "max": 1.75560837254,
      "times": [
        1.72528524754,
        1.73703149754,
        1.72604634954,
        1.7266587935400002,
        1.72507812754,
        1.72402143654,
        1.71734172954,
        1.72653119654,
        1.72942789054,
        1.75560837254
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31127959144,
      "stddev": 0.003135217485455133,
      "median": 0.31131434954000003,
      "user": 0.20153694,
      "system": 0.5353288599999999,
      "min": 0.30471109354000003,
      "max": 0.31579867354,
      "times": [
        0.31295175254,
        0.30471109354000003,
        0.31044563354,
        0.30982309954000004,
        0.31361852854,
        0.31218306554,
        0.31395106454,
        0.30911173054,
        0.31579867354,
        0.31020127254
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.31682486223999995,
      "stddev": 0.008756222312065817,
      "median": 0.31685806904,
      "user": 0.20207804000000001,
      "system": 0.5518006599999999,
      "min": 0.30161719654,
      "max": 0.33565005754,
      "times": [
        0.31954566054,
        0.33565005754,
        0.30161719654,
        0.32186794254,
        0.31481963954000003,
        0.30903997654,
        0.31446513254,
        0.31620321554,
        0.31751292254,
        0.31752687854
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 214.7 ± 10.4 196.2 232.4 2.46 ± 0.12
pacquet@main 219.7 ± 16.8 183.2 251.3 2.52 ± 0.19
pnpr@HEAD 87.6 ± 1.8 84.2 95.8 1.00 ± 0.02
pnpr@main 87.3 ± 0.7 85.8 89.0 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2146663127566667,
      "stddev": 0.010427486222722257,
      "median": 0.21449026784000003,
      "user": 0.17439708333333337,
      "system": 0.06083563,
      "min": 0.19624745784,
      "max": 0.23235674884000002,
      "times": [
        0.23235674884000002,
        0.22706121584,
        0.21047520184000001,
        0.20086781884000002,
        0.21489647784000002,
        0.21252201684,
        0.22277394284000002,
        0.21916661984,
        0.21925674884000002,
        0.20628744584,
        0.21408405784,
        0.19624745784
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.21966549334000002,
      "stddev": 0.016783040714105035,
      "median": 0.21752625584000002,
      "user": 0.1680349375,
      "system": 0.06658713000000001,
      "min": 0.18316205584,
      "max": 0.25126776284,
      "times": [
        0.18316205584,
        0.20612025084,
        0.22609338384,
        0.21795602984,
        0.25126776284,
        0.20247245184,
        0.21121396284,
        0.24948130684,
        0.21876652484,
        0.21603457184,
        0.23725237884,
        0.22622440084,
        0.22034292384,
        0.21427708184,
        0.21709648184,
        0.21688632484
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08762640268848486,
      "stddev": 0.0018107740035222344,
      "median": 0.08738858584,
      "user": 0.02136272727272727,
      "system": 0.008360372121212122,
      "min": 0.08415311284000002,
      "max": 0.09577527084000001,
      "times": [
        0.08627183384,
        0.08732185084,
        0.08679074084,
        0.08790321584,
        0.08706980684000001,
        0.08798677384,
        0.08801303184,
        0.08739817484000001,
        0.09089973884000001,
        0.08415311284000002,
        0.08753427084000001,
        0.08818196084,
        0.08713977784000002,
        0.08726122684000001,
        0.08708936284000002,
        0.08738858584,
        0.08762003184000001,
        0.08734558584000002,
        0.08866392784000002,
        0.08638253284000001,
        0.08728341884000002,
        0.08747513984000001,
        0.08744312984000001,
        0.08765477784000002,
        0.08799390684000001,
        0.08642284884000001,
        0.08718711684000001,
        0.08917436884,
        0.08641247784000002,
        0.09577527084000001,
        0.08622385384000002,
        0.08751151784000001,
        0.08669791684000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08732803341575757,
      "stddev": 0.0007349006326384388,
      "median": 0.08734763984,
      "user": 0.019168090909090905,
      "system": 0.010822095757575756,
      "min": 0.08580924284000001,
      "max": 0.08897834084000002,
      "times": [
        0.08621961584000001,
        0.08714517784,
        0.08659326884000002,
        0.08737759584000002,
        0.08812090584000001,
        0.08639453484000001,
        0.08788420984,
        0.08804735784,
        0.08639034784,
        0.08734763984,
        0.08795722784000001,
        0.08718141684000001,
        0.08750003684000002,
        0.08751107684000001,
        0.08696015984000001,
        0.08762097484,
        0.08841572084000002,
        0.08666014484000001,
        0.08897834084000002,
        0.08580924284000001,
        0.08702106384000001,
        0.08717565484,
        0.08706888484000001,
        0.08763706484000001,
        0.08768577684000001,
        0.08690897384000001,
        0.08818209184,
        0.08727056484000001,
        0.08686739484000001,
        0.08746382884000001,
        0.08738389784000002,
        0.08880404284000001,
        0.08624086584000001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 770.7 ± 103.7 674.7 961.0 1.00
pacquet@main 898.3 ± 213.2 603.0 1176.8 1.17 ± 0.32
pnpm@HEAD 3013.7 ± 81.6 2886.4 3148.6 3.91 ± 0.54
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.7706880434666668,
      "stddev": 0.10368536656609133,
      "median": 0.7231687408,
      "user": 0.71357296,
      "system": 0.12145770666666664,
      "min": 0.6746934218,
      "max": 0.9610278998,
      "times": [
        0.9207823598,
        0.9610278998,
        0.7923386088000001,
        0.6828976428,
        0.6746934218,
        0.7231687408,
        0.7015565808,
        0.7184244848,
        0.7613026518
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.8983499444666667,
      "stddev": 0.21315808964072006,
      "median": 0.8668730698,
      "user": 0.8414626266666665,
      "system": 0.13988348444444443,
      "min": 0.6029905228,
      "max": 1.1768376558,
      "times": [
        1.1768376558,
        0.7111001718000001,
        1.1689371378,
        0.9969586028,
        1.0546349468,
        0.6029905228,
        0.8348429508,
        0.8668730698,
        0.6719744418
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.013718705688889,
      "stddev": 0.08160894642903954,
      "median": 3.0037067538000004,
      "user": 4.630787848888889,
      "system": 0.26429604,
      "min": 2.8863820818000003,
      "max": 3.1486043608000003,
      "times": [
        3.0372110078000003,
        3.1486043608000003,
        3.1263574458,
        3.0057462838,
        2.9689313048000003,
        2.9635371478000003,
        2.9829919648000005,
        2.8863820818000003,
        3.0037067538000004
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.561 ± 0.163 4.419 4.846 1.28 ± 0.07
pacquet@main 4.608 ± 0.115 4.440 4.800 1.29 ± 0.06
pnpr@HEAD 3.579 ± 0.123 3.465 3.797 1.00 ± 0.05
pnpr@main 3.570 ± 0.141 3.454 3.809 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.5609642011,
      "stddev": 0.16286735359668947,
      "median": 4.4712902808,
      "user": 1.7693440799999998,
      "system": 1.4443840399999999,
      "min": 4.4187304668,
      "max": 4.8464889718,
      "times": [
        4.4305166638,
        4.7039262768,
        4.6969307918,
        4.4255411828,
        4.4187304668,
        4.4209318828,
        4.4858699978,
        4.7239952128,
        4.4567105638,
        4.8464889718
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.607792191499999,
      "stddev": 0.11549858393069166,
      "median": 4.6047892948,
      "user": 1.9875714799999997,
      "system": 1.46129324,
      "min": 4.4402221528,
      "max": 4.7997478398,
      "times": [
        4.4402221528,
        4.6918332128,
        4.7082789138,
        4.5457785678,
        4.6352794498,
        4.7997478398,
        4.5082939267999995,
        4.4834304428,
        4.5742991398,
        4.6907582688
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5792354442000005,
      "stddev": 0.12319951670936569,
      "median": 3.5354302137999998,
      "user": 1.2381940799999998,
      "system": 1.26227224,
      "min": 3.4646865077999998,
      "max": 3.7971140558,
      "times": [
        3.7485983948,
        3.4755850118,
        3.6635897028,
        3.4891771588,
        3.4646865077999998,
        3.4955828928,
        3.5752775347999997,
        3.6171225847999997,
        3.7971140558,
        3.4656205978
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.5704277545,
      "stddev": 0.14132387104881008,
      "median": 3.5039939123,
      "user": 1.2185741799999998,
      "system": 1.23844294,
      "min": 3.4539764687999996,
      "max": 3.8089467388,
      "times": [
        3.5159898627999997,
        3.8021725828,
        3.4539764687999996,
        3.8089467388,
        3.4919979618,
        3.4547065808,
        3.4725127787999996,
        3.5710870658,
        3.4581191768,
        3.6747683278
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13689
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,581.07 ms
(-4.78%)Baseline: 2,710.57 ms
3,252.69 ms
(79.35%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,723.57 ms
(-4.38%)Baseline: 1,802.50 ms
2,163.00 ms
(79.68%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
402.07 ms
(-11.52%)Baseline: 454.40 ms
545.28 ms
(73.74%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
196.25 ms
(-7.18%)Baseline: 211.42 ms
253.70 ms
(77.35%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,349.64 ms
(-4.66%)Baseline: 2,464.49 ms
2,957.39 ms
(79.45%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,418.73 ms
(-2.01%)Baseline: 4,509.23 ms
5,411.08 ms
(81.66%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
249.08 ms
(-17.61%)Baseline: 302.30 ms
362.75 ms
(68.66%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
674.69 ms
(-6.76%)Baseline: 723.58 ms
868.30 ms
(77.70%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13689
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,429.10 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
304.71 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
304.60 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
84.15 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,384.95 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,464.69 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
262.55 ms
🐰 View full continuous benchmarking report in Bencher

zkochan added 3 commits August 7, 2026 10:58
A catalog entry that moves to a version the locked one cannot satisfy
left the range-only fast path with nothing to do, so the install fell
back to a full resolution. Replacing the package is the same rewrite an
exact `pnpm.overrides` entry performs, so reuse that machinery rather
than growing a second rewriter: the same dependency-shape validation
decides whether every locked child still fits the new version.

Split the override path into its plan building and a shared apply step
so the catalog caller can drive the rewrite without writing synthetic
overrides into the lockfile, and record the updated catalog snapshot
instead.

An override moves a package everywhere it appears; a catalog entry only
governs the importers that reference it. Fall back when anything else
reaches the package -- an importer pinning it directly, or any package
depending on it -- since the graph would then have to hold both
versions.

Related to #13474.
…cript CLI

Same split as pacquet: the override path keeps its plan building and
hands the rewrite to a shared apply step, which records whichever
setting drove it rather than always writing `overrides`. The catalog
caller builds the same plan from the entries whose version moved and
records the updated catalog snapshot.

Chained after the range-only catalog rewrite, which declines exactly the
changes this handles, and guarded the same way: anything other than the
catalog reaching the package sends the install back to the resolver.
Gate the rewrite on the same catalog-reference check the range-only path
opens with. An importer pointing at a catalog entry with nothing recorded
for it needs the resolver, and this path iterates the recorded entries, so
it would never have looked at that one.

Absorb the range-only entries a mixed update carries. The TypeScript
range-only rewrite keeps the entries it cannot handle and still reports
success, so returning early on it stranded the exact move and sent the
install to a full resolution; run both and take either. pacquet declines
a mixed update outright, so it now handles the range-only entries in the
same pass.

Re-run the whole manifest safety check after `readPackageHook`, which the
TypeScript side only did for peer dependencies. pacquet validates after
its hook, so a hook introducing a name, version, deprecation, bundled
dependency, or runtime engine change took the fast path on one stack and
not the other.

Move the duplicate-name check into the shared plan builder, where it
belongs to the plan rather than to overrides. Both callers already reject
that case earlier for their own reasons -- verified by removing it -- so
this is depth, not a fix.

Reported by CodeRabbit and Greptile on #13689.
Copilot AI review requested due to automatic review settings August 7, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants