Context
plugins/machine-health/skills/audit/scripts/windows/lib/Get-GpuDriverInfo.ps1:33-34 invokes:
$raw = & nvidia-smi --query-gpu=name, driver_version `
--format=csv, noheader 2>$null
In PowerShell native-command argument parsing, the space after each comma splits these into separate arguments: --query-gpu=name,, driver_version, --format=csv,, noheader (PowerShell also parses bare comma-separated tokens as arrays, which then flatten to separate native args). nvidia-smi therefore receives malformed flags and either errors or ignores the extra tokens, so the NVIDIA branch returns nothing on real hardware. The suite's mocks accept any arguments, masking the bug. Cost of leaving it: NVIDIA driver info is silently absent from real audits while tests stay green.
Proposed work
- Pass each flag as a single token:
--query-gpu=name,driver_version and --format=csv,noheader (no spaces), or quote the values.
- Tighten the test mock to assert the exact argument shapes nvidia-smi receives, so a regression is caught.
Acceptance criteria
References
plugins/machine-health/skills/audit/scripts/windows/lib/Get-GpuDriverInfo.ps1:33-34
- Found by the batch-simplify sweep on branch
claude/code-tidying-batch-simplify-s7ljbi; deliberately not fixed there because the sweep was behavior-preserving.
Context
plugins/machine-health/skills/audit/scripts/windows/lib/Get-GpuDriverInfo.ps1:33-34invokes:In PowerShell native-command argument parsing, the space after each comma splits these into separate arguments:
--query-gpu=name,,driver_version,--format=csv,,noheader(PowerShell also parses bare comma-separated tokens as arrays, which then flatten to separate native args). nvidia-smi therefore receives malformed flags and either errors or ignores the extra tokens, so the NVIDIA branch returns nothing on real hardware. The suite's mocks accept any arguments, masking the bug. Cost of leaving it: NVIDIA driver info is silently absent from real audits while tests stay green.Proposed work
--query-gpu=name,driver_versionand--format=csv,noheader(no spaces), or quote the values.Acceptance criteria
--query-gpu=name,driver_versionand--format=csv,noheaderas two intact arguments.References
plugins/machine-health/skills/audit/scripts/windows/lib/Get-GpuDriverInfo.ps1:33-34claude/code-tidying-batch-simplify-s7ljbi; deliberately not fixed there because the sweep was behavior-preserving.