[agent] Filed by the scheduled architecture audit routine (ecosystems and formats). Register: discussion #560 register.
Kind: refactor (mechanical move). Source: review §2.1; 4.7 J. Register E20, step 1 of tracking #833.
Problem
The neutral "one lock-resolved package" types live in the vendored lock inventory:
LockIntegrity, SourceKind, LockfileEntry and LockfileEntry::npm (lock_inventory/mod.rs#L108-L192);``
http_url (#L394-L400).``
So every format reader that emits entries imports vendor:
vex::discover (10 files), api/vendor_prefetch.rs, vendor/registry_fetch.rs and vendor/service_fetch.rs reach into vendor::lock_inventory for the same types. About 48 files name them, and the CLI has 9 references.
Symptoms
None. This is the formats → vendor cycle from Part 4.5 #2. Impact: low risk; it unblocks the codec moves in #833.
Proposed change
- Create
crates/socket-patch-core/src/formats/entry.rs holding the four items verbatim (doc comments included), and pub use them from formats.
- Update the importers to
crate::formats::entry::… (or formats::{LockfileEntry, …}). Keep pub use crate::formats::entry::{…} in vendor::lock_inventory only if the CLI's public paths need it; otherwise delete the old definitions outright.
- No behavior change. The
UnsupportedNpmLayout diagnosis stays in lock_inventory (it is a discovery outcome, not an entry).
Size and scope
~90 moved lines plus roughly 50 one-line use edits. Out of scope: moving the codecs (#833 steps 2–4) and the redirect types (step 5).
Acceptance criteria
Dependencies
None. It conflicts mechanically with open PRs that edit use lines in vex/discover/* or lock_inventory/mod.rs (for example #750, #801); rebase onto whichever lands first. It is the first child of #833.
[agent] Filed by the scheduled architecture audit routine (ecosystems and formats). Register: discussion #560 register.
Kind: refactor (mechanical move). Source: review §2.1; 4.7 J. Register E20, step 1 of tracking #833.
Problem
The neutral "one lock-resolved package" types live in the vendored lock inventory:
LockIntegrity,SourceKind,LockfileEntryandLockfileEntry::npm(lock_inventory/mod.rs#L108-L192);``http_url(#L394-L400).``So every format reader that emits entries imports
vendor:formats/gem/mod.rs#L28;formats/composer/mod.rs#L22;formats/pnpm/mod.rs#L39;formats/cargo/mod.rs#L35.vex::discover(10 files),api/vendor_prefetch.rs,vendor/registry_fetch.rsandvendor/service_fetch.rsreach intovendor::lock_inventoryfor the same types. About 48 files name them, and the CLI has 9 references.Symptoms
None. This is the
formats→vendorcycle from Part 4.5 #2. Impact: low risk; it unblocks the codec moves in #833.Proposed change
crates/socket-patch-core/src/formats/entry.rsholding the four items verbatim (doc comments included), andpub usethem fromformats.crate::formats::entry::…(orformats::{LockfileEntry, …}). Keeppub use crate::formats::entry::{…}invendor::lock_inventoryonly if the CLI's public paths need it; otherwise delete the old definitions outright.UnsupportedNpmLayoutdiagnosis stays inlock_inventory(it is a discovery outcome, not an entry).Size and scope
~90 moved lines plus roughly 50 one-line
useedits. Out of scope: moving the codecs (#833 steps 2–4) and the redirect types (step 5).Acceptance criteria
grep -rn 'crate::vendor' crates/socket-patch-core/src/formats/{gem,pnpm,cargo,composer}/mod.rsno longer listslock_inventory.lock_inventoryarchitecture_testsandformats::architecture_tests::format_models_are_purestay green.cargo test -p socket-patch-coreand-p socket-patch-cligive the same results as onmain, andcargo clippy --all-targetsis clean.Dependencies
None. It conflicts mechanically with open PRs that edit
uselines invex/discover/*orlock_inventory/mod.rs(for example #750, #801); rebase onto whichever lands first. It is the first child of #833.