Skip to content

nvx-rs: split the platform modules, the store, and the supervisor along their sections - #1064

Open
Pedro Henrique Penna (ppenna) wants to merge 7 commits into
devfrom
agents/fix-issue-898-draft-pr-review-comments
Open

Pedro Henrique Penna (ppenna) wants to merge 7 commits into
devfrom
agents/fix-issue-898-draft-pr-review-comments

Conversation

@ppenna

@ppenna Pedro Henrique Penna (ppenna) commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Closes #898. Part of #896.

This splits the last four of the oversized files of nvx::host that #898 lists, platform/windows.rs, platform/linux.rs, store/mod.rs, and supervisor/mod.rs, into directory modules along their existing sections. #921 split network/mod.rs, artifacts.rs, cli/sandbox/mod.rs, and sandbox/mount.rs, and #945 split filesystem.rs, instance.rs, and cli/sandbox/lifecycle.rs; the pull requests that edited the files of this one (#881, #885, #886, #887, #888) have all merged since. sandbox/plan.rs stays whole, as #898 says.

The code moves unchanged. The public API, the names of the tests, and the targets of the intra-doc links stay the same.

Commits

Each commit splits one file. A file that becomes X/mod.rs first moves there with git mv, in a commit of its own, so that git log --follow and git blame follow it; store/mod.rs and supervisor/mod.rs are already mod.rs files.

  1. nvx-rs: move the Windows platform module into a directory. platform/windows.rs moves to platform/windows/mod.rs unchanged.
  2. nvx-rs: split the Windows platform module along its sections. 3,630 lines become process.rs, spawn.rs, private.rs, identity.rs, log_claim.rs, endpoint.rs, interrupt.rs (feature cli), and tests.rs. SUPPORTED, the handle helpers, and probe_hypervisor stay in mod.rs.
  3. nvx-rs: move the Linux platform module into a directory.
  4. nvx-rs: split the Linux platform module along its sections. 1,215 lines become process.rs, spawn.rs, private.rs, identity.rs, log_claim.rs, endpoint.rs, and tests.rs. The constants and probe_hypervisor stay in mod.rs.
  5. nvx-rs: split the sandbox store along its sections. store/mod.rs (1,362 lines) becomes names.rs (FORMAT and the file names), locked.rs (LockedStore and Reservation), and launch.rs (end_process, Recovery, and Launch). The module documentation, SandboxStore, and its helpers stay in mod.rs (658 lines).
  6. nvx-rs: split the supervisor along its sections. supervisor/mod.rs (1,015 lines) becomes launch.rs, vmm.rs, and reattach.rs. The module documentation and the spawn re-exports stay in mod.rs.
  7. doc: describe the split platform, store, and supervisor sources. The README's layout section, which nvx-rs: split filesystem, instance, and sandbox lifecycle #945 started, covers the new siblings.

Where this departs from #898's plan

What changes besides the moved lines

