Skip to content

fix(diagnostics): report ERR_PNPM_* error codes, never pacquet ones - #13091

Merged
zkochan merged 5 commits into
mainfrom
fix-error-codes-err-pnpm
Jul 17, 2026
Merged

zkochan merged 5 commits into
mainfrom
fix-error-codes-err-pnpm

Conversation

@zkochan

@zkochan zkochan commented Jul 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Error codes are a public contract — users match on them in CI and scripts, and pnpm documents them at https://pnpm.io/errors. 284 of pacquet's #[diagnostic(code(...))] sites reported something that is not a pnpm error code:

$ pnpm root -g
Error: pacquet_cli::root_global_unsupported

pacquet is an in-repo crate name that means nothing to a user of the pnpm binary. This is the same leak fixed in #13086 (messages) and #13087 (.modules.yaml), in the last place it remained.

A second group reported unprefixed codes (GIT_CHECKOUT_FAILED, EXOTIC_SUBDEP). Those are the short names pnpm passes to PnpmError, whose constructor prepends the prefix before the code is ever observed (core/error/src/index.ts:19):

this.code = code.startsWith('ERR_PNPM_') ? code : `ERR_PNPM_${code}`

So pnpm emits ERR_PNPM_GIT_CHECKOUT_FAILED where pacquet emitted GIT_CHECKOUT_FAILED — a code pnpm never emits.

All 610 diagnostic codes are now ERR_PNPM_*.

Rules

  1. Where pnpm defines a code for the same error, use pnpm's exact code. 35 codes, verified against the TypeScript source. pacquet_package_manager::outdated_lockfile → ERR_PNPM_OUTDATED_LOCKFILE (which its own doc comment already claimed it was); GIT_CHECKOUT_FAILED → ERR_PNPM_GIT_CHECKOUT_FAILED.
  2. Otherwise derive from the full path minus the crate prefix. pacquet::patch_state_read → ERR_PNPM_PATCH_STATE_READ. The namespace is kept rather than the leaf alone — six distinct create_dir errors (lockfile, modules-yaml, pack, mirror, store-index, workspace-state) would otherwise collapse onto one ERR_PNPM_CREATE_DIR. Verified zero collisions across all 259.

Three merge onto codes pacquet already used elsewhere for the same condition — intended, not a clash. pnpm has a single ERR_PNPM_TRUST_DOWNGRADE and matches on it by name (deps-resolver/src/resolveDependencies.ts:1903), so pacquet's resolver-side and lockfile-side trust downgrades now share it.

Two mislabelled errors, corrected rather than renamed

  • frozen_lockfile_with_outdated_lockfile is not pnpm's outdated-lockfile error. The variant is FrozenLockfileWithUpdateChecksums and the message is about combining --frozen-lockfile with --update-checksums. Renaming on the name alone would have merged a flag conflict into pnpm's stale-lockfile code. It takes ERR_PNPM_CONFIG_CONFLICT_FROZEN_LOCKFILE_WITH_UPDATE_CHECKSUMS, matching the existing ERR_PNPM_CONFIG_CONFLICT_* convention, and its doc comment no longer claims to be the error it isn't.
  • Three package-manifest errors have pnpm equivalents under a different name, which rule 1 cannot see because it matches on the name. "package.json file already exists" is pnpm's PACKAGE_JSON_EXISTS (workspace/commands/src/init.ts:84); "No package.json was found" is NO_IMPORTER_MANIFEST_FOUND; "Missing script" is NO_SCRIPT (exec/commands/src/run.ts:264, message Missing script: ${scriptName} — identical).

Verified

$ pnpm root -g                    → Error: ERR_PNPM_CLI_ROOT_GLOBAL_UNSUPPORTED
$ pnpm install --frozen-lockfile  → Error: ERR_PNPM_OUTDATED_LOCKFILE
$ pnpm init                       → Error: ERR_PNPM_PACKAGE_JSON_EXISTS

cargo nextest run --workspace --no-fail-fast — 6128/6128 pass, 3 skipped. cargo clippy --workspace --all-targets -- -D warnings clean. RUSTDOCFLAGS=-D warnings cargo doc clean.

Four tests asserted on the old codes and are updated: deploy_all_files_rejects_symlink_escape and lockfile_only (which asserts on the code precisely because miette wraps the prose), two node-resolver assertions, and the init snapshot. git-fetcher/src/fetcher/tests.rs:594 already tested error-code parity with pnpm, warning against "a pacquet-only string" — this is the change that test was written to protect.

Review findings (both real, both fixed)

ERR_PNPM_TARBALL_INTEGRITY (Qodo) — 6f31f75. TarballError::Checksum is pnpm's TARBALL_INTEGRITY (fetching/binary-fetcher/src/index.ts:168), and pnpm matches on that code by name to drive lockfile-integrity recovery:

const BROKEN_LOCKFILE_INTEGRITY_ERRORS = new Set([
  'ERR_PNPM_UNEXPECTED_PKG_CONTENT_IN_STORE',
  'ERR_PNPM_TARBALL_INTEGRITY',
])

Since napi/src/error.rs:38 forwards Diagnostic::code() to JS, a pacquet-specific name would have silently disabled that path. The right code was already recorded one layer away — tarball_error_to_request_retry has mapped Checksum to ERR_PNPM_TARBALL_INTEGRITY in the retry payload all along — so the same error was reporting two different codes depending on the surface. Auditing the crate against that mapping also caught TarballTooLarge, whose derived name stuttered (ERR_PNPM_TARBALL_TARBALL_TOO_LARGE). All four tarball codes pnpm defines now agree across both surfaces.

Stale comments (CodeRabbit) — c831702. 42 comment lines across 21 files still named pre-rename identifiers; 5 were flagged, all 42 are fixed. Comments only, no attribute or behavior change.

Known limitation

Rule 1 matches on the code name, so a pacquet error whose pnpm equivalent is named differently gets a rule-2 name instead of pnpm's. The TARBALL_INTEGRITY finding above is exactly this failure mode — pacquet called it verify_checksum_error, pnpm calls it TARBALL_INTEGRITY, and no name-based rule could bridge that.

Six such cases are now fixed by hand (outdated_lockfile, PACKAGE_JSON_EXISTS, NO_IMPORTER_MANIFEST_FOUND, NO_SCRIPT, TARBALL_INTEGRITY, TARBALL_TOO_LARGE), but I have not audited all 225 rule-2 codes for semantic equivalents. None is wrong today — they are pacquet-specific names for errors pnpm has no code for, or more specific than pnpm's — but where pnpm does have an equivalent under another name, only a per-error read will find it. Worth a follow-up pass; each is a one-line rename.

One lead for that pass: tarball_error_to_request_retry-style hand-maintained mappings are where the real pnpm codes were already written down. Other crates may have the same, and they are the cheapest place to look.

Squash Commit Body

Error codes are a public contract — users match on them in CI and scripts, and
pnpm documents them at https://pnpm.io/errors. 284 of pacquet's
`#[diagnostic(code(...))]` sites reported something else:

    $ pnpm root -g
    Error: pacquet_cli::root_global_unsupported

`pacquet` is an in-repo crate name that means nothing to a user of the `pnpm`
binary. A second group reported unprefixed codes (`GIT_CHECKOUT_FAILED`), which
are the *short* names pnpm passes to `PnpmError`; its constructor prepends
`ERR_PNPM_` before the code is ever observed, so pacquet was emitting a code pnpm
never emits.

Rename all 259 offending codes across 284 sites under two rules:

1. Where pnpm defines a code for the same error, use pnpm's exact code.
   `pacquet_package_manager::outdated_lockfile` becomes
   `ERR_PNPM_OUTDATED_LOCKFILE` — which its own doc comment already claimed it
   was — and `GIT_CHECKOUT_FAILED` becomes `ERR_PNPM_GIT_CHECKOUT_FAILED`.
2. Otherwise derive from the full path minus the crate prefix, so
   `pacquet::patch_state_read` becomes `ERR_PNPM_PATCH_STATE_READ`. The namespace
   is retained rather than the leaf alone: six distinct `create_dir` errors would
   otherwise collapse onto one code.

Three merge onto codes pacquet already used elsewhere for the same condition,
which is the intent, not a clash. pnpm has a single `ERR_PNPM_TRUST_DOWNGRADE`
and matches on it by name in `deps-resolver`, so pacquet's resolver-side and
lockfile-side trust downgrades now share it.

Two errors were mislabelled and are corrected rather than renamed:

- `frozen_lockfile_with_outdated_lockfile` is not pnpm's outdated-lockfile error.
  The variant is `FrozenLockfileWithUpdateChecksums` and the message is about
  combining --frozen-lockfile with --update-checksums. It takes
  `ERR_PNPM_CONFIG_CONFLICT_FROZEN_LOCKFILE_WITH_UPDATE_CHECKSUMS`, following the
  existing ERR_PNPM_CONFIG_CONFLICT_* convention, and its doc comment no longer
  claims to be the error it isn't.
- Three package-manifest errors have pnpm equivalents under a different name,
  which rule 1 cannot see because it matches on the name: "package.json file
  already exists" is pnpm's `PACKAGE_JSON_EXISTS` (thrown by `pnpm init`), "No
  package.json was found" is `NO_IMPORTER_MANIFEST_FOUND`, and "Missing script"
  is `NO_SCRIPT`.

All 610 diagnostic codes are now ERR_PNPM_*.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port, or the description notes what still needs porting.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

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

Summary by CodeRabbit

  • Bug Fixes
    • Standardized error identifiers across package management, authentication, workspace, resolver, and file-system operations with consistent ERR_PNPM_* codes.
    • Improved error output reliability for lockfile, path, catalog, login, and installation failures.
    • Updated automated checks to validate stable diagnostic codes instead of wording-sensitive messages.
  • Documentation
    • Documented the error-code naming changes and noted that scripts matching legacy codes may need updates.

Copilot AI review requested due to automatic review settings July 17, 2026 00:35

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 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This change standardizes diagnostic codes across pnpm Rust crates, tests, comments, and release documentation by replacing legacy or unprefixed identifiers with ERR_PNPM_* codes. Error structures, display messages, and runtime control flow remain unchanged.

Changes

Diagnostic code migration

