Skip to content

feat(resolver): emit pnpm:deprecation events for deprecated packages - #13135

Merged
zkochan merged 7 commits into
pnpm:mainfrom
kairosci:paquet-deprecation-warnings
Jul 19, 2026
Merged

zkochan merged 7 commits into
pnpm:mainfrom
kairosci:paquet-deprecation-warnings

Conversation

@kairosci

@kairosci kairosci commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements native Rust deprecation warning emission for pacquet. When a package's registry manifest carries a deprecated field and its name+version is not covered by pnpm.allowedDeprecatedVersions, the resolver now emits a pnpm:deprecation NDJSON event through the reporter — matching the legacy TypeScript implementation at pnpm11/installing/deps-resolver/src/resolveDependencies.ts:2119.

The default reporter renders direct-dependency deprecations immediately and buffers transitive ones into a single summary line at resolution_done, matching @pnpm/cli.default-reporter's reportDeprecations.ts.

Related to #11633

Squash Commit Body

feat(resolver): emit pnpm:deprecation events for deprecated packages

Detect deprecated package versions during resolution and emit
pnpm:deprecation NDJSON events, matching the TypeScript CLI's
deprecationLogger behavior.

The deprecation check runs once per newly-resolved package (on first
dedup-map insert). It extracts the `deprecated` field from the registry
manifest, checks it against `pnpm.allowedDeprecatedVersions` using
node-semver range satisfaction, and forwards the notification to the
install layer via a DeprecationLogFn callback (same pattern as the
existing SkippedOptionalLogFn).

The default reporter renders direct-dep deprecations immediately and
buffers transitive ones into a summary line at resolution_done.

Related to #11633

Checklist

  • Added or updated tests.

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added pnpm:deprecation NDJSON log events when deprecated packages are detected during dependency resolution.
    • Reporter now renders deprecations as red warning lines: direct deprecations show immediately, while subdependency deprecations are buffered and emitted as a single aggregated summary at resolution completion (with zoomed deprecations omitting extra detail when the prefix differs).
    • Added workspace-level suppression to hide deprecations for configured name@version semver ranges.
  • Tests
    • Expanded NDJSON wire-serialization and rendering tests for direct vs transitive deprecations.

@kairosci
kairosci requested a review from zkochan as a code owner July 18, 2026 23:12
Copilot AI review requested due to automatic review settings July 18, 2026 23:12
@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 →

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@coderabbitai

coderabbitai Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This change adds package deprecation events to dependency resolution, forwards them through fresh-lockfile installs, serializes them as pnpm:deprecation, and renders direct warnings immediately while summarizing transitive deprecations after resolution.

Changes

Package deprecation reporting

Layer / File(s) Summary
Deprecation event contracts
pnpm/crates/reporter/src/lib.rs, pnpm/crates/resolving-deps-resolver/src/{lib.rs,resolve_dependency_tree.rs,resolve_workspace.rs}, pnpm/crates/resolving-deps-resolver/src/resolve_workspace/tests.rs
Defines deprecation payloads, reporter serialization, resolver callback configuration, workspace wiring, and updated test options.
Resolver detection and filtering
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs
Extracts manifest deprecation text, checks allowed semver ranges, and emits notifications for newly resolved packages.
Install reporter wiring
pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
Passes deprecation settings to workspace resolution, converts resolver notifications into reporter events, and emits ResolutionDone after deprecation events.
Deprecation rendering and validation
pnpm/crates/default-reporter/src/state.rs, pnpm/crates/default-reporter/tests/render.rs, pnpm/crates/reporter/src/tests.rs, .changeset/pacquet-deprecation-warnings.md
Renders direct warnings, aggregates transitive entries at resolution completion, validates event serialization and rendering, and documents the release change.

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

Sequence Diagram(s)

sequenceDiagram
  participant Resolver as WorkspaceTreeCtx
  participant Install as install_with_fresh_lockfile
  participant Reporter as ReporterState
  Resolver->>Resolver: inspect resolved manifest
  Resolver->>Install: emit Deprecation
  Install->>Reporter: send LogEvent::Deprecation
  Reporter->>Reporter: render direct or buffer transitive event
  Install->>Reporter: send Stage::ResolutionDone
  Reporter->>Reporter: flush transitive summary
Loading

Suggested labels: product: pacquet

Suggested reviewers: copilot, zkochan

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5

The two blocking issues from prior rounds are fixed; one display-layer edge case remains in concurrent resolution for packages that appear as both direct and transitive dependencies.

The core logic is correct and well-tested. The remaining concern is a reporter display race: when a package is resolved concurrently as a transitive dep before its direct dep, it can appear in both the immediate per-package warning and the subdep summary line — a visual inconsistency, not a functional failure.

pnpm/crates/default-reporter/src/state.rs — the interaction between deprecated_subdeps buffering and the deprecation_depths re-emit mechanism for the direct+transitive case.

Reviews (8): Last reviewed commit: "fix(resolver): drop unnecessary block sc..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

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

Inline comments:
In `@pnpm/crates/default-reporter/src/state.rs`:
- Around line 1105-1124: Update flush_deprecated_subdeps to deduplicate the
formatted package names after sorting and before joining them for the summary.
Preserve the existing ordering and count behavior unless the count is intended
to represent displayed unique names.

In `@pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs`:
- Around line 1683-1716: Extract the package name and version from
result.name_ver before the deprecation check, using alias and an empty-string
fallback as appropriate. Pass the extracted pkg_version, not deprecated, as the
second argument to is_deprecation_allowed, and reuse the extracted pkg_name and
pkg_version when constructing Deprecation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e6d2ade-efcb-4c6a-b2a6-f0d3d2504ccc

📥 Commits

Reviewing files that changed from the base of the PR and between 0dbf7e6 and be49118.

📒 Files selected for processing (8)
  • pnpm/crates/default-reporter/src/state.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
  • pnpm/crates/reporter/src/lib.rs
  • pnpm/crates/reporter/src/tests.rs
  • pnpm/crates/resolving-deps-resolver/src/lib.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_workspace.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_workspace/tests.rs

@codecov-commenter

codecov-commenter commented Jul 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.21622% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.68%. Comparing base (0dbf7e6) to head (148459e).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...lving-deps-resolver/src/resolve_dependency_tree.rs 92.55% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13135      +/-   ##
==========================================
+ Coverage   85.64%   85.68%   +0.03%     
==========================================
  Files         505      505              
  Lines       83652    83870     +218     
==========================================
+ Hits        71647    71863     +216     
- Misses      12005    12007       +2     

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

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

@github-actions