Each commit message lists these in detail.

  • Visibility. The new modules are private. Each mod.rs re-exports the public items, and the crate-visible items that other modules use, under their visibility. platform/mod.rs, which re-exports the platform's module with a glob, keeps its surface. A re-export that only one feature or only tests use takes that cfg, as in nvx-rs: split four of the host's oversized files into directory modules #921. The private helpers and fields that siblings or the tests share become pub(super), as nvx-rs: split the host's oversized files into directory modules #898 asks.
  • super:: paths in code. The moved calls of host::platform's unless_exited, parse_hex_id, parse_host_id, and time_left, which went through super::, import them instead, and Windows' spawn test hook goes through super::tests.
  • Imports. Each new file imports what its code uses. Imports that only cli code uses take cfg(feature = "cli"). The tests import the names that they took from mod.rs's imports through their glob.
  • Intra-doc links (nvx-rs: break the host module into finer-grained modules #896, invariant 6). A moved link to an item that its new file does not import gets a link definition with a crate:: path. The moved links written with self#section or super::, which would now name the new modules (self#removal would name store::names, and super::launch::MAX_TIMEOUT would name supervisor::launch rather than host::launch), become references to definitions with crate:: paths, and the lines that they shorten take words from the lines below them, while the other lines keep their bytes. The module documentation of store and supervisor gets definitions after its last line, for the names that it resolved through the imports that mod.rs drops, and for the fn@ links, so that the lines of their doctests, which name those tests, do not move. The rendered documentation does not change.
  • Formatting. rustfmt joins two Windows test statements without the indentation of the inline module, and wraps one signature that pub(super) makes too long.

Validation

I ran the checks on Windows 11 with Rust 1.95.0 and the 1.89 MSRV, against dev at 2266fa59, at each commit, which a script checks out in turn:

  • Public API (nvx-rs: break the host module into finer-grained modules #896, invariant 1). cargo public-api diff of rustdoc's JSON with all features (RUSTC_BOOTSTRAP=1 cargo rustdoc --lib --all-features -- -Z unstable-options --output-format json) for x86_64-pc-windows-msvc and x86_64-unknown-linux-gnu finds no difference from dev at any commit.
  • Test names (nvx-rs: break the host module into finer-grained modules #896, invariant 2). cargo test -- --list on Windows lists exactly the tests of dev with all features (1,322), with default features (1,085), and for the library without default features (270), doctests included, whose names carry their lines.
  • Intra-doc links (nvx-rs: break the host module into finer-grained modules #896, invariant 6). From rustdoc's JSON with --document-private-items, for both targets, every item of the crate keeps its path, naming the items of the new modules as their parent's (16,512 on Windows and 27,610 on Linux), and every intra-doc link keeps its target (2,856 and 3,893). The only documentation that changes is that of the link definitions above. rustdoc reports the same 13 and 15 warnings with private items as on dev.
  • Lints. rustfmt passes, and Clippy with -D warnings passes for Windows and for Linux on all targets with all features and with default features, and on the library with and without default features. cargo check passes for macOS (aarch64-apple-darwin) and with Rust 1.89. At each split commit as I wrote it, Clippy also passed on all targets with cli and on the library with each of cli, testing, and bundled, for Windows and Linux, and rustdoc with -D warnings passed.
  • Tests. At the last commit, the steps of check-nvx-rs pass on Windows: rustfmt; the tests with all features (1,304 passed), with default features (1,068), and of the library without default features (270); and the runtime adapter's protocol-only (48 tests) and host-only (125 tests) configurations, with their rustfmt, Clippy, rustdoc, and 1.89 checks, and Clippy on its guest-only configuration for x86_64-unknown-linux-musl. At each split commit, the tests of the split module pass too: 28 of host::platform on Windows, 64 of host::store and the 11 of tests/store.rs, 26 of host::supervisor and the 20 that tests/supervisor.rs runs, and the doctests of the store and the supervisor, whose names keep their lines.
  • The guard. tests/host_modules.rs passes (22 tests) at each split commit and at the last.
  • Moved code. A script compares each new file, without its documentation and imports, with the lines of the original that it took; the only differences are the ones above.

I compiled, linted, and documented the Linux code from Windows, but CI ran it. CI run 41158921792 at e39976ac passed, the hypervisor-backed jobs included. Its nvx-rs jobs ran the same tests as those of dev's run 41155080692 at bad44022, whose only change to nvx-rs since this branch's base is in the body of a test of cli::session. On Windows, they report the same 2,817 passed and 127 ignored tests. On Linux, the logs name the same tests the same 4,993 times, with none failed; the counts by result differ only where the output of tests that run their binary again as a child interleaves with the results.

Coordination

Two pull requests that were opened while this one was in progress edit the platform modules that it splits, so whichever merges second conflicts on them. The resolution applies their changes to the files that now hold the same code; no other open pull request edits the files that this one splits.

  • nvx-rs: start VMMs with the caller's umask without the owner's bits #1060 rewrites the doc comments of detach and inherit_only in platform/linux.rs, and changes nothing else there. Those functions move unchanged to platform/linux/spawn.rs, where its doc comments apply as they are.
  • runtime-adapter: prove two clone-restore invariants from the host side #1068 adds read counters and an unread method. On Linux, ProcessHandle::bytes_read, own_bytes_read, and read_count belong in platform/linux/process.rs, UnixTransport::unread in platform/linux/endpoint.rs, and its test in platform/linux/tests.rs. On Windows, read_transfer, own_bytes_read, and ProcessHandle::bytes_read belong in platform/windows/process.rs, with the imports of GetProcessIoCounters and IO_COUNTERS. Each platform's mod.rs then re-exports own_bytes_read, which platform re-exports to the crate. Its changes to platform/mod.rs and platform/other.rs, which this pull request does not split, apply as they are.

Copilot AI max review requested due to automatic review settings October 31, 2026 01:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block the host-module reorganization.

No open issues 🎉

What changed in this PR

Completes the remaining host-module splits planned in #898, continuing #896’s structural refactor. The changes reorganize existing code while preserving public entry points, test names, and documentation link targets.

Changes:

  • Split Linux and Windows platform implementations into focused private modules.
  • Extract store constants and launch handling, and separate supervisor launches, VM lifecycle operations, and reattachment.
  • Adjust imports, visibility, and documentation links for the new layout, and document it in the README.
File Description
nvx-rs/​src/​host/​supervisor/​vmm.rs Moves VM handles, stopping, and termination into a dedicated module.
nvx-rs/​src/​host/​supervisor/​tests.rs Updates imports for the extracted supervisor modules.
nvx-rs/​src/​host/​supervisor/​reattach.rs Isolates reattachment and runtime-identity checks.
nvx-rs/​src/​host/​supervisor/​launch.rs Isolates launch, commit, and abandonment handling.
nvx-rs/​src/​host/​store/​tests.rs Updates imports for the store split.
nvx-rs/​src/​host/​store/​names.rs Collects record-format and store-file constants.
nvx-rs/​src/​host/​store/​launch.rs Moves launch transactions and recovery outcomes into a sibling module.
nvx-rs/​src/​host/​platform/​windows/​process.rs Isolates process handles, host identity, and time queries.
nvx-rs/​src/​host/​platform/​windows/​private.rs Collects privacy checks and protected filesystem operations.
nvx-rs/​src/​host/​platform/​windows/​mod.rs Declares private modules and preserves existing exports.
nvx-rs/​src/​host/​platform/​windows/​log_claim.rs Isolates job-object and log-claim handling.
nvx-rs/​src/​host/​platform/​windows/​interrupt.rs Separates CLI Ctrl-C handling.
nvx-rs/​src/​host/​platform/​windows/​identity.rs Collects file identities and directory-handle operations.
nvx-rs/​src/​host/​platform/​windows/​endpoint.rs Isolates named-pipe transport and restore-ready listeners.
nvx-rs/​src/​host/​platform/​linux/​tests.rs Moves platform tests into their existing module path.
nvx-rs/​src/​host/​platform/​linux/​spawn.rs Separates process detachment and descriptor inheritance.
nvx-rs/​src/​host/​platform/​linux/​process.rs Isolates process identity, pidfd waits, and host-time queries.
nvx-rs/​src/​host/​platform/​linux/​private.rs Collects ownership, permission, and private-file operations.
nvx-rs/​src/​host/​platform/​linux/​mod.rs Retains constants and hypervisor probing while re-exporting moved items.
nvx-rs/​src/​host/​platform/​linux/​log_claim.rs Isolates log locking and launch-process verification.
nvx-rs/​src/​host/​platform/​linux/​identity.rs Collects file identities and directory-relative operations.
nvx-rs/​src/​host/​platform/​linux/​endpoint.rs Isolates Unix-socket transport and restore-ready listeners.
nvx-rs/​README.md Documents the platform, store, and supervisor source layout.

Review effort: Max

@ppenna
Pedro Henrique Penna (ppenna) marked this pull request as ready for review October 31, 2026 02:12
@ppenna
Pedro Henrique Penna (ppenna) added this pull request to the merge queue Oct 31, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 31, 2026
host/platform/windows.rs holds, in 3,659 lines, the Windows primitives
of NVX hosts: the processes that the host holds and spawns, the
directories and files private to the current user, the identities of
files, the claim of a launch's log, OpenVMM's named-pipe endpoints, the
CLI's Ctrl-C, and 1,085 lines of inline tests. The next commit splits it
into a directory module along those sections, as #898 lays them out.

Move it first, unchanged, to host/platform/windows/mod.rs, with git mv,
in a commit of its own, so that git log --follow and git blame follow it
through the split. Its module path, host::platform::windows, stays the
same, and with it the paths of its items and the names of its tests.

Validation at this commit, on Windows: the crate builds with all
features and all targets, and the lists of tests, with all features,
with default features, and of the library without default features, are
those of dev (1,323, 1,086, and 270).

Part of #898.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
host/platform/windows/mod.rs, which the previous commit moved from
host/platform/windows.rs, held the Windows primitives of NVX hosts.
Split it along its sections, as #898 lays them out:

- process.rs: from creation_time through monotonic_ns, the processes
  that this user may query, wait for, and terminate, held through
  their handles, the bytes that processes read, the identities of the
  boot and of the host, and the host's monotonic time;
- spawn.rs: from LaunchedProcess through append_argument, the spawns
  of OpenVMM, which pass it only the handles that they list, and the
  processes that they launch;
- private.rs: from create_private_dir through set_access, the
  directories and files that only the current user may access and
  their access control lists, and make_sparse and rename_no_replace;
- identity.rs: from file_identity through handle_information, the
  identities of files, is_deleted, and Directory;
- log_claim.rs: from claim_log through serves_launch, the claim of a
  launch's log and the job object named after the log;
- endpoint.rs: from control_endpoint through PipeTransport, the named
  pipes of OpenVMM's control endpoint and of a clone's restore-ready
  event;
- interrupt.rs: from INTERRUPTED through interrupted, the CLI's Ctrl-C;
- tests.rs: the inline tests, which keep their module path,
  host::platform::windows::tests, and so their names.

SUPPORTED, the handle helpers from wide through open_handle, and
probe_hypervisor stay in mod.rs.

Since #898 was written, #1040 grew the claim from a few lines into the
job objects of 330 lines, which would make identity.rs 690 lines, more
than the smallest of the files that #898 splits. The claim gets a
module of its own, as it does on Linux in a later commit, so that both
platforms keep the same modules.

The code moves unchanged. The new modules are private, and mod.rs
re-exports their items under the visibility that they had, so that
host::platform, which re-exports the items of the platform's module
with a glob, keeps its surface. The re-exports of spawn_foreground,
watch_interrupts, and interrupted take the cli feature, as those items
do, and that of set_access takes test. interrupt.rs holds items of the
cli feature alone, so its module takes the feature, and its items drop
their own cfg attributes.

The helpers that the new modules take from one another become
pub(super): from process.rs, creation_time and refused_termination,
which spawn.rs takes, and the fields of ProcessHandle, which
LaunchedProcess::pin fills; from identity.rs, handle_information and
status_error; and from private.rs, CurrentUser and its constructor,
with_owner_only_attributes, Required, and privacy_problem. So do the
helpers that the tests take: wait_step and end_process, command_line
and the process field of LaunchedProcess, and log_job_name,
log_job_id, object_name, local_directory, and log_job_processes. The
spawn's test hook, which spawn_listed calls, now goes through
super::tests, and the calls of host::platform's unless_exited,
parse_host_id, and time_left, which went through super::, import them
instead. Imports that only cli code uses take cfg(feature = "cli"). The
tests import the names that they took from mod.rs's imports through
their glob, and without the indentation of the inline module, rustfmt
joins two of their statements.

Eleven links in the moved documentation name items that their new
modules do not import: spawn_detached, control_endpoint,
LaunchedProcess::pin, create_log_job, and log_claim_held, which now
live in sibling modules, and SpawnLock and spawn_command, which three
links named with super:: paths that would now resolve from
host::platform::windows rather than host::platform. Each of their doc
comments gets link definitions with crate paths (#896, invariant 6),
the super:: links become references to them, and the two paragraphs
that held those links are rewrapped. The rendered documentation does
not change.

Validation at this commit, on Windows: cargo public-api finds no
difference from dev in rustdoc's JSON for Windows and for Linux, and,
with private items, the crate's 16,518 items keep their names, with
the items of the new modules named as their parent's, and its 2,866
intra-doc links keep their targets; only the eight doc comments above
change, and rustdoc reports no new warning. The lists of tests, with
all features, with default features, and of the library without
default features, are those of dev (1,323, 1,086, and 270). Clippy with
warnings denied passes for Windows on all targets with all features,
with default features, and with cli, on the library with default
features, without them, and with each of cli, testing, and bundled,
and for Linux on all targets and on the library; cargo check passes
for macOS and with Rust 1.89; rustdoc with warnings denied passes; and
the 28 tests of host::platform and the 22 of the host-module guard
pass.

Part of #898.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
host/platform/linux.rs holds, in 1,315 lines, the Linux primitives of
NVX hosts: the processes that the host holds, the identities of the
boot and of the host, the spawns that pass a VMM only the descriptors
that they list, the directories and files private to the current user,
the identities of files, the claim of a launch's log, OpenVMM's Unix
socket endpoints, and 158 lines of inline tests. The next commit splits
it into a directory module along those sections, as #898 lays them
out.

Move it first, unchanged, to host/platform/linux/mod.rs, with git mv,
in a commit of its own, so that git log --follow and git blame follow
it through the split. Its module path, host::platform::linux, stays the
same, and with it the paths of its items and the names of its tests.

Validation at this commit, on Windows: Clippy with warnings denied
passes for Linux on all targets and on the library, with all features,
with default features, and without them.

Part of #898.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
host/platform/linux/mod.rs, which the previous commit moved from
host/platform/linux.rs, held the Linux primitives of NVX hosts. Split
it along its sections, as #898 lays them out, and as the previous
commits split the Windows module:

- process.rs: from process_start_time through monotonic_ns, the
  processes that this user may wait for and kill, held through pidfds,
  the bytes that processes read, the identities of the boot and of the
  host, and the host's monotonic time;
- spawn.rs: detach, inherit_only, and allowlist, which pass OpenVMM no
  descriptor of the caller but those that they list;
- private.rs: from create_private_dir through open_plain_dir, the
  directories and files that only the current user may access and
  their modes, and make_sparse, rename_no_replace, and
  restore_private_file_mode;
- identity.rs: from file_identity through Directory, the identities of
  files, is_deleted, and the open directories;
- log_claim.rs: claim_log, log_claim_held, and serves_launch, the
  claim of a launch's log, which on Windows needs a module of its own;
- endpoint.rs: from control_endpoint through UnixTransport, the Unix
  sockets of OpenVMM's control endpoint and of a clone's restore-ready
  event;
- tests.rs: the inline tests, which keep their module path,
  host::platform::linux::tests, and so their names.

The re-export of the sys module's interrupt functions for the CLI, the
constants at the top of the file, and probe_hypervisor stay in mod.rs.

The code moves unchanged. The new modules are private, and mod.rs
re-exports the items that other modules take from host::platform,
under the visibility that they had, so that host::platform, which
re-exports the items of the platform's module with a glob, keeps its
surface. Only the CLI uses inherit_only, whose re-export takes the cli
feature, as the item does, and only tests outside the module use
check_identity, start_time_from_stat, store_dir_problem, and
owner_only_problem, whose re-exports take test, as the crate's other
re-exports for tests alone do. No module outside host::platform::linux
uses foreign_writer or other_threads_remain, which need no re-export.

identity.rs takes owner_and_mode from private.rs, which becomes
pub(super), as do wait_step, which the tests take from process.rs,
and UnixTransport and its stream field, with which a test builds a
transport.
The calls of host::platform's unless_exited, parse_hex_id,
parse_host_id, and time_left, which went through super::, import them
instead. The tests import the names that they took from mod.rs's
imports through their glob.

One link in the moved documentation of Directory::store_dir_problem
names check_store_dir, which identity.rs does not import. Its doc
comment gets a link definition with the crate path (#896, invariant
6), and the rendered documentation does not change.

Validation at this commit, on Windows: cargo public-api finds no
difference from dev in rustdoc's JSON for Windows and for Linux, and,
with private items, the crate's 27,621 items for Linux keep their
names, with the items of the new modules named as their parent's, and
its 3,903 intra-doc links keep their targets; only the doc comment
above changes, and rustdoc reports no new warning. Clippy with warnings
denied passes for Linux on all targets with all features, with default
features, and with cli, and on the library with default features,
without them, and with each of cli, testing, and bundled. The Linux
tests run in CI.

Part of #898.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
host/store/mod.rs held, in 1,362 lines, the store's module
documentation, the version of its records and the names of its files,
SandboxStore and its helpers, LockedStore, and the launches that a
locked store begins. Split it along those sections, as #898 lays them
out:

- names.rs: from FORMAT through FILE_NAMES, the version of the store's
  records and the names of the files that it keeps in a sandbox's
  directory;
- locked.rs: LockedStore, the Reservation of a clone's launch, and
  their implementations;
- launch.rs: end_process, Recovery, and Launch, a launch in progress
  from the marker of its journal to its runtime record.

The module documentation, the existing submodules, SandboxStore and
its helpers, and the constants of its waits, LOCK_RETRY_INTERVAL and
CLAIM_RELEASE_WAIT, stay in mod.rs. The module documentation keeps its
lines, so its two doctests keep their names, which name their lines.

The code moves unchanged. The new modules are private, and mod.rs
re-exports their public items, so every path under nvx::host::store
resolves as before, and Reservation, which other modules of the crate
import, under its pub(crate) visibility. It also imports
CLONE_FILE_NAMES, which lifecycle.rs takes from it. LockedStore's
constructor, end_launch, and end_identified, and its lock, files, and
lock_removed fields, which mod.rs, launch.rs, lifecycle.rs, and the
tests use, become pub(super), as do end_process and the fields of
Launch, which locked.rs uses, and CLONE_FILE_NAMES. The new modules
take the record and vmm modules through super. mod.rs drops the
imports that only the moved code used, and the tests import
FileIdentity and Process, which they took from them through their
glob.

The moved documentation linked to the sections of the module
documentation with self#, which would now name the new modules, and to
super::instance and super::supervisor::spawn, which would now resolve
from host::store rather than host. It also named ErrorKind and the
store's file names, which the new modules do not import. Each of those
doc comments gets link definitions with crate paths (#896, invariant
6), its self# and super:: links become references to them, and the
lines that they shortened take words from the lines below them. The
module documentation gets definitions for Process, Process::open, and
ProcessRef, which it named through the imports that mod.rs drops. The
rendered documentation does not change.

Validation at this commit, on Windows: cargo public-api finds no
difference from dev in rustdoc's JSON for Windows and for Linux, and,
with private items, the crate's items keep their names, with the items
of the new modules named as their parent's, and its intra-doc links
keep their targets, 2,866 for Windows and 3,903 for Linux; only the
doc comments above change, and rustdoc reports no new warning. The
lists of tests, with all features, with default features, and of the
library without default features, are those of dev (1,323, 1,086, and
270). Clippy with warnings denied passes for Windows and Linux on all
targets with all features, with default features, and with cli, and
on the library with default features, without them, and with each of
cli, testing, and bundled; cargo check passes for macOS and with Rust
1.89; rustdoc with warnings denied passes; and the 64 tests of
host::store, the 11 of tests/store.rs, the store's two doctests, and
the 22 tests of the host-module guard pass.

Part of #898.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
host/supervisor/mod.rs held, in 1,015 lines, the supervisor's module
documentation, its launches, the VMs that it holds and their stops,
and its reattaches. Split it along those sections, as #898 lays them
out:

- launch.rs: launch, LaunchFailure, launch_reporting, abandon_after,
  and Starting, the launches through the store's launch journal and
  the starting launches that their callers commit or abandon;
- vmm.rs: Vmm, StopOutcome, Stopped, and the stop and terminate steps,
  from check_bound through undetermined;
- reattach.rs: Reattached, reattach, reattach_reporting, and
  reattach_with.

mod.rs keeps the module documentation, whose lines do not change, so
its doctest keeps its name, which names its line, and the re-exports
of the spawn and inheritance items.

The code moves unchanged. The new modules are private, and mod.rs
re-exports their public items, so every path under
nvx::host::supervisor resolves as before, and launch_reporting and
reattach_reporting, which the template's clones use, under their
pub(crate) visibility. The fields of Vmm, which launch.rs and
reattach.rs fill, become pub(super), as do the helpers that the tests
take: Vmm's stop_with, stop_unless_exited_with, and terminate_with,
and Stoppable, stop_process, terminate_process, and reattach_with.
rustfmt wraps the signature of terminate_process, which the visibility
makes too long for one line. mod.rs drops the imports that only the
moved code used, and the tests import the names that they took from
them through their glob.

launch and reattach now name both a module and a function of
host::supervisor, which makes the links to the functions ambiguous
(#896, invariant 6): the module documentation's links to them, and
the links of vmm.rs, take fn@ definitions. The module documentation
also gets definitions for the store's and the process module's items
that it named through the imports that mod.rs drops. Three links of
vmm.rs named MAX_TIMEOUT with super::launch, which from vmm.rs names
the new module rather than host::launch, and so no longer resolves;
they become references to a definition with its crate path, and the
lines that they shortened take words from the lines below them. Two
other links of vmm.rs name Starting::commit and
Reattached::Mismatched, which vmm.rs does not import, and get
definitions too. The rendered documentation does not change.

Validation at this commit, on Windows: cargo public-api finds no
difference from dev in rustdoc's JSON for Windows and for Linux, and,
with private items, the crate's items keep their names, with the items
of the new modules named as their parent's, and its intra-doc links
keep their targets, 2,866 for Windows and 3,903 for Linux; only the
doc comments above change, and rustdoc reports no new warning. The
lists of tests, with all features, with default features, and of the
library without default features, are those of dev (1,323, 1,086, and
270). Clippy with warnings denied passes for Windows and Linux on all
targets with all features, with default features, and with cli, and
on the library with default features, without them, and with each of
cli, testing, and bundled; cargo check passes for macOS and with Rust
1.89; rustdoc with warnings denied passes; and the 26 tests of
host::supervisor, the 20 that tests/supervisor.rs runs, the
supervisor's doctest, and the 22 tests of the host-module guard pass.

Part of #898.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The README's layout section describes how #945 split the filesystem
module, the instance module, and the CLI's managed sandbox lifecycle
into private siblings behind their mod.rs files. Describe the same for
the modules that the previous commits split: the Linux and Windows
platform modules, which keep the same siblings, the store, and the
supervisor. The table of modules does not change, since no module's
purpose does.

Validation: scripts/check_markdown_links.py passes.

Part of #898.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ppenna
Pedro Henrique Penna (ppenna) force-pushed the agents/fix-issue-898-draft-pr-review-comments branch from e39976a to 8bdc4a8 Compare October 31, 2026 06:05

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nvx-rs: split the host's oversized files into directory modules

2 participants