Repository navigation
doc: describe only the final nvx library in a guide and the READMEs (SL6.10a) - #1555
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The documented restore sequence omits skipping MAPS when no exports are configured, so following it unconditionally would fail an otherwise valid restore because encoding an empty mapping table returns an error.
1 open issue
What changed in this PR
Updates the documentation for the final public nvx library, separating its microVM mechanisms from caller-owned state and policy and NVX’s private programs.
Changes:
- Adds one library guide covering cold boot, snapshot restore, and reattachment, linked to compiled examples.
- Slims the crate README to the final public API and clarifies caller responsibilities.
- Adds library-guide and guest-agent-guideline links to the repository landing page.
| File | Description |
|---|---|
README.md |
Updates the crate description and links the library and guest-agent guides. |
nvx-rs/README.md |
Documents the final public modules and separates private implementation details. |
doc/library.md |
Introduces the three host workflows and caller-owned responsibilities. |
Review effort: Balanced
761fc1a to
e223dd7
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The documentation targets several pending stacked branches rather than this snapshot, requiring maintainer verification of API and protocol claims against the integrated tree after the planned rebase.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
5d18353 to
b92df2b
Compare
This pull request changes no existing testRelocated unchanged: 0; added: 0. Compared the merge base |
e223dd7 to
506524f
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The documentation conflates an artifact’s digest with the checksum file’s digest, which can give different release artifacts the same identity and hide artifact changes from runtime-identity comparisons.
1 open issue
Review effort: Balanced
506524f to
faad27c
Compare
The library keeps no stores, drives no restore and applies no path or image rules any more, and nothing told a program that uses it what it owns in their place, or how its workflows go: the crate README's one example, a cold boot, was an uncompiled copy of lib.rs's, and the other workflows lived only in the compile-only host-workflows example. doc/library.md follows a host program through a cold boot, a restore from a strict snapshot, with the capture that makes one, and a reattach after the program restarts, and links each to code that CI compiles through the public API alone: the example of the crate documentation in lib.rs, cold_boot, stop, capture, restore and reattach in host-workflows, capture and activate in guest-workflows, the example of host::transport, and external-launch. It then states, in bounded lists, what the program owns in place of the removed stores, driver and policies: paths and image checks, durable state, locks, I/O, timing, recovery, outputs and process lifecycle, each checked against the rustdoc and code of host::vm, host::snapshot, host::restore, host::filesystem, host::transport and host::process. Docs only: 0 core lines, no counted files. Part of #1130 (SL6.10a). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The README still introduced the crate as the NVX mechanics and their
supervision, laid out the split platform, store and supervisor modules,
listed exec among the modules without default features, kept an
uncompiled copy of lib.rs's example, and gave modules that leave the
public API, or leave the crate, rows and long sections of their own.
It now opens with the library's mechanisms and what it leaves to its
users, links the library guide and the guest-agent guidelines, and
names NVX's programs, with NVXC and the code that only they use, as
private users of the library, whose binaries call hidden mains. Its
features come first, and its layout and module table describe the
final public modules: guest::{exec, spawn, process, cgroup, entry} are
gone; guest::{root, view, gpt}, the mapper and the application of an
activation are nvx-init's space, private to the crate, which a short
section under the guest binaries describes and the guidelines detail,
in place of the long sections of each; host::platform is private and
host::report a module of its own; and nvx::protocol::maps and
nvx::Error gain rows. The table keeps one line of at most 200
characters for each of its 36 modules, above the floor of 30 that
module's contracts and leave the rest to its rustdoc. NVXC is private
and speaks version 2 alone; library callers tell errors apart by their
kinds alone, and StillRunning also follows a spawn that cannot confirm
the exit of the process that it started; and the Example gives way to
the guide, whose links reach compiled code.
The CLI's sections, the table of error codes, the binaries' table and
the tests keep their places, since other documents link them and
SL6.10d owns the CLI reference, but no longer say what the code stopped
doing:
- the security checklist covers a VM's directory and outputs and a
snapshot's directory, and the checks of an export's targets, read-only
paths and owner, and of its exported objects, are unit tests of
host::filesystem, as the checklist itself says;
- the store's runtime record is strict and has no format, so an earlier
build's record fails every transition as one that does not parse;
- the deleted sandbox plan no longer holds the network policy, and
provision records the network options, from which each start builds
the policy again;
- a configuration that nvx.py wrote fails as an unsupported format
before its missing distro binding, and a RAM upper records no scratch
binding;
- format-unsupported and foreign-files name the state that the CLI still
keeps, in place of a started sandbox's runtime record and the deleted
template store, and still-running also follows a failed start;
- and the news of an API change of the now private host::sandbox goes.
Docs only: 0 core lines, no counted files.
Part of #1130 (SL6.10a).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The landing page described the nvx crate as the NVX mechanics with the supervision of NVX's microVMs, and had no link for a program that runs microVMs through the library, nor for the authors of guest inits. Its note on integration and its list of usage documents now link the library guide, its crate entry describes the library and NVX's programs in it, and the guest-agent guidelines join the list. Docs only: 0 core lines, no counted files. Part of #1130 (SL6.10a). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
faad27c to
9dc06eb
Compare
|
Reran the failed jobs of CI run 43345750757 once, as attempt 2, with Attempt 1 failed only |
6975b00
into
feature/nvx-refactor

Part of #1130 (SL6.10a, "The library's guide describes only the final public library"). Parent #1090, umbrella #1076.
What and why
The landing page and the crate README still presented
nvxas "the NVX mechanics" with the supervision of NVX's microVMs, laid out the split platform, store and supervisor modules, listedexecamong the modules without default features, kept an uncompiled copy oflib.rs's example, and gave modules that leave the public API, or the crate, rows and long sections of their own. Nothing told a program that uses the library what it owns now that the library keeps no stores, drives no restore and applies no path or image rules. This PR does SL6.10a's Scope and no more, and describes the final public library, whichfeature/nvx-refactornow holds: the host chain (SL6.6c, SL6.7b, SL6.6d, SL6.5a2, SL6.5b, SL6.8c), SL6.11b (#1542), SL6.14, SL4.4b, SL6.11d (#1547), SL6.13b (#1548), SL4.4c (#1541) and SL4.4d (#1545) have merged. Each statement was checked against the code of the tip that this branch is restacked on.doc/library.md(new, the one guide): a host program's three workflows, each linked to code that CI compiles through the public API alone rather than a copy of it:vm::create_private_dir,VmDir::open,vm::create,vm::spawn(orPrepared::into_commandfor a launcher of the caller's own),transport::connect_verifiedandHostConnection::attach,vm::stop. Linked: the example of the crate documentation innvx-rs/src/lib.rs(a rustdoc test),cold_bootandstopinnvx-rs/examples/host-workflows.rs(compile-only), andexternal-launch.finish_capture,Snapshot::open, the caller's per-snapshot lock on Linux,vm::create(.., Some(&snapshot), ..),Prepared::activation_record, aRestoreMachinethat the program drives with its own I/O, and the guest'sActivation. Linked:captureandrestoreinhost-workflows,captureandactivateinguest-workflows.SavedVm,vm::reattach,vm::verify,RuntimeMismatch. Linked:reattachinhost-workflows, and the rustdoc test ofhost::transport.host::{vm, snapshot, restore, filesystem, transport, process}(for example the Linux per-snapshot lock, the Windows spawn's inheritance window andwindows_breakaway,ExportPlan's paths-only race and rechecks,RestoreError's attribution,StillRunning).nvx-rs/README.md, slimmed to the final public library:mains. Features come first (execgone).guest::{exec, spawn, process, cgroup, entry}are gone;guest::{root, view, gpt}, the mapper and an activation's application are nvx-init's space, private to the crate, which a shortnvx-init's spacesection under the guest binaries describes and the guidelines detail;host::platformis private andhost::reporta module of its own;nvx::protocol::mapsandnvx::Errorgain rows. The table keeps the convention of.github/copilot-instructions.md: 36 rows, each one line of at most 200 characters that links its section after the table, above the floor of 30 that guest: delete the process modules and cgroups (SL6.11b) #1542 set (test_readme_gives_each_module_a_short_row_and_a_section). It lists no private module.nvx::protocolsays that NVXC is private and speaks version 2 alone, as SL4.4c and SL4.4d make it;ExportPlanholds paths only;nvx::Errorhas no public codes or constructors, and library callers tell errors apart by their kinds alone (the old text also had them match message fragments, whichError's rustdoc reserves to the CLI's callers). The uncompiled Example gives way to the guide.doc/usage.md,doc/ci.md,doc/contribute.md,doc/build.md,doc/distribution.md, the repository instructions) and SL6.10d owns the CLI reference, but no longer say what the code stopped doing: the security checklist covers a VM's directory and outputs and a snapshot's directory, while the checks of an export's targets, read-only paths and owner, and of its exported objects, are unit tests ofhost::filesystem(the finding that SL6.10f's agent reported); the store's runtime record is strict and has no format, so an earlier build's record fails every transition as one that does not parse; the deleted sandbox plan no longer holds the network policy; a configuration thatnvx.pywrote fails as an unsupported format; a RAM upper records no scratch binding;format-unsupportedandforeign-filesname the state that the CLI still keeps, not a started sandbox's runtime record or the deleted template store;still-runningandStillRunningalso follow a failed spawn; and the news of an API change of the now privatehost::sandboxgoes.README.md: the landing page's note on integration and its usage list link the guide, its crate entry describes the library and NVX's programs in it, and the guest-agent guidelines join the list. No other root section changes.Restack. After SL6.8c merged, the branch was restacked with
git rebase --onto origin/feature/nvx-refactor 5d18353131d, with rerere off. The guide and the landing page applied as they were. The README's conflict was resolved by section: this slim structure for the library part, and the tip's text, with SL4.4c's, SL4.4d's and SL6.13b's edits, for the sections kept above; then every statement was checked against the tip. The private space's long sections, which SL6.13b moved undernvx-init's space, give way to the short section above, since the guidelines give the space's interface. The fixes' autosquash then moved the base toe6c65b95f63, which adds SL6.10e's docs and touches none of these files. At the tip's floor of 30,test_readme_gives_each_module_a_short_row_and_a_sectionpasses.Case matrix. No test changes. Its Docs row for the README's Example already records the fate (rewritten; "the library's guide (SL6.10a) replaces the example"), so no row changes.
Not in this PR, per #1130: CLI reference material (SL6.10d), design pages (SL6.10b, SL6.10c), other guides or a cookbook, build and CI docs (SL6.10e, SL6.10f), the rustdoc (SL6.10g), the migration guide (SL6.10h), and examples beyond cold boot, restore and reattach.
Size. 0 core lines and 0 counted files (estimate 0): two READMEs and one new guide.
BOOT_CONTRACT_VERSION,CONTROL_CONTRACT_REVISIONand the public API are unchanged.Validation
local_gates.py(dev's) selects markdown-links, test-layout, test-changes, thenvx-rschecks and validate-nvx for these files; the ones that the change affects ran from this branch's action definitions, on Windows, at506524fa2b7one6c65b95f63, unless a row says otherwise; Copilot's later finding changed one sentence of the guide, after which the link check passed again atfaad27c788e:python scripts/check_markdown_links.pygit rebase --exec)python scripts/check_test_layout.pypython scripts/check_test_changes.py --base origin/feature/nvx-refactorcargo test --locked --lib --manifest-path nvx-rs/Cargo.toml -- error::tests(reads the README's error codes throughinclude_str!)python -m unittest test_nvx_tools.NvxRsTests test_markdown_links test_tool_versions, which include the module table's test at the tip's floor of 30 and the error codes againstdoc/usage.mdcompilealland the unittest listd368e666fb5on12a90c4a0ee, before the prose fixes below and SL6.10e's docs:compileallpassed, and all 1803 testsrebase_check.py verifyafter the restack--ontointends; this branch's three commits are kept and signedguest::{root, view, gpt}); the module table's 36 rows are all public modules or itemsguest-agent-guidelines.md#ownership,#build-the-space,#the-hosts-mapping-table,ci.md#cratesio-releases,run.md#run-openvmm-directly), and those that other documents link here (#testing,#guest-binaries,#error-codes,#the-nvx-rs-cli,#artifact-root,#layout)windows_breakawaywhen the program runs in a job;vm::stopreturns the report's read apart from the exit;KeyIdentitydigests the key's compatibility prefix;bytes_readcounts reaped children on Linux; library callers classify errors by kind alone; the program sends the mapping table only when it holds a mapping). After the restack, two code-review agents rechecked every statement against the tip. The rewritten parts' four findings are folded:ReadyListener::receivetakes a timeout, not a deadline; on Windows the endpoints are named pipes, not entries of the VM directory; a capture's kernel command line holds only the caller's platform tokens andmaxcpus;StillRunningalso follows a failed spawn. The kept sections' eight findings are folded, as the last item of thenvx-rs/README.mdbullet above lists. Copilot's review of the restack found one more, folded: the guide labels each runtime file with that file's own SHA-256 digest, as a release'sSHA256SUMSlists it, not with a digest of the checksum filenvx-rs/README.mdis not the crate's documentation (lib.rsdoesn't include it), so no doc test orcargo docoutput changes, and nothing here is guest-gated: no Linux host, build or microVM run.