Skip to content

fix: resolve catalog references when installing via a pnpr server - #13233

Merged
zkochan merged 4 commits into
mainfrom
fix-13232
Jul 23, 2026
Merged

zkochan merged 4 commits into
mainfrom
fix-13232

Conversation

@zkochan

@zkochan zkochan commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes a regression where a catalog: specifier fails to resolve when the install is routed through a pnpr server, erroring with:

resolution failed: ... No catalog entry '@tanstack/store' was found for catalog 'default'.

even though the catalog entry exists in pnpm-workspace.yaml.

Root cause

The pnpr server reconstructs the requested workspace in a temp dir from the resolve request (pnpr/crates/pnpr/src/resolver/resolve.rs). That reconstruction wrote a pnpm-workspace.yaml with only a packages: section — no catalog definitions — and passed catalogs_override: None into the install. So the server had no catalogs and could not resolve any catalog: specifier.

This affected both:

  • catalog: in overrides (the error in the issue, which fires first), and
  • catalog: in regular dependencies (verified separately — it fails the same way once the overrides error is out of the way).

Fix

Forward the client's workspace catalogs in the resolve request and use them as the install's catalogs_override, which feeds both dependency and override catalog resolution in one place. The client now sends its raw overrides (the server resolves their catalog: references) rather than pre-resolving them locally.

This mirrors the approach suggested in review — resolving catalog: server-side rather than patching each reference on the client — and keeps dependency and override catalog handling consistent.

Scope (parity change — TypeScript + Rust pnpr server)

  • TS client (@pnpm/pnpr.client): new catalogs field on the resolve request, added to the wire body.
  • TS installer (@pnpm/installing.deps-installer): forward opts.catalogs; send raw overrides.
  • Rust pnpr server (@pnpm/pnpr): new catalogs field on ResolveRequest; passed as catalogs_override.

No pnpm-workspace.yaml reconstruction change is needed — catalogs_override bypasses the manifest read.

Tests

  • Rust (resolve/tests.rs): forwarded_catalogs_resolve_catalog_specifiers — an offline resolve where a catalog: dependency resolves only because the catalogs are forwarded. Verified it fails with the exact issue error (No catalog entry 'lib' ...) when the fix is reverted.
  • TS e2e (pnpmRegistry.ts): faithful reproduction of the issue (root + packages/a, catalog: dependency + catalog: override) against a real pnpr server.
  • TS unit (pnprWorkspaceMetadata.ts): asserts catalogs and raw overrides are forwarded.

Follow-up noted (not fixed here)

While reproducing, I found a separate, pre-existing bug: a workspace with exactly one non-root importer (e.g. only packages/a with no root project) fails the pnpr path with Cannot read properties of undefined (reading 'dependencies'), because installViaPnprServer only builds the projects list when allInstallProjects.length > 1, so a single member is sent as a root (.) importer and the headless install then can't find its importer id. It reproduces without catalogs and is orthogonal to this fix. The issue's real-world repro has a root importer too (root + member = 2 importers), so it is unaffected. Happy to file/fix separately.

Closes #13232

Squash Commit Body

A `catalog:` specifier in a workspace's dependencies or overrides failed to
resolve when the install was routed through a pnpr server, erroring with
"No catalog entry '<name>' was found for catalog 'default'." even though the
catalog entry existed.

The pnpr server reconstructs the requested workspace in a temp dir from the
resolve request. That reconstruction wrote a pnpm-workspace.yaml with only a
packages: section and no catalog definitions, and passed catalogs_override:
None to the install — so the server had no catalogs and could not resolve any
catalog: specifier, in dependencies or overrides.

Forward the client's workspace catalogs in the resolve request and use them as
the install's catalogs_override, which feeds both dependency and override
catalog resolution. The client now sends its raw overrides (the server resolves
their catalog: references) instead of pre-resolving them locally.

Closes pnpm/pnpm#13232

Checklist

  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

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

Summary by CodeRabbit

  • Bug Fixes

    • Fixed pnpr-server installs failing to resolve catalog: references inside overrides (including cases where the catalog entry exists).
    • Improved pnpr-server installs by forwarding workspace catalog data and overrides through resolution so catalog: specifiers resolve consistently in dependency and override handling.
    • Fixed a Windows crash when installing a nested workspace member via a pnpr server.
  • Tests

    • Added Jest and Tokio coverage to verify catalogs/overrides are sent to the pnpr resolver and that installs resolve catalog: references in both dependencies and overrides.
  • Chores

    • Patch version bump for related pnpr/pnpm packages.

Copilot AI review requested due to automatic review settings July 23, 2026 12: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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix catalog: overrides resolution when installing via pnpr server

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Pre-resolve catalog: override specifiers against workspace catalogs before pnpr server requests.
• Prevent pnpr-server installs from failing due to missing catalog definitions server-side.
• Add regression test and ship a patch changeset for pnpm and deps-installer.
Diagram

graph TD
  A["deps-installer: install()"] --> B["installViaPnprServer"] --> C["parseOverrides + catalogs"] --> D["createOverridesMapFromParsed"] --> E{{"pnpr server"}}
  F[("workspace catalogs")] --> C

  subgraph Legend
    direction LR
    _proc["Process"] ~~~ _cfg[("Config") ] ~~~ _ext{{"External"}}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Send catalogs to pnpr server (protocol extension)
  • ➕ Server could resolve catalog: consistently for all callers
  • ➕ Removes need for client-side pre-resolution logic
  • ➖ Requires protocol/schema change and coordinated rollout
  • ➖ Increases request payload size and coupling to workspace config
2. Pre-resolve overrides earlier in the install option normalization pipeline
  • ➕ Keeps installViaPnprServer simpler (uses already-normalized overrides)
  • ➕ Centralizes override normalization for all install paths
  • ➖ Riskier refactor; may affect other call sites expecting raw options
  • ➖ Harder to scope as a minimal regression fix

Recommendation: Current approach (client-side pre-resolution inside installViaPnprServer) is the best fit for a regression fix: it matches the local resolution behavior, avoids pnpr protocol changes, and keeps the fix narrowly scoped to the server-install path that was forwarding raw overrides.

Files changed (3) +27 / -1

