Skip to content

nvx-rs slimming, phase 4.3: the code that only NVX's programs use, and the error codes, become private #1088

Closed
4 of 4 issues completed

Description

Parent: #1076. Phase: 4, the slim library. Needs: #1079, #1082; inside phase 4, groups of #1087 (see the table below). Unblocks: #1089, #1090.

Goal. Image staging, artifact discovery, the policy-file reader, the mount syntax and the path rules become crate-private and cli-gated where they are. NVXC becomes private before v2, the host's platform layer becomes private, and the guest's space becomes crate-private and guest-gated where it is. The error codes and Error's constructors become crate-private, so callers act on an error's kind.

Today (dev e42b1795) and after:

Area Today After
CLI helpers Public or crate-private modules used by the CLI: host::artifacts, host::network::policy's reader, host::sandbox::mount's syntax, host::seal, image staging and path rules. Crate-private and cli-gated where they are, with the crate root's Artifacts and resolve_guest_path, and the host::sandbox and host::network::policy modules become crate-private. host::cli calls them directly; the egress normalization and guest_path stay public.
The export ExportPlan carries file identities, and check enforces them. Paths only. The CLI keeps the identity pins and the recheck, and nvx documents what the caller keeps stable.
Errors Error, ErrorKind, ErrorCode and Result are public, with Error's constructors and code(). Error, ErrorKind and Result stay public; ErrorCode, Error::code and the constructors are crate-private. The CLI keeps printing each error's code.
Fake OpenVMM Hidden in testing. Still hidden in testing; testing::fake_openvmm has only main public and hidden.
NVXC Its frames, refusal categories, EXEC payloads with their flags and limits, guest features and host session are public. All crate-private and gated by cli, guest or testing, before v2 is written; NVXS, the outer records and the mapping table stay public.
Host platform host::platform is public. Crate-private where it is; public forms remain in host::vm, host::transport and host::runtime.
Guest space Public but hidden reference code; the guest's snapshot shares some path lookups with it. guest::{root, view, gpt}, the mapper and the apply family are crate-private and guest-gated where they are. The snapshot no longer depends on the space; MappingTable and the mapping values stay public.

Groups, in order. Each group issue lists its PRs, with their goals, contents, Needs and estimates.

Group issue Delivers PRs Needs
#1124 Image staging, artifact discovery, the policy-file reader and the mount syntax are private to the CLI SL6.4, SL6.7a, SL6.7b #1098, #1122
#1125 Path rules are private to the CLI, and the export holds paths only SL6.5a2, SL6.5b #1122, #1124
#1126 The error codes are private SL6.8c #1124, #1125
#1127 NVXC, the host's platform layer and the guest's space are private SL6.12, SL6.14, SL6.13b #1105, #1121, #1123

Notes.

  • Privatizing counts as a move. A visibility change, feature gate, snapshot update and the import edits it forces have no core lines and no counted file.
  • Integration tests follow visibility. A test that uses a privatized item becomes a unit test of its owner or drives a binary, with the same assertions.
  • Feature gates follow users. CLI helpers stay cli-gated; guest helpers stay guest-gated; NVXC uses any(cli, guest, testing) as needed.
  • No group is leaving code only. The export's removals share their PRs with changes to kept code, so every group follows the limits.

Tests. The privatized code's tests remain with their owners. Integration tests that reached it become unit tests or drive nvx-rs or nvx-fake-openvmm. The policy-file reader compiles the same JSON rules through the public rule values. ExportPlan holds paths only, its check needs no pins, and the CLI persists and rechecks its pins. Errors keep their kinds, messages and sources, and the CLI prints the same codes. Every feature set builds without dead code. NVXC's codec and session tests pass in their owner modules; the fake OpenVMM's cases still drive its binary. The docs and examples of snapshot and activation build without the space, and the space's unit and privileged tests stay with it.

Done when: every group issue is closed; the CLI-only helpers, NVXC, the host's platform layer and the guest's space are private where they are; the fake OpenVMM remains hidden; and nvx exports neither the error codes nor code used only by its programs.

Activity

  1. changed the title [-]nvx-rs slimming, phase 4.3: the code that NVX keeps moves to the crate that uses it, and only per-domain errors remain[/-] [+]nvx-rs slimming, phase 4.3: the code that only NVX's programs use becomes private, and only per-domain errors remain[/+] on Nov 3, 2026
  2. changed the title [-]nvx-rs slimming, phase 4.3: the code that only NVX's programs use becomes private, and only per-domain errors remain[/-] [+]nvx-rs slimming, phase 4.3: the code that only NVX's programs use, and the error codes, become private[/+] on Nov 4, 2026
  3. ppenna commented on Nov 12, 2026

    @ppenna
    Contributor

    Completed on feature/nvx-refactor. All four group issues are closed:

    The code that only NVX's programs use, error codes included, is private to the crate. The push CI run at f5cc2aacfbf, which contains all of them, passed: https://github.com/microsoft/nvx/actions/runs/43323357790

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

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions