Skip to content

Fix vex warning on a vendored gem leftover (#2076) - #2081

Draft
Mikola Lysenko (mikolalysenko) wants to merge 3 commits into
mainfrom
agent/fix-vex-vendored-gem-leftover-copy
Draft

Mikola Lysenko (mikolalysenko) wants to merge 3 commits into
mainfrom
agent/fix-vex-vendored-gem-leftover-copy

Conversation

@mikolalysenko

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:claude-fable-5-2

Fixes #2076

Root cause

vex's vendored drift probe (applied_patches_with_copies in
crates/socket-patch-core/src/vex/verify.rs) compares every installed copy
the crawler finds against the patch record. For a vendored gem the lock
resolves the gem from a PATH source, so Bundler loads the vendored
directory and never the registry copy an earlier bundle install left in
the gem home. That leftover is still counted as "the live tree", so
vendored_tree_out_of_sync fires on every run and no bundle install
clears it.

Plan

  1. Failing unit test in vex/verify.rs and an end-to-end test for the gem case.
  2. Stop counting a gem-home leftover of a vendored gem as an installed copy
    (as Go's module cache and Gradle's files-2.1 copies already are).
  3. Update CLI_CONTRACT.md.

Generated by Claude Code

Assisted-by: Claude Code:claude-fable-5-2
Once Gemfile.lock takes a vendored gem from its PATH source,
Bundler loads the vendored directory and installs nothing for the
gem. The registry copy an earlier bundle install left in the gem
home stays, unpatched, until bundle clean. vex counted it as the
live tree and warned vendored_tree_out_of_sync on every run, with
a remedy (re-run the install) that could never clear it.

The probe now skips a vendored gem's gem-home copies, as it does
Go's module cache and Gradle's files-2.1 copies. A default gem's
copy still counts, since RubyGems can load it before Bundler sets
the load path. The verdict was never affected and is unchanged.

Fixes #2076

Assisted-by: Claude Code:claude-fable-5-2
This replaces the previous commit's approach. Dropping the
gem-home copy from the drift probe hid a copy that a load outside
Bundler still runs (plain ruby, a stale --standalone setup
script), so the probe is back to what main has.

What #2076 reports is the wording. For a vendored gem the warning
said the live tree carries different bytes and to re-run the
install. Bundler loads the vendored path and bundle install never
replaces the old registry copy, so the advice could not clear it.

The gem detail now says the copy is a leftover Bundler no longer
loads, and names bundle clean (a project bundle path) or
gem uninstall NAME -v VERSION (a shared gem home). The warning
code, the verdict and every other ecosystem's text are unchanged.

Fixes #2076

Assisted-by: Claude Code:claude-fable-5-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants