runtime: harden startup triage_run CLI guards and add CLI suite #2664
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2672"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Ammmae0x on 2026-11-26T01:40:24Z.
Change
Harden CLI argument validation and error reporting in
tools/startup/triage_run.pyand add a pure-Python synthetic log/cache CLI suite (tests/startup_triage_run_cli_check.py), registered inCMakeLists.txtasruntime_startup_triage_run_cli_check._validate_args()thatlogdirexists and is a regular file or directory, that--shader-cache(when given) exists and is a directory (not a regular file), and that--max-items >= 1.(OSError, ValueError)inmain(argv=None) -> intto emit a clean stderr error message and return exit code1with zero raw tracebacks, and update__main__toraise SystemExit(main()).triage_run()library behavior andtests/startup_triage_run_check.pyunchanged.Verification
Verified on commit
01446247(based onupstream/main82c70807) on Windows usingout/pe-env/Scripts/python.exe -B:out\pe-env\Scripts\python.exe -B tests\startup_triage_run_check.py-> exit 0 (startup triage_run checks: 0 failed).out\pe-env\Scripts\python.exe -B tests\startup_triage_run_cli_check.py-> exit 0 (8/8 tests OK, 0 skips: directory and single-filelogdir,--shader-cachesummary,--max-itemstruncation,argv=None/__main__, missing/non-regularlogdir, missing/file--shader-cache,--max-items <= 0, runtimeOSError/ValueErrorexit 1 without traceback, Python 3.14-safe argparse checks, and 5 fast in-memory guard mutations).out\pe-env\Scripts\python.exe -B tests\form_coverage_check.py-> exit 0.out\pe-env\Scripts\python.exe -B tests\docs_links_check.py-> exit 0.out\pe-env\Scripts\python.exe -B tests\bidi_controls_check.py-> exit 0.tests/startup_triage_run_cli_check.py): disablinglogdir.exists()guard, disablingshader_cache.is_dir()guard, and relaxingmax_items < 1to< 0.Evidence and follow-up
Checklist
AI-assisted.