Skip to content

Commit 134d40e

Browse files
mikolalysenkoclaude
andcommitted
Move the Socket origin classifier into one module
Discovery's classifier (the memoized hosted_uuid fast path, vendor_ref and its variants, locate, Wired, the socket-patch-<uuid> name grammar) and the redirect's hosted URL rule (hosted_patch_uuid, hosted_patch_url_uuids, SOCKET_PATCH_SERVER_HOST) now live in crates/socket-patch-core/src/origin.rs, with their tests. The code moves verbatim. DiscoverCtx holds an OriginPolicy (the per-run origin allowlist and its memoized host set) and delegates hosted_uuid and locate to it. vex::discover and patch::redirect re-export the moved items, so no caller changes. origin.rs sits outside formats/ on purpose: format models are guarded to apply no host policy (formats/mod.rs architecture_tests). Budget: lock-readers 30,898 -> 30,976 (49 lines moved in from patch/redirect, ~30 lines of OriginPolicy and re-export glue); lock-writers 88,363 -> 88,314. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a396590 commit 134d40e

5 files changed

Lines changed: 878 additions & 796 deletions

File tree

‎crates/socket-patch-core/src/lib.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ pub mod hash;
77
pub mod hosted;
88
pub mod ledgers;
99
pub mod manifest;
10+
pub mod origin;
1011
pub mod patch;
1112
pub mod policy;
1213
pub mod rollout;

0 commit comments

Comments
 (0)