Skip to content

feat: add minimumReleaseAgeExcludePrune, rename cleanupUnusedCatalogs to catalogPrune - #13653

Merged
zkochan merged 5 commits into
pnpm:mainfrom
btea:feat/add-cleanupOutdatedMinimumReleaseAgeExcludes-config
Aug 11, 2026
Merged

zkochan merged 5 commits into
pnpm:mainfrom
btea:feat/add-cleanupOutdatedMinimumReleaseAgeExcludes-config

Conversation

@btea

@btea btea commented Aug 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds an opt-in setting minimumReleaseAgeExcludePrune. When it is on, the
commands that persist pnpm-workspace.yaml — pnpm add, pnpm update,
pnpm remove — prune the minimumReleaseAgeExclude entries that the freshly
written lockfile no longer resolves, so the list stops growing forever as
pnpm audit --fix keeps appending to it.

Per entry:

  • an exact version that is no longer resolved is dropped, and the entry goes
    away once none of its versions remain (a narrowed union is rewritten
    canonically, semver-sorted and ||-joined);
  • a bare-name entry goes away when the package is gone from the lockfile;
  • a name pattern (@scope/*) is always kept — it is forward-looking and can
    never be proven stale;
  • an entry that fails to parse is kept verbatim, so the cleanup can never
    break an install.

The pass may only drop an entry it can prove nothing resolves, so it needs a
lockfile covering every project the setting governs. It is therefore skipped
when the lockfile is not the workspace-shared one
(sharedWorkspaceLockfile: false), when lockfile: false makes the on-disk
lockfile stale, and when the install resolved no new lockfile at all (a frozen
install, or resolution delegated to the pnpr server) — passing an empty set of
resolved versions there would prune every entry.

This is a partial fix: it removes entries that nothing installs anymore, not
entries whose version has since aged past minimumReleaseAge. That second
rule can later become a value of this same setting.

Also renames cleanupUnusedCatalogs to catalogPrune, so the two pruning
settings share one vocabulary — pnpm prune and pnpm store prune already use
that verb, as do git's fetch.prune and gc.prune. cleanupUnusedCatalogs
keeps working; when a file carries both, catalogPrune wins.

Related to #11668

Squash Commit Body

Added a new setting `minimumReleaseAgeExcludePrune`. When enabled, `pnpm
add`, `pnpm update`, and `pnpm remove` prune the `minimumReleaseAgeExclude`
entries in `pnpm-workspace.yaml` that the freshly written lockfile no longer
resolves: exact versions that are gone are dropped (the entry goes away once
none remain), and entries for packages absent from the lockfile are removed
too. A narrowed version union is rewritten canonically via
`mergePackageVersionSpecs`. Name patterns and unparsable entries are kept
verbatim, so the pass never rejects a hand-written entry.

The name groups the setting with `minimumReleaseAgeExclude`, the list it acts
on, matching how `minimumReleaseAgeStrict`,
`minimumReleaseAgeIgnoreMissingTime`, and `trustPolicyIgnoreAfter` sort with
their families.

`cleanupUnusedCatalogs` is renamed to `catalogPrune` for the same reason: it
groups with `catalogMode`, and both settings now name the same operation with
the same verb, the one `pnpm prune` and `pnpm store prune` already use. It is
singular because the pass prunes the `catalog:` block as well as `catalogs:`,
exactly as `catalogMode` governs both. The former name stays accepted — as a
serde alias applied before the canonical key in pacquet, and as a
`catalogPrune ??= cleanupUnusedCatalogs` fallback in the TypeScript config
reader — so the canonical key wins when both are set, in both stacks. No
warning is emitted; `cleanupUnusedCatalogs` is an alias, not a deprecation.

The pass may only drop an entry it can prove nothing resolves, so it needs a
lockfile that covers every project `minimumReleaseAgeExclude` governs. It is
skipped when `sharedWorkspaceLockfile` is false (a per-project lockfile makes
every sibling project's entry look unresolved), when `lockfile` is false (the
on-disk lockfile would be stale), and when the install returned no new
lockfile — a frozen install or a pnpr-delegated one, where an empty resolved
set would otherwise prune the whole list. The presence of the resolved-versions
map is the single gate on both stacks; there is no separate boolean for the
writer to disagree with.

In the TypeScript CLI the versions come from the in-memory lockfile that
`mutateModules` resolved, newly forwarded as `MutateModulesResult.newLockfile`.
In pacquet the pass runs as a second, post-install write of
`pnpm-workspace.yaml` (the catalog write has to precede the install so the
resolver reads the new entries back), reading the lockfile the install just
wrote. Registry-qualified snapshot keys (`<name>@<registry>:<version>`)
register their version; packages resolved only from a non-semver source (git,
tarball, `file:`) register their name with no version, so their bare-name entry
survives while versioned ones are pruned.

Cleanup runs before `addedMinimumReleaseAgeExcludes` is merged, so an exclusion
approved during the same install is never pruned by the same write.

Related to pnpm/pnpm#11668

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.
  • Updated the documentation if needed.

PR description 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

    • Added the cleanupOutdatedMinimumReleaseAgeExcludes workspace setting.
    • When enabled, add, update, and remove automatically remove stale minimumReleaseAgeExclude entries based on resolved package versions.
    • Outdated versions and unresolved package names are removed, while wildcard and invalid rules are preserved.
    • The setting defaults to disabled and works with both shared and project-specific lockfiles.
  • Documentation

    • Added release note documentation for the new setting.

@btea
btea requested a review from zkochan as a code owner August 5, 2026 06:47
Copilot AI lite review requested due to automatic review settings August 5, 2026 06:47
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds an opt-in cleanupOutdatedMinimumReleaseAgeExcludes setting. Add, update, and remove flows use resolved lockfile versions to prune stale exclusions while preserving valid, wildcard, malformed, and newly added entries.

Changes

Minimum release-age exclusion cleanup

Layer / File(s) Summary
Configuration and version-policy rules
pnpm/crates/config/*, pnpm11/config/*, pnpm11/installing/deps-installer/*
Adds the cleanup setting with a default of false. Adds helpers that filter exclusions against resolved package versions.
Workspace manifest cleanup
pnpm/crates/workspace-manifest-writer/*, pnpm11/workspace/workspace-manifest-writer/*
Prunes obsolete exclusions, canonicalizes narrowed version unions, removes empty fields or manifests, and merges new exclusions after cleanup.
Lockfile resolution propagation
pnpm11/lockfile/utils/*, pnpm11/installing/commands/*, pnpm11/installing/deps-installer/*
Extracts resolved versions from lockfiles and propagates new lockfiles through installation and recursive command results.
Command and catalog integration
pnpm/crates/package-manager/*, pnpm/crates/cli/tests/*, .changeset/*
Runs cleanup after add, update, and remove manifest writes, handles lockfile loading errors, and adds integration coverage and release notes.

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

Possibly related issues

Possibly related PRs

  • pnpm/pnpm#13161 — Adds related wildcard and exact-version exclusion behavior that this cleanup preserves and rewrites.
  • pnpm/pnpm#13208 — Shares install-family command and workspace manifest handling changes.
  • pnpm/pnpm#13708 — Shares Rust package-manager handling for minimumReleaseAgeExclude in add, remove, and update flows.

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

Suggested reviewers: zkochan, copilot

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@greptile-apps

greptile-apps Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the registry-qualified snapshot path now extracts and retains the semantic version under the correct package name.

Reviews (7): Last reviewed commit: "refactor: name the pruning settings `min..." | 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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pnpm11/workspace/workspace-manifest-writer/src/index.ts (1)

97-107: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Run cleanup before merging newly added exclusions.

The writer merges addedMinimumReleaseAgeExcludes before cleanup. Cleanup can then delete an exclusion added in the same write when it is absent from resolvedPackageVersions. Rust runs cleanup first and preserves all same-write additions.

  • pnpm11/workspace/workspace-manifest-writer/src/index.ts#L97-L107: move the cleanup block before the addedMinimumReleaseAgeExcludes merge.
  • pnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts#L148-L162: add an unmatched exclusion, such as [email protected], and verify it remains while an existing stale exclusion is removed.

As per path instructions, “entries added in the same write are never pruned” and TypeScript/pacquet behavior must match.

🤖 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/workspace/workspace-manifest-writer/src/index.ts` around lines 97 -
107, In pnpm11/workspace/workspace-manifest-writer/src/index.ts lines 97-107,
move the cleanupMinimumReleaseAgeExcludes call before merging
addedMinimumReleaseAgeExcludes so same-write additions are never pruned. In
pnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts
lines 148-162, add an unmatched exclusion such as [email protected] and verify it
remains while the existing stale exclusion is removed.

Source: Path instructions

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

Inline comments:
In `@pnpm11/installing/commands/src/recursive.ts`:
- Around line 547-548: Update the recursive action aggregation around
allResolvedPackageVersions to track whether any ActionResult.newLockfile was
produced, and pass resolvedPackageVersions as undefined when none was returned.
Preserve and pass the empty map when a lockfile was produced but contains no
resolved versions, so the manifest writer can distinguish “no lockfile” from an
intentionally empty lockfile.

In `@pnpm11/workspace/workspace-manifest-writer/src/index.ts`:
- Around line 302-304: Update the narrowed-version branch that pushes to
survivingSpecs to pass the surviving version union through
mergePackageVersionSpecs() instead of preserving survivingVersions input order.
Add a regression test covering unsorted surviving versions and verify
TypeScript/pacquet behavioral parity, including errors and manifest formatting.

---

Outside diff comments:
In `@pnpm11/workspace/workspace-manifest-writer/src/index.ts`:
- Around line 97-107: In pnpm11/workspace/workspace-manifest-writer/src/index.ts
lines 97-107, move the cleanupMinimumReleaseAgeExcludes call before merging
addedMinimumReleaseAgeExcludes so same-write additions are never pruned. In
pnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts
lines 148-162, add an unmatched exclusion such as [email protected] and verify it
remains while the existing stale exclusion is removed.
🪄 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: 0be5cf97-834d-4150-8c59-3d1f504c66ee

📥 Commits

Reviewing files that changed from the base of the PR and between a550eca and 2d1b6dd.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock, !Cargo.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing (31)
  • .changeset/cleanup-outdated-minimum-release-age-excludes.md
  • pnpm/crates/cli/tests/catalog.rs
  • pnpm/crates/config/src/lib.rs
  • pnpm/crates/config/src/tests.rs
  • pnpm/crates/config/src/version_policy.rs
  • pnpm/crates/config/src/workspace_yaml.rs
  • pnpm/crates/deps-restorer/src/install_package_from_registry/tests.rs
  • pnpm/crates/package-manager/src/add.rs
  • pnpm/crates/package-manager/src/catalog_cleanup.rs
  • pnpm/crates/package-manager/src/catalog_cleanup/tests.rs
  • pnpm/crates/package-manager/src/remove.rs
  • pnpm/crates/package-manager/src/update.rs
  • pnpm/crates/workspace-manifest-writer/Cargo.toml
  • pnpm/crates/workspace-manifest-writer/src/edit.rs
  • pnpm/crates/workspace-manifest-writer/src/lib.rs
  • pnpm/crates/workspace-manifest-writer/src/tests.rs
  • pnpm11/config/reader/src/Config.ts
  • pnpm11/config/version-policy/src/index.ts
  • pnpm11/installing/commands/package.json
  • pnpm11/installing/commands/src/installDeps.ts
  • pnpm11/installing/commands/src/recursive.ts
  • pnpm11/installing/commands/src/remove.ts
  • pnpm11/installing/commands/src/resolvedPackageVersionsIfCleanup.ts
  • pnpm11/installing/commands/tsconfig.json
  • pnpm11/installing/deps-installer/src/install/extendInstallOptions.ts
  • pnpm11/installing/deps-installer/src/install/index.ts
  • pnpm11/lockfile/utils/src/index.ts
  • pnpm11/lockfile/utils/src/resolvedPackageVersions.ts
  • pnpm11/lockfile/utils/test/resolvedPackageVersions.ts
  • pnpm11/workspace/workspace-manifest-writer/src/index.ts
  • pnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts

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.

Pull request overview

Adds a new workspace setting, cleanupOutdatedMinimumReleaseAgeExcludes, to automatically prune stale minimumReleaseAgeExclude entries in pnpm-workspace.yaml based on what the freshly resolved lockfile contains (implemented in both the TypeScript CLI and the Rust pnpm/ port).

Changes:

  • Add lockfile-derived “resolved package versions” collection utilities and pass them through install/remove/update flows to the workspace manifest writer.
  • Implement the cleanup pass in the workspace manifest writer (TypeScript + Rust) and add coverage tests for pruning behavior and edge cases (globs, unparsable entries, non-semver resolutions).
  • Expose parseVersionPolicyRule for reuse and add changeset/lockfile updates for the new public setting.

Reviewed changes

Copilot reviewed 31 out of 33 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts New Jest suite covering cleanup behavior in TS manifest writer.
pnpm11/workspace/workspace-manifest-writer/src/index.ts Adds cleanup option + implementation for pruning outdated excludes.
pnpm11/lockfile/utils/test/resolvedPackageVersions.ts Tests for extracting resolved package versions from a lockfile.
pnpm11/lockfile/utils/src/resolvedPackageVersions.ts New helper to map lockfile packages to name → resolved versions.
pnpm11/lockfile/utils/src/index.ts Exports the new lockfile utility function.
pnpm11/installing/deps-installer/src/install/index.ts Forwards newLockfile through install/mutate results to callers.
pnpm11/installing/deps-installer/src/install/extendInstallOptions.ts Adds cleanupOutdatedMinimumReleaseAgeExcludes to strict options + defaults.
pnpm11/installing/commands/tsconfig.json Adds project reference to lockfile/utils.
pnpm11/installing/commands/src/resolvedPackageVersionsIfCleanup.ts New helper to compute resolved versions only when cleanup is enabled.
pnpm11/installing/commands/src/remove.ts Wires cleanup option + resolved versions into workspace manifest update after remove.
pnpm11/installing/commands/src/recursive.ts Accumulates resolved versions for recursive operations and forwards to manifest writer.
pnpm11/installing/commands/src/installDeps.ts Wires cleanup option + resolved versions into workspace manifest update after install.
pnpm11/installing/commands/package.json Adds dependency on @pnpm/lockfile.utils.
pnpm11/config/version-policy/src/index.ts Exports parseVersionPolicyRule for reuse by cleanup logic.
pnpm11/config/reader/src/Config.ts Adds the new setting to the config type surface.
pnpm/crates/workspace-manifest-writer/src/tests.rs Adds Rust tests for the cleanup pass parity and edge cases.
pnpm/crates/workspace-manifest-writer/src/lib.rs Adds options + error plumbing for cleanup and merging release-age excludes.
pnpm/crates/workspace-manifest-writer/src/edit.rs Implements cleanup + merge helpers on the Rust manifest writer side.
pnpm/crates/workspace-manifest-writer/Cargo.toml Adds pacquet-config dependency for version-policy helpers.
pnpm/crates/package-manager/src/update.rs Runs the cleanup pass post-install for update flows (Rust).
pnpm/crates/package-manager/src/remove.rs Runs the cleanup pass post-install for remove flows (Rust).
pnpm/crates/package-manager/src/add.rs Runs the cleanup pass post-install for add flows (Rust).
pnpm/crates/package-manager/src/catalog_cleanup.rs Adds lockfile-based cleanup pass orchestration + resolved-versions extraction (Rust).
pnpm/crates/package-manager/src/catalog_cleanup/tests.rs New test ensuring non-semver packages register by name only (Rust).
pnpm/crates/deps-restorer/src/install_package_from_registry/tests.rs Extends config fixture with the new setting default (Rust tests).
pnpm/crates/config/src/workspace_yaml.rs Adds workspace-yaml parsing for the new setting (Rust).
pnpm/crates/config/src/version_policy.rs Adds pruning logic + types for resolved versions (Rust).
pnpm/crates/config/src/tests.rs Adds config test ensuring workspace-yaml setting is read (Rust).
pnpm/crates/config/src/lib.rs Adds the new config field and docs (Rust).
pnpm/crates/cli/tests/catalog.rs Adds CLI-level Rust test validating cleanup behavior end-to-end.
pnpm-lock.yaml Updates workspace importer deps and lock entries due to new package usage.
Cargo.lock Adds pacquet-config dependency to workspace-manifest-writer crate.
.changeset/cleanup-outdated-minimum-release-age-excludes.md Changeset announcing the new workspace setting and behavior.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter

codecov-commenter commented Aug 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.63866% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.25%. Comparing base (7bed697) to head (9190f05).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/package-manager/src/catalog_cleanup.rs 95.65% 2 Missing ⚠️
pnpm/crates/package-manager/src/update.rs 92.85% 1 Missing ⚠️
pnpm/crates/workspace-manifest-writer/src/edit.rs 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13653      +/-   ##
==========================================
+ Coverage   88.23%   88.25%   +0.01%     
==========================================
  Files         624      624              
  Lines      101779   101918     +139     
==========================================
+ Hits        89809    89945     +136     
- Misses      11970    11973       +3     

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

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 9190f055fbec

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.506 ± 0.135 2.334 2.689 1.64 ± 0.18
pacquet@main 2.471 ± 0.171 2.349 2.789 1.61 ± 0.19
pnpr@HEAD 1.531 ± 0.150 1.376 1.787 1.00
pnpr@main 1.576 ± 0.183 1.378 1.795 1.03 ± 0.16
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5062693912199996,
      "stddev": 0.13454960229293536,
      "median": 2.47540826132,
      "user": 1.6407179799999998,
      "system": 1.36407122,
      "min": 2.33362309732,
      "max": 2.68917558532,
      "times": [
        2.62508302632,
        2.42670664232,
        2.42400788032,
        2.6149136193199998,
        2.5241098803199997,
        2.6651916943200002,
        2.68917558532,
        2.41969877032,
        2.34018371632,
        2.33362309732
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.47130054562,
      "stddev": 0.17058334396610947,
      "median": 2.3808249738200002,
      "user": 1.5908127799999998,
      "system": 1.32935882,
      "min": 2.34894549832,
      "max": 2.78911304232,
      "times": [
        2.40368244632,
        2.75263640332,
        2.37674805832,
        2.57075144032,
        2.36717826732,
        2.36525795832,
        2.35379045232,
        2.78911304232,
        2.34894549832,
        2.38490188932
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5307067048199998,
      "stddev": 0.14959392537262975,
      "median": 1.47774507532,
      "user": 1.1497670799999997,
      "system": 1.20614862,
      "min": 1.37610992832,
      "max": 1.78699506032,
      "times": [
        1.43525512932,
        1.51446226532,
        1.37610992832,
        1.44102788532,
        1.78699506032,
        1.72381063032,
        1.57268890032,
        1.66675567632,
        1.39507831932,
        1.39488325332
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.57605836272,
      "stddev": 0.18308239507399068,
      "median": 1.5367548603199999,
      "user": 1.1099599799999997,
      "system": 1.17781282,
      "min": 1.37815359932,
      "max": 1.79464795032,
      "times": [
        1.79464795032,
        1.77229794732,
        1.38622421332,
        1.51933353332,
        1.78638047732,
        1.75857912132,
        1.37815359932,
        1.38695254132,
        1.42383805632,
        1.55417618732
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 259.6 ± 18.5 238.5 282.4 1.03 ± 0.09
pacquet@main 251.9 ± 12.6 237.0 271.7 1.00
pnpr@HEAD 271.0 ± 3.7 267.6 277.0 1.08 ± 0.06
pnpr@main 270.6 ± 8.3 261.1 288.6 1.07 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.25955783174,
      "stddev": 0.018471122293576465,
      "median": 0.25156451994,
      "user": 0.22488037999999996,
      "system": 0.5131418799999999,
      "min": 0.23850910544,
      "max": 0.28239544344,
      "times": [
        0.23850910544,
        0.24983375344000003,
        0.24867701944,
        0.25329528644,
        0.23860332244000002,
        0.24547346044,
        0.28214317844000003,
        0.27931862344,
        0.27732912444,
        0.28239544344
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.25194121983999995,
      "stddev": 0.012607667180053652,
      "median": 0.24853887994,
      "user": 0.20838018000000003,
      "system": 0.5084403799999999,
      "min": 0.23700989844,
      "max": 0.27167774544,
      "times": [
        0.26651156944,
        0.24161170544000002,
        0.24834043744,
        0.27167774544,
        0.25293085244,
        0.26761272744000003,
        0.24752248044,
        0.23700989844,
        0.23745745944000002,
        0.24873732244000002
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.27103290324,
      "stddev": 0.003737449646186194,
      "median": 0.27031026594,
      "user": 0.23448518,
      "system": 0.5300139799999999,
      "min": 0.26757334444,
      "max": 0.27704345744000003,
      "times": [
        0.27697585044,
        0.27025347844000003,
        0.27060381744,
        0.26757334444,
        0.26767663844,
        0.26782107944,
        0.27412855144000003,
        0.26788576144000004,
        0.27036705344,
        0.27704345744000003
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.27062704484,
      "stddev": 0.008291373498516365,
      "median": 0.27003757444,
      "user": 0.22061028,
      "system": 0.5392069799999999,
      "min": 0.26112770344,
      "max": 0.28864540644000003,
      "times": [
        0.27123078644,
        0.27649199144000003,
        0.27400083144000004,
        0.26333768644,
        0.26884436244,
        0.27435076844,
        0.26112770344,
        0.26293128144,
        0.26530963044,
        0.28864540644000003
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.664 ± 0.072 2.575 2.810 1.73 ± 0.13
pacquet@main 2.681 ± 0.037 2.636 2.746 1.74 ± 0.13
pnpr@HEAD 1.538 ± 0.110 1.426 1.709 1.00
pnpr@main 1.564 ± 0.126 1.429 1.830 1.02 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.66412669206,
      "stddev": 0.07243892819916016,
      "median": 2.6436936637599997,
      "user": 1.7865434399999998,
      "system": 1.4668375800000002,
      "min": 2.5747007537599997,
      "max": 2.80982288476,
      "times": [
        2.61423398176,
        2.5747007537599997,
        2.60236414676,
        2.63068710776,
        2.62324542376,
        2.74872534576,
        2.65670021976,
        2.80982288476,
        2.70298021476,
        2.67780684176
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.6813171718600004,
      "stddev": 0.03673409373321298,
      "median": 2.66752852726,
      "user": 1.81964464,
      "system": 1.43690838,
      "min": 2.6360518487599998,
      "max": 2.74649144776,
      "times": [
        2.70123531676,
        2.71315645776,
        2.66638409676,
        2.6573919997599997,
        2.74649144776,
        2.66867295776,
        2.64111711776,
        2.6360518487599998,
        2.66247886876,
        2.72019160676
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5380792256600002,
      "stddev": 0.10990382307802249,
      "median": 1.47791658076,
      "user": 1.16056034,
      "system": 1.2090874800000002,
      "min": 1.4257291247600001,
      "max": 1.7086461677600002,
      "times": [
        1.46193255576,
        1.6274450027600003,
        1.46367135276,
        1.66205012976,
        1.44559830176,
        1.4431168287600002,
        1.4921618087600002,
        1.65044098376,
        1.4257291247600001,
        1.7086461677600002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.56439035336,
      "stddev": 0.12642730373955477,
      "median": 1.5252799917600002,
      "user": 1.09403844,
      "system": 1.2685776800000002,
      "min": 1.4294708067600002,
      "max": 1.82979635276,
      "times": [
        1.54857732176,
        1.59415417476,
        1.5039846067600002,
        1.4689675957600001,
        1.73861722776,
        1.47977546376,
        1.82979635276,
        1.5446051257600002,
        1.5059548577600002,
        1.4294708067600002
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 438.3 ± 17.3 414.8 464.9 1.39 ± 0.07
pacquet@main 430.1 ± 33.0 383.1 472.5 1.37 ± 0.11
pnpr@HEAD 317.2 ± 21.6 296.7 364.3 1.01 ± 0.08
pnpr@main 314.7 ± 10.4 296.0 329.3 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.43826096360000005,
      "stddev": 0.01731522221294469,
      "median": 0.43680719310000005,
      "user": 0.58585072,
      "system": 0.7156623999999999,
      "min": 0.4147604146,
      "max": 0.4649413196,
      "times": [
        0.4147604146,
        0.4338067706,
        0.4563330856,
        0.4180166926,
        0.4203332446,
        0.4649413196,
        0.4496535546,
        0.4327624496,
        0.4521944886,
        0.43980761560000003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.43012522580000007,
      "stddev": 0.03298795381420451,
      "median": 0.4338751031,
      "user": 0.59152392,
      "system": 0.6666106999999999,
      "min": 0.3830687486,
      "max": 0.4725224826,
      "times": [
        0.4640793506,
        0.4638795946,
        0.4529197316,
        0.3830687486,
        0.3976189556,
        0.3993224666,
        0.4297209026,
        0.4725224826,
        0.43802930360000003,
        0.40009072160000003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31719961990000006,
      "stddev": 0.02155333232267634,
      "median": 0.3073947786,
      "user": 0.21932491999999998,
      "system": 0.5258089,
      "min": 0.2967385706,
      "max": 0.3642979296,
      "times": [
        0.2969156646,
        0.3066220416,
        0.3302673096,
        0.3642979296,
        0.3035531656,
        0.3081675156,
        0.3367785326,
        0.3238746576,
        0.3047808116,
        0.2967385706
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.31472728940000005,
      "stddev": 0.010359879180002696,
      "median": 0.3165206506,
      "user": 0.22403921999999996,
      "system": 0.5212256000000001,
      "min": 0.2960473326,
      "max": 0.3292817266,
      "times": [
        0.3268729106,
        0.3081052086,
        0.3048279006,
        0.3221304196,
        0.2960473326,
        0.3158693066,
        0.3185140546,
        0.3084520396,
        0.3292817266,
        0.3171719946
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.760 ± 0.021 1.739 1.801 5.86 ± 0.21
pacquet@main 1.752 ± 0.030 1.713 1.799 5.84 ± 0.22
pnpr@HEAD 0.300 ± 0.010 0.288 0.322 1.00
pnpr@main 0.348 ± 0.056 0.300 0.452 1.16 ± 0.19
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.75951659164,
      "stddev": 0.02054972292871016,
      "median": 1.75136659254,
      "user": 0.8181487000000001,
      "system": 0.78331158,
      "min": 1.73941854304,
      "max": 1.8006379590400001,
      "times": [
        1.75657672204,
        1.78210911404,
        1.8006379590400001,
        1.77892355004,
        1.7490701280399998,
        1.7459074050399999,
        1.74081054904,
        1.7480488890399999,
        1.73941854304,
        1.75366305704
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.75154202124,
      "stddev": 0.029727426249953854,
      "median": 1.75065896304,
      "user": 0.8329106,
      "system": 0.7795902799999999,
      "min": 1.7126158330399999,
      "max": 1.79856716804,
      "times": [
        1.78512335904,
        1.78327580704,
        1.79856716804,
        1.75098775104,
        1.75292867704,
        1.75033017504,
        1.73405910304,
        1.73471559804,
        1.71281674104,
        1.7126158330399999
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30010405063999995,
      "stddev": 0.010218235446101832,
      "median": 0.30012927354,
      "user": 0.20504059999999996,
      "system": 0.5136449799999999,
      "min": 0.28839649804,
      "max": 0.32201600604,
      "times": [
        0.32201600604,
        0.29487361804,
        0.31075215204,
        0.30098834704,
        0.29997831004000003,
        0.29203808004000004,
        0.30217666004,
        0.28839649804,
        0.28954059804,
        0.30028023704
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.34775536944,
      "stddev": 0.05561820122519136,
      "median": 0.32141218654000003,
      "user": 0.2503665,
      "system": 0.6159914799999999,
      "min": 0.29950501004,
      "max": 0.45193018404,
      "times": [
        0.33930102304000004,
        0.29950501004,
        0.32432228004,
        0.40330244704,
        0.41893913704,
        0.45193018404,
        0.31850209304,
        0.29976815404,
        0.30744816504,
        0.31453520104
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 213.1 ± 15.7 194.9 242.7 2.44 ± 0.18
pacquet@main 205.5 ± 14.2 187.4 236.1 2.35 ± 0.16
pnpr@HEAD 87.6 ± 1.2 85.9 91.5 1.00 ± 0.02
pnpr@main 87.4 ± 0.9 85.7 90.2 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.21311299838,
      "stddev": 0.015706545737233978,
      "median": 0.21041864938000004,
      "user": 0.18043642000000001,
      "system": 0.055718149999999994,
      "min": 0.19488060488000003,
      "max": 0.24269776888000003,
      "times": [
        0.22925793588,
        0.20966310988000003,
        0.19488060488000003,
        0.19765776188000003,
        0.23315779488000002,
        0.24269776888000003,
        0.22107708588000002,
        0.21514614188000003,
        0.19654104388000002,
        0.19834341088000002,
        0.21117418888000003,
        0.20775913288000003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.20546555749538464,
      "stddev": 0.014190866728285706,
      "median": 0.20365871788000003,
      "user": 0.16210726615384613,
      "system": 0.05642251538461539,
      "min": 0.18744491388000004,
      "max": 0.23605784188000004,
      "times": [
        0.21086900588000002,
        0.21097362088000002,
        0.22684528388000003,
        0.19389793888000004,
        0.20365871788000003,
        0.20358747488000004,
        0.23605784188000004,
        0.18744491388000004,
        0.20801931188000003,
        0.20156062588000004,
        0.20772720188000002,
        0.18846423888000002,
        0.19194607088
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08761207494060606,
      "stddev": 0.0012315099370095934,
      "median": 0.08739854688000001,
      "user": 0.02046566242424243,
      "system": 0.00969772424242424,
      "min": 0.08591123188000001,
      "max": 0.09153919688,
      "times": [
        0.08629882988000001,
        0.08762742588,
        0.08762950088,
        0.08818174788000001,
        0.08701132688,
        0.08615885688000001,
        0.08716969688000001,
        0.08760000488,
        0.08744187788,
        0.08758525588,
        0.08765437688000001,
        0.08718699888,
        0.08689702388000001,
        0.08767243088,
        0.08681003088,
        0.08953945788,
        0.09067553388,
        0.08967191688000001,
        0.08591123188000001,
        0.08756243388,
        0.08739854688000001,
        0.08677525588,
        0.08819376988000001,
        0.09153919688,
        0.08650134088,
        0.08722422788,
        0.08733812288000001,
        0.08840376388,
        0.08649085088,
        0.08736364088000001,
        0.08694963188,
        0.08829847788,
        0.08643568688
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08742477131750004,
      "stddev": 0.0008571413610093145,
      "median": 0.08725527138,
      "user": 0.020825982499999996,
      "system": 0.00949318125,
      "min": 0.08569910388,
      "max": 0.09015725888000001,
      "times": [
        0.08851657688,
        0.08569910388,
        0.08751832188,
        0.08768475388000001,
        0.08726344088,
        0.08675885488,
        0.08973959488000001,
        0.09015725888000001,
        0.08676927388000001,
        0.08718352188,
        0.08768623688,
        0.08798461788,
        0.08703395988000001,
        0.08699472788000001,
        0.08712837888000001,
        0.08797967688000001,
        0.08646142488,
        0.08759554688,
        0.08724710188000001,
        0.08811422188000001,
        0.08775997488000001,
        0.08688926888000001,
        0.08691206288,
        0.08698740288000001,
        0.08642074888000001,
        0.08741082988,
        0.08749185088,
        0.08752287988,
        0.08707456688000001,
        0.08712732688000001,
        0.08731757388,
        0.08716159988000001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 909.2 ± 276.2 647.6 1464.7 1.05 ± 0.44
pacquet@main 866.6 ± 247.4 660.8 1470.3 1.00
pnpm@HEAD 2925.3 ± 84.8 2845.0 3097.3 3.38 ± 0.97
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.909168782648889,
      "stddev": 0.2762195040125459,
      "median": 0.8206534647600001,
      "user": 0.8696706111111111,
      "system": 0.14282064,
      "min": 0.64762927676,
      "max": 1.46465884276,
      "times": [
        0.74851066476,
        0.8206534647600001,
        0.82185470276,
        0.9016413457600001,
        1.46465884276,
        0.79973836876,
        1.2782126447600002,
        0.6996197327600001,
        0.64762927676
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.86659478476,
      "stddev": 0.24737879369352028,
      "median": 0.8205187627600001,
      "user": 0.8355772777777778,
      "system": 0.11931075111111111,
      "min": 0.6607555197600001,
      "max": 1.47029375076,
      "times": [
        0.6644494997600001,
        0.8250157227600001,
        0.8651762597600001,
        0.6607555197600001,
        0.7640990837600001,
        0.9818196947600001,
        0.8205187627600001,
        1.47029375076,
        0.7472247687600001
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 2.925284063093333,
      "stddev": 0.0847740158188643,
      "median": 2.90437598176,
      "user": 4.4553515,
      "system": 0.27200552888888885,
      "min": 2.84503322076,
      "max": 3.09729389876,
      "times": [
        2.99031246976,
        2.8477475817599998,
        2.89555541876,
        2.84503322076,
        3.09729389876,
        2.98972340376,
        2.9054222577599997,
        2.90437598176,
        2.85209233476
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.563 ± 0.164 4.408 4.851 1.30 ± 0.05
pacquet@main 4.503 ± 0.102 4.406 4.695 1.28 ± 0.04
pnpr@HEAD 3.520 ± 0.061 3.447 3.605 1.00
pnpr@main 3.573 ± 0.157 3.447 3.875 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.56252255364,
      "stddev": 0.16354892326404413,
      "median": 4.493079381339999,
      "user": 1.7296951,
      "system": 1.3849659199999997,
      "min": 4.40765198284,
      "max": 4.85073136684,
      "times": [
        4.63916219484,
        4.80787465184,
        4.51582137584,
        4.46608148884,
        4.41990393384,
        4.85073136684,
        4.40765198284,
        4.47033738684,
        4.63405661684,
        4.41360453784
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.50258510724,
      "stddev": 0.10190281312266986,
      "median": 4.45463471634,
      "user": 1.7071852,
      "system": 1.38453312,
      "min": 4.40581291884,
      "max": 4.69518503484,
      "times": [
        4.41056147084,
        4.45911142284,
        4.43552187984,
        4.69518503484,
        4.44444188084,
        4.65150747484,
        4.45015800984,
        4.56413606884,
        4.40581291884,
        4.5094149108399995
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5201794368400003,
      "stddev": 0.06097138547165428,
      "median": 3.53180063884,
      "user": 1.1716210999999999,
      "system": 1.23380672,
      "min": 3.44655112384,
      "max": 3.60534492884,
      "times": [
        3.54974670284,
        3.59283779984,
        3.52740183884,
        3.4478624178399997,
        3.45149535384,
        3.44655112384,
        3.5361994388399998,
        3.47545588484,
        3.60534492884,
        3.56889887884
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.5728926288400005,
      "stddev": 0.15710795727295107,
      "median": 3.52243077484,
      "user": 1.1651700000000003,
      "system": 1.2310942199999997,
      "min": 3.44680179984,
      "max": 3.87470964584,
      "times": [
        3.84678742084,
        3.44680179984,
        3.57186821684,
        3.52067346284,
        3.47095498284,
        3.5241880868399997,
        3.46550513184,
        3.46163552284,
        3.87470964584,
        3.54580201784
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13653
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,574.70 ms
(-3.23%)Baseline: 2,660.73 ms
3,192.88 ms
(80.64%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,739.42 ms
(-2.92%)Baseline: 1,791.74 ms
2,150.09 ms
(80.90%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
414.76 ms
(-7.12%)Baseline: 446.57 ms
535.88 ms
(77.40%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
194.88 ms
(-14.06%)Baseline: 226.77 ms
272.12 ms
(71.62%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,333.62 ms
(-3.40%)Baseline: 2,415.68 ms
2,898.81 ms
(80.50%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,407.65 ms
(-2.27%)Baseline: 4,509.84 ms
5,411.81 ms
(81.45%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
238.51 ms
(-16.82%)Baseline: 286.74 ms
344.09 ms
(69.32%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
647.63 ms
(-6.89%)Baseline: 695.57 ms
834.68 ms
(77.59%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13653
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,425.73 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
288.40 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
296.74 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
85.91 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,376.11 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,446.55 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
267.57 ms
🐰 View full continuous benchmarking report in Bencher

Copilot AI review requested due to automatic review settings August 5, 2026 07:20
@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Aug 5, 2026

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.

Pull request overview

Copilot reviewed 31 out of 33 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Suppressed comments (2)

pnpm11/workspace/workspace-manifest-writer/src/index.ts:107

  • cleanupOutdatedMinimumReleaseAgeExcludes currently runs after merging addedMinimumReleaseAgeExcludes, so entries added in the same write can be immediately pruned if they aren’t present in resolvedPackageVersions (this contradicts the intended “added entries survive” behavior and the Rust implementation/tests). Run the cleanup pass before merging addedMinimumReleaseAgeExcludes.
    pnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts:177
  • The test for “entries added in the same write survive the cleanup” only covers the case where the added entry is also present in resolvedPackageVersions. Add a regression case where an added entry is not in resolvedPackageVersions (it should still be kept) to prevent reintroducing the ordering bug between cleanup and merge.

Copilot AI review requested due to automatic review settings August 5, 2026 07:26

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.

Pull request overview

Copilot reviewed 31 out of 33 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

@btea

btea commented Aug 5, 2026 •

Copy link
Copy Markdown
Member Author

This configuration parameter is named with reference to cleanupUnusedCatalogs, which is a bit long, but the meaning is clear. I can't find a more suitable short name at the moment.

Copilot AI review requested due to automatic review settings August 6, 2026 01:59

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.

Pull request overview

Copilot reviewed 31 out of 33 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file
Suppressed comments (1)

pnpm11/lockfile/utils/test/resolvedPackageVersions.ts:46

  • resolvedPackageVersionsFromLockfile() relies on dep path parsing to handle registry-qualified keys (<name>@<registryName>:<version>). Since this is a new public helper that will drive workspace-manifest cleanup, it would be good to add a regression test that a registry-qualified dep path contributes the semver version (not an empty set / non-semver).

@tats-u

tats-u commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Is it possible to apply this to pnpm audit --fix(=update), too? #11563

Copilot AI review requested due to automatic review settings August 6, 2026 07:57
Copilot AI review requested due to automatic review settings August 7, 2026 14:16
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

448-461: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Add a Rust CLI case for sharedWorkspaceLockfile: false.

catalog.rs::setup() creates a shared-workspace harness, and this test writes only pnpm-workspace.yaml under cleanupOutdatedMinimumReleaseAgeExcludes: true. Add a real CLI test that sets sharedWorkspaceLockfile: false and verifies the same pruning behavior with per-project lockfiles.

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

In `@pnpm/crates/cli/tests/suite/catalog.rs` around lines 448 - 461, Extend the
catalog test coverage around setup() with a separate CLI case that configures
sharedWorkspaceLockfile: false, uses per-project lockfiles, and verifies
cleanupOutdatedMinimumReleaseAgeExcludes still preserves the listed catalog
versions when adding the dependency. Keep the existing shared-workspace test
unchanged and assert the resulting pruning behavior through the CLI.

Sources: Path instructions, Learnings

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

Nitpick comments:
In `@pnpm/crates/cli/tests/suite/catalog.rs`:
- Around line 448-461: Extend the catalog test coverage around setup() with a
separate CLI case that configures sharedWorkspaceLockfile: false, uses
per-project lockfiles, and verifies cleanupOutdatedMinimumReleaseAgeExcludes
still preserves the listed catalog versions when adding the dependency. Keep the
existing shared-workspace test unchanged and assert the resulting pruning
behavior through the CLI.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8cc474ac-ac1a-4f9a-afbc-79a40cb7338b

📥 Commits

Reviewing files that changed from the base of the PR and between 97f20b0 and 41ee153.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock, !Cargo.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing (31)
  • .changeset/cleanup-outdated-minimum-release-age-excludes.md
  • pnpm/crates/cli/tests/suite/catalog.rs
  • pnpm/crates/config/src/lib.rs
  • pnpm/crates/config/src/tests.rs
  • pnpm/crates/config/src/version_policy.rs
  • pnpm/crates/config/src/workspace_yaml.rs
  • pnpm/crates/deps-restorer/src/install_package_from_registry/tests.rs
  • pnpm/crates/package-manager/src/add.rs
  • pnpm/crates/package-manager/src/catalog_cleanup.rs
  • pnpm/crates/package-manager/src/catalog_cleanup/tests.rs
  • pnpm/crates/package-manager/src/remove.rs
  • pnpm/crates/package-manager/src/update.rs
  • pnpm/crates/workspace-manifest-writer/Cargo.toml
  • pnpm/crates/workspace-manifest-writer/src/edit.rs
  • pnpm/crates/workspace-manifest-writer/src/lib.rs
  • pnpm/crates/workspace-manifest-writer/src/tests.rs
  • pnpm11/config/reader/src/Config.ts
  • pnpm11/config/version-policy/src/index.ts
  • pnpm11/installing/commands/package.json
  • pnpm11/installing/commands/src/installDeps.ts
  • pnpm11/installing/commands/src/recursive.ts
  • pnpm11/installing/commands/src/remove.ts
  • pnpm11/installing/commands/src/resolvedPackageVersionsIfCleanup.ts
  • pnpm11/installing/commands/tsconfig.json
  • pnpm11/installing/deps-installer/src/install/extendInstallOptions.ts
  • pnpm11/installing/deps-installer/src/install/index.ts
  • pnpm11/lockfile/utils/src/index.ts
  • pnpm11/lockfile/utils/src/resolvedPackageVersions.ts
  • pnpm11/lockfile/utils/test/resolvedPackageVersions.ts
  • pnpm11/workspace/workspace-manifest-writer/src/index.ts
  • pnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts
🚧 Files skipped from review as they are similar to previous changes (30)
  • pnpm11/installing/commands/tsconfig.json
  • pnpm11/installing/commands/package.json
  • pnpm11/installing/deps-installer/src/install/extendInstallOptions.ts
  • pnpm/crates/deps-restorer/src/install_package_from_registry/tests.rs
  • pnpm11/lockfile/utils/src/index.ts
  • pnpm/crates/workspace-manifest-writer/Cargo.toml
  • pnpm/crates/config/src/workspace_yaml.rs
  • pnpm/crates/config/src/tests.rs
  • pnpm11/lockfile/utils/src/resolvedPackageVersions.ts
  • pnpm11/config/version-policy/src/index.ts
  • pnpm11/installing/commands/src/remove.ts
  • pnpm/crates/config/src/lib.rs
  • pnpm/crates/package-manager/src/remove.rs
  • .changeset/cleanup-outdated-minimum-release-age-excludes.md
  • pnpm/crates/workspace-manifest-writer/src/tests.rs
  • pnpm/crates/package-manager/src/update.rs
  • pnpm11/workspace/workspace-manifest-writer/src/index.ts
  • pnpm/crates/package-manager/src/catalog_cleanup/tests.rs
  • pnpm11/lockfile/utils/test/resolvedPackageVersions.ts
  • pnpm11/workspace/workspace-manifest-writer/test/cleanupOutdatedMinimumReleaseAgeExcludes.test.ts
  • pnpm11/installing/commands/src/resolvedPackageVersionsIfCleanup.ts
  • pnpm11/config/reader/src/Config.ts
  • pnpm/crates/package-manager/src/add.rs
  • pnpm/crates/workspace-manifest-writer/src/edit.rs
  • pnpm11/installing/deps-installer/src/install/index.ts
  • pnpm11/installing/commands/src/recursive.ts
  • pnpm11/installing/commands/src/installDeps.ts
  • pnpm/crates/config/src/version_policy.rs
  • pnpm/crates/package-manager/src/catalog_cleanup.rs
  • pnpm/crates/workspace-manifest-writer/src/lib.rs

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.

Pull request overview

Copilot reviewed 31 out of 33 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

btea added 4 commits August 11, 2026 01:49
- pacquet: register versions of registry-qualified lockfile snapshot keys
  so versioned exclusions for named-registry packages are not pruned
- recursive (non-shared lockfile): pass undefined instead of an empty
  resolved-versions map when no install produced a new lockfile
- writer: canonicalize narrowed version unions with mergePackageVersionSpecs
Matches the pacquet write order: entries approved during the same
install are merged after pruning, so the cleanup pass can never prune
an exclusion that was just added.
With `sharedWorkspaceLockfile: false` the install anchors the lockfile
at the project directory, so the cleanup pass found no lockfile at the
workspace dir and silently skipped. Read the lockfile from the
directory the install actually wrote it to.
@zkochan zkochan changed the title feat: add cleanupOutdatedMinimumReleaseAgeExcludes config feat: add minimumReleaseAgeExcludeCleanup config Aug 11, 2026
@zkochan zkochan changed the title feat: add minimumReleaseAgeExcludeCleanup config feat: add minimumReleaseAgeExcludePrune, rename cleanupUnusedCatalogs to catalogPrune Aug 11, 2026
…nd `catalogPrune`

Renames the new setting from `cleanupOutdatedMinimumReleaseAgeExcludes` to
`minimumReleaseAgeExcludePrune`, so it sorts with the list it acts on the way
`minimumReleaseAgeStrict`, `minimumReleaseAgeIgnoreMissingTime` and
`trustPolicyIgnoreAfter` sort with their families. "Outdated" was also the
wrong adjective: it reads as `pnpm outdated`, or as the release-age ageing rule
this pass does not implement.

Renames `cleanupUnusedCatalogs` to `catalogPrune` for the same reason, so both
settings name the same operation with the verb pnpm already uses in `pnpm prune`
and `pnpm store prune`. It is singular because the pass prunes the `catalog:`
block as well as `catalogs:`, exactly as `catalogMode` governs both. The former
name stays accepted: pacquet applies it just before the `apply!` macro, and the
TypeScript reader folds it with `catalogPrune ??= cleanupUnusedCatalogs`, so the
canonical key wins when a file carries both. No warning is emitted — it is an
alias, not a deprecation.

Two fixes to the pass itself:

Require a lockfile that covers every project `minimumReleaseAgeExclude`
governs. Under `sharedWorkspaceLockfile: false` the install anchors a lockfile
per project, so every entry a sibling project needs looked unresolved and was
deleted — a workspace could lose its whole exclude list to one `pnpm add`. The
pass now no-ops there, as it already did for `lockfile: false` and for an
install that resolved no new lockfile. That also makes the per-project
accumulation in `recursive.ts` dead, so the `newLockfile` plumbing through its
action results goes away with it.

Drop the writer's `cleanup_outdated_minimum_release_age_excludes` flag. The
resolved-versions map already decides whether the pass runs, and every caller
derived both from the same setting, so the pair could only ever disagree by
mistake. The same simplification removes pacquet's unused
`added_minimum_release_age_excludes` option, its `VersionPolicy` error variant
and the `add_minimum_release_age_excludes` edit: pacquet writes approved
exclusions through `minimum_release_age::persist_and_report_excludes` during the
install, which already precedes the post-install prune.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings August 11, 2026 00:31
@zkochan
zkochan force-pushed the feat/add-cleanupOutdatedMinimumReleaseAgeExcludes-config branch from 41ee153 to 9190f05 Compare August 11, 2026 00:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. Historical comment phrasing added 📘 Rule violation ⚙ Maintainability
Description
New comments use historical phrasing (e.g., was released as) instead of describing the current
compatibility behavior. This violates the rule against historical implementation notes in source
comments.
Code

pnpm11/config/reader/test/index.ts[R4494-4496]

+// `catalogPrune` was released as `cleanupUnusedCatalogs`, which every
+// pnpm-workspace.yaml written since pnpm 10.15 may still carry.
+test('catalogPrune is read from its former name, cleanupUnusedCatalogs', async () => {
Relevance

●●● Strong

Team often accepts rewording comments to avoid temporal/historical framing and prevent staleness in
docs/tests.

PR-#13727
PR-#13125

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 772199 prohibits comments that reference historical implementations. The cited
comments explicitly use past-tense/history framing (was released as).

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm11/config/reader/test/index.ts[4494-4496]
pnpm/crates/config/src/tests.rs[2932-2934]

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

## Issue description
Comments were added that describe past history (e.g., “was released as …”) rather than stating the current behavior/compatibility contract.

## Issue Context
The project requires comments to describe current behavior; backward-compatibility notes should be phrased in present terms (e.g., “For backward compatibility, `cleanupUnusedCatalogs` is still accepted as an alias for `catalogPrune`. …”).

## Fix Focus Areas
- pnpm11/config/reader/test/index.ts[4494-4496]
- pnpm/crates/config/src/tests.rs[2932-2934]

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


2. Unnecessary lockfile load/parse 🐞 Bug ➹ Performance
Description
Rust prune_minimum_release_age_excludes() always loads/parses the on-disk wanted lockfile when
minimumReleaseAgeExcludePrune is enabled, even if pnpm-workspace.yaml has no
minimumReleaseAgeExclude to prune (or it’s empty). This adds avoidable filesystem I/O + lockfile
parsing/scanning work to add/remove/update when the pruning flag is on but there is nothing to
clean.
Code

pnpm/crates/package-manager/src/catalog_cleanup.rs[R150-153]

+    let Some(lockfile) = Lockfile::load_wanted_from_dir(&workspace_dir)
+        .map_err(WriteWorkspaceCatalogsError::LoadLockfile)?
+    else {
+        return Ok(());
Relevance

●● Moderate

Mixed precedent on performance-only early guards; similar no-op-avoidance accepted elsewhere, but
similar pruning short-circuit was rejected.

PR-#13708
PR-#13172

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The Rust package-manager function loads the lockfile unconditionally after the flag checks;
meanwhile, the workspace-manifest writer’s prune pass immediately no-ops when the exclude list is
absent, and Config already has the exclude list parsed, enabling a cheap early guard.

pnpm/crates/package-manager/src/catalog_cleanup.rs[135-164]
pnpm/crates/workspace-manifest-writer/src/edit.rs[431-441]
pnpm/crates/config/src/lib.rs[1749-1763]

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

### Issue description
`prune_minimum_release_age_excludes()` eagerly loads and scans the wanted lockfile before knowing whether there are any `minimumReleaseAgeExclude` entries to prune, so the work is wasted when the field is absent/empty.

### Issue Context
- `Config` already carries `minimum_release_age_exclude: Option<Vec<String>>`.
- The writer-side prune is a no-op when `manifest.minimum_release_age_exclude` is `None`.

### Fix Focus Areas
- pnpm/crates/package-manager/src/catalog_cleanup.rs[135-164]
- pnpm/crates/config/src/lib.rs[1749-1763]

### Suggested fix
Add an early return before `Lockfile::load_wanted_from_dir(...)`, e.g.:
- `if config.minimum_release_age_exclude.as_ref().is_none_or(|v| v.is_empty()) { return Ok(()); }`

If `Config::minimum_release_age_exclude` can be populated from sources other than `pnpm-workspace.yaml` in your architecture and you only want to prune when the workspace manifest actually has the field, alternatively (or additionally) do a cheap read of `pnpm-workspace.yaml` to check for the presence of the block before loading the lockfile.

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



Informational

3. Missing trailing comma in params 📘 Rule violation ⚙ Maintainability
Description
New multi-line TypeScript parameter lists omit a trailing comma, violating the repository’s required
formatting and causing noisier diffs on future edits. This should be fixed to match the project’s
trailing-comma style rules.
Code

pnpm11/installing/commands/src/resolvedPackageVersionsForPrune.ts[R16-19]

+export function resolvedPackageVersionsForPrune (
+  opts: MinimumReleaseAgeExcludePruneOptions,
+  newLockfile: LockfileObject | undefined
+): Map<string, Set<string>> | undefined {
Relevance

● Weak

Multiple closely-matching trailing-comma suggestions in multi-line TS signatures were explicitly
rejected by reviewers/bots.

PR-#13792
PR-#13600
PR-#13477

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713434 requires trailing commas in multi-line TypeScript constructs. The added
multi-line function signatures shown in the cited regions end the last parameter line without a
trailing comma.

Rule 713434: Require trailing commas in TypeScript collections and multi-line constructs
pnpm11/installing/commands/src/resolvedPackageVersionsForPrune.ts[16-19]
pnpm11/workspace/workspace-manifest-writer/src/index.ts[277-280]

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 were added without a trailing comma on the last parameter.

## Issue Context
The repo requires trailing commas in multi-line TypeScript constructs to keep diffs stable and consistent.

## Fix Focus Areas
- pnpm11/installing/commands/src/resolvedPackageVersionsForPrune.ts[16-19]
- pnpm11/workspace/workspace-manifest-writer/src/index.ts[277-280]

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


4. Avoidable entries array allocation 🐞 Bug ➹ Performance
Description
resolvedPackageVersionsFromLockfile() iterates via Object.entries(lockfile.packages ?? {}),
which allocates an array of all lockfile package entries before the loop. When
minimumReleaseAgeExcludePrune is enabled, this creates avoidable peak memory and traversal
overhead on install/add/update/remove flows that call updateWorkspaceManifest.
Code

pnpm11/lockfile/utils/src/resolvedPackageVersions.ts[R10-13]

+export function resolvedPackageVersionsFromLockfile (lockfile: LockfileObject): Map<string, Set<string>> {
+  const resolvedVersions = new Map<string, Set<string>>()
+  for (const [depPath, snapshot] of Object.entries(lockfile.packages ?? {})) {
+    const { name, version, nonSemverVersion } = nameVerFromPkgSnapshot(depPath, snapshot)
Relevance

● Weak

Similar micro-optimization to avoid allocations/recomputation in lockfile/utils hot paths was
previously rejected as premature.

PR-#13591

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new TS helper allocates an entries array for the full packages object, and it is invoked on
the manifest persistence path when pruning is enabled and a new lockfile exists.

pnpm11/lockfile/utils/src/resolvedPackageVersions.ts[10-22]
pnpm11/installing/commands/src/installDeps.ts[422-437]

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

### Issue description
`resolvedPackageVersionsFromLockfile()` uses `Object.entries(lockfile.packages ?? {})`, which materializes a full entries array and increases peak memory on large lockfiles.

### Issue Context
This code is reached when `minimumReleaseAgeExcludePrune` is enabled and a fresh `newLockfile` exists; the map is then forwarded into `updateWorkspaceManifest()`.

### Fix Focus Areas
- pnpm11/lockfile/utils/src/resolvedPackageVersions.ts[10-22]

### Suggested fix
Replace `for (const [depPath, snapshot] of Object.entries(...))` with a non-allocating iteration:
- `const packages = lockfile.packages; if (!packages) return new Map()`
- `for (const depPath in packages) { if (!Object.hasOwn(packages, depPath)) continue; const snapshot = packages[depPath]; ... }`
This avoids building an intermediate array proportional to the package count.

ⓘ 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 group findings by type and pick your Finding display, from Minimal to Full

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.

@zkochan
zkochan merged commit 1c42ae2 into pnpm:main Aug 11, 2026
36 checks passed
@btea
btea deleted the feat/add-cleanupOutdatedMinimumReleaseAgeExcludes-config branch August 11, 2026 08:03
@tats-u

tats-u commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Ah, this PR only removes entries that package versions corresponding to are no longer included in the project(s). Sorry for having bothered you.

@btea

btea commented Aug 15, 2026

Copy link
Copy Markdown
Member Author

@zkochan Should we also include these two configurations in version 10?

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.

5 participants