refactor(core): promote vendor/ to top level, rehome ecosystem strays, dissolve utils/ misfiles - #153
Merged
Mikola Lysenko (mikolalysenko) merged 4 commits intoAug 10, 2026
Conversation
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>
This was referenced Aug 10, 2026
Mikola Lysenko (mikolalysenko)
merged commit Aug 10, 2026
e84bda3
into
fix/sweep-bugfixes-and-test-harness
39 of 45 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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:
patch/vendor/→src/vendor/(puregit 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 becomespatch::redirect::golang_local, beside every other ecosystem's rewiring.patch::*paths keep compiling viapub useshims 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. Thebun_lock_textshim is dropped outright (it waspub(crate)before; no external consumer could name it).utils::toml_edit_ext(ensure_table/has_table): the pypi setup backend (pth_hook) owned the crate's generic structured-TOML seam andvendor::{cargo_config,pypi,pypi_uv}reached into it. Unblocks a futuresetup/umbrella without dragging vendor deps along.utils/misfiles:telemetry→ top level (a 1k-LOC subsystem, not a leaf),cleanup_blobs→manifest/(manifest-domain GC),date→api/(parses the API's RFC-2822 wire dates),fuzzy_match→crawlers/. Compat re-exports stay inutils/, same CI-grep guard.utils/keeps the genuine leaves.Also:
vendor/state.rs's flavor docstring gains the missingyarn-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 --followstay clean. If squashed, please add the squash commit to.git-blame-ignore-revsafter merging.Verification
cargo clippy --workspace --all-targets -- -D warningsclean,cargo fmt --checkclean, CI alias-path grep step passes (zero internal old-path uses).🤖 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 useshims for the published crate, and enforcement.Vendor and Go redirect — The vendoring subsystem moves from
patch::vendorto top-levelcrate::vendor(includinggo_mod_editandbun_lock_text). Local Goreplaceredirect logic lives underpatch::redirect::golang_local(replacingpatch::go_redirect). CLI commands (apply,vendor,scan,vex, etc.) and core internals now importsocket_patch_core::vendor::*and the new redirect path.Other promotions —
telemetryis a top-level module (wasutils::telemetry).manifest::cleanup_blobs,api::date, andcrawlers::fuzzy_matchreplace their oldutils::*homes. Shared TOML helpers move toutils::toml_edit_extsopth_hookand vendor code no longer cross-ownensure_table/has_table.Compatibility and CI — Old paths remain as re-exports on
patchandutilsfor external consumers until 4.0. Because#[deprecated]on re-exports does not warn internally, clippy gains a step that fails CI ifcrates/**/*.rsstill references legacy paths (patch::vendor,utils::telemetry, etc.).A small doc fix adds
yarn-berryto the npm flavor list invendor/state.rs.Reviewed by Cursor Bugbot for commit e84bda3. Configure here.