Skip to content

fix: print devEngines and packageManager warnings on stderr - #16587

Merged
zkochan merged 3 commits into
mainfrom
fix-16584
Oct 5, 2026
Merged

zkochan merged 3 commits into
mainfrom
fix-16584

Conversation

@zkochan

@zkochan zkochan commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Summary

With devEngines.runtime.onFail: "warn" (or a packageManager / devEngines.packageManager mismatch with onFail: "warn"), the warning was printed on stdout ahead of the command's own output, breaking pnpm cache path, pnpm list --json, pnpm run, pnpm exec, and others whose stdout a script reads.

Both versions had the bug (v11: cache path, run, exec; v12: also every --json command). Fixed in both: these pre-command warnings now go to stderr. --loglevel=error still hides them. Under --reporter=ndjson, v12 still emits them as records; v11 used to drop them (its ndjson sink attaches after the checks) and now prints them on stderr.

Closes #16584

Squash Commit Body

The runtime and package manager checks run before the command and
warned through the command's reporter, which writes to stdout. A command
whose stdout is a value a script reads, such as `pnpm cache path` or
`pnpm list --json`, got the warning prepended to its output.

In v12 the default reporter's pre-command warnings are written to stderr
with the same `[WARN]` label, still gated by the log level. The ndjson and
silent reporters are unchanged. In v11 the same warnings are printed with
`formatWarn` to stderr, unless the log level or the silent reporter hides
them. They bypass the v11 reporter because its ndjson sink attaches after
these checks and used to drop them.

Closes https://github.com/pnpm/pnpm/issues/16584

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.

Not addressed here: the issue also notes that pnpm_config_loglevel=error in the environment does not hide the warning. With the warning on stderr that no longer corrupts output.


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

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Project devEngines, package manager, and runtime warnings are written to stderr, keeping command results on stdout clear.
    • Warnings respect logging settings, including suppression at error-only log levels and with silent reporting.
    • NDJSON reporting continues to receive warnings through its output stream.

The runtime and package manager checks run before the command and
warned through the command's reporter, which writes to stdout. A command
whose stdout is a value a script reads, such as `pnpm cache path` or
`pnpm list --json`, got the warning prepended to its output.

In v12 the default reporter's pre-command warnings are written to stderr
with the same `[WARN]` label, still gated by the log level. The ndjson and
silent reporters are unchanged. In v11 the same warnings are printed with
`formatWarn` to stderr, unless the log level or reporter hides them; the
ndjson reporter still receives them as log records.

Closes #16584

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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

🧰 Additional context used
📚 Code guidelines (1)
AGENTS.md — auto-discovered

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: 669f6861-6449-4586-aefe-78d5ab04ef37
📥 Commits

Reviewing files that changed from the base of the PR and between 1af5d77 and 22f8b02.

📒 Files selected for processing (2)
  • pnpm11/pnpm/src/packageManagerCheck.ts
  • pnpm11/pnpm/test/packageManagerCheck.test.ts

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


📝 Walkthrough

Walkthrough

Project package-manager and runtime warnings are routed to stderr or the configured reporter. Tests verify that warnings do not appear in command stdout and that configured log levels suppress them.

Changes

Project warning routing

Layer / File(s) Summary
Rust CLI pre-command warning routing
pnpm/crates/cli/src/cli_args/reporter.rs, pnpm/crates/cli/src/cli_args/pre_command*, pnpm/crates/cli/src/cli_args/config_warnings.rs, pnpm/crates/cli/tests/suite/package_manager_check*, .changeset/devengines-warning-on-stderr.md
The CLI resolves a reporter type and routes pre-command warnings to stderr for default and append-only reporters, or through reporter_emit for NDJSON and silent reporters. Tests check warning streams and log-level suppression. The Changeset records patch releases for pnpm and pacquet.
pnpm 11 package-manager and runtime warning routing
pnpm11/pnpm/src/packageManagerCheck.ts, pnpm11/pnpm/test/packageManagerCheck.test.ts
Package-manager and runtime checks receive configuration and route warnings according to log level and reporter. Tests check stderr warnings, unchanged command stdout, and suppression at --loglevel=error.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Assessment against linked issues

Objective Addressed Explanation
[16584] Send devEngines runtime warnings to stderr so command stdout remains usable for machine-readable and other command output. ✅

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

Merge Risk: ⚪ Minimal · up to 22f8b

Project warnings are routed away from command output, with the described reporter and log-level handling. No material merge blocker is identified.

Architecture Summary

Architecture risk: 🔵 Low · up to 22f8b

The change affects 2 systems.

Changed systems: pnpm, pnpm11

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — pnpm (service) was modified; 7 changed files map to changed impact.
  • observed — pnpm11 (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in pnpm/crates/cli/src/cli_args/config_warnings.rs: The module documentation now identifies project checks that run before the command as stderr messages handled here, in addition to config-load warnings.
  • observed — Modified behavior in pnpm/crates/cli/src/cli_args/pre_command.rs: The reporter import now includes ReporterType and reporter_emit alongside ReporterFlags.
  • observed — Modified behavior in pnpm/crates/cli/src/cli_args/pre_command.rs: Reporter dependencies change from DefaultReporter and the Reporter trait to MaxLogLevel, ReporterType, and reporter_emit.
  • observed — Modified behavior in pnpm/crates/cli/src/cli_args/pre_command.rs: Adds reporter-aware warning routing: default and append-only output goes to stderr; NDJSON and silent output uses reporter_emit. The stderr handler accepts only global warning events and emits them when the default reporter’s maximum log level is at least Warn.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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/pnpm/src/packageManagerCheck.ts

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

pnpm11/pnpm/test/packageManagerCheck.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.

@codecov-commenter

codecov-commenter commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.30%. Comparing base (88d67fe) to head (22f8b02).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/cli/src/cli_args/pre_command.rs 92.30% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16587   +/-   ##
=======================================
  Coverage   92.29%   92.30%           
=======================================
  Files        1565     1565           
  Lines      207794   207806   +12     
=======================================
+ Hits       191788   191808   +20     
+ Misses      16006    15998    -8     

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

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.01     13.5±0.14ms    27.7 MB/sec    1.00     13.4±0.09ms    27.9 MB/sec
packument/parse                                  1.03     45.2±0.40µs  1466.9 MB/sec    1.00     44.0±0.31µs  1506.0 MB/sec
tarball/download_dependency                      1.06      4.8±0.20ms   911.1 KB/sec    1.00      4.5±0.08ms   961.8 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00    231.3±4.67ms 69.2 KElem/sec    1.01    233.4±1.53ms 68.6 KElem/sec
version_pick/repeated_ranges_file                1.00      4.6±0.05ms  6.7 KElem/sec    1.02      4.8±0.08ms  6.6 KElem/sec
version_pick/repeated_ranges_raw                 1.00      4.6±0.03ms  6.8 KElem/sec    1.00      4.6±0.05ms  6.8 KElem/sec
workspace_resolution/hoist_heavy                 1.00    228.7±1.40ms        ? ?/sec    1.00    229.1±3.87ms        ? ?/sec
workspace_sort/chained_projects                  1.00     18.3±0.82ms        ? ?/sec    1.02     18.7±0.54ms        ? ?/sec

@github-actions

github-actions Bot commented Oct 4, 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 2392.91 ms 2397.27 ms 0.2% 119.65 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1536.13 ms 1679.16 ms 9.3% 76.81 ms Inconclusive (overlapping samples)
isolated-fresh-restore-hot-cache-hot-store pacquet 233.69 ms 229.12 ms -2.0% 11.68 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 235.90 ms 244.53 ms 3.7% 11.80 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pacquet 7.61 ms 8.20 ms 7.7% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 7.02 ms 7.64 ms 8.8% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 9.36 ms 9.41 ms 0.5% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 9.30 ms 9.30 ms -0.0% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2511.55 ms 2519.70 ms 0.3% 125.58 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1468.74 ms 1460.99 ms -0.5% 73.44 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pacquet 436.17 ms 451.89 ms 3.6% 21.81 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 310.13 ms 299.95 ms -3.3% 15.51 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pacquet 1857.62 ms 1738.26 ms -6.4% 92.88 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 360.29 ms 359.87 ms -0.1% 18.01 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 261.56 ms 243.88 ms -6.8% 13.08 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 95.87 ms 96.73 ms 0.9% 4.79 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 215.96 ms 207.68 ms -3.8% 10.80 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 213.43 ms 209.52 ms -1.8% 10.67 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4495.25 ms 4468.47 ms -0.6% 224.76 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3560.22 ms 3539.27 ms -0.6% 178.01 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 228.48 ms 145.63 ms -36.3% 11.42 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pnpr 228.96 ms 228.57 ms -0.2% 11.45 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: 22f8b028420b

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.435 ± 0.089 2.349 2.609 1.62 ± 0.16
pacquet@main 2.430 ± 0.135 2.301 2.674 1.61 ± 0.17
pnpr@HEAD 1.606 ± 0.142 1.350 1.725 1.07 ± 0.14
pnpr@main 1.505 ± 0.138 1.342 1.703 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.43520033256,
      "stddev": 0.0889099610786022,
      "median": 2.3972709356600004,
      "user": 1.52694154,
      "system": 1.8472215199999997,
      "min": 2.3488368096600003,
      "max": 2.60929522766
    },
    {
      "command": "pacquet@main",
      "mean": 2.4301658980600003,
      "stddev": 0.1352102173942001,
      "median": 2.39291121616,
      "user": 1.5318529399999998,
      "system": 1.74231612,
      "min": 2.3011011096600003,
      "max": 2.6744993896600002
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.6058839124600002,
      "stddev": 0.14156920593739633,
      "median": 1.67915882216,
      "user": 1.49484344,
      "system": 1.62330962,
      "min": 1.34982949566,
      "max": 1.72508388666
    },
    {
      "command": "pnpr@main",
      "mean": 1.5048051053600002,
      "stddev": 0.13837026372848263,
      "median": 1.53612921566,
      "user": 1.37100674,
      "system": 1.66729752,
      "min": 1.3415353026599999,
      "max": 1.70328713666
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 230.8 ± 9.4 218.1 249.4 1.00
pacquet@main 231.6 ± 12.1 214.5 251.9 1.00 ± 0.07
pnpr@HEAD 245.7 ± 11.3 233.4 268.2 1.06 ± 0.07
pnpr@main 238.6 ± 10.4 221.3 256.1 1.03 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.23081568617999998,
      "stddev": 0.009359541962972595,
      "median": 0.22912215988,
      "user": 0.24072748000000002,
      "system": 0.5641662999999999,
      "min": 0.21814800788000002,
      "max": 0.24935656288000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.23155936788,
      "stddev": 0.012091698615031895,
      "median": 0.23369478238000002,
      "user": 0.25132988,
      "system": 0.5738833999999999,
      "min": 0.21447932388000002,
      "max": 0.25190353588
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.24571172238,
      "stddev": 0.011320437442997345,
      "median": 0.24453003638000004,
      "user": 0.25478958,
      "system": 0.5696174999999999,
      "min": 0.23338664388000002,
      "max": 0.26816089587999997
    },
    {
      "command": "pnpr@main",
      "mean": 0.23860877168000005,
      "stddev": 0.010424080437831763,
      "median": 0.23590445988000003,
      "user": 0.25259178000000004,
      "system": 0.5331016,
      "min": 0.22128309788,
      "max": 0.25612208688
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 8.2 ± 0.8 6.8 12.7 1.16 ± 0.14
pacquet@main 7.8 ± 0.6 6.7 10.3 1.09 ± 0.11
pnpr@HEAD 7.8 ± 0.7 6.6 10.3 1.09 ± 0.12
pnpr@main 7.1 ± 0.4 6.4 9.5 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.008225925343925234,
      "stddev": 0.000823471016256968,
      "median": 0.0082035779,
      "user": 0.004845380373831776,
      "system": 0.004193971401869161,
      "min": 0.0068199694000000005,
      "max": 0.012728673400000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.007778919220359284,
      "stddev": 0.000646345348049904,
      "median": 0.007614236400000001,
      "user": 0.004588261676646703,
      "system": 0.00394427401197605,
      "min": 0.006706006400000001,
      "max": 0.0103114744
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.007773385807051283,
      "stddev": 0.0006876859155702754,
      "median": 0.0076427489,
      "user": 0.0044529974358974355,
      "system": 0.004145669487179488,
      "min": 0.006645401400000001,
      "max": 0.0102766294
    },
    {
      "command": "pnpr@main",
      "mean": 0.0071144715091954,
      "stddev": 0.00043696159773452445,
      "median": 0.0070247989,
      "user": 0.004228637356321837,
      "system": 0.003553677011494252,
      "min": 0.0064150094,
      "max": 0.0094790124
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 9.5 ± 0.9 7.7 13.3 1.00 ± 0.12
pacquet@main 9.6 ± 0.9 8.0 14.0 1.01 ± 0.13
pnpr@HEAD 9.4 ± 0.8 7.9 12.3 1.00
pnpr@main 9.4 ± 0.9 7.8 13.1 1.00 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.009475025713333337,
      "stddev": 0.0008866111751501725,
      "median": 0.00941095408,
      "user": 0.005709055833333337,
      "system": 0.004602879166666666,
      "min": 0.00771118258,
      "max": 0.013266441580000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.009558907043636364,
      "stddev": 0.0009342862702694028,
      "median": 0.009362262080000001,
      "user": 0.005697673636363634,
      "system": 0.004643853636363636,
      "min": 0.00801139558,
      "max": 0.01396695258
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.009432912253076919,
      "stddev": 0.0007705040457125665,
      "median": 0.00929915508,
      "user": 0.006022440923076923,
      "system": 0.004140901923076925,
      "min": 0.007888835580000001,
      "max": 0.012295063580000001
    },
    {
      "command": "pnpr@main",
      "mean": 0.00943812229268657,
      "stddev": 0.0008534393854242983,
      "median": 0.00930248208,
      "user": 0.005858467611940295,
      "system": 0.004358975373134325,
      "min": 0.00783323158,
      "max": 0.01305873058
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.519 ± 0.029 2.464 2.579 1.69 ± 0.13
pacquet@main 2.510 ± 0.017 2.479 2.535 1.68 ± 0.12
pnpr@HEAD 1.506 ± 0.112 1.380 1.681 1.01 ± 0.11
pnpr@main 1.491 ± 0.110 1.379 1.750 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.51925927062,
      "stddev": 0.02897543406905499,
      "median": 2.51970316882,
      "user": 1.8864481999999998,
      "system": 1.5524908599999996,
      "min": 2.46369971082,
      "max": 2.57868943482
    },
    {
      "command": "pacquet@main",
      "mean": 2.5100595928199994,
      "stddev": 0.017181011069476584,
      "median": 2.51154688932,
      "user": 1.8388333,
      "system": 1.5595085599999996,
      "min": 2.47892109882,
      "max": 2.53459217782
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5062851412199998,
      "stddev": 0.11178618157340842,
      "median": 1.4609921198200002,
      "user": 1.0960493,
      "system": 1.2550208599999997,
      "min": 1.38041103782,
      "max": 1.68111416682
    },
    {
      "command": "pnpr@main",
      "mean": 1.4912650263200002,
      "stddev": 0.110138431369562,
      "median": 1.46873907332,
      "user": 1.0400953999999998,
      "system": 1.2838007599999997,
      "min": 1.37878216582,
      "max": 1.7497648808200001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 543.4 ± 158.6 436.2 822.3 1.78 ± 0.53
pacquet@main 446.4 ± 40.5 405.2 549.7 1.46 ± 0.16
pnpr@HEAD 304.8 ± 17.9 285.8 348.0 1.00
pnpr@main 311.7 ± 11.6 295.7 331.6 1.02 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.54336890948,
      "stddev": 0.1586245176661163,
      "median": 0.45188772678,
      "user": 0.7220484,
      "system": 0.8912775400000001,
      "min": 0.43615863028,
      "max": 0.82225747328
    },
    {
      "command": "pacquet@main",
      "mean": 0.4464058677800001,
      "stddev": 0.04045138153219034,
      "median": 0.43617221128,
      "user": 0.6007737000000001,
      "system": 0.71709674,
      "min": 0.40522969328,
      "max": 0.54973902428
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3048146179800001,
      "stddev": 0.017882641650436515,
      "median": 0.29995423978,
      "user": 0.26166239999999996,
      "system": 0.60567944,
      "min": 0.28578744528,
      "max": 0.34800026228000003
    },
    {
      "command": "pnpr@main",
      "mean": 0.31168208127999997,
      "stddev": 0.011603980385225093,
      "median": 0.31012712978,
      "user": 0.27159999999999995,
      "system": 0.5957081399999999,
      "min": 0.29571793028,
      "max": 0.33163977028
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.735 ± 0.030 1.686 1.782 4.82 ± 0.14
pacquet@main 1.862 ± 0.102 1.736 1.982 5.17 ± 0.31
pnpr@HEAD 0.360 ± 0.008 0.348 0.376 1.00
pnpr@main 0.361 ± 0.005 0.355 0.372 1.00 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7354617193,
      "stddev": 0.03003657299389088,
      "median": 1.7382556268,
      "user": 1.1187206800000002,
      "system": 1.1516741,
      "min": 1.6856895418,
      "max": 1.7819303308
    },
    {
      "command": "pacquet@main",
      "mean": 1.8621748088,
      "stddev": 0.10173495280945963,
      "median": 1.8576164538,
      "user": 1.37215758,
      "system": 1.4537444999999998,
      "min": 1.7357257577999998,
      "max": 1.9823850168000001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3598564337,
      "stddev": 0.008455593952479582,
      "median": 0.35987129529999995,
      "user": 0.3386583799999999,
      "system": 0.7788337000000001,
      "min": 0.3482395048,
      "max": 0.3759476218
    },
    {
      "command": "pnpr@main",
      "mean": 0.3610173786,
      "stddev": 0.005448281302593207,
      "median": 0.36029076429999995,
      "user": 0.33483078,
      "system": 0.7851855,
      "min": 0.3546186908,
      "max": 0.3716274238
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 246.0 ± 11.2 228.6 268.3 2.57 ± 0.15
pacquet@main 264.1 ± 17.5 237.3 296.8 2.76 ± 0.21
pnpr@HEAD 96.7 ± 3.6 91.5 104.3 1.01 ± 0.05
pnpr@main 95.8 ± 3.7 90.4 102.9 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.24603029540000002,
      "stddev": 0.011237029393283261,
      "median": 0.24387530990000003,
      "user": 0.23123216666666668,
      "system": 0.08506936666666669,
      "min": 0.22860321340000003,
      "max": 0.2682713944
    },
    {
      "command": "pacquet@main",
      "mean": 0.26409129167272727,
      "stddev": 0.01748801070770263,
      "median": 0.2615647794,
      "user": 0.2297715454545454,
      "system": 0.09628424545454545,
      "min": 0.23728001440000002,
      "max": 0.2968213194
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09673541084827587,
      "stddev": 0.0035790094061468286,
      "median": 0.0967335444,
      "user": 0.03755196551724138,
      "system": 0.017253262068965516,
      "min": 0.0914875954,
      "max": 0.1043277264
    },
    {
      "command": "pnpr@main",
      "mean": 0.09582611049677421,
      "stddev": 0.0037020286336621575,
      "median": 0.0958709854,
      "user": 0.03715777419354839,
      "system": 0.016757248387096774,
      "min": 0.0904124884,
      "max": 0.10290917940000001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 208.2 ± 11.9 188.7 221.2 1.00
pacquet@main 231.4 ± 42.4 187.8 312.4 1.11 ± 0.21
pnpm@HEAD 3786.2 ± 313.2 3418.8 4448.1 18.19 ± 1.83
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.20818348053555555,
      "stddev": 0.011884633416603115,
      "median": 0.20767548998,
      "user": 0.20922547111111112,
      "system": 0.03872276,
      "min": 0.18873425098,
      "max": 0.22124728498
    },
    {
      "command": "pacquet@main",
      "mean": 0.23135310320222224,
      "stddev": 0.042378999821273175,
      "median": 0.21595667798,
      "user": 0.23719602666666667,
      "system": 0.05232787111111112,
      "min": 0.18784271498,
      "max": 0.31239976698000005
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.78618431298,
      "stddev": 0.313229399920403,
      "median": 3.74015925598,
      "user": 5.9149582488888885,
      "system": 0.40478364888888885,
      "min": 3.41875681898,
      "max": 4.448091344980001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 210.4 ± 8.6 198.4 225.8 1.00
pacquet@main 215.1 ± 8.5 204.7 237.8 1.02 ± 0.06
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2104107810971429,
      "stddev": 0.008571572105233996,
      "median": 0.20952044324000002,
      "user": 0.16271527714285713,
      "system": 0.08517303142857144,
      "min": 0.19838428624,
      "max": 0.22579199724000001
    },
    {
      "command": "pacquet@main",
      "mean": 0.21514361970153845,
      "stddev": 0.008469860229222855,
      "median": 0.21343386624000002,
      "user": 0.1671471123076923,
      "system": 0.08600080615384617,
      "min": 0.20472037524,
      "max": 0.23776219924000003
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.514 ± 0.114 4.419 4.769 1.25 ± 0.06
pacquet@main 4.559 ± 0.154 4.445 4.921 1.27 ± 0.06
pnpr@HEAD 3.607 ± 0.132 3.483 3.851 1.00 ± 0.05
pnpr@main 3.600 ± 0.133 3.468 3.942 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.513533564559999,
      "stddev": 0.11426698162391496,
      "median": 4.46846854276,
      "user": 1.8398962399999998,
      "system": 2.01727734,
      "min": 4.41868480426,
      "max": 4.76912487126
    },
    {
      "command": "pacquet@main",
      "mean": 4.55865835716,
      "stddev": 0.15438802230109408,
      "median": 4.49524939576,
      "user": 1.75542724,
      "system": 1.86853814,
      "min": 4.44492459126,
      "max": 4.92064571826
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.60690356996,
      "stddev": 0.1315597493020706,
      "median": 3.53926613476,
      "user": 1.5614739399999997,
      "system": 1.8074958399999996,
      "min": 3.48273406426,
      "max": 3.85131392926
    },
    {
      "command": "pnpr@main",
      "mean": 3.60014226816,
      "stddev": 0.13327409864056106,
      "median": 3.56022402576,
      "user": 1.6132134400000002,
      "system": 1.82450944,
      "min": 3.46796283326,
      "max": 3.9418245612600002
    }
  ]
}

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 148.9 ± 13.4 136.7 196.9 1.00
pacquet@main 224.8 ± 18.7 185.3 249.7 1.51 ± 0.18
pnpr@HEAD 228.2 ± 11.7 209.3 249.2 1.53 ± 0.16
pnpr@main 225.4 ± 10.3 210.1 243.7 1.51 ± 0.15
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.14892993350947367,
      "stddev": 0.013411927584030963,
      "median": 0.14562865372,
      "user": 0.1860562115789474,
      "system": 0.18095673052631575,
      "min": 0.13668627772,
      "max": 0.19691029172
    },
    {
      "command": "pacquet@main",
      "mean": 0.22481252621999995,
      "stddev": 0.018671299708854425,
      "median": 0.22848184472,
      "user": 0.2961367466666667,
      "system": 0.24519593666666664,
      "min": 0.18526218472,
      "max": 0.24967743471999998
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.22815612413666667,
      "stddev": 0.011730572886611506,
      "median": 0.22857397322,
      "user": 0.27192557999999994,
      "system": 0.23856285333333335,
      "min": 0.20926719672,
      "max": 0.24921790772
    },
    {
      "command": "pnpr@main",
      "mean": 0.22543350272000004,
      "stddev": 0.01032189423787528,
      "median": 0.22896330472,
      "user": 0.261234489090909,
      "system": 0.25001597454545454,
      "min": 0.21005968672,
      "max": 0.24373019272000002
    }
  ]
}

