Repository navigation
nvx-rs: split filesystem, instance, and sandbox lifecycle - #945
Merged
Pedro Henrique Penna (ppenna) merged 7 commits intoOct 28, 2026
Merged
Conversation
Perform the byte-for-byte preparatory git mv for #898 in its own commit. Keep it separate from the following split so git log --follow and git blame preserve the existing history. This changes no public paths, test names, or behavior; it only moves the file into its module directory. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Separate guest/host path helpers, policy resolution, OpenVMM limits, and recorded-plan checks/rendering along existing sections. Keep request/plan types and planning in mod.rs; retain existing public and crate-private entry points through explicit re-exports; expose shared private helpers only to the parent; disambiguate guest_path function links; and move unchanged inline tests to filesystem/tests.rs while preserving host::filesystem::tests paths. This is partial progress on #898 and does not close the issue. Validation: 28 filesystem tests, 22 layering tests, identical 1090-test Windows list, and unchanged Windows/Linux public surfaces. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move instance.rs to instance/mod.rs as a pure rename, preserving history and blame for the module. The source and destination blobs are identical, so this commit contains no content changes. This prepares the instance module for #898 without changing behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Separate atomic private-file helpers, lock-held lifecycle transitions, and workload output/cancellation into focused sibling modules. Leave instance identity, lookup states, launch/session helpers, and the public facade in mod.rs. Explicit reexports keep all public paths; parent-only visibility limits fields and helpers shared by siblings. Keep tests at host::instance::tests and pin moved intra-doc links to crate paths. This is partial progress on #898 and does not close the issue. Validation: 7 instance tests, full all-target/all-feature Clippy with -D warnings, layering guard, identical 1090-test Windows list, and zero Windows/Linux API diff. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move lifecycle.rs to lifecycle/mod.rs as a pure rename, preserving history and blame for the sandbox lifecycle module. The source and destination blobs are identical, so this commit contains no content changes. This prepares the lifecycle module for #898 without changing behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Separate state-directory handling, outcome reports, start/exec, and stop/deprovision along current sections. Keep configuration and VM discovery in the facade, retain REQUIRED_FEATURES at its existing crate-private root path and reexport entry points; parent-only visibility for helpers shared by siblings. Move inline tests to lifecycle/tests.rs without changing host::cli::sandbox::lifecycle::tests; use explicit function links for start/stop and stable crate-qualified doc links. This is partial unblocked work for #898 and does not close the issue. Validation: 3 targeted lifecycle tests passed, 22 guard tests passed, all-target/all-feature Clippy with -D warnings passed, identical Windows test list, and zero Windows/Linux API diff. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Describe how filesystem planning, instance lifecycle and execution, and managed CLI transitions are divided into private sibling files while their facades retain the existing public module paths. Keep tests at their existing module paths without renaming them, using re-exports and tests.rs to preserve those interfaces. Contributors should use the mod.rs facades rather than private siblings so the source boundaries remain enforceable and public APIs and test paths stay stable. This is partial progress on #898 and does not close the issue. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the host-module refactor.
No open issues 🎉
What changed in this PR
Continues #898 by splitting three large NVX host modules into focused directory modules, following #921. The refactor preserves existing entry points and test module paths; platform, store, and supervisor splits remain deferred.
Changes:
- Separates filesystem path handling, access policies, limits, and recorded-plan verification from request types and planning.
- Extracts instance file operations, locked lifecycle transitions, and workload execution, plus managed sandbox CLI lifecycle operations.
- Moves inline tests into sibling files and documents the new layout.
| File | Description |
|---|---|
nvx-rs/src/host/instance/tests.rs |
Relocates instance tests without changing module paths. |
nvx-rs/src/host/instance/mod.rs |
Retains instance types and entry points with explicit re-exports. |
nvx-rs/src/host/instance/locked.rs |
Holds lock-protected lifecycle transitions. |
nvx-rs/src/host/instance/files.rs |
Extracts private-file operations and temporary-file cleanup. |
nvx-rs/src/host/instance/execution.rs |
Extracts workload output, cancellation, and outcomes. |
nvx-rs/src/host/filesystem/verify.rs |
Holds recorded-plan checks and argument rendering. |
nvx-rs/src/host/filesystem/policy.rs |
Extracts access-policy resolution and validation. |
nvx-rs/src/host/filesystem/mod.rs |
Keeps request types, planning, and existing entry points. |
nvx-rs/src/host/filesystem/limits.rs |
Extracts export-root checks and policy limits. |
nvx-rs/src/host/filesystem/host_path.rs |
Extracts host-path normalization and identity helpers. |
nvx-rs/src/host/filesystem/guest_path.rs |
Extracts guest-path translation and containment helpers. |
nvx-rs/src/host/cli/sandbox/lifecycle/tests.rs |
Relocates lifecycle tests under their existing module path. |
nvx-rs/src/host/cli/sandbox/lifecycle/stop.rs |
Extracts stopping, termination, and deprovisioning. |
nvx-rs/src/host/cli/sandbox/lifecycle/start.rs |
Extracts startup, readiness, and workload execution. |
nvx-rs/src/host/cli/sandbox/lifecycle/outcome.rs |
Extracts outcome-report validation and publication. |
nvx-rs/src/host/cli/sandbox/lifecycle/mod.rs |
Retains configuration, provisioning, VM discovery, and re-exports. |
nvx-rs/src/host/cli/sandbox/lifecycle/directory.rs |
Extracts state-directory creation and resolution. |
nvx-rs/src/host/cli/sandbox/lifecycle.rs |
Removes the monolithic file in favor of directory modules. |
nvx-rs/README.md |
Documents module responsibilities and compatibility preservation. |
Review effort: Balanced
Pedro Henrique Penna (ppenna)
deleted the
agents/issue-898-unblocked-host-modules
branch
October 28, 2026 20:22
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
Continue #898 with the three host files newly unblocked by the merges of #885 and #886:
The first four candidates already landed in #921. This PR deliberately leaves #898 open: Linux/Windows platform, store, and supervisor splits remain for follow-up; they were deferred for overlapping work when this three-file scope was selected. #887 has since merged; #888 remains open.
sandbox/plan.rsstays whole.Compatibility and commits
Each original file has its own byte-for-byte, history-preserving
git mvcommit followed by a separate split commit. A seventh commit documents the source layout. No unrelated changes or fixup commits remain.Existing public entry points are explicitly re-exported, shared private helpers/fields are parent-only, and no duplicated helpers are consolidated. Inline tests move to
tests.rsunder their original module paths. Moved intra-doc links use stable crate paths, and function links to guest_path/start/stop are disambiguated from the new modules. The CLI's REQUIRED_FEATURES retains its existing crate-private path.Local validation
Validated on Windows without a hypervisor:
python scripts\nvx.py verify, Markdown links, and formatting.-D warningsfor all targets/all features, the default library, and feature-free library.Checked after each split and again on the final head:
cargo test --locked --all-features -- --listoutput is identical to the pre-refactor baseline: 1,090 tests, no renamed tests.No SSH profiles are configured in this worktree. Linux execution and hardware-dependent gates are left to the PR CI matrix; local Linux checks above are cross-target compilation/API checks, not claims that Linux binaries ran on Windows.
Current working directory: C:\Users\ppenna\Projects\nvx.worktrees\issue-898-fix-split-commits-validate
Completed CI and review
078e9ff5e4050928366c918a4b5fb3ea64a3d6b0.6464eb005bf6b7dc9eb09fc6c1a68a39c702b82d.--listparity is 1,090 entries (see validation above).