Problem
validate and audit currently print readable terminal messages. CI jobs and coding agents have to interpret those lines instead of consuming a stable result object.
Proposed change
Add an opt-in --format json flag to both commands. Keep the current human-readable output as the default.
The JSON result should include:
- a version string for the output contract;
- the command name and package version;
- the overall
ok value and process exit code;
- validation issues or audit checks as structured arrays;
- file names only, never absolute paths.
Write the JSON document to stdout and operational errors to stderr so callers can redirect it safely.
Acceptance criteria
Useful starting points: src/exam_hwpx_kit/cli.py, src/exam_hwpx_kit/validation.py, src/exam_hwpx_kit/audit.py, and tests/test_cli.py.
Please use only the bundled synthetic fixture. Do not attach real exams, private templates, credentials, or personal file paths.
Problem
validateandauditcurrently print readable terminal messages. CI jobs and coding agents have to interpret those lines instead of consuming a stable result object.Proposed change
Add an opt-in
--format jsonflag to both commands. Keep the current human-readable output as the default.The JSON result should include:
okvalue and process exit code;Write the JSON document to stdout and operational errors to stderr so callers can redirect it safely.
Acceptance criteria
exam-hwpx validate INPUT --format jsonemits one valid JSON document.exam-hwpx audit INPUT OUTPUT --format jsondoes the same for successful and failed audits.llms.txtinclude one short example.Useful starting points:
src/exam_hwpx_kit/cli.py,src/exam_hwpx_kit/validation.py,src/exam_hwpx_kit/audit.py, andtests/test_cli.py.Please use only the bundled synthetic fixture. Do not attach real exams, private templates, credentials, or personal file paths.