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 agent vex checking only one installed copy (#516) by mikolalysenko · Pull Request #517 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 2, 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 #516

Root cause

vex resolves every installed copy of each manifest PURL (find_manifest_package_copies_reusing), but then collapse_to_first dropped all but the first before the agent-record hash check (applied_patches_with_vendor). apply patches every copy, and hosted PURLs were already judged against every copy (HostedCopies). Agent records were not. So when a later install adds a fresh, unpatched nested copy of the same name@version, vex attested not_affected whenever the first crawled copy happened to be patched.

Change

  • vex::verify::applied_patches_with_copies (new) takes purl -> Vec<PathBuf>, meaning every installed copy. An installed-tree record verifies only when every copy verifies, and the first failing copy's tag wins, using the same verify_every_copy helper that HostedCopies now shares. An empty list means package_not_found. The vendored drift probe (vendored_tree_out_of_sync) flags the PURL when any copy is out of sync. applied_patches_with_vendor stays as a one-copy wrapper, so its existing callers and tests are unchanged.
  • commands/vex.rs passes the full copy map instead of collapse_to_first(...).
  • CLI_CONTRACT.md's verification table states the every-copy rule for agent records.

Hosted, vendored and Go-redirect evidence are unchanged; each already has its own copy selection. The npm, PyPI and gem wrappers only dispatch to the binary, so they need no change.

Test evidence

Issue Regression test Red before fix → green after
#516 e2e_vex::verify_mode_requires_every_installed_copy_patched: two nested copies of [email protected], one patched; both crawl orders must omit the PURL (not_applied, non-zero exit), and all copies patched must attest Red: with commands/vex.rs reverted to collapse_to_first, the test panics at e2e_vex.rs:965 (patched-first order attested). Green with the fix.
#516 (core) vex::verify::tests::every_installed_copy_must_verify, empty_copy_list_is_package_not_found, vendored_drift_probe_checks_every_installed_copy Green

Commands run locally:

  • cargo clippy --workspace --all-features -- -D warnings: clean.
  • cargo test -p socket-patch-core --lib vex::verify: 36 passed.
  • cargo test -p socket-patch-cli --all-features --test e2e_vex --test e2e_vex_vendor --test e2e_vex_redirect --test covgap_commands_vex: all passed.
  • cargo test --workspace --all-features --no-fail-fast: 9472 passed, 12 failed. All 12 failures are write-failure and permission fixtures (chmod 0o555 / unremovable-file tests in covgap_commands_vendor, in_process_redirect, repair, and four core lib tests). They can't fail as uid 0, which is what this sandbox runs as, and none of them touch vex. CI runs them as a non-root user.
  • cargo fmt --check on the touched files is clean. main itself isn't rustfmt-clean (about 460 diffs) and CI doesn't run fmt, so this PR formats only its own hunks.

CI note: Poetry 1.0.10 (macOS) crlf/hosted failed rescanIdempotent once. That's a hosted rescan against the live patch API, a path this diff doesn't touch. It passed on the one re-run.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZjqW5PYJWkPpisnhaS4zi


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 #516
d3c6705
Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 2, 2026
Agent-mode npm vex hashes only the first installed copy of a package, so it attests not_affected while another nested copy of the same name@version is unpatched #516
Closed
Claude (claude) added 2 commits October 2, 2026 00:34
@claude
Check every installed copy before vex attests
6cdb3c4
When a project holds several installed copies of the same
package@version (npm nests duplicates, and a later install can add a
fresh unpatched one), `vex` only hashed the first copy it found. It
could then attest a patch as not_affected while another copy that a
dependent loads was still unpatched.

Agent-mode records are now attested only when every installed copy
matches the patched bytes, the same rule `apply` follows when it
patches and that hosted records already use. The vendored drift
warning also checks every copy.

Fixes #516

Assisted-by: Claude Code:claude-opus-5-5
@claude
Document every-copy rule for agent vex records
0f45d24
Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 2, 2026 00:54
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 2, 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 2, 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 0f45d24. 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 2, 2026
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Ready for review — head 0f45d24e6bbc0217d4bb296584ab92fe0a772018.

  • CI: all check runs green on the head (0 failing; only skipped/conditional jobs not run). Mergeable, up to date with main.
  • Bugbot: reviewed 0f45d24 — no issues found. No open review threads.
  • Reviewer focus: vex::verify::applied_patches_with_copies now requires every installed copy of an agent-record PURL to verify (first failing copy's tag wins); commands/vex.rs stops collapsing to the first crawled copy. Regression test: e2e_vex::verify_mode_requires_every_installed_copy_patched.

Generated by Claude Code

All reactions

Sorry, something went wrong.

Uh oh!

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

This was referenced Oct 2, 2026
With several Poetry envs for one project (poetry env use on two Python minors), agent mode patches the alphabetically first env instead of the one Poetry activated, and VEX attests not_affected #526
Closed
Fix Poetry venv selection ignoring envs.toml (#476, #526) #527
Merged
Agent mode patches only the WORKON_HOME venv when a Pipenv project also has an auto-detected ./.venv, so Pipenv 2018–2026.1 keep running the unpatched .venv and VEX attests not_affected (regression from #388) #529
Closed
Fix PyPI agent apply patching only one installed copy (#529, #501) #538
Merged
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed 0f45d24e6bbc0217d4bb296584ab92fe0a772018. Recommendation: ready to merge from a code-review perspective.

No actionable correctness or security regressions found. The CLI passes all discovered copies through verification; empty copy lists fail closed, hosted/vendor precedence stays intact, and the vendor drift warning covers later copies.

Validation: cargo test -p socket-patch-core --lib vex::verify: 36 passed. cargo test -p socket-patch-cli --test e2e_vex verify_mode_requires_every_installed_copy_patched: Passed, including both crawl orders and the all-patched control. Full workspace matrix not rerun.

All reactions

Sorry, something went wrong.

Uh oh!

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

@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Second review pass of 0f45d24e6bbc0217d4bb296584ab92fe0a772018: ready from code review. Every-copy agent verification still fails closed for empty or partly unpatched copy sets. Hosted/vendor precedence and the single-copy API wrapper are preserved. Current main has no competing edits to the changed verification/CLI paths; its PyPI multi-copy apply fix aligns with this requirement.

The head is unchanged from the prior review, discussions introduce no unresolved finding, and it merges cleanly with current main 73b17db5. Prior exact-head validation: 36 core vex::verify tests and the real CLI every-installed-copy regression passed, including both crawl orders and the all-patched control. No duplicate broad test run or code changes were needed for this pass.

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 2, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit 3757e27 into main Oct 2, 2026
519 of 520 checks passed

Uh oh!

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

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/fix-vex-agent-all-copies branch October 2, 2026 17:26
This was referenced Oct 2, 2026
npm agent-mode apply never patches an npm-aliased install (lp@npm:left-pad), yet VEX attests the package not_affected #356
Closed
Agent-mode apply skips a bundled copy inside another vlt/pnpm store entry whenever the package is also installed normally, and VEX attests not_affected #601
Closed
Agent-mode vex still attests not_affected when a Deno .deno/<name>@<ver>_1 copy is unpatched: the #517 every-copy check never sees store peer-variant copies #603
Closed
Agent-mode cargo apply patches only the first of several registry/src index dirs (cargo 1.84 vs 1.85+ hashes), so one cargo keeps building the unpatched crate while apply and VEX report success #339
Closed
Gem vex checks the gem env gemdir copy instead of the Gem.path copy Ruby loads, so it attests not_affected while an unpatched --user-install / GEM_PATH copy runs #420
Closed
With Bun's globalStore (Bun ≥ 1.3.14), agent mode patches and rolls back every other project sharing the store, and vex attests unpatched transitive copies as not_affected #635
Closed
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.

Agent-mode npm vex hashes only the first installed copy of a package, so it attests not_affected while another nested copy of the same name@version is 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 01402503 — 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.