gabriel / muse public
feat patch task/verify-supercharge #1 / 1
AI Agent gabriel · 63 days ago · Apr 18, 2026 · Diff

feat: supercharge muse verify — elapsed_ms, exit_code, _emit_error, fix sha256 prefix bugs

- muse/core/verify.py: - Import long_id alongside short_id - _rehash_object() now returns long_id(h.hexdigest()) — canonical sha256:-prefixed form so comparison against stored object IDs always succeeds - Orphan snapshot sweep: canonicalize snap_id via long_id(snap_file.stem) so verified_snapshots membership checks work correctly (set contains sha256:-prefixed IDs) - Ref validation: accept sha256:-prefixed commit IDs (strip prefix before hex check) - _MAX_REF_BYTES: 65 → 72 (sha256: prefix + 64 hex + newline)

- muse/cli/commands/verify.py: - Add elapsed_ms (float) and exit_code (int) to every JSON success response - Add _VerifyErrorJson TypedDict for error responses - Add _emit_error() helper: JSON mode → stdout, text mode → stderr, quiet → silent - OSError handling uses _emit_error() with error_key='io_error' and exit_code=3 - Update module docstring with JSON error schema and exit code table

- tests/test_cmd_verify.py: fix _sha() to return long_id(hex) — store requires sha256:-prefixed object IDs - tests/test_cmd_verify_hardening.py: same _sha() fix, long_id for bare hex literals, 72-byte ref size cap - tests/test_cmd_verify_supercharge.py: 43 new tests across U/E/S/D/IO/P/Sec/C tiers

sha256:3b28b74b5628ca362ce6006d8d213a57d179d587be44072f248db22c7b11b02c sha
sha256:19f9d16da293653edbf0959ea11d7f89e5183da1d711dbe588053bf632ea977e snapshot
← Older Oldest on task/verify-supercharge
All commits
Newer → Latest on task/verify-supercharge

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:3b28b74b5628ca362ce6006d8d213a57d179d587be44072f248db22c7b11b02c --body "your comment"