Repository navigation
nvx-rs: prepare the CLI's move onto the store and supervisor - #675
Merged
Enrique Saurez (esaurez) merged 2 commits intoOct 22, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unjournaled legacy state can be overwritten, FIFO locks can hang transitions, and Windows guest bundles omit required provenance.
3 open issues
What changed in this PR
Moves the CLI’s managed sandbox lifecycle onto the shared host store and supervisor, while retaining CLI configuration and policy.
Changes:
- Adopts shared locking, launch recovery, runtime records, and process supervision.
- Reads runtime identities from artifact metadata without hashing artifacts.
- Updates lifecycle tests and documents the format switch.
| File | Description |
|---|---|
| scripts/test_microvm_tests.py | Updates simulated lifecycle behavior and regression checks. |
| scripts/nvx_tools/sandbox_lifecycle_tests.py | Adapts acceptance checks to shared-store state. |
| nvx-rs/tests/cli.rs | Adds identity, timeout, and crash-recovery coverage. |
| nvx-rs/src/testing/fake_openvmm.rs | Adds delayed exit after stop. |
| nvx-rs/src/host/supervisor/mod.rs | Exposes the child for failed-start cleanup. |
| nvx-rs/src/host/store/mod.rs | Clarifies record-format documentation. |
| nvx-rs/src/host/python/windows.rs | Removes unused file-status helpers. |
| nvx-rs/src/host/python/mod.rs | Updates filesystem helper documentation. |
| nvx-rs/src/host/python/fs.rs | Removes unused fstat support. |
| nvx-rs/src/host/process.rs | Updates remaining-caller documentation. |
| nvx-rs/src/host/platform/windows.rs | Removes obsolete byte-range lock helpers. |
| nvx-rs/src/host/cli/sandbox/state.rs | Removes the CLI runtime-format constant. |
| nvx-rs/src/host/cli/sandbox/mod.rs | Passes artifacts into lifecycle transitions. |
| nvx-rs/src/host/cli/sandbox/lock.rs | Delegates locking to the shared store. |
| nvx-rs/src/host/cli/sandbox/lifecycle.rs | Uses shared recovery, launch, and stop mechanisms. |
| nvx-rs/src/host/cli/sandbox/identity.rs | Removes CLI-specific process identity handling. |
| nvx-rs/src/host/artifacts.rs | Reads runtime identities from install metadata. |
| nvx-rs/README.md | Documents lifecycle and compatibility changes. |
| doc/run.md | Updates lifecycle usage and acceptance documentation. |
Review effort: Balanced
Enrique Saurez (esaurez)
force-pushed
the
esaurez/a1-host-h4-delegation-20261020
branch
from
October 21, 2026 04:12
501a3fe to
bea29f1
Compare
Enrique Saurez (esaurez)
force-pushed
the
esaurez/a1-host-h4-delegation-20261020
branch
from
October 21, 2026 17:05
bea29f1 to
18ba444
Compare
Base automatically changed from
esaurez/a1-host-h3-supervisor-20261020
to
dev
October 21, 2026 17:58
Enrique Saurez (esaurez)
force-pushed
the
esaurez/a1-host-h4-delegation-20261020
branch
from
October 21, 2026 18:43
18ba444 to
773878f
Compare
Enrique Saurez (esaurez)
marked this pull request as ready for review
October 21, 2026 18:50
This was referenced Oct 21, 2026
Enrique Saurez (esaurez)
force-pushed
the
esaurez/a1-host-h4-delegation-20261020
branch
from
October 22, 2026 00:35
773878f to
d219390
Compare
Enrique Saurez (esaurez)
force-pushed
the
esaurez/a1-host-h4-delegation-20261020
branch
from
October 22, 2026 04:59
d219390 to
141a04b
Compare
Enrique Saurez (esaurez)
requested a review
from Pedro Henrique Penna (ppenna)
October 22, 2026 16:40
ArtifactDir::runtime_identity returns the RuntimeIdentity of a root's OpenVMM executable, kernel, and Alpine initramfs, which a launch records in the sandbox's store and which decides whether a later host may reattach to the VM. It reads the SHA-256 digests that the install metadata lists, and never hashes an artifact: a release's SHA256SUMS, or, in a repository checkout, the build provenance that nvx.py writes to build/ with each artifact that it builds, and that nvx.py download installs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aa7b9fda-3774-4817-aa98-af05f8d50215
Build the OpenVMM command of a start from the arguments before and after its control endpoint, and check that the guest is ready in a function of its own, check_ready, so that the start can move onto supervisor::launch, which chooses the endpoint as it launches OpenVMM. The CLI's tests share the helpers that provision a sandbox with a command line for the fake OpenVMM, and that list a state directory. Nothing that the CLI does changes: it runs the same command, checks in the same order, and the recorded scenarios stay as they were. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: aa7b9fda-3774-4817-aa98-af05f8d50215
Enrique Saurez (esaurez)
force-pushed
the
esaurez/a1-host-h4-delegation-20261020
branch
from
October 22, 2026 21:07
141a04b to
f5cff88
Compare
Enrique Saurez (esaurez)
deleted the
esaurez/a1-host-h4-delegation-20261020
branch
October 22, 2026 21:50
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.


