Repository navigation
spaced-host-client: move the client's methods into modules by guest area (pure move) - #571
Merged
Merged
Conversation
…rea (pure move) lib.rs holds the whole typed client: its types, the call macro and constructors, and 40 methods across four guest services. Keep the types, the macro and the constructors in lib.rs and move the methods into impl blocks in five child modules: meta, filesystem, file_watch, process and networking, together with the helpers only those methods use. Generated by scripts/split_rust_module.py (#562) from the spec in the pull request. Items move verbatim. The only edits keep each item's reach: 5 private items, fields or methods become pub(super). The parent re-exports the moved items, so no caller changes.
ac-pplx
force-pushed
the
ac/split-spaced-host-client
branch
from
October 16, 2026 07:11
d0d20b0 to
6bc3804
Compare
ac-pplx
marked this pull request as ready for review
October 16, 2026 14:49
Collaborator
ReviewNo findings. Verified against What I ran:
What I didn't check: whether the grouping is the right one. That's a design call, and I took the body's word for it. I also didn't rebuild or retest the crate; CI is green on this head. |
the-gigi-pplx
approved these changes
Oct 16, 2026
the-gigi-pplx
left a comment
Collaborator
There was a problem hiding this comment.
Approved. No findings; details in the review comment above.
johnlouie-pplx
approved these changes
Oct 16, 2026
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
crates/libs/spaced/host/client/src/lib.rs(1,040 code lines) is the whole typed client for the spaced host API: its types, a call macro and constructors, then 40 methods across four guest services. This keeps the types, the macro and the constructors inlib.rsand moves the methods, with the helpers only they use, intoimpl SpacedHostClientblocks in five modules (filesystem calls and file watching are separate).lib.rsdrops to 187 code lines; the largest new file isfilesystem.rsat 316.Every moved method is already
puband stays onSpacedHostClient, so the crate's API is unchanged. The macro-generated privatecall_*methods stay inlib.rs; child modules can call them because they are descendants of the crate root.This is a pure move, generated by
scripts/split_rust_module.py(#562) from the spec below and proved by itsverify. It is part of splitting the largest production modules into smaller ones with one job each.What moved where
metafilesystemfile_watchprocessnetworkinglib.rs(parent)How to check it
The spec (item names, not lines):
The tool is
scripts/split_rust_module.pyfrom #562 (not on main yet).b9fc395e0, runsplit_rust_module.py apply spec.toml && cargo fmt --all. This reproduces the first commit.split_rust_module.py verify origin/main→regenerated and compared 6 files from 1 split parents: identical.verifyderives the spec from the diff, regenerates the split from the merge base, and requires HEAD's Rust files to equal the rustfmt'd result byte for byte.pub(super); 40 methods moved intoimplblocks with the same header. Each keeps the reach the item had: one module deeper,pub(super)reaches exactly the old module.Observable changes
target:.sql!. A#[track_caller]panic raised by Tokio inside one (for examplelist_processes' timeout polled without a Tokio timer) now reportsprocess.rsinstead oflib.rs. rustdoc showsSpacedHostClient's methods in six impl sections instead of one, andstd::any::type_nameof a moved method's future names its new module.Validation
Run on a Linux development machine at the PR head, in the CI image:
cargo check --workspace --all-targets --all-features --locked: pass, no warnings.run_clippy_checkswith-D warnings: pass.cargo check -p pplx-space-spaced-host-client --no-default-features --all-targets: pass.cargo nextest run -p pplx-space-spaced-host-client --all-features: 3/3 passed; the crate needs no Postgres or privileges.cargo doc -p pplx-space-spaced-host-client --no-deps: no warnings on the branch or on main. TheSpacedHostClientpage lists the same 62 methods on both.file_sizeentry below.Interactions
No open pull request touches
spaced/host/client/src/lib.rs. Consumers are sbx-mgr, spaced-host-server and the spaced host CLI; the workspace check covers them.Follow-ups, kept out of this PR because
verifyallows no other Rust edits: imports inlib.rsthat only the child modules use could move to them.The archcheck
file_sizebaseline entry for this file is now stale (an advisory finding). Split PRs leave that table alone, so they don't conflict with each other there; one follow-up prunes the stale entries after they land.Rollback
Revert the commit(s). No data, configuration, wire or public API change.
🤖 Generated with Claude Code