github-actions Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 148459e298fe

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

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

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.515 ± 0.125 2.367 2.701 1.72 ± 0.17
pacquet@main 2.539 ± 0.156 2.350 2.773 1.73 ± 0.19
pnpr@HEAD 1.504 ± 0.132 1.356 1.696 1.03 ± 0.13
pnpr@main 1.465 ± 0.129 1.354 1.756 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.51512339812,
      "stddev": 0.12546282195137012,
      "median": 2.50555680172,
      "user": 1.5122025399999999,
      "system": 1.3227310199999998,
      "min": 2.36676762072,
      "max": 2.70108384172,
      "times": [
        2.45658678172,
        2.55452682172,
        2.40810795172,
        2.57110952172,
        2.36676762072,
        2.39141930072,
        2.70108384172,
        2.61199230072,
        2.68457252672,
        2.40506731372
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.53887568042,
      "stddev": 0.15568958698070987,
      "median": 2.52884416372,
      "user": 1.5133869399999997,
      "system": 1.31701012,
      "min": 2.3498044827199998,
      "max": 2.77290101872,
      "times": [
        2.77290101872,
        2.43506662872,
        2.63650930972,
        2.68129074372,
        2.61070985472,
        2.35939169772,
        2.40477182172,
        2.69133277372,
        2.44697847272,
        2.3498044827199998
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.50383114502,
      "stddev": 0.13219592183129217,
      "median": 1.47980789122,
      "user": 1.0718684399999998,
      "system": 1.1502895199999998,
      "min": 1.3560374897199998,
      "max": 1.69647535572,
      "times": [
        1.64955460372,
        1.5070449907199999,
        1.53483717672,
        1.69647535572,
        1.3560374897199998,
        1.35615302772,
        1.45257079172,
        1.68017087072,
        1.39417546472,
        1.41129167872
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.4645675270199998,
      "stddev": 0.12929782750940022,
      "median": 1.4082728377199998,
      "user": 1.04758094,
      "system": 1.20289262,
      "min": 1.35386081972,
      "max": 1.75618209272,
      "times": [
        1.3616470677199999,
        1.75618209272,
        1.49397074272,
        1.62631341272,
        1.39549310872,
        1.43830686072,
        1.35386081972,
        1.4074282117199999,
        1.40911746372,
        1.40335548972
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 259.9 ± 4.5 253.2 270.0 1.03 ± 0.02
pacquet@main 253.3 ± 3.6 249.2 258.8 1.00
pnpr@HEAD 273.2 ± 6.3 263.8 285.7 1.08 ± 0.03
pnpr@main 262.8 ± 10.5 253.5 284.8 1.04 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.25991462656000003,
      "stddev": 0.004526288935471973,
      "median": 0.25923930936000006,
      "user": 0.20954994000000005,
      "system": 0.55317522,
      "min": 0.25318121486000006,
      "max": 0.27002401486000005,
      "times": [
        0.25991317486000004,
        0.25678804286000007,
        0.27002401486000005,
        0.25856544386,
        0.26130311586000005,
        0.25739590886,
        0.25775336386000003,
        0.26326431186000004,
        0.25318121486000006,
        0.26095767386
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.25328716526,
      "stddev": 0.003642685634791523,
      "median": 0.25311221936000006,
      "user": 0.20018634,
      "system": 0.5396462200000001,
      "min": 0.24922963586000002,
      "max": 0.25880505586,
      "times": [
        0.25020897186,
        0.24922963586000002,
        0.25825816486000003,
        0.25880505586,
        0.25381844586,
        0.25572246486000005,
        0.25240599286000004,
        0.24949637786,
        0.25525688686000003,
        0.24966965586000003
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.27322006666,
      "stddev": 0.006253034855491303,
      "median": 0.2721774128600001,
      "user": 0.21921633999999995,
      "system": 0.5390299199999999,
      "min": 0.26381278486000004,
      "max": 0.28573908686000005,
      "times": [
        0.27218419586000003,
        0.28088304386000007,
        0.27103501986000006,
        0.26881329186,
        0.27217062986000007,
        0.27546014186000006,
        0.28573908686000005,
        0.26915836286000006,
        0.26381278486000004,
        0.27294410886000003
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.26281327846,
      "stddev": 0.01048748537895668,
      "median": 0.2599017773600001,
      "user": 0.22231773999999999,
      "system": 0.51318932,
      "min": 0.25353693586000003,
      "max": 0.28484479186000006,
      "times": [
        0.25532025686000004,
        0.25480982486000003,
        0.25353693586000003,
        0.27412989386000003,
        0.26052039886000006,
        0.25383031886,
        0.26081203886000004,
        0.25928315586000006,
        0.27104516886,
        0.28484479186000006
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.711 ± 0.018 2.675 2.741 1.86 ± 0.14
pacquet@main 2.716 ± 0.016 2.698 2.749 1.86 ± 0.14
pnpr@HEAD 1.533 ± 0.131 1.396 1.724 1.05 ± 0.12
pnpr@main 1.461 ± 0.110 1.373 1.738 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.7113072182,
      "stddev": 0.01764491206548556,
      "median": 2.7147027932,
      "user": 1.62346982,
      "system": 1.3137085,
      "min": 2.6748324942,
      "max": 2.7412585142,
      "times": [
        2.6913145272,
        2.7148012612,
        2.7166397362,
        2.7412585142,
        2.7190458822,
        2.7185249801999998,
        2.7086550052,
        2.6748324942,
        2.7146043252,
        2.7133954561999998
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.7159746248000003,
      "stddev": 0.016205505905094602,
      "median": 2.7127500572,
      "user": 1.59221922,
      "system": 1.3199029,
      "min": 2.6975532612,
      "max": 2.7488391632,
      "times": [
        2.7186003832,
        2.7152203862,
        2.6975532612,
        2.7304109042,
        2.7488391632,
        2.7102797281999997,
        2.7057276922,
        2.7290940132,
        2.7057998382,
        2.6982208782
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.5326054640999998,
      "stddev": 0.13105449095267904,
      "median": 1.5012072616999999,
      "user": 1.02108782,
      "system": 1.1212788999999999,
      "min": 1.3960809902,
      "max": 1.7243553301999999,
      "times": [
        1.3960809902,
        1.4094310501999998,
        1.6613906762,
        1.4076707741999999,
        1.7243553301999999,
        1.6667323401999998,
        1.4035823212,
        1.5146712052,
        1.6543966352,
        1.4877433182
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.4611862937,
      "stddev": 0.110450460570966,
      "median": 1.4180949836999999,
      "user": 1.02011002,
      "system": 1.1178234999999999,
      "min": 1.3729539342,
      "max": 1.7375555511999998,
      "times": [
        1.3875059591999999,
        1.3982512172,
        1.4379387501999998,
        1.3893730352,
        1.4952497592,
        1.3917229281999999,
        1.4738190251999999,
        1.5274927772,
        1.3729539342,
        1.7375555511999998
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 565.1 ± 12.3 551.4 594.1 1.94 ± 0.06
pacquet@main 548.9 ± 10.2 538.9 567.8 1.88 ± 0.06
pnpr@HEAD 303.1 ± 8.7 290.1 317.7 1.04 ± 0.04
pnpr@main 291.3 ± 6.6 283.4 300.7 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.5651125863,
      "stddev": 0.01234773025212758,
      "median": 0.5624264389,
      "user": 0.66803846,
      "system": 0.7028109200000001,
      "min": 0.5513551774000001,
      "max": 0.5940630054,
      "times": [
        0.5755279234,
        0.5665775944,
        0.5513551774000001,
        0.5589563264,
        0.5658965514000001,
        0.5940630054,
        0.5560932574,
        0.5672322164,
        0.5580887354,
        0.5573350754
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.5488663615,
      "stddev": 0.010183849889925394,
      "median": 0.5453325199000001,
      "user": 0.65498946,
      "system": 0.6776925199999999,
      "min": 0.5388642144,
      "max": 0.5677723534,
      "times": [
        0.5446440044,
        0.5677723534,
        0.5483673024000001,
        0.5441548234,
        0.5421473134,
        0.5388642144,
        0.5670924934,
        0.5418727174000001,
        0.5460210354,
        0.5477273574
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30305793420000005,
      "stddev": 0.008731754582447392,
      "median": 0.3021780899,
      "user": 0.18560625999999997,
      "system": 0.54034922,
      "min": 0.2900767984,
      "max": 0.3176503564,
      "times": [
        0.2900767984,
        0.3176503564,
        0.3148575584,
        0.3038600354,
        0.30420082740000004,
        0.2948223024,
        0.29894202940000003,
        0.3088422864,
        0.3004961444,
        0.2968310034
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.29131251450000006,
      "stddev": 0.006569637471379505,
      "median": 0.28885194340000003,
      "user": 0.18794496,
      "system": 0.5053822200000001,
      "min": 0.2833602584,
      "max": 0.30065358540000003,
      "times": [
        0.2958274134,
        0.30065358540000003,
        0.2852472824,
        0.29805126340000004,
        0.28763985940000003,
        0.2866005614,
        0.2833602584,
        0.29006402740000004,
        0.2996758834,
        0.28600501040000004
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.851 ± 0.015 1.836 1.884 6.22 ± 0.13
pacquet@main 1.845 ± 0.014 1.824 1.869 6.20 ± 0.13
pnpr@HEAD 0.300 ± 0.007 0.292 0.318 1.01 ± 0.03
pnpr@main 0.298 ± 0.006 0.286 0.305 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.85061616574,
      "stddev": 0.014506855817435469,
      "median": 1.84770011724,
      "user": 0.9089746999999999,
      "system": 0.73058562,
      "min": 1.83564952174,
      "max": 1.88354774374,
      "times": [
        1.88354774374,
        1.8438158757399998,
        1.8472985557400001,
        1.8357656387399999,
        1.8586995227399998,
        1.85876563774,
        1.84810167874,
        1.83564952174,
        1.83868144274,
        1.85583603974
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.8448926456399999,
      "stddev": 0.013737601816686588,
      "median": 1.84548654774,
      "user": 0.9066934999999999,
      "system": 0.7254810199999998,
      "min": 1.8237148377399999,
      "max": 1.86910357374,
      "times": [
        1.8589378827399998,
        1.83243545574,
        1.83717993474,
        1.83328585774,
        1.8537659197399998,
        1.86910357374,
        1.8483350997399999,
        1.84952989874,
        1.8237148377399999,
        1.84263799574
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.29963566804,
      "stddev": 0.007450622549020355,
      "median": 0.29676281924000003,
      "user": 0.19117309999999998,
      "system": 0.53973242,
      "min": 0.29224062774000004,
      "max": 0.31832149074,
      "times": [
        0.29224062774000004,
        0.31832149074,
        0.29916502374000004,
        0.30298634074,
        0.29445707374,
        0.30351990674,
        0.29701823574,
        0.29650740274,
        0.29648555174,
        0.29565502674
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.29756985914,
      "stddev": 0.005887995464960018,
      "median": 0.29836740823999996,
      "user": 0.1917411,
      "system": 0.51832872,
      "min": 0.28586274174,
      "max": 0.30471380874000004,
      "times": [
        0.29677302274,
        0.30285527674,
        0.28586274174,
        0.29043886574,
        0.30309272374,
        0.29513322274000003,
        0.30009411274000003,
        0.29882506074,
        0.29790975574,
        0.30471380874000004
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 326.2 ± 9.9 309.5 344.7 3.92 ± 0.16
pacquet@main 329.8 ± 9.4 315.0 339.8 3.96 ± 0.15
pnpr@HEAD 83.9 ± 1.9 80.1 87.9 1.01 ± 0.03
pnpr@main 83.2 ± 2.2 79.7 88.8 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.326197516,
      "stddev": 0.009887269662246161,
      "median": 0.3279491828,
      "user": 0.3241967,
      "system": 0.04697216,
      "min": 0.3094750308,
      "max": 0.34467512180000004,
      "times": [
        0.34467512180000004,
        0.3237615358,
        0.31985715680000004,
        0.32962738080000004,
        0.3262709848,
        0.3094750308,
        0.3304446118,
        0.32995474880000003,
        0.3150481938,
        0.3328603948
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.3298128771,
      "stddev": 0.009406647697545732,
      "median": 0.3343949068,
      "user": 0.31145199999999995,
      "system": 0.06606856,
      "min": 0.3149808868,
      "max": 0.3397748068,
      "times": [
        0.33622093880000004,
        0.32500461880000003,
        0.3149808868,
        0.3340704758,
        0.3347193378,
        0.31949432380000004,
        0.31835124880000004,
        0.3359224758,
        0.3397748068,
        0.3395896578
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08387921655,
      "stddev": 0.001903120504783403,
      "median": 0.08383507879999999,
      "user": 0.019227006249999998,
      "system": 0.0083872125,
      "min": 0.0800785698,
      "max": 0.0878788308,
      "times": [
        0.0878788308,
        0.0835481988,
        0.0858924368,
        0.0859981368,
        0.0868226908,
        0.0859381938,
        0.0835955478,
        0.0853483208,
        0.0814094488,
        0.0852558378,
        0.0845394168,
        0.0830290608,
        0.0823026908,
        0.0821681678,
        0.0835114688,
        0.0851691328,
        0.0845476528,
        0.0857360818,
        0.0811148418,
        0.0847153578,
        0.0809775638,
        0.0824669198,
        0.0828753508,
        0.0839699828,
        0.0844540358,
        0.0837001748,
        0.0800785698,
        0.0852327038,
        0.0854311768,
        0.0835585888,
        0.0822550508,
        0.0806132968
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.08319142770625,
      "stddev": 0.0021564003998428075,
      "median": 0.08264080830000001,
      "user": 0.01874919375,
      "system": 0.008047716874999998,
      "min": 0.0797310948,
      "max": 0.0888455818,
      "times": [
        0.0872405878,
        0.0797310948,
        0.0830460228,
        0.0827172718,
        0.0829189328,
        0.0820032268,
        0.0809349638,
        0.0852972448,
        0.0849059268,
        0.0823150538,
        0.0803988528,
        0.0828113998,
        0.0823976808,
        0.0821626878,
        0.0816407028,
        0.0826618078,
        0.0817792038,
        0.0826916448,
        0.0818852248,
        0.0824943928,
        0.0824776108,
        0.0818865768,
        0.0823874408,
        0.0831170368,
        0.0810535168,
        0.0840789288,
        0.08763541180000001,
        0.0888455818,
        0.0853981348,
        0.0830520238,
        0.0826198088,
        0.0875396908
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.525 ± 0.136 4.401 4.824 1.29 ± 0.04
pacquet@main 4.579 ± 0.154 4.425 4.850 1.31 ± 0.05
pnpr@HEAD 3.496 ± 0.058 3.459 3.653 1.00
pnpr@main 3.553 ± 0.123 3.443 3.829 1.02 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.52507022952,
      "stddev": 0.1362759130661958,
      "median": 4.454670308320001,
      "user": 1.7076401599999997,
      "system": 1.3816381199999999,
      "min": 4.4008320673200005,
      "max": 4.82435562632,
      "times": [
        4.44685920432,
        4.43699721632,
        4.69566998432,
        4.4008320673200005,
        4.4594991013200005,
        4.51254452932,
        4.82435562632,
        4.44984151532,
        4.44609564832,
        4.57800740232
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.57937816202,
      "stddev": 0.1540583768293018,
      "median": 4.53241055082,
      "user": 1.70160606,
      "system": 1.4032527199999998,
      "min": 4.42497316332,
      "max": 4.8498737293200005,
      "times": [
        4.43583205232,
        4.45747061932,
        4.69547141532,
        4.54222876432,
        4.42963665032,
        4.68412022832,
        4.52259233732,
        4.8498737293200005,
        4.75158266032,
        4.42497316332
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.4955360893199994,
      "stddev": 0.057979674623832245,
      "median": 3.4746920228200002,
      "user": 1.1862120600000001,
      "system": 1.2452289200000002,
      "min": 3.4586970153200003,
      "max": 3.6529299123200003,
      "times": [
        3.6529299123200003,
        3.46921237532,
        3.47950027732,
        3.48646386232,
        3.4831127363200003,
        3.46890355332,
        3.52126650432,
        3.46988376832,
        3.46539088832,
        3.4586970153200003
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.5528180172200003,
      "stddev": 0.12345865181068864,
      "median": 3.50470412482,
      "user": 1.17869746,
      "system": 1.2648107199999998,
      "min": 3.44308777132,
      "max": 3.82917710932,
      "times": [
        3.67435644832,
        3.61918185832,
        3.56160191732,
        3.44308777132,
        3.48363109932,
        3.82917710932,
        3.45208323132,
        3.4888137663200003,
        3.52059448332,
        3.45565248732
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13135
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,674.83 ms
(-3.58%)Baseline: 2,774.16 ms
3,328.99 ms
(80.35%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,835.65 ms
(-5.48%)Baseline: 1,942.13 ms
2,330.56 ms
(78.76%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
551.36 ms
(-7.54%)Baseline: 596.29 ms
715.55 ms
(77.05%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
309.48 ms
(-15.48%)Baseline: 366.18 ms
439.41 ms
(70.43%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,366.77 ms
(-4.48%)Baseline: 2,477.77 ms
2,973.33 ms
(79.60%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,400.83 ms
(-3.02%)Baseline: 4,537.74 ms
5,445.29 ms
(80.82%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
253.18 ms
(-6.40%)Baseline: 270.50 ms
324.60 ms
(78.00%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13135
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

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

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,396.08 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
292.24 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
290.08 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
80.08 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,356.04 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,458.70 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
263.81 ms
🐰 View full continuous benchmarking report in Bencher

Copilot AI review requested due to automatic review settings July 19, 2026 07:12
@kairosci
kairosci force-pushed the paquet-deprecation-warnings branch from be49118 to c13dd17 Compare July 19, 2026 07:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 19, 2026
Copilot AI review requested due to automatic review settings July 19, 2026 07:41
@kairosci
kairosci force-pushed the paquet-deprecation-warnings branch from c13dd17 to 63a5053 Compare July 19, 2026 07:41

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.

Drop the doc comments and inline notes that only translate the
adjacent code, keep the TS parity anchors, and let the behavioral
doc for allowedDeprecatedVersions live in one place
(WorkspaceResolveOptions), referenced from the tree-ctx field and
builder.
Copilot AI review requested due to automatic review settings July 19, 2026 08:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Context used
✅ Compliance rules (platform): 18 rules

Grey Divider


Action required

1. Direct deprecation suppressed ✓ Resolved 🐞 Bug ≡ Correctness ⭐ New
Description
emit_deprecation_if_needed() is only triggered when a package is first inserted into the shared
packages dedup map, so if the same package is later encountered at a shallower depth (including
depth == 0), no depth-0 pnpm:deprecation event is emitted. This can misclassify a direct
dependency deprecation as transitive (buffered into the summary instead of being shown immediately)
depending on traversal/importer order.
Code

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[R1684-1685]

+    if package_is_new {
+        emit_deprecation_if_needed(ctx, &result, &id, depth);
Evidence
The resolver currently emits deprecation notifications only when package_is_new is true (first
insertion into the shared packages map), in both fresh and reused paths. Elsewhere in the same
file, the dependency tree explicitly updates a node’s depth to the minimum seen across visits,
demonstrating that later shallower encounters are expected; therefore, emitting a deprecation only
at first-seen depth can leave the log stuck at a deeper (transitive) depth even if a later
occurrence is direct. Additionally, TreeCtx/WorkspaceTreeCtx are designed to share dedup maps
across importers, making “first seen transitively, later seen directly” possible depending on
importer traversal order.

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1654-1686]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[2670-2702]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1892-1914]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[956-988]

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

### Issue description
Deprecation events are emitted only on the first insertion into the shared `packages` map. Since the same package can later be seen at a shallower depth (including `depth == 0`), the current approach can fail to emit the required *direct dependency* deprecation warning and instead only ever emit a transitive one.

### Issue Context
- The deprecation emit is gated by `package_is_new` in both the fresh-resolve and reused-from-lockfile paths.
- The tree already has logic to update a node’s effective depth to the minimum seen across visits, indicating that “depth can decrease later” is a supported/expected scenario.

### How to fix
Implement depth-aware deprecation emission that upgrades to direct when appropriate, without spamming duplicates. Options:
- Track per-`pkg_id` the **minimum deprecation depth seen** (or at least whether a `depth == 0` deprecation has already been emitted) in a separate map on `WorkspaceTreeCtx` (e.g., `Mutex<HashMap<String, i32>>`).
 - On each occurrence where `deprecated` is present and not allowed, compare/update the stored depth.
 - If the new depth is smaller than the stored one, and especially if it crosses to `0`, emit a new `Deprecation` with `depth == 0` (and current prefix) so the reporter renders it immediately.
- Alternatively, keep emitting only once but defer the classification until the minimal depth is known (harder given the reporter’s “render direct immediately” behavior).

### Fix Focus Areas
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1684-1685]
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[2670-2701]
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[3136-3173]

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


2. Empty deprecation version ✓ Resolved 🐞 Bug ≡ Correctness
Description
When ResolveResult.name_ver is None, the resolver emits a pnpm:deprecation event with
pkg_version set to an empty string and pkg_name derived from the alias, producing malformed
name@ output and preventing allowedDeprecatedVersions semver suppression from ever matching.
This contradicts the ResolveResult contract that name/version for such protocols must be read from
the manifest.
Code

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[R1692-1696]

+        let pkg_name =
+            result.name_ver.as_ref().map_or_else(|| alias.clone(), |nv| nv.name.to_string());
+        let pkg_version =
+            result.name_ver.as_ref().map(|nv| nv.suffix.to_string()).unwrap_or_default();
+
Evidence
The new code explicitly sets pkg_version to "" when name_ver is absent, but ResolveResult’s
contract says those protocols leave name_ver=None and downstream consumers must read canonical
name/version from the manifest, so the emitted event and suppression check become incorrect in
that case.

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1688-1706]
pnpm/crates/resolving-resolver-base/src/resolve.rs[385-391]

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

## Issue description
`resolve_dependency_tree` builds `pkg_name`/`pkg_version` from `result.name_ver`, but when `name_ver` is `None` it falls back to `alias` and an empty version. For non-npm resolutions, `ResolveResult` explicitly documents that `name_ver` may be `None` and consumers must read `name`/`version` from the manifest.

## Issue Context
This makes emitted `pnpm:deprecation` payloads incorrect (e.g. `foo@`) and breaks `pnpm.allowedDeprecatedVersions` suppression because `is_deprecation_allowed()` gets an empty version string.

## Fix Focus Areas
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1688-1710]

## Suggested fix
- When `result.name_ver` is `Some(nv)`, keep using `nv.name` and `nv.suffix`.
- When `result.name_ver` is `None`, derive both name and version from `result.manifest` (e.g. `manifest["name"]` and `manifest["version"]`) before calling `is_deprecation_allowed()` and emitting the log.
- If manifest name/version are missing or non-strings, either skip the deprecation emit (preferred) or fall back to `alias`/`id` but do not emit `pkg_version == ""`.

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


3. Changeset missing pnpm bump ✗ Dismissed 📘 Rule violation § Compliance
Description
The new changeset only bumps pacquet, but this PR adds new user-visible warning output in pnpm’s
Rust default reporter (deprecated package warnings). This violates the requirement to explicitly
include the pnpm package (with an appropriate bump type) in the changeset for user-visible
behavior changes.
Code

.changeset/pacquet-deprecation-warnings.md[R1-3]

+---
+"pacquet": minor
+---
Evidence
Rule 713436 requires changesets to explicitly declare the pnpm package with a correct bump type.
The added changeset only declares pacquet, while the PR also adds new pnpm warning output for
deprecated packages in the default reporter.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/pacquet-deprecation-warnings.md[1-3]
pnpm/crates/default-reporter/src/state.rs[1082-1089]

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 changeset front-matter lists only `"pacquet": minor`, but this PR introduces a user-visible behavior change in pnpm output (deprecated package warnings). The changeset should explicitly include the `pnpm` package with an appropriate bump type.

## Issue Context
The Rust default reporter now renders `pnpm:deprecation` events into warning lines, which changes pnpm’s user-visible output.

## Fix Focus Areas
- .changeset/pacquet-deprecation-warnings.md[1-3]

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


View more (1)
4. flush_deprecated_subdeps() never runs ✓ Resolved 📘 Rule violation ⌂ Architecture
Description
The default reporter buffers transitive pnpm:deprecation events and only flushes them when it
receives Stage::ResolutionDone, but the install pipeline shown appears to emit only
ImportingStarted/ImportingDone stages. As a result, transitive deprecation summaries may never
render (and the buffer may persist for the session), causing user-visible output to diverge from
pnpm’s reporter behavior.
Code

pnpm/crates/default-reporter/src/state.rs[R443-447]

    fn on_stage(&mut self, prefix: &str, stage: Stage) {
-        if stage != Stage::ImportingDone {
-            return;
-        }
-        if !self.progress.contains_key(prefix) {
-            return;
+        match stage {
+            Stage::ResolutionDone => {
+                self.flush_deprecated_subdeps();
+            }
Evidence
PR compliance requires pacquet’s user-visible output to remain in sync with pnpm. In the default
reporter, ReporterState::on_stage() only triggers flush_deprecated_subdeps() on
Stage::ResolutionDone, and transitive deprecations are otherwise accumulated in an in-memory
buffer (deprecated_subdeps) with clearing/rendering happening during that flush; however, the
package-manager emit sites shown only produce pnpm:stage events for importing start/done and do
not emit a ResolutionDone marker, meaning the flush trigger is never delivered and the transitive
deprecation summary line never appears.

Rule 713428: Keep pnpm TypeScript and pacquet Rust user-visible behavior changes in sync
Rule 713429: Pacquet must not introduce new user-visible behavior beyond pnpm
pnpm/crates/default-reporter/src/state.rs[443-447]
pnpm/crates/default-reporter/src/state.rs[1076-1120]
pnpm/crates/package-manager/src/install.rs[1074-1078]
pnpm/crates/package-manager/src/install.rs[1237-1242]
pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[1555-1559]
pnpm/crates/package-manager/src/install_frozen_lockfile.rs[1292-1296]
pnpm/crates/default-reporter/src/state.rs[443-459]
pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[2232-2236]

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

## Issue description
Transitive deprecations (`depth > 0`) are buffered in the default reporter and only flushed when `Stage::ResolutionDone` is received, but the Rust install code paths shown appear to emit only `Stage::ImportingStarted`/`Stage::ImportingDone` stage events. This can prevent the buffered transitive deprecation summary from ever being rendered/cleared, creating a user-visible divergence from pnpm and potentially leaving the buffer resident for the install session.

## Issue Context
- Reporter buffering/flush logic lives in `ReporterState::on_stage()` and `flush_deprecated_subdeps()`; the flush currently happens only on `Stage::ResolutionDone`.
- This PR introduces transitive buffering (`deprecated_subdeps`) and a flush at `resolution_done`, intended to match pnpm’s TS reporter behavior.
- The current Rust install flow shown emits stage logs for importing start/done, but no `resolution_done` marker is emitted, so the flush trigger may never occur.
- To guarantee flushing, either (a) emit `Stage::ResolutionDone` from the package-manager at the real end of resolution across all install paths, and/or (b) add a fallback flush in the reporter on an event guaranteed to arrive (e.g., `Summary` and/or `ExecutionTime`).
- If `ResolutionDone` is later emitted per-prefix/importer, consider making buffering prefix-aware to avoid cross-importer interference.

## Fix Focus Areas
- pnpm/crates/default-reporter/src/state.rs[443-459]
- pnpm/crates/default-reporter/src/state.rs[1076-1120]
- pnpm/crates/package-manager/src/install.rs[1074-1078]
- pnpm/crates/package-manager/src/install.rs[1237-1242]
- pnpm/crates/package-manager/src/install.rs[1482-1486]
- pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[1291-1378]
- pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[1555-1559]
- pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[2232-2236]
- pnpm/crates/package-manager/src/install_frozen_lockfile.rs[1288-1296]

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



Remediation recommended

5. Unbounded deprecation message 🐞 Bug ➹ Performance
Description
The resolver copies the manifest’s deprecated string into the pnpm:deprecation payload and the
default reporter renders it for direct deps without any length bound, allowing extremely large
warning output and additional memory retention. This can noticeably slow resolution/reporting or
bloat logs when registry metadata contains unusually long deprecation strings.
Code

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[R1688-1710]

+    if package_is_new
+        && let Some(deprecated) = extract_deprecated_from_manifest(result.manifest.as_deref())
+        && !deprecated.is_empty()
+    {
+        let pkg_name =
+            result.name_ver.as_ref().map_or_else(|| alias.clone(), |nv| nv.name.to_string());
+        let pkg_version =
+            result.name_ver.as_ref().map(|nv| nv.suffix.to_string()).unwrap_or_default();
+
+        if !is_deprecation_allowed(
+            &pkg_name,
+            &pkg_version,
+            &ctx.workspace.allowed_deprecated_versions,
+        ) && let Some(log) = ctx.workspace.deprecation_log.as_ref()
+        {
+            log(Deprecation {
+                pkg_name,
+                pkg_version,
+                pkg_id: id.clone(),
+                prefix: ctx.base_opts.project_dir.display().to_string(),
+                deprecated,
+                depth,
+            });
Evidence
The resolver path converts the manifest field to an owned String and forwards it into the
deprecation event; the default reporter then interpolates it into the warning line for direct deps,
with no bounding or truncation visible in either path.

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1688-1710]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[3152-3156]
pnpm/crates/default-reporter/src/state.rs[1076-1089]

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

## Issue description
`deprecated` is taken from the manifest and forwarded to logging as an owned `String` with no truncation. The default reporter formats this string directly into output for direct dependencies.

## Issue Context
Even if large deprecation strings are rare, the behavior is fully data-driven by registry metadata and can create very large NDJSON events / terminal output and retain extra heap allocations.

## Fix Focus Areas
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1688-1710]
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[3152-3156]
- pnpm/crates/default-reporter/src/state.rs[1082-1089]

## Suggested fix
- Introduce a maximum length for deprecation messages (e.g. 1–4 KiB), and truncate with an ellipsis before storing/emitting.
 - Best location: inside `extract_deprecated_from_manifest()` so all sinks benefit.
 - Alternatively (or additionally), truncate at render time in the default reporter.
- Keep the truncation deterministic and ensure it doesn’t break JSON serialization (operate on chars/bytes safely).

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


6. Terminal escape injection 🐞 Bug ⛨ Security
Description
The default reporter prints the registry manifest’s deprecated string verbatim to the terminal; a
package publisher controlling registry metadata can embed newlines/ANSI control sequences to spoof
or obscure CLI output.
Code

pnpm/crates/default-reporter/src/state.rs[R1081-1088]

+            let msg = format!(
+                "{} {} {}@{}: {}",
+                self.colors.warn_label(),
+                self.colors.red("deprecated"),
+                log.pkg_name,
+                log.pkg_version,
+                log.deprecated,
+            );
Evidence
The resolver extracts deprecated from manifest JSON and forwards it into DeprecationLog. The
default reporter formats that string into a terminal line, and Frame::emit does not perform any
escaping/sanitization.

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[3149-3153]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1680-1706]
pnpm/crates/default-reporter/src/state.rs[63-104]
pnpm/crates/default-reporter/src/state.rs[1079-1094]

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

### Issue description
`log.deprecated` comes from registry metadata (`manifest["deprecated"]`) and is interpolated into terminal output without escaping/sanitization. This allows terminal output spoofing via embedded control characters (e.g. `\n`, `\r`, `\x1b[...]`).

### Issue Context
- Resolver extracts `deprecated` directly from the manifest JSON.
- Default reporter’s `Frame::emit` stores/prints strings as-is.
- `on_deprecation` formats `log.deprecated` into a warning line.

### Fix Focus Areas
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[3149-3153]
- pnpm/crates/default-reporter/src/state.rs[63-104]
- pnpm/crates/default-reporter/src/state.rs[1079-1094]

### What to change
- Introduce a small sanitizer for **terminal-rendered** fields (at least `deprecated`, and optionally `pkg_name`/`pkg_version` too):
 - Replace `\r`/`\n`/`\t` with visible escapes or spaces.
 - Strip ASCII control chars (including ESC `0x1b`) or escape them.
- Apply sanitizer in `on_deprecation` before building `msg`.
- Keep NDJSON wire payload unchanged; sanitize only the human-facing default reporter output.

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


7. Callback under packages mutex ✓ Resolved 🐞 Bug ➹ Performance
Description
The resolver performs the deprecation semver checks and invokes the reporter callback while holding
the shared packages Mutex, increasing lock hold time on a hot path and risking contention if
logging is slow.
Code

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[R1680-1706]

+            // Matches the TS deprecation warning at
+            // `pnpm11/installing/deps-resolver/src/resolveDependencies.ts:2119`.
+            if let Some(deprecated) = extract_deprecated_from_manifest(result.manifest.as_deref())
+                && !deprecated.is_empty()
+            {
+                let pkg_name = result
+                    .name_ver
+                    .as_ref()
+                    .map_or_else(|| alias.clone(), |nv| nv.name.to_string());
+                let pkg_version =
+                    result.name_ver.as_ref().map(|nv| nv.suffix.to_string()).unwrap_or_default();
+
+                if !is_deprecation_allowed(
+                    &pkg_name,
+                    &pkg_version,
+                    &ctx.workspace.allowed_deprecated_versions,
+                ) && let Some(log) = ctx.workspace.deprecation_log.as_ref()
+                {
+                    log(Deprecation {
+                        pkg_name,
+                        pkg_version,
+                        pkg_id: id.clone(),
+                        prefix: ctx.base_opts.project_dir.display().to_string(),
+                        deprecated,
+                        depth,
+                    });
+                }
Evidence
The deprecation check and callback are inside the packages mutex-guarded region, and
is_deprecation_allowed performs Range/Version parsing. Doing this under the lock increases the
critical section on the resolution hot path.

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1654-1707]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[3158-3173]

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

### Issue description
In `resolve_node`, the new deprecation logic runs inside the scope holding `ctx.workspace.packages`’ mutex guard. Even though semver parsing is conditional, invoking an external callback (`deprecation_log`) under this lock can extend lock hold time and amplify contention in large graphs.

### Issue Context
The deprecation check is correctly placed to ensure “once per newly-resolved package” semantics (inside the `packages.insert(...)` branch), but the expensive parts (semver parsing + emitting) don’t need to happen while the mutex guard is held.

### Fix Focus Areas
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1654-1707]
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[3158-3173]

### What to change
- Keep the **dedupe/once** decision under the lock (e.g., compute `inserted_now`).
- Copy out the minimal data needed for logging (or compute a small `Option<Deprecation>` struct) and **drop the mutex guard**.
- After releasing the lock, run `extract_deprecated...`, `is_deprecation_allowed(...)`, and call `deprecation_log`.
- Optional: pre-parse/caches ranges from `allowed_deprecated_versions` once into `Range` objects to avoid repeated parsing on repeated deprecated hits.

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


Grey Divider

Previous review results

Review updated until commit 148459e

Results up to commit e955451


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


Action required
1. flush_deprecated_subdeps() never runs ✓ Resolved 📘 Rule violation ⌂ Architecture
Description
The default reporter buffers transitive pnpm:deprecation events and only flushes them when it
receives Stage::ResolutionDone, but the install pipeline shown appears to emit only
ImportingStarted/ImportingDone stages. As a result, transitive deprecation summaries may never
render (and the buffer may persist for the session), causing user-visible output to diverge from
pnpm’s reporter behavior.
Code

pnpm/crates/default-reporter/src/state.rs[R443-447]

    fn on_stage(&mut self, prefix: &str, stage: Stage) {
-        if stage != Stage::ImportingDone {
-            return;
-        }
-        if !self.progress.contains_key(prefix) {
-            return;
+        match stage {
+            Stage::ResolutionDone => {
+                self.flush_deprecated_subdeps();
+            }
Evidence
PR compliance requires pacquet’s user-visible output to remain in sync with pnpm. In the default
reporter, ReporterState::on_stage() only triggers flush_deprecated_subdeps() on
Stage::ResolutionDone, and transitive deprecations are otherwise accumulated in an in-memory
buffer (deprecated_subdeps) with clearing/rendering happening during that flush; however, the
package-manager emit sites shown only produce pnpm:stage events for importing start/done and do
not emit a ResolutionDone marker, meaning the flush trigger is never delivered and the transitive
deprecation summary line never appears.

Rule 713428: Keep pnpm TypeScript and pacquet Rust user-visible behavior changes in sync
Rule 713429: Pacquet must not introduce new user-visible behavior beyond pnpm
pnpm/crates/default-reporter/src/state.rs[443-447]
pnpm/crates/default-reporter/src/state.rs[1076-1120]
pnpm/crates/package-manager/src/install.rs[1074-1078]
pnpm/crates/package-manager/src/install.rs[1237-1242]
pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[1555-1559]
pnpm/crates/package-manager/src/install_frozen_lockfile.rs[1292-1296]
pnpm/crates/default-reporter/src/state.rs[443-459]
pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[2232-2236]

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

## Issue description
Transitive deprecations (`depth > 0`) are buffered in the default reporter and only flushed when `Stage::ResolutionDone` is received, but the Rust install code paths shown appear to emit only `Stage::ImportingStarted`/`Stage::ImportingDone` stage events. This can prevent the buffered transitive deprecation summary from ever being rendered/cleared, creating a user-visible divergence from pnpm and potentially leaving the buffer resident for the install session.

## Issue Context
- Reporter buffering/flush logic lives in `ReporterState::on_stage()` and `flush_deprecated_subdeps()`; the flush currently happens only on `Stage::ResolutionDone`.
- This PR introduces transitive buffering (`deprecated_subdeps`) and a flush at `resolution_done`, intended to match pnpm’s TS reporter behavior.
- The current Rust install flow shown emits stage logs for importing start/done, but no `resolution_done` marker is emitted, so the flush trigger may never occur.
- To guarantee flushing, either (a) emit `Stage::ResolutionDone` from the package-manager at the real end of resolution across all install paths, and/or (b) add a fallback flush in the reporter on an event guaranteed to arrive (e.g., `Summary` and/or `ExecutionTime`).
- If `ResolutionDone` is later emitted per-prefix/importer, consider making buffering prefix-aware to avoid cross-importer interference.

## Fix Focus Areas
- pnpm/crates/default-reporter/src/state.rs[443-459]
- pnpm/crates/default-reporter/src/state.rs[1076-1120]
- pnpm/crates/package-manager/src/install.rs[1074-1078]
- pnpm/crates/package-manager/src/install.rs[1237-1242]
- pnpm/crates/package-manager/src/install.rs[1482-1486]
- pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[1291-1378]
- pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[1555-1559]
- pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs[2232-2236]
- pnpm/crates/package-manager/src/install_frozen_lockfile.rs[1288-1296]

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



Remediation recommended
2. Terminal escape injection 🐞 Bug ⛨ Security
Description
The default reporter prints the registry manifest’s deprecated string verbatim to the terminal; a
package publisher controlling registry metadata can embed newlines/ANSI control sequences to spoof
or obscure CLI output.
Code

pnpm/crates/default-reporter/src/state.rs[R1081-1088]

+            let msg = format!(
+                "{} {} {}@{}: {}",
+                self.colors.warn_label(),
+                self.colors.red("deprecated"),
+                log.pkg_name,
+                log.pkg_version,
+                log.deprecated,
+            );
Evidence
The resolver extracts deprecated from manifest JSON and forwards it into DeprecationLog. The
default reporter formats that string into a terminal line, and Frame::emit does not perform any
escaping/sanitization.

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[3149-3153]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1680-1706]
pnpm/crates/default-reporter/src/state.rs[63-104]
pnpm/crates/default-reporter/src/state.rs[1079-1094]

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

### Issue description
`log.deprecated` comes from registry metadata (`manifest["deprecated"]`) and is interpolated into terminal output without escaping/sanitization. This allows terminal output spoofing via embedded control characters (e.g. `\n`, `\r`, `\x1b[...]`).

### Issue Context
- Resolver extracts `deprecated` directly from the manifest JSON.
- Default reporter’s `Frame::emit` stores/prints strings as-is.
- `on_deprecation` formats `log.deprecated` into a warning line.

### Fix Focus Areas
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[3149-3153]
- pnpm/crates/default-reporter/src/state.rs[63-104]
- pnpm/crates/default-reporter/src/state.rs[1079-1094]

### What to change
- Introduce a small sanitizer for **terminal-rendered** fields (at least `deprecated`, and optionally `pkg_name`/`pkg_version` too):
 - Replace `\r`/`\n`/`\t` with visible escapes or spaces.
 - Strip ASCII control chars (including ESC `0x1b`) or escape them.
- Apply sanitizer in `on_deprecation` before building `msg`.
- Keep NDJSON wire payload unchanged; sanitize only the human-facing default reporter output.

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


3. Callback under packages mutex ✓ Resolved 🐞 Bug ➹ Performance
Description
The resolver performs the deprecation semver checks and invokes the reporter callback while holding
the shared packages Mutex, increasing lock hold time on a hot path and risking contention if
logging is slow.
Code

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[R1680-1706]

+            // Matches the TS deprecation warning at
+            // `pnpm11/installing/deps-resolver/src/resolveDependencies.ts:2119`.
+            if let Some(deprecated) = extract_deprecated_from_manifest(result.manifest.as_deref())
+                && !deprecated.is_empty()
+            {
+                let pkg_name = result
+                    .name_ver
+                    .as_ref()
+                    .map_or_else(|| alias.clone(), |nv| nv.name.to_string());
+                let pkg_version =
+                    result.name_ver.as_ref().map(|nv| nv.suffix.to_string()).unwrap_or_default();
+
+                if !is_deprecation_allowed(
+                    &pkg_name,
+                    &pkg_version,
+                    &ctx.workspace.allowed_deprecated_versions,
+                ) && let Some(log) = ctx.workspace.deprecation_log.as_ref()
+                {
+                    log(Deprecation {
+                        pkg_name,
+                        pkg_version,
+                        pkg_id: id.clone(),
+                        prefix: ctx.base_opts.project_dir.display().to_string(),
+                        deprecated,
+                        depth,
+                    });
+                }
Evidence
The deprecation check and callback are inside the packages mutex-guarded region, and
is_deprecation_allowed performs Range/Version parsing. Doing this under the lock increases the
critical section on the resolution hot path.

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1654-1707]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[3158-3173]

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

### Issue description
In `resolve_node`, the new deprecation logic runs inside the scope holding `ctx.workspace.packages`’ mutex guard. Even though semver parsing is conditional, invoking an external callback (`deprecation_log`) under this lock can extend lock hold time and amplify contention in large graphs.

### Issue Context
The deprecation check is correctly placed to ensure “once per newly-resolved package” semantics (inside the `packages.insert(...)` branch), but the expensive parts (semver parsing + emitting) don’t need to happen while the mutex guard is held.

### Fix Focus Areas
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1654-1707]
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[3158-3173]

### What to change
- Keep the **dedupe/once** decision under the lock (e.g., compute `inserted_now`).
- Copy out the minimal data needed for logging (or compute a small `Option<Deprecation>` struct) and **drop the mutex guard**.
- After releasing the lock, run `extract_deprecated...`, `is_deprecation_allowed(...)`, and call `deprecation_log`.
- Optional: pre-parse/caches ranges from `allowed_deprecated_versions` once into `Range` objects to avoid repeated parsing on repeated deprecated hits.

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


Results up to commit 0c8e009


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


Action required
1. Changeset missing pnpm bump ✗ Dismissed 📘 Rule violation § Compliance
Description
The new changeset only bumps pacquet, but this PR adds new user-visible warning output in pnpm’s
Rust default reporter (deprecated package warnings). This violates the requirement to explicitly
include the pnpm package (with an appropriate bump type) in the changeset for user-visible
behavior changes.
Code

.changeset/pacquet-deprecation-warnings.md[R1-3]

+---
+"pacquet": minor
+---
Evidence
Rule 713436 requires changesets to explicitly declare the pnpm package with a correct bump type.
The added changeset only declares pacquet, while the PR also adds new pnpm warning output for
deprecated packages in the default reporter.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/pacquet-deprecation-warnings.md[1-3]
pnpm/crates/default-reporter/src/state.rs[1082-1089]

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 changeset front-matter lists only `"pacquet": minor`, but this PR introduces a user-visible behavior change in pnpm output (deprecated package warnings). The changeset should explicitly include the `pnpm` package with an appropriate bump type.

## Issue Context
The Rust default reporter now renders `pnpm:deprecation` events into warning lines, which changes pnpm’s user-visible output.

## Fix Focus Areas
- .changeset/pacquet-deprecation-warnings.md[1-3]

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


2. Empty deprecation version ✓ Resolved 🐞 Bug ≡ Correctness
Description
When ResolveResult.name_ver is None, the resolver emits a pnpm:deprecation event with
pkg_version set to an empty string and pkg_name derived from the alias, producing malformed
name@ output and preventing allowedDeprecatedVersions semver suppression from ever matching.
This contradicts the ResolveResult contract that name/version for such protocols must be read from
the manifest.
Code

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[R1692-1696]

+        let pkg_name =
+            result.name_ver.as_ref().map_or_else(|| alias.clone(), |nv| nv.name.to_string());
+        let pkg_version =
+            result.name_ver.as_ref().map(|nv| nv.suffix.to_string()).unwrap_or_default();
+
Evidence
The new code explicitly sets pkg_version to "" when name_ver is absent, but ResolveResult’s
contract says those protocols leave name_ver=None and downstream consumers must read canonical
name/version from the manifest, so the emitted event and suppression check become incorrect in
that case.

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1688-1706]
pnpm/crates/resolving-resolver-base/src/resolve.rs[385-391]

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

## Issue description
`resolve_dependency_tree` builds `pkg_name`/`pkg_version` from `result.name_ver`, but when `name_ver` is `None` it falls back to `alias` and an empty version. For non-npm resolutions, `ResolveResult` explicitly documents that `name_ver` may be `None` and consumers must read `name`/`version` from the manifest.

## Issue Context
This makes emitted `pnpm:deprecation` payloads incorrect (e.g. `foo@`) and breaks `pnpm.allowedDeprecatedVersions` suppression because `is_deprecation_allowed()` gets an empty version string.

## Fix Focus Areas
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1688-1710]

## Suggested fix
- When `result.name_ver` is `Some(nv)`, keep using `nv.name` and `nv.suffix`.
- When `result.name_ver` is `None`, derive both name and version from `result.manifest` (e.g. `manifest["name"]` and `manifest["version"]`) before calling `is_deprecation_allowed()` and emitting the log.
- If manifest name/version are missing or non-strings, either skip the deprecation emit (preferred) or fall back to `alias`/`id` but do not emit `pkg_version == ""`.

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



Remediation recommended
3. Unbounded deprecation message 🐞 Bug ➹ Performance
Description
The resolver copies the manifest’s deprecated string into the pnpm:deprecation payload and the
default reporter renders it for direct deps without any length bound, allowing extremely large
warning output and additional memory retention. This can noticeably slow resolution/reporting or
bloat logs when registry metadata contains unusually long deprecation strings.
Code

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[R1688-1710]

+    if package_is_new
+        && let Some(deprecated) = extract_deprecated_from_manifest(result.manifest.as_deref())
+        && !deprecated.is_empty()
+    {
+        let pkg_name =
+            result.name_ver.as_ref().map_or_else(|| alias.clone(), |nv| nv.name.to_string());
+        let pkg_version =
+            result.name_ver.as_ref().map(|nv| nv.suffix.to_string()).unwrap_or_default();
+
+        if !is_deprecation_allowed(
+            &pkg_name,
+            &pkg_version,
+            &ctx.workspace.allowed_deprecated_versions,
+        ) && let Some(log) = ctx.workspace.deprecation_log.as_ref()
+        {
+            log(Deprecation {
+                pkg_name,
+                pkg_version,
+                pkg_id: id.clone(),
+                prefix: ctx.base_opts.project_dir.display().to_string(),
+                deprecated,
+                depth,
+            });
Evidence
The resolver path converts the manifest field to an owned String and forwards it into the
deprecation event; the default reporter then interpolates it into the warning line for direct deps,
with no bounding or truncation visible in either path.

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1688-1710]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[3152-3156]
pnpm/crates/default-reporter/src/state.rs[1076-1089]

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

## Issue description
`deprecated` is taken from the manifest and forwarded to logging as an owned `String` with no truncation. The default reporter formats this string directly into output for direct dependencies.

## Issue Context
Even if large deprecation strings are rare, the behavior is fully data-driven by registry metadata and can create very large NDJSON events / terminal output and retain extra heap allocations.

## Fix Focus Areas
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[1688-1710]
- pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[3152-3156]
- pnpm/crates/default-reporter/src/state.rs[1082-1089]

## Suggested fix
- Introduce a maximum length for deprecation messages (e.g. 1–4 KiB), and truncate with an ellipsis before storing/emitting.
 - Best location: inside `extract_deprecated_from_manifest()` so all sinks benefit.
 - Alternatively (or additionally), truncate at render time in the default reporter.
- Keep the truncation deterministic and ensure it doesn’t break JSON serialization (operate on chars/bytes safely).

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


Qodo Logo

@qodo-code-review

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

Copy link
Copy Markdown

PR Code Suggestions ✨

Latest suggestions up to 0c8e009

Warning

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

CategorySuggestion                                                                                                                                    Impact
Possible issue
Preserve direct deprecation warnings

Track emitted deprecation warnings using a composite key (package ID, importer
prefix, and depth) rather than relying on package_is_new. This prevents direct
dependency warnings from being incorrectly suppressed during parallel or
transitive resolution.

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs [1688-1712]

-if package_is_new
-    && let Some(deprecated) = extract_deprecated_from_manifest(result.manifest.as_deref())
+if let Some(deprecated) = extract_deprecated_from_manifest(result.manifest.as_deref())
     && !deprecated.is_empty()
 {
-    ...
+    let pkg_name =
+        result.name_ver.as_ref().map_or_else(|| alias.clone(), |nv| nv.name.to_string());
+    let pkg_version =
+        result.name_ver.as_ref().map(|nv| nv.suffix.to_string()).unwrap_or_default();
+    let prefix = ctx.base_opts.project_dir.display().to_string();
+    let deprecation_key = (id.clone(), prefix.clone(), depth == 0);
+
     if !is_deprecation_allowed(
         &pkg_name,
         &pkg_version,
         &ctx.workspace.allowed_deprecated_versions,
-    ) && let Some(log) = ctx.workspace.deprecation_log.as_ref()
+    )
+        && lock_recoverable(&ctx.workspace.emitted_deprecations).insert(deprecation_key)
+        && let Some(log) = ctx.workspace.deprecation_log.as_ref()
     {
         log(Deprecation {
             pkg_name,
             pkg_version,
             pkg_id: id.clone(),
-            prefix: ctx.base_opts.project_dir.display().to_string(),
+            prefix,
             deprecated,
             depth,
         });
     }
 }

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies a significant logic flaw where critical deprecation warnings for direct dependencies could be silently skipped if the package is first resolved as a subdependency, and provides a robust fix.

High
  • More

Previous suggestions

Suggestions up to commit e955451
CategorySuggestion                                                                                                                                    Impact
Possible issue
Preserve direct deprecation warnings

Move deprecation logging out of the shared package ownership gate to prevent
direct dependency warnings from being incorrectly suppressed. Deduplicate
warnings by importer, package ID, and depth.

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs [1680-1707]

-            // Matches the TS deprecation warning at
-            // `pnpm11/installing/deps-resolver/src/resolveDependencies.ts:2119`.
-            if let Some(deprecated) = extract_deprecated_from_manifest(result.manifest.as_deref())
-                && !deprecated.is_empty()
-            {
-                ...
-                log(Deprecation {
-                    pkg_name,
-                    pkg_version,
-                    pkg_id: id.clone(),
-                    prefix: ctx.base_opts.project_dir.display().to_string(),
-                    deprecated,
-                    depth,
-                });
-            }
+        emit_deprecation_if_needed(ctx, &result, &alias, &id, depth);
 
+        // Continue with shared package/children ownership handling.
+        ...
+
+fn emit_deprecation_if_needed(
+    ctx: &TreeCtx,
+    result: &pacquet_resolving_resolver_base::ResolveResult,
+    alias: &str,
+    pkg_id: &str,
+    depth: i32,
+) {
+    let Some(deprecated) = extract_deprecated_from_manifest(result.manifest.as_deref())
+        .filter(|deprecated| !deprecated.is_empty())
+    else {
+        return;
+    };
+    let pkg_name = result
+        .name_ver
+        .as_ref()
+        .map_or_else(|| alias.to_string(), |nv| nv.name.to_string());
+    let pkg_version =
+        result.name_ver.as_ref().map(|nv| nv.suffix.to_string()).unwrap_or_default();
+
+    if is_deprecation_allowed(
+        &pkg_name,
+        &pkg_version,
+        &ctx.workspace.allowed_deprecated_versions,
+    ) {
+        return;
+    }
+
+    let key = (
+        ctx.importer_id.clone(),
+        pkg_id.to_string(),
+        depth == 0,
+    );
+    if lock_recoverable(&ctx.workspace.reported_deprecations).insert(key)
+        && let Some(log) = ctx.workspace.deprecation_log.as_ref()
+    {
+        log(Deprecation {
+            pkg_name,
+            pkg_version,
+            pkg_id: pkg_id.to_string(),
+            prefix: ctx.base_opts.project_dir.display().to_string(),
+            deprecated,
+            depth,
+        });
+    }
+}
+
Suggestion importance[1-10]: 9

__

Why: This catches a critical logic bug where workspace-shared state could suppress direct deprecation warnings or assign them the wrong importer prefix if they were first encountered as transitive dependencies.

High

Copilot AI review requested due to automatic review settings July 19, 2026 08:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@zkochan

zkochan commented Jul 19, 2026

Copy link
Copy Markdown
Member

Follow-up on the remaining Qodo review items (addressed in 55ba70a):

Finding 1 — flush_deprecated_subdeps() never runs: confirmed and fixed; see the resolved inline thread. The fresh-lockfile install now emits pnpm:stage resolution_started / resolution_done, matching pnpm11/installing/deps-installer/src/install/index.ts.

Finding 2 — terminal escape injection via the deprecated string: not changed, deliberately. @pnpm/cli.default-reporter interpolates log.deprecated verbatim in reportDeprecations.ts with no sanitization, so sanitizing only in pacquet would violate the parity rule this same review cites (pacquet must not introduce user-visible behavior beyond pnpm). If we want sanitization, it should land in both reporters as its own parity change.

Finding 3 — deprecation work under the packages mutex: fixed. The lock now only decides first-insert (package_is_new, named after the TS packageIsNew); the deprecated-field extraction, semver check, and emit run after the guard is dropped.

Suggestion "Preserve direct deprecation warnings": rejected as a divergence. The TypeScript implementation reports a deprecated package only on its first occurrence (pnpm11/installing/deps-resolver/src/resolveDependencies.ts, packageIsNew), so a direct occurrence resolved after a transitive one is intentionally not re-reported. Pacquet matches that.

Also in 55ba70a: the zoomed (non-cwd-prefix) direct-dependency warning now omits the deprecation text, matching reportDeprecations.ts (which only prints deprecated name@version for zoomed lines); default-reporter frame tests cover direct, zoomed, and buffered-transitive rendering; and the missing changeset for this feature was added (pacquet minor).


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

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 0c8e009

…rn on reused entries

When ResolveResult.name_ver is unset (git / tarball / local), the
pnpm:deprecation payload's name and version now come from the manifest
(its canonical source per the name_ver contract) instead of the alias
plus an empty version, which produced a malformed name@ payload and
defeated allowedDeprecatedVersions matching. A manifest missing either
field suppresses the warning.

The check is extracted into emit_deprecation_if_needed and now also
runs on the lockfile-reuse path: the synthesized manifest already
round-trips the lockfile's deprecated metadata, so reused entries keep
warning on warm installs the way pnpm does on repeat installs.
Copilot AI review requested due to automatic review settings July 19, 2026 08:59

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 Jul 19, 2026

Copy link
Copy Markdown
Member

Correction to my earlier comment, plus the latest round of fixes (9ccb732):

  • Qodo "empty deprecation version" finding: confirmed and fixed — see the resolved inline thread. Name/version now fall back to the manifest when name_ver is unset, matching both the ResolveResult contract and the TypeScript implementation.
  • Qodo "changeset missing pnpm bump" finding: rejected — the repository's changeset rules require Rust-only changes to target pacquet and omit pnpm (which always means the TypeScript CLI). See the resolved inline thread.
  • Correction: I previously wrote that the lockfile-reuse path stays deprecation-free because its synthesized manifests omit registry metadata. That was wrong — synthesize_reused_result deliberately round-trips the lockfile's deprecated field into the synthesized manifest (covered by synthesized_manifest_carries_deprecated_metadata), and the TypeScript CLI keeps warning about deprecated packages on repeat non-frozen installs. The deprecation check now also runs on resolve_reused_node, so warm installs warn the same way pnpm does; covered by the new reused_lockfile_entries_still_notify_the_deprecation_sink test.

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

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 9ccb732

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

Auto-approved notes - no code suggestions found
- 'approve_pr_on_self_review' flag enabled

Copilot AI review requested due to automatic review settings July 19, 2026 10:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

@qodo-code-review

Copy link
Copy Markdown

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 →

Copilot AI review requested due to automatic review settings July 19, 2026 10:14

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.

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

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review state: automerge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants