Skip to content

fix(deploy): don't copy the workspace root's package manager pin into the deployed manifest - #16405

Merged
zkochan merged 6 commits into
pnpm:mainfrom
snmsoodan:fix/deploy-dev-engines-16403
Sep 30, 2026
Merged

zkochan merged 6 commits into
pnpm:mainfrom
snmsoodan:fix/deploy-dev-engines-16403

Conversation

@snmsoodan

@snmsoodan snmsoodan commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

pnpm deploy stops copying the workspace root's packageManager and devEngines.packageManager into the deployed package.json.

#15434 added that copy (for #9079) in 12.7.0 and 11.28.0. A deploy directory is usually run by whatever the target image has, often npm. With the default onFail, npm refuses to run any script of a manifest whose devEngines.packageManager names pnpm, so npm run start in the deploy output exits with EBADDEVENGINES. A packageManager pin can also make corepack or pnpm's own version switching download another pnpm inside the image. The deploy output is for running the app, not developing it, so it carries no pin from the workspace. A project that wants one can declare it in its own package.json, which deploy keeps as-is.

This reverts the #15434 inheritance in both the Rust and TypeScript CLIs and removes the dependency on @pnpm/workspace.project-manifest-reader that it added to @pnpm/releasing.commands.

Closes #16403

Squash Commit Body

Deploy no longer writes the workspace root's `packageManager` or
`devEngines.packageManager` into the deployed manifest. This reverts the
inheritance added in pnpm/pnpm#15434 for pnpm/pnpm#9079, in both the
Rust and TypeScript CLIs.

A deploy directory is run by whatever package manager or runtime its
consumer uses, often npm in a plain Node.js image. With the default
onFail, npm refuses to run the scripts of a manifest whose
devEngines.packageManager names pnpm, so every script in the deploy
output failed with EBADDEVENGINES. A packageManager pin can likewise
make corepack or pnpm's version switching fetch another pnpm inside the
image. The deploy output is meant for running the app, so it carries no
development-time pin from the workspace. A deployed project's own pin is
kept, since deploy leaves the project's manifest fields as they are.

The inheritance helper, its call sites, and the now-unused
`@pnpm/workspace.project-manifest-reader` dependency of
`@pnpm/releasing.commands` are removed. A regression test in each CLI
checks that neither field reaches the deployed manifest, for native and
legacy deploy.

Closes pnpm/pnpm#16403

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • New features are implemented only in the Rust pnpm v12 CLI. Bug fixes
    are implemented in every affected version.
  • 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.

Originally prepared with AI assistance (GitHub Copilot). Revised by an agent (Claude Code, claude-opus-5-5).


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

Summary by CodeRabbit

  • Bug Fixes
    • Deployed package.json files no longer inherit the workspace root’s packageManager or devEngines.packageManager fields. The deployed project’s own runtime devEngines entry remains intact.
  • Documentation
    • Updated deploy guidance to clarify which package-manager fields are excluded and identify the pnpm versions that previously copied them.

@snmsoodan
snmsoodan requested a review from zkochan as a code owner September 29, 2026 18:41
Copilot AI balanced review requested due to automatic review settings September 29, 2026 18:42
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

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

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

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: d3eac982-93f1-4e91-89e5-3d057ee5b094

📥 Commits

Reviewing files that changed from the base of the PR and between b76b9de and c2fd79b.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing (12)
  • .changeset/deploy-does-not-copy-dev-engines.md
  • pnpm/crates/cli/src/cli_args/deploy.rs
  • pnpm/crates/cli/src/cli_args/deploy/package_manager.rs
  • pnpm/crates/cli/src/cli_args/deploy/tests.rs
  • pnpm/crates/cli/tests/suite/deploy/package_manager.rs
  • pnpm/docs/cli/deploy.md
  • pnpm11/docs/cli/deploy.md
  • pnpm11/releasing/commands/package.json
  • pnpm11/releasing/commands/src/deploy/deploy.ts
  • pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts
  • pnpm11/releasing/commands/test/deploy/deploy.test.ts
  • pnpm11/releasing/commands/tsconfig.json
💤 Files with no reviewable changes (5)
  • pnpm11/releasing/commands/tsconfig.json
  • pnpm11/releasing/commands/package.json
  • pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts
  • pnpm/crates/cli/src/cli_args/deploy/tests.rs
  • pnpm/crates/cli/src/cli_args/deploy/package_manager.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/deploy-does-not-copy-dev-engines.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Native and releasing-command deploy paths no longer copy the workspace root’s packageManager or devEngines.packageManager fields into the deployed manifest. Tests and documentation reflect the changed output.

Changes

Deploy manifest package-manager fields

