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 gem takeover un-hosting a grouped gem (#775) by mikolalysenko · Pull Request #776 · SocketDev/socket-patch Conversation
|
| Issue | Test | Red without fix → green with fix |
|---|---|---|
#775 (wet get/scan --mode vendored) |
e2e_redirect_gem_build::gem_hosted_group_block_pin_survives_a_refused_vendored_takeover (real Bundler 4.0.17) |
Red: vendor_takeover_reverted_redirect emitted, Gemfile/lock un-hosted. Green: failed gemfile_declaration_not_editable, files byte-identical. |
| #775 (dry run) | same test, dry_run=true legs for get and scan |
Red: "action": "would_vendor". Green: would_refuse + errorCode. |
| preflight logic | vendor::gem::tests::takeover_preflight_* (3 tests: group block refused and nothing written, top-level hosted gem passes, a refused restore is left to the takeover) |
new |
| preview rendering | scan::vendor_flow::preview_tests::preview_marks_a_refused_takeover_would_refuse |
new |
Red was shown by stubbing gem_vendor_target_preflight to return None. Both the dry legs and the wet leg failed exactly as reported in #775.
The e2e respells the mock upstream as https://rubygems.org/ in the hosted pair and serves it through SOCKET_RUBYGEMS_URL. The takeover restore only re-derives a CHECKSUMS sha256 for a rubygems.org remote, which is the shape of the report.
Commands run locally:
cargo clippy --workspace --all-features -- -D warnings: clean.cargo test -p socket-patch-cli --all-features --test e2e_redirect_gem_build --test e2e_vendor_gem_build -- --ignored: 12 + 6 passed.cargo test --workspace --all-features: all pass except 16 write-failure tests across 4 binaries. Those depend on chmod making files unwritable, which does not hold when running as root (uid 0) in this sandbox. They do not touch the changed code, and CI runs them non-root.main is not cargo fmt-clean under the pinned toolchain, and CI has no fmt check. Only the hunks this PR changes are rustfmt-formatted, so the diff stays reviewable.main (42673c6)The merge was clean and brings in #712 (gem VEX now honours an out-of-tree bundle path), #829 and #874. It also re-triggered the CodeQL Analyze jobs that the 2026-10-05 runner outage had cancelled. Re-validated on 42673c6:
cargo clippy --workspace --all-features -- -D warnings: clean.e2e_redirect_gem_stale_install 32/32 and e2e_vex_redirect 31/31 pass.e2e_redirect_gem_build --ignored 17/17 and e2e_vendor_gem_build --ignored 8/8 pass (real Bundler 4.0.18).42673c6 are green or skipped, including all four CodeQL Analyze jobs. Bugbot is clean, there are no unresolved review threads, and mergeable_state is clean.group block and then refuses to vendor it (gemfile_declaration_not_editable), so the project silently goes back to unpatched #775's side note: a top-level declaration whose service has no prebuilt artifact (vendor_prebuilt_required) is still un-hosted before the failure. That is the same "restore written before the vendor step can fail" class as npm lockfileVersion 1: scan/get --mode vendored un-host a hosted patch and then refuse to vendor it, so the project silently goes back to unpatched (vendor eject rolls back correctly) #659 / npm vendored refuses a registry package with vendor_workspace_member whenever a local file: directory (or workspace member) has the same name@version, and the hosted→vendored takeover then un-hosts it, leaving it unpatched #688. A general fix would snapshot the takeover's restore and roll it back on any backend failure, as vendor eject already does. That is a cross-ecosystem change and is better as its own PR.🤖 Generated with Claude Code
https://claude.ai/code/session_0145M3bGaAVYdPzNXXD75tqe
Note
Medium Risk
Changes hosted→vendored takeover ordering and vendored scan/get preflight for gems; mistakes could leave gems wrongly hosted or still un-host before refuse, but behavior is scoped to gem takeover paths with new tests.
Overview
Fixes #775: vendored takeover over a hosted gem inside a group block no longer restores upstream first and then fails, which left the gem unpatched in both modes.
Gem preflight before takeover restore (aligned with existing Bun/npm takeover gates): core adds gem_vendor_target_preflight, which dry-runs restore_upstream and runs the Gemfile declaration gate on the restored text so socket-patch’s hosted source … do wiring is not confused with the user’s declaration. The CLI wires this through gem_takeover_refusal / gem_takeover_preview_refusals in the vendor takeover loop, before any restore.
Wet runs report failed gemfile_declaration_not_editable with hosted Gemfile / Gemfile.lock unchanged. Dry runs show would_refuse instead of would_vendor. The same checks run in lock_text_refusals_for and scan rollout planning so refused gems are not downloaded or given rollout slots.
CLI_CONTRACT.md documents the gem preflight; e2e and unit tests cover group-block takeover (including real Bundler).
Reviewed by Cursor Bugbot for commit 9ca9497. Configure here.
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
Vendored mode cannot edit a gem declared inside a `group` block (or any other declaration its line grammar refuses), but the hosted -> vendored takeover only finds that out after it has restored the hosted pin. gem_vendor_target_preflight runs the backend's Gemfile declaration gate on the Gemfile and Gemfile.lock text the restore would leave, without writing anything, so the takeover can refuse first (#775). Assisted-by: Claude Code:claude-opus-5-5
`scan --mode vendored` and `get --mode vendored` over a hosted gem declared inside a `group ... do` block restored its upstream entry and only then hit `gemfile_declaration_not_editable`, so the gem ended up neither hosted nor vendored and the next frozen install loaded the unpatched gem. The dry run promised `would_vendor`. The takeover now asks the gem declaration preflight before the restore: the wet run fails `gemfile_declaration_not_editable` with the hosted Gemfile and Gemfile.lock untouched, and the dry-run preview reports the gem as `would_refuse` with the same code (#775). Fixes #775 Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review 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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
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.
Conflicts: kept both sides' additions — CLI_CONTRACT takeover paragraph gets main's npm v1 lock sentence and the PR's gem preflight sentence, vendor_flow preview keeps both the gem takeover and npm lock would_refuse arms, and both new test sections/e2e drivers are kept. Co-Authored-By: Claude <[email protected]>
|
bugbot run 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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] Failing tests (
Why it isn't this PR's: the same two tests fail on Cause: the two merges conflict in meaning. #738 added these tests assuming Fix: I found no open PR for this. A minimal patch would update the two tests to #605's discovery: drop the I didn't re-run the job: the failure is deterministic on Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Brings in the vex_consumed alias test fix (#849) that main's red test/test-release/coverage jobs were waiting on. Co-Authored-By: Claude <[email protected]>
|
bugbot run 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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
The dry-run preview already marked gems whose hosted->vendored takeover the gem gates refuse as would_refuse, but preflight_refused_purls only consulted the Bun, vlt and npm lock gates. A wet scan therefore kept those gems in the rollout set and downloaded them before the takeover refused. The planning pass now applies the same gem takeover gate. Co-Authored-By: Claude <[email protected]>
|
bugbot run 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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The dry-run preview already reported a hosted gem whose vendored takeover the Gemfile declaration gate refuses (#775) as would_refuse, but the wet `scan` / `get --mode vendored` still planned it a rollout slot and fetched its patch view before the takeover refused it. The download phase's lock-text refusals now include the gem takeover refusal for hosted gems, so the view is never fetched, and scan's vendored planning pass leaves those gems out of the rollout. The e2e asserts that a wet scan fetches no view for the refused gem. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0145M3bGaAVYdPzNXXD75tqe
…on-preflight' into agent/fix-gem-takeover-declaration-preflight # Conflicts: # crates/socket-patch-cli/src/commands/scan/vendor_flow.rs
|
bugbot run 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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Resolved conflicts: - scan/vendor_flow.rs: kept main's new with_symlink_warnings helper and this branch's preflight_refused_purls doc (which also covers the gem takeover gate) and GlobalArgs signature. Updated main's new preview_vendor_json unit test to pass the branch's takeover_refusals argument (empty map). - tests/e2e_redirect_gem_build.rs: kept both new drivers (ScanVexGroupBlock from this branch, ScanVexCustomGitSource from main) in the enum, label match and redirect arm. Co-Authored-By: Claude <[email protected]>
|
bugbot run 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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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)
|
[agent] Failing test: Why it isn't this PR's: the test fails the same way on Ported fix: I cherry-picked #878 ( Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] The red checks on What failed: the cancelled jobs carry the annotation "The job was not acquired by Runner of type hosted even after multiple attempts", so no test code ran. Done: I re-ran the cancelled jobs once in each finished run (npm, Gradle, pnpm, Go and Benchmarks). The Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
bugbot run 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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
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.
Brings in the three commits that landed on main since this branch was last updated, including #712 (gem VEX now honours an out-of-tree bundle path). The merge was clean. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] Merged Checks run locally on
Next: watching CI and Bugbot on 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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Bring the gem takeover preflight up to date with main, which now rolls back a takeover restore when the vendored backend refuses (#853, #944) and added the Bundler mirror and semicolon-declaration e2e drivers. - CLI_CONTRACT.md: keep main's rollback paragraph and add the gem preflight sentence, noting that the dry-run preview models the gem refusal even though it does not model other takeover refusals yet. - e2e_redirect_gem_build.rs: keep both sides' new Driver variants and their labels, and route ScanVexGroupBlock and ScanVexTrailingSemicolonDeclaration through the same ScanVex arm. Co-Authored-By: Claude <[email protected]>
|
bugbot run 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 a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
bugbot run 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 9ca9497. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] What failed: the job never reached a test. It downloads two artifacts from the sbt build job: a 1.7 GB Docker image and a binaries tarball. Only the tarball's download log shows it completing. Why it isn't this PR's: the job died in its setup step, before any build or test of this branch ran. This PR doesn't touch the sbt/Mill workflow or its image build. Re-run: the API refused to re-run it while the rest of the workflow run is still in progress ("This workflow is already running"). I'll re-run the failed job once the run finishes. 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.
Rebase follow-up. vendor's gem takeover refusal (#776) called the patch_server_origins that moved to hosted_unwind, and get's vendored dry run now previews vendor's gem takeover refusals, so get -> vendor is an allowlisted edge again (it is not part of a cycle). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Gem hosted → vendored takeover un-hosts a gem declared inside agroup block and then refuses to vendor it (gemfile_declaration_not_editable), so the project silently goes back to unpatched
There was an error while loading. Please reload this page.