Repository navigation
Description
Area
area: nvx (host::filesystem, feature cli).
Base and confirmed scope
Base revision: e5330ad60af7f734a7a2fa75338053b0b064e4d1.
The export planner's FileIdentity.device and FileIdentity.index are pub(crate), although their representation is used only inside host::filesystem and its children:
| Use at the base revision | Source |
|---|---|
| Construct the identity returned by the platform | host_path::identity |
| Construct identities to compare mapped and denied objects against their pins | PlannedExport::verify |
| Compare identities as whole values when rejecting duplicate roots | distinct_roots |
| Store identities as whole values, with derived equality and serde implementations | Pins |
All Rust references to this type, its fields, and the pins carrying it were searched at this base, without filtering out inactive feature/target code. The three struct constructions above are the only explicit field uses. Other modules store or serialize whole pins, such as the CLI's export_pins; none reads, writes, or destructures these fields.
The declaration is gated by cli; host is feature-gated. Neither field nor its callers has a platform-specific visibility alternative.
Proposed change and benefit
Remove pub(crate) from these two fields, making them private to host::filesystem, the least visibility their uses require. Child modules retain access through Rust's ordinary privacy rules.
Keep the FileIdentity type itself crate-visible: the crate-visible fields of Pins contain it. Do not narrow the type, change Pins, introduce accessors, or modify any caller.
This makes the identity's representation an enforced implementation detail of the filesystem planner rather than something unrelated crate modules can construct or mutate. It needs only two line replacements, approximately four changed lines.
Why behavior is unchanged
Only field visibility changes. Field types, order, derives, serde field names and attributes, comparisons, platform identity acquisition, and every executable expression remain identical. The existing public API, error messages and ErrorKinds, protocol bytes, golden fixtures, guest command lines, exit statuses, and output remain unchanged.
No new abstraction, dependency, feature, or unsafe code is needed. No module moves or changes purpose, so the module-layout documentation needs no edit.
Prior work and overlap
Checked all eight existing open and closed code-quality issues: #1683, #1685, #1689, #1692, #1696, #1700, #1701, and #1704. Their linked PRs #1686 and #1688 are merged, and #1695 is open. Their reviews recommend approval without corrective threads. Their changes concern other modules.
Checked closed-unmerged candidate-related PRs as well; no rejected proposal to narrow these filesystem fields was found. The older file-identity work in #984 concerns lock-file identity schemes, not this visibility-only change.
Rechecked every open PR targeting dev, including all 122 files and equivalent legacy nvx-rs/ paths in #1509. None changes nvx/src/host/filesystem/mod.rs. Keep every file held by another open PR untouched.
Base validation
With the checkout clean at the base revision:
cargo test --locked --all-features --lib --manifest-path nvx\Cargo.toml host::filesystem::on Windows: passed, 32 passed, 0 failed, 0 ignored. This includes the existing pinning, swapped-object verification, path-error, and export-plan tests.python scripts\nvx.py verify: blocked, because the OpenVMM submodule is uninitialized. No OpenVMM files were changed. The independent Cargo-only unit tests above passed; broader platform and integration validation is still required.
Acceptance criteria
- Change only the two field visibility qualifiers in
nvx/src/host/filesystem/mod.rs; keepFileIdentityitself crate-visible and all callers unchanged. - Keep existing tests unchanged. Record the base pass above and rerun the affected tests with the change, including the applicable Linux cases, instead of inventing a failure reproduction or regression test for a behavior-preserving change.
- Leave
nvx/public-api/snapshots unchanged and pass the public-API comparison without rewriting them. - Preserve protocol bytes, golden fixtures, serde representations, error messages and ErrorKinds, and guest-program command lines, exit statuses, and output exactly.
- A new abstraction gets a focused unit test if the implementation introduces one. None is proposed or needed here.
- Add no dependency, feature, unsafe code, or bug fix.
- Check the relevant feature/target combinations through check-nvx: all-features and CLI builds on Windows and Linux, default host, no-default, serde-only, testing-only, MSRV, macOS, and guest-target checks. Distinguish locally executed evidence from CI-only validation.
- Pass the gates selected by
python3 scripts/local_gates.py --base origin/dev, following the repository's authoritative action definitions. - Keep the entire diff below 1000 changed lines, insertions plus deletions reported by
git diff --shortstat, including tests and docs. Restrict changes tonvx/and, only if necessary,doc/project-structure.md; do not change scripts, workflows, data, or OpenVMM.
Follow-ups
None required for this self-contained slice. Broader visibility cleanup and changes to identity representations are out of scope. No suspected bug is included in this proposal.
Activity
ppenna commentedon Nov 17, 2026
Assignment to Pedro Henrique Penna (@ppenna) is verified. Native In Progress could not be set: GitHub reports status=null and viewerCanSetStatus=false. After creating this issue, explicit invocation of nvx-fix-issue for #1706 was rejected because disable-model-invocation is enabled, and no skill context was supplied. No substitute workflow was started: no production code, existing tests, or public-API snapshots were changed, and no PR was created. At the base revision the unchanged filesystem unit tests passed 32/32; scripts/nvx.py verify was blocked solely by the uninitialized OpenVMM submodule. Continuing requires native issue-status permission and a user invocation (or enabling model invocation) of nvx-fix-issue for this issue.