Repository navigation
api: move six groups out of controllers/substrate/mod.rs (pure move) - #569
Merged
Merged
Conversation
ac-pplx
force-pushed
the
ac/split-api-substrate-mod-1
branch
from
October 16, 2026 06:52
5bee890 to
58318f6
Compare
substrate/mod.rs holds the SubstrateAdapter trait and its dispatch, and also a dozen unrelated groups of types and helpers. Move six of them, which no open pull request edits, into child modules: node_api_client, pool_claims, local_artifact, execution_fence, recovery_charge and sandbox_state_probe. The trait, dispatch, errors, capabilities and request types stay for a later step. 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: 20 private items, fields or methods become pub(super); 2 pub(super) ones become pub(in crate::controllers). The parent re-exports the moved items, so no caller changes.
ac-pplx
force-pushed
the
ac/split-api-substrate-mod-1
branch
from
October 16, 2026 14:47
58318f6 to
15d51e0
Compare
ac-pplx
marked this pull request as ready for review
October 16, 2026 14:53
Collaborator
ReviewNo findings. Verified against What I ran:
The non-Rust edit checks out: 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.
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/api/src/controllers/substrate/mod.rs(2,964 code lines) holds theSubstrateAdaptertrait and its dispatch, plus about a dozen unrelated groups of types and helpers. This first step moves six of those groups into child modules. No open PR edits them.mod.rsdrops to 2,042 code lines; the largest new file isexecution_fence.rsat 275.A later step moves the trait, the dispatch impl, errors, capabilities and request types, once the open PRs that edit them (#559, #554, #545, #350, #336, #168) have landed or rebased.
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
node_api_clientpool_claimslocal_artifactexecution_fencerecovery_chargesandbox_state_probemod.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).9d6f4f65d, 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 7 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); 2pub(super)→pub(in crate::controllers). Each keeps the reach the item had: one module deeper,pub(super)reaches exactly the old module.Observable changes
Log targets: 2
tracingevents without an explicittarget:now log under the new module paths (pplx_space_api::controllers::substrate::<module>instead ofpplx_space_api::controllers::substrate). Nothing in the repository selects on these targets exactly.sql!locators: the leading/*module:line*/comment of 1 moved statement now names the new module path.A test pins a locator:
controllers::sandbox::lifecycle::characterization_tests::completed_actions_do_not_wait_for_a_key_share_lockmatchespersist_optional_current_local_artifact's statement inpg_stat_activityby its/*pplx_space_api::controllers::substrate:N*/locator. Moving that function made the test fail, so it stays inmod.rs. OnlyPublishedLocalArtifactandreject_deleting_current_local_artifactmove tolocal_artifact;EnqueuedArtifactBackupandPublishedDurableSnapshotstay with the parent code that uses them.Comment:
space-node-api-local/values.yamlcitedinternal_clientinsubstrate/mod.rs; a docs commit points it atsubstrate/node_api_client.rs.Diagnostics name new locations:
expect,unwrap,unreachable!, asserts) in moved code name the new file and line;code.filepath,code.linenoandcode.namespace;std::any::type_nameof a moved type names its new module;sql!locators that stay in the parent shift line numbers;The reviews found nothing in the repository that depends on these.
Validation
Run on a Linux development machine on the previous base (b9fc395). After #552 merged, the branch was regenerated from the same spec on the new main, and
verifypasses there; this PR's CI validates the regenerated head.cargo check --workspace --all-targets --all-features --locked: pass, no warnings.run_clippy_checkswith-D warnings: pass.cargo check -p pplx-space-api --no-default-features --all-targets: pass (the crate's default feature set is empty, so this is also the default build).cargo nextest run -p pplx-space-api --all-featureswith Postgres, Redis andSPACE_CI_REQUIRE_TEST_DEPS=1: 1,826 passed, 1 skipped (the#[ignore]occupancy benchmark). This includes the Kubernetes adapter tests, which compile only with--features kubernetes.cargo doc --document-private-items: the same 19 warnings as main.Interactions
Open PRs touching
substrate/mod.rs: #559, #554, #545 (draft), #350 (draft), #336 (draft) and #168. This branch is regenerated on main after #552 merged. Their hunks were mapped onto current main by content. None edits an item this PR moves, and every item they edit stays inmod.rs: the trait, the dispatch impl,SubstrateError, capabilities and lifecycle request types.Follow-ups, kept out of this PR because
verifyallows no other Rust edits: the movedpool_claimscomment that says "only this module knows which condition occurred";pool_eligibility_testsplacement; parent imports used only by children; and deleting the uncalledconnect_worker_internal.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