Repository navigation
Description
Parent: #1077, in #1076. Needs: #1092. Unblocks: #1094, #1095, #1096, #1097, #1099, #1104, #1106, #1108, #1120, #1132.
Goal. The OS layers that nvx and NVX's other crates share move into nvx-sys, by git mv: the old error type, the guest's sys, parse, status and kernel_text, and the host's sys and the low-level parts of platform (common, Linux, Windows, and the fallback for unsupported hosts). nvx aliases the old paths, so its callers don't change, and keeps its public facades, such as Transport and probe_hypervisor. Six PRs keep each move dependency-closed. The OS layers have 687 pub(crate) lines; only the items that nvx uses across the new boundary, and the host items that the cli feature gated, become public.
Notes.
nvx-sysis published beforenvx, with no stability guarantee. The owners publish its first version by hand, then add its trusted publisher.nvx-sysuses nothing fromnvx. The links back are cut as the code moves: comments,LaunchStage,Command,HypervisorandFileSeal.nvx-syshas noclifeature, so the items that it gated become public.- The host OS layer moves after nvx-rs: move the host modules' tests out of their sources #1197. SL0.3c and SL0.3d edit
nvx-rs/src/host/, which nvx-rs: move the host modules' tests out of their sources #1197 edits too as it moves the host modules' tests out of their sources, so they start from, or rebase onto, adevthat contains it. The PRs before them don't touch the host. The guest OS layer's tests and test helpers are already intestsmodules (nvx-rs: move the guest modules' tests out of their sources #1196): each module moves with itstests.rsortests/, and the helpers thatguest::sys::testsshares withnvx's tests move behindnvx-sys'stest-supportfeature.
PRs, in order. Each PR has one goal, leaves dev green, and names in its description each old test of its area as kept, rewritten or retired, with each change that check_test_changes.py reports. Its tests follow the repository's test layout: a module's unit tests, and the code that only they use, sit in its tests.rs or tests/ and move with it. The estimates count core lines (code, not comments, docs or tests) and counted files; each PR records its measured values. Each PR does what its Scope says and no more: a case, input or layout that its Scope doesn't name, and whatever "Not in this PR" lists, is out of scope. Address every review comment within the scope, and ask before acting on one that asks for more. A PR whose measured core lines pass the stop that its Estimate names (twice the estimate, at most 600) stops and asks before continuing.
-
SL0.3a1: The old error type lives in
nvx-sys.- Objective: The shared error type must be available to
nvx-sysbefore the OS modules move there. Moving it first letsnvxdepend on and re-export the new crate without changing callers, while publishing placesnvx-sysbefore its dependent. - Contents:
git mvoferror.rs, whichnvxre-exports until SL6.8c, so callers don't change;nvxdepends onnvx-sys, which the publishing list now publishes before it; the owners publish its first version by hand, then add its trusted publisher. The README's error table and its test follow. - Scope:
git mvofnvx-rs/src/error.rsandnvx-rs/src/error/tests.rstocrates/nvx-sys/src/error.rsandcrates/nvx-sys/src/error/tests.rs, plus the module wiring and visibility edits the crate boundary requires.nvxdepends onnvx-sysand re-exportsError,ErrorCode,ErrorKindandResultat their existing paths until SL6.8c.- The publisher's ordered crate list places
nvx-sysbeforenvx; owners publish its first version from the final reviewed source and configure its trusted publisher before the PR is marked ready or queued. This is a promotion prerequisite, not a local-build, draft-review or completion-CI prerequisite, and does not authorize publication by the implementation worker. - The ErrorKind and error-code tables move from
nvx-rs/README.mdtocrates/nvx-sys/README.mdwith the existing table test;nvxdocumentation links to their new owner, and repository links and checks follow it. - The protocol-only adapter still depends directly on
nvxwithout features. Its expected graph now includesnvx-sysand that crate's existing Unix dependencies, includingnix; update the dependency assertions and documentation without enablingnvxfeatures or adding a newnixfeature gate.
- Not in this PR:
- Changing error variants, codes, messages, conversions or formatting: this PR moves the existing type.
- Replacing the crate-wide error with domain errors: SL2.1 and SL6.8c perform that API redesign.
- Moving any guest, host or time OS module: later PRs in this group move those dependency-closed slices.
- General publishing redesign beyond adding
nvx-systo the existing order: nvx-rs slimming 1.1.1: the public API is checked, and NVX's programs are hidden from it #1091 supplies workspace publishing.
- Approach: Move the existing file intact, expose only what its new crate and the existing
nvxre-export require, and pointnvxat it. Reuse the workspace publisher's ordered crate list; do not introduce a second error implementation, compatibility wrapper or publishing path. - Done when:
- The moved error tests pass in
nvx-sys, andnvxre-exportsError,ErrorCode,ErrorKindandResultat their existing paths. - The moved README error-table check reads the canonical tables in
nvx-sys's own README, so the crate's tests remain independently packageable;nvxdocumentation links to that location. - The protocol-only dependency checks explicitly verify the adapter's
nvxdependency,nvx'snvx-sysdependency and the absence ofnvxfeatures, with the expected Unix shared-OS dependencies accounted for. - Publishing plans
nvx-sysbeforenvx; owners complete the firstnvx-syspublication and trusted-publisher setup before ready/queue promotion.
- The moved error tests pass in
- Needs: SL0.2a, in nvx-rs slimming 1.1.2: one Cargo workspace, and the new crates' empty shells #1092.
- Estimate: 50 core lines, 4 counted files. Past 100 core lines, stop and ask before continuing.
- Objective: The shared error type must be available to
-
SL0.3a0: The guest's descriptor primitives live in
nvx-sys.- Objective: Most guest OS modules depend on the descriptor and socket primitives, so those primitives must cross the crate boundary first. After this move, later guest slices can depend only on code already in
nvx-sys, while existingnvxmodules keep their old local paths. - Contents:
git mvofguest::sys::{fd, socket}, which most of the other OS modules use, withnvx-sys's module and re-export spine;nvxaliases the old paths. Their apparent links back toguest::spawnare comments. The descriptor code's real dependency onkernel::NULL_DEVICEis cut by moving that one constant's definition intofdand re-exporting it from its old kernel path; the rest ofkernelstays for SL0.3a2.EntryChildandLaunchStagestay out of this slice. - Scope:
git mvofnvx-rs/src/guest/sys/fd.rsandsocket.rsinto the guest OS module undercrates/nvx-sys/src/.- The
nvx-sysguest module and re-export spine needed by these two files, withnvxaliases for their formerguest::syspaths. - Only import, module-path and visibility edits forced by the new crate boundary.
- Move the single
NULL_DEVICEdefinition and its documentation intofd;nvx'skernelre-exports it, so existing callers keep their paths. Do not duplicate the constant or move the rest of the kernel module. fd/tests.rsandsocket/tests.rsmove with their modules. The helpers infd/tests.rsbecomefd/test_support.rs, behindnvx-sys'stest-supportfeature, rather than exposing acfg(test)module across crates. The socket tests keep their three cases;create_fifo,set_descriptor_limitandis_sealed_immutableremain available tonvxtests through its versionednvx-sysdevelopment dependency.- Minimal wiring in the existing guest-binary musl check and its command-selection tests retains the moved socket tests and linting on musl as well as the Linux workspace. Keep the existing
nvxguest checks; do not replace or weaken them.
- Not in this PR:
guest::sys::entry,guest::sys::spawn,EntryChildorLaunchStage: their real higher-level dependencies keep them for SL0.3b.- Moving other
guest::sysmodules, even when they use descriptors: SL0.3a2 moves that dependency-closed set. - Changing descriptor ownership, buffering, socket semantics or error handling: no caller needs new behavior.
- Renaming types, functions or modules, except the specified test-helper file change, or cleaning up their APIs and documentation beyond path fixes.
- Approach: Use
git mv, preserve the two files' implementation and tests, and add the smallest module and alias wiring that makes both crates compile. Treat references toguest::spawnin comments as documentation fixes, not dependencies; do not extract a descriptor abstraction or redesign the wrappers. - Done when:
- The socket tests still cover unconnected datagrams, inherited IPv4 datagram descriptors and an address already in use.
- Those socket tests run through the existing local/CI guest musl gate as well as the Linux workspace; moving crates does not drop that coverage.
NULL_DEVICEhas one definition, and retained kernel callers continue through their old path.nvxcode using the old local guest OS paths compiles without caller edits.
- Needs: SL0.3a1, above.
- Estimate: 100 core lines, about 11 counted files including the module spine and musl gate wiring. Past 200 core lines, stop and ask before continuing.
- Objective: Most guest OS modules depend on the descriptor and socket primitives, so those primitives must cross the crate boundary first. After this move, later guest slices can depend only on code already in
-
SL0.3a2: The guest's base OS helpers live in
nvx-sys.- Objective: The dependency-closed base of the guest OS layer must move behind
nvx-sysbefore entry and spawn can follow. The move preserves existing guest behavior and paths while exposing only the items thatnvxmust use across the new crate boundary. - Contents:
git mvofguest::{parse, status, kernel_text}and of the otherguest::sysmodules butentryandspawn(clock,discipline,filesystem,ioctl,kernel,mapping,msr,poll,port,process,rooted,scheduler,secret,signal,sock_diag,terminal,timerandx86), whichfdmakes dependency-closed. Theportandsignaltests that useguest::spawn::Command,guest::process::Childor the managed agent'sisolate_process_testmove tonvx, beside those owners, or are rewritten onnvx-sys's own helpers. Theirpub(crate)andpub(super)items thatnvxuses becomepub;nvxaliases the old paths, so callers don't change. Test helpers that cross the new boundary sit behindnvx-sys'stest-supportfeature, used as a dev-dependency, or the tests move to the owner of the higher-level behavior; nocfg(test)item crosses a crate. They carry whatdevadded to them since the baseline: signals through a pidfd or to a process group, the rooted open's retry ofopenat2'sEAGAIN, and the clock discipline's held host correction. - Scope:
git mvofguest::{parse,status,kernel_text}andguest::sys::{clock,discipline,filesystem,ioctl,kernel,mapping,msr,poll,port,process,rooted,scheduler,secret,signal,sock_diag,terminal,timer,x86}intocrates/nvx-sys/src/.nvxaliases the former guest paths; only cross-crate users change imports, and only their requiredpub(crate)orpub(super)items become public.- The parent-level
args,c_stringanderrno_ofdefinitions follow their moved consumers intonvx-sys, with aliases at their oldnvxpaths; the existingerrno_oftest follows its definition. - The existing
tests.rsfiles under the listed module paths move with their owners, except higher-level port and signal tests usingguest::spawn::Command,guest::process::Childor the managed agent's isolator; those stay innvxor usenvx-syshelpers. - Only helpers shared by moved code and retained
nvxtests cross intonvx-sysbehindtest-support: process isolation and status, path and umask helpers, signal helpers, diagnostic encoders andPortBackend, including shared status-command-line and child-process fixtures. Helpers with no moved consumer, such asFailing, stay with their existingnvxowner. Tests using the helpers insidenvx-sysretain access without requiring a downstream test build. - The moved behavior includes pidfd and process-group signals,
openat2EAGAINretries, and held host-clock correction.
- Not in this PR:
guest::sys::{entry,spawn}: SL0.3b first cuts their dependencies onLaunchStageandCommand.- Rewriting port, signal or process tests around a new general test framework: move them to their behavior's owner or use the existing low-level helpers.
- Making the whole guest OS layer public: only existing cross-crate uses and declared test support cross the boundary.
- Behavior changes, type or function renames, parser redesigns, portability work or cleanup unrelated to the move.
- Approach: Move the listed modules in place and preserve their implementations. Fix module paths and raise visibility item by item from actual
nvxcompile errors. Keep higher-level tests beside their owners, and expose narrowly reusable test helpers throughtest-support; do not create a new OS facade, parser or test harness. - Done when:
- Every old test in the moved modules is recorded as moved, rewritten or retained in
nvx, with port and signal tests kept beside any higher-level dependency they exercise. - Tests cover pidfd and process-group signaling, rooted-open retry after
EAGAIN, and held host-clock correction. nvxcompiles through aliases at the old guest paths, and nocfg(test)item crosses the crate boundary.
- Every old test in the moved modules is recorded as moved, rewritten or retained in
- Needs: SL0.3a0, above.
- Sizing: The initial estimate was 250 core lines and 5 counted files. Current preparation projects about 600-680 core lines and 25-30 counted files, including necessary visibility and shared test-support wiring. These are advisory targets, not correctness or approval gates. Measure and explain the actual cohesive move; do not reduce coverage, code-golf or reslice solely to satisfy a numeric threshold.
- Objective: The dependency-closed base of the guest OS layer must move behind
-
SL0.3b: The whole guest OS layer lives in
nvx-sys.- Objective: The final guest OS modules cannot move while they name
nvxlaunch types. Cutting those links and movingentryandspawncompletes the guest OS layer innvx-sys, with no dependency back fromnvx-systonvx. - Contents:
git mvofguest::sys::{entry, spawn}. Their links back toguest::{entry, spawn}(LaunchStage,Command) are cut, sonvx-sysuses nothing fromnvx. Thespawntests that use the managed agent'sisolate_process_testmove tonvx, beside that owner, or are rewritten onnvx-sys's own subprocess helper. - Scope:
git mvofentry.rs,entry/tests.rs,spawn.rsandspawn/tests.rsinto the guest OS module undercrates/nvx-sys/src/, and move both production files' allowlist seam entries to their new paths.- Replace their dependencies on
guest::spawn::LaunchStageandguest::spawn::Commandwith low-level inputs and results owned bynvx-sys; thenvxlayer adapts them. - Only import, visibility and alias edits required to keep existing
nvxcallers at their old paths. Simulation, the capability constants andholds_capabilitymove behindnvx-sys'stest-supportfeature for retainednvxtests; spawn tests using the managed agent's isolator stay innvxbeside that owner or use annvx-syssubprocess helper.
- Not in this PR:
- Redesigning the public guest
Command,LaunchStageor spawn APIs: they stay owned bynvx. - Changing child setup order, credentials, working directories, mount behavior, descriptor inheritance or failure reporting.
- Building a reusable process framework or a general subprocess-test library: only the existing tests need isolation.
- Moving guest modules outside
entryandspawn: SL0.3a0 and SL0.3a2 own those moves.
- Redesigning the public guest
- Approach: Separate the low-level child operations from the
nvxtypes at the existing call boundary, then move both files withgit mv. Add only narrow adapters innvx, and keep test isolation local to the crate that owns each test; do not redesign spawning or duplicate the implementation. - Done when:
- The entry and spawn tests retain today's child setup, execution and failure-stage behavior.
- Tests that require the managed agent's isolator remain in
nvxor run through a localnvx-syssubprocess helper. - Neither normal nor test code in
nvx-sysimportsnvx, and existingnvxguest callers keep their paths.
- Needs: SL0.3a2, above.
- Estimate: 300 core lines, 4 counted files. Past 600 core lines, stop and ask before continuing.
- Objective: The final guest OS modules cannot move while they name
-
SL0.3c: The host's OS helpers live in
nvx-sys, on Linux.- Objective: The host's common, Linux and unsupported-host primitives must be shared without moving
nvx's public host facades. After this move,nvx-sysowns the low-level host operations, whileTransport, its stream wrappers andprobe_hypervisorremain available fromnvx. - Contents:
git mvofhost::sys, and ofhost::platform's common, Linux and unsupported-host parts (inherit,other, and thelinuxdirectory:mod,endpoint,identity,log_claim,private,processandspawn, with its tests).Transport, its implementations for the platform's streams (as wrappers over public low-level stream operations) andprobe_hypervisorstay innvx; the links back (Hypervisor, andFileSeal, its test use included) are cut. Theircfg(feature = "cli")gates go:nvx-syshas noclifeature, and the items it gated become public. The read counters and the spawn's umask rule, whichdevadded, move with them. - Scope:
git mvofhost/sysandhost/platform/{inherit,other,linux}intonvx-sys, splittinghost/platform/mod.rsso thatTransport,probe_hypervisor, their wrapper tests andhost/platform/tests.rsstay innvx;host/sys/tests.rs,host/sys/process/tests.rsand the Linux platform'stests.rsfiles move.- Expose the spawn-descriptor, umask, identity, ownership and store-directory helpers that retained
nvxtests use throughnvx-sys'stest-supportfeature; cutHypervisorandFileSeallinks, keeping or rewriting theFileSeal-dependent test innvx. Transport, Linux stream implementations asnvxwrappers over public low-level stream operations, andprobe_hypervisorstay innvx.- Remove
cfg(feature = "cli")from moved items and make those items public becausenvx-syshas noclifeature. - Preserve Linux read counters, restore-ready socket permissions under restrictive umasks, and the unsupported-host implementation.
- Not in this PR:
- Moving the Windows platform directory: SL0.3d moves and tests that platform separately.
- Moving or redesigning
Transport,probe_hypervisor,HypervisororFileSeal: they arenvxfacades and types. - Adding support for another host platform: Linux and Windows are supported, and the existing fallback reports other hosts unavailable.
- Changing process, endpoint, identity, log-claim or spawn behavior, or cleaning up their APIs beyond forced boundary edits.
- Approach: Move the existing common, Linux and fallback files with
git mv. Extract only the low-level stream operations needed by thinnvxTransportwrappers, replaceHypervisorandFileSeallinks with primitive inputs, and remove obsolete feature gates; do not create a new transport hierarchy or platform abstraction. - Done when:
- Existing low-level and retained higher-level tests still cover wait timing, restore-ready socket permissions under a restrictive umask, closed-before-accept behavior, unread transport counts, process read counters and log-claim identity checks.
- The
FileSeal-dependent test remains withnvxor is rewritten without crossing the crate boundary. Transportandprobe_hypervisorremain at their existingnvxpaths, and unsupported hosts still compile and report unavailable.- The moved host code has no
clifeature gates and no dependency onnvx.
- Needs: SL0.3a1, above.
- Estimate: 300 core lines, 5 counted files. Past 600 core lines, stop and ask before continuing.
- Objective: The host's common, Linux and unsupported-host primitives must be shared without moving
-
SL0.3d: The host's OS helpers live in
nvx-sys, on Windows.- Objective: Windows needs the same host OS ownership as Linux without broadening the move into a platform redesign. The Windows primitives and their low-level tests move to
nvx-sys, while higher-level tests stay with their owners andnvxretains its existing public facades. - Contents:
git mvof the Windows part ofhost::platform, now thewindowsdirectory (about 1.9K core lines in eight files, and 65pub(crate)items). Itscfg(feature = "cli")gates go, as in SL0.3c. CI's Windows jobs runnvx-sys's tests. It carries the per-log job objects and the log claim's identity checks thatdevadded. - Scope:
git mvof the Windowsendpoint,identity,interrupt,log_claim,private,process,spawnand module files, withwindows/tests.rsandwindows/private/tests.rs, intocrates/nvx-sys/src/; supervisor and store tests stay innvxand useset_accessthroughnvx-sys'stest-supportfeature.- Remove the moved code's
cfg(feature = "cli")gates and make the formerly gated items public for existing cross-crate callers. - Preserve per-log job objects, log-claim identity checks, named-pipe operations, process identity and handle inheritance behavior.
- Update Windows CI jobs to run
nvx-systests, and move the allowlist seam entry forhost/platform/windows/spawn.rsto its new path.
- Not in this PR:
- Redesigning Windows process launch, job ownership, named pipes, security descriptors or handle inheritance: this is a move.
- Changing
Transportorprobe_hypervisor, which remainnvxfacades over the moved primitives. - Adding Windows behavior not present in the moved modules or making Linux and Windows implementations structurally identical.
- Renaming public or private items, reorganizing the Windows directory further, or performing unrelated cleanup.
- Approach: Move the Windows files and low-level tests together, keeping higher-level tests beside their owners. Adjust imports and visibility only where the crate boundary requires it, and remove feature gates that the destination crate cannot express. Keep the existing operating-system calls and test fixtures; do not wrap them in a new cross-platform framework.
- Done when:
nvx-sysand retainednvxWindows tests together cover endpoint I/O, process identity, spawn handle inheritance and per-log job-object lifetime.- Log-claim tests still reject a changed file identity and track the job associated with the opened log.
- Windows CI builds and runs the
nvx-systest target. - Existing
nvxhost callers continue through their current facades without behavior changes.
- Needs: SL0.3c, above.
- Estimate: 200 core lines, 5 counted files. Past 400 core lines, stop and ask before continuing.
- Objective: Windows needs the same host OS ownership as Linux without broadening the move into a platform redesign. The Windows primitives and their low-level tests move to
Tests. Each PR keeps, rewrites or retires the tests of its area, by name; tests move with a module that owns their behavior. A test that uses code staying in nvx doesn't move with its module: the port and signal tests that use guest::spawn::Command, guest::process::Child or the managed agent's isolate_process_test move to nvx or are rewritten on nvx-sys's own helpers, and so do the spawn tests that use the agent's isolate_process_test; the platform test that uses FileSeal moves to nvx, beside the seal, or is rewritten without it; and the tests of Transport's implementations test nvx's wrappers. Test helpers that cross the new boundary sit behind nvx-sys's test-support feature, used as a dev-dependency; no cfg(test) item crosses a crate. CI's Windows jobs run nvx-sys's tests. The README's error table and its test follow the error type.
Done when: every PR above has merged, with dev green.
Activity
esaurez commentedon Nov 3, 2026
Closing as not planned: the plan in #1076 changed.
nvxstays the only crate, with no Cargo workspace and no new crates. NVX's own programs, its control protocol and the OS layers stay innvx, private to it, and CI checks the public API against committed snapshots (#1091). The guest's and the host's OS layers stay where they are, private tonvx. Their one public part,host::platform, becomes private in #1127.