GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — Fix npm alias links missed from a member (#1494) by mikolalysenko · Pull Request #1500 · SocketDev/socket-patch Conversation
|
| Issue | Test | Without fix | With fix |
|---|---|---|---|
#1494 (vlt, pnpm, npm .store) |
apply::in_process_npm_multicopy::apply_and_rollback_reach_a_member_alias_link_from_the_member: apply, re-apply and rollback from the member, then apply and rollback from the root (one visit) |
FAILED: package_not_installed, partialFailure |
ok |
| #1494 (unit) | ecosystem_dispatch::tests::multi_copy_lookups_take_a_member_alias_link_into_the_root_store |
FAILED | ok |
Bugbot: --check misses member alias |
the member test's apply --check step |
FAILED: package_not_installed |
ok |
| review finding (#633 regression) | apply::in_process_npm_multicopy::apply_and_rollback_visit_a_member_alias_peer_variant_once |
FAILED against the first fix commit (0a81315) | ok |
I also reproduced the issue with real pnpm 10.28: a workspace with packages/a depending on "lp": "npm:[email protected]" and a hand-staged manifest. Run from packages/a with the fixed binary, apply --offline exits 0 with applied, and the root store's left-pad/index.js is patched (require.resolve('lp') resolves to it). rollback then gives success with rolledBack: 1 and restores the bytes.
Local runs:
cargo fmt --all -- --check: cleancargo clippy --workspace --all-features -- -D warnings: cleancargo test -p socket-patch-core -p socket-patch-cli --all-features --lib --test apply --test rollback --test scan --test get --test in_process_vendor --test cli: every CLI target passes (920 lib, 135 apply, 111 rollback, 87, 133, 59, 131). 4 socket-patch-core lib tests fail locally because they rely on read-only permissions and this sandbox runs as root (e.g. copy_tree::relax_loop_must_not_traverse_symlinked_root: "removal cannot succeed under a read-only parent"). This PR doesn't touch core, so CI is the check there.cargo test --workspace ran out of this sandbox's disk allowance while linking test binaries, so I ran the targeted suites above instead. CI covers the rest.get_node_modules_paths errors are swallowed and the walk is retried": this was already the behavior in path scoping, and NpmCrawler::get_node_modules_paths always returns Ok, so there's no real failure path.🤖 Generated with Claude Code
https://claude.ai/code/session_0195pcxXZ2GXtByX1L8egMhJ
Note
Medium Risk
Changes core npm package discovery for apply, rollback, check, and vex; behavior is gated to unresolved PURLs and covered by extensive regression tests for #633 and #1494.
Overview
Fixes #1494: when apply, rollback, apply --check, or vex run from a workspace member, npm alias dependencies that only exist as a root node_modules symlink (vlt/pnpm/npm linked layouts) are no longer reported as package_not_installed.
Package resolution now goes through shared dispatch_find_with_npm_links, which runs the normal crawl and then optionally appends matching root-level symlinks via npm_links_to. Copy lookups (find_all_packages_for_purls, rollback variants, find_manifest_package_copies_reusing) use NpmLinks::ForUnresolved so links are added only when the crawler found no install path—avoiding a second visit when the root store copy already exists (#633 phantom already_patched). Path scoping still uses NpmLinks::All (#1266).
Tests cover member-alias apply/rollback/check across store layouts, resolver behavior from member vs root, and peer-variant alias links visited once from the repo root.
Reviewed by Cursor Bugbot for commit 6104e76. Configure here.
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
Run from inside a vlt, pnpm or npm-linked workspace member, apply
reported a member's npm alias dependency ("lp": "npm:[email protected]")
as package_not_installed and exited 1, and rollback could not restore
it, although scan had offered the patch. The member's node_modules is
the only root walked there, and its alias entry is only a link into
the root store, which the resolver never takes as a copy.
Apply's and rollback's lookups now add the root links whose target is
a requested package, the same pass path scoping got in #1470. Both
commands already act on each physical copy once, so a run from the
root still patches the store copy a single time.
Fixes #1494
Assisted-by: Claude Code:claude-opus-5-5
Apply, rollback, get and vendor now take a workspace member's alias link only for a package they found no other copy of. When a copy was found, apply already patches every store variant of it, so taking the link as well visited one variant twice and reported a phantom already_patched (or already-original on rollback). It also kept a first-party alias link beside a patched registry copy from turning a clean run into a refusal, and skips the link pass whenever every package resolves. Path-scoped scan and rollback still match every link. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Run from a workspace member, apply now patches an alias dependency through the member's link into the root store, but apply --check and vex looked copies up without that link. The check reported the package as not installed and exited 0. They now use the same lookup as apply, which takes a root link only for a package with no other copy. Two vex_consumed tests assumed the resolver never returns a link. They now check that it returns the same copies the identity fallback finds. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0195pcxXZ2GXtByX1L8egMhJ
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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 6104e76. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ready for review (burn-down agent)
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Agent-mode scan run from a vlt (or pnpm) workspace member fails package_not_installed for the member's npm-alias dependency, while the same alias patches from the root
There was an error while loading. Please reload this page.