Skip to content

feat(overrides): add convergence overrides ("pkg@": exact version) - #12876

Merged
zkochan merged 5 commits into
mainfrom
override
Jul 13, 2026
Merged

zkochan merged 5 commits into
mainfrom
override

Conversation

@zkochan

@zkochan zkochan commented Jul 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Implements the convergence override selector proposed in #12794, in both stacks (Related to #12794 — the lifecycle follow-ups below remain open).

A new override selector form with an empty range — "pkg@": "<exact version>" — applies the override to a dependency edge pkg@R iff the version satisfies R: compatible consumers converge on the version, incompatible consumers keep their own resolution, and dependents added later are governed automatically. This is semver-safe by construction (unlike a bare override) and future-proof (unlike range-scoped overrides, which silently stop covering new compatible ranges).

What lands here:

  • Parsing — "pkg@" selectors are recognized as convergence overrides; the value must be an exact version, and empty ranges in parent>child selectors are rejected (both ERR_PNPM_INVALID_CONVERGENCE_OVERRIDE). An empty range previously slipped through undocumented and behaved like a bare override.
  • Resolution semantics — the versions overrider rewrites an edge only when the value satisfies the declared range (loose semver, matching the npm picker); explicit "pkg"/"pkg@range" overrides win over "pkg@"; workspace:, catalog:, npm:, git/URL, and dist-tag specifiers are skipped.
  • Staleness detection (lifecycle rule 3 of the issue) ships with the syntax, since a stale entry can cause exactly the duplication it exists to prevent: after a full resolution (the only time the collected declared-range set is complete), each entry checks whether a newer version satisfies every declared range, and warns with the concrete replacement value. Failed range resolutions can only suppress the warning, never fabricate one; the release-age policy applies to the recommendation.

Deferred follow-ups from the issue's lifecycle plan (called out per the sync rule): pnpm update / pnpm dedupe refreshing and pruning managed entries (rules 1–2), and pnpm outdated listing stale entries (rule 4). Documentation for pnpm.io also still needs a PR.

Verified end-to-end with the bundled CLI against the live registry: converge applied below latest, stale warning with exact recommendation, fresh value silent, incompatible edge untouched. Test suites run: parse-overrides (15), read-package-hook (37), deps-installer new + overrides/dedupe/peer regression suites, peers-checker, deps-status; pacquet: config-parse-overrides (17), package-manager (694), targeted CLI integration suites (68) incl. byte-exact warning assertions; clippy/dylint/fmt/doc clean.

Squash Commit Body

Implements the empty-range override selector from pnpm/pnpm#12794 in both
stacks. "form-data@": "4.0.6" rewrites a dependency edge to exactly 4.0.6
iff 4.0.6 satisfies the edge's declared range, so compatible consumers
converge while incompatible ones keep their own resolution — semver-safe
by construction, unlike a bare override, and future-proof against new
compatible dependents, unlike a range-scoped one.

Design decisions:

- The value must be an exact version (ERR_PNPM_INVALID_CONVERGENCE_OVERRIDE
  otherwise): a range value would make "satisfies" ill-defined (issue open
  question 4).
- Empty ranges are rejected inside parent>child selectors, reserving that
  design space until precedence there is settled (open question 5, first
  half); when "pkg" or "pkg@range" and "pkg@" both match an edge, the
  explicit override wins.
- Satisfies checks use loose semver, matching the npm picker; workspace:,
  catalog:, npm:, git/URL, and dist-tag specifiers are skipped ("satisfies"
  is only defined against a semver range — open question 3).
- Staleness detection (lifecycle rule 3) ships with the syntax: after a
  full resolution — the only time the versions overrider has seen every
  manifest, so the collected declared-range set is complete — each
  convergence entry resolves every declared range against the cached
  registry metadata (release-age policy applied), and if a version newer
  than the value satisfies every declared range, install warns with that
  concrete replacement value. Partial resolutions stay silent to avoid
  false positives from unseen ranges; failed range resolutions can only
  suppress the warning, never fabricate one.
- An empty range previously slipped through parsing and behaved like a bare
  override; that undocumented accident is replaced by validation and the
  converge semantics.

pacquet mirrors the TS behavior byte-for-byte: same error code and
messages, same warning text on the pnpm:global warn channel, same
precedence and skip rules, with matching test coverage.

Deferred follow-ups from the issue's lifecycle plan: pnpm update / pnpm
dedupe refreshing and pruning managed entries (rules 1-2) and pnpm
outdated listing stale entries (rule 4).

Related to pnpm/pnpm#12794.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pacquet/ 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. (pnpm.io docs PR still needed — noted in Summary.)

Written by an agent (Claude Code, claude-fable-5) on behalf of zkochan.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added convergence override support for selectors like pkg@ to coordinate compatible dependency resolutions.
    • Convergence overrides validate exact versions and support catalog-sourced values.
    • Installs now emit warnings when convergence overrides become stale based on declared ranges.
  • Bug Fixes
    • Invalid parent>child selectors can’t use empty ranges.
    • Convergence override values must be exact versions; otherwise they’re rejected.
  • Tests
    • Expanded unit, installer, and CLI end-to-end coverage for convergence rewrites and stale-warning behavior.

Copilot AI review requested due to automatic review settings July 9, 2026 15:15

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 Jul 9, 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

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: b05f1952-fd7b-456e-97a5-e46ba89b0538

📥 Commits

Reviewing files that changed from the base of the PR and between e27e392 and fdd1818.

📒 Files selected for processing (1)
  • pnpm/crates/package-manager/src/warn_on_stale_convergence_overrides.rs

📝 Walkthrough

Walkthrough

Adds pkg@ convergence overrides with exact-version validation, semver-compatible dependency rewriting, declared-range tracking, stale override warnings, installation wiring, documentation, and TypeScript/Rust tests.

Changes

Convergence override support

Layer / File(s) Summary
Parse and validate convergence selectors
pnpm11/config/parse-overrides/...
Recognizes empty-range selectors, resolves catalog versions, requires exact semver values, rejects invalid parent/child selectors, and tests parser behavior.
Apply convergence overrides to dependency edges
pnpm11/hooks/read-package-hook/...
Tracks convergence targets and declared ranges, rewrites compatible dependency and peer edges, preserves explicit override precedence, and validates the overrider.
Wire convergence tracking into installation
pnpm11/installing/deps-installer/...
Adds convergence range state to processed install options and passes it through the read-package hook.
Detect and emit stale convergence warnings
pnpm11/installing/deps-installer/..., pnpm/crates/package-manager/...
Resolves declared ranges, selects newer satisfying versions, emits stale override warnings, and tests warning behavior.
Document and verify end-to-end behavior
.changeset/..., pnpm/crates/cli/tests/...
Documents empty-range convergence semantics and tests stale, current, and incompatible override outcomes in the CLI.

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

Possibly related issues

  • pnpm/pnpm#12794 — Covers the pkg@ syntax, compatible rewriting, stale warnings, and related tests implemented here.

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

Suggested reviewers: qodo-code-review

✨ 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 override

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

Add convergence override selector ("pkg@": exact version)

✨ Enhancement 🧪 Tests ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Recognize "pkg@" override selectors and require exact-version values.
• Apply converge semantics only when the pinned version satisfies declared ranges.
• Warn on stale convergence overrides after full resolution with a suggested upgrade.
Diagram

graph TD
  A["pnpm-workspace.yaml overrides"] --> B["Parse overrides"] --> C["Versions overrider hook"] --> D["Dependency resolution"] --> E["Collect declared ranges"] --> F{"Full resolution?"} --> G["Stale convergence check"] --> H["Global warn"]

  D --> F
  E --> F

  subgraph Legend
    direction LR
    _cfg["Config"] ~~~ _proc["Process"] ~~~ _dec{"Decision"}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Lockfile-based staleness metadata
  • ➕ Avoids post-resolution registry/range queries during install
  • ➕ Can make staleness checks deterministic/offline once lockfile is present
  • ➖ Requires defining and maintaining new lockfile schema/state
  • ➖ Harder to keep consistent with resolution policies (release-age, policy violations) without duplicating resolver logic
2. Intersection-first staleness computation
  • ➕ Potentially fewer resolver calls by computing an intersection/convergence range first
  • ➕ Can simplify candidate search if intersection is representable
  • ➖ Semver range intersection/normalization is non-trivial (especially with unions)
  • ➖ Still needs resolver/policy integration to match actual picked versions; can diverge subtly

Recommendation: Current approach is appropriate: it keeps convergence semantics semver-safe, matches the resolver’s real selection (loose semver + policy constraints), and gates staleness warnings to full resolutions to avoid false positives. The main alternatives either add lockfile schema complexity or risk semantic divergence from the picker.

Files changed (26) +1423 / -32

Enhancement (11) +608 / -30
lib.rsParse and validate convergence override selectors in pacquet +70/-0

Parse and validate convergence override selectors in pacquet

• Extends VersionOverride with a converge flag and validates that "pkg@" selectors have exact-version values. Rejects empty ranges in parent>child selectors using ERR_PNPM_INVALID_CONVERGENCE_OVERRIDE.