@zkochan
zkochan marked this pull request as ready for review October 4, 2026 23:26
Copilot AI balanced review requested due to automatic review settings October 4, 2026 23:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@zkochan

zkochan commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Print pre-command project warnings on stderr in pnpm 11 and 12

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Move pre-command runtime and package manager warnings to stderr, preserving script-readable
 stdout.
• Preserve log-level suppression and ndjson reporter behavior in both CLI versions.
• Add regression tests and patch release notes for pnpm and pacquet.
Diagram

graph TD
  Checks["Project checks"] --> Route{"Reporter and log level"} --> Default["Default warning"] --> Stderr["stderr"]
  Route --> Ndjson["ndjson records"]
  Route --> Silent["Suppress warning"]
  Command["CLI command"] --> Stdout["stdout"]
Loading
High-Level Assessment

Targeting pre-command warnings is the right scope: redirecting all reporter output would change command-reporting behavior. The separate paths retain ndjson handling and log-level filtering while protecting command stdout.

Files changed (10) +151 / -34

Bug fix (4) +59 / -22
pre_command.rsRoute Rust pre-command warnings by reporter +25/-4

Route Rust pre-command warnings by reporter

• Sends default and append-only pre-command warnings to stderr while preserving ndjson and silent reporter sinks. Applies the stderr path to an unusable pinned-pnpm warning and respects the default reporter's log-level ceiling.

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

