Skip to content

feat(install): add loaded linker with GVS exclusions - #16482

Merged
zkochan merged 22 commits into
mainfrom
esm-loader
Oct 5, 2026
Merged

zkochan merged 22 commits into
mainfrom
esm-loader

Conversation

@zkochan

@zkochan zkochan commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds experimental nodeLinker: { type: loaded } installation to pnpm v12. Enable it in pnpm-workspace.yaml, optionally list package names in nodeLinker.excluded, and use normal install, run, and exec commands. Compatible packages load directly from verified content-addressable store blobs. Selected packages and their complete dependency trees use ordinary global virtual store entries, with their existing graph identities and dependency links.

pnpm generates the runtime manifest, embeds and writes the standalone loader, creates JavaScript executable shims, and preloads the loader for scripts and child processes. Store pruning preserves live CAS blobs and materialized GVS trees. Patched packages materialize automatically; packages requiring builds must be selected explicitly, and normal build approval still applies. The default application layout has state and bins under .pnpm/ and creates no application node_modules.

Node.js 26.10.0 or later is required. This is opt-in and experimental: direct filesystem access and independent tool resolvers can still require additional materialization or resolver integration. Existing node_modules directories must be removed when switching modes. CAS repeat installs regenerate the runtime manifest; the optimistic installation shortcut is disabled. No static analyzer is included.

Related to pnpm/tasks#64. Future linker-specific settings and nested hoisting configuration are tracked separately in pnpm/tasks#72. Only the loaded-linker object form is included here. This change extends the existing standalone runtime and diagnostics with normal installer integration. The runtime preserves ESM/CommonJS/JSON loading, peer contexts, exports/imports, aliases, and workspace mappings, using enhanced-resolve through a private filesystem view. Application fs APIs are unchanged.

The repository's unrs-resolver patch adds opt-in native Node resolution through UNRS_RESOLVER_NODE_RESOLUTION=1, retaining the native resolver otherwise. It forwards conditional exports without emulating unrs aliases, tsconfig paths, or custom extensions.

Validation after rebasing onto main at 1e5d031de93fb85997f8bcc018c617c1d5adac7a: pnpm ready:rust passed all 14,570 Rust tests (28 skipped), workspace checks and Clippy. All 27 loader integration tests and the patched-unrs regression passed. The final state-settings extraction passed 142 repeat-install tests. Required push hooks passed. CI and review are running on 557598fb7e507ebfd58afc6cb05556ce3d609569.

CLI coverage includes production-only installs, nested bins, child processes, workspaces and aliases, frozen reinstalls, opt-out changes, builds, removal, store pruning, workspace-state validation without reinstalling, missing runtime repair, and hook changes to linker defaults. Configuration tests cover object parsing, invalid fields, JSON environment values, source replacement, resets, and resolved-settings round trips. The embedded runtime is checked against its source bundle.

Review fixes validate importer and blob paths, publish the installation manifest atomically, constrain stored entry points to their selected package root, discover directories.bin entries from virtual files, and cache selected graphs and verified metadata. Loaded installation requires durable ownership registration, including project-local stores, so pruning preserves its live blobs. Up-to-date state writes and timestamp probes use the configured installation directory. Pruning rejects noncanonical loader slot paths. The separate pnpm/update action cleanup is tracked in pnpm/tasks#75. Patch-package's application-layout limitation is recorded in pnpm/tasks#64 (comment).

External repository compatibility results and reproduction notes are recorded in the implementation task. They were collected with the standalone diagnostic harness, not the integrated install mode, and are scoped probes rather than full repository passes.

Squash Commit Body

Add an opt-in CAS installer and synchronous Node.js module loader.
Generate package-instance manifests and embed the runtime in the Rust CLI.
Load compatible package files directly from verified store blobs while retaining
ordinary complete GVS installations for explicitly materialized dependency trees.

Reuse the existing fetch, graph hashing, linking, build approval, and command shim
pipelines. Preserve loader references during store pruning and preload the loader
for normal script and command execution. Keep application filesystem APIs intact.

Document the install mode; keep compatibility experiment results in the implementation task.
Related to https://github.com/pnpm/tasks/issues/64. Future linker-specific settings and nested hoisting configuration are tracked separately in https://github.com/pnpm/tasks/issues/72. Only the loaded-linker object form is included here.

Checklist

  • I checked the referenced issue and verified that none of the PRs already linked to it solves it.
  • New features are implemented only in the Rust pnpm v12 CLI. Bug fixes are implemented in every affected version.
  • Added changesets for the CLI install mode and the published loader package.
  • Added or updated tests.
  • Updated the documentation.

Written by an agent (Codex, GPT-6).

Summary by CodeRabbit

  • New Features
    • Added the experimental loaded node linker, which lets supported JavaScript and JSON modules load from pnpm’s content-addressable store without creating an application node_modules directory.
    • Configure packages to exclude from store-based loading; excluded packages and their dependency trees are materialized in the global virtual store.
    • Added support for registering loaded projects and retaining their store files during pruning. Requires Node.js 26.10.0 or later.
  • Documentation
    • Added guidance on enabling the loaded linker, package exclusions, opt-outs, supported behavior, and compatibility limitations.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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

🧰 Additional context used
📚 Code guidelines (3)
AGENTS.md — auto-discovered
pnpm/AGENTS.md — auto-discovered
pnpm/CODE_STYLE_GUIDE.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: pnpm/pnpm/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 42a58e6c-f2f3-43fb-b2bf-c9895a6ec567
📥 Commits

Reviewing files that changed from the base of the PR and between 3a52fb8 and 557598f.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock, !Cargo.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing (24)
  • pnpm/crates/cli/tests/suite/cas_linker.rs
  • pnpm/crates/config/src/workspace_yaml/apply.rs
  • pnpm/crates/config/src/workspace_yaml/reset.rs
  • pnpm/crates/config/src/workspace_yaml/settings.rs
  • pnpm/crates/deps-restorer/src/cas.rs
  • pnpm/crates/deps-restorer/src/cas/bins.rs
  • pnpm/crates/deps-restorer/src/cas/bins/tests.rs
  • pnpm/crates/deps-restorer/src/install_frozen_lockfile/build_phase.rs
  • pnpm/crates/deps-restorer/src/install_frozen_lockfile/build_phase/tests.rs
  • pnpm/crates/deps-restorer/src/install_frozen_lockfile/materialization.rs
  • pnpm/crates/deps-restorer/src/phase_options.rs
  • pnpm/crates/package-manager/src/install/apply_materialization.rs
  • pnpm/crates/package-manager/src/install/errors.rs
  • pnpm/crates/package-manager/src/install/prepare_modules_state/up_to_date.rs
  • pnpm/crates/package-manager/src/install/run/fast_path.rs
  • pnpm/crates/package-manager/src/install/workspace_state.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile/materialization.rs
  • pnpm/crates/package-manager/src/install_with_fresh_lockfile/on_disk.rs
  • pnpm/crates/package-manager/src/optimistic_repeat_install/deps_status.rs
  • pnpm/crates/package-manager/src/optimistic_repeat_install/settings.rs
  • pnpm/crates/store-dir/src/project_registry.rs
  • pnpm/crates/store-dir/src/prune.rs
  • pnpm/crates/store-dir/src/prune/tests.rs
  • pnpm/crates/workspace-state/src/lib.rs

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


