Repository navigation
sandbox: name the runtime identity and gateway without the old store and plan (SL3.10b) - #1497
Draft
Pedro Henrique Penna (ppenna) wants to merge 1 commit into
Draft
Pedro Henrique Penna (ppenna) wants to merge 1 commit into
Pedro Henrique Penna (ppenna) wants to merge 1 commit into
Conversation
…and plan Two of the shared sandbox modules still reached old APIs for values that the new interface already owns. `sandbox/mod.rs` named the artifacts' runtime identity through `host::store`, which only re-exports `host::runtime::RuntimeIdentity`, and `sandbox/options.rs` found the gateway of `--net` through `host::sandbox::plan::guest_gateway`, the old plan's wrapper around `net::guest_gateway`. `sandbox/mod.rs` now imports `RuntimeIdentity` from `host::runtime`. `sandbox_network` checks `--net` with `Ipv4Cidr::parse`, whose refusal is the plan's word for word, `guest network "ADDRESS" must be an IPv4 address with a /1 to /30 prefix that is not its network's network, broadcast, or gateway (first) address`, with the same code, and takes the gateway from `net::guest_gateway`, which finds one for every address that parses. The order of the refusals does not change, and `SandboxNetwork::new` still checks the network. This is the first step of SL3.10b, whose split was approved once its measured scope came to about ten times its estimate: SL3.10c moves the sandbox network to `NetworkConfig`, and SL3.10d moves the launch off `SandboxLaunch`, `SandboxSettings` and `SandboxUpper`. Tests: `network_policies_that_the_planner_refuses_fail_before_launch` in tests/cli.rs keeps checking, word for word, that `sandbox run --dry-run` and `sandbox provision` refuse `--net 10.0.0.1/24` before they launch or record anything. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the sandbox CLI dependency cleanup.
No open issues 🎉
What changed in this PR
This PR completes the first part of SL3.10b in #1112, removing residual store and old-plan dependencies from the sandbox CLI without changing its public API or intended behavior.
Changes:
- Imports
RuntimeIdentitydirectly from its owninghost::runtimemodule. - Replaces the old plan gateway wrapper with
Ipv4Cidrvalidation andnet::guest_gateway, preserving validation errors and their order.
| File | Description |
|---|---|
nvx-rs/src/host/cli/sandbox/options.rs |
Uses network primitives directly for guest-address validation and gateway lookup. |
nvx-rs/src/host/cli/sandbox/mod.rs |
Imports runtime identity without the store re-export. |
Review effort: Balanced
This was referenced Nov 11, 2026
This branch has not been deployed
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.
Part of #1112: SL3.10b, step 1 of 3 (the CLI no longer uses the old launch, store or config APIs).
What and why
SL3.10b removes the last uses of
nvx's old launch, store and config APIs from the CLI's four shared sandbox modules:host/cli/sandbox/{mod,options,state}.rsandsandbox/lifecycle/mod.rs. Its measured scope came to about ten times its estimate of 20 core lines, sinceSandboxLaunch,SandboxSettings,SandboxUpperandSandboxNetworkstill carry provision, start and the sandbox's record. The split of SL3.10b into three stacked pull requests, each with one goal, was approved for Pedro Henrique Penna (@ppenna):NetworkConfig, and the record to format 10.SandboxLaunch,SandboxSettingsandSandboxUpperleave the four modules for the CLI's record and aVmConfig.This step:
sandbox/mod.rsimportsRuntimeIdentityfromhost::runtime, its owner, rather than throughhost::store, which only re-exports it.sandbox_network(sandbox/options.rs) no longer callshost::sandbox::plan::guest_gateway, the old plan's wrapper aroundnet::guest_gateway. It checks--netwithIpv4Cidr::parse, whose refusal is the plan's word for word,guest network "ADDRESS" must be an IPv4 address with a /1 to /30 prefix that is not its network's network, broadcast, or gateway (first) address, with the same code (unsupported), and takes the gateway fromnet::guest_gateway, which finds one for every address that parses. The order of the refusals does not change, andSandboxNetwork::newstill checks the network until SL3.10c.Nothing else changes: no output, record, test or public API.
Size. 4 core lines, 2 counted files:
sandbox/mod.rs1 andsandbox/options.rs3. The public API,BOOT_CONTRACT_VERSIONandCONTROL_CONTRACT_REVISIONdo not change.Validation
At this head (
2e33e1bd70d, onfeature/nvx-refactord4edeeb9ab9), the gates thatlocal_gates.py --filesselects for the two files, from this branch's action definitions:cargo fmt --check; Clippy with-D warnings(--all-targets --all-features,--lib,--lib --no-default-features,--lib --bins --features cli,--lib --bins --no-default-features --features testing);cargo test --all-features(lib 1464,cli110) andcargo test; the--lib --no-default-featuresbuild and tests; the bundled-artifacts test;cargo docwith-D warnings; MSRV 1.89; the runtime adapter's protocol-only and host-only configurationscompileall, the 22scripts/test_*.pymodules (1834 tests),test_adversarial.py,test_hosts.py,nvx.pyhelptest_adversarial.py'stest_contained_process_timeout_kills_descendantsfailed once, with aPermissionErroron itschild.pidwhile Rust suites ran beside it, and passed in three reruns and a rerun of the modulecheck_test_layout.py,check_markdown_links.py,check_test_changes.py --base origin/feature/nvx-refactorguest::unit tests ofcargo test --all-features(lib 2276 passed,cli119) and the 26 ofnvx.py check-guest-binaries, which fail on that host at the base too (#1491); none touches the CLInetwork_policies_that_the_planner_refuses_fail_before_launch(tests/cli.rs) keeps checking, word for word, thatsandbox run --dry-runandsandbox provisionrefuse--net 10.0.0.1/24before they launch or record anything. No other path changes: the microVM scenarios run at the top of the stack, with SL3.10d.Left to CI: MSHV and WHP.