Skip to content

refactor(core): unify the per-ecosystem setup backends under setup/ - #155

Merged
Mikola Lysenko (mikolalysenko) merged 1 commit into
fix/sweep-bugfixes-and-test-harnessfrom
refactor/setup-umbrella
Aug 10, 2026
Merged

refactor(core): unify the per-ecosystem setup backends under setup/#155
Mikola Lysenko (mikolalysenko) merged 1 commit into
fix/sweep-bugfixes-and-test-harnessfrom
refactor/setup-umbrella

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

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.

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 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

Fix All in Cursor

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.

Create PR

Or push these changes by commenting:

@cursor push 15869d3fcb
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.

Comment thread .github/workflows/ci.yml
-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::' \

Copy link
Copy Markdown

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 639e3f0. Configure here.

Base automatically changed from refactor/core-taxonomy to fix/sweep-bugfixes-and-test-harness August 10, 2026 18:45
@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit 639e3f0 into fix/sweep-bugfixes-and-test-harness Aug 10, 2026
39 of 46 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the refactor/setup-umbrella branch August 10, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant