Repository navigation
doc: give init agents guidelines (SL7.9) - #1492
Merged
Pedro Henrique Penna (ppenna) merged 5 commits intoNov 11, 2026
Merged
Pedro Henrique Penna (ppenna) merged 5 commits into
Pedro Henrique Penna (ppenna) merged 5 commits into
Conversation
Contributor
This pull request changes existing testsIt modifies or removes 1 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 require resolution.
No open issues 🎉
What changed in this PR
Implements SL7.9 of #1130 by documenting init-agent responsibilities separately from nvx’s library mechanisms, using nvx-init as the reference. Changes are limited to documentation, rustdoc examples and a compile-only unit test; runtime behavior and the public API are unchanged.
Changes:
- Adds guidelines for guest-space assembly, execution ownership, capture coordination, restore ordering and failure handling.
- Connects the guidelines to compiled examples through public-API doctests and the existing private-space unit test.
- Updates the architecture pages, documentation index and acceptance-case matrix.
| File | Description |
|---|---|
nvx-rs/src/guest/snapshot.rs |
Adds a capture-outcome doctest and guidelines link. |
nvx-rs/src/guest/mod.rs |
Adds a mapping-table doctest and guidelines link. |
nvx-rs/src/guest/init/boot/tests.rs |
Aligns compile-only space examples with the quoted guidelines. |
nvx-rs/src/guest/activation.rs |
Links restore sequencing and caller obligations to the guidelines. |
nvx-rs/src/activation/mod.rs |
Summarizes restore-space ordering and links the guidelines. |
doc/project-structure.md |
Lists the new guidelines page. |
doc/guest-agent-guidelines.md |
Defines init-agent responsibilities with nvx-init examples. |
doc/design/4.3-isolation-and-resource-model.md |
Distinguishes nvx-init’s VM-wide boundaries from legacy isolation. |
doc/design/4.2-guest-agents-and-workload-model.md |
Updates lifecycle ownership and the guest architecture diagram. |
doc/acceptance-case-matrix.md |
Records the new doctests and updates existing doctest locations. |
Review effort: Balanced
Pedro Henrique Penna (ppenna)
force-pushed
the
agents/slim-sl5-1a-feature-sets
branch
2 times, most recently
from
November 11, 2026 21:30
9276731 to
05cd1d2
Compare
Base automatically changed from
agents/slim-sl5-1a-feature-sets
to
feature/nvx-refactor
November 11, 2026 21:47
Pedro Henrique Penna (ppenna)
force-pushed
the
agents/slim-sl7-9-init-guidelines
branch
from
November 11, 2026 21:57
0258d48 to
196634c
Compare
Centralize the guest-space, execution, capture and restore contract in one guide, with nvx-init as the internal reference example. Keep the architecture pages focused on boundaries and check the quoted public and private calls through existing rustdoc and unit tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 41345a73-b73f-4332-9ffd-9c513214af7a
Scope the VM-wide reference model separately from retained layered and blockless boot paths. Keep control-device and port-I/O boundaries, and distinguish parent-side account validation from child credentials. The daemon/helper compatibility wording remains a separately disclosed contract question. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 41345a73-b73f-4332-9ffd-9c513214af7a
Scope the reference lifecycle ownership rule without claiming that every retained API avoids forking. Describe caller-owned announcer startup and the report-only restore-finish child fallback without changing runtime or public API behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 41345a73-b73f-4332-9ffd-9c513214af7a
Distinguish the inline deferred restore checks and detector release from the deadline waiter and grace-period grandchild. Preserve the actual child-reaping boundary without changing helper behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 41345a73-b73f-4332-9ffd-9c513214af7a
The first draft of the guidelines predates the nvx-init that feature/nvx-refactor now holds: #1453 routes the new sandbox boots to it, #1431 serves capture requests, #1447 activates repaired sessions, #1439 keeps a restore's announcer as a helper, and #1490 runs sandbox run through it too. Check each statement against that code, and correct those that did not hold: - an execution takes the VM's one workload identity, which nvx-init resolves, or creates, once before its switch, not an account mode of its own request, which nothing selects yet; - the child also drops its capability bounding set, and nvx-init kills an execution's process group when its leader ends; - nvx-init captures only the Fresh boot of a platform capture, refuses a session with a root with ENOTSUP, and shares one 30-second deadline among its checks, its sweep and the capture; - the restored broker restarts at its first epoch with a reset queued, and nvx-init fails on anything but that reset; - the host sends no MAPS for an empty mapping table, which no nvx_maps token announces; - no launch of NVX's CLI carries OpenVMM's older lifecycle token, which still routes a layered launch to the older init agent; - since #1494, no call of nvx starts the announcer: nvx-init forks it and runs /sbin/nvx-ingress itself, and nvx-ingress start runs it for an agent that cannot hold it; - the crate still keeps older calls that start processes, which nvx-init does not use. Quote, and compile, the space's steps in the order of nvx-init's cold boot and restore, and replace the capture excerpt with one that handles each outcome and disposition. The steps compile in SL5.1a's unit test of nvx-init's boot, the_reference_space_steps_compile, which now holds them as the guidelines quote them, and the guidelines link SL5.1a's guest-workflows example. Organize the page by ownership, the space, the executions, the capture, the transport, the restore, failures and replay. Trim design 4.2 and 4.3 to the architecture and boundaries of nvx-init and of the older layered and blockless roots, which still run. Link the guidelines from the rustdoc of guest::activation too, list the page in the project structure, and give the case matrix the doc tests that the guidelines quote, and the lines to which the links move two others. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pedro Henrique Penna (ppenna)
force-pushed
the
agents/slim-sl7-9-init-guidelines
branch
from
November 11, 2026 22:23
196634c to
137d802
Compare
Pedro Henrique Penna (ppenna)
marked this pull request as ready for review
November 11, 2026 22:23
Pedro Henrique Penna (ppenna)
marked this pull request as draft
November 11, 2026 22:25
Pedro Henrique Penna (ppenna)
marked this pull request as ready for review
November 11, 2026 22:25
Pedro Henrique Penna (ppenna)
merged commit Nov 11, 2026
f834bcb
into
feature/nvx-refactor
109 of 129 checks passed
Pedro Henrique Penna (ppenna)
deleted the
agents/slim-sl7-9-init-guidelines
branch
November 11, 2026 22:43
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.
Part of #1130 (SL7.9, "Init agents have guidelines"). Parent #1090, umbrella #1076.
What and why
Authors of init agents had no single contract for building a guest's space, running executions, coordinating a capture and completing a restore: design 4.2 and 4.3 mixed that procedure with the architecture, and described execution machinery that nvx-init doesn't use. This PR does SL7.9's Scope and no more:
doc/guest-agent-guidelines.md(new) opens with the split:nvxparses the contracts, captures the guest and drives a restore's activation, but builds no space, runs no executions and enforces none of these obligations; the one exception is the time daemon, whichTimeAbi::start_daemonforks. With nvx-init as the worked example, it covers:MappingTable's contract: parts in order, a latch after a failure, a complete table before any workload;freeze(deadline),undone, ordered all-or-nothing freezes thawed in reverse,after_restore()), and what nvx-init does instead: it refuses a capture while an execution runs, or kills the process groups and sweeps;Activation::new, the space with the restore's own network policy, DNS and announcer,after_restore,complete, thaw, Ready), failures (Resumed,MustEnd) and replay.guest's rustdoc and the capture-outcome excerpt inguest::snapshot's. The space-interface snippets are the body of the private space's unit test,guest::init::boot::tests::the_reference_space_steps_compile, also quoted verbatim. No new harness.guest,guest::snapshot,guest::activationandactivationlink the guidelines.doc/project-structure.mdlists the page, as it lists every document indoc/. In nvx-rs: build every feature set, compile the documented examples, and give every old test a fate (SL5.1a) #1488's case matrix, the two new doc tests get a row, and the two doc tests whose lines the rustdoc links move keep theirs, at the new lines.Not in this PR, per #1130: other guideline documents, a workspace trait or enforcement code in
nvx, publishing the space module, cgroups, namespaces, per-execution roots or limits, a new example harness, or rewriting 4.2 and 4.3 beyond architecture and boundaries.Commits. The first four are Enrique Saurez (@esaurez)'s first implementation (
esaurez/slim-5.2.1-sl7.9-private-20261108), replayed with their authorship. The fifth checks each statement against nvx-init onfeature/nvx-refactorand corrects those that didn't hold; its message lists them.Rebase. Rebased from
5947e4e8onto SL5.1a, which has merged (#1488), and now onfeature/nvx-refactor584c2ddd, after #1494. Both branches compiled the space's steps in a test of their own, in different files, so Git reported no conflict but one test would duplicate the other. This branch's version now lives in SL5.1a's test, under its name and in its file, whichnvx-rs/README.mdnames (see below). Every statement was checked again at the new base, where the guest code is unchanged since5947e4e8. Three statements no longer held, and are corrected: the host sends noMAPSfor an empty mapping table, which nonvx_mapstoken announces; since #1490, no launch of NVX's CLI carries OpenVMM's older lifecycle token, which design 4.2 said the older CLI launches carry; and since #1494, no call ofnvxstarts the announcer, so the guidelines no longer nameAnnouncer::start, and say that nvx-init forks the restored announcer and runs/sbin/nvx-ingressitself, whilenvx-ingress startruns it for an agent that cannot hold it.Size. 0 core lines and 0 counted files (estimate 0): documents, rustdoc comments and one unit test.
BOOT_CONTRACT_VERSION,CONTROL_CONTRACT_REVISIONand the public API are unchanged.Validation
python scripts/check_markdown_links.py,python scripts/check_test_layout.pycargo fmt --all --check-D warnings:--all-targets --all-features,--lib,--lib --no-default-features,--lib --no-default-features --features serde,--lib --bins --features cli,--lib --bins --no-default-features --features testing--all-targets --all-featuresalso passed on Linux (nvx-kvm-test), where it compiles #1488'shost-workflowsandguest-workflowsexamples--target x86_64-unknown-linux-musl --no-default-features --features guest --all-targets -- -D warnings(the Clippy run ofnvx.py check-guest-binaries)guest-workflowswithguestalonecargo doc --no-deps --all-features,RUSTDOCFLAGS=-D warningscargo test --doc --all-featuressrc/guest/mod.rs - guest (line 41),src/guest/snapshot.rs - guest::snapshot (line 25),src/guest/activation.rs - guest::activation (line 195)andsrc/activation/mod.rs - activation (line 130), the names that the matrix gives them. Windows: theactivationdoc test passedguest::init::boot::tests::the_reference_space_steps_compileguestalone (musl). All ofguest::init::boot::tests(musl): 14 passed, 2 ignored (they need a microVM)cargo test --all-features --test security_checklist(#1488)rustblocks is identical to the code that it quotescheck_test_changes.py --base origin/feature/nvx-refactorThe table's results are from
0258d484, before the rebases onto3c3dfce1and584c2ddd, which changed no content of these commits but the design 4.2 sentence and the announcer statements above. At137d8029, Markdown links, test layout, fmt, rustdoc with warnings denied and the doc tests (Windows and Linux), and the private-space test (Linux, all features andguestalone), passed again, with the same doc-test names.No runtime behavior changes, so no microVM scenario ran. Left to CI: the rest of check-nvx-rs (the full test suites, MSRV, macOS, public API, bundling) and the runtime adapter's checks.
Changes to existing tests (
tests-modified)guest::init::boot::tests::the_reference_space_steps_compile(nvx-rs: build every feature set, compile the documented examples, and give every old test a fate (SL5.1a) #1488's) now holds the space's steps exactly as the guidelines quote them. It has two closures: a cold boot in the order ofboot::cold_boot, and a restore in the order ofboot::Restored::apply. Each has its ownuselines and returnsBox<dyn Error>, so that the quoted excerpt is self-contained, and comments mark where the init starts its helpers and its announcer. It drops nvx-rs: build every feature set, compile the documented examples, and give every old test a fate (SL5.1a) #1488's mapping-table closure and announcer callback: the guidelines quote the table's public half fromguest's doc test instead. It still compiles its closures and runs none of them. This branch first had the same steps in a test of its own,guest::init::tests::documented_private_space_steps_compile. On the rebase, they moved into nvx-rs: build every feature set, compile the documented examples, and give every old test a fate (SL5.1a) #1488's test, so that one test compiles them.Every other test of the area is kept. The doc tests of
activationandguest::activationare unchanged, at lines 130 and 195 (were 123 and 189).