Originally created by: fu351
doberman doctor already builds structured CheckResult values through run_checks(), then renders them for humans. An opt-in JSON mode would let setup scripts consume those same health results while preserving the command's established healthy/unhealthy behavior.
src/doberman/cli/main.py — the doctor commandsrc/doberman/cli/doctor.py — CheckResult, CheckStatus, run_checks(), and health helperstests/unit/test_cli_doctor.py--json option to doberman doctor.run_checks() results rather than duplicating health-check logic.--json is absent.Use CliRunner and monkeypatched run_checks() results so the test does not depend on the contributor's real hooks, database, key permissions, or home directory. Compare exit codes between default and JSON modes for the same result sets.
Only serialize the existing redaction-safe health result representation. Do not add secrets, key material, policy contents, database rows, or environment values. Failures while preparing output must not incorrectly report the system as healthy.
See CONTRIBUTING.md (github.com) before opening a pull request.
Ticket changed by: fu351