Bug fix (1) +4 / -1
index.tsResolve 'catalog:' overrides before sending pnpr-server requests +4/-1

Resolve 'catalog:' overrides before sending pnpr-server requests

• Updates 'installViaPnprServer' to parse overrides with workspace catalogs and send a fully-resolved overrides map to the pnpr server. This prevents server-side failures due to missing catalog definitions in the request.

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

Tests (1) +17 / -0
pnprWorkspaceMetadata.tsAdd regression test for resolving catalog overrides in pnpr-server forwarding +17/-0

Add regression test for resolving catalog overrides in pnpr-server forwarding

• Adds a test that installs with both 'catalog:' and literal overrides and asserts the pnpr-server resolver is called with resolved override values. Ensures 'catalog:' entries are replaced with the catalog version before forwarding.

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

Other (1) +6 / -0
pnpr-catalog-overrides.mdAdd patch changeset for pnpr-server 'catalog:' override regression +6/-0

Add patch changeset for pnpr-server 'catalog:' override regression

• Adds a changeset bumping '@pnpm/installing.deps-installer' and 'pnpm' with a release note describing the pnpr-server install failure when 'catalog:' is used in 'overrides'.

.changeset/pnpr-catalog-overrides.md

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 678169ad-a766-432a-9621-202a4972f8df

📥 Commits

Reviewing files that changed from the base of the PR and between 6adeb50 and ff69926.

📒 Files selected for processing (2)
  • .changeset/pnpr-catalog-overrides.md
  • pnpm11/installing/deps-installer/src/install/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • pnpm11/installing/deps-installer/src/install/index.ts

📝 Walkthrough

Walkthrough

The installer now forwards workspace catalogs to the pnpr server. The client and server protocols accept catalog data, the resolver applies it when processing dependencies and overrides, and tests cover catalog-based resolution. PNPR importer IDs also use lockfile-compatible path normalization.

Changes

PNPR catalog resolution

Layer / File(s) Summary
Catalog request contract
pnpr/client/..., pnpr/crates/pnpr/...
The PNPR client and resolver protocol add optional workspace catalog data to resolve requests and wire the required catalog type dependencies.
Installer catalog forwarding
pnpm11/installing/deps-installer/..., pnpm11/pnpm/test/install/pnpmRegistry.ts, .changeset/...
The installer forwards catalogs with dependency overrides to the PNPR server, with unit and integration coverage and patch-release metadata.
Server catalog resolution
pnpr/crates/pnpr/src/resolver/...
The resolver passes request catalogs into pacquet’s installation configuration and tests resolution of catalog: dependency specifications.
Importer ID normalization
pnpm11/installing/deps-installer/src/install/index.ts
The PNPR install path derives importer IDs through getLockfileImporterId for normalized lockfile keys.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Assessment against linked issues