📝 Walkthrough

Walkthrough

Adds the experimental loaded node linker. Compatible packages load from the content-addressable store through a Node.js loader. Excluded and build-required packages use the global virtual store. The change adds configuration, installation, manifest, pruning, runtime, testing, and documentation support.

Changes

Loaded linker

Layer / File(s) Summary
Linker configuration and runtime integration
pnpm/crates/config/..., pnpm/crates/cli/..., pnpm/crates/package-manager/..., pnpm/crates/workspace-state/...
Adds loaded-linker settings, exclusions, JSON configuration, layout handling, workspace-state support, and loader environment setup.
Store manifest and Node loader
pnpm/esm-loader/*, pnpm/crates/store-dir/src/store_loader_manifest.rs, __patches__/[email protected]
Adds a manifest-backed virtual filesystem, dependency resolver, and Node hooks for stored JavaScript and JSON modules, with path and integrity checks.
CAS installation and bin handling
pnpm/crates/deps-restorer/src/cas/*, pnpm/crates/deps-restorer/src/create_virtual_store/*
Adds selective materialization, manifest and loader file creation, bin generation, and bin refresh during build phases.
Store pruning and workspace state
pnpm/crates/store-dir/src/prune*.rs, pnpm/crates/store-dir/src/loader_references.rs, pnpm/crates/package-manager/src/install/workspace_state*
Tracks loader manifest references during pruning and reads or writes workspace state under the configured modules directory.
Validation and supporting updates
pnpm/crates/cli/tests/suite/cas_linker.rs, pnpm/esm-loader/test/*, pnpm/esm-loader/scripts/*, pnpm/docs/*, .changeset/*, .github/scripts/*, pnpm-workspace.yaml
Adds loader and install tests, repository test scripts, package wiring, documentation, changesets, and small tooling updates.

Priority: ➖ Normal

Estimated code review effort: 5 (Critical) | ~90 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant CLI as pnpm CLI
  participant Installer as CAS installer
  participant Manifest as Store manifest
  participant Loader as Node.js loader
  participant Store as CAS store
  CLI->>Installer: install with nodeLinker loaded
  Installer->>Manifest: write package map and loader
  CLI->>Loader: preload through NODE_OPTIONS
  Loader->>Manifest: resolve package and dependency metadata
  Loader->>Store: read and verify CAS file
  Store-->>Loader: return module bytes
  Loader-->>CLI: execute resolved module
Loading

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

Suggested reviewers: altaywtf

Merge Risk: ⚪ Minimal · up to 55759

The loaded linker is opt-in and experimental, and no outstanding defects were found in the reviewed changes. Normal checks and the author's reported tests apply before merge.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to 55759

This experimental mode changes how dependency code is selected and loaded across application processes. Content verification and build-approval controls provide important safeguards, but interrupted installation can leave inconsistent runnable outputs. Recovery and concurrent-operation coverage remain incomplete.

Retained concerns

  • Medium · reliability · inferred: The new runtime manifest becomes visible before loader and bin publication completes. A later error or interruption can therefore expose a new dependency graph alongside older or incomplete executable outputs rather than preserving the previous coherent installation. This is a failure-containment and rollback concern, not a verified execution-control bypass; individual atomic writes do not provide a common installation commit.
Security review details

Security Blast Radius

  • inferred — The relevant exposure is dependency code executing in loaded-mode Node processes and descendants inheriting the loader option, plus content retention in the user's shared package store. The inspected hooks change code selection, not process isolation; they should not be treated as a sandbox for dependency code.

Trust Boundaries and Controls

  • observed — The traced loaded-linker build path preserves the shared allow-build policy. Loaded snapshots restrict bin relinking rather than replacing the lifecycle execution graph; the existing script gate still checks approval. Importer IDs outside the declared trusted set remain validated before bin writes.

Resilience and Maintainability Implications

  • observed — Prune-reference collection checks manifest version and canonical store identity, then constructs blob paths only from validated digests. These checks constrain shared-store reference interpretation, while runtime integrity failures reject mismatched blob content.

Hardening Proposals

  • proposed — Consider generation-based publication or a durable recovery protocol covering the manifest, loader, command entries, and bin inventory. Define same-workspace serialization and interrupted-install recovery explicitly so future runtime changes cannot silently drift from executable state.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Same-run regression check

HEAD and main are measured on the same runner. The tolerance is 5% of the main median or 2 ms, whichever is larger. A regression requires both the median slowdown and the gap between the fastest retained HEAD sample and slowest retained main sample to exceed this tolerance, after trimming up to 10% from each tail. Suspected regressions are rerun once with target order reversed and only fail if reproduced. This conservative noise guard is not a statistical confidence interval.

Inconclusive rows do not fail the check. They remain visible for performance review. Bencher retains absolute minimum timings for historical tracking; historical alerts do not gate this PR. Sequential measurements can still be affected by runner drift.

Scenario Engine main median HEAD median Change Tolerance Result
isolated-fresh-restore-cold-cache-cold-store pacquet 2340.03 ms 2455.94 ms 5.0% 117.00 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store pnpr 1384.37 ms 1357.93 ms -1.9% 69.22 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pacquet 228.25 ms 228.91 ms 0.3% 11.41 ms Within tolerance
isolated-fresh-restore-hot-cache-hot-store pnpr 260.18 ms 314.31 ms 20.8% 13.01 ms Inconclusive (overlapping samples)
isolated-repeat-install-hot-cache-hot-store pacquet 9.56 ms 9.75 ms 2.0% 2.00 ms Within tolerance
isolated-repeat-install-hot-cache-hot-store pnpr 9.34 ms 9.75 ms 4.4% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pacquet 9.91 ms 9.72 ms -2.0% 2.00 ms Within tolerance
isolated-repeat-install-cold-cache-hot-store pnpr 8.95 ms 9.43 ms 5.4% 2.00 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pacquet 2875.47 ms 2669.06 ms -7.2% 143.77 ms Within tolerance
isolated-fresh-install-cold-cache-cold-store pnpr 1585.93 ms 1735.65 ms 9.4% 79.30 ms Inconclusive (overlapping samples)
isolated-fresh-install-hot-cache-hot-store pacquet 474.80 ms 455.70 ms -4.0% 23.74 ms Within tolerance
isolated-fresh-install-hot-cache-hot-store pnpr 287.94 ms 350.66 ms 21.8% 14.40 ms Inconclusive (overlapping samples)
isolated-fresh-install-cold-cache-hot-store pacquet 1698.83 ms 1765.97 ms 4.0% 84.94 ms Within tolerance
isolated-fresh-install-cold-cache-hot-store pnpr 332.41 ms 341.78 ms 2.8% 16.62 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pacquet 223.58 ms 222.75 ms -0.4% 11.18 ms Within tolerance
isolated-fresh-resolve-hot-cache-offline pnpr 93.11 ms 92.47 ms -0.7% 4.66 ms Within tolerance
isolated-peer-heavy-resolve-hot-cache-offline pacquet 232.21 ms 225.73 ms -2.8% 11.61 ms Within tolerance
isolated-linked-workspace-resolve-hot-cache-offline pacquet 206.73 ms 207.98 ms 0.6% 10.34 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pacquet 4664.71 ms 4496.24 ms -3.6% 233.24 ms Within tolerance
isolated-fresh-restore-cold-cache-cold-store-cold-pnpr pnpr 3753.43 ms 3831.72 ms 2.1% 187.67 ms Within tolerance
gvs-fresh-restore-hot-cache-hot-store pacquet 149.71 ms 157.21 ms 5.0% 7.49 ms Inconclusive (overlapping samples)
gvs-fresh-restore-hot-cache-hot-store pnpr 202.47 ms 187.82 ms -7.2% 10.12 ms Within tolerance

Integrated-Benchmark Report (Linux)

Commit: 557598fb7e50

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm; the linked-workspace scenario compares current Rust against main Rust. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ. Bencher tracks absolute minimum latency; PR regression checks compare HEAD and main samples from the same runner. Historical timing alerts do not gate PRs.

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.439 ± 0.117 2.305 2.636 1.74 ± 0.17
pacquet@main 2.428 ± 0.162 2.271 2.668 1.73 ± 0.19
pnpr@HEAD 1.403 ± 0.119 1.294 1.670 1.00
pnpr@main 1.411 ± 0.110 1.282 1.630 1.01 ± 0.12
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.43942338384,
      "stddev": 0.1166422533117999,
      "median": 2.45593895614,
      "user": 1.454647,
      "system": 1.47093222,
      "min": 2.30513717464,
      "max": 2.63556488964
    },
    {
      "command": "pacquet@main",
      "mean": 2.4283063996399994,
      "stddev": 0.16172982798622332,
      "median": 2.3400330181399998,
      "user": 1.4698362,
      "system": 1.47140982,
      "min": 2.2708677646399997,
      "max": 2.66845676964
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.4028084752399999,
      "stddev": 0.1185512168432622,
      "median": 1.35792584014,
      "user": 1.3638312,
      "system": 1.28596022,
      "min": 1.29390736864,
      "max": 1.6699200916399999
    },
    {
      "command": "pnpr@main",
      "mean": 1.41050224034,
      "stddev": 0.10985825293180397,
      "median": 1.38437116564,
      "user": 1.2458421999999998,
      "system": 1.2750925199999998,
      "min": 1.28200054164,
      "max": 1.62972119564
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 232.0 ± 8.6 222.3 251.9 1.01 ± 0.05
pacquet@main 230.1 ± 8.9 217.9 244.4 1.00
pnpr@HEAD 322.6 ± 89.3 220.5 439.7 1.40 ± 0.39
pnpr@main 261.8 ± 16.8 244.1 290.8 1.14 ± 0.09
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.23204284712,
      "stddev": 0.008574555398638203,
      "median": 0.22891208282,
      "user": 0.267937,
      "system": 0.5516139599999998,
      "min": 0.22233897282,
      "max": 0.25187825582
    },
    {
      "command": "pacquet@main",
      "mean": 0.23011503332000002,
      "stddev": 0.008930299318189578,
      "median": 0.22824738032,
      "user": 0.2678616,
      "system": 0.5609219599999999,
      "min": 0.21786147582,
      "max": 0.24435403382
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.32260702412,
      "stddev": 0.08932824592110761,
      "median": 0.31431035582,
      "user": 0.36731389999999997,
      "system": 0.6804211599999999,
      "min": 0.22051056482,
      "max": 0.43972774582
    },
    {
      "command": "pnpr@main",
      "mean": 0.26183420122,
      "stddev": 0.016804550627970847,
      "median": 0.26018377032,
      "user": 0.29054129999999995,
      "system": 0.5661569599999999,
      "min": 0.24409962582,
      "max": 0.29082234882
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 9.8 ± 0.7 8.4 13.1 1.04 ± 0.09
pacquet@main 9.7 ± 0.8 8.2 12.7 1.03 ± 0.10
pnpr@HEAD 9.8 ± 0.7 8.7 12.8 1.04 ± 0.09
pnpr@main 9.4 ± 0.5 8.3 12.0 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.009810080844502168,
      "stddev": 0.00065637721368418,
      "median": 0.00975256568,
      "user": 0.005846591861471862,
      "system": 0.004879828051948051,
      "min": 0.00837203368,
      "max": 0.013101690680000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.009704738855862073,
      "stddev": 0.0007752813807388421,
      "median": 0.009564186180000002,
      "user": 0.005523992413793105,
      "system": 0.00504896979310345,
      "min": 0.00822118068,
      "max": 0.01270237968
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.009844245323678173,
      "stddev": 0.0006730527273137896,
      "median": 0.00975138168,
      "user": 0.005888733026819918,
      "system": 0.004754273409961689,
      "min": 0.00866626568,
      "max": 0.01275274468
    },
    {
      "command": "pnpr@main",
      "mean": 0.00944378861750001,
      "stddev": 0.000543813885476122,
      "median": 0.00934341168,
      "user": 0.005899279722222223,
      "system": 0.004347567777777777,
      "min": 0.008337659680000001,
      "max": 0.01196306268
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 9.8 ± 0.7 8.4 12.8 1.09 ± 0.10
pacquet@main 10.0 ± 0.8 8.7 14.0 1.12 ± 0.11
pnpr@HEAD 9.6 ± 0.7 8.3 12.6 1.07 ± 0.11
pnpr@main 9.0 ± 0.6 8.0 11.8 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.009803956127272723,
      "stddev": 0.0006551326313927106,
      "median": 0.0097200184,
      "user": 0.005651823636363635,
      "system": 0.0053717376363636325,
      "min": 0.0083743179,
      "max": 0.0128014619
    },
    {
      "command": "pacquet@main",
      "mean": 0.01004978959333333,
      "stddev": 0.0007814890870543916,
      "median": 0.009913782900000001,
      "user": 0.005381344444444445,
      "system": 0.0058793208888888865,
      "min": 0.0087317179,
      "max": 0.013998967900000001
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.009615408010132158,
      "stddev": 0.0007267670723543085,
      "median": 0.0094324539,
      "user": 0.005139363083700437,
      "system": 0.005587395594713656,
      "min": 0.0083018079,
      "max": 0.0126219529
    },
    {
      "command": "pnpr@main",
      "mean": 0.008990792149999998,
      "stddev": 0.000592307292833252,
      "median": 0.0089452114,
      "user": 0.005328908934426227,
      "system": 0.004565009999999999,
      "min": 0.0079555839,
      "max": 0.0117928159
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.674 ± 0.086 2.597 2.893 1.65 ± 0.11
pacquet@main 2.894 ± 0.069 2.798 3.004 1.78 ± 0.11
pnpr@HEAD 1.712 ± 0.067 1.599 1.809 1.05 ± 0.07
pnpr@main 1.623 ± 0.096 1.533 1.830 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.67441397404,
      "stddev": 0.08577500822523874,
      "median": 2.66906042434,
      "user": 2.40233672,
      "system": 1.8388879,
      "min": 2.59689036884,
      "max": 2.89337441584
    },
    {
      "command": "pacquet@main",
      "mean": 2.8942193089400003,
      "stddev": 0.06899791155993233,
      "median": 2.8754673023399997,
      "user": 3.01555572,
      "system": 2.2397587999999997,
      "min": 2.79822159284,
      "max": 3.00439213184
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.7118782430400004,
      "stddev": 0.06712933804397274,
      "median": 1.7356508013400003,
      "user": 1.8359594200000005,
      "system": 1.9365625000000002,
      "min": 1.5990561948400002,
      "max": 1.8089876498400002
    },
    {
      "command": "pnpr@main",
      "mean": 1.6234608809400002,
      "stddev": 0.0962925212026404,
      "median": 1.58593210584,
      "user": 1.7024064200000002,
      "system": 1.7378156999999999,
      "min": 1.53312825284,
      "max": 1.8295165688400001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 457.7 ± 20.7 428.0 489.4 1.59 ± 0.08
pacquet@main 469.4 ± 21.7 430.4 499.6 1.63 ± 0.09
pnpr@HEAD 348.7 ± 47.4 285.3 414.6 1.21 ± 0.17
pnpr@main 287.8 ± 7.0 278.1 299.9 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.45771294244000005,
      "stddev": 0.02069306405506403,
      "median": 0.4557042226400001,
      "user": 0.6326557999999999,
      "system": 0.69651954,
      "min": 0.42801959464000006,
      "max": 0.48938823964000006
    },
    {
      "command": "pacquet@main",
      "mean": 0.46937277194,
      "stddev": 0.021706778308828674,
      "median": 0.4747992911400001,
      "user": 0.6432214999999999,
      "system": 0.74016044,
      "min": 0.43036099664000005,
      "max": 0.49955267764000005
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3486933919400001,
      "stddev": 0.04736445950216572,
      "median": 0.35066252514000007,
      "user": 0.3234797,
      "system": 0.67957894,
      "min": 0.28533026464000005,
      "max": 0.4145954666400001
    },
    {
      "command": "pnpr@main",
      "mean": 0.28775759614000007,
      "stddev": 0.007037040801066906,
      "median": 0.28794128214000003,
      "user": 0.25224149999999995,
      "system": 0.5543579399999999,
      "min": 0.27806349164000005,
      "max": 0.29993579464000003
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.769 ± 0.040 1.690 1.838 5.25 ± 0.28
pacquet@main 1.712 ± 0.044 1.653 1.795 5.08 ± 0.28
pnpr@HEAD 0.337 ± 0.016 0.306 0.359 1.00
pnpr@main 0.352 ± 0.047 0.317 0.470 1.05 ± 0.15
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7687202593999998,
      "stddev": 0.039560852779474236,
      "median": 1.7659724731,
      "user": 1.2007472200000002,
      "system": 1.14179336,
      "min": 1.6904605710999998,
      "max": 1.8381351731
    },
    {
      "command": "pacquet@main",
      "mean": 1.7123906077000002,
      "stddev": 0.044386931400673,
      "median": 1.6988294841,
      "user": 1.1293713200000002,
      "system": 1.11258726,
      "min": 1.6529774911,
      "max": 1.7954334990999998
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.3368706751,
      "stddev": 0.016224284584762876,
      "median": 0.34178237310000004,
      "user": 0.31934922,
      "system": 0.6292236600000001,
      "min": 0.3064722691,
      "max": 0.35922381010000004
    },
    {
      "command": "pnpr@main",
      "mean": 0.3523729791,
      "stddev": 0.046961302760950493,
      "median": 0.33241380610000004,
      "user": 0.31463991999999996,
      "system": 0.6649990599999999,
      "min": 0.31675720910000005,
      "max": 0.4697734351000001
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 220.5 ± 18.6 191.3 255.0 2.36 ± 0.22
pacquet@main 227.5 ± 18.8 198.5 259.8 2.44 ± 0.22
pnpr@HEAD 93.4 ± 3.2 86.6 101.3 1.00
pnpr@main 93.6 ± 2.3 90.4 97.4 1.00 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.22049795112,
      "stddev": 0.018554428883107005,
      "median": 0.22275482712,
      "user": 0.20956408461538462,
      "system": 0.08287642461538464,
      "min": 0.19134279712000002,
      "max": 0.25498863912
    },
    {
      "command": "pacquet@main",
      "mean": 0.22753976278666668,
      "stddev": 0.018753134939437678,
      "median": 0.22357717762,
      "user": 0.19620944999999998,
      "system": 0.07833920666666666,
      "min": 0.19850907012000002,
      "max": 0.25976131912
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.09336916644258066,
      "stddev": 0.0032447100094279654,
      "median": 0.09246945812,
      "user": 0.033341474193548395,
      "system": 0.015621523870967735,
      "min": 0.08660047812,
      "max": 0.10125059112
    },
    {
      "command": "pnpr@main",
      "mean": 0.09360303128129034,
      "stddev": 0.002260753996739939,
      "median": 0.09311105812,
      "user": 0.035854474193548376,
      "system": 0.014696943225806452,
      "min": 0.09044916712,
      "max": 0.09743364212
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 228.1 ± 8.4 219.3 241.2 1.00
pacquet@main 232.0 ± 13.3 213.7 251.6 1.02 ± 0.07
pnpm@HEAD 3512.7 ± 314.8 3288.1 4244.3 15.40 ± 1.49
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.22812177510444442,
      "stddev": 0.008438175136542674,
      "median": 0.22573046666000002,
      "user": 0.22089226666666664,
      "system": 0.06049044666666666,
      "min": 0.21928688866,
      "max": 0.24124355866
    },
    {
      "command": "pacquet@main",
      "mean": 0.23195351310444445,
      "stddev": 0.013292166966845072,
      "median": 0.23220772766,
      "user": 0.23897893333333334,
      "system": 0.04946066888888888,
      "min": 0.21368951066,
      "max": 0.25155338866
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.512697538326667,
      "stddev": 0.3147601639458193,
      "median": 3.38684728866,
      "user": 5.352790933333333,
      "system": 0.38374411333333325,
      "min": 3.28807478866,
      "max": 4.24430612066
    }
  ]
}

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

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 207.3 ± 4.6 200.2 216.8 1.00
pacquet@main 208.0 ± 9.9 196.3 226.5 1.00 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.20734602696,
      "stddev": 0.004574875442622051,
      "median": 0.20797909546,
      "user": 0.1622379257142857,
      "system": 0.08539655714285713,
      "min": 0.20023300596000002,
      "max": 0.21676314196000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.20800432267428576,
      "stddev": 0.00985542950530533,
      "median": 0.20673423096,
      "user": 0.15693471142857143,
      "system": 0.08589934285714285,
      "min": 0.19628358296,
      "max": 0.22651342896
    }
  ]
}

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

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.539 ± 0.155 4.380 4.842 1.21 ± 0.05
pacquet@main 4.682 ± 0.140 4.533 5.005 1.24 ± 0.04
pnpr@HEAD 3.843 ± 0.157 3.645 4.152 1.02 ± 0.05
pnpr@main 3.762 ± 0.072 3.657 3.877 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.53850761128,
      "stddev": 0.1549359959557625,
      "median": 4.496240394580001,
      "user": 1.9175166399999999,
      "system": 1.8177506,
      "min": 4.38049614308,
      "max": 4.84236041008
    },
    {
      "command": "pacquet@main",
      "mean": 4.681942113680001,
      "stddev": 0.13972573779456937,
      "median": 4.66471453958,
      "user": 2.31243034,
      "system": 2.1273304,
      "min": 4.5330814550800005,
      "max": 5.00454335908
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.8428249355800004,
      "stddev": 0.1570053861086172,
      "median": 3.83171523708,
      "user": 2.4969825400000003,
      "system": 2.1904775,
      "min": 3.64457620308,
      "max": 4.15241121908
    },
    {
      "command": "pnpr@main",
      "mean": 3.7619265823800005,
      "stddev": 0.07150085706825553,
      "median": 3.75342667458,
      "user": 2.44677924,
      "system": 2.2056294999999997,
      "min": 3.65721646708,
      "max": 3.87729214908
    }
  ]
}

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

Same install as the isolated fresh-restore hot/hot scenario, into the shared virtual store, the layout pnpm 12 installs into by default. Scenarios run on separate machines, so compare main and branch within each table.

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 157.7 ± 7.9 138.6 169.6 1.06 ± 0.07
pacquet@main 148.4 ± 5.3 140.3 156.9 1.00
pnpr@HEAD 188.5 ± 24.8 150.2 222.0 1.27 ± 0.17
pnpr@main 201.5 ± 10.0 185.6 214.0 1.36 ± 0.08
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.1576770838375,
      "stddev": 0.00794180514401061,
      "median": 0.15721201540000002,
      "user": 0.1968685875,
      "system": 0.19021411749999997,
      "min": 0.13861914690000002,
      "max": 0.16962510290000002
    },
    {
      "command": "pacquet@main",
      "mean": 0.14841880365000001,
      "stddev": 0.005333081372548648,
      "median": 0.1497144199,
      "user": 0.1886205875,
      "system": 0.17406143,
      "min": 0.14033361390000001,
      "max": 0.1568974099
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.18852804478235297,
      "stddev": 0.024784644614714378,
      "median": 0.18781979990000003,
      "user": 0.22155678235294116,
      "system": 0.21081720941176468,
      "min": 0.15018127990000002,
      "max": 0.22197759890000002
    },
    {
      "command": "pnpr@main",
      "mean": 0.20152184005384616,
      "stddev": 0.010048421554404817,
      "median": 0.20246520090000003,
      "user": 0.24208589999999994,
      "system": 0.22373006461538467,
      "min": 0.18558082090000003,
      "max": 0.21395088290000003
    }
  ]
}

@zkochan

zkochan commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

The repository compatibility run does not pass yet.

I built an isolated copy from the installed graph: 1,791 package instances, 37,795 files, 659 MiB of CAS blobs. The loader itself was bundled. A filesystem scan confirmed no node_modules directories and no symlinks outside the isolated tree.

  • Baseline CLI argument-parser suite: 51 tests passed.
  • The same suite with the loader: failed during Jest startup, zero tests executed.
  • TypeScript pnpm CLI suite (withCommand.test.ts) with the loader: also failed during Jest startup.
  • Unbundled TypeScript CLI with current --version and with current help: succeeded. with current prevents switching to the repository's pinned package manager; the unbundled development build reports 0.0.0.

Jest reports that the preset is missing. Calling its resolver with throwIfNotFound exposes the underlying failure: its native unrs-resolver binding cannot load from a virtual path. Jest also resolves and reads modules independently of Node's hooks, so native-tooling support alone will not make its VM module loader consume CAS files.

The draft PR will include a reproducible manual harness (node pnpm/esm-loader/scripts/test-repository.mjs) that retains logs and returns nonzero for these failures. The runtime regression tests now also cover a CommonJS native-addon request, which previously bypassed the load hook and produced an unhelpful dlopen error.

This is evidence that the standalone runtime is not sufficient for the pnpm test suite. Native tooling, resolver integration, and filesystem-dependent modules need to be addressed before claiming that compatibility.


Written by an agent (Codex, GPT-6).

@zkochan

zkochan commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Selective materialization works for the CLI argument-parser suite: all 51 tests pass with no node_modules directory or symlinks outside the isolated fixture.

The experiment materialized 71 of 1,585 registry package instances (656 files, 3.4 MiB). The other 1,514 remain represented by CAS blobs. A second run with a load-hook audit confirmed that 299 modules from 83 package instances actually loaded from CAS during the passing suite.

The materialized subset includes Jest's VM support and some dependencies of the tested code, including @pnpm/nopt and didyoumean2. This proves the hybrid approach for this suite, but not Jest-only materialization or full-suite compatibility. The 208 workspace projects already have physical sources and compiled outputs.

The reproducible experiment is node pnpm/esm-loader/scripts/test-selective-repository.mjs <retained-fixture>, using the fixture created by test-repository.mjs. It logs each missing-file failure, copies and verifies only the corresponding package, and records the selected package IDs and final result. This is diagnostic tooling, not automatic installer policy. The draft still needs install-mode integration and broader compatibility work.


Written by an agent (Codex, GPT-6).

@zkochan

zkochan commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Tested pinned Vue, Vite, and Svelte repositories on Node 26.10.0 with isolated snapshots and no node_modules directories.

  • Vue reactivity: 445 tests pass (4 existing skips) after materializing three tooling packages: Vitest, Vite, and the platform Rolldown binding. The subset is 154 files / 22.5 MiB, out of 509 registry package instances.
  • Svelte compiler: compiled 100 real repository components for client and server. All 200 generated outputs match the normal installation. No registry packages were materialized; the load audit recorded 297 modules from 15 CAS-backed packages.
  • Vite utility suite: normal baseline passes 131 tests. After materializing two tooling packages, the runner still cannot resolve magic-string, and zero tests execute.
  • Svelte store suite: normal baseline passes 33 tests. After materializing eight tooling packages, the runner still cannot resolve esm-env, and zero tests execute.

Native Node resolution with the loader successfully resolves both missing packages. The remaining integration problem is the runners' separate package resolution, including Vite's filesystem walk through node_modules directories. The diagnostic uses native config loading and disables result caching so it does not recreate node_modules for cache files.

The scripts and exact revisions/commands are documented in pnpm/docs/store-loader.md. These remain separate diagnostic tools; no install-time static analyzer or automatic materialization policy was added. Testing also found a package.json BOM parsing defect, fixed with a shared JSON reader and regression test. All 21 loader/patch regression tests pass locally. The PR remains a draft, and the results do not claim complete repository-suite compatibility.


Written by an agent (Codex, GPT-6).

@blacksmith-sh

This comment has been minimized.

@zkochan

zkochan commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Fixed the dependency-status test failure in commit 9991ef2. Its mock used the wall clock for equal lockfile mtimes. When that landed on a whole second, the coarse-timestamp safeguard correctly compared lockfile contents, so the test no longer exercised an unused read. A fixed whole-second timestamp reproduced the CI failure locally; a fixed sub-second timestamp preserves the intended scenario, and all 101 tests in the file pass. No production dependency-status behavior changed.


Written by an agent (Codex, GPT-6).

@zkochan

zkochan commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Implemented explicit opt-outs into normal GVS installations, including the complete locked dependency tree and ordinary dependency links. The loader delegates resolution inside these packages to Node. There is no project node_modules directory; GVS and the retained staging installation use their normal layouts.

The standalone diagnostic reuses pnpm lockfile utilities and pnpm install --frozen-lockfile --ignore-scripts. It records installed paths, platform-skipped optional dependencies, and dependencies exposed by the original installation but absent from its locked graph. It retains the staging installation for ordinary GVS usage tracking. No static analyzer or automatic opt-out selection was added.

Validation:

  • All 23 loader/resolver regression tests pass.
  • Vue: 445 tests pass, 4 existing skips; opting out Vitest installs its 136-package tree.
  • pnpm parser: all 51 tests pass with 12 explicit package-name selections, covering 362 instances in 360 GVS directories.
  • Svelte: the 128-package Vitest tree installs and starts; the suite remains blocked on application dependency esm-env outside that tree.
  • Vite: the diagnostic rejects the local Vite workspace dependency in Vitest's graph. Local file/workspace opt-out graphs remain unsupported by this helper.

Commands and the new manifest field are documented in pnpm/docs/store-loader.md. This remains a standalone runtime and diagnostic, not automatic pnpm install integration. The PR remains a draft as requested.


Written by an agent (Codex, GPT-6).

@zkochan

zkochan commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Expanded compatibility testing to Astro, Nuxt, VueUse, and Mermaid in commit e8aa555. The compatibility report now covers all eight tested projects, including the previous pnpm, Vue, Vite, and Svelte probes, with revisions, commands, setup, and failure details.

  • Astro: 116 selected Node tests pass with no registry materialization and no project node_modules. Audit confirms 4 CAS modules from 4 packages; this is narrow dependency coverage.
  • Nuxt: 87 baseline tests pass. With Vitest's 118-instance GVS tree, configuration stops at exsolve's filesystem lookup of the local kit workspace.
  • VueUse: 318 baseline tests pass, 1 todo. With Vitest's 178-instance GVS tree, Vite cannot resolve msw in test setup even though msw is already materialized in GVS.
  • Mermaid: 294 parser baseline tests pass. With Vitest's 153-instance GVS tree, Vite's config runner cannot resolve jison.

The failed tool lookups all resolve through Node with the loader. More materialization alone does not teach independent resolvers how to use the manifest. No tests execute in these three GVS failures.

Also reran Vue's 445 passing tests with 4 existing skips, Svelte's 200 matching compiler outputs, and all 23 loader/resolver regressions. The diagnostics now support Node's test runner, audit CAS loads across inherited worker preloads, and preserve legacy package.json pnpm settings when staging frozen GVS graphs. Pre-push checks passed.

The PR remains a draft as requested. Installer integration and independent tool-resolver support remain outstanding; no automatic materialization policy was added.


Written by an agent (Codex, GPT-6).

@zkochan

zkochan commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Tested the next four projects in commit 5267b78. The compatibility report now covers pnpm and eleven external workspaces, with pinned revisions and reproduction commands.

Workload Normal baseline GVS loader run
SvelteKit utilities 274 passed 49 passed; 6 suites blocked on magic-string, esm-env, or valibot resolution; 98 materialized instances
Slidev parser 114 passed 3 passed; 2 suites blocked on @antfu/utils; 52 materialized instances
NextAuth.js selected core tests 57 passed 51 passed; JWT suite blocked on @panva/hkdf; 108 materialized instances
Rollup plugin-utils 90 passed All 8 suites blocked on estree-walker/acorn; 57 materialized instances

All-CAS startup fails on native Rolldown/Rollup bindings or Vite's direct package.json read. The imports blocking the GVS runs resolve through Node with the loader, including packages already in GVS. NextAuth's hkdf package also imports and derives a key directly from CAS. These are partial results, not complete passing workloads.

SvelteKit uses a diagnostic wrapper around its existing config to move Vite's cache outside node_modules. That cache is excluded from the snapshot, and the clean-cache rerun produces the same result. NextAuth needs its normal core build; Rollup plugin-utils needs its normal package build.

The harness now preserves package-relative working directories. GVS staging omits unused patch entries from both configuration and the selected lockfile, fixing a frozen-install mismatch caused by NextAuth's unrelated pnpm 9 release-tool patch. Used patches remain intact: pnpm's existing 51-test GVS parser probe still passes. All 23 loader/resolver regression tests and pre-push checks pass.

The report also records the unsuccessful larger NextAuth opt-out: selecting the Preact preset exposed conflicting Babel GVS roots for one original package instance, so the diagnostic rejected that mapping before running tests.

Keeping the PR as a draft as requested. Automatic installer integration and independent resolver support remain outstanding.


Written by an agent (Codex, GPT-6).

@zkochan

zkochan commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Tested the next four workspaces and recorded the pinned revisions, commands, and limitations in the compatibility report.

  • Kysely: 25 database-free Mocha tests pass entirely from CAS, loading 656 modules from 87 package instances. All 10 file-migration tests pass with only four esbuild/platform instances in GVS; 666 modules from 87 packages still load from CAS. The all-CAS migration probe stalls on .cts and retains its timeout evidence.
  • Milkdown: the 15-test context and 21-test transformer baselines pass. With Vitest's 89-instance GVS tree, three tests pass and nine other suites fail in Vite resolution of the exception workspace.
  • Element Plus: 107 utility tests pass normally. With Vitest's 195-instance GVS tree, all 20 suites fail to resolve test setup dependencies.
  • Quasar: 60 tests pass normally across CLI and SSR utilities. With Vitest's 128-instance GVS tree, 26 pass, four assertions fail, and four other suites fail during import. Besides custom resolution, these expose assumptions about physical package paths and discovery of temporary installations outside the manifest.

All copied application trees remain free of node_modules. These are scoped probes, not full repository test passes. The diagnostic now supports Mocha and preserves timeout output and termination details. The 23 loader/resolver regressions and scoped ESLint pass.

The PR remains a draft as requested. Independent resolver integration and the installer integration tracked in pnpm/tasks remain outstanding.


Written by an agent (Codex, GPT-6).

@zkochan

zkochan commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Tested Qwik, Turborepo, Cycle.js, and ByteMD in commit a816526. The compatibility report now covers pnpm and nineteen external projects, with pinned revisions and reproduction commands.

  • Qwik: all 167 selected tests pass with Vitest, oxc-parser, and oxc-transform trees in GVS (93 instances). The run still loads 19 modules from eight CAS package instances. Vitest alone stops at the Oxc native bindings.
  • Turborepo: 33 tests and five snapshots pass normally. After the loader fix below, all-CAS Jest stops at discovery of the local test-utils preset. GVS staging rejects conflicting Babel roots for one original instance, so that attempt executes no tests.
  • Cycle.js: 32 tests pass normally. Mocha 6's extensionless executable is unsupported by the loader, and its format-5.3 lockfile is unsupported by the GVS helper. Installation uses Node 18 with pnpm 6.35.1; both test runs use Node 26.10.0.
  • ByteMD: all seven tests pass with a diagnostic config selecting Svelte's browser condition. All-CAS Vite then fails on a direct package.json read; its format-6.0 lockfile is unsupported by the GVS helper. The report explains the browser condition and the older runner's exclusion of checkouts under .cache.

Turborepo uncovered a real loader defect: CommonJS require('..') was incorrectly classified as a package subpath. The fix handles dot directories within the owning package and retains the package-root escape check. A regression test fails before the fix and passes afterward; all 24 loader/resolver tests and scoped ESLint pass.

The diagnostic now supports package-local Jest, reads runner binary entries from package metadata, and rejects incompatible lockfiles explicitly using the existing lockfile reader. No dependency graph was upgraded to force a GVS result. Every copied application remains free of node_modules.

Keeping this PR as a draft as requested. Installer integration, independent resolver support, extensionless stored executables, and the documented GVS diagnostic limitations remain outstanding.


Written by an agent (Codex, GPT-6).

@zkochan

zkochan commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Tested Prisma, Verdaccio, Logto, and Stimulus Components in commit 970e41c. The compatibility report now covers pnpm and twenty-three external projects, with pinned revisions, reproduction commands, and limits.

  • Prisma: all 89 existing Node-based coverage-tool tests pass entirely from CAS, including temporary Git repositories and child processes. The audit observes 160 modules from 12 CAS package instances. Separately, 169 foundation utility tests pass normally; the 119-instance GVS Vitest selection reaches Oxc's inability to locate the physical workspace tsconfig, so none of those tests execute with the loader.
  • Verdaccio: 166 core/URL tests pass normally, with one existing skip. With Vitest's 157-instance GVS tree, all 17 suites fail to resolve nock in the unchanged network-restricting setup.
  • Logto: 71 shared utility tests pass normally. Vitest's 145-instance tree first fails on an fs read of a stored tsconfig. Selecting the shared tsconfig packages adds four instances and gets past that read: seven tests pass, seven other suites fail to resolve application dependencies.
  • Stimulus Components: 154 DOM tests pass normally. With Vitest's 96-instance GVS tree, all 22 suites stop at resolution of the Stimulus dependency.

Node resolution with the loader finds the imports and workspace tsconfig that block the independent runner lookups. The report distinguishes those lookups from native-binding and filesystem failures during all-CAS startup. The Prisma Node probe disables inherited Git tag signing only in the test process; test sources and assertions are unchanged. These are scoped workloads, not full repository passes.

All copied application trees remain free of node_modules. All 24 loader/resolver regressions pass. This batch changes documentation only; no runtime fix was needed.

The PR remains a draft as requested. Installer integration and the documented independent resolver limitations remain outstanding.


Written by an agent (Codex, GPT-6).

@zkochan zkochan changed the title feat(esm-loader): load Node.js modules directly from store blobs feat(install): load packages from CAS with GVS opt-outs Oct 4, 2026
@zkochan

zkochan commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Implemented normal installer integration in de989d4 and rebased onto main.

Configure nodeLinker: cas and an optional casMaterialize list in pnpm-workspace.yaml. Normal install, run, and exec commands now generate and use the embedded loader. Opt-outs materialize complete dependency trees as ordinary GVS packages. The installer creates executable shims, applies build approval, and preserves live blobs and GVS trees during store pruning.

Local validation passed: 14,506 Rust tests (24 skipped), 24 loader tests, the patched-unrs regression, the embedded-bundle consistency check, TypeScript compilation, lint, Rust documentation, Clippy, custom Rust lints, formatting, and spelling. All six CAS CLI tests were rerun successfully after the final test-fixture lint corrections. CI is running on this head.

Kept as a draft at the author's request. The next compatibility step is exercising this normal install mode on the external repositories; the existing 23-project report documents the earlier standalone diagnostic harness. Independent resolvers and direct filesystem access remain compatibility limits.


Written by an agent (Codex, GPT-6).

@codecov-commenter

codecov-commenter commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.79905% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.31%. Comparing base (1e5d031) to head (557598f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pnpm/crates/store-dir/src/loader_references.rs 87.14% 9 Missing ⚠️
...ates/deps-restorer/src/create_virtual_store/cas.rs 93.54% 6 Missing ⚠️
pnpm/crates/deps-restorer/src/cas/bin_state.rs 80.00% 5 Missing ⚠️
pnpm/crates/store-dir/src/prune_cas.rs 86.84% 5 Missing ⚠️
pnpm/crates/deps-restorer/src/cas.rs 96.61% 4 Missing ⚠️
pnpm/crates/cli/src/cli_args/exec.rs 88.23% 2 Missing ⚠️
pnpm/crates/config/src/cas.rs 96.36% 2 Missing ⚠️
pnpm/crates/config/src/layout.rs 71.42% 2 Missing ⚠️
pnpm/crates/deps-restorer/src/cas/bins.rs 98.01% 2 Missing ⚠️
pnpm/crates/config/src/pnpm_default_parity.rs 0.00% 1 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16482      +/-   ##
==========================================
+ Coverage   92.29%   92.31%   +0.01%     
==========================================
  Files        1568     1576       +8     
  Lines      207972   208719     +747     
==========================================
+ Hits       191957   192679     +722     
- Misses      16015    16040      +25     

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

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

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.00     11.7±0.24ms    32.1 MB/sec    1.04     12.2±0.15ms    30.7 MB/sec
packument/parse                                  1.00     39.0±0.29µs  1701.1 MB/sec    1.09     42.5±0.13µs  1561.6 MB/sec
tarball/download_dependency                      1.03      4.2±0.16ms  1045.2 KB/sec    1.00      4.0±0.10ms  1078.0 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00   198.0±12.45ms 80.8 KElem/sec    1.00    198.7±8.98ms 80.5 KElem/sec
version_pick/repeated_ranges_file                1.00      4.1±0.05ms  7.6 KElem/sec    1.00      4.1±0.02ms  7.6 KElem/sec
version_pick/repeated_ranges_raw                 1.00      4.1±0.07ms  7.6 KElem/sec    1.00      4.1±0.06ms  7.6 KElem/sec
workspace_resolution/hoist_heavy                 1.19   246.0±14.84ms        ? ?/sec    1.00    207.1±5.10ms        ? ?/sec
workspace_sort/chained_projects                  1.00     13.0±1.23ms        ? ?/sec    1.06     13.9±0.61ms        ? ?/sec

@zkochan

zkochan commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Normal installer integration is pushed, with final head 1dd98e24174c61df4f2a6da56f79bad0ffc453af. All current checks are green: 68 successful checks and one skipped job. Rust tests passed on Linux, macOS, and Windows, the TypeScript matrix passed, and the complete WASM/WebContainer workflow passed.

The final CI fix routes WASM worker shutdown through the updated thread manager. The previous code reproduced a worker-exit crash locally; all 93 WASM host/runtime tests now pass, including 40 repeated CLI runs.

The opt-in mode is configured with nodeLinker: cas and casMaterialize in pnpm-workspace.yaml. Selected packages and their complete dependency trees use ordinary GVS entries. The embedded loader, manifest, and executable shims are generated by normal installation. CLI tests verify that the application has no node_modules directory.

Keeping this PR as a draft at the author's request. Further compatibility testing should exercise the new normal install mode; the existing external-project table describes standalone diagnostic probes and remains labeled accordingly. No review findings are outstanding.


Written by an agent (Codex, GPT-6).

@zkochan zkochan changed the title feat(install): load packages from CAS with GVS opt-outs feat(install): add loaded linker with GVS exclusions Oct 4, 2026
@zkochan

zkochan commented Oct 4, 2026

Copy link
Copy Markdown
Member Author

Implemented the loaded-linker object form in 13587af5321fe1a777701b52d3712cc38f74839a:

nodeLinker:
  type: loaded
  excluded:
    - vitest

This replaces the unreleased cas / casMaterialize spelling. Existing scalar linker forms remain supported. The same parser handles workspace configuration, JSON environment values, and JSON --config.node-linker overrides. Excluded packages still materialize with their complete dependency trees in GVS.

The broader linker-settings and hoisting refactor is recorded separately in pnpm/tasks#72; it is not implemented here.

Validation: 7,633 tests passed across the affected Rust crates after rebasing. The final CLI/config selection passed 930 tests, and the config suite passed 827 tests after the lint refactor. CI is green on this head: 68 successful checks and one skipped job. No review findings are outstanding.

The rebase retains main's WASM shutdown fix and drops this branch's redundant fix. Keeping the PR as a draft at the author's request while further real-project compatibility testing of the normal installer remains future work.


Written by an agent (Codex, GPT-6).

@zkochan
zkochan marked this pull request as ready for review October 5, 2026 08:20
Copilot AI balanced review requested due to automatic review settings October 5, 2026 08:20

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.

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

Your trial has ended. Reactivate Greptile to resume code reviews.

Copilot AI balanced review requested due to automatic review settings October 5, 2026 08:23
Copilot AI balanced review requested due to automatic review settings October 5, 2026 11:06

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.

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@zkochan

zkochan commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

Rebased onto the latest fetched main at 1e5d031 and force-pushed with a lease. The new head is 557598f. Conflict resolutions preserve main's LockfileSetting import and recorded_auto_dedupe behavior together with the loader settings and state-directory handling.

The latest verified findings are fixed: importer IDs are validated before loaded bin writes, configured external project anchors remain trusted, and loaded installs require durable registration even with a project-local store. A regression verifies that prune preserves that store's live CAS bin and that blocked registration fails installation. The summary-only pruning finding is also fixed: slot extraction rejects noncanonical components and empty slot prefixes, with a regression for nonexistent roots containing traversal.

The patch-package finding is a confirmed external-tool layout limitation. Source inspection and follow-up probe criteria are recorded in pnpm/tasks#64 (comment). The experimental loader does not emulate application fs APIs or supply application node_modules paths. The existing patchedDependencies flow remains included and materializes patched package trees.

After rebase, pnpm ready:rust passed all 14,570 tests (28 skipped), workspace checks and Clippy. All 27 loader tests and the patched-unrs regression passed. The final state-settings extraction also passed 142 repeat-install tests. Required push hooks passed. Waiting for CI and the new review round on this head.


Written by an agent (Codex, GPT-6).

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 557598f

@zkochan
zkochan merged commit 8aec506 into main Oct 5, 2026
72 checks passed
@zkochan
zkochan deleted the esm-loader branch October 5, 2026 11:22
@zkochan

zkochan commented Oct 5, 2026

Copy link
Copy Markdown
Member Author

The two late review findings about scanning a project-local store and writing loaded-project registration with frozenStore are fixed in the follow-up PR #16600, as requested after this PR merged. All 24 scoped pruning/loaded CLI tests and the required push hooks passed. The follow-up includes a regression for each case.

The repeated prefetch/index work for excluded dependency trees is confirmed and tracked separately in pnpm/tasks#77, with regression and benchmark completion criteria. Reusing a caller-supplied prefetch task requires a shared phase/result contract; simply splitting the snapshot lists does not eliminate the repeat work. That refactor is outside the two correctness fixes in the follow-up PR.


Written by an agent (Codex, GPT-6).

zkochan added a commit that referenced this pull request Oct 5, 2026
…ies (#16600)

Exclude the store from registered-project scans and direct directory walks so GVS entries
cannot mark themselves live when the store is inside the project.

Skip loaded-project registration for frozen stores, preserving the existing
strict registration requirement for writable loaded stores. Document external
ownership of frozen-store retention and cover both cases with regressions.

Follow-up to #16482.
zkochan added a commit that referenced this pull request Oct 28, 2026
modifiedAtOrAfter widens whole-second mtimes (mtimeMs % 1000 === 0) by
a second. Date.now() lands on an exact second once in a thousand runs,
causing tests that derive fake mtimes from Date.now() - 10_000 to report
unmodified files as modified. Use recentTimestamp() across the suite
instead of fixing individual tests piecemeal (#16385,
#16482).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants