Skip to content

[Python] Add input validation and error handling to verify_diagnostics.py#10

Open
therealsaitama0 wants to merge 2 commits into
Andyyook:mainfrom
therealsaitama0:bounty/verify-diagnostics-validation
Open

[Python] Add input validation and error handling to verify_diagnostics.py#10
therealsaitama0 wants to merge 2 commits into
Andyyook:mainfrom
therealsaitama0:bounty/verify-diagnostics-validation

Conversation

@therealsaitama0

@therealsaitama0 therealsaitama0 commented Jun 27, 2026

Copy link
Copy Markdown

Closes #1

Summary

Adds tools/verify_diagnostics.py to validate build diagnostic JSON artifacts with schema validation, subprocess error recovery, and machine-readable output.

Changes

  • New tools/verify_diagnostics.py script with:
    • argparse CLI: --verbose, --json, --threshold, --file
    • Subprocess calls wrapped in try/except with meaningful error messages
    • JSON schema validation for diagnostic reports
    • --json output for machine consumption
    • --threshold flag (default 0) for minimum passing modules
  • New tools/test_verify_diagnostics.py with pytest coverage

Testing

Run tests:

python -m pytest tools/test_verify_diagnostics.py -v

Checklist

  • Changes are scoped
  • Tests added
  • Error handling and validation implemented

Payment Address (Ethereum / Base USDC)

0x5e1040927a1E28D740f92De27a3d493b81682D88

- Add argparse CLI with --verbose, --json, --threshold flags
- Wrap subprocess.run calls in try/except with meaningful error messages
- Support --json output for machine consumption
- Allow --threshold N for minimum passing modules (default: 0)
- Validate diagnostic JSON schema on read and report structural errors
- Add pytest tests for schema validation and verification logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[$40 BOUNTY] [Python] Add input validation and error handling to verify_diagnostics.py

2 participants