[ BOUNTY] Add input validation and error handling to verify_diagnostics.py#6
Open
Xiaofei-Z wants to merge 2 commits into
Open
Conversation
added 2 commits
June 19, 2026 19:24
- argparse CLI: --verbose, --json, --threshold (default 0) - subprocess.run wrapped in try/except (timeout/file-not-found/permission/OS) - --json: machine-readable structured report - --threshold N: minimum passing modules required - validate_diagnostic_json(): schema validation with structural error reporting Closes Andyyook#1
Author
|
Hi @Andyyook, submitted this for the bounty. Added argparse CLI (--verbose/--json/--threshold), subprocess error recovery for all failure modes, JSON schema validation with structural error reporting, and threshold support. All acceptance criteria covered. Happy to address any feedback. Thanks! |
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.
Summary
Closes #1. Adds input validation, error recovery, and structured output to
tools/verify_diagnostics.py.Changes
--verbose/-v,--json/-j,--threshold/-t(default 0)run_build()wrapssubprocess.runin try/except handlingTimeoutExpired,FileNotFoundError,PermissionError,OSErrorwith meaningful messages--jsonoutput: full machine-readable report (build status, diagnostics found, schema validity, threshold met, overall ok)--threshold N: exit non-zero if passing modules < Nvalidate_diagnostic_json(): schema validation — checks required keys, type correctness (modules is list, passed/failed are int), reports structural errors clearlyTesting
python3 tools/verify_diagnostics.py --help→ shows all flagspython3 tools/verify_diagnostics.py→ runs build, validates diagnostics, reports PASS/FAILpython3 tools/verify_diagnostics.py --json→ outputs structured JSON reportpython3 tools/verify_diagnostics.py --threshold 5→ threshold logic verifiedpython3 build.pyrun; diagnostic artifacts presentChecklist