Layer / File(s) Summary
Authentication and CLI diagnostics
pnpm/crates/auth-commands/*, pnpm/crates/cli/*, pnpm/crates/cmd-shim/*
Updates authentication, CLI, patch, and command-shim diagnostics and matching assertions to ERR_PNPM_* codes.
Runtime and infrastructure diagnostics
pnpm/crates/{crypto-shasums-file,directory-fetcher,engine-runtime-*,env-installer,executor,exportable-manifest,fs-packlist,git-fetcher,lockfile,modules-yaml,pack,tarball,versioning}/*
Renames diagnostics for runtime resolution, execution, filesystem, Git, lockfile, packaging, and tarball errors without changing payloads or control flow.
Package manager diagnostics
pnpm/crates/package-manager/*
Renames installation, resolution, linking, patching, pruning, and update diagnostics to ERR_PNPM_* identifiers.
Resolver, storage, and workspace diagnostics
pnpm/crates/{package-manifest,publish,registry,resolving-*,store-dir,workspace*,workspace}/*
Standardizes manifest, registry, resolver, store, and workspace diagnostic identifiers and updates related tests and documentation references.
Release documentation
.changeset/pacquet-err-pnpm-error-codes.md
Documents the prefix migration, example mappings, pnpm code precedence, and required updates for old code matches.

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

Possibly related PRs

  • pnpm/pnpm#13081: Covers overlapping frozen-lockfile diagnostic assertions, including outdated-lockfile failure output.

Suggested labels: product: pacquet

Suggested reviewers: copilot

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

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

❤️ Share

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

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

fix(diagnostics): emit pnpm ERR_PNPM_* codes instead of pacquet/internal codes

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Standardize all Rust diagnostic codes to pnpm’s public ERR_PNPM_* contract.
• Replace crate-path and unprefixed codes with pnpm-equivalent or derived ERR_PNPM_* values.
• Update snapshots/assertions so tests validate stable error codes instead of prose.
Diagram

graph TD
  A["Rust pnpm CLI"] --> B(["Crate errors (miette Diagnostic)"]) --> C["ERR_PNPM_* codes"] --> D{{"User / CI scripts"}}
  E["TypeScript pnpm (reference)"] --> C
  F["Updated tests"] --> C
  subgraph Legend
    direction LR
    _app["App/CLI"] ~~~ _lib(["Library"]) ~~~ _ext{{"External"}}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Centralize codes as constants + forbid raw strings
  • ➕ Reduces future drift by making codes single-source-of-truth
  • ➕ Enables compilation failures for typos/mismatched naming
  • ➕ Makes bulk renames and auditing easier
  • ➖ Requires a larger refactor (shared crate/module + imports)
  • ➖ May add churn/overhead for small error definitions
2. Add a compile-time / CI lint to enforce ERR_PNPM_* prefix
  • ➕ Prevents regressions where pacquet/internal codes leak again
  • ➕ Low ongoing maintenance cost once in place
  • ➖ Doesn’t help with choosing pnpm-equivalent names vs derived names
  • ➖ Still allows semantically-wrong ERR_PNPM_* names without deeper mapping
3. Generate codes from type/module paths via a macro/derive helper
  • ➕ Ensures consistent naming rules (prefix + namespace retention)
  • ➕ Avoids hand-editing large numbers of attributes
  • ➖ More macro complexity and less explicitness in error definitions
  • ➖ Harder to map special cases to pnpm’s existing codes

Recommendation: The PR’s approach (explicit remap to pnpm’s exact codes when known; otherwise derive a collision-free ERR_PNPM_* name) is the right tradeoff for correctness and auditability, especially given the public-contract nature of codes. Consider a follow-up CI lint that rejects any diagnostic code not starting with ERR_PNPM_ to prevent regressions.

Files changed (85) +307 / -296

Bug fix (77) +290 / -285
classic_login.rsRename classic login diagnostic codes to ERR_PNPM_* +2/-2

Rename classic login diagnostic codes to ERR_PNPM_*

• Replaces pacquet_auth_commands diagnostic codes with ERR_PNPM_AUTH_COMMANDS_* equivalents for classic login OTP and transport failures.

pnpm/crates/auth-commands/src/login/classic_login.rs

error.rsRename login error diagnostic codes to ERR_PNPM_* +6/-6

Rename login error diagnostic codes to ERR_PNPM_*

• Updates all login-related diagnostic codes (unsafe URL, QR rendering, request/prompt failures, auth.ini IO) to ERR_PNPM_AUTH_COMMANDS_* names.

pnpm/crates/auth-commands/src/login/error.rs

logout.rsRename logout auth.ini IO diagnostic codes +2/-2

Rename logout auth.ini IO diagnostic codes

• Switches logout ReadAuthIni/WriteAuthIni diagnostic codes to ERR_PNPM_AUTH_COMMANDS_*.

pnpm/crates/auth-commands/src/logout.rs

config.rsRename config-set control-character diagnostic code +1/-1

Rename config-set control-character diagnostic code

• Replaces pacquet_cli config-set diagnostic code with ERR_PNPM_CLI_CONFIG_SET_INVALID_CONTROL_CHARACTER.

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

dlx.rsRename dlx diagnostic codes to ERR_PNPM_CLI_* +3/-3

Rename dlx diagnostic codes to ERR_PNPM_CLI_*

• Updates dlx errors (read manifest, cache, spawn) to ERR_PNPM_CLI_* diagnostic codes.

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

exec.rsRename exec spawn diagnostic code to ERR_PNPM_CLI_* +1/-1

Rename exec spawn diagnostic code to ERR_PNPM_CLI_*

• Updates exec spawn error to use ERR_PNPM_CLI_EXEC_SPAWN.

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

patch.rsRename patch CLI diagnostic codes to ERR_PNPM_PATCH_* +6/-6

Rename patch CLI diagnostic codes to ERR_PNPM_PATCH_*

• Replaces multiple patch edit-dir and patch-file metadata diagnostic codes with ERR_PNPM_PATCH_* codes.

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

patch_commit.rsRename patch-commit CLI diagnostic codes to ERR_PNPM_PATCH_COMMIT_* +6/-6

Rename patch-commit CLI diagnostic codes to ERR_PNPM_PATCH_COMMIT_*

• Updates patch commit manifest/patch dir/IO error diagnostic codes to ERR_PNPM_PATCH_COMMIT_*.

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

patch_remove.rsRename patch-remove diagnostic codes to ERR_PNPM_PATCH_REMOVE_* +3/-3

Rename patch-remove diagnostic codes to ERR_PNPM_PATCH_REMOVE_*

• Switches patch removal IO-related diagnostic codes to ERR_PNPM_PATCH_REMOVE_*.

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

patch_state.rsRename patch-state diagnostic codes to ERR_PNPM_PATCH_STATE_* +7/-7

Rename patch-state diagnostic codes to ERR_PNPM_PATCH_STATE_*

• Updates patch state read/parse/serialize/write/safety diagnostic codes to ERR_PNPM_PATCH_STATE_*.

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

prefix.rsRename prefix diagnostics to ERR_PNPM_CLI_* +2/-2

Rename prefix diagnostics to ERR_PNPM_CLI_*

• Updates prefix global-unsupported and IO error diagnostic codes to ERR_PNPM_CLI_PREFIX_*.

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

root.rsRename root --global unsupported code to ERR_PNPM_CLI_* +1/-1

Rename root --global unsupported code to ERR_PNPM_CLI_*

• Updates the root --global unsupported diagnostic code to ERR_PNPM_CLI_ROOT_GLOBAL_UNSUPPORTED.

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

link_bins.rsRename cmd-shim link-bin diagnostics to ERR_PNPM_CMD_SHIM_* +9/-9

Rename cmd-shim link-bin diagnostics to ERR_PNPM_CMD_SHIM_*

• Replaces pacquet_cmd_shim diagnostic codes for directory/manifests/shim IO operations with ERR_PNPM_CMD_SHIM_* codes.

pnpm/crates/cmd-shim/src/link_bins.rs

lib.rsPrefix shasums diagnostics with ERR_PNPM_* +10/-10

Prefix shasums diagnostics with ERR_PNPM_*

• Updates Node/Bun shasums fetch/signature/integrity related diagnostic codes to ERR_PNPM_* names.

pnpm/crates/crypto-shasums-file/src/lib.rs

error.rsRename directory-fetcher diagnostic codes to ERR_PNPM_* +2/-2

Rename directory-fetcher diagnostic codes to ERR_PNPM_*

• Replaces pacquet_directory_fetcher IO and path-escape diagnostic codes with ERR_PNPM_DIRECTORY_FETCHER_*.

pnpm/crates/directory-fetcher/src/error.rs

bun_resolver.rsPrefix Bun resolver error code with ERR_PNPM_* +1/-1

Prefix Bun resolver error code with ERR_PNPM_*

• Renames BUN_RESOLUTION_FAILURE to ERR_PNPM_BUN_RESOLUTION_FAILURE.

pnpm/crates/engine-runtime-bun-resolver/src/bun_resolver.rs

read_bun_assets.rsPrefix Bun asset parse error code with ERR_PNPM_* +1/-1

Prefix Bun asset parse error code with ERR_PNPM_*

• Renames BUN_PARSE_INTEGRITY to ERR_PNPM_BUN_PARSE_INTEGRITY.

pnpm/crates/engine-runtime-bun-resolver/src/read_bun_assets.rs

deno_resolver.rsPrefix Deno resolver error code with ERR_PNPM_* +1/-1

Prefix Deno resolver error code with ERR_PNPM_*

• Renames DENO_RESOLUTION_FAILURE to ERR_PNPM_DENO_RESOLUTION_FAILURE.

pnpm/crates/engine-runtime-deno-resolver/src/deno_resolver.rs

read_deno_assets.rsPrefix Deno asset-related error codes with ERR_PNPM_* +7/-7

Prefix Deno asset-related error codes with ERR_PNPM_*

• Updates Deno missing assets, GitHub failures, and hash/integrity parse errors to ERR_PNPM_* codes.

pnpm/crates/engine-runtime-deno-resolver/src/read_deno_assets.rs

node_resolver.rsPrefix Node resolver diagnostics with ERR_PNPM_* +3/-3

Prefix Node resolver diagnostics with ERR_PNPM_*

• Updates node runtime resolution and integrity parse error codes to ERR_PNPM_* (offline, version-not-found, integrity-parse).

pnpm/crates/engine-runtime-node-resolver/src/node_resolver.rs

parse_node_specifier.rsPrefix invalid Node channel code with ERR_PNPM_* +1/-1

Prefix invalid Node channel code with ERR_PNPM_*

• Renames INVALID_NODE_RELEASE_CHANNEL to ERR_PNPM_INVALID_NODE_RELEASE_CHANNEL.

pnpm/crates/engine-runtime-node-resolver/src/parse_node_specifier.rs

resolve_node_version.rsPrefix Node index fetch/decode codes with ERR_PNPM_* +2/-2

Prefix Node index fetch/decode codes with ERR_PNPM_*

• Renames FETCH_NODE_INDEX_FAILED and DECODE_NODE_INDEX_FAILED to ERR_PNPM_* equivalents.

pnpm/crates/engine-runtime-node-resolver/src/resolve_node_version.rs

errors.rsRename env-installer diagnostics to ERR_PNPM_ENV_INSTALLER_* +2/-2

Rename env-installer diagnostics to ERR_PNPM_ENV_INSTALLER_*

• Updates config dependency symlink and read-config-modules diagnostic codes to ERR_PNPM_ENV_INSTALLER_*.

pnpm/crates/env-installer/src/errors.rs

lib.rsRename executor diagnostics to ERR_PNPM_EXECUTOR_* +2/-2

Rename executor diagnostics to ERR_PNPM_EXECUTOR_*

• Updates spawn/wait process diagnostic codes from pacquet_executor::* to ERR_PNPM_EXECUTOR_*.

pnpm/crates/executor/src/lib.rs

lifecycle.rsRename lifecycle script diagnostics to ERR_PNPM_EXECUTOR_* +5/-5

Rename lifecycle script diagnostics to ERR_PNPM_EXECUTOR_*

• Updates manifest read and lifecycle spawn/wait/script failure diagnostic codes to ERR_PNPM_EXECUTOR_*.

pnpm/crates/executor/src/lifecycle.rs

run_script.rsRename run-script spawn diagnostic code to ERR_PNPM_EXECUTOR_* +1/-1

Rename run-script spawn diagnostic code to ERR_PNPM_EXECUTOR_*

• Updates run-script spawn failure code to ERR_PNPM_EXECUTOR_RUN_SCRIPT_SPAWN.

pnpm/crates/executor/src/run_script.rs

create.rsRename exportable-manifest README read code to ERR_PNPM_* +1/-1

Rename exportable-manifest README read code to ERR_PNPM_*

• Changes README read diagnostic code to ERR_PNPM_EXPORTABLE_MANIFEST_READ_README.

pnpm/crates/exportable-manifest/src/create.rs

lib.rsRename packlist IO diagnostic code to ERR_PNPM_* +1/-1

Rename packlist IO diagnostic code to ERR_PNPM_*

• Updates the packlist IO diagnostic code to ERR_PNPM_FS_PACKLIST_IO.

pnpm/crates/fs-packlist/src/lib.rs

error.rsAlign git-fetcher error codes with pnpm ERR_PNPM_* +8/-8

Align git-fetcher error codes with pnpm ERR_PNPM_*

• Prefixes and/or maps git fetcher codes (including GIT_CHECKOUT_FAILED and INVALID_PATH) to ERR_PNPM_* equivalents and renames internal namespace codes to ERR_PNPM_GIT_FETCHER_*.

pnpm/crates/git-fetcher/src/error.rs

load_lockfile.rsRename lockfile load diagnostics to ERR_PNPM_LOCKFILE_* +3/-3

Rename lockfile load diagnostics to ERR_PNPM_LOCKFILE_*

• Replaces pacquet_lockfile load codes (current_dir/read/parse) with ERR_PNPM_LOCKFILE_* codes.

pnpm/crates/lockfile/src/load_lockfile.rs

save_lockfile.rsRename lockfile save diagnostics to ERR_PNPM_LOCKFILE_* +6/-6

Rename lockfile save diagnostics to ERR_PNPM_LOCKFILE_*

• Replaces pacquet_lockfile save codes (serialize/write/create/remove/rename) with ERR_PNPM_LOCKFILE_* codes.

pnpm/crates/lockfile/src/save_lockfile.rs

lib.rsRename modules-yaml read/write diagnostics to ERR_PNPM_* +5/-5

Rename modules-yaml read/write diagnostics to ERR_PNPM_*

• Updates modules.yaml read/parse and write/create/serialize diagnostic codes to ERR_PNPM_MODULES_YAML_*.

pnpm/crates/modules-yaml/src/lib.rs

lib.rsRename pack diagnostics to ERR_PNPM_PACK_* +4/-4

Rename pack diagnostics to ERR_PNPM_PACK_*

• Updates beforePacking hook and tarball/FS IO diagnostic codes to ERR_PNPM_PACK_*.

pnpm/crates/pack/src/lib.rs

add.rsRename add resolve-latest code to ERR_PNPM_PACKAGE_MANAGER_* +1/-1

Rename add resolve-latest code to ERR_PNPM_PACKAGE_MANAGER_*

• Updates the add command’s resolve-latest diagnostic code to ERR_PNPM_PACKAGE_MANAGER_ADD_RESOLVE_LATEST.

pnpm/crates/package-manager/src/add.rs

build_snapshot.rsRename build-snapshot diagnostics to ERR_PNPM_PACKAGE_MANAGER_* +3/-3

Rename build-snapshot diagnostics to ERR_PNPM_PACKAGE_MANAGER_*

• Updates build snapshot missing-integrity and parse errors to ERR_PNPM_PACKAGE_MANAGER_BUILD_SNAPSHOT_* codes.

pnpm/crates/package-manager/src/build_snapshot.rs

create_virtual_dir_by_snapshot.rsRename create-virtual-dir diagnostics to ERR_PNPM_PACKAGE_MANAGER_* +2/-2

Rename create-virtual-dir diagnostics to ERR_PNPM_PACKAGE_MANAGER_*

• Updates node_modules creation and obsolete child removal diagnostic codes to ERR_PNPM_PACKAGE_MANAGER_*.

pnpm/crates/package-manager/src/create_virtual_dir_by_snapshot.rs

create_virtual_store.rsRename virtual-store structural errors to ERR_PNPM_PACKAGE_MANAGER_* +2/-2

Rename virtual-store structural errors to ERR_PNPM_PACKAGE_MANAGER_*

• Updates missing metadata/packages-section diagnostic codes to ERR_PNPM_PACKAGE_MANAGER_* equivalents.

pnpm/crates/package-manager/src/create_virtual_store.rs

install.rsAlign install-path diagnostics with pnpm ERR_PNPM_* +15/-10

Align install-path diagnostics with pnpm ERR_PNPM_*

• Maps/renames install diagnostic codes (no lockfile, pnpmfile fail, stale lockfile, missing importer, package-map write) to pnpm ERR_PNPM_* names. Corrects a mislabelled frozen-lockfile/update-checksums conflict into an ERR_PNPM_CONFIG_CONFLICT_* code and updates its documentation comment.

pnpm/crates/package-manager/src/install.rs

install_frozen_lockfile.rsRename frozen-lockfile install diagnostics to ERR_PNPM_* +4/-4

Rename frozen-lockfile install diagnostics to ERR_PNPM_*

• Updates external lockfile verification, pnpmfile failures, and package-map write codes to ERR_PNPM_* names.

pnpm/crates/package-manager/src/install_frozen_lockfile.rs

install_package_by_snapshot.rsRename install-by-snapshot diagnostics to ERR_PNPM_* +7/-7

Rename install-by-snapshot diagnostics to ERR_PNPM_*

• Maps missing tarball integrity and unsupported/custom resolution related codes to pnpm-compatible ERR_PNPM_* names and renames other pacquet-internal codes under ERR_PNPM_PACKAGE_MANAGER_*.

pnpm/crates/package-manager/src/install_package_by_snapshot.rs

install_package_from_registry.rsRename registry install unsupported-resolution code to ERR_PNPM_* +1/-1

Rename registry install unsupported-resolution code to ERR_PNPM_*

• Updates unsupported-resolution diagnostic code to ERR_PNPM_PACKAGE_MANAGER_UNSUPPORTED_RESOLUTION.

pnpm/crates/package-manager/src/install_package_from_registry.rs

install_with_fresh_lockfile.rsRename fresh-lockfile path diagnostics to ERR_PNPM_* +7/-7

Rename fresh-lockfile path diagnostics to ERR_PNPM_*

• Updates package-map write, first-writer aborted, and pnpmfile-hook-related codes to pnpm ERR_PNPM_* values (notably ERR_PNPM_PNPMFILE_FAIL).

pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs

link_bins.rsRename link-virtual-store-bins diagnostic code +1/-1

Rename link-virtual-store-bins diagnostic code

• Updates read-virtual-store diagnostic code to ERR_PNPM_PACKAGE_MANAGER_READ_VIRTUAL_STORE.

pnpm/crates/package-manager/src/link_bins.rs

link_manifest_link_deps.rsRename link: dependency diagnostics to ERR_PNPM_PACKAGE_MANAGER_* +2/-2

Rename link: dependency diagnostics to ERR_PNPM_PACKAGE_MANAGER_*

• Updates invalid modules-dir-name and per-dependency symlink failure diagnostic codes to ERR_PNPM_PACKAGE_MANAGER_*.

pnpm/crates/package-manager/src/link_manifest_link_deps.rs

link_root_component_members.rsRename root-component linking diagnostics to ERR_PNPM_PACKAGE_MANAGER_* +2/-2

Rename root-component linking diagnostics to ERR_PNPM_PACKAGE_MANAGER_*

• Updates manifest read and symlink failure diagnostic codes to ERR_PNPM_PACKAGE_MANAGER_ROOT_COMPONENT_*.

pnpm/crates/package-manager/src/link_root_component_members.rs

minimum_release_age.rsRename minimumReleaseAge prompt code to ERR_PNPM_* +1/-1

Rename minimumReleaseAge prompt code to ERR_PNPM_*

• Updates the approval prompt diagnostic code to ERR_PNPM_PACKAGE_MANAGER_MINIMUM_RELEASE_AGE_PROMPT.

pnpm/crates/package-manager/src/minimum_release_age.rs

package_extender.rsPrefix package extension selector error code with ERR_PNPM_* +1/-1

Prefix package extension selector error code with ERR_PNPM_*

• Renames INVALID_PACKAGE_EXTENSION_SELECTOR to ERR_PNPM_INVALID_PACKAGE_EXTENSION_SELECTOR.

pnpm/crates/package-manager/src/package_extender.rs

patch.rsRename patch (package-manager) diagnostics to ERR_PNPM_* +4/-4

Rename patch (package-manager) diagnostics to ERR_PNPM_*

• Updates patch target/write-package-for-patch failure codes (missing metadata, unsupported resolution, unsafe destination, IO/stat) to ERR_PNPM_PACKAGE_MANAGER_* names.

pnpm/crates/package-manager/src/patch.rs

patch_commit.rsRename package-manager patch-commit diagnostics to ERR_PNPM_* +11/-11

Rename package-manager patch-commit diagnostics to ERR_PNPM_*

• Updates patch commit errors for manifest/packlist/IO/temp dirs/path escape/diff spawn and output limits to ERR_PNPM_PACKAGE_MANAGER_PATCH_COMMIT_* codes.

pnpm/crates/package-manager/src/patch_commit.rs

prune_direct_deps.rsRename prune direct deps diagnostics to ERR_PNPM_PACKAGE_MANAGER_* +3/-3

Rename prune direct deps diagnostics to ERR_PNPM_PACKAGE_MANAGER_*

• Updates manifest read and bin/link removal diagnostic codes to ERR_PNPM_PACKAGE_MANAGER_PRUNE_DIRECT_DEPS_*.

pnpm/crates/package-manager/src/prune_direct_deps.rs

symlink_direct_dependencies.rsRename symlink direct dependencies diagnostics to ERR_PNPM_* +2/-2

Rename symlink direct dependencies diagnostics to ERR_PNPM_*

• Updates unsafe importer path and symlink failure diagnostic codes to ERR_PNPM_PACKAGE_MANAGER_*.

pnpm/crates/package-manager/src/symlink_direct_dependencies.rs

update.rsRename update resolve-latest diagnostic code +1/-1

Rename update resolve-latest diagnostic code

• Updates update --latest resolve failure code to ERR_PNPM_PACKAGE_MANAGER_UPDATE_RESOLVE_LATEST.

pnpm/crates/package-manager/src/update.rs

lib.rsMap package-manifest errors to pnpm-equivalent ERR_PNPM_* codes +6/-6

Map package-manifest errors to pnpm-equivalent ERR_PNPM_* codes

• Renames internal manifest error codes to ERR_PNPM_* and maps specific user-facing cases to pnpm’s canonical codes (ERR_PNPM_PACKAGE_JSON_EXISTS, ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND, ERR_PNPM_NO_SCRIPT).

pnpm/crates/package-manifest/src/lib.rs

extract_manifest_from_packed.rsRename publish extract-manifest diagnostics to ERR_PNPM_PUBLISH_* +2/-2

Rename publish extract-manifest diagnostics to ERR_PNPM_PUBLISH_*

• Updates archive read and manifest parse diagnostic codes to ERR_PNPM_PUBLISH_EXTRACT_MANIFEST_*.

pnpm/crates/publish/src/extract_manifest_from_packed.rs

lib.rsRename registry diagnostics to ERR_PNPM_REGISTRY_* +5/-5

Rename registry diagnostics to ERR_PNPM_REGISTRY_*

• Updates missing latest/version, network/io, and serialization diagnostic codes to ERR_PNPM_REGISTRY_*.

pnpm/crates/registry/src/lib.rs

lib.rsPrefix resolver unsupported-spec code with ERR_PNPM_* +1/-1

Prefix resolver unsupported-spec code with ERR_PNPM_*

• Renames SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER to ERR_PNPM_SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER.

pnpm/crates/resolving-default-resolver/src/lib.rs

resolve_dependency_tree.rsAlign deps-resolver diagnostics with ERR_PNPM_* +3/-3

Align deps-resolver diagnostics with ERR_PNPM_*

• Updates unsupported-spec, exotic-subdep, and pnpmfile-hook failure codes to pnpm-compatible ERR_PNPM_* names.

pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs

local_resolver.rsPrefix local resolver directory errors with ERR_PNPM_* +2/-2

Prefix local resolver directory errors with ERR_PNPM_*

• Renames LINKED_PKG_DIR_NOT_FOUND and NOT_PACKAGE_DIRECTORY to ERR_PNPM_* prefixed equivalents.

pnpm/crates/resolving-local-resolver/src/local_resolver.rs

parse_bare_specifier.rsPrefix unsupported path protocol code with ERR_PNPM_* +1/-1

Prefix unsupported path protocol code with ERR_PNPM_*

• Renames PATH_IS_UNSUPPORTED_PROTOCOL to ERR_PNPM_PATH_IS_UNSUPPORTED_PROTOCOL.

pnpm/crates/resolving-local-resolver/src/parse_bare_specifier.rs

errors.rsRename npm resolver diagnostics to ERR_PNPM_RESOLVING_NPM_RESOLVER_* +8/-8

Rename npm resolver diagnostics to ERR_PNPM_RESOLVING_NPM_RESOLVER_*

• Updates metadata fetch/decode/filter/cache and guard errors to ERR_PNPM_* codes, including a shared ERR_PNPM_CACHE_MISSING_AFTER_304.

pnpm/crates/resolving-npm-resolver/src/errors.rs

mirror.rsRename npm resolver mirror diagnostics to ERR_PNPM_* +6/-6

Rename npm resolver mirror diagnostics to ERR_PNPM_*

• Updates mirror persistence, URL parsing, missing host, and encoding-related diagnostic codes to ERR_PNPM_RESOLVING_NPM_RESOLVER_MIRROR_*.

pnpm/crates/resolving-npm-resolver/src/mirror.rs

pick_package.rsRename mirror persist diagnostics in pick_package to ERR_PNPM_* +3/-3

Rename mirror persist diagnostics in pick_package to ERR_PNPM_*

• Updates encode/serialize/write diagnostic codes for mirror persistence to ERR_PNPM_RESOLVING_NPM_RESOLVER_PICK_PACKAGE_*.

pnpm/crates/resolving-npm-resolver/src/pick_package.rs

resolve_from_workspace.rsRename workspace resolve diagnostics to ERR_PNPM_* +2/-2

Rename workspace resolve diagnostics to ERR_PNPM_*

• Updates workspace-packages-not-loaded and unparsable spec diagnostic codes to ERR_PNPM_RESOLVING_NPM_RESOLVER_*.

pnpm/crates/resolving-npm-resolver/src/resolve_from_workspace.rs

trust_checks.rsAlign trust diagnostics with pnpm ERR_PNPM_TRUST_DOWNGRADE +2/-2

Align trust diagnostics with pnpm ERR_PNPM_TRUST_DOWNGRADE

• Renames trust-check-failed code to ERR_PNPM_RESOLVING_NPM_RESOLVER_TRUST_CHECK_FAILED and maps trust downgrade to pnpm’s canonical ERR_PNPM_TRUST_DOWNGRADE.

pnpm/crates/resolving-npm-resolver/src/trust_checks.rs

msgpackr_records.rsRename store-dir msgpackr diagnostics to ERR_PNPM_STORE_DIR_* +9/-9

Rename store-dir msgpackr diagnostics to ERR_PNPM_STORE_DIR_*

• Updates msgpack decode/encode diagnostic codes under ERR_PNPM_STORE_DIR_MSGPACKR_RECORDS_* (EOF, unknown slot, type expectations, trailing bytes, slot exhaustion).

pnpm/crates/store-dir/src/msgpackr_records.rs

project_registry.rsRename project registry diagnostics to ERR_PNPM_STORE_DIR_* +8/-8

Rename project registry diagnostics to ERR_PNPM_STORE_DIR_*

• Updates register/list project registry IO/symlink diagnostics and maps project inaccessible to ERR_PNPM_PROJECT_INACCESSIBLE.

pnpm/crates/store-dir/src/project_registry.rs

prune.rsRename store prune diagnostics to ERR_PNPM_STORE_DIR_* +2/-2

Rename store prune diagnostics to ERR_PNPM_STORE_DIR_*

• Updates prune slot removal and sweep dir read diagnostic codes to ERR_PNPM_STORE_DIR_PRUNE_*.

pnpm/crates/store-dir/src/prune.rs

store_index.rsRename store index diagnostics to ERR_PNPM_STORE_DIR_* +7/-7

Rename store index diagnostics to ERR_PNPM_STORE_DIR_*

• Updates index DB create/open/URI/schema/read/write/decode diagnostic codes to ERR_PNPM_STORE_DIR_STORE_INDEX_*.

pnpm/crates/store-dir/src/store_index.rs

lib.rsAlign tarball diagnostics with ERR_PNPM_* contract +12/-12

Align tarball diagnostics with ERR_PNPM_* contract

• Renames tarball fetch/status/IO/checksum/gzip/task/join/path-traversal/zip handling diagnostic codes to ERR_PNPM_* equivalents, including mapping path traversal to ERR_PNPM_PATH_TRAVERSAL.

pnpm/crates/tarball/src/lib.rs

error.rsRename versioning IO diagnostics to ERR_PNPM_VERSIONING_* +3/-3

Rename versioning IO diagnostics to ERR_PNPM_VERSIONING_*

• Updates read/write/remove diagnostic codes to ERR_PNPM_VERSIONING_*.

pnpm/crates/versioning/src/error.rs

lib.rsRename workspace manifest writer diagnostics to ERR_PNPM_* +8/-8

Rename workspace manifest writer diagnostics to ERR_PNPM_*

• Updates read/parse/edit/write/remove and override/conflict/inline/control-char diagnostic codes to ERR_PNPM_WORKSPACE_MANIFEST_WRITER_*.

pnpm/crates/workspace-manifest-writer/src/lib.rs

filter.rsRename workspace projects filter diagnostics to ERR_PNPM_* +2/-2

Rename workspace projects filter diagnostics to ERR_PNPM_*

• Updates invalid pattern and unsupported selector diagnostic codes to ERR_PNPM_WORKSPACE_PROJECTS_FILTER_*.

pnpm/crates/workspace-projects-filter/src/filter.rs

lib.rsRename workspace state read/write diagnostics to ERR_PNPM_* +5/-5

Rename workspace state read/write diagnostics to ERR_PNPM_*

• Updates workspace state create/serialize/write/read/parse diagnostic codes to ERR_PNPM_WORKSPACE_STATE_*.

pnpm/crates/workspace-state/src/lib.rs

manifest.rsPrefix invalid workspace configuration code with ERR_PNPM_* +1/-1

Prefix invalid workspace configuration code with ERR_PNPM_*

• Renames invalid workspace configuration diagnostic code to ERR_PNPM_INVALID_WORKSPACE_CONFIGURATION.

pnpm/crates/workspace/src/manifest.rs

project_manifest.rsRename workspace project-manifest diagnostics to ERR_PNPM_* +4/-4

Rename workspace project-manifest diagnostics to ERR_PNPM_*

• Updates read/parse/unsupported-name and missing-manifest diagnostic codes, mapping missing importer manifest to ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND.

pnpm/crates/workspace/src/project_manifest.rs

projects.rsRename workspace project discovery diagnostics to ERR_PNPM_* +2/-2

Rename workspace project discovery diagnostics to ERR_PNPM_*

• Updates invalid glob and walk error diagnostic codes to ERR_PNPM_WORKSPACE_INVALID_GLOB and ERR_PNPM_WORKSPACE_WALK_ERROR.

pnpm/crates/workspace/src/projects.rs

root_finder.rsRename bad workspace manifest name diagnostic code +1/-1

Rename bad workspace manifest name diagnostic code

• Updates bad workspace manifest name diagnostic code to ERR_PNPM_BAD_WORKSPACE_MANIFEST_NAME.

pnpm/crates/workspace/src/root_finder.rs

Tests (7) +12 / -11
test_classic_login.rsUpdate classic login tests to assert ERR_PNPM_* codes +1/-1

Update classic login tests to assert ERR_PNPM_* codes

• Adjusts test expectations to match the new ERR_PNPM_AUTH_COMMANDS_* diagnostic code strings surfaced via miette.

pnpm/crates/auth-commands/src/login/test_classic_login.rs

test_web_login_errors.rsUpdate web login tests for ERR_PNPM_* codes +3/-3

Update web login tests for ERR_PNPM_* codes

• Updates assertions for request/QR/unsafe-URL error codes to ERR_PNPM_AUTH_COMMANDS_*.

pnpm/crates/auth-commands/src/login/test_web_login_errors.rs

tests.rsUpdate config CLI tests to assert ERR_PNPM_* +1/-1

Update config CLI tests to assert ERR_PNPM_*

• Updates the test to expect the ERR_PNPM_CLI_CONFIG_SET_INVALID_CONTROL_CHARACTER code.

pnpm/crates/cli/src/cli_args/config/tests.rs

deploy.rsUpdate deploy test to match ERR_PNPM_DIRECTORY_FETCHER_PATH_ESCAPE +2/-1

Update deploy test to match ERR_PNPM_DIRECTORY_FETCHER_PATH_ESCAPE

• Adjusts the deploy symlink-escape test to assert the stable ERR_PNPM_DIRECTORY_FETCHER_PATH_ESCAPE code.

pnpm/crates/cli/tests/deploy.rs

lockfile_only.rsUpdate lockfile-only test to match ERR_PNPM_OUTDATED_LOCKFILE +1/-1

Update lockfile-only test to match ERR_PNPM_OUTDATED_LOCKFILE

• Changes stale-lockfile assertion to expect ERR_PNPM_OUTDATED_LOCKFILE instead of matching a pacquet/internal code fragment.

pnpm/crates/cli/tests/lockfile_only.rs

workspace_install.rsUpdate workspace install tests for ERR_PNPM_* codes +2/-2

Update workspace install tests for ERR_PNPM_* codes

• Updates frozen-install assertions to match ERR_PNPM_OUTDATED_LOCKFILE and ERR_PNPM_PACKAGE_MANAGER_NO_IMPORTER.

pnpm/crates/cli/tests/workspace_install.rs

tests.rsUpdate node resolver tests to expect ERR_PNPM_* codes +2/-2

Update node resolver tests to expect ERR_PNPM_* codes

• Adjusts test assertions for offline and version-not-found failures to the ERR_PNPM_* prefixed codes.

pnpm/crates/engine-runtime-node-resolver/src/node_resolver/tests.rs

Documentation (1) +5 / -0
pacquet-err-pnpm-error-codes.mdAdd changeset documenting error-code contract change +5/-0

Add changeset documenting error-code contract change

• Adds a release note explaining that all Rust-reported diagnostic codes are now ERR_PNPM_* codes. Calls out the breaking nature for scripts/CI that matched the previous pacquet/internal codes.

.changeset/pacquet-err-pnpm-error-codes.md

@greptile-apps

greptile-apps Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

This PR is safe to merge — it is a systematic rename of diagnostic codes with no logic changes, backed by a full 6128-test suite pass, zero-collision verification across all 259 rule-2 codes, and explicit parity guards added to the most security-sensitive paths.

The change is purely additive to the public contract: users who already match on ERR_PNPM_* codes see no difference, and users matching old internal codes are warned by the changeset. The critical ERR_PNPM_TARBALL_INTEGRITY and ERR_PNPM_TRUST_DOWNGRADE paths — where pnpm matches the diagnostic code by name at runtime — are correctly aligned. The mislabeled FrozenLockfileWithUpdateChecksums correction is accurate and the doc-comment fix removes a genuinely misleading claim. No logic, data, or protocol changes are present.

No files require special attention. The tarball/src/lib.rs and resolving-npm-resolver/src/trust_checks.rs changes are the most externally visible (pnpm matches their codes at runtime) and both are correctly aligned.

Reviews (3): Last reviewed commit: "test: assert diagnostic codes, not just ..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                          main                                   pr
-----                          ----                                   --
lockfile/parse_pnpm_lock       1.05     13.6±1.88ms    27.6 MB/sec    1.00     12.9±0.69ms    29.0 MB/sec
packument/parse                1.08     43.8±3.49µs  1513.1 MB/sec    1.00     40.7±0.76µs  1628.7 MB/sec
tarball/download_dependency    1.10      3.0±0.36ms  1424.5 KB/sec    1.00      2.8±0.26ms  1568.3 KB/sec

@qodo-code-review

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

Copy link
Copy Markdown

Code Review by Qodo

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

Context used
✅ Compliance rules (platform): 18 rules

Grey Divider


Action required

1. Wrong tarball integrity code ✓ Resolved 🐞 Bug ⛨ Security
Description
TarballError::Checksum now reports ERR_PNPM_TARBALL_VERIFY_CHECKSUM_ERROR, but pnpm’s
established integrity-mismatch code is ERR_PNPM_TARBALL_INTEGRITY. Because the N-API bridge
forwards miette::Diagnostic::code() as the JS error code, consumers matching on
ERR_PNPM_TARBALL_INTEGRITY (often treated as a supply-chain signal) will not recognize the failure
from the Rust engine.
Code

pnpm/crates/tarball/src/lib.rs[R165-169]

    #[diagnostic(
-        code(pacquet_tarball::verify_checksum_error),
+        code(ERR_PNPM_TARBALL_VERIFY_CHECKSUM_ERROR),
        help(
            "The downloaded tarball does not match the integrity recorded in the lockfile. If you trust the new content (legitimate republish, or stale local metadata cache), run `pnpm install --update-checksums`. Otherwise treat this as a potential supply-chain issue and verify the new content first."
        )
Evidence
pnpm defines the integrity mismatch as TARBALL_INTEGRITY (thus emitted as
ERR_PNPM_TARBALL_INTEGRITY), while the Rust variant is currently tagged with a different code and
that code is forwarded to JS consumers via the N-API error envelope.

pnpm/crates/tarball/src/lib.rs[143-176]
pnpm11/worker/src/index.ts[130-158]
pnpm/crates/napi/src/error.rs[34-49]
pnpm/crates/tarball/src/lib.rs[1522-1556]

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

## Issue description
`TarballError::Checksum` is an integrity verification failure but is currently tagged with `ERR_PNPM_TARBALL_VERIFY_CHECKSUM_ERROR`, which is not the pnpm contract code for this condition.

This breaks parity with pnpm’s `TARBALL_INTEGRITY` error (surfacing as `ERR_PNPM_TARBALL_INTEGRITY`) and can cause downstream tooling/CI to miss integrity failures.

## Issue Context
- pnpm’s TypeScript implementation throws `PnpmError('TARBALL_INTEGRITY', ...)` for checksum mismatches.
- The Rust N-API bridge forwards `Diagnostic::code()` directly into the JS error envelope, so the diagnostic code is externally observable.

## Fix Focus Areas
- pnpm/crates/tarball/src/lib.rs[165-171]

## Expected change
- Change the `TarballError::Checksum` diagnostic code to `ERR_PNPM_TARBALL_INTEGRITY`.
- (Optional but recommended) add/adjust a unit test that asserts `TarballError::Checksum` emits `ERR_PNPM_TARBALL_INTEGRITY` to prevent future regressions.

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



Remediation recommended

2. Changeset missing pnpm entry 📘 Rule violation § Compliance
Description
The new changeset front-matter lists only pacquet and does not declare a bump for pnpm, which
the compliance checklist requires. If this rule is enforced by release tooling, the pnpm package may
not receive the intended version bump/release note alignment.
Code

.changeset/pacquet-err-pnpm-error-codes.md[R1-3]

+---
+"pacquet": patch
+---
Evidence
PR Compliance ID 713436 requires changesets to include a pnpm entry. The added changeset
front-matter includes only pacquet, so it does not satisfy the rule as written.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/pacquet-err-pnpm-error-codes.md[1-3]

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

## Issue description
The changeset `.changeset/pacquet-err-pnpm-error-codes.md` does not include a `pnpm` package entry in its front-matter.

## Issue Context
Compliance rule PR Compliance ID 713436 requires that changeset files explicitly declare the `pnpm` package and a valid bump type (`patch`/`minor`/`major`).

## Fix Focus Areas
- .changeset/pacquet-err-pnpm-error-codes.md[1-3]

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



Informational

3. Hook code docs ambiguous 🐞 Bug ⚙ Maintainability ⭐ New
Description
HookError docs mention both ERR_PNPM_PNPMFILE_FAIL and ERR_PNPM_BAD_READ_PACKAGE_HOOK_RESULT,
but the resolver currently documents and emits only ERR_PNPM_PNPMFILE_FAIL for all pnpmfile hook
failures. This ambiguity can mislead maintainers about which ERR_PNPM_* codes are actually
observable today.
Code

pnpm/crates/hooks/src/lib.rs[19]

+/// Covers the `ERR_PNPM_PNPMFILE_FAIL` / `ERR_PNPM_BAD_READ_PACKAGE_HOOK_RESULT` conditions: a
Evidence
The hook module docs name both codes, while the dependency resolver’s error type explicitly states
pacquet does not distinguish the two conditions yet and annotates the error with
#[diagnostic(code(ERR_PNPM_PNPMFILE_FAIL))], meaning that is the observable code in this path.

pnpm/crates/hooks/src/lib.rs[17-22]
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs[278-286]

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

## Issue description
`pnpm/crates/hooks/src/lib.rs` documents that hook failures cover both `ERR_PNPM_PNPMFILE_FAIL` and `ERR_PNPM_BAD_READ_PACKAGE_HOOK_RESULT`, but the resolver layer explicitly states pacquet does not distinguish those cases yet and surfaces them under `ERR_PNPM_PNPMFILE_FAIL`.

## Issue Context
This PR is specifically about making diagnostic codes a stable public contract (`ERR_PNPM_*`). Documentation that implies an observable code split that is not currently implemented risks future contributors making incorrect assumptions.

## Fix Focus Areas
- pnpm/crates/hooks/src/lib.rs[17-22]

## Suggested fix
Adjust the comment to explicitly state the current mapping, e.g.:
- These conditions exist upstream, but pacquet currently surfaces both under `ERR_PNPM_PNPMFILE_FAIL` and does not yet emit `ERR_PNPM_BAD_READ_PACKAGE_HOOK_RESULT` separately (reserved for future distinction).

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

Results up to commit 7c70e3c


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


Action required
1. Wrong tarball integrity code ✓ Resolved 🐞 Bug ⛨ Security
Description
TarballError::Checksum now reports ERR_PNPM_TARBALL_VERIFY_CHECKSUM_ERROR, but pnpm’s
established integrity-mismatch code is ERR_PNPM_TARBALL_INTEGRITY. Because the N-API bridge
forwards miette::Diagnostic::code() as the JS error code, consumers matching on
ERR_PNPM_TARBALL_INTEGRITY (often treated as a supply-chain signal) will not recognize the failure
from the Rust engine.
Code

pnpm/crates/tarball/src/lib.rs[R165-169]

    #[diagnostic(
-        code(pacquet_tarball::verify_checksum_error),
+        code(ERR_PNPM_TARBALL_VERIFY_CHECKSUM_ERROR),
        help(
            "The downloaded tarball does not match the integrity recorded in the lockfile. If you trust the new content (legitimate republish, or stale local metadata cache), run `pnpm install --update-checksums`. Otherwise treat this as a potential supply-chain issue and verify the new content first."
        )
Evidence
pnpm defines the integrity mismatch as TARBALL_INTEGRITY (thus emitted as
ERR_PNPM_TARBALL_INTEGRITY), while the Rust variant is currently tagged with a different code and
that code is forwarded to JS consumers via the N-API error envelope.

pnpm/crates/tarball/src/lib.rs[143-176]
pnpm11/worker/src/index.ts[130-158]
pnpm/crates/napi/src/error.rs[34-49]
pnpm/crates/tarball/src/lib.rs[1522-1556]

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

## Issue description
`TarballError::Checksum` is an integrity verification failure but is currently tagged with `ERR_PNPM_TARBALL_VERIFY_CHECKSUM_ERROR`, which is not the pnpm contract code for this condition.

This breaks parity with pnpm’s `TARBALL_INTEGRITY` error (surfacing as `ERR_PNPM_TARBALL_INTEGRITY`) and can cause downstream tooling/CI to miss integrity failures.

## Issue Context
- pnpm’s TypeScript implementation throws `PnpmError('TARBALL_INTEGRITY', ...)` for checksum mismatches.
- The Rust N-API bridge forwards `Diagnostic::code()` directly into the JS error envelope, so the diagnostic code is externally observable.

## Fix Focus Areas
- pnpm/crates/tarball/src/lib.rs[165-171]

## Expected change
- Change the `TarballError::Checksum` diagnostic code to `ERR_PNPM_TARBALL_INTEGRITY`.
- (Optional but recommended) add/adjust a unit test that asserts `TarballError::Checksum` emits `ERR_PNPM_TARBALL_INTEGRITY` to prevent future regressions.

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



Remediation recommended
2. Changeset missing pnpm entry 📘 Rule violation § Compliance
Description
The new changeset front-matter lists only pacquet and does not declare a bump for pnpm, which
the compliance checklist requires. If this rule is enforced by release tooling, the pnpm package may
not receive the intended version bump/release note alignment.
Code

.changeset/pacquet-err-pnpm-error-codes.md[R1-3]

+---
+"pacquet": patch
+---
Evidence
PR Compliance ID 713436 requires changesets to include a pnpm entry. The added changeset
front-matter includes only pacquet, so it does not satisfy the rule as written.

Rule 713436: Explicitly declare pnpm package and correct bump type in changesets
.changeset/pacquet-err-pnpm-error-codes.md[1-3]

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

## Issue description
The changeset `.changeset/pacquet-err-pnpm-error-codes.md` does not include a `pnpm` package entry in its front-matter.

## Issue Context
Compliance rule PR Compliance ID 713436 requires that changeset files explicitly declare the `pnpm` package and a valid bump type (`patch`/`minor`/`major`).

## Fix Focus Areas
- .changeset/pacquet-err-pnpm-error-codes.md[1-3]

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


Qodo Logo

Comment thread pnpm/crates/tarball/src/lib.rs Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

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

Inline comments:
In `@pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs`:
- Line 231: Update the stale diagnostic-code references in the comments adjacent
to the diagnostic attributes: in
pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs at lines 231,
258, and 282, and in pnpm/crates/resolving-local-resolver/src/local_resolver.rs
at lines 117 and 126. Rename each documented identifier to its current
ERR_PNPM_* code, including both codes referenced at line 282, without changing
the diagnostic attributes or behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6a6c1213-c50e-4eeb-a8a4-9b61d3fc91cc

📥 Commits

Reviewing files that changed from the base of the PR and between 27646a0 and 7c70e3c.

⛔ Files ignored due to path filters (1)
  • pnpm/crates/cli/tests/snapshots/init__should_throw_on_existing_file.snap is excluded by !**/*.snap, !**/*.snap
📒 Files selected for processing (85)
  • .changeset/pacquet-err-pnpm-error-codes.md
  • pnpm/crates/auth-commands/src/login/classic_login.rs
  • pnpm/crates/auth-commands/src/login/error.rs
  • pnpm/crates/auth-commands/src/login/test_classic_login.rs
  • pnpm/crates/auth-commands/src/login/test_web_login_errors.rs
  • pnpm/crates/auth-commands/src/logout.rs
  • pnpm/crates/cli/src/cli_args/config.rs
  • pnpm/crates/cli/src/cli_args/config/tests.rs
  • pnpm/crates/cli/src/cli_args/dlx.rs
  • pnpm/crates/cli/src/cli_args/exec.rs
  • pnpm/crates/cli/src/cli_args/patch.rs
  • pnpm/crates/cli/src/cli_args/patch_commit.rs
  • pnpm/crates/cli/src/cli_args/patch_remove.rs
  • pnpm/crates/cli/src/cli_args/patch_state.rs
  • pnpm/crates/cli/src/cli_args/prefix.rs
  • pnpm/crates/cli/src/cli_args/root.rs
  • pnpm/crates/cli/tests/deploy.rs
  • pnpm/crates/cli/tests/lockfile_only.rs
  • pnpm/crates/cli/tests/workspace_install.rs
  • pnpm/crates/cmd-shim/src/link_bins.rs
  • pnpm/crates/crypto-shasums-file/src/lib.rs
  • pnpm/crates/directory-fetcher/src/error.rs
  • pnpm/crates/engine-runtime-bun-resolver/src/bun_resolver.rs
  • pnpm/crates/engine-runtime-bun-resolver/src/read_bun_assets.rs
  • pnpm/crates/engine-runtime-deno-resolver/src/deno_resolver.rs
  • pnpm/crates/engine-runtime-deno-resolver/src/read_deno_assets.rs
  • pnpm/crates/engine-runtime-node-resolver/src/node_resolver.rs
  • pnpm/crates/engine-runtime-node-resolver/src/node_resolver/tests.rs
  • pnpm/crates/engine-runtime-node-resolver/src/parse_node_specifier.rs
  • pnpm/crates/engine-runtime-node-resolver/src/resolve_node_version.rs
  • pnpm/crates/env-installer/src/errors.rs
  • pnpm/crates/executor/src/lib.rs
  • pnpm/crates/executor/src/lifecycle.rs
  • pnpm/crates/executor/src/run_script.rs
  • pnpm/crates/exportable-manifest/src/create.rs
  • pnpm/crates/fs-packlist/src/lib.rs
  • pnpm/crates/git-fetcher/src/error.rs
  • pnpm/crates/lockfile/src/load_lockfile.rs
  • pnpm/crates/lockfile/src/save_lockfile.rs
  • pnpm/crates/modules-yaml/src/lib.rs
  • pnpm/crates/pack/src/lib.rs
  • pnpm/crates/package-manager/src/add.rs
  • pnpm/crates/package-manager/src/build_snapshot.rs
  • pnpm/crates/package-manager/src/create_virtual_dir_by_snapshot.rs
  • pnpm/crates/package-manager/src/create_virtual_store.rs
  • pnpm/crates/package-manager/src/install.rs
  • pnpm/crates/package-manager/src/install_frozen_lockfile.rs
  • pnpm/crates/package-manager/src/install_package_by_snapshot.rs
  • pnpm/crates/package-manager/src/install_package_from_registry.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
  • pnpm/crates/package-manager/src/link_bins.rs
  • pnpm/crates/package-manager/src/link_manifest_link_deps.rs
  • pnpm/crates/package-manager/src/link_root_component_members.rs
  • pnpm/crates/package-manager/src/minimum_release_age.rs
  • pnpm/crates/package-manager/src/package_extender.rs
  • pnpm/crates/package-manager/src/patch.rs
  • pnpm/crates/package-manager/src/patch_commit.rs
  • pnpm/crates/package-manager/src/prune_direct_deps.rs
  • pnpm/crates/package-manager/src/symlink_direct_dependencies.rs
  • pnpm/crates/package-manager/src/update.rs
  • pnpm/crates/package-manifest/src/lib.rs
  • pnpm/crates/publish/src/extract_manifest_from_packed.rs
  • pnpm/crates/registry/src/lib.rs
  • pnpm/crates/resolving-default-resolver/src/lib.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs
  • pnpm/crates/resolving-local-resolver/src/local_resolver.rs
  • pnpm/crates/resolving-local-resolver/src/parse_bare_specifier.rs
  • pnpm/crates/resolving-npm-resolver/src/errors.rs
  • pnpm/crates/resolving-npm-resolver/src/mirror.rs
  • pnpm/crates/resolving-npm-resolver/src/pick_package.rs
  • pnpm/crates/resolving-npm-resolver/src/resolve_from_workspace.rs
  • pnpm/crates/resolving-npm-resolver/src/trust_checks.rs
  • pnpm/crates/store-dir/src/msgpackr_records.rs
  • pnpm/crates/store-dir/src/project_registry.rs
  • pnpm/crates/store-dir/src/prune.rs
  • pnpm/crates/store-dir/src/store_index.rs
  • pnpm/crates/tarball/src/lib.rs
  • pnpm/crates/versioning/src/error.rs
  • pnpm/crates/workspace-manifest-writer/src/lib.rs
  • pnpm/crates/workspace-projects-filter/src/filter.rs
  • pnpm/crates/workspace-state/src/lib.rs
  • pnpm/crates/workspace/src/manifest.rs
  • pnpm/crates/workspace/src/project_manifest.rs
  • pnpm/crates/workspace/src/projects.rs
  • pnpm/crates/workspace/src/root_finder.rs

@qodo-code-review

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

Copy link
Copy Markdown

PR Code Suggestions ✨

Latest suggestions up to dfafc29

Warning

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

CategorySuggestion                                                                                                                                    Impact
Possible issue
Match missing-importer error semantics

Change the missing-importer error code to ERR_PNPM_OUTDATED_LOCKFILE in both the
test and implementation to correctly match pnpm's behavior.

pnpm/crates/cli/tests/workspace_install.rs [319]

-stderr.contains("ERR_PNPM_PACKAGE_MANAGER_NO_IMPORTER") && stderr.contains("pkg-a"),
+stderr.contains("ERR_PNPM_OUTDATED_LOCKFILE") && stderr.contains("pkg-a"),
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that simply prefixing an internal error code does not align with the actual error code pnpm uses for this scenario (ERR_PNPM_OUTDATED_LOCKFILE), though fixing this test will also require updating the underlying implementation.

Medium
  • More

Previous suggestions

✅ Suggestions up to commit 7c70e3c
CategorySuggestion                                                                                                                                    Impact
General
Add tarball prefix to error code

Rename ERR_PNPM_PATH_TRAVERSAL to ERR_PNPM_TARBALL_PATH_TRAVERSAL.

pnpm/crates/tarball/src/lib.rs [218-219]

-#[diagnostic(code(ERR_PNPM_PATH_TRAVERSAL))]
+#[diagnostic(code(ERR_PNPM_TARBALL_PATH_TRAVERSAL))]
 PathTraversal { url: String, entry_path: String, reason: &'static str },
Suggestion importance[1-10]: 4

__

Why: Standardizing error codes across the crate improves naming consistency, though ERR_PNPM_PATH_TRAVERSAL might be intended to match a specific pnpm error code exactly.

Low
✅ Remove duplicate in error code
Suggestion Impact:The commit changed `ERR_PNPM_TARBALL_TARBALL_TOO_LARGE` to `ERR_PNPM_TARBALL_TOO_LARGE` exactly as suggested.

code diff:

-    #[diagnostic(code(ERR_PNPM_TARBALL_TARBALL_TOO_LARGE))]
+    #[diagnostic(code(ERR_PNPM_TARBALL_TOO_LARGE))]

Simplify the error code to ERR_PNPM_TARBALL_TOO_LARGE to avoid duplication.

pnpm/crates/tarball/src/lib.rs [196-197]

-#[diagnostic(code(ERR_PNPM_TARBALL_TARBALL_TOO_LARGE))]
+#[diagnostic(code(ERR_PNPM_TARBALL_TOO_LARGE))]
 TarballTooLarge { url: String, advertised_size: u64 },
Suggestion importance[1-10]: 4

__

Why: Removing the duplicated word in ERR_PNPM_TARBALL_TARBALL_TOO_LARGE makes the code cleaner, assuming it still aligns with upstream pnpm error codes.

Low

@github-actions

github-actions Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: dfafc291e28c

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

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.586 ± 0.133 2.460 2.909 1.50 ± 0.18
pacquet@main 2.829 ± 0.171 2.613 3.097 1.65 ± 0.20
pnpr@HEAD 1.719 ± 0.184 1.508 2.006 1.00
pnpr@main 1.752 ± 0.136 1.541 1.935 1.02 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5861872635800003,
      "stddev": 0.13265033450760383,
      "median": 2.56630163268,
      "user": 2.13288264,
      "system": 1.6679198200000003,
      "min": 2.45966910918,
      "max": 2.90851612118,
      "times": [
        2.50668567218,
        2.56464514618,
        2.62161343118,
        2.6271550231800003,
        2.56795811918,
        2.47365344018,
        2.45966910918,
        2.90851612118,
        2.4795817811800003,
        2.65239479218
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.8290269797799996,
      "stddev": 0.1709923543112872,
      "median": 2.83387158418,
      "user": 2.71485614,
      "system": 1.9799769199999997,
      "min": 2.61308145318,
      "max": 3.09701697218,
      "times": [
        2.8710115211800002,
        3.09701697218,
        2.61308145318,
        2.6179550761800003,
        2.79673164718,
        2.8901961371800002,
        2.66979508618,
        2.91334801218,
        2.75591687118,
        3.06521702118
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.7186378264799997,
      "stddev": 0.18381766861093432,
      "median": 1.6966779066800002,
      "user": 1.76259624,
      "system": 1.80251172,
      "min": 1.50837824118,
      "max": 2.00620577418,
      "times": [
        1.57049707018,
        1.8678075281800002,
        2.00620577418,
        1.5348987041800002,
        1.87668632918,
        1.50837824118,
        1.6126547551800001,
        1.8862293191800001,
        1.78070105818,
        1.5423194851800002
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.75201686758,
      "stddev": 0.13607105030652814,
      "median": 1.76569765768,
      "user": 1.8047190400000002,
      "system": 1.7936067200000003,
      "min": 1.54092166118,
      "max": 1.93483005918,
      "times": [
        1.8111612721800001,
        1.54092166118,
        1.93483005918,
        1.7464141021800001,
        1.7031267191800001,
        1.84092705518,
        1.56407951418,
        1.92801586118,
        1.78498121318,
        1.6657112181800002
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 360.1 ± 21.8 334.0 408.8 1.03 ± 0.11
pacquet@main 348.3 ± 31.8 307.1 406.2 1.00
pnpr@HEAD 374.9 ± 16.9 349.7 394.8 1.08 ± 0.11
pnpr@main 380.2 ± 22.9 338.3 416.2 1.09 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.36006225388,
      "stddev": 0.021845961397013215,
      "median": 0.35928125048000004,
      "user": 0.35523627999999996,
      "system": 0.83634542,
      "min": 0.33398698248,
      "max": 0.40877190648,
      "times": [
        0.33398698248,
        0.38167191048000004,
        0.36182065148000003,
        0.35178069548,
        0.36128235748000004,
        0.34080948548,
        0.40877190648,
        0.34193604848000003,
        0.35826296748,
        0.36029953348000004
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.34825364778,
      "stddev": 0.03184323781738148,
      "median": 0.34085947998,
      "user": 0.36223528,
      "system": 0.7748560200000002,
      "min": 0.30713385048,
      "max": 0.40622939648,
      "times": [
        0.34443140948,
        0.30713385048,
        0.33728755048000003,
        0.35003433548,
        0.37549976248,
        0.38720657948000003,
        0.40622939648,
        0.32964067348000003,
        0.32440640348,
        0.32066651648
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.37488366797999995,
      "stddev": 0.016923294715895536,
      "median": 0.38043089798000007,
      "user": 0.38813237999999994,
      "system": 0.79151862,
      "min": 0.34973817748,
      "max": 0.39479179948000004,
      "times": [
        0.35217250348,
        0.37450166248,
        0.34973817748,
        0.38851394148,
        0.39095375848,
        0.38355087148,
        0.35375216948000004,
        0.37873200248000005,
        0.39479179948000004,
        0.38212979348000004
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.38016609738000007,
      "stddev": 0.022934971993291826,
      "median": 0.38139089348,
      "user": 0.37806818,
      "system": 0.8214624199999999,
      "min": 0.33826557348,
      "max": 0.41616830948000005,
      "times": [
        0.33826557348,
        0.37093275748000004,
        0.40121448848,
        0.38971380148,
        0.39264492148,
        0.37980745048000003,
        0.41616830948000005,
        0.35013188448000004,
        0.38040311248,
        0.38237867448
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.263 ± 0.072 3.138 3.370 1.87 ± 0.14
pacquet@main 3.262 ± 0.033 3.217 3.323 1.87 ± 0.14
pnpr@HEAD 1.744 ± 0.127 1.528 1.922 1.00
pnpr@main 1.802 ± 0.135 1.626 1.998 1.03 ± 0.11
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.263051575680001,
      "stddev": 0.0715775381974154,
      "median": 3.2570264623800003,
      "user": 2.8653153799999997,
      "system": 2.0476201599999997,
      "min": 3.13757327238,
      "max": 3.36962363738,
      "times": [
        3.1764465143800003,
        3.3319197263800002,
        3.2448380553800003,
        3.13757327238,
        3.36962363738,
        3.32545497738,
        3.2992083823800002,
        3.2313982663800003,
        3.2658769003800003,
        3.24817602438
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.262493117980001,
      "stddev": 0.03272956741205686,
      "median": 3.2595920533800005,
      "user": 2.8401433799999998,
      "system": 2.04212506,
      "min": 3.2170233123800003,
      "max": 3.32322064038,
      "times": [
        3.2614473733800002,
        3.2794507803800004,
        3.3026289063800003,
        3.23509208238,
        3.23739302838,
        3.32322064038,
        3.2170233123800003,
        3.23991245438,
        3.27102586838,
        3.2577367333800002
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.74353579338,
      "stddev": 0.12713653335681718,
      "median": 1.7201538433799999,
      "user": 1.6675273799999997,
      "system": 1.75410446,
      "min": 1.52754370138,
      "max": 1.92247115838,
      "times": [
        1.76426305238,
        1.86043670638,
        1.52754370138,
        1.67543315338,
        1.6548271933799998,
        1.78888224338,
        1.67604463438,
        1.90625290938,
        1.65920318138,
        1.92247115838
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.80231926508,
      "stddev": 0.1350234677656537,
      "median": 1.79746672688,
      "user": 1.66874988,
      "system": 1.7727036600000001,
      "min": 1.62578195938,
      "max": 1.99763917838,
      "times": [
        1.99763917838,
        1.95281989838,
        1.66785438638,
        1.87890985838,
        1.83244953638,
        1.93545060738,
        1.69863021038,
        1.76248391738,
        1.67117309838,
        1.62578195938
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 918.2 ± 71.0 829.9 1037.1 2.38 ± 0.21
pacquet@main 993.1 ± 67.3 879.8 1120.7 2.57 ± 0.21
pnpr@HEAD 385.7 ± 16.5 361.6 420.2 1.00
pnpr@main 459.5 ± 19.1 434.6 503.1 1.19 ± 0.07
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.9182483217800002,
      "stddev": 0.07104274311983418,
      "median": 0.91592760738,
      "user": 1.15719898,
      "system": 0.95686096,
      "min": 0.8298584418800001,
      "max": 1.03708582388,
      "times": [
        0.9805813228800001,
        0.8298584418800001,
        0.91803833288,
        1.03708582388,
        0.87359766788,
        0.9715580138800001,
        0.8320690268800001,
        0.9732073298800001,
        0.9138168818800001,
        0.85267037588
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.99313813638,
      "stddev": 0.06732055274665272,
      "median": 1.00053105238,
      "user": 1.26382468,
      "system": 0.9489657600000001,
      "min": 0.8797565398800001,
      "max": 1.12066115888,
      "times": [
        1.01899482388,
        0.93966179788,
        1.00323269188,
        0.9894758558800001,
        0.92093310788,
        0.99782941288,
        1.12066115888,
        1.03289341588,
        1.02794255888,
        0.8797565398800001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.38573130758000007,
      "stddev": 0.01653753450096191,
      "median": 0.38808021888000005,
      "user": 0.33141777999999994,
      "system": 0.70760066,
      "min": 0.36161803088000005,
      "max": 0.42021770888000004,
      "times": [
        0.3880501128800001,
        0.39152529988000007,
        0.37864843188,
        0.38811032488,
        0.38826804388,
        0.36763731888000006,
        0.42021770888000004,
        0.36161803088000005,
        0.39803098488000005,
        0.37520681888000007
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.45946339588,
      "stddev": 0.01914088600265162,
      "median": 0.45459531488000005,
      "user": 0.33948588,
      "system": 0.73815396,
      "min": 0.43459158688000005,
      "max": 0.50309323788,
      "times": [
        0.4707444598800001,
        0.43459158688000005,
        0.4553437698800001,
        0.44658668388000006,
        0.45521476688000007,
        0.50309323788,
        0.4539758628800001,
        0.44780671188000004,
        0.47473447688000003,
        0.45254240188000006
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.478 ± 0.120 2.312 2.631 6.24 ± 0.38
pacquet@main 2.604 ± 0.214 2.231 2.862 6.56 ± 0.59
pnpr@HEAD 0.425 ± 0.038 0.396 0.529 1.07 ± 0.10
pnpr@main 0.397 ± 0.014 0.377 0.423 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.4777149136400003,
      "stddev": 0.12002340646540151,
      "median": 2.45568763214,
      "user": 1.7109175999999997,
      "system": 1.2147633199999999,
      "min": 2.31225372364,
      "max": 2.63110235664,
      "times": [
        2.61088772664,
        2.59381729264,
        2.49232053164,
        2.63110235664,
        2.58441073864,
        2.4167598736400002,
        2.36929772264,
        2.34724443764,
        2.4190547326400003,
        2.31225372364
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.60438246714,
      "stddev": 0.21360664591546896,
      "median": 2.66024325264,
      "user": 1.8672148,
      "system": 1.22528362,
      "min": 2.23146647964,
      "max": 2.86220581764,
      "times": [
        2.40627996264,
        2.23146647964,
        2.3535967816400003,
        2.5887026956400003,
        2.73309860664,
        2.86220581764,
        2.73178380964,
        2.76176221264,
        2.8126731726400003,
        2.56225513264
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.42540544884000003,
      "stddev": 0.038406490043871554,
      "median": 0.41216013914000005,
      "user": 0.3412611,
      "system": 0.7812615199999999,
      "min": 0.39579248664,
      "max": 0.5294662816400001,
      "times": [
        0.42814460164,
        0.41032114964,
        0.39579248664,
        0.43807514564,
        0.41051447464,
        0.5294662816400001,
        0.40604430464,
        0.41448295764000004,
        0.40740728264000003,
        0.41380580364
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.39715096404,
      "stddev": 0.014437662962583241,
      "median": 0.39633809764,
      "user": 0.323724,
      "system": 0.73832612,
      "min": 0.37727473664,
      "max": 0.42321144964,
      "times": [
        0.39901099664,
        0.39366519864,
        0.37727473664,
        0.39136999464,
        0.38647334364,
        0.42321144964,
        0.41062230764,
        0.40806201564,
        0.40231873764000003,
        0.37950085964
      ]
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 681.4 ± 67.1 570.4 786.5 6.10 ± 0.63
pacquet@main 652.4 ± 45.7 580.3 744.5 5.84 ± 0.45
pnpr@HEAD 111.6 ± 3.4 103.1 118.9 1.00
pnpr@main 112.5 ± 4.3 105.8 122.2 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.6813797191,
      "stddev": 0.06712628679888147,
      "median": 0.6879441884,
      "user": 0.6558228399999999,
      "system": 0.116574,
      "min": 0.5703657999,
      "max": 0.7865498929,
      "times": [
        0.5703657999,
        0.6730500749,
        0.5957098639,
        0.6762893469000001,
        0.7581029229,
        0.7057022359,
        0.7865498929,
        0.7117726189,
        0.6995990299,
        0.6366554049
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.6524190114999999,
      "stddev": 0.0456989728850248,
      "median": 0.6443816834,
      "user": 0.6179094399999999,
      "system": 0.1249533,
      "min": 0.5802899209,
      "max": 0.7445104219,
      "times": [
        0.6236130799,
        0.7445104219,
        0.6696124709000001,
        0.6592406249,
        0.7026432239,
        0.5802899209,
        0.6502064189000001,
        0.6385569479000001,
        0.6292409199000001,
        0.6262760859000001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.1116261050666667,
      "stddev": 0.003393896838767068,
      "median": 0.1113264659,
      "user": 0.03201193166666666,
      "system": 0.017500116666666666,
      "min": 0.1031492339,
      "max": 0.1188694929,
      "times": [
        0.1142482789,
        0.1115612579,
        0.1166339919,
        0.1095191509,
        0.1090956029,
        0.1090850739,
        0.1158683509,
        0.1122688309,
        0.1172093349,
        0.10927496090000001,
        0.1104073349,
        0.1126395679,
        0.1109812749,
        0.1188694929,
        0.1111875439,
        0.1119017379,
        0.1141775149,
        0.10734920390000001,
        0.1110390229,
        0.1114972869,
        0.1114653879,
        0.11056290590000001,
        0.1090341789,
        0.1031492339
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.11246602802500001,
      "stddev": 0.00428638915711482,
      "median": 0.1125190724,
      "user": 0.03463184833333333,
      "system": 0.015264574999999997,
      "min": 0.1057742569,
      "max": 0.1222436279,
      "times": [
        0.1177248469,
        0.1057742569,
        0.1119704889,
        0.1083291799,
        0.1073741009,
        0.1177212609,
        0.1093742979,
        0.1172492809,
        0.1163897619,
        0.1077369749,
        0.1120244589,
        0.1222436279,
        0.11273876590000001,
        0.1125867299,
        0.1124514149,
        0.1154155669,
        0.1088630059,
        0.1058835639,
        0.1141815129,
        0.1152804929,
        0.1147864329,
        0.1116261999,
        0.11427620990000001,
        0.1071822399
      ]
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 5.050 ± 0.191 4.805 5.369 1.32 ± 0.09
pacquet@main 5.317 ± 0.333 4.903 5.964 1.39 ± 0.11
pnpr@HEAD 4.083 ± 0.164 3.765 4.292 1.07 ± 0.07
pnpr@main 3.830 ± 0.205 3.631 4.167 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 5.04966304062,
      "stddev": 0.19143223172135598,
      "median": 5.051958905019999,
      "user": 3.12990466,
      "system": 2.28515608,
      "min": 4.80530265702,
      "max": 5.36895818502,
      "times": [
        5.13540924402,
        5.04817858502,
        5.36895818502,
        5.05573922502,
        5.24203494502,
        4.89430747702,
        4.80530265702,
        4.84687539902,
        4.87888819402,
        5.22093649502
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 5.31665345742,
      "stddev": 0.3333506127603531,
      "median": 5.24889286102,
      "user": 3.21007536,
      "system": 2.48105528,
      "min": 4.90253042402,
      "max": 5.96364510102,
      "times": [
        4.90253042402,
        5.16720080502,
        4.92644954802,
        5.23275376302,
        5.72867131602,
        5.96364510102,
        5.41811131202,
        5.13423058502,
        5.26503195902,
        5.42790976102
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 4.08256312702,
      "stddev": 0.16421794681166368,
      "median": 4.05339710652,
      "user": 2.1443325599999996,
      "system": 2.1414039799999998,
      "min": 3.76477172302,
      "max": 4.29173686902,
      "times": [
        4.06665860902,
        4.28941944402,
        4.03240904302,
        3.96617556702,
        4.04013560402,
        3.76477172302,
        4.20192852602,
        4.19293166002,
        3.97946422502,
        4.29173686902
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.8304026991199995,
      "stddev": 0.20528456346517063,
      "median": 3.74163089002,
      "user": 1.9527747599999998,
      "system": 1.9024215799999997,
      "min": 3.6305992630199997,
      "max": 4.16685192102,
      "times": [
        3.79419903702,
        4.1528232120199995,
        4.0229582620199995,
        4.16685192102,
        3.73679798702,
        3.66566453502,
        3.6305992630199997,
        3.65161516502,
        3.73605381602,
        3.74646379302
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13091
Testbedpacquet

🚨 1 Alert

BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Upper Boundary
(Limit %)
isolated-linker.fresh-resolve.hot-cache.offlineLatency
milliseconds (ms)
📈 plot
🚷 threshold
🚨 alert (🔔)
681.38 ms
(+44.90%)Baseline: 470.26 ms
564.31 ms
(120.75%)

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
3,263.05 ms
(+0.50%)Baseline: 3,246.72 ms
3,896.06 ms
(83.75%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
2,477.71 ms
(+7.69%)Baseline: 2,300.89 ms
2,761.07 ms
(89.74%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
918.25 ms
(+2.46%)Baseline: 896.23 ms
1,075.47 ms
(85.38%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
🚨 view alert (🔔)
681.38 ms
(+44.90%)Baseline: 470.26 ms
564.31 ms
(120.75%)

isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,586.19 ms
(-13.09%)Baseline: 2,975.55 ms
3,570.66 ms
(72.43%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
5,049.66 ms
(-7.25%)Baseline: 5,444.36 ms
6,533.23 ms
(77.29%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
360.06 ms
(-3.55%)Baseline: 373.30 ms
447.96 ms
(80.38%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/13091
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,667.77 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
308.59 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
350.56 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
84.62 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,519.39 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,523.12 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
276.56 ms
🐰 View full continuous benchmarking report in Bencher

Copilot AI review requested due to automatic review settings July 17, 2026 08:11

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 added 3 commits July 17, 2026 10:14
Error codes are a public contract — users match on them in CI and
scripts, and pnpm documents them at https://pnpm.io/errors. 284 of
pacquet's `#[diagnostic(code(...))]` sites reported something else:

    $ pnpm root -g
    Error: pacquet_cli::root_global_unsupported

`pacquet` is an in-repo crate name that means nothing to a user of the
`pnpm` binary. A second group reported unprefixed codes
(`GIT_CHECKOUT_FAILED`), which are the *short* names pnpm passes to
`PnpmError`; its constructor prepends `ERR_PNPM_` before the code is ever
observed, so pacquet was emitting a code pnpm never emits.

Rename all 259 offending codes across 284 sites under two rules:

1. Where pnpm defines a code for the same error, use pnpm's exact code.
   `pacquet_package_manager::outdated_lockfile` becomes
   `ERR_PNPM_OUTDATED_LOCKFILE` — which its own doc comment already
   claimed it was — and `GIT_CHECKOUT_FAILED` becomes
   `ERR_PNPM_GIT_CHECKOUT_FAILED`.
2. Otherwise derive from the full path minus the crate prefix, so
   `pacquet::patch_state_read` becomes `ERR_PNPM_PATCH_STATE_READ`. The
   namespace is retained rather than the leaf alone: six distinct
   `create_dir` errors would otherwise collapse onto one code.

Three merge onto codes pacquet already used elsewhere for the same
condition, which is the intent, not a clash. pnpm has a single
`ERR_PNPM_TRUST_DOWNGRADE` and matches on it by name in
`deps-resolver`, so pacquet's resolver-side and lockfile-side trust
downgrades now share it.

Two errors were mislabelled and are corrected rather than renamed:

- `frozen_lockfile_with_outdated_lockfile` is not pnpm's outdated-lockfile
  error. The variant is `FrozenLockfileWithUpdateChecksums` and the
  message is about combining --frozen-lockfile with --update-checksums.
  It takes `ERR_PNPM_CONFIG_CONFLICT_FROZEN_LOCKFILE_WITH_UPDATE_CHECKSUMS`,
  following the existing ERR_PNPM_CONFIG_CONFLICT_* convention, and its
  doc comment no longer claims to be the error it isn't.
- Three package-manifest errors have pnpm equivalents under a different
  name, which rule 1 cannot see because it matches on the name: "package.json
  file already exists" is pnpm's `PACKAGE_JSON_EXISTS` (thrown by
  `pnpm init`), "No package.json was found" is
  `NO_IMPORTER_MANIFEST_FOUND`, and "Missing script" is `NO_SCRIPT`.

All 610 diagnostic codes are now ERR_PNPM_*.
… mismatch

`TarballError::Checksum` is the downloaded-tarball-does-not-match-the-
lockfile error. pnpm calls that `TARBALL_INTEGRITY`
(`fetching/binary-fetcher/src/index.ts`, `worker/src/index.ts`), and
matches on the emitted code by name:

    const BROKEN_LOCKFILE_INTEGRITY_ERRORS = new Set([
      'ERR_PNPM_UNEXPECTED_PKG_CONTENT_IN_STORE',
      'ERR_PNPM_TARBALL_INTEGRITY',
    ])

so the code drives lockfile-integrity recovery rather than only being
printed. The N-API bridge forwards `Diagnostic::code()` into the JS error
(`napi/src/error.rs`), which makes the diagnostic code externally
observable — a consumer treating an integrity mismatch as a supply-chain
signal would not have recognised it under a pacquet-specific name.

The correct code was already recorded one layer away:
`tarball_error_to_request_retry` has mapped `TarballError::Checksum` to
`ERR_PNPM_TARBALL_INTEGRITY` in the retry payload all along. The
diagnostic attribute now agrees with it, so one error reports one code on
both surfaces.

`TarballTooLarge` gets the same treatment: the derived name stuttered
(`ERR_PNPM_TARBALL_TARBALL_TOO_LARGE`, crate + leaf), and the retry
mapping already called it `ERR_PNPM_TARBALL_TOO_LARGE`.

All four tarball codes that pnpm defines — TARBALL_INTEGRITY,
PATH_TRAVERSAL, NO_OFFLINE_TARBALL, TARBALL_TOO_LARGE — now match between
the diagnostic attribute and the retry payload.

Reported by Qodo on the review of the parent commit.
The rename updated `#[diagnostic(code(...))]` but not the prose around
it, leaving 42 comment lines naming pre-rename identifiers — "Carries the
`LINKED_PKG_DIR_NOT_FOUND` code" when the code emitted is now
`ERR_PNPM_LINKED_PKG_DIR_NOT_FOUND`. One sentence managed both
conventions at once:

    /// The error codes (`GIT_DEP_PREPARE_NOT_ALLOWED`,
    /// `ERR_PNPM_PREPARE_PACKAGE`, `INVALID_PATH`) match pnpm's

The short forms were not wrong so much as ambiguous: they are the names
pnpm passes to `PnpmError`, which are not the names either stack emits.
Spelling every reference the way it appears in output makes the comment
checkable against the attribute below it, and matches the
`pnpm.io/errors/<code>` URLs those comments point at.

`BAD_READ_PACKAGE_HOOK_RESULT` is included: pnpm raises it via
`super('BAD_READ_PACKAGE_HOOK_RESULT', ...)` in `requirePnpmfile.ts`, so
it is a real code, referenced by pacquet only in prose.

Reported by CodeRabbit on the review of the parent commit.
@qodo-code-review

Copy link
Copy Markdown

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

@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

@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/cli/tests/install.rs`:
- Line 987: The renamed diagnostic codes are only documented in comments, so the
tests do not detect regressions. Update the relevant assertions in
pnpm/crates/cli/tests/install.rs:987-987 to verify the exact catalog diagnostic
code for the missing-entry case;
pnpm/crates/git-fetcher/src/tarball_fetcher/tests.rs:622-622 and :662-662 to
assert ERR_PNPM_INVALID_PATH; and
pnpm/crates/resolving-local-resolver/tests/resolve.rs:383-383 to assert
ERR_PNPM_LINKED_PKG_DIR_NOT_FOUND, while preserving the existing message and
behavior checks.

In `@pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs`:
- Around line 279-282: Update the documentation for the PnpmfileHook variant to
mention only the ERR_PNPM_PNPMFILE_FAIL diagnostic code it actually emits.
Remove the unsupported ERR_PNPM_BAD_READ_PACKAGE_HOOK_RESULT reference, unless a
separate diagnostic path is implemented to emit that code consistently with
pnpm’s canonical public contract.
🪄 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: 843df1b5-f822-4910-90e4-a523e6cfab86

📥 Commits

Reviewing files that changed from the base of the PR and between 7c70e3c and c831702.

📒 Files selected for processing (22)
  • pnpm/crates/cli/tests/install.rs
  • pnpm/crates/crypto-shasums-file/src/lib.rs
  • pnpm/crates/engine-runtime-deno-resolver/src/deno_resolver.rs
  • pnpm/crates/engine-runtime-deno-resolver/src/read_deno_assets.rs
  • pnpm/crates/engine-runtime-node-resolver/src/node_resolver.rs
  • pnpm/crates/engine-runtime-node-resolver/src/parse_node_specifier.rs
  • pnpm/crates/engine-runtime-node-resolver/src/resolve_node_version.rs
  • pnpm/crates/git-fetcher/src/error.rs
  • pnpm/crates/git-fetcher/src/fetcher/tests.rs
  • pnpm/crates/git-fetcher/src/prepare_package.rs
  • pnpm/crates/git-fetcher/src/tarball_fetcher/tests.rs
  • pnpm/crates/hooks/src/lib.rs
  • pnpm/crates/napi/src/resolve.rs
  • pnpm/crates/napi/src/resolve/tests.rs
  • pnpm/crates/package-manager/src/create_virtual_store.rs
  • pnpm/crates/package-manager/src/install_package_by_snapshot.rs
  • pnpm/crates/resolving-default-resolver/src/lib.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs
  • pnpm/crates/resolving-local-resolver/src/lib.rs
  • pnpm/crates/resolving-local-resolver/src/local_resolver.rs
  • pnpm/crates/resolving-local-resolver/tests/resolve.rs
  • pnpm/crates/tarball/src/lib.rs
🚧 Files skipped from review as they are similar to previous changes (10)
  • pnpm/crates/resolving-default-resolver/src/lib.rs
  • pnpm/crates/engine-runtime-node-resolver/src/resolve_node_version.rs
  • pnpm/crates/resolving-local-resolver/src/local_resolver.rs
  • pnpm/crates/engine-runtime-deno-resolver/src/deno_resolver.rs
  • pnpm/crates/engine-runtime-deno-resolver/src/read_deno_assets.rs
  • pnpm/crates/engine-runtime-node-resolver/src/node_resolver.rs
  • pnpm/crates/package-manager/src/create_virtual_store.rs
  • pnpm/crates/package-manager/src/install_package_by_snapshot.rs
  • pnpm/crates/git-fetcher/src/error.rs
  • pnpm/crates/crypto-shasums-file/src/lib.rs

Comment thread pnpm/crates/cli/tests/install.rs Resolved
@codecov-commenter

codecov-commenter commented Jul 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.49%. Comparing base (73707d2) to head (dfafc29).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13091      +/-   ##
==========================================
- Coverage   85.49%   85.49%   -0.01%     
==========================================
  Files         501      501              
  Lines       80484    80484              
==========================================
- Hits        68807    68806       -1     
- Misses      11677    11678       +1     

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

zkochan added 2 commits July 17, 2026 10:29
The previous commit spelled every code reference in its emitted
`ERR_PNPM_*` form, which was wrong for this one. `PnpmfileHook` carries
only `ERR_PNPM_PNPMFILE_FAIL`; `HookError` has no diagnostic code of its
own. Writing the second identifier as `ERR_PNPM_BAD_READ_PACKAGE_HOOK_RESULT`
turned a note about which pnpm *conditions* the variant covers into a
claim that it emits a code it cannot emit.

Say what it emits, and record the parity gap the old wording was hinting
at: pnpm splits these conditions across two codes, reserving
BAD_READ_PACKAGE_HOOK_RESULT for a hook that returns a non-manifest,
which pacquet does not distinguish yet. Closing that gap means splitting
HookError, which is not a rename.

Reported by CodeRabbit.
Four tests named a diagnostic code in a doc comment but asserted only the
enum variant or the message text, so a code regression — the exact thing
this branch changes — would not fail them.

Assert the code itself, following the pattern already established in
`git_fetcher::fetcher::tests`, whose comment says a rename "would
silently regress error-code parity with pnpm without this check":

    let code = err.code().map(|c| c.to_string()).unwrap_or_default();
    assert_eq!(code, "ERR_PNPM_INVALID_PATH");

Covers the traversal and missing-subdir rejections
(ERR_PNPM_INVALID_PATH), the missing `file:` tarball target
(ERR_PNPM_LINKED_PKG_DIR_NOT_FOUND), and the catalog misconfiguration
(ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_SPEC), whose test asserted the
prose while its comment made a claim about the code specifically.

Each assertion was verified to fail against a deliberately regressed
code before being kept.

Reported by CodeRabbit.
Copilot AI review requested due to automatic review settings July 17, 2026 08:43
@zkochan
zkochan force-pushed the fix-error-codes-err-pnpm branch from c831702 to dfafc29 Compare July 17, 2026 08:43

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

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

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pnpm/crates/workspace-manifest-writer/src/lib.rs (1)

134-159: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Revert unrelated API refactor to maintain scope discipline.

This functional API change (refactoring from a single dependency update to a batch update via an iterator) violates the PR's scope. As per path instructions, this PR should remain strictly focused on diagnostic error code unification, with no unrelated refactors or churn.

Please revert this method's signature and implementation back to their original state to keep the PR focused and prevent unintended behavioral consequences.

🤖 Prompt for 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.

In `@pnpm/crates/workspace-manifest-writer/src/lib.rs` around lines 134 - 159,
Revert set_config_dependencies to its original single-dependency API and
implementation, replacing the IntoIterator batch parameter with the prior
name/specifier arguments and removing the iterator loop. Preserve the existing
manifest read, parse, edit, and write behavior without introducing unrelated
batching changes.

Source: Path instructions

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

Outside diff comments:
In `@pnpm/crates/workspace-manifest-writer/src/lib.rs`:
- Around line 134-159: Revert set_config_dependencies to its original
single-dependency API and implementation, replacing the IntoIterator batch
parameter with the prior name/specifier arguments and removing the iterator
loop. Preserve the existing manifest read, parse, edit, and write behavior
without introducing unrelated batching changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 56094d55-9610-4a4c-868a-efeb9b4d1fb4

📥 Commits

Reviewing files that changed from the base of the PR and between c831702 and dfafc29.

⛔ Files ignored due to path filters (1)
  • pnpm/crates/cli/tests/snapshots/init__should_throw_on_existing_file.snap is excluded by !**/*.snap, !**/*.snap
📒 Files selected for processing (94)
  • .changeset/pacquet-err-pnpm-error-codes.md
  • pnpm/crates/auth-commands/src/login/classic_login.rs
  • pnpm/crates/auth-commands/src/login/error.rs
  • pnpm/crates/auth-commands/src/login/test_classic_login.rs
  • pnpm/crates/auth-commands/src/login/test_web_login_errors.rs
  • pnpm/crates/auth-commands/src/logout.rs
  • pnpm/crates/cli/src/cli_args/config.rs
  • pnpm/crates/cli/src/cli_args/config/tests.rs
  • pnpm/crates/cli/src/cli_args/dlx.rs
  • pnpm/crates/cli/src/cli_args/exec.rs
  • pnpm/crates/cli/src/cli_args/patch.rs
  • pnpm/crates/cli/src/cli_args/patch_commit.rs
  • pnpm/crates/cli/src/cli_args/patch_remove.rs
  • pnpm/crates/cli/src/cli_args/patch_state.rs
  • pnpm/crates/cli/src/cli_args/prefix.rs
  • pnpm/crates/cli/src/cli_args/root.rs
  • pnpm/crates/cli/tests/deploy.rs
  • pnpm/crates/cli/tests/install.rs
  • pnpm/crates/cli/tests/lockfile_only.rs
  • pnpm/crates/cli/tests/workspace_install.rs
  • pnpm/crates/cmd-shim/src/link_bins.rs
  • pnpm/crates/crypto-shasums-file/src/lib.rs
  • pnpm/crates/directory-fetcher/src/error.rs
  • pnpm/crates/engine-runtime-bun-resolver/src/bun_resolver.rs
  • pnpm/crates/engine-runtime-bun-resolver/src/read_bun_assets.rs
  • pnpm/crates/engine-runtime-deno-resolver/src/deno_resolver.rs
  • pnpm/crates/engine-runtime-deno-resolver/src/read_deno_assets.rs
  • pnpm/crates/engine-runtime-node-resolver/src/node_resolver.rs
  • pnpm/crates/engine-runtime-node-resolver/src/node_resolver/tests.rs
  • pnpm/crates/engine-runtime-node-resolver/src/parse_node_specifier.rs
  • pnpm/crates/engine-runtime-node-resolver/src/resolve_node_version.rs
  • pnpm/crates/env-installer/src/errors.rs
  • pnpm/crates/executor/src/lib.rs
  • pnpm/crates/executor/src/lifecycle.rs
  • pnpm/crates/executor/src/run_script.rs
  • pnpm/crates/exportable-manifest/src/create.rs
  • pnpm/crates/fs-packlist/src/lib.rs
  • pnpm/crates/git-fetcher/src/error.rs
  • pnpm/crates/git-fetcher/src/fetcher/tests.rs
  • pnpm/crates/git-fetcher/src/prepare_package.rs
  • pnpm/crates/git-fetcher/src/tarball_fetcher/tests.rs
  • pnpm/crates/hooks/src/lib.rs
  • pnpm/crates/lockfile/src/load_lockfile.rs
  • pnpm/crates/lockfile/src/save_lockfile.rs
  • pnpm/crates/modules-yaml/src/lib.rs
  • pnpm/crates/napi/src/resolve.rs
  • pnpm/crates/napi/src/resolve/tests.rs
  • pnpm/crates/pack/src/lib.rs
  • pnpm/crates/package-manager/src/add.rs
  • pnpm/crates/package-manager/src/build_snapshot.rs
  • pnpm/crates/package-manager/src/create_virtual_dir_by_snapshot.rs
  • pnpm/crates/package-manager/src/create_virtual_store.rs
  • pnpm/crates/package-manager/src/install.rs
  • pnpm/crates/package-manager/src/install_frozen_lockfile.rs
  • pnpm/crates/package-manager/src/install_package_by_snapshot.rs
  • pnpm/crates/package-manager/src/install_package_from_registry.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
  • pnpm/crates/package-manager/src/link_bins.rs
  • pnpm/crates/package-manager/src/link_manifest_link_deps.rs
  • pnpm/crates/package-manager/src/link_root_component_members.rs
  • pnpm/crates/package-manager/src/minimum_release_age.rs
  • pnpm/crates/package-manager/src/package_extender.rs
  • pnpm/crates/package-manager/src/patch.rs
  • pnpm/crates/package-manager/src/patch_commit.rs
  • pnpm/crates/package-manager/src/prune_direct_deps.rs
  • pnpm/crates/package-manager/src/symlink_direct_dependencies.rs
  • pnpm/crates/package-manager/src/update.rs
  • pnpm/crates/package-manifest/src/lib.rs
  • pnpm/crates/publish/src/extract_manifest_from_packed.rs
  • pnpm/crates/registry/src/lib.rs
  • pnpm/crates/resolving-default-resolver/src/lib.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs
  • pnpm/crates/resolving-local-resolver/src/lib.rs
  • pnpm/crates/resolving-local-resolver/src/local_resolver.rs
  • pnpm/crates/resolving-local-resolver/src/parse_bare_specifier.rs
  • pnpm/crates/resolving-local-resolver/tests/resolve.rs
  • pnpm/crates/resolving-npm-resolver/src/errors.rs
  • pnpm/crates/resolving-npm-resolver/src/mirror.rs
  • pnpm/crates/resolving-npm-resolver/src/pick_package.rs
  • pnpm/crates/resolving-npm-resolver/src/resolve_from_workspace.rs
  • pnpm/crates/resolving-npm-resolver/src/trust_checks.rs
  • pnpm/crates/store-dir/src/msgpackr_records.rs
  • pnpm/crates/store-dir/src/project_registry.rs
  • pnpm/crates/store-dir/src/prune.rs
  • pnpm/crates/store-dir/src/store_index.rs
  • pnpm/crates/tarball/src/lib.rs
  • pnpm/crates/versioning/src/error.rs
  • pnpm/crates/workspace-manifest-writer/src/lib.rs
  • pnpm/crates/workspace-projects-filter/src/filter.rs
  • pnpm/crates/workspace-state/src/lib.rs
  • pnpm/crates/workspace/src/manifest.rs
  • pnpm/crates/workspace/src/project_manifest.rs
  • pnpm/crates/workspace/src/projects.rs
  • pnpm/crates/workspace/src/root_finder.rs
🚧 Files skipped from review as they are similar to previous changes (66)
  • pnpm/crates/package-manager/src/package_extender.rs
  • pnpm/crates/package-manager/src/add.rs
  • pnpm/crates/package-manager/src/link_bins.rs
  • pnpm/crates/workspace/src/manifest.rs
  • pnpm/crates/git-fetcher/src/fetcher/tests.rs
  • pnpm/crates/directory-fetcher/src/error.rs
  • pnpm/crates/package-manager/src/install_package_from_registry.rs
  • pnpm/crates/lockfile/src/load_lockfile.rs
  • pnpm/crates/resolving-npm-resolver/src/resolve_from_workspace.rs
  • pnpm/crates/napi/src/resolve.rs
  • pnpm/crates/lockfile/src/save_lockfile.rs
  • pnpm/crates/resolving-local-resolver/src/lib.rs
  • pnpm/crates/registry/src/lib.rs
  • pnpm/crates/auth-commands/src/login/error.rs
  • pnpm/crates/engine-runtime-node-resolver/src/parse_node_specifier.rs
  • pnpm/crates/engine-runtime-bun-resolver/src/read_bun_assets.rs
  • pnpm/crates/cli/src/cli_args/config.rs
  • pnpm/crates/package-manager/src/create_virtual_dir_by_snapshot.rs
  • pnpm/crates/engine-runtime-node-resolver/src/node_resolver/tests.rs
  • pnpm/crates/workspace/src/root_finder.rs
  • pnpm/crates/hooks/src/lib.rs
  • pnpm/crates/cli/tests/deploy.rs
  • pnpm/crates/exportable-manifest/src/create.rs
  • pnpm/crates/pack/src/lib.rs
  • pnpm/crates/store-dir/src/prune.rs
  • pnpm/crates/modules-yaml/src/lib.rs
  • pnpm/crates/package-manager/src/link_manifest_link_deps.rs
  • pnpm/crates/auth-commands/src/login/classic_login.rs
  • pnpm/crates/resolving-default-resolver/src/lib.rs
  • pnpm/crates/cli/src/cli_args/prefix.rs
  • pnpm/crates/workspace/src/project_manifest.rs
  • pnpm/crates/package-manager/src/create_virtual_store.rs
  • pnpm/crates/cli/src/cli_args/patch_remove.rs
  • pnpm/crates/cli/src/cli_args/patch.rs
  • pnpm/crates/engine-runtime-node-resolver/src/node_resolver.rs
  • pnpm/crates/auth-commands/src/login/test_web_login_errors.rs
  • pnpm/crates/versioning/src/error.rs
  • pnpm/crates/executor/src/lifecycle.rs
  • pnpm/crates/engine-runtime-deno-resolver/src/deno_resolver.rs
  • .changeset/pacquet-err-pnpm-error-codes.md
  • pnpm/crates/package-manager/src/patch.rs
  • pnpm/crates/fs-packlist/src/lib.rs
  • pnpm/crates/cli/src/cli_args/config/tests.rs
  • pnpm/crates/napi/src/resolve/tests.rs
  • pnpm/crates/package-manager/src/link_root_component_members.rs
  • pnpm/crates/package-manager/src/prune_direct_deps.rs
  • pnpm/crates/resolving-deps-resolver/src/resolve_dependency_tree.rs
  • pnpm/crates/resolving-npm-resolver/src/mirror.rs
  • pnpm/crates/package-manager/src/install_frozen_lockfile.rs
  • pnpm/crates/executor/src/lib.rs
  • pnpm/crates/git-fetcher/src/tarball_fetcher/tests.rs
  • pnpm/crates/crypto-shasums-file/src/lib.rs
  • pnpm/crates/engine-runtime-deno-resolver/src/read_deno_assets.rs
  • pnpm/crates/cli/tests/workspace_install.rs
  • pnpm/crates/cli/src/cli_args/patch_commit.rs
  • pnpm/crates/tarball/src/lib.rs
  • pnpm/crates/package-manifest/src/lib.rs
  • pnpm/crates/auth-commands/src/logout.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile.rs
  • pnpm/crates/resolving-npm-resolver/src/errors.rs
  • pnpm/crates/store-dir/src/store_index.rs
  • pnpm/crates/resolving-local-resolver/src/local_resolver.rs
  • pnpm/crates/workspace-projects-filter/src/filter.rs
  • pnpm/crates/package-manager/src/install.rs
  • pnpm/crates/workspace-state/src/lib.rs
  • pnpm/crates/package-manager/src/patch_commit.rs

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 17, 2026
@zkochan
zkochan merged commit 352c079 into main Jul 17, 2026
38 of 39 checks passed
@zkochan
zkochan deleted the fix-error-codes-err-pnpm branch July 17, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants