GeezerVison is showing github.com — refactor(core): unify the per-ecosystem setup backends under setup/ by mikolalysenko · Pull Request #155 · SocketDev/socket-patch
Conversation
Summary
Stacked on #153 (sibling of #154) — retarget as the stack lands. The last taxonomy fix from the 2026-08-10 structure review: the four per-ecosystem setup backends lived as four top-level modules under four different naming schemes (gem_setup = {eco}_setup, composer_setup = {eco}_setup, pth_hook = {mechanism}, package_json = {file edited}), all consumed by the CLI's setup command with mirrored doc contracts.
gem_setup/ → setup/gem/, composer_setup/ → setup/composer/, pth_hook/ → setup/pypi/ — pure git mv, templates included.
setup/npm.rs is a thin alias over package_json's setup-facing surface. package_json itself stays top-level deliberately: it doubles as the crate-wide shared npm-manifest library (crawlers and vendor parse package.json through it).
- Old top-level paths keep compiling via lib.rs aliases for external consumers of the published core crate; internal references repointed; the CI alias-path grep gains the three old paths.
- The shared Status enum the four backends' docs describe informally is deliberately not introduced — their semantics differ subtly (e.g. gem template regeneration), and the review's adversarial pass flagged unification as a behavior decision, not motion.
Verification
- 128 in-src setup tests,
setup_invariants (19), setup_contract_gaps (8), cli_parse_setup (29) all green.
cargo clippy --workspace --all-targets -- -D warnings and cargo fmt --check clean.
- Zero behavior change: moves, aliases, import repoints, doc-path updates only.
🤖 Generated with Claude Code
Note Low Risk
Structural refactor with backward-compatible pub use aliases and grep enforcement; setup hook wiring logic is unchanged. Note: lint-ecosystems in CI may still point at old gem_setup/templates paths if not updated elsewhere in the stack.
Overview
Consolidates the gem, Composer, and PyPI setup backends under setup/ (setup/gem, setup/composer, setup/pypi) and adds setup/npm as a thin re-export over the existing package_json setup surface so every ecosystem backend lives under one module tree.
socket-patch-cli and internal core code now import setup::gem, setup::composer, and setup::pypi instead of gem_setup, composer_setup, and pth_hook. lib.rs keeps composer_setup, gem_setup, and pth_hook as public aliases for external crate consumers; CI’s moved-module grep now rejects new internal uses of those old paths (along with gem_setup::, composer_setup::, pth_hook::).
Doc and comment references are updated to the canonical paths (e.g. setup::gem::discover_bundler_project). No intentional behavior change—moves, aliases, and import repoints only.
Reviewed by Cursor Bugbot for commit 639e3f0. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Four naming schemes for one concept, now one umbrella: gem_setup ->
setup::gem, composer_setup -> setup::composer, pth_hook -> setup::pypi,
plus a thin setup::npm alias re-exporting package_json's setup-facing
surface. package_json itself stays top-level: it doubles as the
crate-wide shared npm-manifest library (crawlers and vendor parse
package.json through it), which is exactly why it never fit under a
setup umbrella wholesale.
Pure git-mv moves — the pypi backend's generic TOML helpers were already
extracted to utils::toml_edit_ext, so nothing vendor-shaped rides along.
Old top-level paths keep compiling through lib.rs aliases for external
consumers of the published crate; internal references are repointed and
the CI alias-path grep now rejects the three old paths. The shared
per-backend Status enum the four modules' docs describe informally is
deliberately NOT introduced here: their status semantics differ subtly
(gem template regeneration), and unification is a behavior decision,
not motion.
Co-Authored-By: Claude Fable 5 <[email protected]>
cursor
Bot
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Stale CI template paths
- Updated CI workflow paths from gem_setup/templates/ to setup/gem/templates/ to match the template file relocation.

Or push these changes by commenting:
Preview (15869d3fcb)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -94,8 +94,8 @@ jobs:
( cd gem/socket-patch && ruby -c lib/socket_patch/launcher.rb && ruby -c exe/socket-patch && gem build socket-patch.gemspec )
( cd gem/socket-patch-bundler && ruby -c plugins.rb && gem build socket-patch-bundler.gemspec )
# The generated-plugin templates are pure Ruby — keep them parseable.
- ruby -c crates/socket-patch-core/src/gem_setup/templates/plugins.rb.tmpl
- ruby -c crates/socket-patch-core/src/gem_setup/templates/gemspec.tmpl
+ ruby -c crates/socket-patch-core/src/setup/gem/templates/plugins.rb.tmpl
+ ruby -c crates/socket-patch-core/src/setup/gem/templates/gemspec.tmpl
- name: PHP — lint the Composer launcher + validate composer.json
# composer.json lives at the repo root (Packagist requires the
@@ -94,8 +94,8 @@ jobs:
( cd gem/socket-patch && ruby -c lib/socket_patch/launcher.rb && ruby -c exe/socket-patch && gem build socket-patch.gemspec )
( cd gem/socket-patch-bundler && ruby -c plugins.rb && gem build socket-patch-bundler.gemspec )
# The generated-plugin templates are pure Ruby — keep them parseable.
- ruby -c crates/socket-patch-core/src/gem_setup/templates/plugins.rb.tmpl
- ruby -c crates/socket-patch-core/src/gem_setup/templates/gemspec.tmpl
+ ruby -c crates/socket-patch-core/src/setup/gem/templates/plugins.rb.tmpl
+ ruby -c crates/socket-patch-core/src/setup/gem/templates/gemspec.tmpl
- name: PHP — lint the Composer launcher + validate composer.json
# composer.json lives at the repo root (Packagist requires the
You can send follow-ups to the cloud agent here.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 639e3f0. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
-e 'patch::go_redirect' -e 'patch::bun_lock_text' \
|
|
|
-e 'utils::telemetry' -e 'utils::cleanup_blobs' \
|
|
|
-e 'utils::date' -e 'utils::fuzzy_match' \
|
|
|
-e 'gem_setup::' -e 'composer_setup::' -e 'pth_hook::' \
|
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.
Stale CI template paths
High Severity
The Bundler plugin templates moved from gem_setup/templates/ to setup/gem/templates/, but the lint-ecosystems job still runs ruby -c against the old paths. Those files no longer exist there, so the Ruby syntax-check step fails and the templates stop getting CI coverage.
Reviewed by Cursor Bugbot for commit 639e3f0. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Base automatically changed from
refactor/core-taxonomy
to
fix/sweep-bugfixes-and-test-harness
August 10, 2026 18:45
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|