execute.rsMove minimum-release-age warning to stderr +4/-4

Move minimum-release-age warning to stderr

• Uses the pre-command stderr sink when a pnpm version cannot be checked against minimumReleaseAge.

pnpm/crates/cli/src/cli_args/pre_command/execute.rs

input.rsSelect the pre-command warning sink +2/-2

Select the pre-command warning sink

• Resolves the configured reporter and maps it to the appropriate warning emitter before command execution.

pnpm/crates/cli/src/cli_args/pre_command/input.rs

packageManagerCheck.tsPrint pnpm 11 project-check warnings on stderr +28/-12

Print pnpm 11 project-check warnings on stderr

• Routes runtime and package manager check warnings through a helper that prints formatted warnings to stderr. It preserves silent and error log-level suppression and passes ndjson warnings to the reporter.

pnpm11/pnpm/src/packageManagerCheck.ts

Refactor (1) +2 / -2
reporter.rsExpose the configured reporter type +2/-2

Expose the configured reporter type

• Changes pre-command reporter configuration to return the resolved reporter type, allowing warning routing without changing command reporter selection.

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

Tests (3) +82 / -9
package_manager_check.rsAssert Rust package manager warnings use stderr +2/-1

Assert Rust package manager warnings use stderr

• Checks that a package manager mismatch warning appears on stderr rather than stdout.

