Skip to content

feat(cli): warn about install settings left under package.json's pnpm field - #13359

Merged
zkochan merged 3 commits into
mainfrom
feat-legacy-pnpm-field-warning
Jul 25, 2026
Merged

zkochan merged 3 commits into
mainfrom
feat-legacy-pnpm-field-warning

Conversation

@zkochan

@zkochan zkochan commented Jul 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes item 1 of #13315 — pnpm 12 gave no warning when package.json still declared install settings under the pnpm field.

pnpm 10 moved those settings into pnpm-workspace.yaml, and pnpm 11 warns about every migrated key a manifest still carries so the setting is not silently dropped. pacquet ignored the field without a word, so a repository that had not migrated its pnpm.overrides met only the downstream symptom: a resolution that quietly disregarded the override. The issue calls this "the difference that matters most in practice" of the three it lists.

Using the fixture from the issue:

# before
Lockfile is up to date, resolution step is skipped
Packages: +2

# after — matching pnpm 11 byte for byte
[WARN] The "pnpm" field in package.json is no longer read by pnpm. The following keys were ignored: "pnpm.overrides". See https://pnpm.io/settings for the new home of each setting.
Lockfile is up to date, resolution step is skipped
Packages: +2

The port already existed — this wires it up

pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs was already in the tree with the same 19-key migrated list as config/reader/src/index.ts (I diffed the two sets: zero difference), the same message text, and unit tests for declaration order, an unowned key (app), and the absent / malformed / non-object manifest cases.

It was never declared as a module, so nothing compiled it and nothing called it. In the interest of full disclosure: it reached main through my own #13299, where a git add pnpm/crates swept in two files that had nothing to do with that PR. It should have been reviewed as this change, so it is being reviewed as this change now.

Where the warning is emitted

In derive_config_root_and_package_manager_to_sync, which:

  • every install-family dispatch already calls (install, add, update, ci, remove, rebuild, install-test, and the three patch commands — one site covers all ten),
  • computes the same directory pnpm reads the root manifest from (workspaceDir ?? dir, pnpm's rootProjectManifestDir),
  • runs before any install output, so the warning lands first as it does in pnpm.

pnpm emits this from config-reading, so it fires for every command that loads config. The install family is where it is observable and where the issue reports it; extending it further can follow if it turns out to matter.

One install can finish without reaching that site: finished_via_up_to_date_fast_path completes a repeat pnpm install from main, before the async machinery exists, so an up-to-date project stayed silent (found in review). pnpm keeps warning on that run — it warns from config-reading, ahead of "Already up to date" — so the fast path now warns from its deciding branch, after install_already_up_to_date confirms it will finish and before its own output. Warning at its config-load site instead would double-print, since every earlier return false hands the command to the full install path.

The warning takes the parsed manifest rather than a directory (found in review). derive_config_root_and_package_manager_to_sync reads the root package.json once, through read_manifest_json, and hands the value to the warning and to package_manager_to_sync alike — one read where there were two, and the read strips a UTF-8 BOM, which a bare serde_json::from_slice had been choking on where pnpm warns. The fast path reads config_root's manifest through that same reader rather than reusing the dir/package.json it already holds: those are the same file only by an invariant that lives in another function.

Verification

Against the issue's own fixture, pnpm 11 and pacquet now produce an identical line. Also checked that a pnpm field holding only an unowned key (app), and a manifest with no pnpm field at all, both stay quiet — and that pnpm add warns too, since it shares the emit site.

Four end-to-end tests cover the warning, the silent case, the up-to-date fast path, and a run from inside a workspace package; the position tests assert the warning's offset relative to the command's own output, not just its presence. The workspace test discriminates by key — overrides at the root, neverBuiltDependencies in the package — so reading the wrong manifest fails it instead of producing a lookalike warning. I confirmed each of them genuinely catches its regression by breaking the subject and watching it fail. A unit test covers the BOM, checked against pnpm 11 on the same manifest.

just ready (7087 tests), just dylint, and the CI doc command are all clean.

One thing noticed, not changed

pnpm 11 writes this warning to stderr; pacquet writes it to stdout. Filed as #13361 rather than fixed here, since it needs a config-warning channel that bypasses the reporter.

Narrower than it first looks, and I initially described it too broadly: reporter warnings already agree between the stacks — pnpm install --force prints its warning on stdout in pnpm 11 too. The difference is confined to warnings pnpm raises while reading config, which it prints with console.warn (stderr) outside the reporter entirely. pacquet has no such channel, so this one goes through LogEvent::Global and lands in the reporter's stdout frame.

Squash Commit Body

pnpm 10 moved the install settings out of package.json's `pnpm` field
into pnpm-workspace.yaml, and pnpm warns about every migrated key a
manifest still declares so the setting is not silently dropped. pacquet
ignored the field without a word, so a project that had not migrated its
`pnpm.overrides` met only the downstream symptom.

`legacy_pnpm_field` already carried the port — the same 19-key migrated
list as config/reader/src/index.ts, the same message, and unit tests —
but was never declared as a module, so nothing compiled or called it.

The emit sits in `derive_config_root_and_package_manager_to_sync`, which
every install-family command already calls to resolve its root and which
computes the same directory pnpm reads the root manifest from. One site
covers all ten commands, and it runs before any install output so the
warning lands first, as in pnpm. The repeat-install fast path finishes
before that site is reached, so it warns from its deciding branch too.

The emit takes the parsed manifest, so that site reads the root
`package.json` once and shares it with `package_manager_to_sync`,
through the reader that strips a UTF-8 BOM.

Closes item 1 of pnpm/pnpm#13315.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
    (TypeScript already emits this warning; this is the pacquet side.)
  • 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.

Written by an agent (Claude Code, claude-opus-5[1m]).


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

Summary by CodeRabbit

  • New Features
    • Added warnings when legacy pnpm settings in package.json are no longer read, directing users to migrate to pnpm-workspace.yaml.
  • Bug Fixes
    • Ensures the warning is emitted on lockfile-only and “already up to date” flows (before the “Already up to date” message).
    • Correctly bases the warning on the workspace root manifest when running inside a workspace package.
    • Avoids reporting unrelated keys under the pnpm field.
  • Tests
    • Added regression coverage for migrated, unrelated, workspace-scope, and lockfile-only scenarios.

… field

pnpm 10 moved the install settings out of `package.json`'s `pnpm` field
into `pnpm-workspace.yaml`, and pnpm warns about every migrated key a
manifest still declares so the setting is not silently dropped. pacquet
ignored the field without a word, so a project that had not migrated its
`pnpm.overrides` met only the downstream symptom — a resolution that
quietly disregarded the override.

`legacy_pnpm_field` already carried the port: the same 19-key migrated
list as `config/reader/src/index.ts`, the same message text, and unit
tests for declaration order, an unowned key (`app`), and the
absent/malformed/non-object manifest cases. It was never declared as a
module, so nothing compiled or called it. This wires it up.

The emit sits in `derive_config_root_and_package_manager_to_sync`, which
every install-family command already calls to resolve its root and which
computes the same directory pnpm reads the root manifest from
(`workspaceDir ?? dir`). One site therefore covers install, add, update,
ci, remove, rebuild, install-test, and the three patch commands, and it
runs before any install output, so the warning lands first as it does in
pnpm.

Verified against the fixture in #13315: pnpm 11 and pacquet now
emit a byte-identical warning naming `"pnpm.overrides"`, and a manifest
whose `pnpm` field holds only an unowned key stays quiet.

Closes item 1 of #13315.

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

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 25, 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: bf66d272-0366-45f8-af2d-926f127ccabe

📥 Commits

Reviewing files that changed from the base of the PR and between ff53713 and a209abe.

📒 Files selected for processing (1)
  • pnpm/crates/cli/tests/install.rs

📝 Walkthrough

Walkthrough

The Rust CLI warns when migrated pnpm settings remain in package.json, propagates reporter context across install-related commands, handles the up-to-date fast path, and adds workspace-root regression tests plus a patch changeset.

Changes

Legacy pnpm field warning

Layer / File(s) Summary
Warning implementation
pnpm/crates/cli/src/cli_args.rs, pnpm/crates/cli/src/cli_args/pipelines.rs
Registers the legacy pnpm field module and emits warnings through the active reporter during configuration derivation.
Reporter propagation
pnpm/crates/cli/src/cli_args/dispatch_install.rs
Passes reporter context from add, update, remove, install, deploy, dedupe, prune, and unlink into configuration derivation.
Fast-path handling and regression coverage
pnpm/crates/cli/src/cli_args/install.rs, pnpm/crates/cli/tests/install.rs, .changeset/pacquet-legacy-pnpm-field-warning.md
Emits warnings before “Already up to date” output, validates migrated and unrelated keys, checks workspace-root behavior, and records a patch release entry.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLICommand
  participant ConfigPipeline
  participant WarningHelper
  participant Reporter
  CLICommand->>ConfigPipeline: pass reporter during config derivation
  ConfigPipeline->>WarningHelper: inspect config_root for migrated pnpm fields
  WarningHelper->>Reporter: emit ignored-field warning
  CLICommand->>WarningHelper: check fields on up-to-date fast path
  WarningHelper->>Reporter: emit warning before status output
Loading

Possibly related issues

Suggested labels: product: pacquet

Suggested reviewers: copilot, aqeelat, 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 feat-legacy-pnpm-field-warning

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

Warn when package.json#pnpm still contains migrated install settings

✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Emit pnpm-compatible warning when migrated settings remain under package.json.pnpm.
• Wire warning into install-family root/config derivation so it prints before install output.
• Add end-to-end coverage ensuring migrated keys warn and third-party keys stay quiet.
Diagram

graph TD
  A["Install-family command"] --> B["derive_config_root..."] --> C["Warn legacy pnpm field"] --> D["Read root package.json"] --> E["Reporter emit"] --> F["Continue install pipeline"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Warn during general config loading (all commands)
  • ➕ Matches pnpm more closely if pnpm warns for any command that loads config
  • ➕ Catches users even when they don't run install-family commands
  • ➖ Broader behavioral change and higher risk of noisy warnings in unrelated commands
  • ➖ Requires identifying/standardizing the earliest config-read path and reporter availability
2. Warn only in `install` entrypoint (not shared root derivation)
  • ➕ Narrower surface area; minimizes signature churn
  • ➖ Would miss add/update/remove/dedupe/prune/... which are install-family and should behave consistently
  • ➖ Likely duplicates logic across multiple command paths
3. Parse once during `State::init` / manifest load and cache ignored keys
  • ➕ Avoids repeated manifest reads if root derivation is called multiple times
  • ➕ Centralizes manifest inspection
  • ➖ More invasive refactor of initialization boundaries
  • ➖ Harder to guarantee the warning prints before any install output in all paths

Recommendation: Current approach is a good tradeoff: a single shared call-site (derive_config_root_and_package_manager_to_sync) covers the full install family and has the necessary context (root dir + reporter sink) to emit the warning early, matching pnpm’s UX. Consider expanding to non-install commands later only if real-world reports show the warning is being missed.

Files changed (5) +89 / -9

Enhancement (3) +22 / -9
cli_args.rsExpose 'legacy_pnpm_field' module to CLI crate +1/-0

Expose 'legacy_pnpm_field' module to CLI crate

• Declares the previously-unwired 'legacy_pnpm_field' module so it is compiled and available to be called from the CLI pipelines.

pnpm/crates/cli/src/cli_args.rs

dispatch_install.rsThread reporter into shared root/config derivation +8/-8

Thread reporter into shared root/config derivation

• Updates install-family dispatch paths to pass the active 'ReporterType' into 'derive_config_root_and_package_manager_to_sync', enabling early warning emission in a single shared location.

pnpm/crates/cli/src/cli_args/dispatch_install.rs

pipelines.rsEmit legacy pnpm-field warning during config-root derivation +13/-1

Emit legacy pnpm-field warning during config-root derivation

• Extends 'derive_config_root_and_package_manager_to_sync' to call 'warn_ignored_pnpm_manifest_fields' using 'reporter_emit(reporter)' before computing package-manager sync policy, ensuring the warning appears before install output.

pnpm/crates/cli/src/cli_args/pipelines.rs

Tests (1) +62 / -0
install.rsAdd integration tests for legacy 'pnpm' manifest-field warning +62/-0

Add integration tests for legacy 'pnpm' manifest-field warning

• Adds install-flow tests asserting a verbatim pnpm-compatible warning when migrated keys (e.g., 'overrides') appear under 'package.json.pnpm', and asserting no warning when only third-party keys (e.g., 'app') are present.

pnpm/crates/cli/tests/install.rs

Documentation (1) +5 / -0
pacquet-legacy-pnpm-field-warning.mdAdd changeset for legacy 'package.json.pnpm' warning +5/-0

Add changeset for legacy 'package.json.pnpm' warning

• Introduces a patch changeset documenting the new warning behavior and clarifying that only pnpm-migrated keys are reported while third-party keys are ignored.

.changeset/pacquet-legacy-pnpm-field-warning.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

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

Inline comments:
In `@pnpm/crates/cli/tests/install.rs`:
- Around line 1673-1685: Strengthen the assertion in the install test around the
warning string so it also verifies the warning appears before a stable
normal-install output marker. Preserve the exact warning-content check, and
compare the warning and install-marker positions (or reporter event order) to
enforce the CLI output sequence.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0badb6e9-6929-4ea7-86ff-4ab0656f8ff7

📥 Commits

Reviewing files that changed from the base of the PR and between b4032e8 and 250837f.

📒 Files selected for processing (5)
  • .changeset/pacquet-legacy-pnpm-field-warning.md
  • pnpm/crates/cli/src/cli_args.rs
  • pnpm/crates/cli/src/cli_args/dispatch_install.rs
  • pnpm/crates/cli/src/cli_args/pipelines.rs
  • pnpm/crates/cli/tests/install.rs

Comment thread pnpm/crates/cli/tests/install.rs Resolved
@greptile-apps

greptile-apps Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported fast-path omission is fixed: a successful synchronous repeat install emits the warning before returning, while unsuccessful probes continue to the full path that emits it there, so no blocking failure remains.

Reviews (3): Last reviewed commit: "test(cli): pin the legacy pnpm-field war..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.00     11.4±0.02ms    33.0 MB/sec    1.00     11.4±0.03ms    32.8 MB/sec
packument/parse                1.00     37.4±0.09µs  1772.2 MB/sec    1.04     39.1±0.15µs  1697.0 MB/sec
tarball/download_dependency    1.00      2.3±0.04ms  1915.4 KB/sec    1.06      2.4±0.06ms  1811.1 KB/sec

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Context used
✅ Compliance rules (platform): 24 rules

Grey Divider


Action required

1. Wrong manifest on fast-path ✗ Dismissed 🐞 Bug ≡ Correctness
Description
finished_via_up_to_date_fast_path() emits the legacy pnpm-field warning by reading package.json
under config_root, but install_already_up_to_date() can discover a different workspace root when
invoked from a workspace subpackage. This can suppress the warning for root-level migrated settings
(or warn for a leaf package) on the “Already up to date” path.
Code

pnpm/crates/cli/src/cli_args/install.rs[351]

+        warn_ignored_pnpm_manifest_fields(&config_root, emit);
Relevance

⭐⭐⭐ High

Team often fixes workspace-root/path correctness issues; precedent accepts correcting directory
anchoring in workspaces.

PR-#13202
PR-#13177

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The fast-path uses config.workspace_dir (or current dir) as the warning root, while the up-to-date
detector can discover a different workspace root from the manifest’s directory; therefore the
warning can read the wrong package.json when invoked from a subpackage.

pnpm/crates/cli/src/cli_args/install.rs[323-352]
pnpm/crates/package-manager/src/install.rs[3649-3652]
pnpm/crates/package-manager/src/install.rs[3947-3954]
pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs[41-66]

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

## Issue description
On the up-to-date fast path, the warning reads `package.json` from `config_root` (`config.workspace_dir` or the current `dir`). However, the up-to-date check can *discover* a different workspace root (via `find_workspace_dir`) and returns it as `workspace_root`, so the warning may inspect the wrong manifest when `pnpm install` is run from a workspace subpackage.

## Issue Context
`install_already_up_to_date()` derives `workspace_root` using `configured_or_discovered_workspace_dir(config, manifest_dir)`, so `workspace_root` may be a parent directory even if `config.workspace_dir` is `None`. The fast-path already has `workspace_root` in hand.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/install.rs[323-362]

### Suggested change
- Replace `warn_ignored_pnpm_manifest_fields(&config_root, emit);` with `warn_ignored_pnpm_manifest_fields(&workspace_root, emit);` so the warning targets the same root the install logic uses.
- (Optional but recommended) Add/adjust a test that runs `install` from a workspace subpackage where only the workspace-root `package.json` contains `pnpm.overrides`, and assert the warning still appears on the fast path.

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



Remediation recommended

2. Unnecessary full install 🐞 Bug ➹ Performance ⭐ New
Description
The test only asserts warning text but runs a regular pnpm install from the workspace leaf, doing
extra install work that isn’t needed for the assertion.
Code

pnpm/crates/cli/tests/install.rs[1761]

+    let assert = pacquet_in(&package_dir).with_arg("install").assert().success();
Relevance

⭐⭐⭐ High

Tests often use --lockfile-only when asserting output; changing should reduce work without altering
contract.

PR-#13299

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The test’s assertions only inspect the emitted warning text and do not validate any installed
artifacts, so a lockfile-only invocation is sufficient and avoids extra work.

pnpm/crates/cli/tests/install.rs[1761-1772]

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 `migrated_keys_are_read_from_the_workspace_root()` asserts only on stdout containing/omitting specific warning strings, but it currently runs a normal `install`.

### Issue Context
This is an integration-test hot path (it runs in CI and locally). Minimizing `install` work improves test suite runtime and reduces filesystem side effects.

### Fix Focus Areas
- pnpm/crates/cli/tests/install.rs[1761-1772]

### Suggested fix
- Change the invocation to something like:
 - `pacquet_in(&package_dir).with_args(["install", "--lockfile-only"])...`
- Keep the same stdout assertions; the warning should still be emitted on the early install path while avoiding unnecessary node_modules/materialization work.

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


3. Non-hermetic install test 🐞 Bug ☼ Reliability ⭐ New
Description
migrated_keys_are_read_from_the_workspace_root() constructs its own pnpm-workspace.yaml and runs
pnpm install without the test harness’ mocked-registry/store setup, so behavior/output can vary
with ambient pnpm config and machine state.
Code

pnpm/crates/cli/tests/install.rs[R1734-1762]

+    let CommandTempCwd { root, workspace, .. } = CommandTempCwd::init();
+    fs::write(workspace.join("pnpm-workspace.yaml"), "packages:\n  - packages/*\n")
+        .expect("write pnpm-workspace.yaml");
+    fs::write(
+        workspace.join("package.json"),
+        serde_json::json!({
+            "name": "root",
+            "version": "1.0.0",
+            "private": true,
+            "pnpm": { "overrides": { "is-number": "6.0.0" } },
+        })
+        .to_string(),
+    )
+    .expect("write package.json");
+    let package_dir = workspace.join("packages").join("leaf");
+    fs::create_dir_all(&package_dir).expect("create the workspace package");
+    fs::write(
+        package_dir.join("package.json"),
+        serde_json::json!({
+            "name": "leaf",
+            "version": "1.0.0",
+            "pnpm": { "neverBuiltDependencies": [] },
+        })
+        .to_string(),
+    )
+    .expect("write the workspace package's package.json");
+
+    let assert = pacquet_in(&package_dir).with_arg("install").assert().success();
+    let stdout = String::from_utf8_lossy(&assert.get_output().stdout).into_owned();
Relevance

⭐⭐ Medium

Repo values hermetic tests, but similar “use standard mocked-registry harness” suggestion was
previously rejected.

PR-#13287
PR-#13250

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new test builds a workspace and runs install using CommandTempCwd::init() and pacquet_in()
without any registry/store/cache pinning. The harness provides add_mocked_registry() specifically
to set storeDir/cacheDir and a mocked registry, and even writes pnpm-workspace.yaml for
hermeticity; pacquet_in() itself adds no env overrides.

pnpm/crates/cli/tests/install.rs[1734-1762]
pnpm/crates/testing-utils/src/bin.rs[23-42]
pnpm/crates/testing-utils/src/bin.rs[58-117]
pnpm/crates/cli/tests/_utils/mod.rs[22-28]

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 `migrated_keys_are_read_from_the_workspace_root()` uses `CommandTempCwd::init()` and writes a minimal `pnpm-workspace.yaml`, then runs `pnpm install` from a subpackage. Unlike most install tests, it does not use `add_mocked_registry()` (or an equivalent isolation), so it can inherit ambient pnpm configuration (store/cache/GVS settings) and be less reproducible.

### Issue Context
The repo already has a standard helper (`CommandTempCwd::add_mocked_registry`) that pins registry + store/cache and writes a workspace YAML specifically because pnpm reads those settings from `pnpm-workspace.yaml`.

### Fix Focus Areas
- pnpm/crates/cli/tests/install.rs[1734-1762]

### Suggested fix
- Change the test to use `CommandTempCwd::init().add_mocked_registry()`.
- Preserve the hermetic `pnpm-workspace.yaml` contents written by the helper (storeDir/cacheDir/enableGlobalVirtualStore), and *append* the `packages:` workspace section instead of replacing the file with a minimal one.
- Keep invoking the install from `package_dir` as today to retain coverage of “run from workspace leaf uses root manifest for warning”.

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


4. BOM suppresses warning 🐞 Bug ≡ Correctness
Description
derive_config_root_and_package_manager_to_sync now emits the legacy pnpm-field warning, but the
warning helper parses package.json with serde_json::from_slice and does not strip a UTF-8 BOM, so
BOM-prefixed manifests that the rest of the CLI accepts will silently skip the warning.
Code

pnpm/crates/cli/src/cli_args/pipelines.rs[R610-616]

+    reporter: ReporterType,
) -> miette::Result<(PathBuf, Option<PackageManagerToSync>)> {
    let config_root = cfg.workspace_dir.clone().unwrap_or_else(|| dir_ref.to_path_buf());
+    // pnpm warns from config-reading, so the notice lands ahead of any
+    // install output. This is the install family's earliest point that
+    // knows the root manifest's directory.
+    warn_ignored_pnpm_manifest_fields(&config_root, reporter_emit(reporter));
Relevance

⭐⭐⭐ High

Matches repo’s pattern of fixing inconsistent/fragile JSON parsing paths; prevents BOM-related parse
failure.

PR-#13202

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The newly-wired warning is emitted from pipelines.rs, and its implementation currently parses raw
bytes with serde_json directly. The repository’s manifest parser explicitly strips BOMs because
serde_json rejects them, so this creates an inconsistency where the warning path fails while other
manifest-reading paths succeed.

pnpm/crates/cli/src/cli_args/pipelines.rs[607-620]
pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs[57-66]
pnpm/crates/package-manifest/src/lib.rs[852-867]

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

### Issue description
The new warning path reads `package.json` bytes and parses them via `serde_json::from_slice`. `serde_json` rejects a leading UTF-8 BOM, but the repo’s canonical manifest parsing explicitly strips BOMs. As a result, the warning can be skipped for manifests that the rest of pacquet/pnpm logic would otherwise read successfully.

### Issue Context
`derive_config_root_and_package_manager_to_sync` now calls `warn_ignored_pnpm_manifest_fields(...)` before proceeding to other work.

### Fix Focus Areas
- pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs[57-66]
- pnpm/crates/cli/src/cli_args/pipelines.rs[607-620]

### Suggested fix
In `legacy_pnpm_field.rs`, route parsing through the repo’s BOM-tolerant manifest parser (e.g. `pacquet_package_manifest::parse_manifest_bytes(&bytes)`) or strip `b"\xEF\xBB\xBF"` before calling `serde_json::from_slice`.

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


View more (2)
5. pnpm 10 moved comment 📘 Rule violation ⚙ Maintainability
Description
New doc comments in the Rust install tests describe behavior using historical phrasing (`pnpm 10
moved ...`), which can become stale and violates the requirement to document current behavior only.
Code

pnpm/crates/cli/tests/install.rs[R1649-1656]

+/// pnpm 10 moved the install settings out of `package.json`'s `pnpm`
+/// field into `pnpm-workspace.yaml`, and warns about every migrated key
+/// a manifest still declares so the setting isn't silently dropped.
+/// A repository that hasn't migrated its `pnpm.overrides` would
+/// otherwise see only the downstream symptom.
+///
+/// The message is asserted verbatim: it is the same string pnpm emits,
+/// and `@pnpm/cli.default-reporter` renders it.
Relevance

⭐⭐⭐ High

Strong precedent: team accepts rewriting comments/tests to avoid historical phrasing and comment
drift.

PR-#13138
PR-#13246
PR-#13244

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 772199 forbids historical phrasing in comments/docstrings. The added test doc comment
explicitly references past behavior/version migration (pnpm 10 moved ...), rather than stating the
current behavior contract being tested.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/cli/tests/install.rs[1649-1656]

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 newly added doc comment in `pnpm/crates/cli/tests/install.rs` uses historical phrasing (e.g., referencing `pnpm 10` and what it moved), which violates the rule that comments must describe current behavior, not prior implementations.

## Issue Context
This is a test doc comment; it should explain the current contract being asserted (warning behavior and message expectations) without tying the explanation to a past version migration narrative.

## Fix Focus Areas
- pnpm/crates/cli/tests/install.rs[1649-1656]

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


6. Duplicate package.json parsing 🐞 Bug ➹ Performance
Description
The new warning adds an extra fs read + JSON parse of the root package.json immediately before
package_manager_to_sync reads/parses the same file again, adding avoidable overhead on every
install/add/update/remove/dedupe/prune invocation.
Code

pnpm/crates/cli/src/cli_args/pipelines.rs[R612-619]

    let config_root = cfg.workspace_dir.clone().unwrap_or_else(|| dir_ref.to_path_buf());
+    // pnpm warns from config-reading, so the notice lands ahead of any
+    // install output. This is the install family's earliest point that
+    // knows the root manifest's directory.
+    warn_ignored_pnpm_manifest_fields(&config_root, reporter_emit(reporter));
    let package_manager_to_sync =
        package_manager_to_sync(&config_root.join("package.json"), &config_root)
            .wrap_err("read package manager policy")?;
Relevance

⭐⭐ Medium

Perf-only duplicate parse removal is plausible, but similar “reduce duplication/optimize reads”
often rejected as non-essential.

PR-#13207
PR-#13150

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new call site invokes the warning helper before package_manager_to_sync. The helper
reads/parses package.json itself, while package_manager_to_sync reads/parses package.json
again via read_manifest_json, creating back-to-back redundant work.

pnpm/crates/cli/src/cli_args/pipelines.rs[607-620]
pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs[57-72]
pnpm/crates/cli/src/cli_args/package_manager.rs[27-61]

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

### Issue description
`derive_config_root_and_package_manager_to_sync` now calls `warn_ignored_pnpm_manifest_fields(&config_root, ...)`, which reads and parses `config_root/package.json`. Immediately after, it calls `package_manager_to_sync(&config_root.join("package.json"), ...)`, which reads and parses the same file again. This adds redundant IO and parsing on a very frequently executed CLI path.

### Issue Context
The warning only needs the root manifest’s `pnpm` object keys; `package_manager_to_sync` also needs the parsed manifest.

### Fix Focus Areas
- pnpm/crates/cli/src/cli_args/pipelines.rs[607-620]
- pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs[41-72]
- pnpm/crates/cli/src/cli_args/package_manager.rs[27-61]

### Suggested fix
Parse `package.json` once in `derive_config_root_and_package_manager_to_sync` and share the parsed `serde_json::Value`:
- Change `warn_ignored_pnpm_manifest_fields` (or add a sibling helper) to accept `&serde_json::Value` (or `Option<&Value>`) instead of re-reading the file.
- Add an overload/variant of `package_manager_to_sync` that accepts a pre-parsed manifest, or refactor the existing function to take the manifest value when already available.
This removes the second filesystem read+parse while keeping behavior the same.

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



Informational

7. Redundant fast-path manifest IO 🐞 Bug ➹ Performance
Description
The up-to-date fast path already reads/parses package.json into a PackageManifest, but
warn_ignored_pnpm_manifest_fields() re-reads and re-parses package.json again before emitting
“Already up to date”. This adds extra filesystem I/O and JSON parsing to a hot path.
Code

pnpm/crates/cli/src/cli_args/install.rs[351]

+        warn_ignored_pnpm_manifest_fields(&config_root, emit);
Relevance

⭐ Low

Similar “avoid extra parsing/IO on hot path” micro-optimizations were explicitly rejected as not
worth complexity.

PR-#13150
PR-#13297

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The fast-path reads package.json via PackageManifest::from_path, and the warning helper then reads
and parses package.json again using std::fs::read + serde_json::from_slice.

pnpm/crates/cli/src/cli_args/install.rs[327-352]
pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs[41-63]
pnpm/crates/package-manifest/src/lib.rs[160-175]

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 fast path calls `PackageManifest::from_path(...)` and later calls `warn_ignored_pnpm_manifest_fields(...)`, which does its own `std::fs::read(.../package.json)` + `serde_json::from_slice(...)`. On the “Already up to date” path this is redundant work.

## Issue Context
This matters most when the fast path runs frequently (repeat installs) and/or on slower filesystems/large manifests. The optimization needs to be compatible with the correct root selection (see workspace-root mismatch issue).

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/install.rs[327-352]
- pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs[41-72]

### Suggested change
- Add an overload/helper that accepts a parsed `serde_json::Value` or a `&PackageManifest` and computes ignored keys from `manifest.value()`.
- In `finished_via_up_to_date_fast_path`, when the warning should target the same manifest already parsed (e.g., when `workspace_root == manifest.path().parent()`), reuse the existing parsed manifest instead of re-reading from disk; otherwise fall back to reading `workspace_root/package.json`.

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


8. Changeset missing pnpm bump 📘 Rule violation § Compliance
Description
The newly added changeset declares a bump for pacquet but does not include a pnpm entry as
required by the changeset compliance rule, which can lead to incorrect release/versioning metadata.
Code

.changeset/pacquet-legacy-pnpm-field-warning.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

⭐ Low

Analogous “add pnpm entry to pacquet changeset” compliance suggestions repeatedly rejected in recent
PRs.

PR-#12995
PR-#13091
PR-#13059

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires each added/modified changeset to include an explicit pnpm entry
with a correct bump type. The new changeset front-matter includes only pacquet and omits pnpm.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/pacquet-legacy-pnpm-field-warning.md[1-3]

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

## Issue description
The new changeset file does not declare a bump entry for the `pnpm` package.

## Issue Context
Compliance requires changeset front-matter to include an explicit `pnpm` package entry with a valid bump type (`patch`/`minor`/`major`).

## Fix Focus Areas
- .changeset/pacquet-legacy-pnpm-field-warning.md[1-3]

ⓘ 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 a209abe

Results up to commit 250837f ⚖️ Balanced


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


Remediation recommended
1. pnpm 10 moved comment 📘 Rule violation ⚙ Maintainability
Description
New doc comments in the Rust install tests describe behavior using historical phrasing (`pnpm 10
moved ...`), which can become stale and violates the requirement to document current behavior only.
Code

pnpm/crates/cli/tests/install.rs[R1649-1656]

+/// pnpm 10 moved the install settings out of `package.json`'s `pnpm`
+/// field into `pnpm-workspace.yaml`, and warns about every migrated key
+/// a manifest still declares so the setting isn't silently dropped.
+/// A repository that hasn't migrated its `pnpm.overrides` would
+/// otherwise see only the downstream symptom.
+///
+/// The message is asserted verbatim: it is the same string pnpm emits,
+/// and `@pnpm/cli.default-reporter` renders it.
Relevance

⭐⭐⭐ High

Strong precedent: team accepts rewriting comments/tests to avoid historical phrasing and comment
drift.

PR-#13138
PR-#13246
PR-#13244

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 772199 forbids historical phrasing in comments/docstrings. The added test doc comment
explicitly references past behavior/version migration (pnpm 10 moved ...), rather than stating the
current behavior contract being tested.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/cli/tests/install.rs[1649-1656]

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 newly added doc comment in `pnpm/crates/cli/tests/install.rs` uses historical phrasing (e.g., referencing `pnpm 10` and what it moved), which violates the rule that comments must describe current behavior, not prior implementations.

## Issue Context
This is a test doc comment; it should explain the current contract being asserted (warning behavior and message expectations) without tying the explanation to a past version migration narrative.

## Fix Focus Areas
- pnpm/crates/cli/tests/install.rs[1649-1656]

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


2. BOM suppresses warning 🐞 Bug ≡ Correctness
Description
derive_config_root_and_package_manager_to_sync now emits the legacy pnpm-field warning, but the
warning helper parses package.json with serde_json::from_slice and does not strip a UTF-8 BOM, so
BOM-prefixed manifests that the rest of the CLI accepts will silently skip the warning.
Code

pnpm/crates/cli/src/cli_args/pipelines.rs[R610-616]

+    reporter: ReporterType,
) -> miette::Result<(PathBuf, Option<PackageManagerToSync>)> {
    let config_root = cfg.workspace_dir.clone().unwrap_or_else(|| dir_ref.to_path_buf());
+    // pnpm warns from config-reading, so the notice lands ahead of any
+    // install output. This is the install family's earliest point that
+    // knows the root manifest's directory.
+    warn_ignored_pnpm_manifest_fields(&config_root, reporter_emit(reporter));
Relevance

⭐⭐⭐ High

Matches repo’s pattern of fixing inconsistent/fragile JSON parsing paths; prevents BOM-related parse
failure.

PR-#13202

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The newly-wired warning is emitted from pipelines.rs, and its implementation currently parses raw
bytes with serde_json directly. The repository’s manifest parser explicitly strips BOMs because
serde_json rejects them, so this creates an inconsistency where the warning path fails while other
manifest-reading paths succeed.

pnpm/crates/cli/src/cli_args/pipelines.rs[607-620]
pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs[57-66]
pnpm/crates/package-manifest/src/lib.rs[852-867]

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

### Issue description
The new warning path reads `package.json` bytes and parses them via `serde_json::from_slice`. `serde_json` rejects a leading UTF-8 BOM, but the repo’s canonical manifest parsing explicitly strips BOMs. As a result, the warning can be skipped for manifests that the rest of pacquet/pnpm logic would otherwise read successfully.

### Issue Context
`derive_config_root_and_package_manager_to_sync` now calls `warn_ignored_pnpm_manifest_fields(...)` before proceeding to other work.

### Fix Focus Areas
- pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs[57-66]
- pnpm/crates/cli/src/cli_args/pipelines.rs[607-620]

### Suggested fix
In `legacy_pnpm_field.rs`, route parsing through the repo’s BOM-tolerant manifest parser (e.g. `pacquet_package_manifest::parse_manifest_bytes(&bytes)`) or strip `b"\xEF\xBB\xBF"` before calling `serde_json::from_slice`.

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


3. Duplicate package.json parsing 🐞 Bug ➹ Performance
Description
The new warning adds an extra fs read + JSON parse of the root package.json immediately before
package_manager_to_sync reads/parses the same file again, adding avoidable overhead on every
install/add/update/remove/dedupe/prune invocation.
Code

pnpm/crates/cli/src/cli_args/pipelines.rs[R612-619]

    let config_root = cfg.workspace_dir.clone().unwrap_or_else(|| dir_ref.to_path_buf());
+    // pnpm warns from config-reading, so the notice lands ahead of any
+    // install output. This is the install family's earliest point that
+    // knows the root manifest's directory.
+    warn_ignored_pnpm_manifest_fields(&config_root, reporter_emit(reporter));
    let package_manager_to_sync =
        package_manager_to_sync(&config_root.join("package.json"), &config_root)
            .wrap_err("read package manager policy")?;
Relevance

⭐⭐ Medium

Perf-only duplicate parse removal is plausible, but similar “reduce duplication/optimize reads”
often rejected as non-essential.

PR-#13207
PR-#13150

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new call site invokes the warning helper before package_manager_to_sync. The helper
reads/parses package.json itself, while package_manager_to_sync reads/parses package.json
again via read_manifest_json, creating back-to-back redundant work.

pnpm/crates/cli/src/cli_args/pipelines.rs[607-620]
pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs[57-72]
pnpm/crates/cli/src/cli_args/package_manager.rs[27-61]

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

### Issue description
`derive_config_root_and_package_manager_to_sync` now calls `warn_ignored_pnpm_manifest_fields(&config_root, ...)`, which reads and parses `config_root/package.json`. Immediately after, it calls `package_manager_to_sync(&config_root.join("package.json"), ...)`, which reads and parses the same file again. This adds redundant IO and parsing on a very frequently executed CLI path.

### Issue Context
The warning only needs the root manifest’s `pnpm` object keys; `package_manager_to_sync` also needs the parsed manifest.

### Fix Focus Areas
- pnpm/crates/cli/src/cli_args/pipelines.rs[607-620]
- pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs[41-72]
- pnpm/crates/cli/src/cli_args/package_manager.rs[27-61]

### Suggested fix
Parse `package.json` once in `derive_config_root_and_package_manager_to_sync` and share the parsed `serde_json::Value`:
- Change `warn_ignored_pnpm_manifest_fields` (or add a sibling helper) to accept `&serde_json::Value` (or `Option<&Value>`) instead of re-reading the file.
- Add an overload/variant of `package_manager_to_sync` that accepts a pre-parsed manifest, or refactor the existing function to take the manifest value when already available.
This removes the second filesystem read+parse while keeping behavior the same.

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



Informational
4. Changeset missing pnpm bump 📘 Rule violation § Compliance
Description
The newly added changeset declares a bump for pacquet but does not include a pnpm entry as
required by the changeset compliance rule, which can lead to incorrect release/versioning metadata.
Code

.changeset/pacquet-legacy-pnpm-field-warning.md[R1-3]

+---
+"pacquet": patch
+---
Relevance

⭐ Low

Analogous “add pnpm entry to pacquet changeset” compliance suggestions repeatedly rejected in recent
PRs.

PR-#12995
PR-#13091
PR-#13059

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713436 requires each added/modified changeset to include an explicit pnpm entry
with a correct bump type. The new changeset front-matter includes only pacquet and omits pnpm.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/pacquet-legacy-pnpm-field-warning.md[1-3]

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

## Issue description
The new changeset file does not declare a bump entry for the `pnpm` package.

## Issue Context
Compliance requires changeset front-matter to include an explicit `pnpm` package entry with a valid bump type (`patch`/`minor`/`major`).

## Fix Focus Areas
- .changeset/pacquet-legacy-pnpm-field-warning.md[1-3]

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


Results up to commit ff53713 ⚖️ Balanced


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


Action required
1. Wrong manifest on fast-path ✗ Dismissed 🐞 Bug ≡ Correctness
Description
finished_via_up_to_date_fast_path() emits the legacy pnpm-field warning by reading package.json
under config_root, but install_already_up_to_date() can discover a different workspace root when
invoked from a workspace subpackage. This can suppress the warning for root-level migrated settings
(or warn for a leaf package) on the “Already up to date” path.
Code

pnpm/crates/cli/src/cli_args/install.rs[351]

+        warn_ignored_pnpm_manifest_fields(&config_root, emit);
Relevance

⭐⭐⭐ High

Team often fixes workspace-root/path correctness issues; precedent accepts correcting directory
anchoring in workspaces.

PR-#13202
PR-#13177

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The fast-path uses config.workspace_dir (or current dir) as the warning root, while the up-to-date
detector can discover a different workspace root from the manifest’s directory; therefore the
warning can read the wrong package.json when invoked from a subpackage.

pnpm/crates/cli/src/cli_args/install.rs[323-352]
pnpm/crates/package-manager/src/install.rs[3649-3652]
pnpm/crates/package-manager/src/install.rs[3947-3954]
pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs[41-66]

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

## Issue description
On the up-to-date fast path, the warning reads `package.json` from `config_root` (`config.workspace_dir` or the current `dir`). However, the up-to-date check can *discover* a different workspace root (via `find_workspace_dir`) and returns it as `workspace_root`, so the warning may inspect the wrong manifest when `pnpm install` is run from a workspace subpackage.

## Issue Context
`install_already_up_to_date()` derives `workspace_root` using `configured_or_discovered_workspace_dir(config, manifest_dir)`, so `workspace_root` may be a parent directory even if `config.workspace_dir` is `None`. The fast-path already has `workspace_root` in hand.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/install.rs[323-362]

### Suggested change
- Replace `warn_ignored_pnpm_manifest_fields(&config_root, emit);` with `warn_ignored_pnpm_manifest_fields(&workspace_root, emit);` so the warning targets the same root the install logic uses.
- (Optional but recommended) Add/adjust a test that runs `install` from a workspace subpackage where only the workspace-root `package.json` contains `pnpm.overrides`, and assert the warning still appears on the fast path.

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



Informational
2. Redundant fast-path manifest IO 🐞 Bug ➹ Performance
Description
The up-to-date fast path already reads/parses package.json into a PackageManifest, but
warn_ignored_pnpm_manifest_fields() re-reads and re-parses package.json again before emitting
“Already up to date”. This adds extra filesystem I/O and JSON parsing to a hot path.
Code

pnpm/crates/cli/src/cli_args/install.rs[351]

+        warn_ignored_pnpm_manifest_fields(&config_root, emit);
Relevance

⭐ Low

Similar “avoid extra parsing/IO on hot path” micro-optimizations were explicitly rejected as not
worth complexity.

PR-#13150
PR-#13297

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The fast-path reads package.json via PackageManifest::from_path, and the warning helper then reads
and parses package.json again using std::fs::read + serde_json::from_slice.

pnpm/crates/cli/src/cli_args/install.rs[327-352]
pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs[41-63]
pnpm/crates/package-manifest/src/lib.rs[160-175]

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 fast path calls `PackageManifest::from_path(...)` and later calls `warn_ignored_pnpm_manifest_fields(...)`, which does its own `std::fs::read(.../package.json)` + `serde_json::from_slice(...)`. On the “Already up to date” path this is redundant work.

## Issue Context
This matters most when the fast path runs frequently (repeat installs) and/or on slower filesystems/large manifests. The optimization needs to be compatible with the correct root selection (see workspace-root mismatch issue).

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/install.rs[327-352]
- pnpm/crates/cli/src/cli_args/legacy_pnpm_field.rs[41-72]

### Suggested change
- Add an overload/helper that accepts a parsed `serde_json::Value` or a `&PackageManifest` and computes ignored keys from `manifest.value()`.
- In `finished_via_up_to_date_fast_path`, when the warning should target the same manifest already parsed (e.g., when `workspace_root == manifest.path().parent()`), reuse the existing parsed manifest instead of re-reading from disk; otherwise fall back to reading `workspace_root/package.json`.

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

@codecov-commenter

codecov-commenter commented Jul 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.22%. Comparing base (68adca9) to head (a209abe).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13359      +/-   ##
==========================================
+ Coverage   87.06%   87.22%   +0.16%     
==========================================
  Files         535      537       +2     
  Lines       91916    92080     +164     
==========================================
+ Hits        80023    80314     +291     
+ Misses      11893    11766     -127     

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

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

@github-actions

github-actions Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: a209abeb06ca

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.457 ± 0.116 2.369 2.701 1.62 ± 0.20
pacquet@main 2.564 ± 0.167 2.360 2.820 1.69 ± 0.22
pnpr@HEAD 1.514 ± 0.172 1.354 1.790 1.00
pnpr@main 1.514 ± 0.132 1.364 1.671 1.00 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.4570711962400003,
      "stddev": 0.11636905882636667,
      "median": 2.4093668303400007,
      "user": 1.57583282,
      "system": 1.34596782,
      "min": 2.36917395234,
      "max": 2.7008057423400005,
      "times": [
        2.3902237143400002,
        2.36917395234,
        2.4492171803400002,
        2.3695271103400004,
        2.6405373073400003,
        2.43801423434,
        2.4147033833400005,
        2.39447906034,
        2.7008057423400005,
        2.4040302773400004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.56361667694,
      "stddev": 0.167195834329853,
      "median": 2.5589832078400003,
      "user": 1.5760626199999999,
      "system": 1.31638992,
      "min": 2.3599924743400003,
      "max": 2.8204366883400005,
      "times": [
        2.7914224563400003,
        2.8204366883400005,
        2.6440889063400004,
        2.6483343023400003,
        2.4939273133400004,
        2.3599924743400003,
        2.3981627473400002,
        2.3736055023400002,
        2.6240391023400003,
        2.48215727634
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5142408568399999,
      "stddev": 0.17218144901672822,
      "median": 1.43920788734,
      "user": 1.07566812,
      "system": 1.12998002,
      "min": 1.35440325334,
      "max": 1.79032978734,
      "times": [
        1.37509818334,
        1.79032978734,
        1.42480171734,
        1.40488239034,
        1.4594382263399999,
        1.77516791434,
        1.39731851634,
        1.35440325334,
        1.45361405734,
        1.70735452234
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.51439165154,
      "stddev": 0.1320505853976208,
      "median": 1.5523170683399998,
      "user": 1.06664192,
      "system": 1.15799092,
      "min": 1.36389563834,
      "max": 1.67131567434,
      "times": [
        1.36757121034,
        1.37164538434,
        1.36389563834,
        1.37183693634,
        1.67131567434,
        1.58247963334,
        1.5427042203399999,
        1.56192991634,
        1.65819649934,
        1.65234140234
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 263.9 ± 11.5 246.2 277.9 1.00 ± 0.05
pacquet@main 263.3 ± 6.5 252.8 274.6 1.00
pnpr@HEAD 281.2 ± 5.8 273.8 292.5 1.07 ± 0.03
pnpr@main 282.6 ± 6.3 276.1 292.8 1.07 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.26390069562,
      "stddev": 0.011475597767126365,
      "median": 0.26196727502000006,
      "user": 0.21071578,
      "system": 0.5300862000000001,
      "min": 0.24619390652000003,
      "max": 0.27787091852,
      "times": [
        0.24619390652000003,
        0.25152353152,
        0.25839274352,
        0.25521762752000005,
        0.26095826952,
        0.27787091852,
        0.27624022752000005,
        0.26297628052000005,
        0.27186009652000004,
        0.27777335452
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.26332044672,
      "stddev": 0.00649697177701023,
      "median": 0.26478538102000004,
      "user": 0.22702477999999998,
      "system": 0.5392634,
      "min": 0.25283836552000005,
      "max": 0.27461793452000005,
      "times": [
        0.26701009652,
        0.27461793452000005,
        0.26399305952,
        0.26819022652,
        0.26598920852,
        0.25283836552000005,
        0.26124472052000003,
        0.25530539352000003,
        0.26557770252,
        0.25843775952000003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.28121423402,
      "stddev": 0.005766326206862344,
      "median": 0.28049083002,
      "user": 0.21425608000000002,
      "system": 0.5758161,
      "min": 0.27375775952000003,
      "max": 0.29248857152,
      "times": [
        0.27382932552000006,
        0.28527713352,
        0.27375775952000003,
        0.28674802152,
        0.28047828152000004,
        0.28103697652000004,
        0.27758049852000005,
        0.28044239352000006,
        0.28050337852,
        0.29248857152
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.28264657642,
      "stddev": 0.006303021309864753,
      "median": 0.27962669852,
      "user": 0.23685968000000002,
      "system": 0.5449112,
      "min": 0.27606496752000004,
      "max": 0.29276538552000003,
      "times": [
        0.29276538552000003,
        0.29055572252,
        0.28363763852,
        0.27827174352,
        0.28002447452,
        0.27884942652000005,
        0.29041199052000005,
        0.27922892252000003,
        0.27665549252000005,
        0.27606496752000004
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.801 ± 0.026 2.771 2.854 1.76 ± 0.18
pacquet@main 2.794 ± 0.012 2.781 2.820 1.76 ± 0.18
pnpr@HEAD 1.591 ± 0.166 1.427 1.854 1.00
pnpr@main 1.641 ± 0.141 1.441 1.813 1.03 ± 0.14
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.8010446044599995,
      "stddev": 0.02611248616917914,
      "median": 2.79920733486,
      "user": 1.74750916,
      "system": 1.3390799999999996,
      "min": 2.77083215536,
      "max": 2.8540150503599997,
      "times": [
        2.77926014036,
        2.78777894836,
        2.8540150503599997,
        2.77256492736,
        2.80999325836,
        2.8233565443599997,
        2.78925875236,
        2.77083215536,
        2.81423035036,
        2.80915591736
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.79383363186,
      "stddev": 0.012152885121549264,
      "median": 2.7906591818599997,
      "user": 1.7668701599999999,
      "system": 1.355629,
      "min": 2.78052758436,
      "max": 2.81986268636,
      "times": [
        2.80385329336,
        2.8010248723599998,
        2.81986268636,
        2.78052758436,
        2.7909752643599997,
        2.78419326636,
        2.79034309936,
        2.79817249536,
        2.78810535436,
        2.78127840236
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.59073027286,
      "stddev": 0.16566333211284245,
      "median": 1.54207431136,
      "user": 1.0237589599999999,
      "system": 1.1805554999999999,
      "min": 1.4268975293600001,
      "max": 1.85424686336,
      "times": [
        1.7561206163600003,
        1.4361397793600001,
        1.60970229336,
        1.7814333083600002,
        1.85424686336,
        1.47444632936,
        1.4354315323600002,
        1.4268975293600001,
        1.6757986553600002,
        1.45708582136
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.6413262341600003,
      "stddev": 0.14133015876617203,
      "median": 1.67927631386,
      "user": 1.04606076,
      "system": 1.1718085999999999,
      "min": 1.44092069836,
      "max": 1.8132598383600003,
      "times": [
        1.73635195336,
        1.4964516813600002,
        1.5423902793600002,
        1.8132598383600003,
        1.6702135603600001,
        1.78594773136,
        1.46912559936,
        1.7702619323600002,
        1.68833906736,
        1.44092069836
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 608.5 ± 19.8 572.5 648.1 1.95 ± 0.08
pacquet@main 603.3 ± 20.5 578.7 638.7 1.94 ± 0.08
pnpr@HEAD 311.6 ± 6.8 304.9 328.4 1.00 ± 0.03
pnpr@main 311.6 ± 6.5 302.5 321.3 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.60851352284,
      "stddev": 0.019791766363286112,
      "median": 0.60387552404,
      "user": 0.7351363,
      "system": 0.71533028,
      "min": 0.57252881904,
      "max": 0.64814995004,
      "times": [
        0.59998906504,
        0.60944448304,
        0.60525537004,
        0.60104900304,
        0.62820276104,
        0.64814995004,
        0.60210934104,
        0.61591075804,
        0.60249567804,
        0.57252881904
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.60325184274,
      "stddev": 0.02046038853042637,
      "median": 0.6028796670400001,
      "user": 0.728246,
      "system": 0.6988157799999999,
      "min": 0.57873401304,
      "max": 0.63874781204,
      "times": [
        0.61245036704,
        0.58593338904,
        0.57873401304,
        0.60942282204,
        0.62773565204,
        0.63874781204,
        0.61428328104,
        0.59633651204,
        0.58256768604,
        0.5863068930399999
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31158480354000007,
      "stddev": 0.0068246940483257315,
      "median": 0.30983386854000006,
      "user": 0.19681539999999997,
      "system": 0.56445698,
      "min": 0.30492695804000003,
      "max": 0.32844374304,
      "times": [
        0.30863421304000005,
        0.30963883604000003,
        0.31002890104,
        0.30492695804000003,
        0.30859055104000005,
        0.32844374304,
        0.30518666704,
        0.31143731604,
        0.31660539404000004,
        0.31235545604000003
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.31157352634,
      "stddev": 0.0064626637767735825,
      "median": 0.31042062504,
      "user": 0.1975604,
      "system": 0.55714638,
      "min": 0.30250794004000003,
      "max": 0.32128096404000006,
      "times": [
        0.32128096404000006,
        0.30259910004,
        0.30777216904000004,
        0.31064890004,
        0.31019235004,
        0.30250794004000003,
        0.31609066404,
        0.30969046404000006,
        0.31546581804,
        0.31948689404
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.931 ± 0.016 1.910 1.958 6.18 ± 0.14
pacquet@main 1.925 ± 0.010 1.911 1.938 6.17 ± 0.14
pnpr@HEAD 0.312 ± 0.007 0.304 0.323 1.00
pnpr@main 0.316 ± 0.008 0.302 0.326 1.01 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.9305348169600003,
      "stddev": 0.01648124486447288,
      "median": 1.92977737976,
      "user": 0.9878315599999998,
      "system": 0.77078704,
      "min": 1.9096815257600002,
      "max": 1.95816192276,
      "times": [
        1.9258377607600001,
        1.95816192276,
        1.9289281337600002,
        1.9096815257600002,
        1.91295576576,
        1.93062662576,
        1.9350965487600003,
        1.93109453676,
        1.9162216997600001,
        1.9567436497600001
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.9254337540600002,
      "stddev": 0.009680024304254563,
      "median": 1.92681326776,
      "user": 0.97919126,
      "system": 0.7750054399999999,
      "min": 1.9112937637600003,
      "max": 1.9382334487600001,
      "times": [
        1.9117343047600002,
        1.9272520747600002,
        1.9314936987600002,
        1.9304430087600002,
        1.93802667876,
        1.9112937637600003,
        1.92086614276,
        1.9263744607600002,
        1.9382334487600001,
        1.9186199587600001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.31214018086000006,
      "stddev": 0.006669975862317742,
      "median": 0.31100575176000006,
      "user": 0.20651455999999996,
      "system": 0.55153604,
      "min": 0.30412482176000005,
      "max": 0.32272485076,
      "times": [
        0.30438857776000006,
        0.30893353176000005,
        0.30922347876000006,
        0.30412482176000005,
        0.32174474476000003,
        0.32272485076,
        0.31474436176000004,
        0.31278802476000006,
        0.30664310576000003,
        0.31608631076000004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.31600697966,
      "stddev": 0.008250999977580617,
      "median": 0.31663703926000003,
      "user": 0.19814655999999997,
      "system": 0.56947164,
      "min": 0.30168896076,
      "max": 0.32598699776000006,
      "times": [
        0.31215120576000005,
        0.31744299776,
        0.30667352276000004,
        0.32598699776000006,
        0.31029284476,
        0.31583108076000005,
        0.32416109676000004,
        0.32507639176,
        0.32076469776000005,
        0.30168896076
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 366.5 ± 18.2 351.2 413.9 4.21 ± 0.23
pacquet@main 362.1 ± 11.4 344.8 376.2 4.16 ± 0.16
pnpr@HEAD 87.4 ± 1.7 83.5 91.3 1.00 ± 0.03
pnpr@main 87.1 ± 1.9 82.8 91.1 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.3664929267,
      "stddev": 0.018174659891440126,
      "median": 0.36276086920000006,
      "user": 0.3649534200000001,
      "system": 0.05210412,
      "min": 0.3511912522,
      "max": 0.4139487672,
      "times": [
        0.36450881220000003,
        0.3691446162,
        0.36844085120000003,
        0.3721238892,
        0.36101292620000003,
        0.3548353382,
        0.35621819320000003,
        0.3535046212,
        0.4139487672,
        0.3511912522
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.3621244657,
      "stddev": 0.011435207162448854,
      "median": 0.3670784232,
      "user": 0.34711192,
      "system": 0.06523682,
      "min": 0.3448173032,
      "max": 0.3761993362,
      "times": [
        0.3673439832,
        0.3501390692,
        0.3669911292,
        0.3448173032,
        0.3464573432,
        0.3681729642,
        0.3750433292,
        0.3589144822,
        0.3671657172,
        0.3761993362
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08742256857500001,
      "stddev": 0.0017194740344256012,
      "median": 0.08745568270000001,
      "user": 0.019959557500000003,
      "system": 0.0097818575,
      "min": 0.0834516292,
      "max": 0.09126258520000001,
      "times": [
        0.0872460382,
        0.08697463720000001,
        0.0859499172,
        0.0910389642,
        0.0834516292,
        0.0884910342,
        0.08578617820000001,
        0.0886595412,
        0.0885766652,
        0.0868106772,
        0.0873995972,
        0.08686150420000001,
        0.08560506720000001,
        0.0871719682,
        0.0876430352,
        0.0875197732,
        0.08792262320000001,
        0.0861243552,
        0.08822100520000001,
        0.0882528742,
        0.08585193120000001,
        0.08728177520000001,
        0.0883857262,
        0.08774230420000001,
        0.0859016652,
        0.0906311052,
        0.0848963702,
        0.09126258520000001,
        0.0884154412,
        0.08892797820000001,
        0.08500645920000001,
        0.0875117682
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08708262142580644,
      "stddev": 0.0019338673720038083,
      "median": 0.0871897522,
      "user": 0.02019786193548387,
      "system": 0.009510116129032256,
      "min": 0.0828278652,
      "max": 0.0910746212,
      "times": [
        0.0910746212,
        0.0879452242,
        0.0883617302,
        0.0873366292,
        0.0854923242,
        0.08697450620000001,
        0.0892867422,
        0.08719687520000001,
        0.0864830412,
        0.0871897522,
        0.0881461032,
        0.0862723432,
        0.0865614792,
        0.0828278652,
        0.0837070302,
        0.08811189920000001,
        0.0868827342,
        0.0856382592,
        0.0903489532,
        0.0876983502,
        0.0853555662,
        0.0897505662,
        0.0847513382,
        0.0864701252,
        0.0877685822,
        0.08807456920000001,
        0.0851203832,
        0.08781955920000001,
        0.0904207692,
        0.0846998612,
        0.08579348120000001
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.623 ± 0.171 4.445 4.831 1.31 ± 0.06
pacquet@main 4.566 ± 0.124 4.444 4.781 1.30 ± 0.04
pnpr@HEAD 3.528 ± 0.130 3.447 3.875 1.00 ± 0.04
pnpr@main 3.522 ± 0.071 3.443 3.635 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.623455356860001,
      "stddev": 0.1710997861447682,
      "median": 4.59679057416,
      "user": 1.763916,
      "system": 1.3882599800000002,
      "min": 4.44515526766,
      "max": 4.83078766066,
      "times": [
        4.48612133766,
        4.83078766066,
        4.73721326566,
        4.44944474966,
        4.80267266166,
        4.70745981066,
        4.46899177566,
        4.82913043866,
        4.47757660066,
        4.44515526766
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.565983381960001,
      "stddev": 0.12391658373352922,
      "median": 4.52574584066,
      "user": 1.7445770999999997,
      "system": 1.4111656799999999,
      "min": 4.44398459266,
      "max": 4.78107737666,
      "times": [
        4.78107737666,
        4.45963127166,
        4.76375455066,
        4.45984868066,
        4.63105393266,
        4.51458396166,
        4.53690771966,
        4.44398459266,
        4.48131896066,
        4.5876727726599995
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.5280053179600004,
      "stddev": 0.1297165871210838,
      "median": 3.47670537116,
      "user": 1.1708927999999998,
      "system": 1.2805822799999997,
      "min": 3.44742508166,
      "max": 3.87477167266,
      "times": [
        3.53457364966,
        3.87477167266,
        3.46163958166,
        3.44742508166,
        3.4904837346599997,
        3.5952089366599997,
        3.4592725026599997,
        3.48528223466,
        3.46812850766,
        3.46326727766
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.52181561416,
      "stddev": 0.07080729964397063,
      "median": 3.49058915216,
      "user": 1.2163094999999997,
      "system": 1.23636258,
      "min": 3.44291673766,
      "max": 3.63530584966,
      "times": [
        3.47320502166,
        3.50680254866,
        3.57814130066,
        3.45238943366,
        3.5642921686599998,
        3.47437575566,
        3.44291673766,
        3.61703380466,
        3.63530584966,
        3.47369352066
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13359
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,770.83 ms
(+1.30%)Baseline: 2,735.15 ms
3,282.18 ms
(84.42%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,909.68 ms
(+1.01%)Baseline: 1,890.52 ms
2,268.62 ms
(84.18%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
572.53 ms
(-0.25%)Baseline: 573.96 ms
688.75 ms
(83.13%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
351.19 ms
(+1.59%)Baseline: 345.70 ms
414.83 ms
(84.66%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,369.17 ms
(+0.23%)Baseline: 2,363.64 ms
2,836.37 ms
(83.53%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,445.16 ms
(+0.37%)Baseline: 4,428.80 ms
5,314.56 ms
(83.64%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
246.19 ms
(-0.02%)Baseline: 246.24 ms
295.49 ms
(83.32%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13359
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,426.90 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
304.12 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
304.93 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
83.45 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,354.40 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,447.43 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
273.76 ms
🐰 View full continuous benchmarking report in Bencher

A plain `pnpm install` whose lockfile and `node_modules` are already
current finishes in `finished_via_up_to_date_fast_path`, before the async
install machinery — and therefore before
`derive_config_root_and_package_manager_to_sync`, where the warning about
migrated keys left under `package.json`'s `pnpm` field is emitted. A
project that had not migrated its `pnpm.overrides` saw only
"Already up to date" on every repeat install.

pnpm warns from config-reading, so it warns on that run too: verified
against pnpm 11, which prints the warning ahead of "Already up to date"
on both the first and the second install of the same fixture.

The emit sits in the deciding branch rather than next to the fast path's
config load, because every earlier `return false` hands the command to
the full install path, which already warns.

The new test asserts the ordering the two comments in
#13359 asked for — the warning precedes
the command's own output — and fails without the emit above.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

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

Inline comments:
In `@pnpm/crates/cli/tests/install.rs`:
- Around line 1693-1696: Replace the `///` documentation comments above the
up-to-date fast-path test rationale with regular `//` comments, preserving the
existing explanatory text and behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 83bedf8d-4809-4765-8451-01e7a52201a8

📥 Commits

Reviewing files that changed from the base of the PR and between 250837f and ff53713.

📒 Files selected for processing (2)
  • pnpm/crates/cli/src/cli_args/install.rs
  • pnpm/crates/cli/tests/install.rs

Comment thread pnpm/crates/cli/tests/install.rs Resolved
Comment thread pnpm/crates/cli/src/cli_args/install.rs Resolved
@qodo-code-review

Copy link
Copy Markdown

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

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

Both emit sites read the root manifest from `workspaceDir ?? dir`, the
same directory pnpm resolves it from, so a run inside a workspace
package must name the workspace root's migrated keys and never the
package's own. Nothing covered that: every existing case runs from the
root, where the two directories coincide.

The new test discriminates by key — `overrides` at the root,
`neverBuiltDependencies` in the package — so reading the wrong manifest
fails the assertion instead of producing an indistinguishable warning.
Pointing the emit at the cwd makes it fail with
"pnpm.neverBuiltDependencies". pnpm 11 warns identically on the same
fixture.
Copilot AI review requested due to automatic review settings July 25, 2026 16:40

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.

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

Copy link
Copy Markdown

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

kairosci added a commit to kairosci/pnpm that referenced this pull request Jul 27, 2026
… field (pnpm#13359)

pnpm 10 moved the install settings out of package.json's `pnpm` field
into pnpm-workspace.yaml, and pnpm warns about every migrated key a
manifest still declares so the setting is not silently dropped. pacquet
ignored the field without a word, so a project that had not migrated its
`pnpm.overrides` met only the downstream symptom.

`legacy_pnpm_field` already carried the port — the same 19-key migrated
list as config/reader/src/index.ts, the same message, and unit tests —
but was never declared as a module, so nothing compiled or called it.

The emit sits in `derive_config_root_and_package_manager_to_sync`, which
every install-family command already calls to resolve its root and which
computes the same directory pnpm reads the root manifest from. One site
covers all ten commands, and it runs before any install output so the
warning lands first, as in pnpm. The repeat-install fast path finishes
before that site is reached, so it warns from its deciding branch too.

Closes item 1 of pnpm#13315.
kairosci added a commit to kairosci/pnpm that referenced this pull request Jul 27, 2026
The warning parsed `package.json` with a bare `serde_json::from_slice`,
which chokes on the UTF-8 BOM an editor may leave at the head of the
file — pnpm strips it and warns, pacquet stayed silent. It also read and
parsed the manifest a second time, immediately before
`package_manager_to_sync` read and parsed the very same file.

Both follow from the helper doing its own IO. It now takes the parsed
manifest, so `derive_config_root_and_package_manager_to_sync` reads the
file once through `read_manifest_json` (the crate's BOM-stripping
reader) and hands it to the warning and to the package-manager policy
alike. `package_manager_to_sync` no longer reads anything, which leaves
it infallible.

The up-to-date fast path keeps its own read, one directory removed from
the manifest it already holds, and goes through the same reader via
`warn_ignored_pnpm_manifest_fields_in`: the two paths coincide only by
an invariant that lives in another function.

Follow-up to pnpm#13359, whose changeset is still pending, so the
fix ships with the feature.
kairosci added a commit to kairosci/pnpm that referenced this pull request Jul 27, 2026
…3376)

Close the four CLI-surface differences left over from pnpm#13315
after pnpm#13359 and pnpm#13375 landed the other two.

Three land in the Rust engine. The `Scope:` line arrives via a new
`pnpm:scope` channel and a port of `reportScope.ts`; pnpm gates it on the
command being one that reports scope *and* the run being workspace-wide,
and since the engine's recursive-by-default set is narrower than pnpm's,
that conjunction is computed at dispatch and seeded into the reporter.
The event is emitted where the counts already exist — the `--filter`
resolution and the installer's workspace walk — so no install pays for a
second directory walk. A `sharedWorkspaceLockfile: false` plan reports
once for the whole selection rather than once per child install, which
would otherwise overwrite the filtered count with the workspace total.

The second is the `allowBuilds` placeholder an install writes for a build
it blocked, which pnpm#13375 taught the engine to read but not yet to
write. The third is the elapsed time on a cache-satisfied lockfile
verdict.

The fourth goes the other way. The store block a first install prints is
unreachable in the TypeScript CLI: `reportContext` needs
`pnpm:package-import-method`, which only `@pnpm/fs.indexed-pkg-importer`
emits, and that runs inside a `@pnpm/worker` thread whose logger never
reaches the reporter. The main process already receives the import method
back from the worker, so it is reported from there instead.

Reporter globals are now seeded before the pre-command checks. They are
`OnceLock`s and the pre-command checks emit, so whatever fired first was
locking in unset values.

Closes pnpm#13315
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants