GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix pnpm modulesDir store being skipped (#661, #696) by mikolalysenko · Pull Request #698 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:claude-opus-5-5

Fixes #661
Fixes #696

Summary

pnpm projects that set modulesDir (pnpm 10.12+) are now patched and attested correctly:

  • Agent mode ignores pnpm's modulesDir: on pnpm 10.12+ every installed package is "not installed", and apply exits 0 leaving it unpatched #661: agent apply patches the copy pnpm installed under <modulesDir>/.pnpm. Before, it exited 0 with the package unpatched as "not installed".
  • Hosted pnpm vex attests not_affected over an unpatched install when pnpm's modulesDir is set (pnpm 10.12+), because the missed install is treated as "nothing installed" #696: hosted standalone vex hash-checks that copy and omits an unpatched one. Before, it attested not_affected from the lock pin.
  • Hosted pnpm vex attests not_affected over an unpatched install when pnpm's modulesDir is set (pnpm 10.12+), because the missed install is treated as "nothing installed" #696, follow-up variants from the issue comment: hosted vex no longer attests a pinned npm package from the lock when the installed pnpm tree keeps its virtual store outside the project (enableGlobalVirtualStore, or a virtualStoreDir that climbs out). A transitive dep there is invisible to the crawler, so "not found" doesn't mean "not installed".

Root cause

pnpm's modulesDir (modulesDir: in pnpm-workspace.yaml, modules-dir= in .npmrc) renames node_modules. From pnpm 10.12 the virtual store moves with it. The npm crawler only collects directories literally named node_modules, plus the roots in configured_install_roots (yarn --modules-folder, Rush). It never read modulesDir. The miss surfaced as the lockfile-only "not installed" skip in agent mode (#661), and the hosted lockfile_basis exemption turned it into an attestation in vex (#696). The same exemption also excused every other crawler blind spot, such as pnpm stores outside the project.

Changes

  • crawlers/npm_crawler.rs
    • configured_install_roots now includes pnpm's modules dirs:
      • the configured modulesDir: nearest pnpm-workspace.yaml first, else the nearest .npmrc modules-dir. It is resolved per project, like pnpm does, and honored only strictly inside the project (same guard as yarn's modules folder).
      • any direct child dir holding pnpm's .modules.yaml install record. This catches a modulesDir that came from pnpm's global config or the environment.
    • New pnpm_store_outside_project: true when a .modules.yaml in node_modules or a pnpm modules dir records a virtualStoreDir outside the project.
  • commands/vex.rs: the hosted lockfile_basis exemption no longer excuses package_not_found for pkg:npm/ purls when pnpm_store_outside_project holds. With nothing installed (no .modules.yaml) the lock basis still attests, as before.
  • CLI_CONTRACT.md (manifest-less VEX hosted row) and CHANGELOG.md document the new behavior.
  • No wrapper changes needed: npm/, pypi/ and gem/ only dispatch to the binary.

Test evidence

Red → green: each new test was run with the source fix reverted (tests kept) and failed, then passed with the fix.

Issue Test Without fix With fix
#661 core test_pnpm_modules_dir_is_a_crawl_root (workspace yaml, quoted/commented yaml key, .npmrc, .modules.yaml probe) FAILED ok
#661 core test_pnpm_modules_dir_setting_resolution (workspace member, yaml beats .npmrc, out-of-project values refused) FAILED ok
#661 cli in_process_alternate_installers::pnpm_modules_dir_install_is_patched (yaml and .npmrc) FAILED (apply exit 0, file unpatched: the reported symptom) ok
#661 cli in_process_alternate_installers::pnpm_modules_dir_install_then_apply_patches_file (real pnpm install; skips if pnpm < 10.12) n/a (new real-toolchain leg) ok on pnpm 10.28.0
#696 cli e2e_vex_redirect::pnpm_modules_dir_install_is_hash_verified_not_lockfile_attested FAILED (exit 0 attested) ok: hash_mismatch, exit 1; patched copy attests; nothing installed attests
#696 core test_pnpm_store_outside_project FAILED ok
#696 cli e2e_vex_redirect::pnpm_store_outside_project_is_not_lockfile_attested (GVS-style outside store, in-project store control, nothing-installed control) FAILED (exit 0 attested) ok

Local runs on Linux, Rust 1.93.1:

  • cargo clippy --workspace --all-features -- -D warnings: clean.
  • cargo fmt: the changed files are fmt-clean. main itself isn't fmt-clean under this toolchain and CI doesn't run fmt, so I left unrelated files untouched.
  • cargo test --workspace --all-features --no-fail-fast: 9731 passed, 12 failed, 253 ignored. All 12 failures are write-failure / unremovable-file simulations that depend on chmod denying writes. This sandbox runs as root (uid 0), which bypasses that. The 4 core-lib ones (copy_tree::relax_loop_must_not_traverse_symlinked_root, vlt_heal::an_unremovable_hidden_lock_keeps_every_store_entry, pypi_poetry::wire_write_failure_maps_error_and_leaves_lock_untouched, pypi_requirements::wire_failure_rolls_back_already_written_files) fail identically on origin/main. The others are in covgap_commands_vendor, in_process_redirect and repair, none of which touch the npm crawler or the vex exemption. CI runs non-root.

Follow-ups / not covered

  • In agent mode, a transitive dep that lives only in pnpm's global virtual store is still not patched in place. That is deliberate (shared store, Agent-mode apply and rollback on a pnpm project with enableGlobalVirtualStore patch (and unpatch) every other project that shares the store #361/Agent mode ignores pnpm's virtualStoreDir: transitive dependencies are reported package_not_installed with a custom virtualStoreDir or the global virtual store #362) and not part of these issues.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JKwbXnQ94oRf1r94V1yupy


Note

Medium Risk
Changes npm discovery and hosted VEX attestation for pnpm layouts; incorrect handling could miss patches or over-attest, but behavior is narrowly scoped and heavily regression-tested.

Overview
Fixes pnpm modulesDir layouts (pnpm 10.12+ puts the virtual store under <modulesDir>/.pnpm with no node_modules). The npm crawler now treats configured modulesDir (pnpm-workspace.yaml / .npmrc) and child dirs with .modules.yaml as install roots, so agent apply patches those store copies instead of treating them as not installed (#661).

Hosted vex hash-checks installs under that layout. It also stops using lockfile-only attestation for pkg:npm/ when .modules.yaml records a virtualStoreDir outside the project (global virtual store or an escaping path), because transitive deps there are invisible to the crawler (#696). With nothing installed, lock-pin attestation is unchanged.

CLI_CONTRACT.md and CHANGELOG.md document the behavior; new unit and e2e tests cover crawl roots, setting resolution, apply, and vex outcomes.

Reviewed by Cursor Bugbot for commit f548ad0. Configure here.


Generated by Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@claude
Start fix for #661, #696
ad4e100
Assisted-by: Claude Code:claude-opus-5-5
This was referenced Oct 3, 2026
Agent mode ignores pnpm's modulesDir: on pnpm 10.12+ every installed package is "not installed", and apply exits 0 leaving it unpatched #661
Closed
Hosted pnpm vex attests not_affected over an unpatched install when pnpm's modulesDir is set (pnpm 10.12+), because the missed install is treated as "nothing installed" #696
Closed
Claude (claude) added 2 commits October 3, 2026 13:40
@claude
Find installs in pnpm's modulesDir
c2c9607
pnpm 10.12+ with `modulesDir` set installs into `<modulesDir>/.pnpm`
and leaves no node_modules, so agent apply skipped every package as
"not installed" and exited 0 unpatched, and hosted vex attested
not_affected over the unpatched install. The crawler now treats the
configured modulesDir (pnpm-workspace.yaml or .npmrc), or a project
dir holding pnpm's .modules.yaml, as an install root.

Hosted vex also stops excusing a missing npm package as "nothing
installed" when pnpm keeps the installed virtual store outside the
project (global virtual store, or a virtualStoreDir that climbs
out), since transitive deps there are invisible to the crawler.

Fixes #661, #696.

Assisted-by: Claude Code:claude-opus-5-5
@claude
Test real pnpm modulesDir; document it
f548ad0
Adds a real-pnpm leg that installs with `modulesDir: deps` and checks
agent apply patches the `deps/.pnpm` store copy, and records the new
behavior in CLI_CONTRACT.md and the CHANGELOG.

Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 3, 2026 14:08
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Oct 3, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit f548ad0. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 3, 2026
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

[burn-down agent] Ready for review at head f548ad0dc35c8a8cb55d03c71b79b311d17ded4b.

  • CI: 491/491 check runs green (success/skipped) on f548ad0.
  • Bugbot: reviewed f548ad0 — no findings; no unresolved review threads.
  • Mergeable: yes, up to date with main.
  • Reviewer focus: npm_crawler.rs modulesDir/.modules.yaml root detection, and the vex.rs change that stops lock-only attestation when virtualStoreDir escapes the project.

Slack announcement not sent this run (Slack send tool unavailable).


Generated by Claude Code

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Tanmay182003
Tanmay Singla (Tanmay182003) approved these changes Oct 5, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit e5a6cbc into main Oct 5, 2026
492 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/fix-pnpm-modules-dir-crawl branch October 5, 2026 11:23
Mikola Lysenko (mikolalysenko) pushed a commit that referenced this pull request Oct 5, 2026
@claude
Merge main into agent/fix-npm-store-copy-enumeration
62534c5
Resolves conflicts with main's npm alias (#738), first-party link
(#634) and pnpm store (#698) changes:

- CLI_CONTRACT.md: keep main's hosted row and this PR's agent row.
- vex_consumed.rs: drop aliases the installed lookup already found
  (main), then store-expand only the new ones (this PR), so already
  expanded copies are not scanned again.
- Tests: keep both sides' new multicopy and e2e_vex regressions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0174mrknEY9ge42c94RNRRBx
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 8, 2026
pnpm node-linker=pnp with a modulesDir is refused as yarn Plug'n'Play, because the layout detector ignores the modulesDir the crawler honors #1129
Closed
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@Tanmay182003 Tanmay Singla (Tanmay182003) Tanmay182003 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Hosted pnpm vex attests not_affected over an unpatched install when pnpm's modulesDir is set (pnpm 10.12+), because the missed install is treated as "nothing installed" Agent mode ignores pnpm's modulesDir: on pnpm 10.12+ every installed package is "not installed", and apply exits 0 leaving it unpatched

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mikolalysenko @Tanmay182003 @claude
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.