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 vendor --check unwired cause and remedy (#900) by mikolalysenko · Pull Request #970 · SocketDev/socket-patch

Conversation

@mikolalysenko

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

Root cause

Discovery::vendor_entry_live returns a bare bool. It is false in three different situations:

  1. Contested. Another lock resolves the same version from elsewhere, e.g. package-lock.json resolving from the registry beside a wired yarn.lock / bun.lock. contest_across_locks dropped the ref and kept only a diagnostic.
  2. Removed. The dependency left the lock (npm uninstall or an upgrade).
  3. Wiring dropped. A relock dropped the .socket/vendor/ reference, but the package is still in the lock.

vendor --check always printed the case-3 text: "no lockfile or config references … any more, so a fresh install gets the unpatched package; re-run socket-patch vendor to rewire it". In cases 1 and 2 that text is false, and vendor, scan and repair are all no-ops, so the CI gate stayed red for good. vex added the same "no lockfile or config wires it" phrase after its correct patched_ref_unattributable warning.

Fix

  • Core (vex/discover/mod.rs)
    • Discovery now keeps the refs it drops as contested (contested: Vec<ContestedRef>, recorded in contest_across_locks).
    • New Discovery::vendored_contest(purl, uuid) returns the contest that killed a vendored claim.
    • New Discovery::resolves_package(purl) says whether any lock resolves the package at all.
    • The golden renderer covers the new field. One golden gained a contested entry: the existing package-lock vs vlt-lock contest fixture.
  • vendor --check (commands/vendor.rs, unwired_check_failure)
    • Contested: reports wiring contested: <lock> wires .socket/vendor/<eco>/<uuid>, but <other> resolves the same version from elsewhere …; delete whichever of the two locks the project does not install from. It still fails, because an install from the other lock is unpatched.
    • Removed (npm and PyPI only, because only those extractors record every lock entry): when no lock resolves the package and the prune GC's in-use probe answers Some(false), it reports dependency removed: no lockfile resolves <purl> any more …; run socket-patch scan --mode vendored --prune. vendor --check fails a vendored package whose lock is contested by a sibling package-lock.json with "no lockfile or config references .socket/vendor/… any more", which is false, and its remedy ("re-run socket-patch vendor") is a no-op, so the check stays red forever #900 verified that remedy, and it matches scan's own vendor_ledger_entry_unwired hint.
    • Anything else keeps the existing text.
  • vex: the vendor_unwired phrase no longer claims nothing wires the artifact. It names the three causes, so it no longer contradicts the contest warning printed just before it. The reason code is unchanged.
  • CLI_CONTRACT.md: the vendor --check section documents the two new reasons.
  • The npm, PyPI and gem wrappers only dispatch to the binary, so they need no change.
  • Ported c831b63: a cherry-pick of Route Gradle digests through utils::digest #878's 659ac2c, which fixes main's red utils::digest guard test. It becomes a no-op once Route Gradle digests through utils::digest #878 lands. See the PR comment.

Tests (red → green)

Issue / trigger Test Without fix With fix
#900 contested lock (issue body) in_process_vendor::vendor_check_names_contesting_lock FAILED (wiring missing: no lockfile or config references …) ok
#900 npm uninstall (follow-up comment) in_process_vendor::vendor_check_names_removed_dependency_and_prune_remedy FAILED (same false message) ok
core contest record vex::discover::tests::a_ref_another_lock_resolves_elsewhere_is_contested (extended) does not compile (no API) ok

The existing vendor_check_fails_when_lock_no_longer_wires_artifact test (#725, case 3) still passes, with its message unchanged.

Local runs:

  • cargo clippy --workspace --all-features -- -D warnings: clean.
  • cargo test --workspace --all-features --no-fail-fast: everything passes except 12 permission-denial / unwritable-file tests, all in files this PR doesn't touch. They fail because this sandbox runs as root, where chmod 0o555 doesn't block writes. The same 12 fail identically on unmodified main 9c43dfc in the same container: 4 in core --lib, 3 each in covgap_commands_vendor and in_process_redirect, and 2 in repair. CI runs as a non-root user.
  • cargo fmt: only the hunks this PR touches are formatted. main isn't rustfmt-clean under the pinned 1.93.1 toolchain (123 files differ), and CI has no fmt gate, so unrelated files are left alone.

CI: every check on c831b63 is green, including gradle 8.14.3 / jdk 21 / vendor / windows-latest. That job failed the first time on a Maven Central HTTP 403 and passed when re-run once. Bugbot's review of c831b63 found no issues.

Follow-ups

  • After an uninstall, npm 8 (lockfileVersion 2) drops resolved from the legacy mirror. That's Vendored npm vex and vendor --check fail after any npm 7–10 npm install on a lockfileVersion 2 lock, because npm drops resolved from the legacy mirror and #813 treats that as an unpatched npm 6 install (regression) #879's root cause and out of scope here.

🤖 Generated with Claude Code

https://claude.ai/code/session_01U5HBJbvvfmhkxErLkvp4rP


Note

Medium Risk
Changes discovery contest bookkeeping and vendor-check failure text that CI gates rely on; behavior is corrective but alters when users see which remedy applies.

Overview
Fixes #900 by making vendor --check and related messaging distinguish three “unwired” vendored-ledger cases instead of always blaming dropped wiring and suggesting socket-patch vendor.

Discovery now keeps cross-lock contests as ContestedRef entries (with vendored_contest and resolves_package) when a ref is dropped because another lock resolves the same version elsewhere.

vendor --check routes dead entries through unwired_check_failure, which emits wiring contested (names both locks; delete the stale one), dependency removed for npm/PyPI when nothing resolves the package (points to scan --mode vendored --prune), or the existing wiring missing / re-vendor text. vex’s vendor_unwired copy is aligned so it no longer contradicts contest diagnostics. CLI contract documents the new reasons; regression tests cover contested locks and post-npm uninstall.

A small digest helper refactor in JVM/Gradle paths (sha1_hex_of / sha256_hex_of) rides along with the fix.

Reviewed by Cursor Bugbot for commit c831b63. 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 #900
1f6349c
Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 7, 2026
vendor --check fails a vendored package whose lock is contested by a sibling package-lock.json with "no lockfile or config references .socket/vendor/… any more", which is false, and its remedy ("re-run socket-patch vendor") is a no-op, so the check stays red forever #900
Closed
Claude (claude) added 3 commits October 7, 2026 00:35
@claude
Name the real cause when vendor --check fails
d38360d
`vendor --check` reported every dead vendored entry as "no lockfile or
config references .socket/vendor/... any more; re-run `socket-patch
vendor`". In two common cases that was false and the remedy did
nothing, so the CI gate stayed red for good:

- Another lock (e.g. package-lock.json beside a wired yarn.lock or
  bun.lock) resolves the same version from the registry. The check now
  says the wiring is contested, names both locks, and says to delete
  the lock the project does not install from.
- The dependency left the lock (`npm uninstall` or an upgrade). The
  check now says the dependency was removed and points at
  `socket-patch scan --mode vendored --prune`, the command that reverts
  the entry. This matches scan's own hint.

Discovery now keeps the refs it drops as contested, so callers can
name the contesting lock. `vex`'s vendor_unwired phrase no longer
claims nothing wires the artifact when the cause is a contest or a
removed dependency.

Fixes #900

Assisted-by: Claude Code:claude-opus-5-5
@claude
Document vendor --check cause-specific reasons
bd5bf65
Assisted-by: Claude Code:claude-opus-5-5
@claude
Route Gradle digests through utils::digest
c831b63
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)
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author

[agent] test (macos-latest) failed on the empty start commit 1f6349c. The failure is utils::digest::tests::production_digests_go_through_the_helpers in socket-patch-core --lib, and it isn't from this PR: that commit's tree is identical to main 9c43dfc. #646's Gradle code hashes inline, but #865's guard test requires the utils::digest helpers. #878 fixes it and is green.

I ported that fix here as c831b63 (a cherry-pick of #878's 659ac2c), so CI can go green on this head. Once #878 lands on main, the commit has no effect.


Generated by Claude Code

All reactions

Sorry, something went wrong.

Uh oh!

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

@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author

[agent] gradle 8.14.3 / jdk 21 / vendor / windows-latest failed on c831b63, and the cause isn't in this PR. Both failing tests stopped before reaching any socket-patch code, because Maven Central returned HTTP 403 to the Windows runner:

  • gradle_vendor_395_mixed_root: Maven couldn't resolve maven-dependency-plugin:3.5.0 (status code: 403).
  • gradle_multi_project_vendor_locked_offline_tamper_and_byte_exact_revert: Gradle couldn't GET commons-text-1.10.0.pom (Received status code 403 from server: Forbidden).

This PR doesn't change Gradle, Maven or network code, and the vendored-Gradle runs on the other OSes pass. There's no fix to port, since this is an outage in an external registry. I'll re-run the failed jobs once when the workflow run finishes. It's still running, so GitHub refuses the re-run for now.


Generated by Claude Code

All reactions

Sorry, something went wrong.

Uh oh!

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

@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 7, 2026 01:00
@mikolalysenko

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

Mikola Lysenko (mikolalysenko) commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator Author

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

  • CI: all required checks green on c831b63 (no failures; only skipped/conditional jobs not run).
  • Bugbot: reviewed c831b63, no findings; no unresolved review threads.
  • Mergeable, 0 commits behind main.
  • Reviewer note: c831b63 is a cherry-pick of Route Gradle digests through utils::digest #878's 659ac2c (fixes main's red utils::digest guard test) and becomes a no-op once Route Gradle digests through utils::digest #878 merges.

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 7, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit 93e2b5c into main Oct 7, 2026
599 of 600 checks passed

Uh oh!

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

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/fix-vendor-check-unwired-cause branch October 7, 2026 12:08
This was referenced Oct 7, 2026
Vendored npm vex and vendor --check fail after any npm 7–10 npm install on a lockfileVersion 2 lock, because npm drops resolved from the legacy mirror and #813 treats that as an unpatched npm 6 install (regression) #879
Closed
After bun remove of a vendored package in a bun.lockb project, scan --prune, vendor --revert and remove keep it as "drifted", so vendor --check stays red and its remedy loops #1132
Closed
After npm install <pkg>@<other version> moves a vendored npm package off its patched version, scan --prune, vendor --revert, remove and rollback all drift-keep it, so vendor --check stays red and every remedy it names loops #1155
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.

vendor --check fails a vendored package whose lock is contested by a sibling package-lock.json with "no lockfile or config references .socket/vendor/… any more", which is false, and its remedy ("re-run socket-patch vendor") is a no-op, so the check stays red forever

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.