Commit 6ee1bfa
fix(cli): require argv arrays for runCapture (NVIDIA#2582)
## Summary
This PR removes the shell-string overload from `runCapture()` and makes
argv arrays the only supported input. It updates the remaining call
sites to use explicit argv execution so shell parsing is always opt-in
and visible in review.
## Changes
- Remove the `execSync`-based shell-string path from `src/lib/runner.ts`
and make `runCapture()` reject string inputs at runtime.
- Convert `src/lib/preflight.ts` and `src/lib/onboard.ts` call sites
from shell strings to argv arrays for command discovery, Docker
inspection, DNS probing, `ps`, and `hostname -I`.
- Update runner and preflight tests to cover argv-only behavior and
spawn-based error redaction.
## Type of Change
- [x] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [ ] Doc only (includes code sample changes)
## Verification
- [x] `npx prek run --all-files` passes
- [x] `npm test` passes
- [x] Tests added or updated for new or changed behavior
- [x] No secrets, API keys, or credentials committed
- [ ] Docs updated for user-facing behavior changes
- [ ] `make docs` builds without warnings (doc changes only)
- [ ] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [ ] New doc pages include SPDX header and frontmatter (new pages only)
## AI Disclosure
- [x] AI-assisted — tool: pi coding agent
---
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Refactor**
* Standardized command execution for host and container probes,
improving reliability of gateway, IP/gateway discovery, disk/swap
detection, and process/network checks for more consistent inspection
results.
* **Tests**
* Updated tests to validate the new argument-array execution model,
tighten error/regression guards, and ensure command output trimming and
expected behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Aaron Erickson <aerickson@nvidia.com>1 parent cba8e92 commit 6ee1bfa
6 files changed
Lines changed: 199 additions & 166 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1816 | 1816 | | |
1817 | 1817 | | |
1818 | 1818 | | |
1819 | | - | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
1820 | 1828 | | |
1821 | 1829 | | |
1822 | 1830 | | |
| |||
1848 | 1856 | | |
1849 | 1857 | | |
1850 | 1858 | | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
1851 | 1875 | | |
1852 | 1876 | | |
1853 | 1877 | | |
| |||
1910 | 1934 | | |
1911 | 1935 | | |
1912 | 1936 | | |
1913 | | - | |
1914 | | - | |
| 1937 | + | |
1915 | 1938 | | |
1916 | 1939 | | |
1917 | 1940 | | |
1918 | | - | |
1919 | | - | |
| 1941 | + | |
1920 | 1942 | | |
1921 | 1943 | | |
1922 | 1944 | | |
| |||
2458 | 2480 | | |
2459 | 2481 | | |
2460 | 2482 | | |
2461 | | - | |
2462 | | - | |
2463 | | - | |
| 2483 | + | |
2464 | 2484 | | |
2465 | 2485 | | |
2466 | 2486 | | |
| |||
3877 | 3897 | | |
3878 | 3898 | | |
3879 | 3899 | | |
3880 | | - | |
3881 | | - | |
| 3900 | + | |
3882 | 3901 | | |
3883 | 3902 | | |
3884 | 3903 | | |
| |||
6219 | 6238 | | |
6220 | 6239 | | |
6221 | 6240 | | |
6222 | | - | |
6223 | | - | |
| 6241 | + | |
| 6242 | + | |
6224 | 6243 | | |
6225 | 6244 | | |
6226 | | - | |
6227 | | - | |
| 6245 | + | |
6228 | 6246 | | |
6229 | 6247 | | |
6230 | 6248 | | |
| |||
6305 | 6323 | | |
6306 | 6324 | | |
6307 | 6325 | | |
6308 | | - | |
| 6326 | + | |
6309 | 6327 | | |
6310 | 6328 | | |
6311 | 6329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| |||
731 | 731 | | |
732 | 732 | | |
733 | 733 | | |
734 | | - | |
735 | | - | |
| 734 | + | |
736 | 735 | | |
737 | 736 | | |
738 | 737 | | |
| |||
760 | 759 | | |
761 | 760 | | |
762 | 761 | | |
763 | | - | |
| 762 | + | |
764 | 763 | | |
765 | 764 | | |
766 | 765 | | |
| |||
807 | 806 | | |
808 | 807 | | |
809 | 808 | | |
810 | | - | |
| 809 | + | |
811 | 810 | | |
812 | 811 | | |
813 | | - | |
| 812 | + | |
814 | 813 | | |
815 | 814 | | |
816 | 815 | | |
817 | 816 | | |
818 | 817 | | |
819 | | - | |
820 | | - | |
821 | | - | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
822 | 826 | | |
823 | 827 | | |
824 | 828 | | |
825 | | - | |
| 829 | + | |
826 | 830 | | |
827 | | - | |
| 831 | + | |
828 | 832 | | |
829 | 833 | | |
830 | 834 | | |
831 | 835 | | |
832 | 836 | | |
833 | | - | |
| 837 | + | |
834 | 838 | | |
835 | 839 | | |
836 | 840 | | |
| |||
868 | 872 | | |
869 | 873 | | |
870 | 874 | | |
871 | | - | |
872 | | - | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
873 | 880 | | |
874 | 881 | | |
875 | 882 | | |
876 | 883 | | |
877 | 884 | | |
878 | 885 | | |
879 | | - | |
880 | | - | |
881 | | - | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
882 | 889 | | |
883 | 890 | | |
884 | 891 | | |
| |||
930 | 937 | | |
931 | 938 | | |
932 | 939 | | |
933 | | - | |
| 940 | + | |
934 | 941 | | |
935 | 942 | | |
936 | 943 | | |
937 | 944 | | |
938 | | - | |
939 | | - | |
| 945 | + | |
| 946 | + | |
940 | 947 | | |
941 | 948 | | |
0 commit comments