Objective Addressed Explanation
Forward the workspace catalog so catalog: references in dependencies and overrides resolve correctly [#13232] ✅

Out-of-scope changes

Code Change Explanation
Normalize PNPR headless-install importer IDs for Windows ( pnpm11/installing/deps-installer/src/install/index.ts:2761-2764 ) The linked issue specifies catalog resolution failure; it does not define the separate Windows nested-workspace crash fix documented by the changeset.

Possibly related PRs

  • pnpm/pnpm#13017: Both PRs extend PNPR resolution request wiring with additional JSON payload fields.

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

Suggested reviewers: copilot

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-13232

Warning

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

🔧 ESLint

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

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


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failures remain.

Reviews (3): Last reviewed commit: "docs: note the Windows nested-member fix..." | Re-trigger Greptile

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 23, 2026
@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Context used
✅ Compliance rules (platform): 26 rules

Grey Divider


Remediation recommended

1. Frozen path skips catalogs 🐞 Bug ➹ Performance ⭐ New
Description
pnpr now resolves catalog: specifiers using request.catalogs, but the
fresh_frozen_input_lockfile short-circuit still checks lockfile settings with an empty catalogs
config, so any lockfile with a catalogs: snapshot can never take the frozen fast-path. This forces
a full resolve even when the lockfile and catalogs are unchanged, adding avoidable CPU/I/O in
--frozen-lockfile installs.
Code

pnpr/crates/pnpr/src/resolver/resolve.rs[R226-229]

+        // The reconstructed workspace carries no catalog sections, so the
+        // client's catalogs are forwarded here and used to resolve
+        // `catalog:` specifiers in dependencies and overrides.
+        catalogs_override: request.catalogs.clone(),
Relevance

⭐⭐⭐ High

Frozen-lockfile fast-path correctness/perf fixes in pnpr resolver have been accepted before.

PR-#12144

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The resolver now uses request.catalogs for actual resolution, but the frozen fast-path’s staleness
check still hard-codes an empty catalogs config, which makes any non-empty lockfile catalogs:
snapshot fail the fast-path eligibility check.

pnpr/crates/pnpr/src/resolver/resolve.rs[214-233]
pnpr/crates/pnpr/src/resolver/resolve.rs[245-284]
pnpm/crates/lockfile/src/freshness.rs[250-270]
pnpm/crates/lockfile/src/freshness.rs[289-294]
pnpm/crates/lockfile/src/lib.rs[89-104]

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

## Issue description
`fresh_frozen_input_lockfile()` uses `check_lockfile_settings(...)`, which internally compares the lockfile’s `catalogs:` snapshot against an empty `Catalogs::new()`. Now that pnpr resolution uses `request.catalogs` via `catalogs_override`, the frozen fast-path should validate against the *request-provided catalogs* instead; otherwise, any lockfile that records a catalogs snapshot (typical once `catalog:` is used) will always be treated as stale for this optimization.

## Issue Context
- Resolution now uses `catalogs_override: request.catalogs.clone()`.
- The frozen-lockfile fast-path is meant to be a hot-path optimization (common in CI).
- The lockfile type explicitly records a `catalogs:` snapshot for catalog-referenced direct deps; comparing that snapshot to an empty config prevents the fast-path from ever triggering.

## Fix Focus Areas
- pnpr/crates/pnpr/src/resolver/resolve.rs[226-233]
- pnpr/crates/pnpr/src/resolver/resolve.rs[245-313]
- pnpm/crates/lockfile/src/freshness.rs[250-294]

## What to change
- In `fresh_frozen_input_lockfile`, replace the `check_lockfile_settings(...)` call with the catalogs-aware variant (`check_lockfile_settings_with_catalogs(...)`) using `request.catalogs.as_ref().unwrap_or(&empty_catalogs)`.
- Keep the existing overrides / settings inputs as-is (still `None`/empty in this fast-path), but ensure the catalogs comparison uses the forwarded catalogs.
- (Optional but recommended) add a unit test covering a frozen request where lockfile `catalogs:` snapshot matches `request.catalogs`, asserting the fast-path returns `Some(lockfile)`.

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


2. Unsafe overrides map build ✓ Resolved 🐞 Bug ⛨ Security
Description
installViaPnprServer() now always builds the pnpr request overrides via
createOverridesMapFromParsed(parseOverrides(...)), but createOverridesMapFromParsed accumulates
into a plain {} with bracket assignment, which cannot safely represent special keys like
__proto__ as ordinary own properties. This can silently drop such an override entry (and is
inconsistent with existing repo patterns that use null-prototype objects / defineProperty for
user-controlled dependency keys).
Code

pnpm11/installing/deps-installer/src/install/index.ts[R2697-2700]

+      // Resolve any `catalog:` references in overrides against the workspace
+      // catalogs before sending them to the pnpr server. The server never
+      // receives the catalog definitions, so it cannot resolve them itself.
+      overrides: createOverridesMapFromParsed(parseOverrides(opts.overrides ?? {}, opts.catalogs ?? {})),
Relevance

⭐⭐⭐ High

Team has accepted null-prototype/defineProperty hardening for __proto__-keyed maps; same pattern
applies to overrides.

PR-#12558
PR-#12953

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The pnpr-server path now always routes override serialization through a helper that uses a plain
object accumulator. The repo explicitly documents that YAML/JSON-parsed inputs can contain
__proto__ as an own property and already uses null-prototype + defineProperty to make such keys
safe/representable; createOverridesMapFromParsed currently does not.

pnpm11/installing/deps-installer/src/install/index.ts[2686-2703]
pnpm11/lockfile/settings-checker/src/createOverridesMapFromParsed.ts[1-10]
pnpm11/catalogs/config/src/mergeCatalogs.ts[10-37]
pnpm11/catalogs/config/test/mergeCatalogs.test.ts[43-53]
pnpm11/pkg-manifest/utils/src/updateProjectManifestObject.ts[103-115]
PR-#12558

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

### Issue description
`installViaPnprServer()` now constructs the pnpr request overrides with `createOverridesMapFromParsed(parseOverrides(...))`. The `createOverridesMapFromParsed` helper currently builds the map with a normal `{}` and `overridesMap[selector] = ...`, which is unsafe for special keys like `__proto__` (cannot be represented as a normal own property on a plain object).

### Issue Context
This codebase already treats manifest/config-derived keys as attacker-controlled and repeatedly hardens maps keyed by dependency-like names via `Object.create(null)` and/or `Object.defineProperty`.

### Fix Focus Areas
- pnpm11/lockfile/settings-checker/src/createOverridesMapFromParsed.ts[1-10]
- pnpm11/installing/deps-installer/src/install/index.ts[2686-2703]

### Suggested fix
- Change the accumulator in `createOverridesMapFromParsed()` to a null-prototype object:
 - `const overridesMap = Object.create(null) as Record<string, string>`
- Write entries with `Object.defineProperty` (or at minimum keep bracket assignment on a null-prototype object) so `__proto__` is always an own data property.
- Add a regression test near existing hardening tests (or add a new unit test for `createOverridesMapFromParsed`) that ensures a selector key named `__proto__` is preserved as an own property and does not mutate prototypes.

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



Informational

3. execPnpm() call missing comma 📘 Rule violation ⚙ Maintainability ⭐ New
Description
The multi-line execPnpm() call omits a trailing comma after the single argument, violating the
required trailing-comma style for multi-line argument lists. This creates inconsistent formatting
and noisier diffs when editing these blocks.
Code

pnpm11/pnpm/test/install/pnpmRegistry.ts[R355-357]

+  await execPnpm(
+    ['install', `--config.pnprServer=http://localhost:${serverPort}`]
+  )
Relevance

⭐ Low

Team repeatedly rejects trailing-comma style nits in TS multiline calls/signatures.

PR-#12949
PR-#12833
PR-#12789

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713434 requires trailing commas in TypeScript multi-line constructs. The new
execPnpm( call spans multiple lines but the last (and only) argument line does not end with a
comma.

Rule 713434: Require trailing commas in TypeScript collections and multi-line constructs
pnpm11/pnpm/test/install/pnpmRegistry.ts[355-357]

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 multi-line function call argument list is missing a trailing comma on the last argument.

## Issue Context
Repo compliance requires trailing commas in TypeScript multi-line constructs to keep diffs stable and formatting consistent.

## Fix Focus Areas
- pnpm11/pnpm/test/install/pnpmRegistry.ts[355-357]

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


4. Unconditional overrides parsing ✓ Resolved 🐞 Bug ➹ Performance
Description
The pnpr-server install path now parses every override selector/value via parseOverrides() even
when no override value uses the catalog: protocol, adding avoidable selector parsing/semver work
compared to forwarding opts.overrides directly. This is likely small, but pnpr installs are
performance-sensitive and a cheap pre-check can skip the parse work for the common non-catalog case.
Code

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

+      overrides: createOverridesMapFromParsed(parseOverrides(opts.overrides ?? {}, opts.catalogs ?? {})),
Relevance

⭐⭐ Medium

Perf nits are sometimes accepted for hot paths, but also often rejected as complexity for small
wins.

PR-#12491
PR-#12855

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed code introduces parseOverrides on the pnpr-server path; parseOverrides does
non-trivial work per entry (selector parsing and converge validation). When no value is a catalog:
reference, forwarding the original overrides would avoid that work.

pnpm11/installing/deps-installer/src/install/index.ts[2686-2703]
pnpm11/config/parse-overrides/src/index.ts[28-67]

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

### Issue description
`installViaPnprServer()` always calls `parseOverrides()` + `createOverridesMapFromParsed()`. That parsing is only necessary to resolve `catalog:` values (and potentially to surface local errors for catalog misuse). For installs whose overrides contain no `catalog:` values, this is extra CPU/allocation work.

### Issue Context
pnpm install paths are hot; this runs on every install that uses `pnprServer` and has any `overrides`.

### Fix Focus Areas
- pnpm11/installing/deps-installer/src/install/index.ts[2686-2703]
- pnpm11/config/parse-overrides/src/index.ts[28-67]

### Suggested fix
- Add a cheap predicate before parsing:
 - If `opts.overrides == null` or empty, keep `overrides` undefined.
 - Else, if `Object.values(opts.overrides).some(v => typeof v === 'string' && v.trimStart().startsWith('catalog:'))` is false, send `opts.overrides` as-is.
 - Otherwise, do the current `parseOverrides`/`createOverridesMapFromParsed` resolution.
- Keep behavior unchanged for actual `catalog:` usage.

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


Grey Divider

Previous review results

Review updated until commit ff69926

Results up to commit 516668a ⚖️ Balanced


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


Remediation recommended
1. Unsafe overrides map build ✓ Resolved 🐞 Bug ⛨ Security
Description
installViaPnprServer() now always builds the pnpr request overrides via
createOverridesMapFromParsed(parseOverrides(...)), but createOverridesMapFromParsed accumulates
into a plain {} with bracket assignment, which cannot safely represent special keys like
__proto__ as ordinary own properties. This can silently drop such an override entry (and is
inconsistent with existing repo patterns that use null-prototype objects / defineProperty for
user-controlled dependency keys).
Code

pnpm11/installing/deps-installer/src/install/index.ts[R2697-2700]

+      // Resolve any `catalog:` references in overrides against the workspace
+      // catalogs before sending them to the pnpr server. The server never
+      // receives the catalog definitions, so it cannot resolve them itself.
+      overrides: createOverridesMapFromParsed(parseOverrides(opts.overrides ?? {}, opts.catalogs ?? {})),
Relevance

⭐⭐⭐ High

Team has accepted null-prototype/defineProperty hardening for __proto__-keyed maps; same pattern
applies to overrides.

PR-#12558
PR-#12953

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The pnpr-server path now always routes override serialization through a helper that uses a plain
object accumulator. The repo explicitly documents that YAML/JSON-parsed inputs can contain
__proto__ as an own property and already uses null-prototype + defineProperty to make such keys
safe/representable; createOverridesMapFromParsed currently does not.

pnpm11/installing/deps-installer/src/install/index.ts[2686-2703]
pnpm11/lockfile/settings-checker/src/createOverridesMapFromParsed.ts[1-10]
pnpm11/catalogs/config/src/mergeCatalogs.ts[10-37]
pnpm11/catalogs/config/test/mergeCatalogs.test.ts[43-53]
pnpm11/pkg-manifest/utils/src/updateProjectManifestObject.ts[103-115]
PR-#12558

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

### Issue description
`installViaPnprServer()` now constructs the pnpr request overrides with `createOverridesMapFromParsed(parseOverrides(...))`. The `createOverridesMapFromParsed` helper currently builds the map with a normal `{}` and `overridesMap[selector] = ...`, which is unsafe for special keys like `__proto__` (cannot be represented as a normal own property on a plain object).

### Issue Context
This codebase already treats manifest/config-derived keys as attacker-controlled and repeatedly hardens maps keyed by dependency-like names via `Object.create(null)` and/or `Object.defineProperty`.

### Fix Focus Areas
- pnpm11/lockfile/settings-checker/src/createOverridesMapFromParsed.ts[1-10]
- pnpm11/installing/deps-installer/src/install/index.ts[2686-2703]

### Suggested fix
- Change the accumulator in `createOverridesMapFromParsed()` to a null-prototype object:
 - `const overridesMap = Object.create(null) as Record<string, string>`
- Write entries with `Object.defineProperty` (or at minimum keep bracket assignment on a null-prototype object) so `__proto__` is always an own data property.
- Add a regression test near existing hardening tests (or add a new unit test for `createOverridesMapFromParsed`) that ensures a selector key named `__proto__` is preserved as an own property and does not mutate prototypes.

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



Informational
2. Unconditional overrides parsing ✓ Resolved 🐞 Bug ➹ Performance
Description
The pnpr-server install path now parses every override selector/value via parseOverrides() even
when no override value uses the catalog: protocol, adding avoidable selector parsing/semver work
compared to forwarding opts.overrides directly. This is likely small, but pnpr installs are
performance-sensitive and a cheap pre-check can skip the parse work for the common non-catalog case.
Code

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

+      overrides: createOverridesMapFromParsed(parseOverrides(opts.overrides ?? {}, opts.catalogs ?? {})),
Relevance

⭐⭐ Medium

Perf nits are sometimes accepted for hot paths, but also often rejected as complexity for small
wins.

PR-#12491
PR-#12855

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed code introduces parseOverrides on the pnpr-server path; parseOverrides does
non-trivial work per entry (selector parsing and converge validation). When no value is a catalog:
reference, forwarding the original overrides would avoid that work.

pnpm11/installing/deps-installer/src/install/index.ts[2686-2703]
pnpm11/config/parse-overrides/src/index.ts[28-67]

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

### Issue description
`installViaPnprServer()` always calls `parseOverrides()` + `createOverridesMapFromParsed()`. That parsing is only necessary to resolve `catalog:` values (and potentially to surface local errors for catalog misuse). For installs whose overrides contain no `catalog:` values, this is extra CPU/allocation work.

### Issue Context
pnpm install paths are hot; this runs on every install that uses `pnprServer` and has any `overrides`.

### Fix Focus Areas
- pnpm11/installing/deps-installer/src/install/index.ts[2686-2703]
- pnpm11/config/parse-overrides/src/index.ts[28-67]

### Suggested fix
- Add a cheap predicate before parsing:
 - If `opts.overrides == null` or empty, keep `overrides` undefined.
 - Else, if `Object.values(opts.overrides).some(v => typeof v === 'string' && v.trimStart().startsWith('catalog:'))` is false, send `opts.overrides` as-is.
 - Otherwise, do the current `parseOverrides`/`createOverridesMapFromParsed` resolution.
- Keep behavior unchanged for actual `catalog:` usage.

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


Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

No code suggestions found for the PR.

A `catalog:` specifier in a workspace's dependencies or overrides failed to
resolve when the install was routed through a pnpr server, erroring with
"No catalog entry '<name>' was found for catalog 'default'." even though the
catalog entry existed.

The pnpr server reconstructs the requested workspace in a temp dir from the
resolve request. That reconstruction wrote a `pnpm-workspace.yaml` with only a
`packages:` section and no catalog definitions, and passed `catalogs_override:
None` to the install — so the server had no catalogs and could not resolve any
`catalog:` specifier, in dependencies or overrides.

Forward the client's workspace catalogs in the resolve request and use them as
the install's `catalogs_override`, which feeds both dependency and override
catalog resolution. The client now sends its raw overrides (the server resolves
their `catalog:` references) instead of pre-resolving them locally.

Closes #13232

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 23, 2026 13:12

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.

Keeps the tsconfig `references` in sync with the new `@pnpm/catalogs.types`
dependency so the meta-updater check passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 23, 2026 13:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

No code suggestions found for the PR.

@zkochan zkochan changed the title fix: resolve catalog references in overrides on the pnpr server install path fix: resolve catalog references when installing via a pnpr server Jul 23, 2026
@zkochan

zkochan commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

Heads up: I reworked this PR after a review question ("isn't the right fix just to send the catalogs to pnpr?"). That's the better fix, so the approach changed substantially:

  • Before: pre-resolve catalog: in overrides on the client and send resolved overrides. This only fixed overrides.
  • Now: forward the workspace catalogs to the pnpr server and let it resolve catalog: in both dependencies and overrides via catalogs_override.

The reason the change grew: the earlier client-side fix left catalog: in regular dependencies still broken (the server reconstructs the workspace with no catalog section). I confirmed that end-to-end — after fixing overrides, a plain catalog: dependency failed with the same No catalog entry ... error. Forwarding catalogs fixes both uniformly and lets the client drop the override pre-resolution.

It's now a parity change across the TS client/installer and the Rust pnpr server (@pnpm/pnpr). New Rust + TS-e2e + TS-unit tests added; the Rust test was verified to fail with the exact issue error when the fix is reverted. Re-review appreciated since the diff is different from what you last approved.


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

@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.15     13.9±0.97ms    26.9 MB/sec    1.00     12.1±0.71ms    31.0 MB/sec
packument/parse                1.09     44.9±1.64µs  1476.9 MB/sec    1.00     41.2±0.89µs  1609.0 MB/sec
tarball/download_dependency    1.21      3.3±0.78ms  1314.7 KB/sec    1.00      2.7±0.23ms  1585.9 KB/sec

@qodo-code-review

Copy link
Copy Markdown

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

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

No code suggestions found for the PR.

@codecov-commenter

codecov-commenter commented Jul 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.92%. Comparing base (80c4162) to head (ff69926).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13233   +/-   ##
=======================================
  Coverage   86.92%   86.92%           
=======================================
  Files         528      528           
  Lines       90457    90467   +10     
=======================================
+ Hits        78630    78642   +12     
+ Misses      11827    11825    -2     

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

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

@blacksmith-sh

blacksmith-sh Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
test/install/pnpmRegistry.ts (7.861 s)/pnpmRegistry.ts (7.861 s) View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

The pnpr install path built each project's headless-install importer id with a
raw `path.relative(lockfileDir, rootDir)`. On Windows a nested workspace member
(`packages/foo`) yields `packages\foo`, which does not match the POSIX importer
keys (`packages/foo`) the pnpr server emits in the lockfile — so the headless
install crashed with "Cannot read properties of undefined (reading
'dependencies')". Root-level members never showed it because they have no path
separator.

Use `getLockfileImporterId`, which normalizes separators the same way the
resolve request's project dirs already are.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings July 23, 2026 13:36

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.

Copilot AI review requested due to automatic review settings July 23, 2026 13:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

No code suggestions found for the PR.

@qodo-code-review

Copy link
Copy Markdown

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

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

No code suggestions found for the PR.

@github-actions

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: ff699269303a

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

The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time).

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.548 ± 0.162 2.385 2.812 1.69 ± 0.20
pacquet@main 2.486 ± 0.155 2.348 2.808 1.64 ± 0.20
pnpr@HEAD 1.528 ± 0.178 1.356 1.785 1.01 ± 0.16
pnpr@main 1.511 ± 0.154 1.369 1.737 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5482645084400004,
      "stddev": 0.16231377344328193,
      "median": 2.46580055944,
      "user": 1.81858362,
      "system": 1.4432871999999999,
      "min": 2.3850000979400003,
      "max": 2.8123449709400004,
      "times": [
        2.8123449709400004,
        2.73451483494,
        2.66537290694,
        2.4208841439400004,
        2.50655437194,
        2.42504674694,
        2.7024017809400003,
        2.41907799794,
        2.3850000979400003,
        2.4114472319400004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.4858831608400003,
      "stddev": 0.15515264774471668,
      "median": 2.41872927694,
      "user": 1.70295812,
      "system": 1.3337124999999999,
      "min": 2.34816122394,
      "max": 2.8079169269400004,
      "times": [
        2.3887520569400005,
        2.71785003594,
        2.4709972709400003,
        2.42913817394,
        2.5166050219400002,
        2.37559171894,
        2.34816122394,
        2.8079169269400004,
        2.40832037994,
        2.3954987989400003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5275012675400002,
      "stddev": 0.17843116421112012,
      "median": 1.4268604259400002,
      "user": 1.1300485200000001,
      "system": 1.1636865999999997,
      "min": 1.35607289694,
      "max": 1.78522669694,
      "times": [
        1.38954042894,
        1.35607289694,
        1.78522669694,
        1.37491234794,
        1.6938464479400002,
        1.68861913294,
        1.4538806289400001,
        1.75364369094,
        1.39984022294,
        1.37943018094
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.51148561804,
      "stddev": 0.15385745071764056,
      "median": 1.43218475744,
      "user": 1.15698852,
      "system": 1.2510362,
      "min": 1.36915515994,
      "max": 1.73692240194,
      "times": [
        1.3843587609399999,
        1.38155274194,
        1.5846201069399999,
        1.73692240194,
        1.4690188849399999,
        1.36915515994,
        1.72625550494,
        1.39535062994,
        1.67727384994,
        1.39034813894
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 263.1 ± 11.6 246.0 280.3 1.01 ± 0.05
pacquet@main 260.5 ± 6.7 252.3 274.7 1.00
pnpr@HEAD 287.2 ± 16.9 273.1 325.3 1.10 ± 0.07
pnpr@main 280.3 ± 9.7 266.2 298.3 1.08 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2630544972,
      "stddev": 0.011625040134223615,
      "median": 0.2642847849,
      "user": 0.21660917999999998,
      "system": 0.5237677799999999,
      "min": 0.2460321234,
      "max": 0.2802864934,
      "times": [
        0.2646919354,
        0.2623290314,
        0.2791590634,
        0.2652209414,
        0.2471045704,
        0.2460321234,
        0.2679264724,
        0.2539167064,
        0.2638776344,
        0.2802864934
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.2604502239,
      "stddev": 0.0067215342833385275,
      "median": 0.2603624619,
      "user": 0.21225298,
      "system": 0.5498394799999999,
      "min": 0.2522857974,
      "max": 0.2746680134,
      "times": [
        0.2620645634,
        0.2746680134,
        0.2593048224,
        0.2583311404,
        0.2614201014,
        0.2540004334,
        0.2663695834,
        0.26250629540000003,
        0.2535514884,
        0.2522857974
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.2872251646,
      "stddev": 0.01686933173523829,
      "median": 0.27961148339999997,
      "user": 0.24856968000000004,
      "system": 0.53165938,
      "min": 0.2730833734,
      "max": 0.3252841134,
      "times": [
        0.3252841134,
        0.3066665604,
        0.2892185064,
        0.2803256374,
        0.2779572414,
        0.2912981794,
        0.2788973294,
        0.2742261224,
        0.2730833734,
        0.2752945824
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.28029284790000003,
      "stddev": 0.009652793376484637,
      "median": 0.2797223724,
      "user": 0.22599418,
      "system": 0.5252009799999999,
      "min": 0.2661614304,
      "max": 0.2982644524,
      "times": [
        0.2763071164,
        0.2821996624,
        0.2797836574,
        0.2676361744,
        0.2661614304,
        0.29029637340000003,
        0.2982644524,
        0.2772224694,
        0.2853960554,
        0.2796610874
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.800 ± 0.032 2.744 2.870 1.67 ± 0.14
pacquet@main 2.792 ± 0.026 2.730 2.826 1.66 ± 0.14
pnpr@HEAD 1.681 ± 0.141 1.466 1.858 1.00
pnpr@main 1.768 ± 0.154 1.519 1.910 1.05 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.80030193136,
      "stddev": 0.03200112486098057,
      "median": 2.80066243826,
      "user": 1.8501271799999994,
      "system": 1.35696796,
      "min": 2.74425027626,
      "max": 2.86991717226,
      "times": [
        2.74425027626,
        2.80149516526,
        2.78907953826,
        2.81040174126,
        2.86991717226,
        2.80179515926,
        2.81867430226,
        2.79982971126,
        2.77624499326,
        2.79133125426
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.7922678797600007,
      "stddev": 0.026184092994733177,
      "median": 2.79388963226,
      "user": 1.8295917800000001,
      "system": 1.3130062599999999,
      "min": 2.72975992926,
      "max": 2.8261569582600004,
      "times": [
        2.79242393926,
        2.80065025526,
        2.82119019626,
        2.77897347626,
        2.79646977026,
        2.79535532526,
        2.72975992926,
        2.8261569582600004,
        2.79089913226,
        2.79079981526
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6811163756600003,
      "stddev": 0.14139510324928256,
      "median": 1.67876504726,
      "user": 1.16616388,
      "system": 1.29536766,
      "min": 1.4656216072600001,
      "max": 1.85848072426,
      "times": [
        1.62520736326,
        1.4656216072600001,
        1.76578923626,
        1.50915933426,
        1.85848072426,
        1.59754914226,
        1.81813730526,
        1.8436527762600001,
        1.59524353626,
        1.73232273126
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.7676459678600005,
      "stddev": 0.15362180143730295,
      "median": 1.83903636876,
      "user": 1.21646718,
      "system": 1.2994517599999997,
      "min": 1.5187721542600001,
      "max": 1.9095130282600001,
      "times": [
        1.87867998726,
        1.84753019926,
        1.8722032852600001,
        1.83054253826,
        1.8774576282600002,
        1.9095130282600001,
        1.5187721542600001,
        1.54304703226,
        1.8109457902600001,
        1.58776803526
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 619.2 ± 15.1 596.3 644.4 1.98 ± 0.08
pacquet@main 620.4 ± 50.4 553.9 701.7 1.99 ± 0.17
pnpr@HEAD 315.7 ± 13.3 300.0 346.2 1.01 ± 0.05
pnpr@main 312.2 ± 9.7 298.6 328.3 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6191565195400001,
      "stddev": 0.01506543139959873,
      "median": 0.6231182642400002,
      "user": 0.75132072,
      "system": 0.70383544,
      "min": 0.5962595462400001,
      "max": 0.6443582732400001,
      "times": [
        0.6066479452400001,
        0.6288139572400001,
        0.6270319252400001,
        0.6443582732400001,
        0.6217835932400001,
        0.6045191822400001,
        0.6315406142400001,
        0.5962595462400001,
        0.6061572232400001,
        0.6244529352400001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.6204023236400001,
      "stddev": 0.05043910156145752,
      "median": 0.6132202977400001,
      "user": 0.76457272,
      "system": 0.69304804,
      "min": 0.5538648182400001,
      "max": 0.70172312824,
      "times": [
        0.59387708524,
        0.5541461982400001,
        0.5980208892400001,
        0.63185505624,
        0.6906587472400001,
        0.70172312824,
        0.65343671824,
        0.6137940662400001,
        0.6126465292400001,
        0.5538648182400001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31568550064,
      "stddev": 0.013321914164567161,
      "median": 0.31496672224,
      "user": 0.21826901999999998,
      "system": 0.53761144,
      "min": 0.30002336224,
      "max": 0.34624743224,
      "times": [
        0.31154718624,
        0.30301649124,
        0.32547619424,
        0.30466346924,
        0.30002336224,
        0.31778846524,
        0.34624743224,
        0.31735212324,
        0.31815896124,
        0.31258132124
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.3121671228399999,
      "stddev": 0.009725621995574075,
      "median": 0.31067179924,
      "user": 0.19851151999999997,
      "system": 0.54662864,
      "min": 0.29860978224,
      "max": 0.32830395324,
      "times": [
        0.30979471024,
        0.31339150524,
        0.29860978224,
        0.30639777024,
        0.30339846024,
        0.32247157324,
        0.31154888824,
        0.32329470024,
        0.32830395324,
        0.30445988524
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.947 ± 0.049 1.898 2.072 6.09 ± 0.25
pacquet@main 1.954 ± 0.038 1.911 2.014 6.12 ± 0.23
pnpr@HEAD 0.320 ± 0.010 0.304 0.331 1.00
pnpr@main 0.350 ± 0.020 0.318 0.380 1.09 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.94663691998,
      "stddev": 0.04865289611321852,
      "median": 1.9302339344800001,
      "user": 1.0049413,
      "system": 0.80183108,
      "min": 1.89801659998,
      "max": 2.0723467269799998,
      "times": [
        1.97404410898,
        1.9225037499800002,
        2.0723467269799998,
        1.95334311798,
        1.92693502998,
        1.9335328389800002,
        1.89801659998,
        1.94021132098,
        1.9252768909800002,
        1.9201588149800002
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.9544069928799996,
      "stddev": 0.03759722593764571,
      "median": 1.94282005198,
      "user": 1.0675113999999999,
      "system": 0.7660998799999998,
      "min": 1.91066473898,
      "max": 2.01434205598,
      "times": [
        2.0076118689799998,
        1.94464566998,
        1.9230524079800002,
        1.91066473898,
        1.94099443398,
        1.9525373029800002,
        1.9326412129800001,
        1.92265392798,
        1.99492630898,
        2.01434205598
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3195182416800001,
      "stddev": 0.010095746716079502,
      "median": 0.31800157198,
      "user": 0.22004649999999998,
      "system": 0.53454728,
      "min": 0.30353011398,
      "max": 0.33073151398,
      "times": [
        0.32982470898,
        0.31608184198,
        0.33073151398,
        0.30462569398,
        0.33048826798000003,
        0.31914962198,
        0.30353011398,
        0.31685352198,
        0.32727529498,
        0.31662183698
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.34957826278000004,
      "stddev": 0.01976916761401596,
      "median": 0.35083038698,
      "user": 0.22885300000000003,
      "system": 0.58122458,
      "min": 0.31757565098,
      "max": 0.37992780298,
      "times": [
        0.31757565098,
        0.37251791698000003,
        0.35141572798000004,
        0.32910783098,
        0.36735230098,
        0.37992780298,
        0.33358182598,
        0.35129772498,
        0.34264279698,
        0.35036304898000004
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 416.1 ± 21.3 386.9 445.9 4.48 ± 0.30
pacquet@main 387.5 ± 11.5 375.2 409.6 4.17 ± 0.22
pnpr@HEAD 92.9 ± 4.1 85.3 104.3 1.00
pnpr@main 95.9 ± 3.8 89.2 104.0 1.03 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.41609096144,
      "stddev": 0.021267355599627998,
      "median": 0.41355488813999997,
      "user": 0.40814504000000007,
      "system": 0.0671882,
      "min": 0.38687976614,
      "max": 0.44586788214,
      "times": [
        0.38687976614,
        0.43523543514,
        0.43834685614,
        0.44586788214,
        0.40964886114,
        0.40665739514,
        0.43367161314,
        0.39613099614,
        0.39100989414000004,
        0.41746091514
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.38752117314,
      "stddev": 0.011486291584705679,
      "median": 0.38433086764,
      "user": 0.38081964,
      "system": 0.0624506,
      "min": 0.37519323714,
      "max": 0.40963363214000004,
      "times": [
        0.37680922614,
        0.38659580214,
        0.40963363214000004,
        0.38064968914,
        0.38359907614,
        0.38506265914,
        0.39698598514,
        0.40167127714,
        0.37901114714,
        0.37519323714
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09291154007939394,
      "stddev": 0.004070659214302664,
      "median": 0.09216956314000001,
      "user": 0.023764121818181824,
      "system": 0.011669284848484847,
      "min": 0.08533431714,
      "max": 0.10427159414,
      "times": [
        0.08533431714,
        0.08758291614000001,
        0.08675742314000001,
        0.08645260114,
        0.08672951114,
        0.08916612414000001,
        0.09510032514000001,
        0.09877535714,
        0.09464275414000001,
        0.09014950414,
        0.09474606914000001,
        0.09565498914000001,
        0.09827223114000001,
        0.09197172114,
        0.09172457514000001,
        0.09099790914000001,
        0.09108682614000001,
        0.09631879614000001,
        0.09518748814000001,
        0.09601484414000001,
        0.09593742914,
        0.09562386014,
        0.09493054614,
        0.09200294914000001,
        0.09462056214,
        0.09700693014,
        0.09289193114000001,
        0.08994196314000001,
        0.09191742814000001,
        0.09094443814000001,
        0.09216956314000001,
        0.09115534514000001,
        0.10427159414
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.09589119389,
      "stddev": 0.003782366077782399,
      "median": 0.09556365164,
      "user": 0.02501919,
      "system": 0.01229965,
      "min": 0.08918524014000001,
      "max": 0.10397246214000001,
      "times": [
        0.09871226814,
        0.10252217414,
        0.09980822014000001,
        0.09575040814,
        0.09432557814,
        0.09142540314000001,
        0.09673411814,
        0.08918524014000001,
        0.09253484014,
        0.09212962714,
        0.09460254914,
        0.09268702614,
        0.09508770114000001,
        0.09356657114000001,
        0.09570667514,
        0.09689769514,
        0.09290689914000001,
        0.09007464214000001,
        0.09542062814,
        0.09979785914000001,
        0.09714804714000001,
        0.09585560514000001,
        0.09332818114000001,
        0.10331116714000001,
        0.10397246214000001,
        0.09991744514,
        0.09445086314000001,
        0.09709353414
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.650 ± 0.175 4.462 4.968 1.30 ± 0.05
pacquet@main 4.550 ± 0.088 4.477 4.750 1.27 ± 0.04
pnpr@HEAD 3.589 ± 0.071 3.505 3.746 1.00
pnpr@main 3.614 ± 0.118 3.497 3.907 1.01 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.649978240380001,
      "stddev": 0.17459236333778863,
      "median": 4.6029142829800005,
      "user": 2.1855143599999995,
      "system": 1.6219838799999997,
      "min": 4.462027640480001,
      "max": 4.967906617480001,
      "times": [
        4.934559661480001,
        4.602523184480001,
        4.51424717348,
        4.53100702548,
        4.5267139514800006,
        4.63940555048,
        4.718086217480001,
        4.967906617480001,
        4.60330538148,
        4.462027640480001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.5498953037800005,
      "stddev": 0.08833830751848544,
      "median": 4.5163551574800005,
      "user": 2.01355106,
      "system": 1.6015505800000003,
      "min": 4.47709475048,
      "max": 4.750230897480001,
      "times": [
        4.520503665480001,
        4.47709475048,
        4.4780731004800005,
        4.554837362480001,
        4.61618594848,
        4.61824255748,
        4.49060896848,
        4.750230897480001,
        4.480969137480001,
        4.51220664948
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5888584264800003,
      "stddev": 0.0707672864753933,
      "median": 3.59164888198,
      "user": 1.4205217599999997,
      "system": 1.35033748,
      "min": 3.50528759648,
      "max": 3.74582715848,
      "times": [
        3.58904487448,
        3.50776281648,
        3.59425288948,
        3.59728161648,
        3.52066949048,
        3.62052379248,
        3.5857562394799998,
        3.74582715848,
        3.62217779048,
        3.50528759648
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.6143624368799996,
      "stddev": 0.11808715181254958,
      "median": 3.5954070269800003,
      "user": 1.5556767599999997,
      "system": 1.58599018,
      "min": 3.49667207148,
      "max": 3.9068395104799998,
      "times": [
        3.9068395104799998,
        3.62524202548,
        3.58216438548,
        3.66333708348,
        3.55875250248,
        3.60864966848,
        3.49667207148,
        3.50386871748,
        3.65714726248,
        3.54095114148
      ]
    }
  ]
}

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13233
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,744.25 ms
(-3.10%)Baseline: 2,832.13 ms
3,398.56 ms
(80.75%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,898.02 ms
(-4.23%)Baseline: 1,981.93 ms
2,378.31 ms
(79.81%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
596.26 ms
(-9.36%)Baseline: 657.85 ms
789.42 ms
(75.53%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
386.88 ms
(-2.06%)Baseline: 395.03 ms
474.03 ms
(81.61%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,385.00 ms
(-1.70%)Baseline: 2,426.33 ms
2,911.60 ms
(81.91%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,462.03 ms
(-0.51%)Baseline: 4,484.87 ms
5,381.85 ms
(82.91%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
246.03 ms
(-11.26%)Baseline: 277.26 ms
332.71 ms
(73.95%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13233
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,465.62 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
303.53 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
300.02 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
85.33 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,356.07 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,505.29 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
273.08 ms
🐰 View full continuous benchmarking report in Bencher

@zkochan
zkochan merged commit c3c3e6b into main Jul 23, 2026
35 checks passed
@zkochan
zkochan deleted the fix-13232 branch July 23, 2026 14:04
zkochan added a commit that referenced this pull request Jul 24, 2026
… pnpm

Three gaps in what the two clients tell the pnpr server, all of the same
shape: a field the request omits is not defaulted server-side but cleared,
so the server resolves under inputs the user never chose.

pacquet never sent `catalogs`. The workspace the server reconstructs from
the request has no catalog sections of its own, so every `catalog:`
specifier failed with "No catalog entry ... was found for catalog
'default'." — the bug #13233 fixed for the TypeScript client and
the server, leaving the Rust client behind. The catalogs are picked the
same way the local install picks them: an updateConfig hook's set when it
produced one, otherwise the workspace-manifest read. Reading only
`config.catalogs` is not enough — it is None unless a hook ran, which the
new end-to-end test catches.

The TypeScript client never sent `frozenLockfile` / `preferFrozenLockfile`,
so the server always reuse-and-updated and `--frozen-lockfile` silently
resolved and rewrote the lockfile it promises to leave alone. Since
frozenLockfile defaults to true on CI, this changes CI behavior: an
out-of-date lockfile now fails instead of being updated in place.

Tests assert what actually goes over the wire, since a silently missing
field is the failure mode: a mockito body matcher for the Rust client and
an end-to-end catalog install against a real pnpr for the CLI.
zkochan added a commit that referenced this pull request Jul 25, 2026
… catalogs, resolution mode) (#13279)

pnpr resolves and enforces policy server-side, and neither client runs its own
verifyLockfileResolutions when a pnpr server is configured. The server assigns
each field from the request unconditionally, so a field a client omits is cleared
rather than defaulted, and the server resolves under inputs the user never chose.

The TypeScript client sent only minimumReleaseAge of the verification policy, so
minimumReleaseAgeExclude entries stopped applying and the input-lockfile verifier
could reject a lockfile whose entries the user had explicitly excluded. It also
never sent the resolution mode, so --frozen-lockfile silently resolved and rewrote
the lockfile it promises to leave alone.

pacquet never sent catalogs, so every catalog: specifier failed to resolve — the
bug #13233 fixed for the TypeScript client and the server, leaving the Rust client
behind.

Drop the TRUST_POLICY_INCOMPATIBLE_WITH_PNPR guard, written before the server
gained trust-policy enforcement and refusing an install pacquet runs happily.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm 11.15.1 PNPR: catalog: in overrides fails with "No catalog entry … for catalog 'default'" despite entry existing

3 participants