Skip to content

refactor(core): promote vendor/ to top level, rehome ecosystem strays, dissolve utils/ misfiles - #153

Merged
Mikola Lysenko (mikolalysenko) merged 4 commits into
fix/sweep-bugfixes-and-test-harnessfrom
refactor/core-taxonomy
Aug 10, 2026
Merged

refactor(core): promote vendor/ to top level, rehome ecosystem strays, dissolve utils/ misfiles#153
Mikola Lysenko (mikolalysenko) merged 4 commits into
fix/sweep-bugfixes-and-test-harnessfrom
refactor/core-taxonomy

Conversation

@mikolalysenko

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

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #150 (retarget to main once it lands). The module-taxonomy fixes from the 2026-08-10 structure review — four commits, each mechanical and independently revertable:

  1. Promote patch/vendor/src/vendor/ (pure git mv). patch/ was 63% of the crate but only ~11% patch engine; the vendoring/lockfile-rewriting subsystem (34 files, ~47% of core) is the crate's center of mass and now says so in the tree. The npm strays move with it (bun_lock_text, go_mod_edit), and the Go local replace-redirect backend becomes patch::redirect::golang_local, beside every other ecosystem's rewiring.
  2. Repoint all internal imports to the canonical paths. Old patch::* paths keep compiling via pub use shims for external consumers of the published core crate — but #[deprecated] on a re-export emits no warnings (Allow deprecating a re-export rust-lang/rust#30827), so a new CI grep step rejects internal uses of the alias paths instead. The bun_lock_text shim is dropped outright (it was pub(crate) before; no external consumer could name it).
  3. Extract utils::toml_edit_ext (ensure_table/has_table): the pypi setup backend (pth_hook) owned the crate's generic structured-TOML seam and vendor::{cargo_config,pypi,pypi_uv} reached into it. Unblocks a future setup/ umbrella without dragging vendor deps along.
  4. Dissolve the utils/ misfiles: telemetry → top level (a 1k-LOC subsystem, not a leaf), cleanup_blobsmanifest/ (manifest-domain GC), dateapi/ (parses the API's RFC-2822 wire dates), fuzzy_matchcrawlers/. Compat re-exports stay in utils/, same CI-grep guard. utils/ keeps the genuine leaves.

Also: vendor/state.rs's flavor docstring gains the missing yarn-berry (npm_flavor emits and revert-routes it; the doc list had drifted).

Merge note

Prefer rebase-merge over squash for this one: commit 1/4 is a pure-rename commit kept free of content edits so git blame/log --follow stay clean. If squashed, please add the squash commit to .git-blame-ignore-revs after merging.

Verification

  • Full workspace suite green on this branch (163 test binaries; the only 2 failures during development were the base branch's own RED pins, since fixed in Structure-review batch: sweep fixes, module taxonomy, npm-family dedup, coverage gaps, CI honesty #150's second commit).
  • cargo clippy --workspace --all-targets -- -D warnings clean, cargo fmt --check clean, CI alias-path grep step passes (zero internal old-path uses).
  • Zero behavior change intended; the only non-move diffs are import paths, module decls, shims, and the one docstring fix.

🤖 Generated with Claude Code


Note

Low Risk
Mechanical module moves and import updates with compat shims and a CI grep guard; no intended runtime behavior change, though a missed import could fail compile rather than ship silently.

Overview
This PR restructures socket-patch-core’s module tree and repoints every in-repo caller to canonical paths. Behavior is intended to be unchanged; the work is import moves, pub use shims for the published crate, and enforcement.

Vendor and Go redirect — The vendoring subsystem moves from patch::vendor to top-level crate::vendor (including go_mod_edit and bun_lock_text). Local Go replace redirect logic lives under patch::redirect::golang_local (replacing patch::go_redirect). CLI commands (apply, vendor, scan, vex, etc.) and core internals now import socket_patch_core::vendor::* and the new redirect path.

Other promotionstelemetry is a top-level module (was utils::telemetry). manifest::cleanup_blobs, api::date, and crawlers::fuzzy_match replace their old utils::* homes. Shared TOML helpers move to utils::toml_edit_ext so pth_hook and vendor code no longer cross-own ensure_table / has_table.

Compatibility and CI — Old paths remain as re-exports on patch and utils for external consumers until 4.0. Because #[deprecated] on re-exports does not warn internally, clippy gains a step that fails CI if crates/**/*.rs still references legacy paths (patch::vendor, utils::telemetry, etc.).

A small doc fix adds yarn-berry to the npm flavor list in vendor/state.rs.

Reviewed by Cursor Bugbot for commit e84bda3. Configure here.

Pure move, no logic changes. patch/ was 63% of the crate but only ~11%
patch engine; the vendoring + lockfile-rewriting subsystem it contained
(34 files, ~47% of core) is the crate's real center of mass and now
lives at crate::vendor. The npm-family strays move with it
(bun_lock_text, go_mod_edit), and the project-local Go replace-redirect
backend joins the other rewiring code as patch::redirect::golang_local.

Old `patch::*` paths keep compiling through re-export shims for
external consumers of the published crate; internal references are
repointed in the follow-up commit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e paths

Mechanical: patch::vendor → vendor, patch::go_mod_edit →
vendor::go_mod_edit, patch::bun_lock_text → vendor::bun_lock_text,
patch::go_redirect → patch::redirect::golang_local, across both crates
and tests. The patch::* re-export shims stay for external consumers of
the published core crate, but #[deprecated] on a pub use emits no
warnings (rust-lang/rust#30827), so a CI grep now rejects new internal
uses of the alias paths. The bun_lock_text shim is dropped outright: it
was pub(crate) before the move, so no external consumer could name it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ensure_table / has_table were defined inside the pypi setup backend
(pth_hook) but consumed by vendor::cargo_config, vendor::pypi and
vendor::pypi_uv — the pypi hook module owned the crate's generic
structured-TOML seam. Move both (verbatim) to utils::toml_edit_ext and
repoint the five callers. Unblocks folding pth_hook under a future
setup/ umbrella without dragging vendor dependencies along.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Mechanical moves with compat re-exports left in utils/ for external
consumers of the published crate (internal paths repointed, CI
grep-guarded like the vendor promotion):

* utils/telemetry.rs -> src/telemetry.rs — a 1k-LOC subsystem, not a
  leaf helper
* utils/cleanup_blobs.rs -> manifest/cleanup_blobs.rs — imports
  manifest::operations/schema; it is manifest-domain blob GC
* utils/date.rs -> api/date.rs — parses the API's RFC-2822 wire dates
* utils/fuzzy_match.rs -> crawlers/fuzzy_match.rs — depends on
  crawlers::types

utils/ keeps the genuine leaves: fs, env_compat, http, process, purl,
serde, socket_cli_config, toml_edit_ext, uri.

Also: vendor/state.rs flavor docstring gains the missing yarn-berry
(npm_flavor emits and revert-routes it; the doc list had drifted).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mikolalysenko
Mikola Lysenko (mikolalysenko) merged commit e84bda3 into fix/sweep-bugfixes-and-test-harness Aug 10, 2026
39 of 45 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the refactor/core-taxonomy 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