Repository navigation
Fix vex attesting nothing after a hosted move of a platform-locked gem - #2497
Mikola Lysenko (mikolalysenko) wants to merge 3 commits into
Conversation
A hosted move of a gem Bundler locks as platform builds was followed by a standalone `vex` that attested nothing: the document was empty and the command exited 1. Three causes, each fixed here. The patch of a locked build was looked up by the purl its package reference states. The patch service states the gem alone there (`pkg:gem/nokogiri@1.18.9`), without the `platform` qualifier, for every gem patch, so no patch matched a locked platform build. The lookup now takes a patch's platform from the patch search, which lists each patch under its own purl, and reads the reference's purl only for a patch the search does not list. For the same reason a hosted `scan` / `get` reported a platform build's event under the gem's bare purl. The event keeps the build's own purl when the reference names the gem alone. Each hosted build's record was checked against every installed copy of the gem version. The patches of one fix have bytes of their own per build, so on a lock naming more than one build (`nokogiri (1.18.9)` beside `nokogiri (1.18.9-x86_64-linux-gnu)`) the installed copy failed the check of every build but its own. A hosted gem build is now judged by the copies of its own build, as the record check already did. A build this machine does not install is attested from the lock's pin, but not while an installed build of the same gem fails its own patch's check. The capstone fixtures now serve references in both shapes, and a patch per build with its own bytes. One new arm names the ruby gem's patch `?platform=ruby` in the search, its view and its reference. Released 5.2.0 keeps failing on such a lock until the reference states the build's own purl, which needs a matching change in Socket's backend. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…shapes Review follow-ups to the hosted platform-gem `vex` fix. A patch the search lists is still held to its reference: one that names another gem, or carries the `platform` of another build, matches no locked build. The two spellings of the glibc Linux platform are one. A platform gem's patch the search does not list, whose reference names the gem alone, is no longer read as the ruby gem's patch: nothing states its platform, so it matches no build. A hosted candidate takes the selection's platform only where its reference names none. A reference that says `?platform=ruby` is reported as it states. The capstone fixture for bare references now lists the ruby gem's patch under `?platform=ruby` in the search and its view, as the patch service does, and the lock-gaining test serves views that match the gems it builds. The docs of the hosted copy lookup say a gem build's purl gets the copies of its own build. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
PR SummaryMedium Risk Overview Patch ↔ lock matching now uses the patch search listing (qualified purl per build) to pair each locked platform with its granted patch; reference purls still disambiguate only when a patch is not in search, with guards for contradictory or bare platform-gem references. Hosted redirect candidates keep the selection’s platform-qualified purl when the grant names the gem alone, so VEX consumption judges each gem build against only that build’s installed copies (not every copy of the gem version), and withholds lockfile-basis excuses for sibling builds while any installed build of the same gem fails verification—so one wrong on-disk platform build does not falsely attest other builds. Docs and e2e capstones are updated to describe per-build attestation, distinct patched bytes per platform, and multiple reference-purl shapes. Reviewed by Cursor Bugbot for commit 01dd5ee. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 01dd5ee. Configure here.
`locked_build_patch` already treats `x86_64-linux` and `x86_64-linux-gnu` (and case) as one platform when deciding whether a reference contradicts the search, but the lock match itself compared exactly. A patch stated as `x86_64-linux` then matched no `x86_64-linux-gnu` build, and standalone `vex` attested nothing for it. Fold the platform there too; the registry digest still pins the build's exact bytes. Found by Cursor Bugbot. Assisted-by: Claude Code:claude-opus-5-5
|
[agent] PR shepherd: final review brief for the approver. What it does. After a hosted move of a gem that Bundler locks as platform builds (such as nokogiri Risk: low–medium.
Look here
Verified
Changes I made. None in this review. The glibc-spelling fix (3687794) came from an earlier shepherd run. Open questions. None blocking. The PR notes that released 5.2.0 also needs a matching change in Socket's backend, so that a platform gem's package reference states its own purl. Generated by Claude Code |

What was wrong
After a hosted move of a gem that Bundler locks as platform builds (
nokogiri (1.18.9-x86_64-linux-gnu)), a standalonesocket-patch vexattested nothing: it warnedno granted patch matches 1.18.9-x86_64-linux-gnu, omitted the gem asrecord_unavailable, wrote no statement and exited 1. The move itself, the frozen install and the run's own--vexwere fine. This is released 5.2.0 against the production patch service.There were three causes.
vexfinds the patch of each locked build by the purl its package reference states. The patch service states the gem alone there (pkg:gem/nokogiri@1.18.9) for every gem patch, a platform gem's included, so no patch was ever "for" a locked platform. The lookup now takes a patch's platform from the patch search, which lists each patch under its own purl. The reference's purl places only a patch the search does not list.scan/getreported a platform build'sappliedevent under the gem's bare purl. The candidate now keeps the selection's platform when its reference names none.nokogiri (1.18.9)besidenokogiri (1.18.9-x86_64-linux-gnu)), the one installed copy failed the check of every build but its own (hash_mismatch,partialFailure). A hosted gem build is now judged by the copies of its own build, which is what the record check already did. A build this machine does not install is attested from the lock's pin, but not while an installed build of the same gem fails its own patch's check.The test fixtures hid all three: they served references with qualified purls and one set of bytes for every build of a fix.
Tests
e2e_redirect_gem_build,--ignored) now serve references in three shapes and a patch per build with its own bytes. They also tamper with the installed build and check thatvexthen attests no build of the gem. Seven arms pass on Ruby 3.4.10 / Bundler 4.0.15. Each fix was removed in turn to confirm an arm fails without it.socket-patch-corelib (9,025 tests),socket-patch-clilib, and thevexand gem integration targets pass.cargo fmtand CI's clippy command are clean.Checked against production
A Linux build of this branch, run in
ruby:3.3containers against the production patch service, with nokogiri 1.18.9. Each run is: hosted move,BUNDLE_FROZEN=true bundle install,vex,rollback. All steps exit 0.vexx86_64-linux-gnuonly, withCHECKSUMSget <uuid> --mode hostedx86_64-linux-gnuonly, withCHECKSUMSscan --mode hostedruby+x86_64-linux-gnu, withCHECKSUMSscan --mode hostedx86_64-linux-gnuonly, noCHECKSUMS(Bundler 2.5.22)scan --mode hostedNot changed here
pkg:gem/nokogiri@1.18.9) when its reference names the gem alone, while VEX names it?platform=ruby. That is what 5.2.0 does and what every plain gem's event looks like, so I left it. The capstones pin it. (Review finding 1.)Review
/code-review highfound no blocking bug and six minor points. Five are fixed in the second commit: a reference that contradicts the search no longer matches, an unlisted platform patch with a bare reference is no longer read as the ruby gem's, a reference that says?platform=rubyis reported as stated, one test fixture served views that did not match its gems, and stale module docs. The sixth is the event purl above.🤖 Generated with Claude Code
Generated by Claude Code