pacquet/crates/config-parse-overrides/src/lib.rs

install_with_fresh_lockfile.rsGate and run stale convergence checks on full pacquet resolutions +60/-14

Gate and run stale convergence checks on full pacquet resolutions

• Introduces a full-resolution detector based on lockfile reuse seed and update reuse scope, then runs stale convergence override detection only when the manifest walk is complete. Uses resolver cache/policies to compute recommended replacements and emits warnings before dropping resolver caches.

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

lib.rsWire stale convergence warning module into pacquet package-manager +1/-0

Wire stale convergence warning module into pacquet package-manager

• Registers the warn_on_stale_convergence_overrides module so it can be invoked after resolution.

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

overrides.rsImplement convergence override semantics in pacquet versions overrider +155/-6

Implement convergence override semantics in pacquet versions overrider

• Adds a convergence override bucket keyed by package name, applies it only when the pinned version satisfies the declared semver range, and records declared ranges for later staleness checks. Explicit (scoped/unscoped) overrides retain precedence, and non-semver specs are skipped.

pacquet/crates/package-manager/src/overrides.rs

warn_on_stale_convergence_overrides.rsAdd staleness detection and warning emission for convergence overrides (pacquet) +136/-0

Add staleness detection and warning emission for convergence overrides (pacquet)

• Implements stale detection by resolving the best admitted version for each collected range and picking the newest candidate satisfying every range. Emits pnpm:global-style warnings with the shared wording and recommended replacement version.

pacquet/crates/package-manager/src/warn_on_stale_convergence_overrides.rs

index.tsParse and validate "pkg@" convergence overrides in pnpm TS stack +24/-1

Parse and validate "pkg@" convergence overrides in pnpm TS stack

• Marks empty-range selectors as convergence overrides, rejects empty ranges in parent>child selectors, and enforces exact-version values with INVALID_CONVERGENCE_OVERRIDE errors. Runs validation after catalog resolution so resolved values are checked.

pnpm11/config/parse-overrides/src/index.ts

createReadPackageHook.tsPlumb convergeDeclaredRanges into versions overrider hook +4/-2

Plumb convergeDeclaredRanges into versions overrider hook

• Extends createReadPackageHook to accept an optional convergeDeclaredRanges map and passes it into createVersionsOverrider when overrides are enabled.

pnpm11/hooks/read-package-hook/src/createReadPackageHook.ts

createVersionsOverrider.tsApply convergence overrides during manifest rewriting and collect ranges +65/-7

Apply convergence overrides during manifest rewriting and collect ranges

• Partitions overrides into explicit vs convergence entries, applies convergence only when the pinned version satisfies the declared semver range, and records ranges for staleness checks. Skips non-semver-range specifiers and preserves explicit override precedence.

pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts

extendInstallOptions.tsAllocate convergeDeclaredRanges when convergence overrides are present +10/-0

Allocate convergeDeclaredRanges when convergence overrides are present

• Extends processed install options with convergeDeclaredRanges and initializes it when parsed overrides include convergence entries, then wires it into the read-package hook creation.

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

index.tsRun stale convergence warning after full resolution in pnpm installer +15/-0

Run stale convergence warning after full resolution in pnpm installer

• Invokes warnOnStaleConvergenceOverrides only when convergeDeclaredRanges is present and the install does a full resolution (forceFullResolution or dedupe). Avoids warnings on partial resolutions to prevent false positives.

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

warnOnStaleConvergenceOverrides.tsImplement stale convergence override detection and warning (pnpm TS) +68/-0

Implement stale convergence override detection and warning (pnpm TS)

• Resolves each collected declared range using requestPackage (skipFetch, policy-aware) to find best admitted versions and warns when a newer version satisfies all ranges. Emits globalWarn messages matching shared wording.

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

Tests (9) +782 / -0
convergence_overrides.rsAdd pacquet CLI e2e tests for convergence overrides +116/-0

Add pacquet CLI e2e tests for convergence overrides

• Introduces end-to-end install tests validating converge application, silence when fresh, and no-op on incompatible edges. Asserts the exact stale-warning wording emitted on stdout.

pacquet/crates/cli/tests/convergence_overrides.rs

tests.rsAdd unit tests for convergence override parsing/validation (pacquet) +54/-0

Add unit tests for convergence override parsing/validation (pacquet)

• Covers parsing "pkg@" and scoped forms, catalog value resolution, invalid non-exact values, and parent>child empty-range rejection. Asserts error messages match the shared wording.

pacquet/crates/config-parse-overrides/src/tests.rs

tests.rsEnsure overrides serialize/round-trip including convergence selectors +29/-0

Ensure overrides serialize/round-trip including convergence selectors

• Adds a lockfile serialization round-trip test to ensure override keys like "form-data@" persist verbatim in YAML and reparse correctly.

pacquet/crates/package-manager/src/dependencies_graph_to_lockfile/tests.rs

tests.rsAdd pacquet unit tests for convergence override behavior +133/-0

Add pacquet unit tests for convergence override behavior

• Tests satisfy-only rewriting, skipping non-range specifiers, empty declared spec as match-all, peer dependency rewriting, explicit-override precedence, declared-range collection, and apply_to_arc collection behavior when no cloning occurs.

pacquet/crates/package-manager/src/overrides/tests.rs

tests.rsTest stale convergence detection logic and warning text (pacquet) +110/-0

Test stale convergence detection logic and warning text (pacquet)

• Adds async tests for best-candidate selection, suppression cases (no all-satisfying candidate, not newer, unresolved ranges), and exact warning message formatting.

pacquet/crates/package-manager/src/warn_on_stale_convergence_overrides/tests.rs

index.tsAdd parse-overrides tests for convergence selectors and failures +43/-0

Add parse-overrides tests for convergence selectors and failures

• Adds tests for parsing convergence selectors (including scoped), catalog value resolution, invalid non-exact values, and parent>child empty-range rejection.

pnpm11/config/parse-overrides/test/index.ts

createVersionOverrider.test.tsAdd read-package-hook tests for convergence rewriting and collection +139/-0

Add read-package-hook tests for convergence rewriting and collection

• Adds coverage for satisfy-only rewriting, skipping non-range specifiers, peer dependency behavior, precedence vs explicit overrides, and declared-range collection into the provided map.

pnpm11/hooks/read-package-hook/test/createVersionOverrider.test.ts

convergenceOverrides.tsAdd integration tests for convergence overrides and stale warnings (pnpm) +60/-0

Add integration tests for convergence overrides and stale warnings (pnpm)

• Validates that converge rewrites only satisfying transitive edges, preserves incompatible direct resolutions, persists overrides in lockfile, and emits a stale warning with the recommended replacement version.

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

warnOnStaleConvergenceOverrides.test.tsUnit test stale warning computation with mocked requestPackage +98/-0

Unit test stale warning computation with mocked requestPackage

• Adds tests covering warn/no-warn scenarios, including exact-range caps and unresolved ranges. Uses a mocked globalWarn to assert emitted message contents.

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

Documentation (1) +15 / -0
olive-pandas-converge.mdPublish changeset for convergence overrides feature +15/-0

Publish changeset for convergence overrides feature

• Adds a minor changeset for affected packages and documents the new "pkg@": "<version>" convergence override behavior and stale-warning semantics.

.changeset/olive-pandas-converge.md

Other (5) +18 / -2
Cargo.tomlAdd node-semver dependency for convergence value validation +1/-0

Add node-semver dependency for convergence value validation

• Adds node-semver to support exact-version parsing/validation for convergence overrides in the Rust parsing stack.

pacquet/crates/config-parse-overrides/Cargo.toml

pnpm-lock.yamlUpdate lockfile for new semver/type deps and workspace references +9/-0

Update lockfile for new semver/type deps and workspace references

• Updates the workspace lockfile to include semver and @types/semver for parse-overrides, and adds config.version-policy linkage for deps-installer.

pnpm-lock.yaml

package.jsonAdd semver runtime + types for convergence override validation +4/-2

Add semver runtime + types for convergence override validation

• Adds semver as a dependency and @types/semver as a devDependency to support exact-version validation of convergence override values.

pnpm11/config/parse-overrides/package.json

package.jsonAdd version-policy dependency to support stale warning recommendations +1/-0

Add version-policy dependency to support stale warning recommendations

• Adds @pnpm/config.version-policy dependency so stale convergence warning logic can respect published-by/release-age policies.

pnpm11/installing/deps-installer/package.json

tsconfig.jsonAdd config/version-policy project reference +3/-0

Add config/version-policy project reference

• Adds a TypeScript project reference so deps-installer can import @pnpm/config.version-policy.

pnpm11/installing/deps-installer/tsconfig.json

@qodo-code-review