nvx-rs sandboxkeeps its own runtime records, lock, and spawn, wait, and kill code, which #772, stacked on this PR, replaces with the host layers that every host of a sandbox shares:host::store,host::supervisor, andhost::session. This PR prepares that move, and changes no behavior. Its earlier pushes held the whole move, which was split out into #772 to keep each review small.What changes
Runtime identity.
ArtifactDir::runtime_identityreads the identities of OpenVMM, the kernel, and the Alpine initramfs from install metadata, and never hashes an artifact;RuntimeIdentity::newadds this build's boot and control contract versions:SHA256SUMS, underbin/openvmm[.exe],guest/vmlinux, andguest/initramfs.cpio.gz;nvx.pywrites tobuild/with each artifact that it builds, and thatnvx.py downloadinstalls:executable_sha256ofopenvmm.provenance.json,kernel_sha256ofvmlinux.provenance.json, andinitramfs_sha256ofinitramfs.provenance.json.Nothing calls it yet: the CLI's managed
startrecords the identity that it reads in nvx-rs: move the CLI's sandbox lifecycle onto the store and supervisor #772, andhost::instancein nvx-rs: move host::instance onto the store and supervisor #721.The CLI's start.
startbuilds the OpenVMM command from the arguments before and after its control endpoint, and checks that the guest is ready in a function of its own,check_ready, so that nvx-rs: move the CLI's sandbox lifecycle onto the store and supervisor #772 can launch OpenVMM withsupervisor::launch, which chooses the endpoint itself. The command and the order of the checks stay as they were.Tests. The CLI's tests share the helpers that provision a sandbox with a command line for the fake OpenVMM and that list a state directory, which the tests of nvx-rs: move the CLI's sandbox lifecycle onto the store and supervisor #772 use too.
Behavior
Nothing changes. The golden fixture
nvx-rs/tests/fixtures/cli.jsonis unchanged, and the existing tests check what they checked before.Tests
host::artifactsunit tests: the identity of each layout, and the errors for missing, malformed, and duplicated metadata.Part of #620. Refs #535.
Validation
Run at this head (
f5cff887), ondevated6a603f, on Windows 11 (MSVC, WHP) and on an Azure Linux 3 host with MSHV. Real VMs ran withnvx-rsbuilt from this branch and the artifacts ofv0.1.0-dev.ed6a603f1e53, the release ofed6a603f, fromnvx.py download. The MSHV host cannot present the built-in profile of its CPU (amd.genoa.v1), so OpenVMM ran there through a wrapper that adds--cpu-profile host.python scripts/nvx.py verify.nvx-rs, withNVX_BUNDLE=skip, on Windows and Linux:cargo fmt --all --check;cargo clippy --locked --all-targets --all-features -- -D warnings;cargo clippy --locked --lib --no-default-features -- -D warnings;cargo test --locked --all-features, thencargo test --locked;cargo doc --locked --no-deps --all-featureswithRUSTDOCFLAGS=-D warnings. On Linux, the other steps ofcheck-nvx-rs: the 1.89 check, the macOS check, the artifact-bundling test, and the three configurations oftests/runtime-adapter.aci_edge_sandboxes: the steps ofcheck-aci-edge-sandboxeson Linux (fmt, clippy, tests,nvx.py test-agent-bundling, docs, the 1.89 check, the macOS check), and its fmt, clippy, tests, and docs on Windows.validate-nvx, thenvx.py --helpsmoke commands, the Specula tests, and the pinnedshellcheckandshfmton the scripts thatcheck-qualitylists.sudofor/dev/mshv:python scripts/nvx.py test-microvm --scenario managed-lifecycle --scenario sandbox-lifecycle --scenario managed-exec-config.Left to CI: the full matrix on KVM, MSHV, and WHP.