Repository navigation
nvx-rs: group the host's modules into layered subsystems #899
Description
Parent: #896. Needs: #897; preferably #898; and a decision whether the test-name changes below are acceptable.
Goal. Group host's children into private, layered subsystem modules, re-exported at today's paths:
| Group | Children |
|---|---|
host/os/ |
sys, platform, process, spawn, seal |
host/policy/ |
network, filesystem |
host/control/ |
nvxs, session |
host/runtime/ |
store, artifacts, launch, supervisor, report, instance |
python/, sandbox/ and cli/ stay where they are. host/mod.rs declares the groups as private modules and re-exports their children, for example pub use self::runtime::{artifacts, instance, launch, report, store, supervisor};, and the crate-private sys and spawn through private uses. Public paths and rustdoc URLs stay unchanged, because rustdoc inlines re-exports from private modules; verify this.
Today (dev 6af32ba0), with #897's moves, the groups are layered already: os ← policy, control ← runtime ← sandbox ← cli, and python is a leaf that runtime, sandbox and cli use.
Costs:
- The test names of moved modules change:
host::store::tests::xbecomeshost::runtime::store::tests::x. Their source paths change too; git follows the renames. super::paths across groups becomecrate::host::paths. 14 imports in 7 files fail to compile until then:filesystem.rs:43,instance.rs:66,67and69,launch.rs:13,14and96,nvxs.rs:42,session.rs:10,store/mod.rs:239-242andsupervisor/mod.rs:108. 5 intra-doc links break, whichcargo doc -D warningsreports:artifacts.rs:143,instance.rs:672, andprocess.rs:18,19and38. A link retargets silently only where its new parent holds an item of the same name (nvx-rs: break the host module into finer-grained modules #896, invariant 6).- No visibility changes: no item of a direct child of host is
pub(super), so none nameshost. The 7pub(super)items ofseal.rs(seal.rs:261-358) sit in its inlineimpmodules, and nameseal, which moves with them. #[cfg(unix)]and#[allow(unsafe_code)]move with the declaration ofsys(host/mod.rs:65-67) intoos.- Links to moved files:
nvx-rs/README.md:626and648(src/host/store/mod.rs), andaci_edge_sandboxes/README.md:931and1164(src/host/network/policy/mod.rs). - Unaffected: the coverage family, because
pythonstays; the bundling filter, becauseartifactsremains a substring ofhost::runtime::artifacts::tests::*; and the examples of the mutants workflow, becausesandboxandclistay (nvx-rs: break the host module into finer-grained modules #896, invariant 2). host::template, once the template stack lands (nvx-rs: break the host module into finer-grained modules #896), depends onsandbox,supervisorandinstance, so it stays at the top level, besidesandboxandcli.
Guard. Extend #897's guard to check the group order: os ← policy, control ← runtime ← sandbox ← cli, with python a leaf.
Acceptance. Zero public API diff (#896, invariant 1). The guard enforces the group layering. The test list changes only by the documented prefix renames. CI is green.
Activity