qodo-code-review Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (6) 📘 Rule violations (4) 📎 Requirement gaps (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 18 rules

Grey Divider


Action required

1. instanceof Error in test ✓ Resolved 📘 Rule violation ≡ Correctness
Description
The new Jest test uses version instanceof Error, which is discouraged because it can fail across
realms in Jest. This violates the required pattern of using util.types.isNativeError() for Error
checks in TypeScript tests.
Code

pnpm11/installing/deps-installer/test/install/warnOnStaleConvergenceOverrides.test.ts[R15-20]

+function fakeRequestPackage (versionByRange: Record<string, string | Error>): RequestPackageFunction {
+  return (async (wantedDependency: { alias?: string, bareSpecifier?: string }) => {
+    const version = versionByRange[wantedDependency.bareSpecifier!]
+    if (version == null) throw new Error(`Unexpected range ${wantedDependency.bareSpecifier!}`)
+    if (version instanceof Error) throw version
+    return {
Evidence
PR Compliance ID 713456 requires replacing instanceof Error with util.types.isNativeError() in
TypeScript Jest tests; the added helper fakeRequestPackage() uses instanceof Error to branch
behavior.

Rule 713456: Use util.types.isNativeError instead of instanceof Error in Jest TypeScript tests
pnpm11/installing/deps-installer/test/install/warnOnStaleConvergenceOverrides.test.ts[15-20]

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 test helper uses `instanceof Error` for error detection, which can be unreliable across realms in Jest.

## Issue Context
Compliance requires using `util.types.isNativeError(value)` instead of `value instanceof Error` in Jest TypeScript tests.

## Fix Focus Areas
- pnpm11/installing/deps-installer/test/install/warnOnStaleConvergenceOverrides.test.ts[1-26]

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



Remediation recommended

2. Unbounded stale-check fanout 🐞 Bug ➹ Performance ⭐ New
Description
find_stale_convergence_overrides() uses future::join_all to spawn one concurrent resolve_range
future per collected declared range. With many distinct ranges collected for a convergence-managed
package, this warning-only phase can still cause a large burst of concurrent resolver work and extra
memory use (all futures + results), slowing installs.
Code

pnpm/crates/package-manager/src/warn_on_stale_convergence_overrides.rs[R69-76]

+        let mut candidates: Vec<Version> = ranges
+            .iter()
+            .map(|range| resolve_range(name.clone(), range.clone()))
+            .pipe(future::join_all)
+            .await
+            .into_iter()
+            .flatten()
+            .collect();
Evidence
The stale-check resolves all ranges at once via join_all, so concurrency scales linearly with the
number of collected ranges. Range collection itself can accumulate many distinct range strings per
package without any cap, so a large workspace can amplify this fanout.

pnpm/crates/package-manager/src/warn_on_stale_convergence_overrides.rs[69-76]
pnpm/crates/package-manager/src/overrides.rs[430-442]

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

## Issue description
`find_stale_convergence_overrides()` currently resolves all collected declared ranges concurrently via `future::join_all`. If the range set is large, this can create a large number of in-flight futures at once and allocate a full results vector, which is unnecessary for a warning-only check.

## Issue Context
The set of declared ranges is populated from manifests and stored in a `HashSet<String>` per package, so its size can grow with workspace size and dependency variety.

## Fix Focus Areas
- pnpm/crates/package-manager/src/warn_on_stale_convergence_overrides.rs[69-76]

## Suggested fix approach
- Replace `join_all` with bounded concurrency (e.g. `futures_util::stream::iter(...).buffer_unordered(N)`), collecting results incrementally.
- Optionally add a soft cap (or early exit) on the number of ranges processed for this warning-only path, to prevent pathological cases from dominating install time.

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


3. Stale check skips policies 🐞 Bug ⛨ Security
Description
The stale-convergence warning path builds resolution/request options from defaults and/or fails to
forward trust-policy and other policy/guard settings, so policy enforcement (e.g.,
trust_policy/no-downgrade, package_version_guard, block_exotic_subdeps) is not applied and the
warning can recommend versions a real install would reject. This can mislead users into updating to
an inadmissible version that violates configured supply-chain security policy.
Code

pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[R1279-1286]

+            let stale_check_opts = ResolveOptions {
+                project_dir: lockfile_dir.to_path_buf(),
+                lockfile_dir: lockfile_dir.to_path_buf(),
+                default_tag: Some("latest".to_string()),
+                published_by,
+                published_by_exclude: published_by_exclude.clone(),
+                ..ResolveOptions::default()
+            };
Evidence
In the stale-check implementation, ResolveOptions are constructed from ResolveOptions::default()
and the check filters candidates primarily based on whether result.policy_violation.is_some(),
meaning it relies on the resolver being configured with the same policy knobs as the real install;
however, those trust/guard policy inputs are dropped even though ResolveOptions supports them.
Similarly on the pnpm11 side, warnOnStaleConvergenceOverrides() inspects
response.body.policyViolation but does not pass trustPolicy, trustPolicyExclude, or
trustPolicyIgnoreAfter into requestPackage(), despite RequestPackageOptions supporting these
fields and the main install path configuring/forwarding trust policy elsewhere—so the stale-check
can yield a policyViolation result that doesn’t reflect actual trust-policy enforcement and can
recommend versions that would be rejected during install.

pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[1269-1304]
pnpm/crates/resolving-resolver-base/src/resolve.rs[319-358]
pnpm/crates/package-manager/src/warn_on_stale_convergence_overrides.rs[95-111]
pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts[7-14]
pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts[39-56]
pnpm11/store/controller-types/src/index.ts[116-162]
pnpm11/store/controller-types/src/index.ts[191-197]
pnpm11/installing/deps-installer/src/install/index.ts[1611-1634]

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 stale-convergence override staleness check can recommend package versions that the real install would reject because it builds resolution/request options from defaults and/or does not forward policy-related settings (trust policy, package version guard, blocking exotic subdeps, etc.). As a result, policy enforcement does not apply to the stale-check, `policyViolation`/`policy_violation` can be inaccurate, and the warning may provide security-misleading guidance (e.g., even under `trustPolicy=no-downgrade`).

## Issue Context
- The staleness check filters candidates only when a policy violation is detected (e.g., `result.policy_violation.is_some()` / `response.body.policyViolation`), so it depends on the stale-check resolver/request being configured with the same policy options as the main install/resolution pipeline.
- The main resolution path does set/forward policy options on the options objects, but the new stale-check path constructs options from defaults or fails to pass `trustPolicy*` through to `requestPackage()`, dropping enforcement.

## Fix Focus Areas
- pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[1278-1286]
- pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts[7-14]
- pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts[39-55]
- pnpm11/installing/deps-installer/src/install/index.ts[1611-1633]

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


4. Stale warning omits pnpm up 📎 Requirement gap ≡ Correctness
Description
The new staleness warning message recommends manual editing and pnpm dedupe, but does not
recommend pnpm up <name> as required. This weakens the prescribed remediation guidance for stale
managed convergence overrides.
Code

pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts[66]

+    globalWarn(`The convergence override "${name}@": "${override.newBareSpecifier}" is stale: every declared range of ${name} also admits ${best}. Change the override's value to ${best} in pnpm-workspace.yaml, or remove the override and run "pnpm dedupe".`)
Evidence
PR Compliance ID 772205 requires the install-time warning to recommend pnpm up <name> and/or `pnpm
dedupe`; the newly added warning strings in both TS and Rust only mention editing the value and
pnpm dedupe.

"pnpm install" warns on detectably harmful stale managed "pkg@" overrides
pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts[61-67]
pnpm/crates/package-manager/src/warn_on_stale_convergence_overrides.rs[127-133]

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 stale convergence override warning text does not include the required remediation guidance to run `pnpm up <name>` (it only suggests changing the value manually or running `pnpm dedupe`).

## Issue Context
The compliance rule for stale managed `"pkg@"` overrides requires warning during install and recommending `pnpm up <name>` and/or `pnpm dedupe`. The warning text should also remain in sync between pnpm (TS) and pacquet (Rust).

## Fix Focus Areas
- pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts[61-67]
- pnpm/crates/package-manager/src/warn_on_stale_convergence_overrides.rs[127-133]
- pnpm/crates/cli/tests/convergence_overrides.rs[58-63]
- pnpm/crates/package-manager/src/warn_on_stale_convergence_overrides/tests.rs[97-110]

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


View more (8)
5. warnOnStaleConvergenceOverrides comment duplicated 📘 Rule violation ⚙ Maintainability
Description
The new call-site comment above warnOnStaleConvergenceOverrides() restates the same rationale
already documented in the function’s JSDoc. This duplicates documentation and increases the chance
the two diverge over time.
Code

pnpm11/installing/deps-installer/src/install/index.ts[R1621-1624]

+  // Only a full resolution walks every manifest through the versions
+  // overrider, making the collected declared ranges complete enough for the
+  // staleness verdict; partial resolutions must stay silent to avoid false
+  // positives from unseen ranges.
Evidence
PR Compliance ID 713431 forbids call-site comments that substantially restate a function’s existing
JSDoc. The added comment in install/index.ts repeats the full-resolution rationale already present
in warnOnStaleConvergenceOverrides’s JSDoc.

Rule 713431: Avoid duplicating JSDoc content in call-site comments
pnpm11/installing/deps-installer/src/install/index.ts[1621-1624]
pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts[16-35]

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 call-site comment duplicates the callee’s JSDoc, violating the guideline to avoid restating JSDoc content at call sites.

## Issue Context
`warnOnStaleConvergenceOverrides()` already documents why it must only run after a full resolution. The call site repeats the same reasoning; prefer removing it or replacing it with a short call-specific note (e.g., referencing the function’s docs rather than re-explaining them).

## Fix Focus Areas
- pnpm11/installing/deps-installer/src/install/index.ts[1621-1624]
- pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts[16-35]

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


6. Range collector can balloon 🐞 Bug ⛨ Security
Description
pacquet records every distinct declared range string for converge-governed packages into an
in-memory HashSet without any cap, and later clones and iterates that set during staleness checks.
In large workspaces (or adversarial inputs) this can inflate memory usage and make the warning-only
staleness phase noticeably expensive.
Code

pacquet/crates/package-manager/src/overrides.rs[R433-442]

+    fn try_record_converge_range(&self, dep_name: &str, dep_spec: &str) -> Option<Range> {
+        self.converge.get(dep_name)?;
+        let range = parse_declared_range(dep_spec)?;
+        self.converge_declared_ranges
+            .lock()
+            .unwrap_or_else(std::sync::PoisonError::into_inner)
+            .entry(dep_name.to_string())
+            .or_default()
+            .insert(dep_spec.to_string());
+        Some(range)
Evidence
The collector stores full range strings in a HashSet and has no limiting logic on inserts; the
snapshot method deep-clones the whole map; and the staleness check iterates over all recorded ranges
to resolve candidates and compute a best version, so both memory and runtime scale with the
collected set size.

pacquet/crates/package-manager/src/overrides.rs[31-49]
pacquet/crates/package-manager/src/overrides.rs[134-144]
pacquet/crates/package-manager/src/overrides.rs[430-443]
pacquet/crates/package-manager/src/warn_on_stale_convergence_overrides.rs[33-86]

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 convergence staleness feature collects declared ranges into `converge_declared_ranges: HashMap<String, HashSet<String>>` and retains all unique range strings. This scales with the number of unique range spellings encountered and is later cloned/iterated for staleness checks, creating an availability risk (memory/time) for large graphs.

### Issue Context
This data is only used for a warning, so it’s reasonable to trade completeness for bounded resource usage.

### Fix Focus Areas
- pacquet/crates/package-manager/src/overrides.rs[31-49]
- pacquet/crates/package-manager/src/overrides.rs[134-144]
- pacquet/crates/package-manager/src/overrides.rs[430-443]
- pacquet/crates/package-manager/src/warn_on_stale_convergence_overrides.rs[33-86]

### Implementation notes
- Add an upper bound (per package and/or global) on recorded ranges; once exceeded, mark the package as “overflowed” and either:
 - skip staleness checks for that package, or
 - sample/keep only the first N normalized ranges.
- Avoid cloning the entire `HashMap<String, HashSet<String>>` if possible (e.g., drain/take under lock at end of resolution, or provide an iterator-style snapshot that doesn’t deep-clone large sets).
- Consider storing a normalized/canonicalized range string (to reduce duplicates that differ only by whitespace) if normalization is available in `node_semver`.

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


7. Double-scan manifest hook 🐞 Bug ➹ Performance
Description
VersionsOverrider::apply_to_arc() scans dependency maps to decide whether to clone
(has_applicable_override()), then scans them again either to record convergence ranges
(record_converge_declared_ranges()) or to rewrite (apply_to_value()), adding avoidable overhead
on a hot path executed for every resolved manifest.
Code

pacquet/crates/package-manager/src/overrides.rs[R173-184]

+        if self.is_empty() {
+            return manifest;
+        }
+        if !self.has_applicable_override(&manifest) {
+            // Nothing rewrites, so the shared value is returned as-is —
+            // but the declared ranges of converge-governed edges must
+            // still reach the staleness collector (`apply_to_value`
+            // records them as a side effect of its walk, which is
+            // skipped here).
+            self.record_converge_declared_ranges(&manifest);
            return manifest;
        }
Evidence
apply_to_arc() always performs a pre-scan and then performs another full walk: on the no-rewrite
path it calls record_converge_declared_ranges(), and on the rewrite path it clones and calls
apply_to_value(). Both helper paths iterate dependency groups and consult overrides/convergence
logic, duplicating work per manifest.

pacquet/crates/package-manager/src/overrides.rs[168-188]
pacquet/crates/package-manager/src/overrides.rs[209-237]
pacquet/crates/package-manager/src/overrides.rs[239-264]

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

### Issue description
`VersionsOverrider::apply_to_arc()` currently performs an initial full scan to decide whether it needs to clone the manifest, and then performs a second full scan (either to record declared ranges for convergence overrides or to apply rewrites). This adds extra work for every manifest during resolution when overrides are enabled.

### Issue Context
The pre-scan is useful to avoid cloning shared `Arc<Value>` manifests when nothing changes, but the declared-range collector is also required for convergence overrides.

### Fix Focus Areas
- pacquet/crates/package-manager/src/overrides.rs[168-207]
- pacquet/crates/package-manager/src/overrides.rs[209-265]

### Implementation notes
- Combine `has_applicable_override()` and `record_converge_declared_ranges()` into a single pass for the no-clone path (e.g., add a `collect_converge_ranges` mode to the scan).
- Ensure the “explicit override claims edge” exclusion stays identical to the rewrite walk.
- Avoid parsing the same declared range twice in the scan when possible.

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


8. convergeDep() has too many params 📘 Rule violation ⚙ Maintainability
Description
convergeDep is introduced with 4 positional parameters, exceeding the 3-parameter limit and
increasing call-site complexity. Refactor it to accept a single options object (e.g., `{
convergeOpts, deps, peerDeps, name, bareSpecifier }`).
Code

pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[R165-170]

+function convergeDep (
+  { convergeVersions, convergeDeclaredRanges }: ConvergeOptions,
+  { deps, peerDeps }: { deps: Dependencies, peerDeps: Dependencies | undefined },
+  name: string,
+  bareSpecifier: string
+): void {
Evidence
Compliance ID 713433 limits new/modified TypeScript function signatures to 3 parameters unless using
an options object. convergeDep is defined with four parameters and is called with four positional
arguments.

Rule 713433: Limit TypeScript functions to three parameters or fewer
pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[165-170]
pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[133-136]

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

## Issue description
`convergeDep` takes 4 positional parameters, violating the 3-parameter maximum.

## Issue Context
The compliance checklist requires TypeScript functions to take at most three parameters; additional data should be passed via an options/config object.

## Fix Focus Areas
- pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[165-170]
- pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[133-136]

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


9. Unbounded staleness concurrency 🐞 Bug ⛨ Security
Description
warnOnStaleConvergenceOverrides() fans out nested Promise.all across every convergence override
and every collected declared range, which can create thousands of concurrent requestPackage calls
and spike memory/CPU during install. Because the ranges are collected from all manifests, an
attacker-controlled repo (or just a large workspace) can turn a warning-only feature into a
noticeable install slowdown or failure (availability risk).
Code

pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts[R40-60]

+  await Promise.all(convergeOverrides.map(async (override) => {
+    const name = override.targetPkg.name
+    const ranges = opts.convergeDeclaredRanges.get(name)
+    if (ranges == null || ranges.size === 0) return
+    const candidates = await Promise.all([...ranges].map(async (range) => {
+      try {
+        const response = await opts.requestPackage({ alias: name, bareSpecifier: range }, {
+          downloadPriority: 0,
+          lockfileDir: opts.lockfileDir,
+          projectDir: opts.lockfileDir,
+          preferredVersions: {},
+          skipFetch: true,
+          publishedBy,
+          publishedByExclude,
+        })
+        if (response.body.policyViolation != null) return undefined
+        return response.body.manifest?.version
+      } catch {
+        return undefined
+      }
+    }))
Evidence
The staleness check uses nested Promise.all (per override and per range), and each range issues a
requestPackage call; the range set is accumulated from dependency edges across manifests, so the
fan-out scales with workspace size. The install pipeline calls this after resolution on
full-resolution paths, meaning the concurrency spike is on a hot install flow.

pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts[36-67]
pnpm11/installing/deps-installer/src/install/index.ts[1621-1634]
pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[165-187]

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

### Issue description
`warnOnStaleConvergenceOverrides()` performs nested `Promise.all()` over (convergence overrides) × (declared ranges), creating unbounded concurrency. On large workspaces (or attacker-controlled repos), this can cause excessive simultaneous `requestPackage()` calls, increasing memory pressure and event-loop contention during `pnpm install`.

### Issue Context
This code runs in the install path after a full resolution, and the collected range sets can be large because they are populated while reading many manifests.

### Fix Focus Areas
- Add bounded concurrency (e.g. `p-limit`) so total in-flight `requestPackage` calls are capped (align with existing install/requester concurrency defaults where possible).
- Consider applying the limit at the innermost `requestPackage` call site (ranges), not only per override.
- Keep behavior identical (failures suppress warning; no new warnings fabricated).

### Fix Focus Areas (code pointers)
- pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts[36-67]
- pnpm11/installing/deps-installer/src/install/index.ts[1621-1634]
- pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[165-187]

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


10. Serial stale-range resolves 🐞 Bug ➹ Performance
Description
pacquet’s find_stale_convergence_overrides() resolves each declared range sequentially (await
inside a for loop), adding avoidable latency when many ranges were collected for a convergence
override. This runs in the full-resolution install path, so large range sets can slow installs even
though this is only a warning check.
Code

pacquet/crates/package-manager/src/warn_on_stale_convergence_overrides.rs[R67-72]

+        let mut candidates = Vec::new();
+        for range in ranges {
+            if let Some(version) = resolve_range(name.clone(), range.clone()).await {
+                candidates.push(version);
+            }
+        }
Evidence
The new staleness check collects candidates by awaiting resolve_range inside a for loop, which
is inherently serial. The codebase already demonstrates a standard pattern for parallelizing many
independent async operations (FuturesUnordered), suggesting a safe, consistent approach to reduce
latency here.

pacquet/crates/package-manager/src/warn_on_stale_convergence_overrides.rs[67-77]
pacquet/crates/package-manager/src/check_custom_resolver_force_resolve.rs[46-63]

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

### Issue description
`find_stale_convergence_overrides()` currently awaits `resolve_range()` in a loop, forcing sequential per-range resolution. If a convergence override has many collected declared ranges, this can add noticeable latency to full-resolution installs.

### Issue Context
The repository already uses `FuturesUnordered` in other places to parallelize independent async checks. Here, parallelization can be bounded to avoid overwhelming the resolver while still reducing end-to-end latency.

### Fix Focus Areas
- Replace the sequential loop with bounded parallel execution (e.g. `stream::iter(ranges).map(...).buffer_unordered(N)` or `FuturesUnordered` with an explicit concurrency cap).
- Preserve semantics: failures still yield no candidate and cannot fabricate warnings.
- Keep ordering-independent behavior (candidates are sorted after collection anyway).

### Fix Focus Areas (code pointers)
- pacquet/crates/package-manager/src/warn_on_stale_convergence_overrides.rs[67-78]
- pacquet/crates/package-manager/src/check_custom_resolver_force_resolve.rs[46-63]

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


11. Missing trailing commas in params 📘 Rule violation ⚙ Maintainability
Description
Several multi-line TypeScript parameter lists omit the required trailing comma after the last
parameter, creating inconsistent formatting and noisier diffs. Add trailing commas in these
multi-line signatures.
Code

pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[R25-29]

export function createVersionsOverrider (
  overrides: VersionOverrideWithoutRawSelector[],
-  rootDir: string
+  rootDir: string,
+  opts?: CreateVersionsOverriderOptions
): ReadPackageHook {
Evidence
Compliance ID 713434 requires trailing commas in multi-line TypeScript constructs. The updated/added
function signatures are split across multiple lines but do not include a trailing comma after the
final parameter.

Rule 713434: Require trailing commas in TypeScript collections and multi-line constructs
pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[25-29]
pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[85-90]
pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[109-118]
pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[165-170]

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 are missing a trailing comma on the last parameter.

## Issue Context
The compliance checklist requires trailing commas in multi-line TypeScript constructs, including function parameter lists.

## Fix Focus Areas
- pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[25-29]
- pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[85-90]
- pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[109-118]
- pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[165-170]

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


12. overrideDepsOfPkg() has too many params 📘 Rule violation ⚙ Maintainability
Description
overrideDepsOfPkg now takes 4 positional parameters, exceeding the 3-parameter limit and making
call sites harder to read and evolve. Refactor it to take a single options object (or fold
convergeOpts into the existing first object parameter).
Code

pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[R85-90]

function overrideDepsOfPkg (
  { manifest, dir }: { manifest: PackageManifest, dir: string | undefined },
  versionOverrides: VersionOverrideWithParent[],
-  genericVersionOverrides: VersionOverride[]
+  genericVersionOverrides: VersionOverride[],
+  convergeOpts: ConvergeOptions
): void {
Evidence
Compliance ID 713433 requires new/modified TypeScript functions to have at most three parameters (or
use a single options object). overrideDepsOfPkg is defined with four parameters (`{ manifest, dir
}, versionOverrides, genericVersionOverrides, convergeOpts`).

Rule 713433: Limit TypeScript functions to three parameters or fewer
pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[85-90]

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

## Issue description
`overrideDepsOfPkg` has 4 positional parameters, violating the 3-parameter maximum.

## Issue Context
The compliance checklist requires TypeScript functions to take at most three parameters; additional data should be passed via an options/config object.

## Fix Focus Areas
- pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts[85-92]

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


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

PR Code Suggestions ✨

Latest suggestions up to fdd1818

Warning

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

CategorySuggestion                                                                                                                                    Impact
Possible issue
Validate resolved candidate versions

Filter out invalid semver versions before applying semver.gt or other semver
operations.

pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts [61-64]

 const best = candidates
-  .filter((version): version is string => version != null && semver.gt(version, override.newBareSpecifier))
+  .filter((version): version is string => version != null && semver.valid(version) != null)
+  .filter((version) => semver.gt(version, override.newBareSpecifier))
   .sort(semver.rcompare)
   .find((version) => [...ranges].every((range) => semver.satisfies(version, range, true)))
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: Guarding against invalid versions prevents unexpected crashes during the warning check, ensuring the installation completes successfully even with malformed registry data.

Medium
  • More

Previous suggestions

Suggestions
CategorySuggestion                                                                                                                                    Impact
Possible issue
Validate semver before comparison

Validate semver inputs before comparison to prevent errors from invalid registry
data.

pnpm11/installing/deps-installer/src/install/index.ts [61-64]

+const parsedRanges = [...ranges].filter((range) => semver.validRange(range, true) != null)
+if (parsedRanges.length !== ranges.size) return
+
 const best = candidates
-  .filter((version): version is string => version != null && semver.gt(version, override.newBareSpecifier))
+  .filter((version): version is string =>
+    version != null &&
+    semver.valid(version) != null &&
+    semver.gt(version, override.newBareSpecifier)
+  )
   .sort(semver.rcompare)
-  .find((version) => [...ranges].every((range) => semver.satisfies(version, range, true)))
+  .find((version) => parsedRanges.every((range) => semver.satisfies(version, range, true)))
Suggestion importance[1-10]: 5

__

Why: Adding defensive semver validation prevents potential runtime crashes from malformed registry versions, though the collected ranges are already pre-validated.

Low

@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 (3)
pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts (2)

61-64: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Consider hoisting the [...ranges] spread out of the find callback.

The spread [...ranges] is re-evaluated for every candidate version inside find. Hoisting it to a local const before the chain avoids repeated Set→Array conversions.

♻️ Suggested refactor
+    const allRanges = [...ranges]
     const best = candidates
       .filter((version): version is string => version != null && semver.gt(version, override.newBareSpecifier))
       .sort(semver.rcompare)
-      .find((version) => [...ranges].every((range) => semver.satisfies(version, range, true)))
+      .find((version) => allRanges.every((range) => semver.satisfies(version, range, true)))
🤖 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/warnOnStaleConvergenceOverrides.ts`
around lines 61 - 64, The `best` lookup in `warnOnStaleConvergenceOverrides`
repeatedly converts `ranges` from a Set to an array inside the `find` callback.
Hoist the `[...ranges]` conversion into a local constant before the
`candidates.filter(...).sort(...).find(...)` chain, then have the `find`
predicate reuse that array when checking `semver.satisfies` so the conversion
happens once instead of for every candidate.

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

Log errors in the catch block instead of silently swallowing them.

The bare catch { return undefined } swallows all errors with no trace. While the doc comment explains the design intent (failures suppress the warning, never fabricate one), the coding guideline states "never swallow errors." A persistent issue (e.g., misconfigured registry, auth failure) would make the staleness check silently inoperative with no way to diagnose it. Adding a debug-level log preserves the design intent while enabling troubleshooting.

As per coding guidelines: "Catch only specific expected errors, never swallow errors, and include context such as offending paths in error messages."

♻️ Suggested fix: add debug logging
     if (response.body.policyViolation != null) return undefined
     return response.body.manifest?.version
-      } catch {
+      } catch (err) {
+        logger.debug({
+          message: `Stale convergence override check: failed to resolve range "${range}" for "${name}"`,
+          prefix: opts.lockfileDir,
+        })
     return undefined
   }

You'll need to import a debug-capable logger from @pnpm/logger (e.g., globalInfo or a scoped logger) alongside the existing globalWarn import.

🤖 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/warnOnStaleConvergenceOverrides.ts`
around lines 57 - 59, The bare catch in warnOnStaleConvergenceOverrides is
swallowing unexpected failures, so update that catch block to log the error at
debug level before returning undefined. Use the existing function name to locate
the block, add a debug-capable logger import from `@pnpm/logger` alongside
globalWarn, and include enough context in the message to identify the
stale-convergence check while still preserving the current behavior of
suppressing the warning.

Source: Coding guidelines

pacquet/crates/package-manager/src/warn_on_stale_convergence_overrides.rs (1)

41-87: 🚀 Performance & Scalability | 🔵 Trivial

Range resolutions run fully sequentially — parallelize per REVIEW_GUIDE performance priority and pnpm parity.

Each declared range is resolved with a sequential for range in ranges { ... .await } inside a sequential for override_entry in ... loop. pnpm's TS counterpart resolves every declared range concurrently via Promise.all. On a workspace with several convergence overrides and many declared ranges, this compounds into fully serial network round-trips, adding avoidable latency to the gated (full-resolution) staleness check.

♻️ Suggested concurrent resolution
-        let mut candidates = Vec::new();
-        for range in ranges {
-            if let Some(version) = resolve_range(name.clone(), range.clone()).await {
-                candidates.push(version);
-            }
-        }
+        let candidates: Vec<Version> = futures::future::join_all(
+            ranges.iter().map(|range| resolve_range(name.clone(), range.clone())),
+        )
+        .await
+        .into_iter()
+        .flatten()
+        .collect();

As per path instructions, "Performance second: stale-convergence detection is extra work—confirm it only runs on gated paths ... and doesn't add network/CPU work to the warm/common install path unnecessarily," and pnpm↔pacquet parity requires matching behavior; unnecessary serialization here works against both.
[medium_effort][high_reward]

🤖 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 `@pacquet/crates/package-manager/src/warn_on_stale_convergence_overrides.rs`
around lines 41 - 87, The staleness check in find_stale_convergence_overrides
resolves declared ranges one-by-one, which is fully sequential and slower than
pnpm parity. Update the resolution step inside this function to resolve all
ranges for a given override concurrently instead of awaiting each call in the
for range in ranges loop, then keep the existing filtering/sorting logic
unchanged. Use the existing resolve_range closure and the
parsed_ranges/candidates flow in find_stale_convergence_overrides to locate the
async block to parallelize.

Source: Path instructions

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

Nitpick comments:
In `@pacquet/crates/package-manager/src/warn_on_stale_convergence_overrides.rs`:
- Around line 41-87: The staleness check in find_stale_convergence_overrides
resolves declared ranges one-by-one, which is fully sequential and slower than
pnpm parity. Update the resolution step inside this function to resolve all
ranges for a given override concurrently instead of awaiting each call in the
for range in ranges loop, then keep the existing filtering/sorting logic
unchanged. Use the existing resolve_range closure and the
parsed_ranges/candidates flow in find_stale_convergence_overrides to locate the
async block to parallelize.

In
`@pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts`:
- Around line 61-64: The `best` lookup in `warnOnStaleConvergenceOverrides`
repeatedly converts `ranges` from a Set to an array inside the `find` callback.
Hoist the `[...ranges]` conversion into a local constant before the
`candidates.filter(...).sort(...).find(...)` chain, then have the `find`
predicate reuse that array when checking `semver.satisfies` so the conversion
happens once instead of for every candidate.
- Around line 57-59: The bare catch in warnOnStaleConvergenceOverrides is
swallowing unexpected failures, so update that catch block to log the error at
debug level before returning undefined. Use the existing function name to locate
the block, add a debug-capable logger import from `@pnpm/logger` alongside
globalWarn, and include enough context in the message to identify the
stale-convergence check while still preserving the current behavior of
suppressing the warning.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 24245b85-8ed9-4d56-90ee-91122527848c

📥 Commits

Reviewing files that changed from the base of the PR and between c70e33e and a0060fe.

⛔ 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 (25)
  • .changeset/olive-pandas-converge.md
  • pacquet/crates/cli/tests/convergence_overrides.rs
  • pacquet/crates/config-parse-overrides/Cargo.toml
  • pacquet/crates/config-parse-overrides/src/lib.rs
  • pacquet/crates/config-parse-overrides/src/tests.rs
  • pacquet/crates/package-manager/src/dependencies_graph_to_lockfile/tests.rs
  • pacquet/crates/package-manager/src/install_with_fresh_lockfile.rs
  • pacquet/crates/package-manager/src/lib.rs
  • pacquet/crates/package-manager/src/overrides.rs
  • pacquet/crates/package-manager/src/overrides/tests.rs
  • pacquet/crates/package-manager/src/warn_on_stale_convergence_overrides.rs
  • pacquet/crates/package-manager/src/warn_on_stale_convergence_overrides/tests.rs
  • pnpm11/config/parse-overrides/package.json
  • pnpm11/config/parse-overrides/src/index.ts
  • pnpm11/config/parse-overrides/test/index.ts
  • pnpm11/hooks/read-package-hook/src/createReadPackageHook.ts
  • pnpm11/hooks/read-package-hook/src/createVersionsOverrider.ts
  • pnpm11/hooks/read-package-hook/test/createVersionOverrider.test.ts
  • pnpm11/installing/deps-installer/package.json
  • pnpm11/installing/deps-installer/src/install/extendInstallOptions.ts
  • pnpm11/installing/deps-installer/src/install/index.ts
  • pnpm11/installing/deps-installer/src/install/warnOnStaleConvergenceOverrides.ts
  • pnpm11/installing/deps-installer/test/install/convergenceOverrides.ts
  • pnpm11/installing/deps-installer/test/install/warnOnStaleConvergenceOverrides.test.ts
  • pnpm11/installing/deps-installer/tsconfig.json

@github-actions

github-actions Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
tarball/download_dependency    1.00      6.5±0.20ms   664.6 KB/sec    1.00      6.5±0.59ms   662.5 KB/sec

@codecov-commenter

codecov-commenter commented Jul 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.21429% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.49%. Comparing base (bcb8b5a) to head (fdd1818).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...manager/src/warn_on_stale_convergence_overrides.rs 95.94% 3 Missing ⚠️
pnpm/crates/package-manager/src/overrides.rs 98.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12876      +/-   ##
==========================================
+ Coverage   85.45%   85.49%   +0.03%     
==========================================
  Files         474      475       +1     
  Lines       74555    74777     +222     
==========================================
+ Hits        63714    63930     +216     
- Misses      10841    10847       +6     

☔ 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 added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: fdd1818feb3b

Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD.

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.038 ± 0.109 3.919 4.301 1.87 ± 0.14
pacquet@main 4.099 ± 0.215 3.888 4.508 1.90 ± 0.16
pnpr@HEAD 2.156 ± 0.147 1.970 2.376 1.00
pnpr@main 2.190 ± 0.143 2.011 2.416 1.02 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.0378631474399995,
      "stddev": 0.10947391981656766,
      "median": 4.02550788294,
      "user": 3.9728242000000002,
      "system": 3.3973898399999998,
      "min": 3.91921735544,
      "max": 4.30088396044,
      "times": [
        4.30088396044,
        4.11215746344,
        3.92663876644,
        4.05611342144,
        4.03060741944,
        3.9624514944399998,
        4.01954582744,
        4.025739074440001,
        3.91921735544,
        4.02527669144
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.099265836640001,
      "stddev": 0.2148202429494948,
      "median": 3.9871660779399996,
      "user": 3.9133181,
      "system": 3.4309911399999997,
      "min": 3.88762257344,
      "max": 4.50770052744,
      "times": [
        4.50770052744,
        3.98032559044,
        3.91633559244,
        4.23351827044,
        3.88762257344,
        4.40926201344,
        3.9927697734399996,
        3.97043065344,
        4.11313098944,
        3.98156238244
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.15629502794,
      "stddev": 0.14654271309425548,
      "median": 2.1189958504399997,
      "user": 2.7484557,
      "system": 2.9170046399999996,
      "min": 1.97042952944,
      "max": 2.37644944344,
      "times": [
        2.08568887044,
        2.37644944344,
        1.99696579344,
        2.31053373944,
        2.05383927144,
        2.1523028304399996,
        1.97042952944,
        2.26066157644,
        2.04814121744,
        2.3079380074399998
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.19034627254,
      "stddev": 0.14250840082421318,
      "median": 2.1953275659399996,
      "user": 2.7381687999999995,
      "system": 2.9196586399999993,
      "min": 2.0106624214399997,
      "max": 2.41550521444,
      "times": [
        2.07141786344,
        2.2588763144399997,
        2.35346048544,
        2.2459324604399997,
        2.2967581934399997,
        2.0106624214399997,
        2.14472267144,
        2.0620206134399997,
        2.41550521444,
        2.0441064874399997
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 653.5 ± 14.3 635.5 674.8 1.00 ± 0.03
pacquet@main 651.5 ± 10.6 639.8 667.7 1.00
pnpr@HEAD 725.5 ± 68.3 694.3 918.9 1.11 ± 0.11
pnpr@main 748.1 ± 107.4 692.0 1049.8 1.15 ± 0.17
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6534567625000001,
      "stddev": 0.014269814160407027,
      "median": 0.6531388622000001,
      "user": 0.38797847999999996,
      "system": 1.3337322600000001,
      "min": 0.6354744077000001,
      "max": 0.6747574417000001,
      "times": [
        0.6474359607000001,
        0.6390998317000001,
        0.6696616327,
        0.6361889537000001,
        0.6591595007000001,
        0.6581012577,
        0.6481764667000001,
        0.6354744077000001,
        0.6747574417000001,
        0.6665121717000001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.6514971801,
      "stddev": 0.010595180755616105,
      "median": 0.6504376752000001,
      "user": 0.40773117999999997,
      "system": 1.31347656,
      "min": 0.6398318927000001,
      "max": 0.6676747717,
      "times": [
        0.6666738257,
        0.6552196407,
        0.6409897807,
        0.6676747717,
        0.6542889047,
        0.6586509357,
        0.6465864457,
        0.6398867967,
        0.6451688067000001,
        0.6398318927000001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.7255445616,
      "stddev": 0.06829983067494451,
      "median": 0.7066869992,
      "user": 0.40539497999999996,
      "system": 1.3821129600000002,
      "min": 0.6943115557,
      "max": 0.9189416427000001,
      "times": [
        0.7026622127000001,
        0.6945015317000001,
        0.7044903197000001,
        0.6975186207,
        0.7134549717,
        0.7117183037,
        0.7089627787,
        0.7088836787,
        0.6943115557,
        0.9189416427000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.7481408884000001,
      "stddev": 0.10743153545786537,
      "median": 0.7163105842,
      "user": 0.41852178,
      "system": 1.3871953599999998,
      "min": 0.6919987677,
      "max": 1.0498499787,
      "times": [
        0.7190882277,
        0.6919987677,
        0.7198770447,
        0.7112735047000001,
        0.6945227797000001,
        0.7233959677,
        0.7135329407000001,
        0.7037482637000001,
        1.0498499787,
        0.7541214087
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.276 ± 0.052 4.228 4.404 1.96 ± 0.13
pacquet@main 4.229 ± 0.030 4.183 4.288 1.94 ± 0.13
pnpr@HEAD 2.179 ± 0.146 2.008 2.424 1.00
pnpr@main 2.235 ± 0.128 2.050 2.410 1.03 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.275913587020002,
      "stddev": 0.0521735053913691,
      "median": 4.26508345942,
      "user": 3.8561069600000004,
      "system": 3.3207106200000007,
      "min": 4.22750896692,
      "max": 4.40375928792,
      "times": [
        4.2976496849200005,
        4.23940591092,
        4.28229862592,
        4.26625004992,
        4.26391686892,
        4.22750896692,
        4.24801353392,
        4.22829924092,
        4.30203369992,
        4.40375928792
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.22901830202,
      "stddev": 0.029684802076149257,
      "median": 4.221117337420001,
      "user": 3.83334656,
      "system": 3.2974190200000004,
      "min": 4.183357050920001,
      "max": 4.28829589892,
      "times": [
        4.183357050920001,
        4.25555239892,
        4.20741040792,
        4.21380634392,
        4.21486135592,
        4.227373318920001,
        4.21260129792,
        4.24791385392,
        4.28829589892,
        4.23901109292
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.1794246973200004,
      "stddev": 0.14632414307465194,
      "median": 2.1620871404199997,
      "user": 2.58868316,
      "system": 2.82721682,
      "min": 2.00771719892,
      "max": 2.4239457189199998,
      "times": [
        2.0596939229199998,
        2.4239457189199998,
        2.05933437692,
        2.00771719892,
        2.19288944892,
        2.32226108392,
        2.04302440092,
        2.13182775292,
        2.19234652792,
        2.36120654092
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.2345868146199996,
      "stddev": 0.12792528877541667,
      "median": 2.24114155092,
      "user": 2.58525366,
      "system": 2.85341982,
      "min": 2.0498528279199997,
      "max": 2.40957843092,
      "times": [
        2.18474210192,
        2.10006099792,
        2.0930127269199996,
        2.20013465492,
        2.0498528279199997,
        2.28214844692,
        2.37246300692,
        2.2923390869199998,
        2.36153586492,
        2.40957843092
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.434 ± 0.021 1.414 1.467 2.15 ± 0.04
pacquet@main 1.455 ± 0.063 1.404 1.625 2.18 ± 0.10
pnpr@HEAD 0.666 ± 0.008 0.658 0.679 1.00
pnpr@main 0.694 ± 0.046 0.661 0.820 1.04 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.4337241769600002,
      "stddev": 0.02074852276278727,
      "median": 1.42736277086,
      "user": 1.3819599,
      "system": 1.7329864000000001,
      "min": 1.41388630936,
      "max": 1.4674890093600002,
      "times": [
        1.41388630936,
        1.45010715636,
        1.41391049136,
        1.43559592336,
        1.4191296183600002,
        1.4155230113600001,
        1.41563043336,
        1.4473813553600001,
        1.4674890093600002,
        1.45858846136
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.45474189836,
      "stddev": 0.06259939641704271,
      "median": 1.43614463086,
      "user": 1.4010776999999999,
      "system": 1.7393897999999997,
      "min": 1.4044688973600001,
      "max": 1.6251800973600001,
      "times": [
        1.6251800973600001,
        1.45288497936,
        1.43234030936,
        1.47040960236,
        1.4310910703600002,
        1.4399489523600002,
        1.42822233636,
        1.4044688973600001,
        1.4177785173600002,
        1.44509422136
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.66596960886,
      "stddev": 0.007703070603822347,
      "median": 0.6645999523599999,
      "user": 0.33502580000000004,
      "system": 1.2872221,
      "min": 0.65766717736,
      "max": 0.67915254136,
      "times": [
        0.66017233436,
        0.67915254136,
        0.66866677136,
        0.65766717736,
        0.66078886836,
        0.66841103636,
        0.65881070236,
        0.65898184936,
        0.67483840636,
        0.67220640136
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.69422021456,
      "stddev": 0.04586864432878466,
      "median": 0.68216531536,
      "user": 0.344823,
      "system": 1.3095683,
      "min": 0.66143211336,
      "max": 0.81971959636,
      "times": [
        0.69086867436,
        0.66819014736,
        0.68084801636,
        0.68348261436,
        0.69953510736,
        0.69620502136,
        0.67352035636,
        0.66840049836,
        0.81971959636,
        0.66143211336
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.047 ± 0.029 3.001 3.101 4.43 ± 0.08
pacquet@main 3.182 ± 0.066 3.094 3.345 4.62 ± 0.12
pnpr@HEAD 0.688 ± 0.010 0.676 0.702 1.00
pnpr@main 0.707 ± 0.007 0.695 0.718 1.03 ± 0.02
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.04725186216,
      "stddev": 0.02914068231453169,
      "median": 3.04290876696,
      "user": 1.7659387000000002,
      "system": 1.9877433200000003,
      "min": 3.00113717146,
      "max": 3.10131263646,
      "times": [
        3.0517878124599997,
        3.0320470394599996,
        3.00113717146,
        3.10131263646,
        3.02411977446,
        3.02864989846,
        3.03402972146,
        3.07531771146,
        3.0675177584599997,
        3.05659909746
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.18247107746,
      "stddev": 0.06603555949077071,
      "median": 3.16650846896,
      "user": 1.8694210999999998,
      "system": 2.0705630200000003,
      "min": 3.0943477854599997,
      "max": 3.34462852846,
      "times": [
        3.0943477854599997,
        3.14486522846,
        3.16642155646,
        3.14811585646,
        3.15478209246,
        3.1665953814599996,
        3.1993520214599998,
        3.34462852846,
        3.19272332046,
        3.21287900346
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.6882781486600001,
      "stddev": 0.009715617180855889,
      "median": 0.6878875859600001,
      "user": 0.36239039999999995,
      "system": 1.31177692,
      "min": 0.6756185024600001,
      "max": 0.7021676574600001,
      "times": [
        0.6842072644600001,
        0.6792698554600001,
        0.7021676574600001,
        0.6915679074600001,
        0.6955654034600001,
        0.6826926364600001,
        0.6772447894600001,
        0.70051962846,
        0.6756185024600001,
        0.6939278414600001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.7073471988600001,
      "stddev": 0.006985061909380249,
      "median": 0.7072570829600001,
      "user": 0.3733114,
      "system": 1.3195895199999998,
      "min": 0.6953596574600001,
      "max": 0.7178920104600001,
      "times": [
        0.7099005754600001,
        0.7081893294600001,
        0.7035508104600001,
        0.7103637904600001,
        0.7178920104600001,
        0.6953596574600001,
        0.7063248364600001,
        0.7019776154600001,
        0.7025408924600001,
        0.7173724704600001
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 698.0 ± 13.8 674.7 722.0 6.22 ± 0.13
pacquet@main 693.7 ± 10.3 679.5 716.5 6.19 ± 0.09
pnpr@HEAD 112.2 ± 0.4 111.5 113.0 1.00
pnpr@main 118.9 ± 31.8 110.9 267.9 1.06 ± 0.28
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.69801330484,
      "stddev": 0.013790949907907055,
      "median": 0.69558718174,
      "user": 0.6563249200000001,
      "system": 0.15171790000000002,
      "min": 0.67473887324,
      "max": 0.72196266624,
      "times": [
        0.69451467824,
        0.68980021924,
        0.67473887324,
        0.7016105192400001,
        0.69938084924,
        0.72196266624,
        0.71828233824,
        0.68974851624,
        0.69343470324,
        0.69665968524
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.69373934094,
      "stddev": 0.010289287315044221,
      "median": 0.69183164024,
      "user": 0.64820502,
      "system": 0.1577845,
      "min": 0.67952805524,
      "max": 0.71645017924,
      "times": [
        0.6842748682400001,
        0.67952805524,
        0.69603899224,
        0.69237647224,
        0.70254283324,
        0.69686323324,
        0.68853394124,
        0.68949802624,
        0.69128680824,
        0.71645017924
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.11215996423999998,
      "stddev": 0.00043084686396152166,
      "median": 0.11218500424,
      "user": 0.02822195333333333,
      "system": 0.022481541666666664,
      "min": 0.11145840224,
      "max": 0.11296452724,
      "times": [
        0.11176460224,
        0.11148613324000001,
        0.11289310024,
        0.11215213524,
        0.11225376824000001,
        0.11253160624,
        0.11256660824,
        0.11153265224,
        0.11238359324000001,
        0.11165517724,
        0.11224159924,
        0.11215502924000001,
        0.11230047824,
        0.11257325324,
        0.11188709124,
        0.11274933424,
        0.11192509324000001,
        0.11193173224,
        0.11210284124,
        0.11238778924000001,
        0.11221497924,
        0.11296452724,
        0.11145840224,
        0.11172761524000001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.11891962124,
      "stddev": 0.03178387826879172,
      "median": 0.11220972674000002,
      "user": 0.029020578333333335,
      "system": 0.021691124999999995,
      "min": 0.11094498924,
      "max": 0.26793220124,
      "times": [
        0.11094498924,
        0.11194869924,
        0.11267876324000001,
        0.11224538524000001,
        0.11219141424000001,
        0.11222803924000001,
        0.11195214424000001,
        0.11305162824000001,
        0.11209396724000001,
        0.11173209324,
        0.11214247024,
        0.11257215724,
        0.11170881824000001,
        0.11243561224000001,
        0.11233923724,
        0.11247720924,
        0.11178096624,
        0.11189527824,
        0.11253072524,
        0.26793220124,
        0.12002220524,
        0.11139410524,
        0.11151821124,
        0.11225458924000001
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 6.857 ± 0.095 6.727 6.992 1.41 ± 0.02
pacquet@main 6.835 ± 0.149 6.674 7.113 1.41 ± 0.03
pnpr@HEAD 4.852 ± 0.050 4.795 4.954 1.00
pnpr@main 4.954 ± 0.132 4.736 5.194 1.02 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 6.856734658800001,
      "stddev": 0.09479669794179912,
      "median": 6.8408219839,
      "user": 4.15740202,
      "system": 3.6518167399999997,
      "min": 6.727181032400001,
      "max": 6.992366408400001,
      "times": [
        6.8969178414000005,
        6.9494419674,
        6.992366408400001,
        6.8285410384,
        6.8256800964,
        6.8531029294,
        6.727181032400001,
        6.7665941084000005,
        6.9766582734,
        6.750862892400001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 6.8349776792,
      "stddev": 0.1493698096261517,
      "median": 6.7634413749,
      "user": 4.084591919999999,
      "system": 3.6240823399999997,
      "min": 6.674078933400001,
      "max": 7.1128665214,
      "times": [
        6.9642276964,
        7.004888487400001,
        7.1128665214,
        6.893543713400001,
        6.7456930494,
        6.7452369044000005,
        6.674078933400001,
        6.6980689584,
        6.729982827400001,
        6.781189700400001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 4.852331218800001,
      "stddev": 0.04994010041457515,
      "median": 4.8506681019,
      "user": 2.86391522,
      "system": 3.0889593399999997,
      "min": 4.7951498664,
      "max": 4.9536627354,
      "times": [
        4.858654206400001,
        4.911493566400001,
        4.8574858754,
        4.9536627354,
        4.800407728400001,
        4.8438503284,
        4.8038010494000005,
        4.7951498664,
        4.8594361014,
        4.839370730400001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 4.9538259753,
      "stddev": 0.13168804054251035,
      "median": 4.949701885400001,
      "user": 2.8523142200000002,
      "system": 3.0824238399999997,
      "min": 4.735682064400001,
      "max": 5.194454604400001,
      "times": [
        4.8555040254,
        4.955455054400001,
        5.0159782494,
        4.8705955294,
        4.8565257784,
        5.194454604400001,
        5.060802665400001,
        4.9439487164,
        4.735682064400001,
        5.049313065400001
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12876
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
4,275.91 ms
(-0.37%)Baseline: 4,291.72 ms
5,150.06 ms
(83.03%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
3,047.25 ms
(+0.88%)Baseline: 3,020.75 ms
3,624.90 ms
(84.06%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
1,433.72 ms
(+5.49%)Baseline: 1,359.12 ms
1,630.95 ms
(87.91%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
698.01 ms
(+9.20%)Baseline: 639.21 ms
767.05 ms
(91.00%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
4,037.86 ms
(-2.44%)Baseline: 4,138.96 ms
4,966.75 ms
(81.30%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
6,856.73 ms
(-6.76%)Baseline: 7,354.09 ms
8,824.91 ms
(77.70%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
653.46 ms
(+0.58%)Baseline: 649.67 ms
779.60 ms
(83.82%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12876
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
2,179.42 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
688.28 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
665.97 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
112.16 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,156.30 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
4,852.33 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
725.54 ms
🐰 View full continuous benchmarking report in Bencher

Copilot AI review requested due to automatic review settings July 9, 2026 23:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 44a1f75

@qodo-code-review

qodo-code-review Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

CategorySuggestion                                                                                                                                    Impact
Possible issue
Validate semver before comparison

Validate semver inputs before comparison to prevent errors from invalid registry
data.

pnpm11/installing/deps-installer/src/install/index.ts [61-64]

+const parsedRanges = [...ranges].filter((range) => semver.validRange(range, true) != null)
+if (parsedRanges.length !== ranges.size) return
+
 const best = candidates
-  .filter((version): version is string => version != null && semver.gt(version, override.newBareSpecifier))
+  .filter((version): version is string =>
+    version != null &&
+    semver.valid(version) != null &&
+    semver.gt(version, override.newBareSpecifier)
+  )
   .sort(semver.rcompare)
-  .find((version) => [...ranges].every((range) => semver.satisfies(version, range, true)))
+  .find((version) => parsedRanges.every((range) => semver.satisfies(version, range, true)))

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 5

__

Why: Adding defensive semver validation prevents potential runtime crashes from malformed registry versions, though the collected ranges are already pre-validated.

Low
  • More

zkochan and others added 3 commits July 11, 2026 10:23
Implements the empty-range override selector from #12794 in both
stacks. "form-data@": "4.0.6" rewrites a dependency edge to exactly 4.0.6
iff 4.0.6 satisfies the edge's declared range, so compatible consumers
converge while incompatible ones keep their own resolution — semver-safe
by construction, unlike a bare override, and future-proof against new
compatible dependents, unlike a range-scoped one.

Design decisions:

- The value must be an exact version (ERR_PNPM_INVALID_CONVERGENCE_OVERRIDE
  otherwise): a range value would make "satisfies" ill-defined (issue open
  question 4).
- Empty ranges are rejected inside parent>child selectors, reserving that
  design space until precedence there is settled (open question 5, first
  half); when "pkg" or "pkg@range" and "pkg@" both match an edge, the
  explicit override wins.
- Satisfies checks use loose semver, matching the npm picker; workspace:,
  catalog:, npm:, git/URL, and dist-tag specifiers are skipped ("satisfies"
  is only defined against a semver range — open question 3).
- Staleness detection (lifecycle rule 3 of the issue) ships with the
  syntax: after a full resolution — the only time the versions overrider
  has seen every manifest, so the collected declared-range set is complete —
  each convergence entry resolves every declared range against the cached
  registry metadata (release-age policy applied), and if a version newer
  than the value satisfies every declared range, install warns with that
  concrete replacement value. Partial resolutions stay silent to avoid
  false positives from unseen ranges; failed range resolutions can only
  suppress the warning, never fabricate one.
- An empty range previously slipped through parsing and behaved like a bare
  override; that undocumented accident is replaced by validation and the
  converge semantics.

pacquet mirrors the TS behavior byte-for-byte: same error code and
messages, same warning text emitted on the pnpm:global warn channel the
shared default reporter renders, same precedence and skip rules, with
matching test coverage (parser, overrider, staleness unit tests, and
mocked-registry e2e asserting the exact warning on stdout).

Deferred follow-ups from the issue's lifecycle plan: pnpm update / pnpm
dedupe refreshing and pruning managed entries (rules 1-2) and pnpm
outdated listing stale entries (rule 4).

Related to #12794.

Co-Authored-By: Claude Fable 5 <[email protected]>
Raw strings for the stale-convergence warning literals and trailing
commas in multi-line macro invocations, as required by the dylint
perfectionist lints the pre-push hook enforces.

Co-Authored-By: Claude Fable 5 <[email protected]>
meta-updater adds the config/version-policy reference introduced by the
convergence-override staleness check.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings July 11, 2026 08:27
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