Conversation
Restrict Syntax's three fields and presentation methods to host::cli. Only CLI commands and their tests use these members. Keep the type's visibility because crate-visible Exit constructors name it. At base b540585, all ten parser and two CLI usage tests pass on Windows and a Linux KVM virtual machine. The same unchanged tests pass with this visibility change on Windows. No expression, diagnostic, protocol, public API snapshot, or test changes. Refs #1981. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
7 tasks
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the change restricting Syntax members to the CLI module subtree.
No open issues 🎉
What changed in this PR
Addresses #1981 by restricting Syntax members to host::cli and its descendants, enforcing the existing ownership of CLI presentation details.
Changes:
- Narrows three fields and three formatting methods from
pub(crate)topub(super). - Leaves the
Syntaxtype’s visibility, runtime behavior, public API, and tests unchanged.
| File | Description |
|---|---|
nvx/src/host/cli/args.rs |
Limits six Syntax members to the CLI module subtree. |
Review effort: Balanced
Pedro Henrique Penna (ppenna)
deleted the
agents/issue-1981-cli-syntax-member-scope
branch
November 22, 2026 17:49
This was referenced Nov 30, 2026
Aaqibhafeez Khan (Aaqibhafeezkhan)
pushed a commit
to Aaqib-OSS/nvx
that referenced
this pull request
Nov 30, 2026
The argument parser, Deadline, NetworkOptions and NativeRules, and the guest-agent Session with its ExecRequest and ExecResult declared their items pub(crate). host/cli/mod.rs declares these modules private and re-exports none of their items, so only host::cli can name them, and pub(crate) made a reader search the whole crate for their users. Declare the 42 items pub(super), which in a file directly under host/cli/ is host::cli and its descendants, as microsoft#1980, microsoft#1982, and microsoft#2011 did for other members of these files. Only visibility changes: the generated code, the CLI's output, and the public API are the same. download.rs, run.rs, and sandbox/ keep theirs, since open pull requests change them. Evidence: at a6ec7d4 on Windows, cargo clippy --locked with --all-targets --all-features and with --lib --bins --features cli passes with -D warnings, without private_interfaces warnings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Fixes #1981
What does this pull request change?
Restrict the three fields and three formatting methods of
host::cli::args::Syntaxfrom
pub(crate)topub(super), the CLI module and its descendants.The entire diff is six insertions and six deletions in
nvx/src/host/cli/args.rs. No expression, message, field type, public APIsnapshot, test, protocol byte, dependency, feature, or unsafe block changes.
CLI and guest command lines, output, and exit statuses remain identical.
Why is this change needed?
Only CLI command descriptions and CLI error/help rendering use these members.
Their crate-wide visibility permits unrelated modules to couple to CLI
presentation details. The narrower visibility expresses and enforces their
existing ownership.
Private visibility would exclude the parent and sibling CLI modules. The
Syntaxtype retains its visibility because crate-visibleExitconstructorsname it in their signatures; changing those interfaces or other parser items
is outside this focused slice. No new abstraction or error path needs a new
test. Module-purpose and layout documentation remains accurate.
How was this change validated?
Base:
b5405859f31da6592b2cc9ed73f8fe0eac0e3999.Head:
55db64e0868317d96c038f7469f9b07d21a5d239.Tests are unchanged, as requested for this behavior-preserving task.
The commands on both revisions were:
cargo test --locked --manifest-path nvx/Cargo.toml --all-features --lib host::cli::args::tests-- passed, 10 tests.cargo test --locked --manifest-path nvx/Cargo.toml --all-features --test cli usage::-- passed, 2 tests.python scripts\nvx.py verify(Windows) /python3 scripts/nvx.py verify(Linux) -- passed before builds.cargo build --release --locked --features cli --manifest-path nvx/Cargo.toml-- passed on both platforms at head.python scripts\check_test_changes.py --base origin/dev-- passed: zero test changes.git diff --check-- passed.git diff --shortstat origin/dev HEAD-- 1 file, 6 insertions, 6 deletions.An initial Windows usage-test invocation with
--features cliselected zerotests because the integration harness also needs
testing; it was correctedto
--all-features, and only the two-test result above is counted.Windows selected gates:
$env:PIP_DRY_RUN='1'; $env:PIP_NO_INDEX='1'; python scripts\local_gates.py --base origin/dev --run-- passed all nine gates: test changes, Markdown links, test layout, formatting,
all Clippy feature combinations, Rust tests, documentation, MSRV, and CLI
validation. The CLI action ran 2314 Python tests (89 standard platform skips)
and 84 adversarial tests (11 standard platform skips), with no failures.
The pinned PyYAML 6.0.3 was already installed; the environment settings made
the action's package-install setup a dry run. No packages were installed.
Linux selected gates:
PIP_DRY_RUN=1 PIP_NO_INDEX=1 python3 scripts/local_gates.py --base origin/dev --run --keep-going-- twelve gates passed, including the public API check against both snapshots,
the feature matrix, MSRV, macOS target check, and guest lint/build/tests.
The raw
nvx-cligate failed at its setup command because this host has nopip. An earlier invocation stopped at Markdown links because it haspython3but nopython; a temporary, process-localpythonalias to thesame interpreter resolved that prerequisite and was removed afterward.
Every Linux CLI action test command was then run separately, verbatim from
the action, omitting only its unavailable package-install setup. All passed
with the host's existing PyYAML 6.0.1: 2314 Python tests (41 standard platform
skips), 84 adversarial tests, compilation, and help commands. This is test
evidence, not a claim that the original pip setup passed. Exact commands:
Both temporary Linux worktrees were removed. The original host checkout,
submodule, and pre-existing processes were preserved.
Local runtime scenarios are not needed for a visibility-only change.
The selected KVM/MSHV/WHP microVM suites, platform checks, and performance
regression gate passed in current-head CI run 45033533190,
including
Required status check, Linux and Windows crate/CLI checks, andthe public API check. The run did not publish releases or performance history.
Copilot reviewed head
55db64e0868317d96c038f7469f9b07d21a5d239with approvalrecommended and no findings. There are no review threads. The Ready PR is
left unmerged and unqueued for maintainer approval.
Checklist
python3 scripts/check_test_layout.pychecks.python3 scripts/check_test_changes.py --base origin/devlists no changeto an existing test, or a Changes to existing tests section below
explains each one.
.github/copilot-instructions.mdand the skills when a convention orworkflow changes.
nvxupdatesnvx-rs/public-api/withpython3 scripts/public_api.py --update.description says how the change versions or migrates them.