Repository navigation
nvx: hide NVX's programs from the public API - #1265
Conversation
NVX's guest tools, managed agent, CLI and fake OpenVMM are programs, but
their modules appeared in the crate's documentation as API. A binary can
call only a public item, so hide the programs instead of moving them.
The modules whose only public item is their main become #[doc(hidden)]:
guest::{console_pending, device_io, exit, managed_agent, mmio_write,
time_probe}, host::cli and testing. So do the mains of guest::ingress,
guest::time and guest::reseed, whose library parts stay documented.
Every binary keeps calling the same path.
The crate's feature list, the manifest's comments and the README say
that the cli and testing features build NVX's own binaries and add no
API, and the README drops the hidden modules' rows and sections. The API
snapshots mark the hidden items; no item appears or disappears.
Part of #1091.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c2e22d0d-c583-4401-a947-31781d4fec41
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues require changes.
No open issues 🎉
What changed in this PR
This PR implements SL1.5 of #1091, hiding NVX’s program entry points from generated API documentation while preserving their paths, visibility, and behavior. It builds on #1261’s public-API snapshots without hiding the library items alongside those programs.
Changes:
- Adds
#[doc(hidden)]to program-only modules and three entry points in shared library modules. - Updates feature descriptions and removes README module listings for hidden programs.
- Marks 20 Linux and 5 Windows snapshot entries as hidden, without adding or removing items.
| File | Description |
|---|---|
nvx-rs/src/lib.rs |
Hides testing and clarifies the cli and testing features. |
nvx-rs/src/host/mod.rs |
Hides the CLI module. |
nvx-rs/src/guest/time/mod.rs |
Hides the time program’s entry point. |
nvx-rs/src/guest/reseed.rs |
Hides the reseed program’s entry point. |
nvx-rs/src/guest/mod.rs |
Hides six program-only guest modules. |
nvx-rs/src/guest/ingress/mod.rs |
Hides the ingress program’s entry point. |
nvx-rs/README.md |
Removes hidden-module listings and updates feature descriptions. |
nvx-rs/public-api/windows.txt |
Marks five program-related entries as hidden. |
nvx-rs/public-api/linux.txt |
Marks twenty program-related entries as hidden. |
nvx-rs/Cargo.toml |
Updates comments describing program-building features; configuration is unchanged. |
Review effort: Balanced
|
Neuro-formal verification (NFV) selects nontrivial properties from PR intent and source, tries verification, then tries refutation. NFV: 0 refuted, 0 verified in PR #1265PR head These are results for translated models under their stated assumptions, not proofs of source-code correctness or confirmed source bugs. refuted: 0 · verified: 0 · resources exhausted: 0 · type-check/audit failure: 0
Add this agentic workflow to your repoTo install this agentic workflow, run |
Closes #1091 (SL1.5: NVX's programs are hidden from the public API).
Stacked on #1261 (SL0.4), whose public-API snapshots this pull request updates; GitHub retargets it to
devonce #1261 merges.What and why
NVX's guest tools, managed agent, CLI and fake OpenVMM are programs, but their modules appeared in
nvx's documentation as API. A binary can call only a public item, so this pull request hides the programs' entry points instead of moving them. No code moves, and every binary keeps calling the same path.#[doc(hidden)], keeping theircfgs:guest::{console_pending, device_io, exit, managed_agent, mmio_write, time_probe},host::cliandtesting, withtesting::fake_openvmm. Their submodules are already private.guest::ingress::main,guest::time::mainandguest::reseed::mainbecome#[doc(hidden)], while the library parts beside them stay documented:Announcer,PROGRAMandStartError;TimeAbiand its types;Seed,reseedandReseedError.cliandtestingfeatures build NVX's own binaries and add no API; the crate's feature list gains theclientry that it lacked. docs.rs's feature list doesn't change.nvx::testing::fake_openvmmandnvx::host::cli, with their sections, whose facts "Test hooks" and "The nvx-rs CLI" already hold, and "Test hooks" names the fake OpenVMM's source file instead of its module.python scripts/public_api.py --updatemarks the hidden items in the API snapshots.The snapshots' diff only adds hidden markers: 20 lines of
nvx-rs/public-api/linux.txtand 5 ofwindows.txtgain(hidden), which no line had before, and no line appears or disappears. Without the markers, both snapshots equal those of this pull request's base, line for line:The lines that gain the marker
linux.txt:windows.txt:Tests
python scripts/check_test_changes.py --base fd53cc783a93814e4d1d9cca9e0afcd7803ed563reports none.nvx-rs/tests/cli.rs, with the scenario tests ofnvx-rs/tests/cli/, andfake_openvmm.rs,guest_tools.rs,managed_lifecycle.rs,template_capture.rs,checked_handoff.rs,supervisor.rsandstore.rsinnvx-rs/tests/; the unit tests of the hidden modules; and the guest binaries' tests (nvx.py test-guest-binaries).test_readme_gives_each_module_a_short_row_and_a_section(scripts/test_nvx_tools.py), which checks the README's module table, passes unchanged with the two rows fewer.Size
0 core lines in 0 counted files, under #1076's rules: a file whose items a pull request only hides doesn't count, nor do those lines, and documentation and the snapshots don't count either. Counted as code, the 11
#[doc(hidden)]lines would make 11 core lines in 6 files: 6 innvx-rs/src/guest/mod.rs, and 1 each innvx-rs/src/lib.rs,nvx-rs/src/host/mod.rs,nvx-rs/src/guest/ingress/mod.rs,nvx-rs/src/guest/time/mod.rsandnvx-rs/src/guest/reseed.rs. #1091 estimated 0.Validation
At this head. Nothing was published.
cargo doc --no-deps --features cli,testing,guestwith Rust 1.95.0, docs.rs's features, for docs.rs's targetsx86_64-unknown-linux-gnuandx86_64-pc-windows-msvc, each into an empty documentation directory. At the base, its pages include the 8 modules and the 3 entry points that this pull request hides, for Linux, with 11mainpages in all, andhost::cliandtestingfor Windows. At this head, it documents none of them for either target, and its list of items links to none, while the pages of the library parts remain, such as those ofAnnouncer,PROGRAM,StartError,TimeAbi,TimeError,Seed,reseedandReseedError.python scripts/public_api.pypasses on Windows and on Linux. On Linux, both listings that it generates equal the committed snapshots byte for byte.check-nvx-rsthat run on Windows, run as written, pass: rustfmt; Clippy, denying warnings, on every feature set,--lib --bins --features cliand--lib --bins --no-default-features --features testingincluded; the tests with all features and with the default ones, and the library's tests without them; the bundling test; the documentation, denying warnings; the minimum Rust version's check; and the runtime adapter's checks.requirements-dev.txtpins: the Linux-only steps ofcheck-nvx-rs(the macOS check, the guest binaries' checks, build and tests, and the runtime adapter's guest configuration), the two--lib --binsClippy runs, thevalidate-nvxunit tests (1796 tests, 39 skipped),scripts/test_adversarial.py(84 tests, none skipped), the host-connect tests,nvx.py --helpfor each command, the OpenVMM vector and CPU profile tests, ShellCheck, shfmt, ruff, pyright for Linux and for Windows, the Markdown links, the test layout and kernel configuration checks, and the Specula tests pass.requirements-dev.txtpins: thevalidate-nvxunit tests (1796 tests, 71 skipped), the host-connect tests,nvx.py --helpfor each command, the OpenVMM vector and CPU profile tests, ruff, pyright for Linux and for Windows,compileall, the Markdown links, the test layout, kernel configuration and PowerShell syntax checks, and the test-change check pass, andscripts/test_adversarial.pypasses (84 tests, 11 skipped) with CPython 3.14.9, python.org's embeddable runtime without its._pthfile. The Specula tests fail there: they importfcntl, which Python lacks on Windows, and CI runs them on Linux only, where they pass.dev. The change only hides items, so no VM scenarios ran.