Repository navigation
Description
Goal
Add an experimental, opt-in pnpm v12 install mode that runs Node.js applications directly from the content-addressable store. Packages that can run from store files should not need a materialized package directory or a node_modules tree.
Keep the existing linker modes and defaults unchanged. Configuration should flow through pnpm's normal config layer. Decide the final setting name during integration; a dedicated store-backed linker is a candidate.
Runtime and manifest
- Use Node's synchronous module hooks for both ESM and CommonJS, including createRequire. Require a Node version that supports these hooks.
- Emit a versioned project manifest from the installed lockfile graph and the fetcher's existing file-to-CAS mappings. Reuse the package-map dependency graph builder. Do not maintain a separate dependency resolver for installation.
- Preserve package snapshot identities, including peer contexts, even when their source blobs are identical. Bare imports must follow the issuer's declared dependency edges, including aliases and workspace links.
- Resolve exports, imports, conditional exports, relative imports, JSON, and package type scopes without creating package directories. Verify blob integrity before loading code.
- Keep store paths relocatable relative to the generated manifest where possible. Write the manifest atomically only after lockfile verification and successful fetching.
A standalone runtime prototype is being implemented in the esm-loader worktree under pnpm/esm-loader. It consumes a version 1 JSON manifest and runs ESM and CommonJS directly from SHA-512 store blobs. It is not yet connected to pnpm install. Its virtual filesystem is private to resolution; ordinary application fs calls are not redirected.
Installation integration
- Fetch and verify packages into CAS, retain their file maps, and skip virtual-store materialization for eligible packages on both fresh-resolution and frozen-lockfile paths.
- Extend the existing dependency-map construction rather than duplicating lockfile edge handling. Account for filtering, optional failures, production-only installs, workspace links, peer variants, patches, and aliases.
- Disable inappropriate fast paths and early materialization in the new mode. Persist enough state to detect dependency/config/store changes and recover after interrupted installs.
- Ensure a fresh store-backed install creates no node_modules tree. Mode transitions must not let stale loader manifests or old install state affect execution.
- Propagate the loader into pnpm run, exec, script shortcuts, lifecycle execution where appropriate, and subprocesses. Document direct node invocation.
Binaries
- Generate command shims for Node-based bins that preload the loader and execute the package's bin entry in its dependency context. Do not require the bin target to be exported by package.json.
- Preserve arguments, exit codes, signals, working directories, Windows shim behavior, and the package's declared dependencies.
- Distinguish Node scripts from native or arbitrary shell executables. Those need a materialized executable or package directory.
- Decide where shims live so PATH integration does not require creating node_modules merely for .bin.
Builds and side-effects cache
- Treat materialization as a package capability decision, not simply a devDependency/runtime dependency split. Most ordinary runtime packages should load directly. Development tools may work directly too.
- A package with lifecycle scripts can still run from CAS when an applicable side-effects cache entry exists. Compose the base file index with the selected side-effects diff, applying deletions and replacements, and expose the resulting files through the loader manifest.
- Preserve existing build authorization, platform/ABI/engine cache keys, patch identity, and side-effects integrity checks. Never run scripts merely because this mode is enabled.
- On a permitted build cache miss, materialize a temporary build environment, execute the existing build pipeline, upload its result, and then use the resulting store files when compatible.
- Selectively retain a materialized directory for native addons, packages reading/writing adjacent files via fs, directory scanning, unsupported symlinks, and other filesystem-dependent behavior. Native addons may also need neighboring shared libraries. A cache hit alone does not eliminate these requirements.
- Provide explicit per-package materialization overrides. Avoid silently executing arbitrary code twice to discover whether it requires a physical directory.
Acceptance tests
- Cold and warm installs run an app with transitive ESM/CommonJS dependencies and no node_modules or package directories.
- Frozen/repeat installs, updates, removals, optional dependencies, aliases, workspaces, cycles, and peer-context separation work.
- Exports/imports restrictions, custom conditions, JSON attributes, encoded paths, dynamic import, createRequire, and worker startup behave predictably.
- Node bin shims work without materializing their packages, including on Windows.
- A cached build output executes from CAS without rebuilding; an authorized cache miss builds and then reuses the result.
- An incompatible runtime package can be explicitly materialized while compatible packages remain in CAS.
- Corrupt/missing blobs, invalid manifests, unsupported runtime versions, and mode transitions produce actionable errors without falling back to unrelated node_modules packages.
- Measure cold/warm install time, startup time, memory, manifest size, and disk usage against isolated and PnP linkers on realistic applications.
Written by an agent (Codex, GPT-6).
Activity
zkochan commentedon Oct 1, 2026
Opened pnpm/pnpm#16482 as a draft for the standalone runtime foundation. It loads ESM, CommonJS, and JSON directly from verified CAS blobs using an explicit dependency manifest, with separate module identities for peer contexts.
This covers only the runtime portion of this task. Configurable installation, generated manifests, Node bin shims, side-effects cache selection, and selective materialization remain planned here. The initial loader does not redirect application fs calls or load native addons.
Written by an agent (Codex, GPT-6).
zkochan commentedon Oct 1, 2026
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.
withCommand.test.ts) with the loader: also failed during Jest startup.with current --versionandwith current help: succeeded.with currentprevents 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
throwIfNotFoundexposes the underlying failure: its nativeunrs-resolverbinding 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 commentedon Oct 1, 2026
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/noptanddidyoumean2. 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 bytest-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 commentedon Oct 1, 2026
Tested pinned Vue, Vite, and Svelte repositories on Node 26.10.0 with isolated snapshots and no node_modules directories.
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).
zkochan commentedon Oct 1, 2026
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:
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 commentedon Oct 5, 2026
Repository compatibility evidence
Supporting evidence for this implementation task, moved from #74. This report does not add acceptance criteria or claim that every tested repository must pass before this task closes.
Record the loader compatibility experiments for future development of #64 and pnpm/pnpm#16482. These results come from the standalone diagnostic harness, not end-to-end validation of the integrated install mode. Preserve the failures and limited workload coverage when interpreting them.
These are scoped experiments with the experimental store loader, not full repository test passes. The external projects come from Workspaces in the wild. Results were collected on Linux x64 with Node.js 26.10.0. The latest batch, recorded on October 1, 2026, adds Prisma, Verdaccio, Logto, and Stimulus Components.
Method
Each workload first runs against a normal installation. The diagnostic then copies workspace sources and built outputs, snapshots installed registry packages into CAS, and reruns the same workload with the loader. It checks that the copied tree contains no
node_modulesdirectory or symlink outside the tree. The original checkout retains its normal installation for the baseline.In the all-CAS run, registry packages have only store blobs and manifest entries. Workspace sources remain physical. In the GVS run, explicitly selected packages and their full locked dependency trees have normal GVS installations outside the copied application. GVS and the retained staging installation contain
node_modules; the copied application does not. Installation scripts are disabled for these experiments.A snapshot's package count describes available dependencies, not test coverage. The audit counts distinct module URLs successfully loaded through Node's hooks and their CAS package instances, including inherited worker preloads. It does not count sources that a runner reads directly into its own VM. A failed startup can load CAS modules without executing any tests.
Results
fs; 0 testsvitestand its tree: 136 instancespackage.jsonthroughfs; 0 testsvitestand its tree: 128 instances; Vite cannot resolveesm-env, 0 testsvitestand its tree: 118 instances; configuration cannot resolve@nuxt/kit, 0 testsvitestand its tree: 178 instances; all 58 suites fail to resolvemswin setup, 0 testspackage.jsonthroughfs; 0 testsvitestand its tree: 153 instances; configuration cannot resolvejison, 0 testsvitestand its tree: 98 instances; 49 tests pass, 6 suites fail on dependency resolutionvitestand its tree: 52 instances; 3 tests pass, 2 suites cannot resolve@antfu/utilsvitest,vite, andunplugin-swctrees: 108 instances; 51 tests pass, JWT suite cannot resolve@panva/hkdfpackage.jsonthroughfs; 0 testsvitestand its tree: 57 instances; 8 suites fail onestree-walkeroracorn, 0 tests.ctscase stalls; terminated after three minutesesbuildtrees: 4 instances; all 10 pass, 666 CAS modules from 87 packagesvitestand its tree: 89 instances; 3 tests pass, 4 suites cannot resolve the exception workspacevitestand its tree: 195 instances; all 20 suites fail to resolve test setup dependencies, 0 testsvitestand its tree: 128 instances; 25 tests pass, 4 fail, 3 other suites fail during importstack-tracevitest,oxc-parser, andoxc-transformtrees: 93 instances; all 167 pass, 19 CAS modules from 8 packagespackage.jsonthroughfs; 0 testsvitestand its tree: 157 instances; all 17 suites fail to resolvenockin setupvitestand shared tsconfig trees: 149 instances; 7 tests pass, 7 suites fail on dependency resolutionpackage.jsonthroughfs; 0 testsvitestand its tree: 96 instances; all 22 suites fail to resolve@hotwired/stimulusWhat the passing runs establish
Astro's selected tests exercise compiled workspace code with Node's test runner and no materialized registry packages. Only four registry modules were observed through the CAS hooks. The snapshot contains 1,951 registry package instances and 565 workspace roots, so this is deliberately narrow coverage of that graph.
The Svelte comparison compiles 100 real repository components for both client and server. Hashes of generated JavaScript, CSS, source maps, and warnings match the baseline. This bypasses Vitest and does not establish that Svelte's test runner works with all-CAS dependencies.
Kysely's Mocha run exercises query IDs, logging, object utilities, JSON-result parsing, immediate values, plugin composition, and async disposal. The tests use dummy drivers, not live databases. Its 656 observed CAS modules include Mocha, assertion and mocking libraries, and database-client imports from shared test setup. No registry packages are materialized. The snapshot contains 1,592 registry instances and four workspace roots; this is not coverage of every dependency or of database integration.
Kysely's separate file-migration suite passes all ten tests with only the two esbuild versions and their platform binaries in GVS (four instances). Mocha and the remaining dependencies stay in CAS. The all-CAS run stalls while loading a
.ctsmigration through the TypeScript tooling after five passing cases. Selecting esbuild resolves that stall; the passing run observes 666 CAS modules from 87 packages.Prisma's separate Node-runner workload exercises its coverage report, upgrade-coverage gate, and workflow checks. All 89 tests pass with no registry materialization, loading 160 CAS modules from 12 package instances, including schema validation and Markdown frontmatter dependencies. Tests that create temporary Git repositories and launch child processes also pass. This does not cover Prisma database access or its Vitest suites.
Qwik's eight selected files pass all 167 tests after opting out Vitest and both installed versions of
oxc-parserandoxc-transform. Vitest alone materializes 76 instances but fails on the parser's native binding; adding the parser reaches the transformer's native binding. The final 93-instance selection loads 19 modules from eight CAS package instances. This exercises built workspace code and source tests, not the full framework or browser suite.Vue's reactivity suite and pnpm's parser suite pass with GVS fallback. Vue's audited GVS rerun observed no CAS module loads: its passing workload uses physical workspaces and materialized tooling. The pnpm parser needs test setup and application dependencies in addition to Jest's own tree. These passes do not establish that opting out only the test runner suffices in other projects.
Remaining failures
@nuxt/test-utils, whoseexsolvelookup cannot locate the local@nuxt/kitworkspace without filesystem dependency links. Node resolution with the loader findspackages/kit/src/index.ts. The failed configuration run still loads 36 CAS modules from 20 packages.mswormsw/nodefrompackages/.test/mockServer.ts. The selected Vitest tree already materializesmswin GVS. Node resolution with the loader finds it there, but Vite's own resolver does not consult that mapping. The failed run loads 28 CAS modules from 12 packages.jisonimported by.build/jisonTransformer.ts. Node resolution with the loader finds its CAS module. No CAS modules are observed before the config-runner failure in the GVS attempt.esm-envandmagic-string. Their test runners' independent resolution paths still fail. Vite'smagic-stringfailure was observed in the earlier individual-package experiment; the GVS helper stops sooner because its opt-out graph contains a workspace link.magic-string,esm-env, orvalibot; six other suites pass. Node resolution with the loader finds all three dependencies, includingmagic-stringalready in GVS. The failed run loads 554 CAS modules from 15 packages, primarily through configuration tooling. A diagnostic config moves the Svelte plugin's Vite cache outsidenode_modules; without it, the original config also fails the isolation check despite--no-cache.@antfu/utils. Two time-parser suites pass three tests. Node resolution with the loader finds the missing dependency. No CAS module loads are observed in the GVS attempt.package.json. Selectingvitest,vite, andunplugin-swcgets through configuration and passes three suites. The JWT suite still fails in Vite's resolver on@panva/hkdf. Node with the loader imports that package from CAS and successfully derives a key. The partial test run loads 406 CAS modules from 38 packages. A separate attempt including@preact/preset-vitewas rejected by the diagnostic because one original Babel package instance mapped to conflicting GVS roots; that attempt executed no tests.estree-walker, and its scope tests importacorn. Vite cannot resolve either, though Node with the loader finds both andacornis already in GVS. No CAS modules are observed in the GVS attempt.@milkdown/exception, a physical workspace package. ESM resolution with the loader finds its TypeScript entry, but importing that entry directly through Node then fails on its extensionless relative imports; it still needs the project's TypeScript tooling. The three passing context tests do not load CAS modules. No CAS module loads are observed in either GVS probe.@vue/test-utils. Node resolution with the loader finds it in CAS. Configuration startup loads 310 CAS modules from 44 packages before the suites fail.ci-info,cross-spawn, orstack-tracein the selected suites, though Node with the loader resolves them. The CLI also has four assertion failures: a resolved path no longer contains the package namekolorist, reading that package's virtualpackage.jsonthroughfsreturns no data, and two subprocess tests cannot discover newly created local CLI packages throughrequire.resolve(..., { paths }). Those temporary installations are outside the manifest. The CLI probe observes 28 CAS modules from 16 packages; the SSR utility probe observes none.@turbo/test-utilsworkspace; the all-CAS attempt loads 61 modules from 47 packages before configuration fails. The first attempt also exposed a loader defect: CommonJSrequire('..')was rejected even when the target stayed inside the stored package. The loader now acceptsrequire('.')andrequire('..')within that boundary, with regression coverage that still rejects escape from the package root. The preset failure is the result after that fix. Opting out Jest is rejected because one original@babel/coreinstance maps to conflicting GVS roots; no tests run in that attempt.bin/mochabefore any CAS modules load. Opting out Mocha and ts-node cannot be tested with the GVS helper because the installed lockfile uses format 5.3.package.jsonread fails. The GVS helper rejects the installed format-6.0 lockfile. This is a diagnostic limitation, not evidence that a correctly materialized Vitest tree would fail.@repo/tsconfig/base. Vite's Oxc transform cannot locate that tsconfig without dependency links, so all 14 suites fail before running tests. Node resolution with the loader finds the existing physicalpackages/0-config/tsconfig/base.jsonworkspace file. The Vitest selection includes both installed runner versions (5.0.0-rc.2 and 4.1.10), totaling 119 instances; no CAS modules are observed in this GVS attempt. This checkout is the Prisma 8 development branch, not a released Prisma 7 workload. Type-only tests are excluded from this runtime probe.nockfrom the root test setup. Node resolution with the loader finds its CAS entry. The setup disables external network connections, so it is kept intact. No CAS module loads are observed in the GVS attempt.fsread of the shared tsconfig's virtual JSON file. Selecting@silverhand/ts-configas well materializes four more instances and gets past that read. Seven tests in two suites then pass; seven other suites cannot resolvenanoid,libphonenumber-js,ua-parser-js, or@silverhand/essentials. Node resolution with the loader finds all four, and the tsconfig resolves to a physical GVS JSON file. No CAS modules are observed in either GVS attempt. The selected baseline also passes on Node.js 26.10.0 despite the package declaring Node.js 22.@hotwired/stimulus. Node resolution with the loader finds its CAS entry. No tests or CAS module loads are observed in the GVS attempt.The GVS fallback addresses physical-file requirements within an installed dependency tree. It does not make a separate resolver understand application dependencies in the loader manifest. The custom-resolver failures need resolver integration or additional physical application links, not just more copies of package files.
The pnpm CLI compatibility probe also reached registry setup, which requires the external
pnpr-preparebinary. Its full CLI suite has not passed in this setup. Unbundled CLI startup withwith current --versionandwith current helpsucceeded.Pinned checkouts
The pnpm GVS run used this feature branch at
5d922b13566dbbc4142af415149ff73714ec8619. The external probes use installed dependency graphs, including existing build outputs. They do not test a fresh install directly into CAS.Reproduction
Use Node.js 26.10.0 for the diagnostic process; the scripts reuse that executable for both baseline and loader runs. Install each pinned checkout with
pnpm install --frozen-lockfile --ignore-scripts. From the external checkout, prepare the workloads that require generated files:Kysely and Element Plus needed
--config.@pnpm:registry=https://registry.npmjs.org/on their install command to override the test machine's scoped registry mirror. The mirror omitted timestamps required by Kysely's trust policy and served an Element Plus dependency tarball whose integrity did not match the lockfile. The official registry passed the original frozen-lockfile, integrity, and policy checks. No package versions or trust policies were changed.For Mermaid, add a diagnostic-only
compatibility.workspace.jsoncontaining["./vite.config.ts"]. This selects the existing root configuration without loading the unrelated documentation configuration. The latter uses__dirname, which fails under the config runner. Mermaid needs--configLoader runnerbecause its configuration imports TypeScript sources through.jsspecifiers. No upstream test sources were changed.For SvelteKit, add
packages/kit/compatibility.config.jsto redirect the cache while preserving its existing test configuration:The snapshot excludes
.cache, so the loader run does not reuse the baseline's generated dependency cache. The NextAuth.js probe disables coverage for both baseline and loader runs. Its core build supplies the generatedjwt.jsimported by the existing JWT tests. The Rollup plugin-utils tests likewise require built outputs. The diagnostic supports Vitest, Mocha, Jest, and Node's test runner. Package runners are located from the selected working directory using their declared binary entry, including older Mocha releases. The diagnostic's--cwdoption runs package-specific configurations from the same relative directory in the baseline and copied checkout; it still snapshots the whole workspace.For ByteMD, keep both the checkout and retained fixture outside any
.cachedirectory. Vitest 0.29.8's default exclusion otherwise matches their absolute paths and reports no tests. SetTMPDIR=/tmpfor its diagnostic and addcompatibility.config.mjs:This changes browser/server resolution for both baseline and loader runs without modifying test assertions. Cycle.js has no package-manager pin; use pnpm 6.35.1 with Node.js 18.20.8 for its frozen installation, then add
"packageManager": "[email protected]"to the diagnostic checkout's root manifest so workspace discovery uses the matching CLI. Its lockfile and dependency versions remain unchanged. Running pnpm 6's installer on the test machine's newer Node version fails its HTTP requests withERR_INVALID_THIS.Prisma's Node-runner probe sets
GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=tag.gpgSign GIT_CONFIG_VALUE_0=falsefor the test process. The tests create temporary Git tags; inheriting the machine's signed-tag setting otherwise opens an editor. This does not change global Git configuration. The test sources and assertions are unchanged.Logto does not pin pnpm in its manifest; its CI selects pnpm 10. The diagnostic uses
pnpm with 10.30.3 install --frozen-lockfile --ignore-scripts. Prisma's foundation probe disables Vitest's type-only tests explicitly; the reported 169 tests check runtime behavior.Run the following from the pnpm repository, with its workspace utilities installed and compiled:
Each command retains a fixture and exits unsuccessfully if the loader run fails. Use its printed directory for the GVS attempt or the Svelte compiler comparison:
Before the Kysely migration GVS retry, remove the test-created
repo/test/node/dist/cts-migrationsdirectory inside that retained fixture. The timeout prevents its cleanup hook from running; leaving it in place makes the next setup fail withEEXIST.For pnpm, create the fixture with
test-repository.mjs, then use these explicit opt-outs:The GVS diagnostic needs an installed pnpm v12 CLI and a format-9 installed lockfile. It explicitly checks the supported format before mapping package contexts; it does not upgrade older lockfiles or re-resolve their dependency graphs. It preserves both workspace configuration and legacy
package.jsonpnpm settings when installing the frozen selected graph. Patch entries absent from that graph are omitted from both staging configuration and lockfile. NextAuth.js's unrelated release-tool patch otherwise fails the frozen install because its pnpm 9 hash differs from the current patch hash format. Patches used by the selected graph remain intact; the pnpm parser regression still passes with its patched dependencies.Retained evidence
Every fixture retains
ecosystem-results.jsonwith the revision, command arguments, runtime, snapshot counts, and exit statuses, plusbaseline.stdout,baseline.stderr,cas.stdout, andcas.stderr. GVS attempts that reach test execution writegvs-results.json,gvs.stdout, andgvs.stderr; the result includes every mapped package root and the retained staging installation path. The pnpm-specific fixture uses its own scenario report.The diagnostic also retains partial output on timeout, with a null exit status, the termination signal, and the spawn error in the result. The all-CAS run has a three-minute limit; the GVS run has a two-minute limit. A terminated process may not flush its exit-time module audit, so timeout audit counts can be incomplete.
New runs also write CAS load audits as JSON lines, one URL array per exiting process or worker:
cas-loads.jsonlfor the all-CAS attempt andsuite-cas-loads.jsonlfor the latest GVS/selective attempt. Compiler comparisons writecompiler-results.jsonandcompiler-cas-loads.jsonl. The diagnostics retain failures as well as passes.Earlier individual-package experiment
Before the complete GVS fallback, a diagnostic copied individual package files without creating dependency trees. It passed pnpm's 51 parser tests with 71 materialized instances (656 files, 3.4 MiB), and Vue's reactivity suite with 3 tooling packages (154 files, 22.5 MiB). Vite stopped at
magic-stringafter materializing 2 tooling packages; Svelte stopped atesm-envafter 8 packages. These counts are not comparable to the full GVS dependency closures above. The commands and limitations remain documented in the reproduction notes below.Repository compatibility check
From a checkout with dependencies installed and compiled, run:
This manual compatibility check first runs the existing CLI argument parser test suite as a baseline. It then snapshots the installed dependency graph into a temporary CAS, copies the compiled workspaces without
node_modules, bundles the loader so its own dependencies require no package directories, and attempts the parser suite, a pnpm CLI suite, and unbundled CLI startup. It verifies that the temporary tree contains nonode_modulesdirectories or symlinks outside the tree. The original checkout is not modified. The fixture and logs are retained at the printed path.This tests runtime compatibility against the installed packages. It does not test fetching, automatic installation, or generation of a manifest from a lockfile. Missing optional/platform dependencies from the installed graph are recorded in
missing-dependencies.json.The repository patch for
unrs-resolverenables Node resolution withUNRS_RESOLVER_NODE_RESOLUTION=1. The compatibility check sets this automatically. It delegates tocreateRequire().resolve()and forwards conditional exports through a temporary synchronous hook. This mode uses Node semantics; unrs-specific aliases, TypeScript configuration, and custom extension searches are not implemented. Normal runs retain the native resolver.The patched run indexed 1,793 packages and 37,807 files. The parser baseline passed 51 tests. Without
node_modules, Jest resolved its configuration and started the parser suite, then failed when its VM runtime readsource-map-support.jsdirectly throughfs. Zero tests executed. The CLI suite reached registry setup and required the externalpnpr-preparetest binary. The unbundled CLI'swith current --versionandwith current helpcommands succeeded;with currentprevents switching to the repository's pinned package manager. The unbundled development build reports version0.0.0.These results do not establish compatibility with pnpm's test suite. The command exits unsuccessfully while any scenario fails. Running Jest requires additional filesystem integration and native-tooling support or materialization. See the install-mode plan.
The resolver patch has a separate regression test that runs from CAS without a native binding or
node_modules:Selective materialization experiment
To try materializing only packages that the parser suite reads directly, pass the retained fixture directory to:
This diagnostic retries the parser suite after each missing store-backed filesystem read. It verifies and copies that package's files into
materialized/<package-instance-hash>, then maps the package to a physical root in a separate manifest. It preserves the original CAS manifest and records each attempt and the selected packages inselective-results.json. It stops on success or on a failure that materialization cannot address. This is an experiment, not an automatic installer policy.The parser suite passed all 51 tests after materializing 71 of the 1,585 stored package instances: 656 files, 3.4 MiB. The other 1,514 package instances remained in CAS, and the fixture contained no
node_modulesdirectory or external symlink. The 208 workspace projects already had physical sources and compiled outputs.The selected packages include Jest internals and dependencies of the code under test, such as
@pnpm/noptanddidyoumean2. Jest's VM reads those sources too. This demonstrates that selective materialization works for this suite, but does not establish that materializing Jest alone is sufficient or that all remaining CAS packages were exercised.External repository checks
The standalone diagnostic scripts also accept installed pnpm workspaces. These checks ran on Linux with Node.js 26.10.0. They snapshot workspace files and dependency blobs, then verify that the snapshot contains neither
node_modulesdirectories nor symlinks outside it. They do not add an install-time analyzer or change the repositories' source code.magic-stringesm-envVue's snapshot contains 509 registry package instances and 18 workspace projects. Its materialized subset is
vitest,vite, and@rolldown/binding-linux-x64-gnu: 154 files, 22.5 MiB. Vite's snapshot contains 1,150 registry package instances and 285 workspace projects. Svelte's contains 410 registry package instances and 3 workspace projects. Workspace sources and built outputs remain physical in every scenario.Both
magic-stringandesm-envresolve successfully through native Node resolution with the loader. The remaining failures are in the test runners' resolution paths. These are compatibility probes, not full-repository test passes. The Svelte compiler comparison exercises the compiler directly and does not replace its Vitest suite.After installing the pinned dependencies in each checkout, run these from the pnpm repository:
Vite's checkout needs
pnpm --filter vite run build-bundlefirst. Each command runs the normal baseline, prints the retained snapshot directory, and exits nonzero if the all-CAS run fails.--configLoader nativeavoids bundling the test configuration with a separate resolver.--no-cacheprevents Vitest from creatingnode_modules/.vitefor its result cache.Use the corresponding snapshot directory for the follow-up experiments:
The selective experiment accepts explicit package names and can additionally materialize packages identified by missing-file or unsupported-native-addon errors. It does not infer dependencies through static analysis. Its loader preload is inherited through
NODE_OPTIONSso worker processes can resolve CAS packages too. Reports preserve package counts, exit statuses, and individual attempt logs. The compiler check uses the original all-CAS manifest and compares hashes of generated JavaScript, CSS, source maps, and warnings.GVS opt-out experiment
Create a fresh fixture with
test-repository.mjsortest-ecosystem.mjs, then select packages explicitly:The diagnostic reads the original installation's current lockfile and maps the selected package instances to their locked contexts. It reuses pnpm's lockfile pruning and serialization utilities to prepare a separate installation, then runs
pnpm install --frozen-lockfile --ignore-scriptswith the global virtual store enabled. It does not re-resolve versions or run project hooks; the snapshots already include hook results. The installed graph includes required dependencies and the optional dependencies applicable to the target platform.The generated
.pnpm-gvs.jsonpoints the installed closure at normal GVS entries with native resolution.gvs-results.jsonrecords the selection, physical roots, skipped optional dependencies, dependencies exposed by the source installation but absent from its locked graph, and the suite's exit status. The copied application tree is checked fornode_modulesbefore and after execution. GVS and the retained staging installation are outside that tree and do containnode_modules.This repository-only diagnostic requires compiled pnpm workspace utilities and an installed pnpm v12 CLI. It currently rejects opt-out trees containing local file or workspace links. In particular, Vite's Vitest depends on the local Vite workspace, so that probe cannot use this diagnostic yet. Lifecycle scripts are disabled in the experiment; packages requiring uncached build outputs need a separately authorized normal build.
On the pinned repositories above, opting out
vitestinstalled 136 package instances for Vue; all 445 reactivity tests passed with 4 existing skips. Svelte's opt-out installed 128 package instances, but its suite still stopped at the application dependencyesm-env, outside Vitest's tree.The pnpm parser suite passed all 51 tests with these explicit selections:
Those names select 18 installed instances and map their closures to 360 distinct GVS directories for 362 manifest instances. Jest alone still failed on direct filesystem reads of test setup dependencies. These are scoped compatibility checks, not full repository-suite passes.
Written by an agent (Codex, GPT-6).
zkochan commentedon Oct 5, 2026
Additional compatibility finding from review of pnpm/pnpm#16482: patch-package requires application node_modules paths. Its package-details parser constructs node_modules/package (and nested node_modules paths), and the patch application checks that physical path. This is a source inspection, not a successful executable probe.
Evidence: https://github.com/pnpm/patch-package/blob/c97a62eab19011781304d612a77159393f489d0f/src/PackageDetails.ts and https://github.com/pnpm/patch-package/blob/c97a62eab19011781304d612a77159393f489d0f/src/applyPatches.ts.
Materializing patch-package itself or its target in the global virtual store does not supply those application paths. The current experimental loader does not emulate application fs calls. pnpm's existing patchedDependencies flow is included in the installer integration and materializes patched package trees automatically.
For this task's compatibility evaluation, keep patch-package classified as requiring integration. A future probe should cover patch creation, application, and reinstall behavior through the loaded manifest, and ensure it does not mutate shared GVS entries in place. Do not treat the current PR as proving compatibility with this tool.
Written by an agent (Codex, GPT-6).
feat(install): add loaded linker with GVS exclusions (#16482)