Layer / File(s) Summary
Remove inheritance from native deploy
pnpm/crates/cli/src/cli_args/deploy.rs, pnpm/crates/cli/src/cli_args/deploy/package_manager.rs
Native deploy paths no longer read or apply workspace-root package-manager declarations. The inheritance helpers and associated project state are removed.
Remove inheritance from releasing-command deploy
pnpm11/releasing/commands/src/deploy/*, pnpm11/releasing/commands/package.json, pnpm11/releasing/commands/tsconfig.json
Releasing-command deploy paths no longer apply or write inherited declarations. The helper exports and their configuration dependency are removed.
Validate and document deploy output
pnpm/crates/cli/tests/suite/deploy/package_manager.rs, pnpm/crates/cli/src/cli_args/deploy/tests.rs, pnpm11/releasing/commands/test/deploy/deploy.test.ts, pnpm/docs/cli/deploy.md, pnpm11/docs/cli/deploy.md, .changeset/deploy-does-not-copy-dev-engines.md
Tests expect workspace-root package-manager declarations to be absent. Documentation and the changeset record the behavior and the versions that copied those fields.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Assessment against linked issues

Objective Addressed Explanation
[16403] Keep the workspace’s development-time package-manager pin out of the deployed manifest so the output can run with npm. ✅

Possibly related PRs

  • pnpm/pnpm#15434: Added the workspace-root package-manager inheritance removed by this pull request.

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

Suggested reviewers: altaywtf

Merge Risk: ⚪ Minimal · up to c2fd7

Deploy output stops inheriting workspace-root package-manager pins while retaining the deployed project's own fields. No merge-blocking issue is established; the change is ready to merge subject to normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to c2fd7

The change narrows manifest inheritance rather than expanding deploy authority. Selected-project declarations remain authoritative, and the inspected deploy paths retain their existing validation and failure behavior. No introduced security concern was established, but downstream enforcement and the broader changed surface are not fully covered.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated change affects manifests generated for selected-project deploy targets and their subsequent consumers. The inspected native entrypoint does not gain additional target scope or filesystem authority: single-project selection and target validation remain unchanged.

Trust Boundaries and Controls

  • observed — The inspected native flow selects exactly one normalized project, resolves source hooks before target preparation, and validates the target before copying. Removing root package-manager inheritance does not bypass those controls or change the selected project used for lockfile importer identity.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Warning

Some tools did not complete. Review the errors below.

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

pnpm11/releasing/commands/src/deploy/deploy.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

pnpm11/releasing/commands/test/deploy/deploy.test.ts

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).


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.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Sep 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Both implementations can drop an integrity hash or replace the root’s pnpm pin with a different package manager.

Review effort: Balanced
Findings: 2 High severity · 2 Medium severity · 1 Low severity

Open (5)
What changed in this PR

This PR changes pnpm deploy in both CLI implementations so the deployed manifest keeps a package manager pin without copying the workspace root’s devEngines enforcement, addressing the npm script failure reported in #16403.

Changes:

  • Inherit packageManager, converting an exact root devEngines.packageManager version into a pin when needed.
  • Add native and legacy deploy regression tests, plus a release note.
File Description
pnpm11/​releasing/​commands/​test/​deploy/​deploy.test.ts Tests deployed manifest behavior in both modes.
pnpm11/​releasing/​commands/​src/​deploy/​inheritPackageManager.ts Changes TypeScript pin inheritance.
pnpm/​crates/​cli/​tests/​suite/​deploy/​package_manager.rs Tests Rust deploy pin inheritance.
pnpm/​crates/​cli/​src/​cli_args/​deploy/​package_manager.rs Changes Rust pin inheritance.
cspell.json Adds the npm error code to the spelling list.
.changeset/​deploy-does-not-copy-dev-engines.md Adds a release note.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov-commenter

codecov-commenter commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.16%. Comparing base (0ef7d99) to head (c2fd79b).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16405      +/-   ##
==========================================
- Coverage   92.16%   92.16%   -0.01%     
==========================================
  Files        1516     1515       -1     
  Lines      204012   204059      +47     
==========================================
+ Hits       188024   188066      +42     
- Misses      15988    15993       +5     

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

Copy link
Copy Markdown
Contributor

Same-run regression check

HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.

Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2674.98 ms 2818.22 ms 5.4% 133.75 ms Inconclusive (overlapping samples)
isolated-fresh-restore-cold-cache-cold-store pnpr 1478.54 ms 1497.80 ms 1.3% 73.93 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 266.23 ms 258.44 ms -2.9% 13.31 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 288.09 ms 288.18 ms 0.0% 14.40 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 9.60 ms 9.63 ms 0.3% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 8.56 ms 9.50 ms 11.0% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 8.94 ms 10.14 ms 13.4% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 9.81 ms 9.73 ms -0.9% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2651.91 ms 2911.64 ms 9.8% 132.60 ms Inconclusive (overlapping samples)
isolated-fresh-install-cold-cache-cold-store pnpr 1694.47 ms 1539.64 ms -9.1% 84.72 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 497.81 ms 523.24 ms 5.1% 24.89 ms Inconclusive (overlapping samples)
isolated-fresh-install-hot-cache-hot-store pnpr 304.03 ms 312.20 ms 2.7% 15.20 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1774.59 ms 1784.23 ms 0.5% 88.73 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 371.20 ms 371.28 ms 0.0% 18.56 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 227.45 ms 244.11 ms 7.3% 11.37 ms Inconclusive (overlapping samples)
isolated-fresh-resolve-hot-cache-offline pnpr 92.28 ms 93.01 ms 0.8% 4.61 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 321.71 ms 350.90 ms 9.1% 16.09 ms Inconclusive (overlapping samples)
isolated-linked-workspace-resolve-hot-cache-offline pacquet 220.63 ms 230.70 ms 4.6% 11.03 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4538.37 ms 4600.49 ms 1.4% 226.92 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3577.85 ms 3490.17 ms -2.5% 178.89 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 138.09 ms 202.34 ms 46.5% 6.90 ms Inconclusive (overlapping samples)
gvs-fresh-restore-hot-cache-hot-store pnpr 164.01 ms 164.65 ms 0.4% 8.20 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: c2fd79b194d9

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.820 ± 0.109 2.672 3.026 1.87 ± 0.16
pacquet@main 2.681 ± 0.085 2.557 2.811 1.78 ± 0.15
pnpr@HEAD 1.510 ± 0.114 1.363 1.729 1.00
pnpr@main 1.542 ± 0.117 1.428 1.748 1.02 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.81999783412,
      "stddev": 0.1087484725510389,
      "median": 2.8182225293200003,
      "user": 2.7560841999999997,
      "system": 2.2109845399999997,
      "min": 2.6721730538200004,
      "max": 3.02615187982
    },
    {
      "command": "pacquet@main",
      "mean": 2.6808194689200002,
      "stddev": 0.08516890355953188,
      "median": 2.6749782143200003,
      "user": 2.4255787,
      "system": 1.9973336399999997,
      "min": 2.55671429782,
      "max": 2.8106004878200004
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5097326302199998,
      "stddev": 0.11441698440440459,
      "median": 1.49780295432,
      "user": 2.0565337999999995,
      "system": 1.83315594,
      "min": 1.36281868782,
      "max": 1.72915163782
    },
    {
      "command": "pnpr@main",
      "mean": 1.54214481562,
      "stddev": 0.11742739671126112,
      "median": 1.47854205782,
      "user": 2.0837191,
      "system": 1.9502380399999997,
      "min": 1.4279035178200001,
      "max": 1.7479191658200002
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 267.7 ± 30.9 225.2 318.0 1.00
pacquet@main 272.6 ± 28.9 243.3 335.7 1.02 ± 0.16
pnpr@HEAD 288.3 ± 24.4 246.4 339.7 1.08 ± 0.15
pnpr@main 289.4 ± 26.1 248.7 332.7 1.08 ± 0.16
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.26770585958,
      "stddev": 0.030891376579704834,
      "median": 0.25844488668,
      "user": 0.31094368,
      "system": 0.62711334,
      "min": 0.22516545268000002,
      "max": 0.31798710168
    },
    {
      "command": "pacquet@main",
      "mean": 0.27261335728,
      "stddev": 0.02893038154364704,
      "median": 0.26622601718000005,
      "user": 0.31388037999999996,
      "system": 0.6191752399999999,
      "min": 0.24328671668000001,
      "max": 0.33570461868
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.28827950398,
      "stddev": 0.024377153400025105,
      "median": 0.28818305118,
      "user": 0.31643367999999994,
      "system": 0.6227260399999999,
      "min": 0.24643384268000001,
      "max": 0.33969991468
    },
    {
      "command": "pnpr@main",
      "mean": 0.28936878378,
      "stddev": 0.02605026243555738,
      "median": 0.28809154768,
      "user": 0.31452717999999996,
      "system": 0.6340872400000002,
      "min": 0.24871595368000002,
      "max": 0.33274550868
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 10.7 ± 2.6 7.7 19.8 1.23 ± 0.32
pacquet@main 9.9 ± 1.3 8.2 15.6 1.14 ± 0.19
pnpr@HEAD 9.7 ± 1.1 7.6 16.2 1.11 ± 0.17
pnpr@main 8.7 ± 0.9 7.1 13.4 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.010656450374740497,
      "stddev": 0.002562898790709145,
      "median": 0.0096324027,
      "user": 0.00629203806228374,
      "system": 0.005325695363321798,
      "min": 0.007670107700000001,
      "max": 0.0198399887
    },
    {
      "command": "pacquet@main",
      "mean": 0.00989536031458333,
      "stddev": 0.001269597808704989,
      "median": 0.0095990452,
      "user": 0.005923666666666663,
      "system": 0.004838451597222223,
      "min": 0.008220552700000001,
      "max": 0.015571052700000003
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.009658598359192824,
      "stddev": 0.0010919902146390354,
      "median": 0.009503430700000001,
      "user": 0.005976004484304933,
      "system": 0.004547435246636771,
      "min": 0.007618049700000001,
      "max": 0.0161889427
    },
    {
      "command": "pnpr@main",
      "mean": 0.008672437050000002,
      "stddev": 0.0008678706366495366,
      "median": 0.008564381200000002,
      "user": 0.005480289285714285,
      "system": 0.003973422785714286,
      "min": 0.007077155700000001,
      "max": 0.013368011700000001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 10.2 ± 0.9 8.1 12.7 1.11 ± 0.15
pacquet@main 9.2 ± 0.9 7.8 13.0 1.00
pnpr@HEAD 9.9 ± 0.8 8.5 13.0 1.07 ± 0.14
pnpr@main 9.9 ± 0.9 8.2 14.6 1.07 ± 0.15
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.010173475845863462,
      "stddev": 0.0008998940968135479,
      "median": 0.01013618638,
      "user": 0.005698882008032126,
      "system": 0.0053571566265060225,
      "min": 0.00809249938,
      "max": 0.012680924380000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.009184896716363631,
      "stddev": 0.0009192984234400274,
      "median": 0.008941157380000002,
      "user": 0.005677082818181818,
      "system": 0.0042795613636363635,
      "min": 0.00775611738,
      "max": 0.012975777380000001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.009869642539663867,
      "stddev": 0.000806939195746181,
      "median": 0.00972895788,
      "user": 0.006480224537815125,
      "system": 0.0042726491596638645,
      "min": 0.008511254380000001,
      "max": 0.012983956380000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.009869378244197532,
      "stddev": 0.0009402660402683793,
      "median": 0.009813072380000001,
      "user": 0.006033886172839503,
      "system": 0.0046921090534979394,
      "min": 0.00815098038,
      "max": 0.01459141438
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.942 ± 0.112 2.823 3.169 1.87 ± 0.14
pacquet@main 2.678 ± 0.071 2.606 2.790 1.70 ± 0.12
pnpr@HEAD 1.573 ± 0.102 1.470 1.829 1.00
pnpr@main 1.691 ± 0.163 1.503 1.997 1.08 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.9419326625599997,
      "stddev": 0.11210577619092497,
      "median": 2.91163918176,
      "user": 2.9679145399999998,
      "system": 2.31899076,
      "min": 2.82336754476,
      "max": 3.16873408176
    },
    {
      "command": "pacquet@main",
      "mean": 2.67779076286,
      "stddev": 0.07126999579009152,
      "median": 2.65191039876,
      "user": 2.32130284,
      "system": 1.82448866,
      "min": 2.60587991776,
      "max": 2.78985010276
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5726107291600002,
      "stddev": 0.10225397212359658,
      "median": 1.53964187226,
      "user": 1.4592365399999998,
      "system": 1.5647748599999998,
      "min": 1.46965409976,
      "max": 1.8287914837600001
    },
    {
      "command": "pnpr@main",
      "mean": 1.69091063776,
      "stddev": 0.1631114463223684,
      "median": 1.6944727897600003,
      "user": 1.6579898400000002,
      "system": 1.8577563599999993,
      "min": 1.50292112376,
      "max": 1.99739071976
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 516.8 ± 26.3 483.2 556.3 1.70 ± 0.11
pacquet@main 508.6 ± 49.5 437.8 617.4 1.67 ± 0.17
pnpr@HEAD 321.3 ± 31.7 274.3 387.3 1.06 ± 0.11
pnpr@main 304.2 ± 11.6 287.6 322.0 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.51680465498,
      "stddev": 0.0263117817597288,
      "median": 0.52324450538,
      "user": 0.7238049200000001,
      "system": 0.77853484,
      "min": 0.48319894488000004,
      "max": 0.55633522488
    },
    {
      "command": "pacquet@main",
      "mean": 0.50855144598,
      "stddev": 0.04950253290481795,
      "median": 0.49781142038000004,
      "user": 0.7053082199999999,
      "system": 0.7782535399999999,
      "min": 0.43776219288000007,
      "max": 0.61743616088
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3212744027800001,
      "stddev": 0.03173010940602889,
      "median": 0.31219814238000004,
      "user": 0.28090181999999997,
      "system": 0.6088484399999999,
      "min": 0.27431005288000004,
      "max": 0.38729326988
    },
    {
      "command": "pnpr@main",
      "mean": 0.30424241778000005,
      "stddev": 0.011593508654358663,
      "median": 0.30402518038000004,
      "user": 0.26164141999999996,
      "system": 0.5902393399999999,
      "min": 0.28755041788,
      "max": 0.32196931288
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.798 ± 0.055 1.738 1.902 4.83 ± 0.23
pacquet@main 1.784 ± 0.044 1.706 1.874 4.79 ± 0.21
pnpr@HEAD 0.373 ± 0.013 0.357 0.396 1.00 ± 0.05
pnpr@main 0.372 ± 0.013 0.354 0.396 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.79810860706,
      "stddev": 0.0551217706004087,
      "median": 1.78423457916,
      "user": 1.25302886,
      "system": 1.24839746,
      "min": 1.7378999241600002,
      "max": 1.90235160016
    },
    {
      "command": "pacquet@main",
      "mean": 1.7839417788600003,
      "stddev": 0.0439330492228548,
      "median": 1.77459479966,
      "user": 1.25550766,
      "system": 1.23491596,
      "min": 1.7058060661600003,
      "max": 1.87398988416
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.37268206286000005,
      "stddev": 0.013167950491792531,
      "median": 0.37128074016,
      "user": 0.35333026,
      "system": 0.79101986,
      "min": 0.35696266016,
      "max": 0.39615128916000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.37230935616000005,
      "stddev": 0.01324933945813739,
      "median": 0.37120073566,
      "user": 0.36507036000000004,
      "system": 0.78680806,
      "min": 0.35393133916,
      "max": 0.39632839016000004
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 268.9 ± 56.7 205.0 380.0 2.91 ± 0.62
pacquet@main 228.3 ± 11.6 212.5 250.5 2.47 ± 0.13
pnpr@HEAD 92.8 ± 1.7 89.6 97.4 1.00 ± 0.03
pnpr@main 92.4 ± 1.8 88.9 97.5 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.26893206140000003,
      "stddev": 0.056740488125577984,
      "median": 0.24411116160000002,
      "user": 0.24629172000000002,
      "system": 0.09165904,
      "min": 0.20495078310000003,
      "max": 0.3800430241
    },
    {
      "command": "pacquet@main",
      "mean": 0.22834911702307698,
      "stddev": 0.011558865427159544,
      "median": 0.22744530110000002,
      "user": 0.2011833046153846,
      "system": 0.08757307076923077,
      "min": 0.21246813210000004,
      "max": 0.25048318810000003
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09275362303103449,
      "stddev": 0.0016681247090681943,
      "median": 0.0930149101,
      "user": 0.03559712689655173,
      "system": 0.013345259310344826,
      "min": 0.08962549310000001,
      "max": 0.0974189401
    },
    {
      "command": "pnpr@main",
      "mean": 0.09244617244375002,
      "stddev": 0.001764871638997152,
      "median": 0.0922802536,
      "user": 0.033784326249999996,
      "system": 0.013888027499999999,
      "min": 0.0889366421,
      "max": 0.0974727011
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 361.1 ± 40.6 307.5 418.8 1.12 ± 0.16
pacquet@main 321.8 ± 26.5 276.4 354.6 1.00
pnpm@HEAD 3533.7 ± 114.2 3421.4 3763.1 10.98 ± 0.97
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.36114892552444444,
      "stddev": 0.04062779972035492,
      "median": 0.35089624408,
      "user": 0.38845868888888885,
      "system": 0.08199110444444443,
      "min": 0.30748532508,
      "max": 0.41882212808
    },
    {
      "command": "pacquet@main",
      "mean": 0.32176833808,
      "stddev": 0.02649376350846696,
      "median": 0.32170546608,
      "user": 0.35047035555555556,
      "system": 0.07627443777777777,
      "min": 0.27635376108,
      "max": 0.35458289508
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.533663086191111,
      "stddev": 0.11422610751562136,
      "median": 3.50764076408,
      "user": 5.457573355555556,
      "system": 0.27845477111111105,
      "min": 3.42136609608,
      "max": 3.76313870708
    }
  ]
}

Scenario: Isolated linker: linked-workspace resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 237.9 ± 15.9 218.4 260.2 1.05 ± 0.09
pacquet@main 226.4 ± 13.4 210.5 256.2 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.23790827619454546,
      "stddev": 0.015880083110303242,
      "median": 0.23070430974,
      "user": 0.18681699272727273,
      "system": 0.09422700909090907,
      "min": 0.21839024674000002,
      "max": 0.26020559274000005
    },
    {
      "command": "pacquet@main",
      "mean": 0.22641438843230766,
      "stddev": 0.013393202321787841,
      "median": 0.22062556174,
      "user": 0.1700193353846154,
      "system": 0.09579594615384615,
      "min": 0.21048836574000002,
      "max": 0.25619462074000005
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.642 ± 0.233 4.427 5.232 1.31 ± 0.09
pacquet@main 4.569 ± 0.116 4.460 4.867 1.29 ± 0.07
pnpr@HEAD 3.546 ± 0.157 3.397 3.834 1.00
pnpr@main 3.584 ± 0.091 3.455 3.764 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.642452237039999,
      "stddev": 0.2328659895544878,
      "median": 4.60048707664,
      "user": 2.2238109399999995,
      "system": 1.7803663399999998,
      "min": 4.42675865914,
      "max": 5.23163113514
    },
    {
      "command": "pacquet@main",
      "mean": 4.569272017039999,
      "stddev": 0.11613211930057984,
      "median": 4.53836578164,
      "user": 2.0329542399999996,
      "system": 1.7078080400000004,
      "min": 4.46007280114,
      "max": 4.86658896814
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.54574297354,
      "stddev": 0.15684745530443475,
      "median": 3.49016947764,
      "user": 1.69456904,
      "system": 1.6506678399999999,
      "min": 3.39701857114,
      "max": 3.83447946714
    },
    {
      "command": "pnpr@main",
      "mean": 3.5843413795399997,
      "stddev": 0.09139272104328634,
      "median": 3.57785175464,
      "user": 1.65871814,
      "system": 1.6572431399999998,
      "min": 3.45508088414,
      "max": 3.76404083014
    }
  ]
}

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

Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 201.4 ± 43.8 138.1 285.9 1.44 ± 0.33
pacquet@main 140.3 ± 9.6 129.7 165.1 1.00
pnpr@HEAD 161.2 ± 10.9 139.9 174.5 1.15 ± 0.11
pnpr@main 163.4 ± 11.3 145.4 181.4 1.16 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2014204372177778,
      "stddev": 0.04383483274779766,
      "median": 0.20234319044,
      "user": 0.24820333555555557,
      "system": 0.20068067555555558,
      "min": 0.13814910144,
      "max": 0.28586470744000003
    },
    {
      "command": "pacquet@main",
      "mean": 0.14028524033473685,
      "stddev": 0.0095979135021148,
      "median": 0.13809496944,
      "user": 0.17603204315789475,
      "system": 0.14502872526315788,
      "min": 0.12971908144,
      "max": 0.16512097744
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.16123856370666667,
      "stddev": 0.010935275041313178,
      "median": 0.16465227744,
      "user": 0.18863197999999998,
      "system": 0.15720108666666663,
      "min": 0.13993336744,
      "max": 0.17447426644
    },
    {
      "command": "pnpr@main",
      "mean": 0.16341933149555554,
      "stddev": 0.01128073110686582,
      "median": 0.16401070694,
      "user": 0.19316794666666665,
      "system": 0.16006367555555553,
      "min": 0.14540652844,
      "max": 0.18143495144
    }
  ]
}

…oyed manifest

`pnpm deploy` copied the workspace root's `devEngines.packageManager` into the
deployed `package.json` (pnpm#15434). npm enforces `devEngines` by default,
so installing a deploy output with npm made every script of it fail:

    EBADDEVENGINES: devEngines.packageManager
      wanted:  { name: "pnpm", version: "12.8.1", onFail: "error" }
      current: { name: "npm", version: "11.7.0" }

A deploy directory is meant to be installed by whichever package manager its
consumer uses, so it must not carry a development-time contract that rules one
of them out.

The deployed manifest now inherits only the `packageManager` field, which is
the pin corepack reads. The root's `devEngines.packageManager` still outranks
its `packageManager` field, so when the root pins an exact version there and
declares no `packageManager`, that version is written as the `packageManager`
spec instead: the pin pnpm#15434 set out to preserve is kept, without
exporting its enforcement. A range or a dist-tag names no version that could be
installed, so it falls back to the `packageManager` field.

Fixes pnpm#16403.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 7ee9c5ce-96b9-4d2b-a163-a6e5a4a4eb38
Copilot AI balanced review requested due to automatic review settings September 29, 2026 19:13
@zkochan
zkochan force-pushed the fix/deploy-dev-engines-16403 branch from 27ca480 to f1469a6 Compare September 29, 2026 19:13
@zkochan

zkochan commented Sep 29, 2026

Copy link
Copy Markdown
Member

Review Summary

Summary

  • Intent: Fix pnpm deploy incorrectly copying devEngines.packageManager into the deployed package.json (#16403). Because npm enforces devEngines by default, deploying and running npm run <script> in a deployed folder failed with EBADDEVENGINES.
  • Diff Breakdown:
    • Implemented in both Rust v12 (pacquet / pnpm/crates/cli/src/cli_args/deploy/package_manager.rs) and TypeScript v11 (pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts).
    • Only inherits packageManager field (read by corepack), dropping devEngines.
    • When the workspace root has no packageManager but pins an exact version in devEngines.packageManager, that version is preserved as the packageManager spec.
    • Added comprehensive test suites in Rust and TypeScript covering both native and legacy deploy modes.
    • Changeset added targeting @pnpm/releasing.commands, pnpm, and pacquet.

Evaluation

  • Security: No security regressions. Stripping devEngines from deployed outputs prevents unexpected enforcement when deployed artifacts are consumed by third-party runners.
  • Performance: No regressions. Manifest manipulation is purely local in-memory transformation during deploy.
  • Correctness: Follows npm/corepack semantics properly; resolves the reported bug cleanly in both Rust and TypeScript engines.
  • Tests & Verification: Verified clean rebase onto origin/main. Full CI matrix is green (TS CI matrix, Rust CI matrix, CodeQL, Bencher).

Verdict

Approved. Clean bug fix with complete version coverage and rigorous tests.


Reviewed by Zoltan's Agent

A root `packageManager` naming the same version as the exact pnpm
`devEngines.packageManager` entry is now kept as written, so its
corepack integrity hash survives. A hash on the devEngines entry is kept
too. Only a pnpm entry is converted; an entry for another package
manager falls back to the root `packageManager` field.

Update both versions' deploy docs, and reword the changeset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@qodo-code-review

qodo-code-review Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 🔗 Cross-repo conflicts (1) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Website misstates fixed deploy versions 🔗 Cross-repo conflict ≡ Correctness ⭐ New
Description
The deploy docs place the non-copying behavior under “Since v12.7.0” and “Since v11.28.0” headings
while also saying those starting versions copied the workspace root’s package-manager fields; their
open-ended v12.8.x and v11.28.x copying ranges also include releases that will contain the fix.
Because pnpm.io imports both files into its versioned docs, readers checking an installed or fixed
release encounter conflicting guidance about its behavior.
Code

pnpm/docs/cli/deploy.md[R95-96]

+  root `package.json` are not copied into the deployed `package.json`. Versions
+  v12.7.0 through v12.8.x copied them.
Relevance

●●● Strong

Recent accepted docs findings show reviewers correct inaccurate behavior and version documentation
in both v12 and v11 docs.

PR-#16393

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Each page’s “Since” heading and copying range assign opposite behavior to the same starting version.
The package manifests place current versions within the open-ended ranges, the PR records patch
releases, and pnpm.io maps these source directories to its current and versioned docs and copies
their Markdown during sync.

pnpm -> pnpm.io
pnpm/docs/cli/deploy.md[92-96]
pnpm11/docs/cli/deploy.md[100-102]
.changeset/deploy-does-not-copy-dev-engines.md[1-7]
pnpm/npm/pnpm/package.json[14-14]
pnpm11/pnpm/package.json[1-3]
External repo: pnpm/pnpm.io, scripts/docs-sources.mjs [4-10]
External repo: pnpm/pnpm.io, scripts/sync-docs.mjs [9-15]
External repo: pnpm/pnpm.io, scripts/sync-docs.mjs [53-55]

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

## Issue description
Both deploy pages give conflicting version guidance: their “Since” headings attribute the non-copying behavior to versions also listed as copying the fields, while their open-ended patch-series ranges include releases that will contain the fix. pnpm.io imports these pages into its versioned docs.

## Fix Focus Areas
- pnpm/docs/cli/deploy.md[92-96]
- pnpm11/docs/cli/deploy.md[100-102]

## Recommended Fix
Separate the historical copying behavior from the new behavior. State the first fixed version for each release line, end each copying range at the last release that actually copied the fields rather than using open-ended `v12.8.x` and `v11.28.x` ranges, and retain the statement that fixed releases do not copy them.

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

Dismiss ↗ | View ↗


2. Deploy comments overstate npm failures ✓ Resolved
Description
The updated inherit_package_manager comment says npm refuses to run scripts whenever
devEngines.packageManager names another manager, but onFail: 'warn' and onFail: 'ignore' allow
scripts to proceed. The TypeScript helper repeats the claim, so readers of either implementation
could mistake a warning or ignored mismatch for a hard failure.
Code

pnpm/crates/cli/src/cli_args/deploy/package_manager.rs[R13-15]

+/// that package managers enforce by default, and npm refuses to run any script
+/// of a manifest whose `devEngines.packageManager` names another package
+/// manager.
Relevance

●●● Strong

Accepted precedents favor correcting comments to state current behavior and non-obvious
configuration-dependent contracts.

PR-#15430
PR-#16219

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Both changed comments make an unconditional claim about npm refusing scripts. The PR description
explicitly distinguishes onFail: 'warn' and onFail: 'ignore' from a failing mismatch.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/cli/src/cli_args/deploy/package_manager.rs[12-15]
pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[8-11]

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

## Issue description
Both deploy helper comments state that npm always refuses to run scripts when the declared package manager differs, regardless of `onFail`.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/deploy/package_manager.rs[12-15]
- pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[8-11]

## Recommended Fix
Explain that a mismatched package manager can block or affect scripts depending on `onFail`, without claiming that every mismatch is fatal.

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


3. Deploys select the wrong integrity hash ⊘ Outdated
Description
exactPnpmDevEnginesVersion compares validVersion(version), which retains a valid build suffix,
with version.split('+', 1)[0], so it rejects exact pins carrying an integrity hash. When the root
declares a hashed devEngines.packageManager pin, TypeScript deploys fall back to a different root
hash or omit the pin entirely, while the Rust path preserves the hashed pin and the new TypeScript
test expects it.
Code

pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[64]

+  return validVersion(version) === version.split('+', 1)[0] ? version : undefined
Relevance

●●● Strong

Recent accepted parity findings support fixing divergent TS/Rust behavior; integrity-hash
preservation is a concrete correctness bug.

PR-#14832

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed TypeScript comparison rejects the hashed version asserted by the new test; the Rust
implementation instead accepts an exact version and retains its original spelling. This makes the
two affected deploy implementations behave differently for the same manifest.

Rule 713428: Keep pnpm v11 and v12 observable behavior aligned when fixing shared bugs
pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[58-64]
pnpm11/releasing/commands/test/deploy/inheritPackageManager.test.ts[17-21]
pnpm/crates/cli/src/cli_args/deploy/package_manager.rs[69-75]

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 TypeScript exact-version check rejects valid hashed pins, making deploy output disagree with the Rust implementation and the new test.

## Fix Focus Areas
- pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[58-64]
- pnpm11/releasing/commands/test/deploy/inheritPackageManager.test.ts[17-21]

## Recommended Fix
Validate the complete version against the semver result without comparing it to a suffix-stripped string. Keep the hash in the returned pin and verify the hashed-pin test passes.

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


View medium (3)
4. Deploy notes mix the fix with rationale ✓ Resolved
Description
The changeset's second sentence combines npm's enforcement rationale, the former script failure, and
the new manifest behavior. When this entry becomes a release note, the old failure remains embedded
in a sentence about current behavior instead of appearing in its own past-tense sentence.
Code

.changeset/deploy-does-not-copy-dev-engines.md[7]

+`pnpm deploy` no longer copies the workspace root's `devEngines` into the deployed `package.json`. npm enforces `devEngines.packageManager` by default — a deploy output whose `devEngines` named pnpm made `npm run <script>` fail with `EBADDEVENGINES` — so the deployed manifest now inherits only the `packageManager` pin, which is the field corepack reads. When the root declares no `packageManager` but an exact `devEngines.packageManager` version, that version is written as the `packageManager` pin instead, so the pin the workspace uses is still preserved [#16403](https://github.com/pnpm/pnpm/issues/16403).
Relevance

●●● Strong

Recent changeset reviews repeatedly require observable behavior and separate past-tense bug
descriptions from rationale.

PR-#16238
PR-#15887

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rules 3058322 and 3058498 require observable-behavior-focused changeset text and a separate
past-tense sentence when previous buggy behavior is mentioned. The added second sentence joins the
previous npm run failure to the new inheritance behavior with a rationale clause.

Rule 3058322: Changeset entries must describe observable behavior changes only
Rule 3058498: Describe previous buggy behavior in a separate past-tense sentence
.changeset/deploy-does-not-copy-dev-engines.md[7-7]

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 deploy changeset combines historical failure, justification, and current behavior in one sentence.

## Fix Focus Areas
- .changeset/deploy-does-not-copy-dev-engines.md[7-7]

## Recommended Fix
Keep the release note focused on what `pnpm deploy` now writes. If the previous failure is needed, put it in a separate past-tense sentence; leave design rationale in the PR description.

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


5. Deploy notes contain em dashes ✓ Resolved
Description
The deploy changeset uses em dashes in its release-note paragraph. Both occurrences are in newly
added text, so the entry breaks the changeset's plain-dash convention.
Code

.changeset/deploy-does-not-copy-dev-engines.md[7]

+`pnpm deploy` no longer copies the workspace root's `devEngines` into the deployed `package.json`. npm enforces `devEngines.packageManager` by default — a deploy output whose `devEngines` named pnpm made `npm run <script>` fail with `EBADDEVENGINES` — so the deployed manifest now inherits only the `packageManager` pin, which is the field corepack reads. When the root declares no `packageManager` but an exact `devEngines.packageManager` version, that version is written as the `packageManager` pin instead, so the pin the workspace uses is still preserved [#16403](https://github.com/pnpm/pnpm/issues/16403).
Relevance

●●● Strong

Repository history accepts explicit changeset formatting corrections, and em-dash removal is a
deterministic style fix.

PR-#16344
PR-#16238

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 3058313 prohibits em dashes anywhere in a changeset, and the added entry contains two.

Rule 3058313: Changeset text formatting conventions
.changeset/deploy-does-not-copy-dev-engines.md[7-7]

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 entry contains em dashes, which the changeset text convention disallows.

## Fix Focus Areas
- .changeset/deploy-does-not-copy-dev-engines.md[7-7]

## Recommended Fix
Rewrite the parenthetical explanation as a separate sentence using ordinary punctuation.

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


6. Deploys lose package manager hashes ✓ Resolved
Description
exactDevEnginesPin and dev_engines_package_manager_spec convert an exact
devEngines.packageManager version to an unhashed packageManager spec, replacing the root’s
existing spec even when it contains the same version and an integrity hash. If both root fields
carry matching hashed pins, native and legacy deploys write an unhashed pin, so the deployed
manifest no longer carries the artifact-integrity constraint.
Code

pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[R56-58]

+  return validVersion(pinned.version) === pinned.version
+    ? `${pinned.name}@${pinned.version}`
+    : undefined
Relevance

●● Moderate

Potential integrity loss is a substantive deploy regression; history supports deploy correctness
fixes but lacks an exact hash precedent.

PR-#15416
PR-#15246

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The repository tests matching +sha512 hashes in both root fields as a supported declaration. The
config reader identifies that suffix as an integrity hash, while the new TypeScript return value and
Rust exact_version path omit it; both deploy paths use these helpers to produce the deployed
manifest.

pnpm11/pnpm/test/packageManagerCheck.test.ts[608-621]
pnpm11/config/reader/src/index.ts[1217-1231]
pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[33-58]
pnpm/crates/cli/src/cli_args/deploy/package_manager.rs[43-60]
pnpm/crates/cli/src/cli_args/package_manager.rs[211-213]

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

## Issue description
Deploying a workspace with matching hashed `packageManager` and `devEngines.packageManager` pins replaces the hashed spec with an unhashed one. The TypeScript and Rust implementations both need to preserve the integrity hash while continuing not to copy `devEngines` into the deployed manifest.

## Fix Focus Areas
- pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[33-58]
- pnpm/crates/cli/src/cli_args/deploy/package_manager.rs[43-60]

## Recommended Fix
When selecting an exact devEngines pin, retain its valid integrity build metadata; if a matching root `packageManager` already carries the hash, preserve that spec rather than replacing it with an unhashed reconstruction. Add deploy tests for matching hashed pins in both implementations.

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



Informational

7. Test helper appears before its first call ⊘ Outdated
Description
The new top-level inheritedPackageManagerOf function declaration precedes every call to it in the
test file. Its first call is in the following test, so a reader encounters the helper definition
before the behavior it supports.
Code

pnpm11/releasing/commands/test/deploy/inheritPackageManager.test.ts[R6-8]

+function inheritedPackageManagerOf (root: ProjectManifest): string | undefined {
+  return inheritPackageManager({ name: 'app' }, root).packageManager
+}
Relevance

● Weak

A closely matching declaration-order style finding for a test helper was explicitly rejected.

PR-#12864

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new top-level function is declared at line 6 and first called at line 11, contrary to the
specified declaration order.

Rule 713432: Declare TypeScript functions only after their first usage
pnpm11/releasing/commands/test/deploy/inheritPackageManager.test.ts[6-14]

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 TypeScript test helper is declared before its first use in the same file.

## Fix Focus Areas
- pnpm11/releasing/commands/test/deploy/inheritPackageManager.test.ts[6-15]

## Recommended Fix
Move the function declaration below the first test that calls it, leaving its behavior unchanged.

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


Grey Divider

Context sources
✅ Compliance rules (platform): 63 rules
✅ Skills: review-code
✅ Cross-repo context — repo relationships
  Explored: repo: pnpm/pnpm.io (sha: 94842f51) — View relationship
Review mode: ⚖️ Balanced: This is a behavior-affecting deploy change spanning native and legacy implementations, with manifest and compatibility implications, but the logic is focused enough for one careful review pass.

Grey Divider

Tip of the day
💡 Did you know, you can route each severity your way: inline, summary, both, or drop

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit c2fd79b

Results up to commit f1469a6 ⚖️ Balanced


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


Remediation recommended
1. Deploy notes mix the fix with rationale ✓ Resolved
Description
The changeset's second sentence combines npm's enforcement rationale, the former script failure, and
the new manifest behavior. When this entry becomes a release note, the old failure remains embedded
in a sentence about current behavior instead of appearing in its own past-tense sentence.
Code

.changeset/deploy-does-not-copy-dev-engines.md[7]

+`pnpm deploy` no longer copies the workspace root's `devEngines` into the deployed `package.json`. npm enforces `devEngines.packageManager` by default — a deploy output whose `devEngines` named pnpm made `npm run <script>` fail with `EBADDEVENGINES` — so the deployed manifest now inherits only the `packageManager` pin, which is the field corepack reads. When the root declares no `packageManager` but an exact `devEngines.packageManager` version, that version is written as the `packageManager` pin instead, so the pin the workspace uses is still preserved [#16403](https://github.com/pnpm/pnpm/issues/16403).
Relevance

●●● Strong

Recent changeset reviews repeatedly require observable behavior and separate past-tense bug
descriptions from rationale.

PR-#16238
PR-#15887

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rules 3058322 and 3058498 require observable-behavior-focused changeset text and a separate
past-tense sentence when previous buggy behavior is mentioned. The added second sentence joins the
previous npm run failure to the new inheritance behavior with a rationale clause.

Rule 3058322: Changeset entries must describe observable behavior changes only
Rule 3058498: Describe previous buggy behavior in a separate past-tense sentence
.changeset/deploy-does-not-copy-dev-engines.md[7-7]

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 deploy changeset combines historical failure, justification, and current behavior in one sentence.

## Fix Focus Areas
- .changeset/deploy-does-not-copy-dev-engines.md[7-7]

## Recommended Fix
Keep the release note focused on what `pnpm deploy` now writes. If the previous failure is needed, put it in a separate past-tense sentence; leave design rationale in the PR description.

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


2. Deploy notes contain em dashes ✓ Resolved
Description
The deploy changeset uses em dashes in its release-note paragraph. Both occurrences are in newly
added text, so the entry breaks the changeset's plain-dash convention.
Code

.changeset/deploy-does-not-copy-dev-engines.md[7]

+`pnpm deploy` no longer copies the workspace root's `devEngines` into the deployed `package.json`. npm enforces `devEngines.packageManager` by default — a deploy output whose `devEngines` named pnpm made `npm run <script>` fail with `EBADDEVENGINES` — so the deployed manifest now inherits only the `packageManager` pin, which is the field corepack reads. When the root declares no `packageManager` but an exact `devEngines.packageManager` version, that version is written as the `packageManager` pin instead, so the pin the workspace uses is still preserved [#16403](https://github.com/pnpm/pnpm/issues/16403).
Relevance

●●● Strong

Repository history accepts explicit changeset formatting corrections, and em-dash removal is a
deterministic style fix.

PR-#16344
PR-#16238

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Rule 3058313 prohibits em dashes anywhere in a changeset, and the added entry contains two.

Rule 3058313: Changeset text formatting conventions
.changeset/deploy-does-not-copy-dev-engines.md[7-7]

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 entry contains em dashes, which the changeset text convention disallows.

## Fix Focus Areas
- .changeset/deploy-does-not-copy-dev-engines.md[7-7]

## Recommended Fix
Rewrite the parenthetical explanation as a separate sentence using ordinary punctuation.

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


3. Deploys lose package manager hashes ✓ Resolved
Description
exactDevEnginesPin and dev_engines_package_manager_spec convert an exact
devEngines.packageManager version to an unhashed packageManager spec, replacing the root’s
existing spec even when it contains the same version and an integrity hash. If both root fields
carry matching hashed pins, native and legacy deploys write an unhashed pin, so the deployed
manifest no longer carries the artifact-integrity constraint.
Code

pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[R56-58]

+  return validVersion(pinned.version) === pinned.version
+    ? `${pinned.name}@${pinned.version}`
+    : undefined
Relevance

●● Moderate

Potential integrity loss is a substantive deploy regression; history supports deploy correctness
fixes but lacks an exact hash precedent.

PR-#15416
PR-#15246

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The repository tests matching +sha512 hashes in both root fields as a supported declaration. The
config reader identifies that suffix as an integrity hash, while the new TypeScript return value and
Rust exact_version path omit it; both deploy paths use these helpers to produce the deployed
manifest.

pnpm11/pnpm/test/packageManagerCheck.test.ts[608-621]
pnpm11/config/reader/src/index.ts[1217-1231]
pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[33-58]
pnpm/crates/cli/src/cli_args/deploy/package_manager.rs[43-60]
pnpm/crates/cli/src/cli_args/package_manager.rs[211-213]

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

## Issue description
Deploying a workspace with matching hashed `packageManager` and `devEngines.packageManager` pins replaces the hashed spec with an unhashed one. The TypeScript and Rust implementations both need to preserve the integrity hash while continuing not to copy `devEngines` into the deployed manifest.

## Fix Focus Areas
- pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[33-58]
- pnpm/crates/cli/src/cli_args/deploy/package_manager.rs[43-60]

## Recommended Fix
When selecting an exact devEngines pin, retain its valid integrity build metadata; if a matching root `packageManager` already carries the hash, preserve that spec rather than replacing it with an unhashed reconstruction. Add deploy tests for matching hashed pins in both implementations.

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


Results up to commit 7721b06 ⚖️ Balanced


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


Remediation recommended
1. Deploys select the wrong integrity hash ⊘ Outdated
Description
exactPnpmDevEnginesVersion compares validVersion(version), which retains a valid build suffix,
with version.split('+', 1)[0], so it rejects exact pins carrying an integrity hash. When the root
declares a hashed devEngines.packageManager pin, TypeScript deploys fall back to a different root
hash or omit the pin entirely, while the Rust path preserves the hashed pin and the new TypeScript
test expects it.
Code

pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[64]

+  return validVersion(version) === version.split('+', 1)[0] ? version : undefined
Relevance

●●● Strong

Recent accepted parity findings support fixing divergent TS/Rust behavior; integrity-hash
preservation is a concrete correctness bug.

PR-#14832

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed TypeScript comparison rejects the hashed version asserted by the new test; the Rust
implementation instead accepts an exact version and retains its original spelling. This makes the
two affected deploy implementations behave differently for the same manifest.

Rule 713428: Keep pnpm v11 and v12 observable behavior aligned when fixing shared bugs
pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[58-64]
pnpm11/releasing/commands/test/deploy/inheritPackageManager.test.ts[17-21]
pnpm/crates/cli/src/cli_args/deploy/package_manager.rs[69-75]

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 TypeScript exact-version check rejects valid hashed pins, making deploy output disagree with the Rust implementation and the new test.

## Fix Focus Areas
- pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[58-64]
- pnpm11/releasing/commands/test/deploy/inheritPackageManager.test.ts[17-21]

## Recommended Fix
Validate the complete version against the semver result without comparing it to a suffix-stripped string. Keep the hash in the returned pin and verify the hashed-pin test passes.

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



Informational
2. Test helper appears before its first call ⊘ Outdated
Description
The new top-level inheritedPackageManagerOf function declaration precedes every call to it in the
test file. Its first call is in the following test, so a reader encounters the helper definition
before the behavior it supports.
Code

pnpm11/releasing/commands/test/deploy/inheritPackageManager.test.ts[R6-8]

+function inheritedPackageManagerOf (root: ProjectManifest): string | undefined {
+  return inheritPackageManager({ name: 'app' }, root).packageManager
+}
Relevance

● Weak

A closely matching declaration-order style finding for a test helper was explicitly rejected.

PR-#12864

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new top-level function is declared at line 6 and first called at line 11, contrary to the
specified declaration order.

Rule 713432: Declare TypeScript functions only after their first usage
pnpm11/releasing/commands/test/deploy/inheritPackageManager.test.ts[6-14]

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 TypeScript test helper is declared before its first use in the same file.

## Fix Focus Areas
- pnpm11/releasing/commands/test/deploy/inheritPackageManager.test.ts[6-15]

## Recommended Fix
Move the function declaration below the first test that calls it, leaving its behavior unchanged.

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


Results up to commit b76b9de ⚖️ Balanced


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


Remediation recommended
1. Deploy comments overstate npm failures ✓ Resolved
Description
The updated inherit_package_manager comment says npm refuses to run scripts whenever
devEngines.packageManager names another manager, but onFail: 'warn' and onFail: 'ignore' allow
scripts to proceed. The TypeScript helper repeats the claim, so readers of either implementation
could mistake a warning or ignored mismatch for a hard failure.
Code

pnpm/crates/cli/src/cli_args/deploy/package_manager.rs[R13-15]

+/// that package managers enforce by default, and npm refuses to run any script
+/// of a manifest whose `devEngines.packageManager` names another package
+/// manager.
Relevance

●●● Strong

Accepted precedents favor correcting comments to state current behavior and non-obvious
configuration-dependent contracts.

PR-#15430
PR-#16219

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Both changed comments make an unconditional claim about npm refusing scripts. The PR description
explicitly distinguishes onFail: 'warn' and onFail: 'ignore' from a failing mismatch.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/cli/src/cli_args/deploy/package_manager.rs[12-15]
pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[8-11]

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

## Issue description
Both deploy helper comments state that npm always refuses to run scripts when the declared package manager differs, regardless of `onFail`.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/deploy/package_manager.rs[12-15]
- pnpm11/releasing/commands/src/deploy/inheritPackageManager.ts[8-11]

## Recommended Fix
Explain that a mismatched package manager can block or affect scripts depending on `onFail`, without claiming that every mismatch is fatal.

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


Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

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

No code suggestions found for the PR.

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 review overview

🟡 Changes recommended

Both deploy implementations can drop an integrity suffix when converting an exact package-manager pin.

Review effort: Balanced
Findings: 2 Medium severity · 2 Low severity

Open (4)
Resolved since last review (2)

Copilot AI balanced review requested due to automatic review settings September 29, 2026 19:24
@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 7721b06

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

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 review overview

🟡 Changes recommended

The TypeScript path rejects exact pins with integrity hashes, so the new hash-preservation behavior does not work.

Review effort: Balanced
Findings: 1 High severity · 1 Low severity

Open (2)
Resolved since last review (3)

Copilot AI balanced review requested due to automatic review settings September 29, 2026 19:45
@qodo-code-review

Copy link
Copy Markdown

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

Copilot AI balanced review requested due to automatic review settings September 29, 2026 23:04
@zkochan

zkochan commented Sep 29, 2026

Copy link
Copy Markdown
Member

On your question about that sentence in the description: it doesn't hold up, and I removed it. Since b76b9de, deploy doesn't create a packageManager field from devEngines. The only packageManager a deployed manifest gets is one the root already declares in that field, which is the pre-existing behavior from pnpm/pnpm#15434. My earlier wrap-up comment described the conversion as a fix. That comment is out of date.


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

@qodo-code-review

Copy link
Copy Markdown

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

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

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 review overview

🟢 Approval recommended

Both implementations address the reported failure and cover native and legacy deploy; only a nonblocking comment-wording correction remains.

Review effort: Balanced
Findings: None

npm runs scripts after a devEngines mismatch when onFail is warn or
ignore, so the comments now say the refusal comes with the default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings September 29, 2026 23:27
@zkochan

zkochan commented Sep 29, 2026

Copy link
Copy Markdown
Member

Qodo's "Deploy comments overstate npm failures" finding is fixed in 19a276b. The Rust and TypeScript doc comments and the Rust test comment now say npm refuses to run scripts with the default onFail. With warn or ignore, the scripts still run.


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

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 19a276b

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

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 review overview

🟢 Approval recommended

The scoped fix preserves project-owned pins and has regression coverage for both implementations and deploy modes.

Review effort: Balanced
Findings: None

Deploy no longer writes the workspace root's `packageManager` or
`devEngines.packageManager` into the deployed manifest. This reverts the
inheritance added in pnpm#15434. A deploy directory is installed
by whatever package manager its consumer uses, and with the default
onFail npm refuses to run the scripts of a manifest whose
devEngines.packageManager names pnpm.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings September 29, 2026 23:41
@zkochan zkochan changed the title fix(deploy): don't copy the workspace root's devEngines into the deployed manifest fix(deploy): don't copy the workspace root's package manager pin into the deployed manifest Sep 29, 2026
@zkochan

zkochan commented Sep 29, 2026

Copy link
Copy Markdown
Member

There was no good reason. The only one was that pnpm/pnpm#9079 asked for it and pnpm/pnpm#15434 added it. Since c2fd79b, deploy copies neither packageManager nor devEngines.packageManager from the workspace root. That removes the 15434 inheritance code in both stacks, the now-unused @pnpm/workspace.project-manifest-reader dependency of @pnpm/releasing.commands, and its tests. A single regression test per stack now checks that neither field is copied. The docs and changeset say the same.


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

@qodo-code-review

Copy link
Copy Markdown

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

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

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 review overview

🟡 Changes recommended

Both test suites remove coverage that the deployed project’s own package-manager pin is preserved.

Review effort: Balanced
Findings: 2 Medium severity

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

@zkochan

zkochan commented Sep 30, 2026

Copy link
Copy Markdown
Member

@coderabbitai resume

@zkochan

zkochan commented Sep 30, 2026

Copy link
Copy Markdown
Member

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Reviews resumed and review finished.

@zkochan
zkochan merged commit 2211354 into pnpm:main Sep 30, 2026
68 checks passed
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Pull request is closed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

npm refuses to run scripts when pnpm deploy copies devEngines.packageManager into the deployed package.json

4 participants