# pnpm/pnpm — codebase unpack

> Canonical page: https://codevetter.com/unpack/pnpm

This is a deterministic Repo Unpack scan of pnpm/pnpm — a structural map, not a review, security audit, or maintainer-endorsed description.

- Scanned commit: b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385 (2026-10-02)
- Last upstream commit: fix: take file locks with flock on Android (#16512)
- Generated by codevetter 1.15.0 on 2026-10-02
- 4000 files scanned · 22.2 MB

Source inspection; upstream code and tests were not executed.

## Languages

- Rust: 3194 files
- TypeScript: 2093 files
- JSON: 1556 files
- Markdown: 1125 files
- JavaScript: 384 files
- YAML: 317 files
- TOML: 126 files
- Shell: 13 files

## Repository structure

- pnpm/ — 1251 files
- pnpm11/ — 1251 files
- pnpr/ — 817 files
- .changeset/ — 538 files
- .github/ — 75 files
- .agents/ — 10 files
- .husky/ — 7 files
- .meta-updater/ — 6 files

Probable source entrypoint: `pnpm/` (inferred from the tree, not upstream docs)

## Package

- Cargo.toml: null — 0 declared dependencies

## Structural health signals

Average score 6.4/10 across 96 files; 49 hotspots. These are deterministic review leads, not proof of a bug.

## Recent history

- b2ef6cb63b8b (2026-10-02) fix: take file locks with flock on Android (#16512)
- 658dbc30a61c (2026-10-02) feat: support pnpm in StackBlitz WebContainers (#16499)
- da17e33bb653 (2026-10-02) fix(cmd-shim): end the pnpm CLI's batch context before it runs (#16509)
- 80afdd52f74d (2026-10-02) refactor(resolver): drop the installable flag the walk never reads (#16513)
- 1435ce4ce6ee (2026-10-02) fix(resolving): revalidate release-age upgraded metadata with its full ETag (#16507)

## Overview

At commit b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385, this repository contains the Rust pnpm v12 CLI, the maintained TypeScript pnpm v11 CLI, and pnpr, a Rust registry server. It serves developers managing dependencies, workspaces, scripts, and releases, plus operators hosting or proxying packages. Distinctive mechanisms include content-addressed installation, separate wanted and installed lockfile state, policy verification, JavaScript hooks, and an optional server-assisted resolution path. This brief reflects bounded source inspection, including three concrete flows; it is not exhaustive coverage or runtime validation.

## System map

The repository has two CLI implementations and a sibling registry server, with shared Rust crates rather than one uniform runtime. The Rust CLI separates startup, command routing, application state, and the installation engine. pnpr builds an Axum server around configuration, identity, routing, storage, and optional protocol surfaces. Root manifests coordinate builds and tests across both language stacks.
- The root Cargo workspace includes pnpm crates, pnpm task binaries, and pnpr crates; its shared package metadata selects Rust edition 2024. — [Cargo.toml#L1-12](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/Cargo.toml#L1-L12)
- The Rust executable's main delegates to pnpm_cli::main, which installs diagnostics and runs CLI startup on a separate thread; normal commands use a Tokio runtime with 32 MiB stack headroom. — [pnpm/crates/cli/src/bin/main.rs#L1-3](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/bin/main.rs#L1-L3) [pnpm/crates/cli/src/lib.rs#L62-80](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/lib.rs#L62-L80) [pnpm/crates/cli/src/lib.rs#L298-349](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/lib.rs#L298-L349)
- The TypeScript entrypoint dynamically loads main and the worker API, routes errors through errorHandler, and drains workers in finally; its package ships bin launchers and dist output and requires Node >=22.13. — [pnpm11/pnpm/src/pnpm.ts#L12-27](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm11/pnpm/src/pnpm.ts#L12-L27) [pnpm11/pnpm/package.json#L43-58](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm11/pnpm/package.json#L43-L58) [pnpm11/pnpm/package.json#L190-192](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm11/pnpm/package.json#L190-L192)
- CLI State owns manifest data, a lazy wanted lockfile, resolved-package state, and shared HTTP/tarball caches; configuration is borrowed as a process-lifetime Config. — [pnpm/crates/cli/src/state.rs#L30-58](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/state.rs#L30-L58)
- pnpr exposes library router/serve APIs and a Tokio binary; serve validates enabled surfaces and registry routing, loads OSV and authentication, builds the router, then binds and serves with graceful shutdown. — [pnpr/crates/pnpr/src/lib.rs#L19-41](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/lib.rs#L19-L41) [pnpr/crates/pnpr/src/main.rs#L123-157](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/main.rs#L123-L157) [pnpr/crates/pnpr/src/server.rs#L343-363](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server.rs#L343-L363)
- pnpr separates durable hosted storage from its disposable local proxy cache. HostedBackend supports local or S3-compatible implementations, while authentication supports local htpasswd/SQLite and selectable shared SQL backends. — [pnpr/crates/storage/src/backend.rs#L13-24](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/storage/src/backend.rs#L13-L24) [pnpr/crates/auth/src/lib.rs#L3-27](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/auth/src/lib.rs#L3-L27)
- Root scripts provide Rust build, affected tests, smoke tests, checks, and linting, alongside TypeScript compilation and package testing; pnpm-workspace.yaml wraps CI scripts in named pipelines and assigns task concurrency groups. — [package.json#L7-34](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/package.json#L7-L34) [package.json#L48-59](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/package.json#L48-L59) [pnpm-workspace.yaml#L64-83](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm-workspace.yaml#L64-L83) [pnpm-workspace.yaml#L89-114](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm-workspace.yaml#L89-L114)
- The Rust CLI's npm wrapper is named pacquet in-repo but publishes as pnpm and exposes pnpm/pn/pnpx/pnx. A separate workflow builds the pnpm container image for amd64 and arm64 with provenance and SBOM output. — [pnpm/npm/pnpm/package.json#L1-14](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/npm/pnpm/package.json#L1-L14) [pnpm/npm/pnpm/package.json#L29-39](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/npm/pnpm/package.json#L29-L39) [.github/workflows/docker.yml#L103-115](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/.github/workflows/docker.yml#L103-L115)

## Feature catalog

The inspected Rust command table covers dependency management, workspace execution, package inspection, publishing, configuration, runtime management, and release intents. Installation exposes dependency-group and linker choices, with optional Cargo and Python participation. pnpr combines compatible registry APIs with resolution, artifact, compiler-cache, and pipeline-record surfaces. This catalog groups the inspected public surfaces; command registration alone does not establish complete implementation or successful operation.
- Dependency commands include add, install, install-test, update, remove, link/unlink, import, dedupe, prune, fetch, deploy, and patch/patch-commit/patch-remove; install accepts production, development, and optional dependency selection plus isolated, hoisted, or PnP linkers. — [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L26-36](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L26-L36) [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L113-125](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L113-L125) [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L221-236](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L221-L236) [pnpm/crates/cli/src/cli_args/install.rs#L65-99](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/install.rs#L65-L99)
- Execution surfaces include recursive, run, exec, dlx, create, test/start/stop/restart shortcuts, tasks, and pipeline. Pipeline's declared contract includes frozen installation, affected-project selection, dependency ordering, and cached task restoration. — [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L23-25](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L23-L25) [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L132-164](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L132-L164)
- Inspection and security commands include list/ll, why, outdated, audit, peers, licenses, sbom, doctor, ignored-builds, approve-builds, cat-file, cat-index, and find-hash. — [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L37-68](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L37-L68) [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L84-90](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L84-L90) [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L126-128](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L126-L128) [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L213-220](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L213-L220)
- Publishing and account commands include pack, publish, stage, access, deprecate/undeprecate, unpublish, dist-tag, login/logout, owner, team, whoami, and star/unstar/stars; change, version, and lane manage release intents and lanes. — [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L19-20](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L19-L20) [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L41-83](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L41-L83) [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L103-112](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L103-L112) [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L246-255](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L246-L255)
- Configuration and environment surfaces include config/get/set, pkg, set-script, runtime, deprecated env, shim, with, setup, self-update, completion, clean/purge, ci, store, and cache. edit/profile/token/xmas are explicitly registered as unimplemented commands directing users to npm. — [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L129-131](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L129-L131) [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L153-212](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L153-L212) [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L242-269](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L242-L269)
- When cargo.enabled or python.enabled is set, ecosystem_install::plan adds Cargo or Python tasks to an InstallPlan; Python selection follows workspace scope and production/development dependency groups. — [pnpm/crates/cli/src/ecosystem_install.rs#L20-23](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/ecosystem_install.rs#L20-L23) [pnpm/crates/cli/src/ecosystem_install.rs#L49-85](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/ecosystem_install.rs#L49-L85)
- pnpr mounts npm metadata, version, tarball, search, dist-tag, publish, unpublish, and staged-publish routes, including named registry prefixes; configured Cargo and PyPI ecosystems add their own route sets. — [pnpr/crates/pnpr/src/server/routing.rs#L221-241](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/routing.rs#L221-L241) [pnpr/crates/pnpr/src/server/routing.rs#L291-335](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/routing.rs#L291-L335) [pnpr/crates/pnpr/src/server/routing.rs#L437-441](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/routing.rs#L437-L441)
- Optional pnpr surfaces provide resolve/verify-lockfile, artifact publication/resolution/blob retrieval, compiler-cache reads and writes, and pipeline-run storage plus a viewer. NAPI separately exposes install, rebuild, pack, dependency resolution, peer checks, configuration, and lockfile APIs to Node hosts. — [pnpr/crates/pnpr/src/server/routing.rs#L339-430](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/routing.rs#L339-L430) [pnpm/crates/napi/src/lib.rs#L26-41](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/napi/src/lib.rs#L26-L41)

## Data flow

CLI inputs become normalized arguments, configuration, manifest data, and lazily loaded lockfile state before entering the installation engine. The engine carries explicit workspace scope, lockfile policy, execution mode, shared caches, and verification state through resolution and materialization. Installed metadata and freshness records represent different stages of completion. Server reads add identity and declared provenance before consulting hosted storage or upstream caches.
- Rust startup consumes args_os, handles executable aliases and the pm prefix, extracts ConfigOverrides, rewrites with current, parses Clap arguments, and retains child argv for pinned-package-manager dispatch. — [pnpm/crates/cli/src/lib.rs#L123-164](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/lib.rs#L123-L164)
- Config is a merged runtime type rather than directly deserialized file data: defaults are overlaid with the auth/registry/network subset of .npmrc and structural pnpm-workspace.yaml settings. — [pnpm/crates/config/src/settings.rs#L39-55](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/config/src/settings.rs#L39-L55) [pnpm/crates/cli/src/state.rs#L44-52](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/state.rs#L44-L52)
- State::install passes shared tarball and HTTP caches, resolved packages, Config, PackageManifest, and a lazy lockfile into Install::new; dedicated-project installs also share cross-project caches and completion coordination. — [pnpm/crates/cli/src/state.rs#L96-134](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/state.rs#L96-L134) [pnpm/crates/package-manager/src/install/entry_points.rs#L19-60](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/entry_points.rs#L19-L60)
- InstallArgs converts CLI/config decisions into lockfile policy, execution mode, linker, architecture, and resolution seed settings. pnpr's remote policy controls server resolution, while local materialization uses the server-produced lockfile as frozen input. — [pnpm/crates/cli/src/cli_args/install.rs#L307-352](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/install.rs#L307-L352) [pnpm/crates/cli/src/cli_args/install.rs#L413-425](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/install.rs#L413-L425)
- RunExecution loads lockfiles and hooked manifests, settles the wanted lockfile, creates Verification, dispatches the chosen path, materializes, and applies the result; shared Verification holds metadata cache, planned canonical fetches, and resolution verifiers. — [pnpm/crates/package-manager/src/install/run/execution.rs#L39-61](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/run/execution.rs#L39-L61) [pnpm/crates/package-manager/src/install/run/execution.rs#L70-116](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/run/execution.rs#L70-L116) [pnpm/crates/package-manager/src/install/run.rs#L406-414](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/run.rs#L406-L414)
- Installed-state commit builds and writes .modules.yaml, then saves the current lockfile. Workspace freshness is written later, and a moved-tree filtered install deliberately skips that freshness update. — [pnpm/crates/package-manager/src/install/apply_materialization/commit.rs#L18-61](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/apply_materialization/commit.rs#L18-L61) [pnpm/crates/package-manager/src/install/apply_materialization.rs#L268-274](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/apply_materialization.rs#L268-L274) [pnpm/crates/package-manager/src/install/apply_materialization.rs#L296-299](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/apply_materialization.rs#L296-L299)
- pnpr metadata reads validate CanonicalPackageName, resolve a RegistrySource, authorize upstream access or apply hosted gates, then load bytes. Upstream responses pass through packument_response with tarball-base rewriting, OSV data, and abbreviated-response selection. — [pnpr/crates/pnpr/src/server/package_reads.rs#L223-270](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/package_reads.rs#L223-L270) [pnpr/crates/pnpr/src/server/upstream_packuments.rs#L244-268](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/upstream_packuments.rs#L244-L268)
- pnpr's resolution cache distinguishes public and private fetch routes using RouteClass and a Footprint digest. RouteHook selects server-managed credentials at the auth-selection boundary; privacy depends on registry/package policy rather than simply whether a request carried credentials. — [pnpr/crates/route/src/lib.rs#L1-22](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/route/src/lib.rs#L1-L22) [pnpr/crates/route/src/lib.rs#L62-77](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/route/src/lib.rs#L62-L77)

## Behavior traces

Three principal flows were followed through source: CLI startup, dependency installation through installed-state persistence, and pnpr metadata/tarball reads through authorization and cache handling. Additional startup reading distinguishes pnpr's production server API from convenience router construction. The traces retain early returns and policy branches because those determine which work actually occurs. These are execution paths inferred directly from code structure, not observed runs.
- Rust startup follows bin::main → pnpm_cli::main → run_on_big_stack(run_cli) → shim dispatch → argument normalization → parse_or_answer → configure_cli_args → pinned dispatch/completion checks → Rayon setup → install fast-path check → run_cli_command. — [pnpm/crates/cli/src/bin/main.rs#L1-3](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/bin/main.rs#L1-L3) [pnpm/crates/cli/src/lib.rs#L62-80](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/lib.rs#L62-L80) [pnpm/crates/cli/src/lib.rs#L123-175](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/lib.rs#L123-L175)
- TypeScript startup follows buildArgv → runPnpm → main → parseCliArgs → loadCommandConfig/readCommandConfig → package-manager/runtime handling → config-dependency and hook loading → runCommandWithConfig; runPnpm finally drains workers. — [pnpm11/pnpm/src/pnpm.ts#L8-39](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm11/pnpm/src/pnpm.ts#L8-L39) [pnpm11/pnpm/src/main.ts#L71-96](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm11/pnpm/src/main.ts#L71-L96) [pnpm11/pnpm/src/main.ts#L137-175](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm11/pnpm/src/main.ts#L137-L175)
- InstallArgs::run calls run_inner, resolves frozen/link options, rejects pnpr plus dry-run, and selects install_via_pnpr_inner when pnpr_target exists; otherwise run_local builds State::install and invokes run or run_selected. — [pnpm/crates/cli/src/cli_args/install.rs#L223-259](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/install.rs#L223-L259) [pnpm/crates/cli/src/cli_args/install.rs#L307-352](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/install.rs#L307-L352)
- Local Install::run → run_inner acquires a store-use lock → run_inner_impl settles RunMode and discovers the workspace → RunExecution::run checks reuse, loads lockfiles, and settles wanted state → dispatch chooses frozen/fresh → materialize → finish_materialization. — [pnpm/crates/package-manager/src/install/entry_points.rs#L63-66](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/entry_points.rs#L63-L66) [pnpm/crates/package-manager/src/install/run.rs#L62-103](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/run.rs#L62-L103) [pnpm/crates/package-manager/src/install/run.rs#L172-210](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/run.rs#L172-L210) [pnpm/crates/package-manager/src/install/run/execution.rs#L26-116](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/run/execution.rs#L26-L116)
- Persistence follows finish_materialization → apply_materialization_result → apply → link_apply_projects → commit_apply_state → finish_apply. commit_modules_state writes module metadata before the current lockfile; finish_apply subsequently publishes workspace freshness and completion output. — [pnpm/crates/package-manager/src/install/run/execution.rs#L119-152](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/run/execution.rs#L119-L152) [pnpm/crates/package-manager/src/install/apply_materialization.rs#L202-249](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/apply_materialization.rs#L202-L249) [pnpm/crates/package-manager/src/install/apply_materialization.rs#L268-293](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/apply_materialization.rs#L268-L293) [pnpm/crates/package-manager/src/install/apply_materialization/commit.rs#L18-61](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/apply_materialization/commit.rs#L18-L61)
- pnpr startup follows Args::parse → Config::resolve_with_overrides → apply_cli_overrides → logging → serve. serve validates configuration, loads active OSV, calls load_startup_auth with registry journal recovery, builds routes, binds the listener, and enters graceful serving. — [pnpr/crates/pnpr/src/main.rs#L123-157](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/main.rs#L123-L157) [pnpr/crates/pnpr/src/server.rs#L311-317](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server.rs#L311-L317) [pnpr/crates/pnpr/src/server.rs#L343-363](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server.rs#L343-L363)
- A metadata read follows serve_packument → addressed_registry → serve_registry_packument → canonical-name parsing/source selection/access authorization → serve_packument_via_upstream → load_upstream_packument. A fresh cache hit returns immediately; misses fetch and cache, authoritative 404s purge cached package state, and packument_response shapes the client response. — [pnpr/crates/pnpr/src/server/package_reads.rs#L15-28](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/package_reads.rs#L15-L28) [pnpr/crates/pnpr/src/server/package_reads.rs#L223-270](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/package_reads.rs#L223-L270) [pnpr/crates/pnpr/src/server/upstream_packuments.rs#L42-118](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/upstream_packuments.rs#L42-L118) [pnpr/crates/pnpr/src/server/upstream_packuments.rs#L244-268](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/upstream_packuments.rs#L244-L268)
- An upstream tarball read follows serve_registry_tarball → access authorization → serve_tarball_via_upstream → filename validation/authorized_upstream → serve_authorized_upstream_tarball. Without OSV, a cache hit can precede metadata binding; misses bind version/integrity, screen OSV, fetch, open temporary storage, and stream with integrity-gated cache promotion. — [pnpr/crates/pnpr/src/server/package_reads.rs#L277-304](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/package_reads.rs#L277-L304) [pnpr/crates/pnpr/src/server/upstream_tarballs.rs#L15-106](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/upstream_tarballs.rs#L15-L106) [pnpr/crates/pnpr/src/server/upstream_tarballs.rs#L192-227](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/upstream_tarballs.rs#L192-L227) [pnpr/crates/storage/src/streaming.rs#L64-87](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/storage/src/streaming.rs#L64-L87) [pnpr/crates/storage/src/streaming.rs#L143-164](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/storage/src/streaming.rs#L143-L164)

## Testing signals

Tests and CI definitions were inspected, not executed; no passing result, measured coverage percentage, or benchmark outcome is established here. Rust uses ordinary and Tokio tests, process-level CLI fixtures, snapshots, and cargo-nextest configuration. TypeScript uses Jest with registry-backed project fixtures. The inspected checks span installation, filtering, integrity, recovery, and language/runtime boundaries, but the bounded sample cannot establish all untested behavior.
- The inspected Rust CLI suite is assembled in tests/suite/main.rs as one integration-test binary, while nextest runs individual tests in separate processes; its modules include install-related commands, custom resolvers/fetchers, lifecycle behavior, and linker variants. — [pnpm/crates/cli/tests/suite/main.rs#L1-75](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/tests/suite/main.rs#L1-L75)
- should_install_dependencies spawns the real CLI against a mocked registry, asserts the direct dependency is a symlink/junction, checks transitive placement in the virtual store, and snapshots workspace/store structure using insta. — [pnpm/crates/cli/tests/suite/install.rs#L5-14](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/tests/suite/install.rs#L5-L14) [pnpm/crates/cli/tests/suite/install.rs#L60-102](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/tests/suite/install.rs#L60-L102)
- TypeScript install/only.ts uses Jest and execPnpm fixtures to check production/development filtering; its production test also checks progress counts and verifies the resolved dev-transitive version in the lockfile before store-presence assertions. — [pnpm11/pnpm/test/install/only.ts#L5-46](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm11/pnpm/test/install/only.ts#L5-L46) [pnpm11/pnpm/test/install/only.ts#L58-95](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm11/pnpm/test/install/only.ts#L58-L95)
- pnpr tarball tests use Tokio, mockito, temporary storage, and Axum oneshot requests to check declaring-version integrity binding and cache replay after router reconstruction; the same file includes a tampered-stream rejection test. — [pnpr/crates/pnpr/tests/server/tarball_verification.rs#L7-18](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/tests/server/tarball_verification.rs#L7-L18) [pnpr/crates/pnpr/tests/server/tarball_verification.rs#L96-137](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/tests/server/tarball_verification.rs#L96-L137)
- Journal-recovery tests fabricate interrupted on-disk publication state, including an older manifest format, to exercise sealed roll-forward and unsealed rollback; these recovery scenarios were read, not run. — [pnpr/crates/pnpr/tests/journal_recovery.rs#L1-4](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/tests/journal_recovery.rs#L1-L4) [pnpr/crates/pnpr/tests/journal_recovery.rs#L76-85](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/tests/journal_recovery.rs#L76-L85)
- The nextest smoke profile selects one test per behavior area and explicitly does not prove change correctness. Default tests receive a 60-second slow interval with termination after five intervals, and separate validation is documented for stale smoke-test names. — [.config/nextest.toml#L3-30](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/.config/nextest.toml#L3-L30) [.config/nextest.toml#L30-53](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/.config/nextest.toml#L30-L53)
- Rust CI invokes separate rust-test and pnpr-test pipelines and adds a Linux Node test of the built NAPI addon. TypeScript CI builds the bundle before sharded tests across Node 22.13, 24, and 26.10 on Linux, with a separate Windows shard matrix. — [.github/workflows/pacquet-ci.yml#L271-303](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/.github/workflows/pacquet-ci.yml#L271-L303) [.github/workflows/ci.yml#L112-124](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/.github/workflows/ci.yml#L112-L124) [.github/workflows/ci.yml#L152-205](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/.github/workflows/ci.yml#L152-L205)
- Ecosystem E2E and Cargo equivalence are scheduled compatibility checks rather than per-PR merge blockers; docs CI builds the external website with repository docs and checks URLs, while the inspected CodeQL matrix selects JavaScript. — [.github/workflows/ecosystem-e2e.yml#L3-22](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/.github/workflows/ecosystem-e2e.yml#L3-L22) [.github/workflows/cargo-equivalence.yml#L3-17](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/.github/workflows/cargo-equivalence.yml#L3-L17) [.github/workflows/docs.yml#L40-58](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/.github/workflows/docs.yml#L40-L58) [.github/workflows/codeql-analysis.yml#L39-57](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/.github/workflows/codeql-analysis.yml#L39-L57)

## Risk map

The observations below identify trust boundaries and behavior that deserves careful review; they are not confirmed vulnerabilities. Package scripts and JavaScript hooks intentionally cross into process execution, while pnpr handles identity, remote fetches, cached private data, and persistent publication state. Several protections are explicit, including early authorization, integrity-gated cache promotion, connection policy, and verification gates. Operational assumptions and coverage limits remain relevant even when those protections are present.
- The executor exposes shell execution through sh -c and allows callers to choose the working directory; command strings therefore cross an intentional code-execution boundary, and nonzero child status is distinct from spawn/wait errors. — [pnpm/crates/executor/src/lib.rs#L72-104](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/executor/src/lib.rs#L72-L104)
- pnpmfile hooks execute JavaScript in Node processes. readPackage/afterAllResolved/filterLog use a lazy long-lived worker, while preResolution uses node -e with piped JSON and a 30-second timeout; preResolution failures warn rather than abort. — [pnpm/crates/hooks/src/node_runtime.rs#L11-24](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/hooks/src/node_runtime.rs#L11-L24) [pnpm/crates/hooks/src/node_runtime.rs#L32-77](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/hooks/src/node_runtime.rs#L32-L77)
- Lockfile verification can overlap resolution/fetching but must gate sensitive downstream operations. The gate aborts on drop; trustLockfile or an empty verifier set makes verification a no-op, so changes to either policy or completion ordering require review. — [pnpm/crates/package-manager/src/install.rs#L174-185](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install.rs#L174-L185) [pnpm/crates/package-manager/src/install.rs#L216-259](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install.rs#L216-L259) [pnpm/crates/package-manager/src/install/run.rs#L380-400](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/run.rs#L380-L400)
- pnpr mounts authentication before handlers to enforce token restrictions before buffering large write bodies. Unknown or revoked ordinary bearer tokens can resolve to anonymous, leaving route and per-package policy responsible for distinguishing public access from protected operations. — [pnpr/crates/pnpr/src/server/routing.rs#L79-87](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/routing.rs#L79-L87) [pnpr/crates/pnpr/src/server/authentication.rs#L111-123](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/authentication.rs#L111-L123) [pnpr/crates/pnpr/src/server/authentication.rs#L159-169](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/authentication.rs#L159-L169)
- Resolver connection policy admits public addresses, explicitly allowed private networks, and the server's configured public_url host. IP literals are checked separately from hostname resolution; own-host configuration and private-network exceptions are security-sensitive inputs. — [pnpr/crates/route/src/connect_policy.rs#L7-49](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/route/src/connect_policy.rs#L7-L49)
- A warm upstream tarball cache hit without OSV intentionally skips re-binding against current metadata, so previously verified bytes can remain downloadable after a version is unpublished. The documented acceptance authority is the client's lockfile integrity. — [pnpr/crates/pnpr/src/server/upstream_tarballs.rs#L60-83](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/upstream_tarballs.rs#L60-L83)
- Inference: install completion is a broad regression hotspot because filtered selection, prior metadata, current lockfiles, and workspace freshness meet at separate writes; reordering freshness ahead of module/current-lockfile commit could advertise an incomplete tree. (inferred) — [pnpm/crates/package-manager/src/install/apply_materialization/commit.rs#L18-61](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/apply_materialization/commit.rs#L18-L61) [pnpm/crates/package-manager/src/install/apply_materialization/commit.rs#L111-127](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/apply_materialization/commit.rs#L111-L127) [pnpm/crates/package-manager/src/install/apply_materialization.rs#L268-299](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/package-manager/src/install/apply_materialization.rs#L268-L299)
- The inspected CodeQL workflow selects only JavaScript, and the smoke profile explicitly limits its correctness claim. Neither source establishes Rust security-analysis coverage or full branch coverage; broader repository tooling was not exhaustively audited. — [.github/workflows/codeql-analysis.yml#L39-57](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/.github/workflows/codeql-analysis.yml#L39-L57) [.config/nextest.toml#L15-27](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/.config/nextest.toml#L15-L27)

## Extension points

The clearest extension seams are typed command registration, ordered resolver composition, hook interfaces, reporter events, and backend traits. pnpr separates feature-surface mounting from registry provenance and storage implementation. Extension contracts frequently encode security or compatibility constraints, so adding an implementation requires preserving those constraints rather than only satisfying a type signature. NAPI exposes a separate host-facing boundary over the same Rust engine.
- CliCommand is a Clap-derived enum carrying command-specific argument types, with aliases and an external-subcommand fallback; cli_args::grammar caches the assembled command grammar in OnceLock. — [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L16-36](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L16-L36) [pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L260-271](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args/cli_command/commands.rs#L260-L271) [pnpm/crates/cli/src/cli_args.rs#L125-131](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/cli/src/cli_args.rs#L125-L131)
- DefaultResolver composes Vec<Box<dyn Resolver>> in order: Ok(None) defers, the first claim wins, and exhaustion yields a stable unsupported-spec error; resolving-resolver-base also exposes a separate ResolutionVerifier seam. — [pnpm/crates/resolving-default-resolver/src/lib.rs#L1-10](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/resolving-default-resolver/src/lib.rs#L1-L10) [pnpm/crates/resolving-default-resolver/src/lib.rs#L21-49](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/resolving-default-resolver/src/lib.rs#L21-L49) [pnpm/crates/resolving-resolver-base/src/lib.rs#L1-18](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/resolving-resolver-base/src/lib.rs#L1-L18) [pnpm/crates/resolving-resolver-base/src/lib.rs#L26-40](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/resolving-resolver-base/src/lib.rs#L26-L40)
- PnpmfileHooks is an async Send+Sync interface for manifest and resolution customization. Custom fetchers can request native CafsInfo, TempDir, LocalTarball, and RemoteTarball operations through callback channels with oneshot responses. — [pnpm/crates/hooks/src/lib.rs#L27-44](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/hooks/src/lib.rs#L27-L44) [pnpm/crates/hooks/src/lib.rs#L106-120](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/hooks/src/lib.rs#L106-L120)
- Reporter extensions add typed LogEvent variants serialized with a name tag; channel names and payloads are designed for consumption by the TypeScript default reporter, making the wire contract part of extension correctness. — [pnpm/crates/reporter/src/lib.rs#L1-12](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/reporter/src/lib.rs#L1-L12) [pnpm/crates/reporter/src/lib.rs#L32-68](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/reporter/src/lib.rs#L32-L68)
- pnpr surface_routes conditionally mounts resolver, artifact, pipeline, and registry route factories. Shared authentication/body-limit layering is applied after surface construction, and individual protocol routes add caller gates. — [pnpr/crates/pnpr/src/server/routing.rs#L74-87](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/routing.rs#L74-L87) [pnpr/crates/pnpr/src/server/routing.rs#L179-218](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/routing.rs#L179-L218) [pnpr/crates/pnpr/src/server/routing.rs#L339-355](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server/routing.rs#L339-L355)
- Registry supports Hosted, Upstream, and ordered Router variants with declared package patterns. A router selects a claiming concrete source authoritatively; its not-found/unavailable result cannot fall through to a different origin. — [pnpr/crates/registry/src/lib.rs#L8-26](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/registry/src/lib.rs#L8-L26) [pnpr/crates/registry/src/lib.rs#L43-62](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/registry/src/lib.rs#L43-L62)
- Storage and identity implementations plug into HostedBackend and AuthState's UserBackend/TokenBackend trait objects. Hosted backends own compare-and-set and blob-promotion differences; backend selection occurs during startup. — [pnpr/crates/storage/src/backend.rs#L13-50](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/storage/src/backend.rs#L13-L50) [pnpr/crates/storage/src/backend.rs#L65-82](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/storage/src/backend.rs#L65-L82) [pnpr/crates/auth/src/lib.rs#L130-138](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/auth/src/lib.rs#L130-L138) [pnpr/crates/auth/src/lib.rs#L163-184](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/auth/src/lib.rs#L163-L184)
- The NAPI crate exports typed install, resolution, configuration, packing, and lockfile boundaries; its documented JS contract lives in the wrapper declarations, and module initialization installs the engine's tracing subscriber. — [pnpm/crates/napi/src/lib.rs#L4-15](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/napi/src/lib.rs#L4-L15) [pnpm/crates/napi/src/lib.rs#L26-41](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/napi/src/lib.rs#L26-L41) [pnpm/crates/napi/src/lib.rs#L66-72](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/crates/napi/src/lib.rs#L66-L72)

## Contributor handoff

Future work should first identify the owning product and the precise observable behavior being changed. Read repository policy alongside the implementation, because broad documentation and historical descriptions can lag current manifests or source. Tests and CI were inspected, not executed, and this bounded investigation provides no baseline pass result. For authorized implementation work, select meaningful scoped checks while preserving cross-version contracts, state ordering, and release-note targets.
- Read AGENTS.md and PHILOSOPHY.md plus the owning product's guide. New CLI features belong only in Rust v12; shared bugs require fixes in both supported implementations, while pnpr has no CLI counterpart to mirror. — [AGENTS.md#L13-29](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/AGENTS.md#L13-L29) [pnpm/AGENTS.md#L25-40](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/AGENTS.md#L25-L40) [pnpr/AGENTS.md#L20-30](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/AGENTS.md#L20-L30)
- Prefer existing capabilities and shared abstractions before adding code. pnpr specifically directs reuse of pnpm crates and reserves pnpr-prefixed crates for registry-only logic. — [PHILOSOPHY.md#L16-32](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/PHILOSOPHY.md#L16-L32) [pnpr/AGENTS.md#L66-92](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/AGENTS.md#L66-L92)
- Run Rust tooling from the repository root and account for pnpm-managed Cargo source replacement. A fresh clone or changed Cargo.lock requires dependency installation before Cargo can resolve the replaced sources; cargo add is not the documented dependency-addition path. — [CONTRIBUTING.md#L44-48](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/CONTRIBUTING.md#L44-L48) [CONTRIBUTING.md#L68-72](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/CONTRIBUTING.md#L68-L72)
- For authorized Rust validation, use pnpm test:rust-affected and add relevant pnpm-cli suite modules for user-visible engine changes: affected-crate selection alone does not necessarily include CLI e2e tests. Invoke root pnpm scripts to participate in task concurrency limits. — [pnpm/CONTRIBUTING.md#L108-120](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/CONTRIBUTING.md#L108-L120) [package.json#L27-34](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/package.json#L27-L34)
- Tests and CI in this brief were inspected, not executed. A future agent must establish actual selected-test results; smoke is explicitly insufficient to prove correctness, and TypeScript CLI e2e tests require rebuilding the bundled dist/pnpm.mjs after package changes. — [.config/nextest.toml#L15-27](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/.config/nextest.toml#L15-L27) [AGENTS.md#L95-114](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/AGENTS.md#L95-L114)
- For pnpr embedding, choose APIs deliberately: router uses in-memory auth, router_with_auth can panic on invalid setup, and try_router variants return errors. Production serve loads persistent auth and recovers registry publication state before binding. — [pnpr/crates/pnpr/src/server.rs#L199-244](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server.rs#L199-L244) [pnpr/crates/pnpr/src/server.rs#L311-317](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server.rs#L311-L317) [pnpr/crates/pnpr/src/server.rs#L343-363](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpr/crates/pnpr/src/server.rs#L343-L363)
- User-visible changes require affected-version documentation and normally a changeset, with an exemption for bugs in unreleased features. Target pacquet for Rust CLI changes, pnpm plus affected packages for TypeScript fixes, and @pnpm/pnpr for server changes. — [AGENTS.md#L31-37](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/AGENTS.md#L31-L37) [AGENTS.md#L216-222](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/AGENTS.md#L216-L222) [AGENTS.md#L284-296](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/AGENTS.md#L284-L296)
- Preserve reporter event payload/order for shared fixes and use real temporary-directory or mocked-registry fixtures before introducing test injection. Root README still calls the Rust port experimental, while product docs identify v12 as the development target; verify maturity from current policy and feature evidence. — [pnpm/AGENTS.md#L41-64](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/AGENTS.md#L41-L64) [README.md#L20-24](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/README.md#L20-L24) [pnpm/README.md#L1-9](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/pnpm/README.md#L1-L9) [PHILOSOPHY.md#L34-40](https://github.com/pnpm/pnpm/blob/b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385/PHILOSOPHY.md#L34-L40)

Source repository: https://github.com/pnpm/pnpm
Full evidence corpus: https://github.com/Codevetter/codevetter/tree/main/benchmarks/repo-unpacks/pnpm.json

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
