gabriel / muse public
feat BREAKING verify dev
gabriel · 165 days ago · Apr 14, 2026 · Diff

feat(verify): snapshot store sweep, nothing_checked flag, zero-byte detection

Three supercharges to muse verify:

1. Snapshot store sweep — after BFS walk from branch refs, also checks every .muse/snapshots/*.msgpack not yet visited. Catches missing objects after partial clones where the branch ref file was never written (clone crashed before the final step). Previously these repos showed all_ok=True because the BFS found 0 branch refs and checked nothing.

2. nothing_checked flag — VerifyResult and --json output now include nothing_checked: bool. True when refs=0, commits=0, and snapshots=0, meaning the repo was structurally empty. Distinguishes 'clean' from 'nothing was checked' for scripts and repair tools.

3. Zero-byte object detection — always flags object files with st_size==0 as corruption, even with --no-objects / check_objects=False. Zero bytes cannot match any real SHA-256 OID (e3b0c442… is the empty-bytes hash). Previously these slipped through --no-objects undetected.

9 new tests in TestVerifySupercharged covering all three capabilities plus edge cases (no double-reporting, sweep deduplication, orphan snapshots with present vs missing objects).

sha256:30637a38c2c205fb4bbc0568ed26ce4c8dc05636ad069a8486019d224f4b3c20 sha
+10 ~6 symbols
sha256:d571fa4494adcb6e114036f6718093572a7f98219aad6afa76939a6dd7aae23a snapshot
+10
symbols added
~6
symbols modified
0
dead code introduced
Semantic Changes 16 symbols
~ muse/cli/commands/verify.py .py 2 symbols modified
~ muse/core/verify.py .py 3 symbols modified
~ tests/test_cmd_verify.py .py 10 symbols added, 1 symbol modified
+ TestVerifySupercharged class class TestVerifySupercharged L103–251
+ test_json_output_includes_nothing_checked method method test_json_output_includes_nothing_checked L243–251
+ test_nothing_checked_false_when_commits_exist method method test_nothing_checked_false_when_commits_exist L111–115
+ test_nothing_checked_true_when_no_refs_and_no_snapshots method method test_nothing_checked_true_when_no_refs_and_no_snapshots L117–120
+ test_orphan_snapshot_with_missing_object_detected method method test_orphan_snapshot_with_missing_object_detected L122–135
+ test_orphan_snapshot_with_present_object_passes method method test_orphan_snapshot_with_present_object_passes L137–149
+ test_partial_clone_missing_objects_detected method method test_partial_clone_missing_objects_detected L151–177
+ test_snapshot_sweep_does_not_recheck_already_verified method method test_snapshot_sweep_does_not_recheck_already_verified L235–241
+ test_zero_byte_object_flagged_without_check_objects method method test_zero_byte_object_flagged_without_check_objects L179–206
+ test_zero_byte_object_not_double_reported method method test_zero_byte_object_not_double_reported L208–233
← Older Oldest on dev
All commits
Newer → Latest on dev

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:30637a38c2c205fb4bbc0568ed26ce4c8dc05636ad069a8486019d224f4b3c20 --body "your comment"