fix(check): fix test fixtures + add exit_code to JSON output
Test fixture fixes: - _write_commit_chain: commit files were saved as 'sha256:hex.msgpack' but _commit_path reads 'hex.msgpack' (strips prefix). Fixed by using hex_commit = commit_id.removeprefix('sha256:') for the filename. - _write_commit_chain: manifest used bare hex object IDs; now uses sha256: prefixed OIDs to match validate_object_id contract. - Short SHA test: cids[-1][:12] was capturing 'sha256:abc12' instead of 12 hex chars. Fixed with removeprefix(). - Commit prefix display test: check.py shows commit_id[:12] which now includes the sha256: prefix. Fixed assertion to match actual display. Result: 39 failures → 0.
Supercharge: - Add exit_code to _CheckJson TypedDict and JSON payload. Agents can now gate on check results from JSON without relying on shell exit status. Mirrors the process exit code exactly (0/1/2). - Fix --warn help text: removed misleading 'implies --strict' — the two flags are independent; combine explicitly with --strict --warn to gate on both. - Update module docstring: add Agent use section showing exit_code pattern, add --strict --warn combined example, document post-filter guarantee. - Add TestExitCodeInJson class (6 tests) covering all exit_code scenarios. Result: 69 → 75 tests, all green.
0 comments
muse hub commit comment sha256:809f9613d721ade1f5cab6c145fc93d539980587a01cdba3348a16b0534d85ad --body "your comment"
No comments yet. Be the first to start the discussion.