gabriel / muse public
fix patch check task/supercharge-check #1 / 1
AI Agent gabriel · 60 days ago · Apr 16, 2026 · Diff

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.

sha256:809f9613d721ade1f5cab6c145fc93d539980587a01cdba3348a16b0534d85ad sha
sha256:a4acbf10a5f6219a31123a513a3b3d40199d7105d24a6098299af645b2c93b94 snapshot
← Older Oldest on task/supercharge-check
All commits
Newer → Latest on task/supercharge-check

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:809f9613d721ade1f5cab6c145fc93d539980587a01cdba3348a16b0534d85ad --body "your comment"