# Behavior traces — pnpm/pnpm

> Canonical page: https://codevetter.com/unpack/pnpm/behavior-traces

# Behavior traces — pnpm/pnpm

Scanned commit b2ef6cb63b8b7cb93d6b57f0d2efedf25d7c1385 (2026-10-02). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

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)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

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