pnpm/crates/cli/tests/suite/package_manager_check.rs

runtime.rsCover Rust runtime warning output and filtering +37/-1

Cover Rust runtime warning output and filtering

• Verifies that runtime mismatch warnings appear on stderr, leave 'cache path' stdout as one line, and remain hidden by '--loglevel=error'.

pnpm/crates/cli/tests/suite/package_manager_check/runtime.rs

packageManagerCheck.test.tsCover pnpm 11 warning streams and suppression +43/-7

Cover pnpm 11 warning streams and suppression

• Updates package manager and runtime assertions to expect stderr warnings, including under Corepack. Adds 'cache path' stdout-isolation and '--loglevel=error' regression tests.

pnpm11/pnpm/test/packageManagerCheck.test.ts

Documentation (2) +8 / -1
devengines-warning-on-stderr.mdDocument the warning-stream fix +6/-0

Document the warning-stream fix

• Adds patch release notes for pnpm and pacquet explaining that project-pin warnings no longer contaminate command stdout.

.changeset/devengines-warning-on-stderr.md

config_warnings.rsClarify the scope of stderr warnings +2/-1

Clarify the scope of stderr warnings

• Documents that the existing stderr warning facility also serves project checks made before command execution.

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

@qodo-code-review

qodo-code-review Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Remediation recommended

1. A comment describes discarded behavior 📘 Rule violation ⚙ Maintainability ⭐ New
Description
The new warnAboutProject comment says the ndjson reporter attaches later and “would drop” these
warnings, describing a prior implementation detail rather than the current contract. Future readers
may interpret the historical reporter timing as an active behavior guarantee when the function now
deliberately bypasses that reporter.
Code

pnpm11/pnpm/src/packageManagerCheck.ts[R236-237]

+ * from stdout. They bypass the reporter, as the ndjson one attaches after these
+ * checks and would drop them.
Relevance

●●● Strong

Recent precedent accepted rewriting comments that describe historical behavior into current-contract
wording.

PR-#15214
PR-#14129

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed comment explicitly states that the ndjson reporter “would drop” the warnings, which is
historical implementation information prohibited by the checklist rule; the warning itself is
introduced in the focused diff range.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm11/pnpm/src/packageManagerCheck.ts[236-237]

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 comment above `warnAboutProject` describes the reporter's discarded historical behavior rather than only documenting the current warning contract.

## Fix Focus Areas
- pnpm11/pnpm/src/packageManagerCheck.ts[233-241]

## Recommended Fix
Remove the historical explanation that the ndjson reporter would drop warnings. Keep only the current rationale that pre-command project warnings are written directly to stderr so they do not contaminate command stdout, including under reporter modes where appropriate.

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

Dismiss ↗ | View ↗


2. Version 11 loses structured pin warnings 📘 Rule violation ⌂ Architecture
Description
warnAboutProject sends ndjson warnings through globalWarn before the v11 reporter is
initialized. When a project pin mismatches under --reporter=ndjson, that record has no configured
output sink, while v12 routes the corresponding pre-command warning to its ndjson reporter.
Code

pnpm11/pnpm/src/packageManagerCheck.ts[R241-243]

