Repository navigation
Description
Area
area: nvx (host::cli::shell, feature cli).
Base and confirmed scope
Base revision: 659493256316ec367ce36ffbc9dad62b471b28b4.
Three command-quoting helpers are pub(crate), although their callers all
belong to their defining module or its child tests:
| Helper | All callers |
|---|---|
windows_command_line |
format_command and the Windows quoting test |
shell_quote |
shell_command_line and the POSIX quoting test |
shell_command_line |
format_command and the POSIX quoting test linked above |
The crate-wide Rust search included inactive features and targets, and every
use of these helpers was read at this revision. Both quoting implementations
compile together: format_command selects one with cfg!(windows), not
conditional compilation of the helpers. The parent
cli feature gate
and private shell module
remain unchanged.
Proposed change and benefit
Remove pub(crate) from these three functions. Private visibility is the
least scope that permits every existing use, including descendant tests.
Leave format_command and all callers unchanged.
This makes the platform-specific quoting implementations private details of
the module: other CLI modules use the existing platform-selecting entry
point instead of depending directly on one quoting dialect. It requires
three line replacements, not a new wrapper or abstraction.
Only visibility changes. Signatures otherwise, function bodies, quoting
rules, allocations, error messages and ErrorKinds, protocol bytes, golden
fixtures, guest command lines, exit statuses, and output remain identical.
The functions are already absent from the external public API. No module
moves or changes purpose, so layout documentation needs no edit.
Prior work and overlap
Checked all open and closed code-quality issues and their linked pull
requests, including the review feedback on merged #1686, #1688, and #1695.
They have no corrective review comments. #1683 lists these three functions
only as an unconfirmed follow-up; its merged #1686 changed sandbox files,
not this module. This issue confirms that follow-up's complete use sites.
No active issue or pull request addresses this change, and no
closed-unmerged pull request proposed it. Checked every changed-file page
of the three open pull requests targeting dev, including equivalent
legacy nvx-rs/ paths: none changes this production file or its tests.
Base validation
At the clean base revision on Windows:
cargo test --locked --all-features --lib --manifest-path nvx\Cargo.toml host::cli::shell:::
passed, 2 passed, 0 failed, 1121 filtered out. Both the Windows and
POSIX quoting tests run on this host.python scripts\nvx.py verify: blocked, because the OpenVMM submodule
is uninitialized. No OpenVMM file was changed. The independent Cargo-only
unit tests above passed; broader validation remains outstanding.
Acceptance criteria
- Make only the three helpers private; retain
format_commandand all callers. - Keep both public API snapshots in
nvx/public-api/unchanged and pass the public API check. - Preserve protocol bytes, golden fixtures, errors and ErrorKinds, command lines, exit statuses, and output exactly.
- Record passing affected tests at the base revision, then pass the same tests unchanged after the change. Keep all existing tests unchanged.
- A new abstraction gets a unit test; none is introduced by this visibility-only change.
- Check the least visibility across all supported feature and target combinations using the applicable
check-nvxgates; explicitly distinguish local evidence from CI-only platform validation. - Keep the complete diff below 1000 inserted plus deleted lines as reported by
git diff --shortstat; the expected diff is 3 insertions and 3 deletions innvx/src/host/cli/shell.rs. - Pass the gates selected by
python scripts\local_gates.py --base origin/devand the applicable commands in check-nvx. - Add no dependencies, features, or unsafe code. Change no tests, public API snapshots, scripts, workflows, data, or OpenVMM files.
Follow-ups
None is needed for this self-contained change. No suspected bug is included.
Other visibility or refactoring ideas require their own use-site audit.
Activity