Repository navigation
host: delete the unused artifact discovery and checked-file accessors (SL6.6b) - #1532
Merged
Pedro Henrique Penna (ppenna) merged 2 commits intoNov 12, 2026
Conversation
Contributor
This pull request changes existing testsIt modifies or removes 38 existing test asset(s), listed below. Review each with care: a change to a test can hide a regression that the test caught. See doc/contribute.md#changes-to-existing-tests. Test code
Relocated unchanged: 0; added: 0. Compared the merge base |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the unused-API cleanup.
No open issues 🎉
What changed in this PR
This PR removes unused artifact-discovery and checked-file APIs as part of the nvx library-slimming workstream. It prepares the remaining helpers for CLI-only visibility in #1533 while retaining the CLI’s discovery, verification, and launch paths.
Changes:
- Deletes
Artifacts, unused artifact helpers, binding accessors, and checked-file methods. - Retires tests for deleted APIs and adapts retained tests to verification, fields, and serialized bindings.
- Updates examples and documentation, and removes 58 public API snapshot entries per platform.
| File | Description |
|---|---|
nvx-rs/tests/security_checklist.rs |
Creates the staged-image binding through verification instead of import. |
nvx-rs/src/lib.rs |
Removes the Artifacts re-export and uses explicit paths and digests in the example. |
nvx-rs/src/host/seal/tests.rs |
Reads timestamp fields directly after getter removal. |
nvx-rs/src/host/seal.rs |
Deletes unused timestamp getters. |
nvx-rs/src/host/sandbox/scratch/tests.rs |
Adapts binding, geometry, and checked-file assertions. |
nvx-rs/src/host/sandbox/scratch.rs |
Removes unused accessors and retains platform-specific file access. |
nvx-rs/src/host/sandbox/options/tests.rs |
Checks serialized binding values instead of removed getters. |
nvx-rs/src/host/sandbox/mod.rs |
Moves geometry documentation to the retained helper. |
nvx-rs/src/host/sandbox/distro/tests.rs |
Retires import tests and adapts retained verification and geometry cases. |
nvx-rs/src/host/sandbox/distro.rs |
Deletes import APIs and getters; retains the checked file as a guard. |
nvx-rs/src/host/artifacts/tests.rs |
Retires discovery tests and preserves layout, requirements, and contract checks. |
nvx-rs/src/host/artifacts/mod.rs |
Deletes Artifacts, discovery, and the release-manifest wrapper. |
nvx-rs/src/host/artifacts/guest.rs |
Removes the unused guest-name parser. |
nvx-rs/src/host/artifacts/dir.rs |
Removes unused sandbox-artifact and OpenVMM requirement helpers. |
nvx-rs/README.md |
Updates API descriptions and the explicit-runtime example. |
nvx-rs/public-api/windows.txt |
Records the Windows public API removals. |
nvx-rs/public-api/linux.txt |
Records the Linux public API removals. |
Review effort: Balanced
nvx::Artifacts, with Artifacts::discover, located the OpenVMM executable, the guest kernel and the Alpine initramfs from the NVX_OPENVMM, NVX_KERNEL and NVX_INITRD variables, NVX_ARTIFACTS_DIR, or an nvx/ release beside the executable, and read their runtime identity from the install metadata of the release or checkout. The old launch, instance and template paths that called it are gone (#1121, #1122), and the CLI has its own discovery: --root, the release or checkout that holds the executable, and NVX_OPENVMM, over ArtifactDir. Once SL6.4 (#1124) makes host::artifacts private to the CLI, Artifacts would have no caller in any feature set, so it goes now, while it is public. It goes whole: the type and its fields, new, artifact_dir, runtime_identity, probe, from_dir, from_release_dir, from_repo_layout, discover, ENV_OPENVMM, ENV_KERNEL, ENV_INITRD, ENV_DIR and BESIDE_EXE_DIR, with the crate root's re-export, the private discover_with and read_json, and check_manifest, which only it called. ArtifactDir::sandbox_artifacts, which returned an Artifacts, goes with ArtifactDir::require_openvmm, which only it called, and so does Guest::from_name, which nothing calls: the CLI reads --guest itself. The public API snapshots lose these 38 lines on each platform. ArtifactDir, its layouts and paths, its runtime identity, Guest and the artifacts' names stay, and so do the CLI's NVX_OPENVMM and NVX_AUTO_DOWNLOAD. contract::manifest_mismatches stays for the CLI's downloads. The crate's example, which the doc test at line 62 compiles, and the README's take the runtime's paths and the SHA-256 digests that identify them from their caller, as examples/external-launch.rs does, rather than discover them. Tests of host::artifacts: - Retired, since they checked only what goes: release_layout_names_the_guest_artifacts, the_directory_variable_accepts_a_repository_checkout, explicit_variables_win_and_must_be_complete, the_directory_variable_precedes_the_executable_directory, discovery_fails_when_no_source_is_present, located_artifacts_have_the_identity_of_their_directory, and incompatible_manifests_are_unavailable, whose mismatches contract's mismatches_name_each_field_with_its_expected_and_declared_values covers. - repository_layout_is_detected_beside_the_guest_sources and this_repository_uses_the_repository_layout check the layouts through ArtifactDir alone. - repository_manifest_declares_the_supported_contract checks the checkout's SOURCE-MANIFEST.json with manifest_mismatches. - guests_name_their_artifacts_as_nvx_py_does and a_release_holds_the_guest_artifacts_in_guest drop their checks of from_name and of the release's discovery. - guest_artifacts_are_required_in_the_order_and_words_of_nvx_py, which checked sandbox_artifacts's order, becomes guest_artifacts_are_required_in_the_words_of_nvx_py, which keeps its checks of require_kernel and require_initramfs. Part of #1122 (SL6.6b). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Since the checked-file handoff left (SL6.3, #1122), a start checks the bindings of its sandbox's images and holds what the checks return, but launches OpenVMM by path: it drops the checked distro layer once the VM runs, and hands the VMM the scratch image's claim, through CheckedScratch::file on Linux and CheckedScratch::claim and into_file on Windows. What the old launch and the template store read of a binding or a checked file, and the import of a layer that a staging caller verified itself, no NVX program reads any more. Once SL6.4 (#1124) makes host::sandbox's distro and scratch modules and host::seal private to the CLI, they would have no caller in any feature set, so they go now, while they are public. What goes: - DistroBinding::import and its private import_with, and the getters format, identity, image, manifest and policy; - CheckedDistro's file, path, geometry and into_file, with its path and format, which only they read; it keeps the checked layer, which a start holds open, as a field that nothing reads; - CheckedScratch's path and geometry, with its path, file on Windows and into_file on Linux; - ScratchBinding's scheme, device, file_id, kind and length; - FileSeal::modified and FileSeal::changed. The public API snapshots lose these 20 lines on each platform. What the bindings record and check, their serde forms, the claims of scratch images, and the block geometry that the private block_geometry reads for host::vm, host::snapshot and the CLI's captures stay. The docs of block_geometry take the description of the geometry that CheckedDistro::geometry gave, and the README and host::sandbox's docs no longer present the import or the checked files' geometry. Tests: imports_bind_a_staged_layer_without_reading_it retires with the import. The other tests of distro bindings, scratch bindings and seals read the private fields of the values that they check in place of the deleted getters, and make the bindings that they need by verification, which reads nothing of a layer without a manifest, or by changing a verified binding's verdict, in place of an import: - distro: verification_binds_the_layer_its_manifest_and_the_policy, bindings_round_trip_through_their_serde_form, the_staged_check_reads_no_content, the_staged_check_fails_without_reading_for_another_policy_or_layer, the_checked_file_is_the_object_that_the_check_compared, gpt_disks_bind_by_their_disk_guid, which no longer compares the verification of a disk with its import, and a_manifest_path_whose_lookup_fails_is_no_absent_manifest_for_a_binding, which no longer checks an import of such a path; - distro: checked_layers_present_the_geometry_that_openvmm_reads_through_them and layers_present_the_block_size_of_their_filesystem, and scratch: checked_images_present_the_geometry_that_openvmm_reads_through_them, read the geometry through the checked file with block_geometry; - scratch: binds_record_the_image_without_reading_it, bindings_round_trip_through_their_serde_form, checks_claim_the_image_without_reading_it, which no longer checks the deleted path, a_check_that_waited_for_a_claim_compares_the_image_again and the_checked_image_is_the_object_that_the_check_compared; - seal: a_seal_holds_the_identity_kind_length_and_times_of_an_open_file and seals_differ_when_their_file_changes; - options: distro_manifest_binds_the_layer, the_entrypoint_check_needs_no_manifest_and_precedes_the_distro_verification and sandbox_rejects_systemd_from_bound_distro_metadata read the binding's serde form, which callers record; - the security checklist's a_staged_image_that_was_replaced_fails_its_check binds its layer, which has no manifest, by verification. Part of #1122 (SL6.6b). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pedro Henrique Penna (ppenna)
force-pushed
the
agents/slim-sl6-6b-unused-discovery
branch
from
November 12, 2026 13:42
008035d to
7e7ef6e
Compare
Pedro Henrique Penna (ppenna)
marked this pull request as ready for review
November 12, 2026 13:43
Pedro Henrique Penna (ppenna)
marked this pull request as draft
November 12, 2026 13:45
Pedro Henrique Penna (ppenna)
marked this pull request as ready for review
November 12, 2026 13:45
Pedro Henrique Penna (ppenna)
merged commit Nov 12, 2026
fc5d450
into
feature/nvx-refactor
103 of 124 checks passed
Pedro Henrique Penna (ppenna)
deleted the
agents/slim-sl6-6b-unused-discovery
branch
November 12, 2026 14:05
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.
Leaving code only. This PR changes only code that this effort removes from NVX: the public artifact discovery that no NVX program uses (
Artifacts,nvx::Artifacts,discover_with,check_manifestandread_json),ArtifactDir::{sandbox_artifacts, require_openvmm},Guest::from_name,DistroBinding::{import, import_with}and its getters,CheckedDistro's andCheckedScratch's unused parts,ScratchBinding's getters, andFileSeal::{modified, changed}, with the edits that remove references to them. Nothing that stays changes, and no later PR uses what it changes, so the size limits for kept code don't apply.Part of #1122 (SL6.6b, "the unused artifact discovery and checked-file accessors are gone"). Parent #1087, umbrella #1076.
It needs SL6.3 (#1530) and SL6.6a (#1524), which have both merged: it starts from
671a192d0a5, the tip after them. SL6.4 (#1533, in #1124) stacks on it and makes what stays private to the CLI.What and why
Once SL6.3 deleted the old launch, instance and template code, about 15 groups of public items in
host::artifacts,host::sandbox::{distro, scratch}andhost::sealhad no caller in any NVX program, only in the public API, its doc examples and tests. The CLI has always used its own discovery, throughArtifactDirandGuest, and verifies distro layers rather than importing their bindings. SL6.4 makes these modules private to the CLI, which would leave these items dead, so this PR deletes them first, as SL6.6b in #1122 records. Two commits:host: delete the artifact discovery that no NVX program uses(2ef545e9):Artifactsgoes, with its fields, its methods (new,discover,from_dir,from_release_dir,from_repo_layout,artifact_dir,runtime_identity,probe) and its constants (ENV_OPENVMM,ENV_KERNEL,ENV_INITRD,ENV_DIR,BESIDE_EXE_DIR), and so does its re-export,nvx::Artifacts. So do the privatediscover_withandread_json, the publiccheck_manifest(the release manifest's check, which only discovery called),ArtifactDir::{sandbox_artifacts, require_openvmm}andGuest::from_name.NVX_ARTIFACTS_DIR,NVX_KERNELandNVX_INITRD, and itsnvx/directory beside the executable, go with it.NVX_OPENVMMandNVX_AUTO_DOWNLOAD, which the CLI reads through its own constants, keep their meaning.contract::manifest_mismatchesstays for the CLI's downloads, andArtifactDir,Guest,ArtifactPathsand the layouts' names and requirements stay for the CLI.src/lib.rs(the doc testnvx-rs/src/lib.rs - (line 57), which still compiles a cold boot and a stop throughhost::vm) and the README's example take the three paths and their SHA-256 digests from the command line, withRuntimeIdentity::newandArtifactIdentity::sha256, instead ofArtifacts::discoverandArtifacts::runtime_identity. Thehostbullet of the crate's docs says "the layouts of NVX's artifacts" instead of "artifact discovery", and the README'shost::artifactssection dropsArtifacts.host: delete the binding and checked-file accessors that nothing reads(008035d2):DistroBindinglosesimport, the crate-privateimport_withthat implemented it, and its five getters (format,identity,image,manifest,policy). A binding still comes fromverify, andcheckand the serde form, whichnvx-rs sandbox provisionrecords, don't change.CheckedDistrokeeps only the open file that the start holds while it launches, as_file, which nothing reads; itsfile,path,geometryandinto_filego, with thepathandformatfields that only they read.CheckedScratchkeeps its claim and its file:filestays on the hosts where the start reads it, other than Windows, andinto_fileon Windows, where the start takes the guard.pathandgeometrygo, with thepathfield. The description of the geometry that bothgeometrymethods documented moves toblock_geometry, which the start,host::vmandhost::snapshotcall.ScratchBindingloses its five getters (scheme,device,file_id,kind,length), andFileSeallosesmodifiedandchanged. Seals still compare whole, and record every field.host::sandbox's docs stop naming the import and thegeometrymethods.The public API snapshots lose 58 lines on each platform, all in the items above (38 for the first commit, 20 for the second). Nothing is added. The warning-denied builds of every feature set pass on Windows, Linux and the macOS check, so nothing else became unused.
Size
Measured against
671a192d0a5, by #1076's rules: leaving code only, no limit. The measuring script counts 10 added or changed code lines, in 4 files: 6 import lines that shrink with what goes (artifacts/dir.rs3,artifacts/mod.rs1,sandbox/distro.rs1,sandbox/scratch.rs1), the 2 lines ofCheckedDistro's remaining field,_file, and the 2 platformcfgs ofCheckedScratch::{file, into_file}. Counted files: 7,src/lib.rs,src/host/artifacts/{mod, dir, guest}.rs,src/host/sandbox/{distro, scratch}.rsandsrc/host/seal.rs;src/host/sandbox/mod.rschanges only its docs. 17 files change: +193 and −1068 lines, tests, docs and snapshots included.Old tests of the area
host::artifacts::tests::release_layout_names_the_guest_artifacts(Artifacts::from_dirandfrom_release_diron a release;a_release_holds_the_guest_artifacts_in_guestkeeps the release's names);the_directory_variable_accepts_a_repository_checkout,explicit_variables_win_and_must_be_complete,the_directory_variable_precedes_the_executable_directoryanddiscovery_fails_when_no_source_is_present(discovery's sources and their order), with their helpervariables;incompatible_manifests_are_unavailable(check_manifest's errors;contract's tests keepmanifest_mismatches' own);located_artifacts_have_the_identity_of_their_directory(Artifacts::runtime_identity;ArtifactDir::runtime_identitykeeps its tests);host::sandbox::distro::tests::imports_bind_a_staged_layer_without_reading_it(DistroBinding::import).host::artifacts::tests::repository_layout_is_detected_beside_the_guest_sourcesandthis_repository_uses_the_repository_layoutcheck the paths throughArtifactDir::from_dirinstead ofArtifacts, and the first one also checks the layout;repository_manifest_declares_the_supported_contractchecks the checkout'sSOURCE-MANIFEST.jsonwithcontract::manifest_mismatches, whichcheck_manifestcalled;guests_name_their_artifacts_as_nvx_py_doesno longer checksGuest::from_name;a_release_holds_the_guest_artifacts_in_guestno longer compares the release with discovery's artifacts;guest_artifacts_are_required_in_the_order_and_words_of_nvx_pybecomesguest_artifacts_are_required_in_the_words_of_nvx_py: the order wassandbox_artifacts'; the requirements of the kernel, the initramfs and the distro layer and manifest, innvx.py's words, stay.host::artifacts,host::sandbox,host::sealand the CLI, the checklist and the doc tests. Those that the report below lists change only to stop naming what goes.Test changes
python scripts/check_test_changes.py --base 671a192d0a5lists 38 changes to existing tests, hencetests-modified:nvx-rs/src/host/artifacts/tests.rs: the imports; the removed helper and tests and the rewritten tests above.nvx-rs/src/host/sandbox/distro/tests.rs: the removedimports_bind_a_staged_layer_without_reading_it(above), and, with the same assertions:verification_binds_the_layer_its_manifest_and_the_policy,bindings_round_trip_through_their_serde_form,the_staged_check_reads_no_content,gpt_disks_bind_by_their_disk_guid,a_manifest_path_whose_lookup_fails_is_no_absent_manifest_for_a_bindingandthe_checked_file_is_the_object_that_the_check_comparedread the binding's fields and the checked file, as a child module may, instead of the getters;checked_layers_present_the_geometry_that_openvmm_reads_through_themandlayers_present_the_block_size_of_their_filesystemread the geometry withblock_geometrythrough the checked file, whichCheckedDistro::geometrycalled, and make their bindings withverify_withinstead ofimport_with;the_staged_check_fails_without_reading_for_another_policy_or_layermakes its rejected binding from the verified one, with another verdict, instead of importing it;gpt_disks_bind_by_their_disk_guidno longer compares the verified binding with an imported one, and expects the failure for a missing disk fromverifyinstead ofimport;a_manifest_path_whose_lookup_fails_is_no_absent_manifest_for_a_bindingchecks the staged check's refusal alone, without the import's.nvx-rs/src/host/sandbox/scratch/tests.rs:binds_record_the_image_without_reading_it,bindings_round_trip_through_their_serde_form,checks_claim_the_image_without_reading_it,a_check_that_waited_for_a_claim_compares_the_image_againandthe_checked_image_is_the_object_that_the_check_comparedread the fields instead of the getters (checks_claim_the_image_without_reading_itno longer checksCheckedScratch::path);checked_images_present_the_geometry_that_openvmm_reads_through_themreads the geometry withblock_geometry, asCheckedScratch::geometrydid.nvx-rs/src/host/sandbox/options/tests.rs:distro_manifest_binds_the_layer,the_entrypoint_check_needs_no_manifest_and_precedes_the_distro_verificationandsandbox_rejects_systemd_from_bound_distro_metadataread the binding's identity, format and manifest from its serde form, which the CLI records, instead of the getters.nvx-rs/src/host/seal/tests.rs:a_seal_holds_the_identity_kind_length_and_times_of_an_open_fileandseals_differ_when_their_file_changesread themodifiedandchangedfields instead of the getters.nvx-rs/tests/security_checklist.rs:a_staged_image_that_was_replaced_fails_its_checkbinds the layer withDistroBinding::verifyinstead ofimport, with the imports.doc/acceptance-case-matrix.mdnames none of the retired or renamed tests, so it doesn't change.Validation
local_gates.py --files(fromdev) selectstest-changes,markdown-links,test-layout, thecheck-nvx-rssteps andnvx-clion both systems; I ran them from this branch's action definitions, with Rust 1.95.0. Nothing here changes runtime behavior that a VM shows: the CLI's discovery and staging paths don't change, and SL6.4's microVM runs, which hold these commits, passed (below).The checks first ran on
5d0894b021a, on a local base of SL6.3's and SL6.6a's pre-merge heads (34233747c4b). After both merged, this branch was rebased onto671a192d0a5with no conflicts, andgit range-diffshows=for both commits. On this head,008035d2893:cargo fmt --all --check-D warnings:--all-targets --all-features,--lib,--lib --no-default-features,serde,cliandtestingalone--target x86_64-unknown-linux-gnu--target x86_64-unknown-linux-musl --no-default-features --features guest -D warningscargo check --all-targets --all-features --target aarch64-apple-darwinhost/snapshot/tests.rs, is the base'scargo test --locked --all-featuresnvx-rs/src/lib.rs - (line 57)includedguest::failures as on the base, by name, as below. MSHV (kernel 6.18), with--no-fail-fast: passed, lib 1877 passed and 57 ignored, and every integration and doc testcargo test --locked,cargo build --locked --lib --no-default-features,cargo test --locked --lib --no-default-featuresRUSTDOCFLAGS=-D warnings cargo doc --locked --no-deps --all-featurescargo +1.89 check --locked --all-targets --all-featurespython scripts/public_api.pycheck-guest-binaries,build-guest-binaries,test-guest-binariescheck-guest-binarieshas the base's same 7guest::failures. MSHV:check-guest-binariespassedcheck_test_layout.py,check_markdown_links.pycheck_matrix.py <worktree> 99d2022085fOn kernel 6.6,
nvx-kvm-testfails the same 28guest::lib tests and 7 guest-binary tests on the current tip,00c55b965f0, as on this head, by name; kernel 6.18 runs them all.Each commit passes Clippy with
-D warnings, with every feature, withcliand without default features, on Windows and for Linux.The
validate-nvxunittest list passed on Windows on the first head (1824 tests, 73 skipped); this PR changes no script.Left to CI: the microVM scenarios on each backend, and
openvmm-ci, for the unchanged pin.