Repository navigation
Description
Parent: #1088, in #1076. Needs: #1098, #1122. Unblocks: #1125, #1126, #1131. No PR of this group merges before the API-ready commit.
Goal. Image staging and artifact discovery become crate-private and cli-gated where they are: host::seal, host::sandbox::{distro, scratch, layer} and host::artifacts, including discovery, Guest and the scratch template's inventory, with the crate root's Artifacts. The policy-file reader first builds public rule values, then it and the --mount syntax become crate-private and cli-gated where they are, and the host::sandbox and host::network::policy modules become crate-private with what remains in them. NVX_OPENVMM and NVX_AUTO_DOWNLOAD keep their meaning, and shared normalization stays public.
Notes.
- Privatizing counts as a move. Visibility, feature gates, the API snapshot and forced imports have no core lines and no counted file.
- Integration tests follow visibility.
tests/cli.rs,tests/cli/{artifacts, formats, lifecycle}.rs, the policy and mount tests, and any remaining checked-transfer or fake-backed use become unit tests or drive a binary, with the same assertions.
PRs, in order. Each PR has one goal, leaves dev green, and names in its description each old test of its area as kept, rewritten or retired, with each change that check_test_changes.py reports. Its tests follow the repository's test layout: a module's unit tests, and the code that only they use, sit in its tests.rs or tests/ and move with it. The estimates count core lines (code, not comments, docs or tests) and counted files; each PR records its measured values. Each PR does what its Scope says and no more: a case, input or layout that its Scope doesn't name, and whatever "Not in this PR" lists, is out of scope. Address every review comment within the scope, and ask before acting on one that asks for more. A PR whose measured core lines pass the stop that its Estimate names (twice the estimate, at most 600) stops and asks before continuing.
-
SL6.4: Image staging and artifact discovery are private to the CLI.
- Objective: Image staging and artifact discovery are CLI-owned behavior, but their seals, bindings, checked files, artifact inventory and discovery rules are public API of
nvx. This PR makes that implementation private to the CLI where it is, without changing image formats, discovery precedence, environment variables, checks or launch behavior. - Contents:
host::seal,host::sandbox::{distro, scratch, layer}andhost::artifactsbecome crate-private andcli-gated where they are:FileSeal;DistroBindingand the distro policy (PolicyVerdict,PolicyResult,DISTRO_POLICY_REVISION);ScratchBindingand its claim; the checked filesCheckedDistroandCheckedScratch; discovery,ArtifactDir,Guestand the scratch template's inventory (Guest::scratch_template_name); and the re-exports that would keep some of them public: the crate root'sArtifacts, andhost::sandbox'sLAYER_ROLES,LayerRoleandSandboxLayer.NVX_OPENVMMandNVX_AUTO_DOWNLOADkeep their meaning. The root description keeps the image format and the expected UUID or GUID. The integration tests that use these items become unit tests of their owners or drive the binary, asserting the same behavior. The API snapshot drops the items. - Scope:
host::sealandhost::sandbox::{distro, scratch, layer}become crate-private andcli-gated with their implementations and unit tests, andhost::sandboxstops re-exportingLAYER_ROLES,LayerRoleandSandboxLayer.host::artifactsdiscovery,ArtifactDir,GuestandGuest::scratch_template_namebecome crate-private andcli-gated where they are, and the crate root stops re-exportingArtifacts.- The root description continues to own the EROFS or GPT format and the expected filesystem UUID or disk GUID.
- Repository and release layouts, explicit artifact variables, executable-directory discovery,
NVX_OPENVMMandNVX_AUTO_DOWNLOADkeep their current behavior. - Integration tests that reach these internals become unit tests of their owners or test through the binary, preserving the same cases.
- Not in this PR:
- Image-format, sealing, policy, scratch-claim, artifact-discovery or download behavior changes: this PR only narrows visibility and feature gates.
- Moving the helpers under
host::cli, splitting mixed helpers or adding alias modules. - Changing path-only block-device launch behavior or restoring descriptor transfer: those are separate launch decisions.
- Reworking downloads, installation, archives, GitHub access or update history.
- Approach: Narrow the modules and items in place, keep them behind
cli, and follow the compiler to adjust internal imports. Move each integration-test case beside its owner or drive the CLI binary when behavior crosses modules. Preserve the existing discovery order and image logic, then regenerate the API snapshot and check that its diff removes only these helpers. - Done when:
- Seal, distro, scratch, layer and artifact-discovery tests cover the same successful and refused cases where they now live.
- The guest artifact inventory includes the same kernel, initramfs, distro files and scratch template for the supported guests.
- The artifact command still honors
NVX_OPENVMM, and download tests still honorNVX_AUTO_DOWNLOAD. - The API snapshot lists none of the private image-staging or artifact-discovery items under any path,
nvx::Artifactsincluded.
- Needs: SL6.3, in nvx-rs slimming 4.2.3: the old configs, the old launch code and
bundledare gone #1122; SL6.6a, in nvx-rs slimming 4.2.3: the old configs, the old launch code andbundledare gone #1122. - Estimate: 0 core lines (visibility), no counted files.
- Objective: Image staging and artifact discovery are CLI-owned behavior, but their seals, bindings, checked files, artifact inventory and discovery rules are public API of
-
SL6.7a: The policy-file reader builds public rules.
- Objective: The policy-file reader currently reaches private network lowering details, which prevents it from becoming private to the CLI cleanly. This PR makes it construct the public rule model and compile through
NetworkPolicy::native_egress_rules, preserving the existing JSON language and native output. - Contents: The egress compiler parses each JSON rule into the public
EgressRule,DestinationandPortSelectorvalues, and compiles them throughNetworkPolicy::native_egress_rules; it no longer usesaddressorlowering. Its tests check the same compiled rules. - Scope:
host::network::policyparses every existing JSON rule intoEgressRule,DestinationandPortSelectorvalues.- The reader builds a
NetworkPolicyand obtains allow and deny native rules throughNetworkPolicy::native_egress_rules. - The existing flat and MXC rule forms, IPv4 and IPv6 destinations, CIDR exclusions, protocol selectors and port ranges remain supported.
- The current file-size, nesting, rule-budget and native-rule-budget limits remain unchanged.
- Grammar, model and property tests compare the same compiled native allow and deny rules through the public values.
- Not in this PR:
- Making the reader private to the CLI: the following PR narrows its visibility after this dependency change.
- Changing the policy-file grammar, accepted protocols, limits, diagnostics or canonicalization: existing files must compile the same way.
- Making
addressorloweringpublic, or changing shared normalization: no caller needs either. - Adding another rule model or a second native-rule compiler: the public network values already provide the required path.
- Approach: Replace the reader's direct construction of private lowering inputs with a narrow conversion from its parsed JSON model to the existing public rule values, then call
native_egress_rules. Reuse the current JSON reader, validation and normalization tests; do not add a compatibility layer or duplicate the lowerer. - Done when:
- The grammar tests accept and reject the same JSON shapes, encodings, CIDRs, selectors, ports and limits.
- Model tests show that public rule values represent the same destinations and selectors as the file model.
- Property tests show that valid policy files compile to the same canonical native allow and deny rules.
- No policy-file compiler code calls the private
addressorloweringmodules.
- Needs: SL2.4d, in nvx-rs slimming 2.1.2: the kernel command line and OpenVMM's arguments come from the configuration alone #1098.
- Estimate: 200 core lines, 2 counted files. Past 400 core lines, stop and ask before continuing.
- Objective: The policy-file reader currently reaches private network lowering details, which prevents it from becoming private to the CLI cleanly. This PR makes it construct the public rule model and compile through
-
SL6.7b: The policy-file reader and the mount syntax are private to the CLI.
- Objective: The egress policy-file reader and
--mountsyntax are CLI-facing code, but they are public API ofnvx. This PR makes them private to the CLI where they are, while preserving policy compilation, mount parsing, export planning and host-path checks. - Contents:
host::network::policy's reader (compile_policy*,CompiledEgressPolicy, the JSON reader) and the--mountsyntax (host::sandbox::mount's parsing andSandboxOptions, withplan_mounts,plan_mounts_withandpath_text) become crate-private andcli-gated where they are. The shared normalization stays public. Neitherhost::sandboxnorhost::network::policykeeps anything in the final public API, so both modules become crate-private here: what remains inhost::sandbox(its limits and defaults,parse_workload_identity,require_fileand the mount types) takes its users' features,host::network::policy's limits go with its reader, and the network lowering takesMAX_RULESdirectly. Their integration-test users become unit tests of their owners or drive the binary, asserting the same behavior. The API snapshot drops the items. - Scope:
host::network::policy's JSON reader,compile_policy*functions andCompiledEgressPolicybecome crate-private andcli-gated where they are.host::sandbox::mountparsing,SandboxOptions,plan_mounts,plan_mounts_withandpath_textbecome crate-private andcli-gated.- Existing mount access, owner, kind, allow, deny and write-path forms continue to produce the same
ExportPlanand boot values. - Policy-reader, mount-parser,
SandboxOptionsand host-path integration tests become unit tests or drive the binary. - Shared network normalization stays public.
- The
host::sandboxandhost::network::policymodules become crate-private:host::sandbox's limits, defaults,parse_workload_identity,require_fileand mount types take their users' features;policy's limits go private with its reader; the network lowering usesMAX_RULESdirectly.
- Not in this PR:
- Policy grammar, rule normalization, mount syntax or option-validation behavior changes: this PR only narrows visibility and feature gates.
- Moving the helpers under
host::cli, renaming commands, flags, types or modules, or adding aliases. - Redesigning export planning or path rules: their own PRs handle that area.
- Generalizing mounts for new owners, platforms or path spellings.
- Approach: Narrow the existing policy reader and mount-syntax items to crate visibility, keep them behind
cli, and update internal imports directly. Move each integration-test case beside its owner or test through the CLI binary. Preserve parser structure and shared normalization, then regenerate the API snapshot without introducing a generic parsing framework. - Done when:
- Policy-file grammar, model and property tests pass with the same native rules and failures.
--mounttests still cover access, ownership, policy paths, commas, links and reserved targets.SandboxOptionsstill attributes policy options to the preceding mount and produces the same exports.- The API snapshot lists no path under
host::sandboxorhost::network::policy.
- Needs: SL6.3, in nvx-rs slimming 4.2.3: the old configs, the old launch code and
bundledare gone #1122; SL6.7a, above; SL6.4, above. - Estimate: 0 core lines (visibility), no counted files.
- Objective: The egress policy-file reader and
Tests. Image, seal, artifact, policy-file and mount tests keep their assertions with their owners. The policy reader compiles the same native rules through EgressRule, Destination and PortSelector. Mount options produce the same exports and host-path checks. Download and artifact commands keep NVX_AUTO_DOWNLOAD and NVX_OPENVMM. Every feature set builds without unused private code, and the API snapshot drops only the privatized items, leaving no path under host::sandbox or host::network::policy.
Done when: every PR above has merged, with dev green.
Activity
[-]nvx-rs slimming 4.3.1: image staging, artifact discovery, the policy-file reader and the mount syntax live in nvx-cli[/-][+]nvx-rs slimming 4.3.1: image staging, artifact discovery, the policy-file reader and the mount syntax are private to the CLI[/+]esaurez commentedon Nov 10, 2026
Workstream source/progress checkpoint - 2026-11-10 UTC
Checked boxes below mean merged scope, not merely an implemented first iteration. Implementation branches are source checkpoints, not automatic qualification, Ready or merge approval. Some starting inputs are frozen/anonymous commits rather than standalone branches; their exact SHAs and known merged producer refs are recorded explicitly.
SL6.4 - no completed first-iteration handoff recorded. Inspect any preserved partial/prior work before implementing the issue's scope.
SL6.7a - merged via pull request 1298.
esaurez/slim-4.3.1-sl6.7a-20261105at5190a0c10525577155e4a5446cde148475bc3b20.feature/nvx-refactorate08a4b3d466540f2feec4a3c02d23bc8c297867b; merge commit1e23a5dfc1dfee30262edd713a85a4e4fa9eef2d.SL6.7b - no completed first-iteration handoff recorded. Inspect any preserved partial/prior work before implementing the issue's scope.
The original technical scope remains authoritative, supplemented only by any portable technical clarification in this issue. No machine-specific execution policy is part of this checkpoint.
ppenna commentedon Nov 12, 2026
SL6.4 note: making image staging and artifact discovery CLI-private would leave about 15 groups of items with no caller:
Artifactsand the bindings' and checked files' unused accessors, which the CLI never used. Per #1076, leaving code isn't mixed into a privatization group, so a new leaving-code slice, SL6.6b in #1122, deletes them first. SL6.4 stacks on it and stays visibility-only, at 0 core lines.host::sealcan't be fullycli-gated, becausehost::snapshotand the Windows platform layer use it internally. Those items take their users' gates, and nothing ofhost::sealstays public.tests: check image staging through the CLI and the owners' unit tests
host: make image staging and artifact discovery private to the CLI
host: delete the artifact discovery that no NVX program uses
host: delete the binding and checked-file accessors that nothing reads
tests: check image staging through the CLI and the owners' unit tests
host: make image staging and artifact discovery private to the CLI
host: make the policy-file reader and the mount syntax private to the…
host: delete the artifact discovery that no NVX program uses
host: delete the binding and checked-file accessors that nothing reads
host: delete the artifact discovery that no NVX program uses
16 remaining items
host: delete the artifact discovery that no NVX program uses
host: delete the binding and checked-file accessors that nothing reads
tests: check image staging through the CLI and the owners' unit tests
host: make image staging and artifact discovery private to the CLI
host: delete the sandbox accessors that only tests use
tests: check the policy reader and the mount syntax through the CLI
host: make the policy-file reader and the mount syntax private to the…
host: delete the artifact discovery that no NVX program uses
host: delete the binding and checked-file accessors that nothing reads
tests: check image staging through the CLI and the owners' unit tests
host: make image staging and artifact discovery private to the CLI
host: delete the sandbox accessors that only tests use
tests: check the policy reader and the mount syntax through the CLI
host: make the policy-file reader and the mount syntax private to the…