+  if (config.reporter === 'ndjson') {
+    globalWarn(message)
+    return
Relevance

●●● Strong

Accepted precedent requires warnings emitted before reporter initialization to retain a visible,
correctly routed output sink.

PR-#13495
PR-#15407

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new branch relies on globalWarn for ndjson output, but the project checks run during config
loading and ndjson output is configured only afterward. Rust selects its ndjson sink at the
pre-command check, leaving the implementations with different warning presence for the same reporter
choice.

Rule 713428: Keep pnpm v11 and v12 observable behavior aligned when fixing shared bugs
pnpm11/pnpm/src/packageManagerCheck.ts[239-245]
pnpm11/pnpm/src/main.ts[145-160]
pnpm11/pnpm/src/main.ts[197-205]
pnpm11/pnpm/src/reporter/index.ts[43-51]
pnpm/crates/cli/src/cli_args/pre_command.rs[316-320]

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 v11 ndjson branch emits project warnings before its reporter is initialized, so the records are lost while v12 emits them.

## Fix Focus Areas
- pnpm11/pnpm/src/packageManagerCheck.ts[239-245]
- pnpm11/pnpm/src/main.ts[145-160]
- pnpm11/pnpm/src/main.ts[197-205]

## Recommended Fix
Initialize the selected ndjson output sink before the project checks, without initializing it twice when command execution begins. Add a v11 CLI regression test asserting that a pin mismatch produces an ndjson record.

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

Dismiss ↗ | View ↗


3. Age-check failures corrupt JSON logs 🐞 Bug ≡ Correctness
Description
mature_version_to_record sends its lookup-failure warning directly to emit_warning_on_stderr
instead of resolving the selected reporter. When a project uses minimumReleaseAge and the version
lookup fails under --reporter=ndjson, a plain [WARN] line appears on stderr alongside the
reporter's JSON records.
Code

pnpm/crates/cli/src/cli_args/pre_command/execute.rs[94]

+                emit_warning_on_stderr,
Relevance

●●● Strong

Accepted reporter-routing precedents require pre-command warnings to honor configured sinks and
preserve structured output.

PR-#15407
PR-#16437

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The sync path calls the age lookup, its failure branch now hardcodes the plain-stderr emitter, and
that emitter calls emit_config_warning. The ndjson reporter independently writes JSON records to
stderr, so the new warning shares that stream without being encoded as a record.

pnpm/crates/cli/src/cli_args/pre_command/execute.rs[32-40]
pnpm/crates/cli/src/cli_args/pre_command/execute.rs[89-103]
pnpm/crates/cli/src/cli_args/pre_command.rs[316-329]
pnpm/crates/cli/src/cli_args/config_warnings.rs[30-41]
pnpm/crates/reporter/src/lib.rs[650-669]

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 failed minimum-release-age lookup writes a human-readable warning into the ndjson reporter's stderr stream.
## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/pre_command/execute.rs[89-103]
- pnpm/crates/cli/src/cli_args/pre_command.rs[316-329]
## Recommended Fix
Carry the resolved reporter choice into the environment-lockfile sync path and route this warning through `pre_command_emit`, so ndjson receives a JSON record while default and append-only warnings remain on stderr.

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

Dismiss ↗ | View ↗


View medium (1)
4. Both release lines share one changeset 📘 Rule violation § Compliance
Description
The new changeset lists pnpm and pacquet together rather than giving each affected CLI package
its own changeset. This PR modifies both the v11 TypeScript and v12 Rust implementations, so their
release notes cannot be managed as separate package-targeted entries.
Code

.changeset/devengines-warning-on-stderr.md[R2-3]

+"pnpm": patch
+"pacquet": patch
Evidence
The frontmatter places both package names in one newly added changeset, while the diff contains
changes to the v11 and v12 CLI implementations. Rule 713436 explicitly requires separate,
package-specific changeset files for a PR touching both.

Rule 713436: Changesets for pnpm v11 vs v12 (pacquet) must target the correct package and bump type
.changeset/devengines-warning-on-stderr.md[1-6]
pnpm11/pnpm/src/packageManagerCheck.ts[239-245]
pnpm/crates/cli/src/cli_args/pre_command.rs[316-330]

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

## Issue description
One changeset targets both CLI release lines, although the checklist requires a separate changeset for each when both implementations change.

## Fix Focus Areas
- .changeset/devengines-warning-on-stderr.md[1-6]

## Recommended Fix
Keep a patch changeset targeting only `pnpm` and add a separate changeset targeting only `pacquet`. Give each entry wording accurate for its release line.

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

Dismiss ↗ | View ↗


Grey Divider

Context sources
✅ Compliance rules (platform): 63 rules
✅ Skills: review-code
✅ Cross-repo context — repo relationships
  Explored: repo: pnpm/update (sha: fcaa952e) — View relationship
  Explored: repo: pnpm/setup (sha: fbda4c85) — View relationship
  Explored: repo: pnpm/exec (sha: d9dca8d2) — View relationship
Review mode: Auto: 🚀 Fast: This is a localized stderr-routing change with a focused regression test and no security, performance, API, or migration risk.

Grey Divider

Tip of the day
💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 22f8b02

Results up to commit 1af5d77 ⚖️ Balanced


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


Remediation recommended
1. Version 11 loses structured pin warnings 📘 Rule violation ⌂ Architecture
Description
warnAboutProject sends ndjson warnings through globalWarn before the v11 reporter is
initialized. When a project pin mismatches under --reporter=ndjson, that record has no configured
output sink, while v12 routes the corresponding pre-command warning to its ndjson reporter.
Code

pnpm11/pnpm/src/packageManagerCheck.ts[R241-243]

+  if (config.reporter === 'ndjson') {
+    globalWarn(message)
+    return
Relevance

●●● Strong

Accepted precedent requires warnings emitted before reporter initialization to retain a visible,
correctly routed output sink.

PR-#13495
PR-#15407

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new branch relies on globalWarn for ndjson output, but the project checks run during config
loading and ndjson output is configured only afterward. Rust selects its ndjson sink at the
pre-command check, leaving the implementations with different warning presence for the same reporter
choice.

Rule 713428: Keep pnpm v11 and v12 observable behavior aligned when fixing shared bugs
pnpm11/pnpm/src/packageManagerCheck.ts[239-245]
pnpm11/pnpm/src/main.ts[145-160]
pnpm11/pnpm/src/main.ts[197-205]
pnpm11/pnpm/src/reporter/index.ts[43-51]
pnpm/crates/cli/src/cli_args/pre_command.rs[316-320]

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 v11 ndjson branch emits project warnings before its reporter is initialized, so the records are lost while v12 emits them.

## Fix Focus Areas
- pnpm11/pnpm/src/packageManagerCheck.ts[239-245]
- pnpm11/pnpm/src/main.ts[145-160]
- pnpm11/pnpm/src/main.ts[197-205]

## Recommended Fix
Initialize the selected ndjson output sink before the project checks, without initializing it twice when command execution begins. Add a v11 CLI regression test asserting that a pin mismatch produces an ndjson record.

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

Dismiss ↗ | View ↗


2. Age-check failures corrupt JSON logs 🐞 Bug ≡ Correctness
Description
mature_version_to_record sends its lookup-failure warning directly to emit_warning_on_stderr
instead of resolving the selected reporter. When a project uses minimumReleaseAge and the version
lookup fails under --reporter=ndjson, a plain [WARN] line appears on stderr alongside the
reporter's JSON records.
Code

pnpm/crates/cli/src/cli_args/pre_command/execute.rs[94]

+                emit_warning_on_stderr,
Relevance

●●● Strong

Accepted reporter-routing precedents require pre-command warnings to honor configured sinks and
preserve structured output.

PR-#15407
PR-#16437

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The sync path calls the age lookup, its failure branch now hardcodes the plain-stderr emitter, and
that emitter calls emit_config_warning. The ndjson reporter independently writes JSON records to
stderr, so the new warning shares that stream without being encoded as a record.

pnpm/crates/cli/src/cli_args/pre_command/execute.rs[32-40]
pnpm/crates/cli/src/cli_args/pre_command/execute.rs[89-103]
pnpm/crates/cli/src/cli_args/pre_command.rs[316-329]
pnpm/crates/cli/src/cli_args/config_warnings.rs[30-41]
pnpm/crates/reporter/src/lib.rs[650-669]

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 failed minimum-release-age lookup writes a human-readable warning into the ndjson reporter's stderr stream.
## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/pre_command/execute.rs[89-103]
- pnpm/crates/cli/src/cli_args/pre_command.rs[316-329]
## Recommended Fix
Carry the resolved reporter choice into the environment-lockfile sync path and route this warning through `pre_command_emit`, so ndjson receives a JSON record while default and append-only warnings remain on stderr.

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

Dismiss ↗ | View ↗


3. Both release lines share one changeset 📘 Rule violation § Compliance
Description
The new changeset lists pnpm and pacquet together rather than giving each affected CLI package
its own changeset. This PR modifies both the v11 TypeScript and v12 Rust implementations, so their
release notes cannot be managed as separate package-targeted entries.
Code

.changeset/devengines-warning-on-stderr.md[R2-3]

+"pnpm": patch
+"pacquet": patch
Evidence
The frontmatter places both package names in one newly added changeset, while the diff contains
changes to the v11 and v12 CLI implementations. Rule 713436 explicitly requires separate,
package-specific changeset files for a PR touching both.

Rule 713436: Changesets for pnpm v11 vs v12 (pacquet) must target the correct package and bump type
.changeset/devengines-warning-on-stderr.md[1-6]
pnpm11/pnpm/src/packageManagerCheck.ts[239-245]
pnpm/crates/cli/src/cli_args/pre_command.rs[316-330]

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

## Issue description
One changeset targets both CLI release lines, although the checklist requires a separate changeset for each when both implementations change.

## Fix Focus Areas
- .changeset/devengines-warning-on-stderr.md[1-6]

## Recommended Fix
Keep a patch changeset targeting only `pnpm` and add a separate changeset targeting only `pacquet`. Give each entry wording accurate for its release line.

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

Dismiss ↗ | View ↗


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.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Oct 4, 2026
The ndjson reporter attaches after the project checks run, so a warning
logged through it was dropped. Print it on stderr like the others.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 4, 2026 23:38

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.

@zkochan

zkochan commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Qodo findings:

  1. v11 loses structured pin warnings under ndjson. Real, but it predates this PR. Before and after the first commit, --reporter=ndjson in v11 dropped the warning, because the ndjson sink attaches after the checks. Fixed in 22f8b02: v11 now prints these warnings on stderr under ndjson too, and there's a regression test. They come out as [WARN] text rather than a JSON record. Emitting a record would mean attaching the ndjson sink before config-dependent checks, which is more than this fix needs.
  2. Age-check failure under ndjson in v12. Not acting. Before this PR, that warning already ignored the selected reporter and went to stdout as plain text. This PR only moves it to stderr. Routing it through the reporter means threading the reporter choice into the switch path, which is out of scope here.
  3. One changeset for both lines. Not acting. AGENTS.md allows a single changeset naming both pnpm and pacquet when the same release-note text applies, and it does here. Both CLIs now keep these warnings off stdout.

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

@qodo-code-review

Copy link
Copy Markdown

Qodo findings:

  1. v11 loses structured pin warnings under ndjson. Real, but it predates this PR. Before and after the first commit, --reporter=ndjson in v11 dropped the warning, because the ndjson sink attaches after the checks. Fixed in 22f8b02: v11 now prints these warnings on stderr under ndjson too, and there's a regression test. They come out as [WARN] text rather than a JSON record. Emitting a record would mean attaching the ndjson sink before config-dependent checks, which is more than this fix needs.
  2. Age-check failure under ndjson in v12. Not acting. Before this PR, that warning already ignored the selected reporter and went to stdout as plain text. This PR only moves it to stderr. Routing it through the reporter means threading the reporter choice into the switch path, which is out of scope here.
  3. One changeset for both lines. Not acting. AGENTS.md allows a single changeset naming both pnpm and pacquet when the same release-note text applies, and it does here. Both CLIs now keep these warnings off stdout.

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

Thanks for the context. My assessment is:

  • finding 1: Your explanation confirms the observable behavior: v11 emits a plain stderr warning under --reporter=ndjson, not an ndjson record. However, the current implementation explicitly bypasses the reporter (packageManagerCheck.ts:233-237), so the cross-version structured-output discrepancy remains. If plain stderr is an intentional scope decision, this finding is reasonable to reject as out of scope—but it is not disproved by being pre-existing.
  • finding 2: Pre-existing behavior is relevant, but this PR changes the warning’s destination to stderr while ndjson also uses stderr. The hardcoded emit_warning_on_stderr at pre_command/execute.rs:94 therefore still permits human-readable text in the structured stream. This remains a valid compatibility concern, even if reporter threading is deferred.
  • finding 3: I agree this finding is not supported by the repository guidance. AGENTS.md explicitly permits one changeset when the same release-note text applies to every target, and this changeset describes the same user-visible behavior for both CLIs.

I have not dismissed any findings because that requires an explicit dismissal request. Findings 1 and 2 remain scope/design decisions; finding 3 appears dismissible as a false positive.

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 22f8b02

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

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

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.

@zkochan

zkochan commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Qodo's new finding, "A comment describes discarded behavior": not acting. The comment states a current fact. In main.ts the ndjson reporter is still set up after these checks run, so logging through it would lose the warning. That is the reason this function bypasses it, and it isn't history. Findings 2–4 repeat the earlier round, and my earlier comment answers them.


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

@qodo-code-review

Copy link
Copy Markdown

Qodo's new finding, "A comment describes discarded behavior": not acting. The comment states a current fact. In main.ts the ndjson reporter is still set up after these checks run, so logging through it would lose the warning. That is the reason this function bypasses it, and it isn't history. Findings 2–4 repeat the earlier round, and my earlier comment answers them.


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

Your point is valid: readCommandConfig() runs handlePackageManagerAndRuntimes() before runCommandWithConfig() calls initCommandReporter() in pnpm11/pnpm/src/main.ts, so the comment describes the current execution order, not merely historical behavior.

finding 1 is therefore a maintainability/style recommendation rather than a correctness issue. The concern is that “the ndjson one attaches after these checks and would drop them” documents reporter initialization internals instead of the intended contract—warnings are deliberately written to stderr so they do not contaminate command output. I would not treat the finding as evidence that the routing logic is wrong.

I have not taken action on findings 2–4; your message does not explicitly request dismissal or implementation.

@zkochan
zkochan merged commit 56455e0 into main Oct 5, 2026
68 checks passed
@zkochan
zkochan deleted the fix-16584 branch October 5, 2026 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

devEngines onFail: "warn" prints its warning on stdout, which breaks --json output

3 participants