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 linked-store alias copies left unpatched (#852) by mikolalysenko · Pull Request #987 · SocketDev/socket-patch Conversation
|
| Issue | Variant | Test | Before → after |
|---|---|---|---|
| #852 | alias + plain copy (also scoped alias name, other-version alias ignored, link-only entry ignored) | npm_crawler::tests::test_npm_linked_store_alias_entry_beside_a_plain_copy_is_a_copy |
FAILED → ok |
| #852 | alias only (also unscoped alias of a scoped package) | npm_crawler::tests::test_npm_linked_store_alias_only_install_is_resolved |
FAILED → ok |
| #852 | vex every-copy rule, new npm linked-store alias entry (#852) layout |
e2e_vex::verify_mode_requires_every_store_copy_patched |
FAILED on main's crawler ("an unpatched store copy must keep the purl out of the VEX doc") → ok |
The issue's repro with a real npm 10.9.4 / Node 22 install-strategy=linked install and the hand-staged [email protected] patch, run with a binary built from main and one built from this branch:
| case | main | this PR |
|---|---|---|
| alias + plain | apply "1 of 1 applied"; vex not_affected; lp unpatched |
apply 1 of 1; vex not_affected; left-pad and lp both patched |
| alias only | apply "1 not found on disk"; vex exit 1, omitted as not installed; lp unpatched |
apply 1 of 1; vex not_affected; lp patched |
rollback --offline --yes on the alias + plain case restores both copies.
Commands run locally:
cargo clippy --workspace --all-features -- -D warnings: clean.cargo fmt --all -- --check: no diffs in files this PR touches. The local rustfmt reports existing diffs in files this PR doesn't touch.cargo test -p socket-patch-core --all-features --lib: 5247 passed, 5 failed.
chmod can't make a dir read-only: 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.main digest guard, passes after the port.cargo test -p socket-patch-core --all-features --test crawler_npm_e2e --test covgap_crawlers_npm_crawler: 93 passed.cargo test -p socket-patch-cli --all-features --test e2e_vex: 19 passed.cargo test --workspace --all-features couldn't finish here: it hit the sandbox's disk allowance while linking test binaries, with no test failures. CI runs the full matrix.🤖 Generated with Claude Code
https://claude.ai/code/session_01RL7etZZRZ4tKZVNsPFD3KL
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
With npm 9-11's install-strategy=linked, an alias install such as "lp": "npm:[email protected]" lives in a store entry named after the alias (node_modules/.store/[email protected]<hash>/node_modules/lp). Agent mode only looked for node_modules/left-pad inside store entries, so: - beside a plain left-pad copy, apply patched only the plain copy and exited 0, and vex attested not_affected while require('lp') still loaded unpatched code; - with only the alias installed, apply reported the package "not found on disk" and vex refused with package_not_found. The resolver now searches npm linked-store entries for alias copies the same way it searches an importer tree. The store variant fan-out used by apply, rollback and vex also probes a same-version entry under another name at its own dir. In both cases the entry's package.json stays the authority on name and version. Fixes #852 Assisted-by: Claude Code:claude-opus-5-5
main has failed socket-patch-core's lib tests since Gradle support (#646) and the digest helpers (#865) both landed. The guard test production_digests_go_through_the_helpers flags three files #646 added that still hash inline: crawlers/gradle_cache.rs, patch/jvm_jar.rs and patch/sidecars/maven.rs. That breaks test, test-release and coverage on every open PR. Each inline sha1/sha256 call now goes through sha1_hex_of or sha256_hex_of, which compute the same lowercase hex. Behaviour is unchanged. Assisted-by: Claude Code:claude-opus-5-5 (cherry picked from commit 659ac2c)
|
BugBot review 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 87bbd60. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
[agent] Resolved: both one-time re-runs passed on Original note: two CI jobs failed on
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] Ready for review at
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 misses an npm-aliased copy under install-strategy=linked (node_modules/.store/lp@…), so apply exits 0 with it unpatched and VEX attests not_affected
There was an error while loading. Please reload this page.