gabriel / muse public
feat patch dev
AI Agent gabriel · 161 days ago · Apr 18, 2026 · Diff

feat: supercharge muse verify-object for agent use

Source changes: - Module docstring: add duration_ms/exit_code to JSON example, add text mode summary format, add --fail-fast to agent examples - _iter_all_object_ids docstring: fix shard path (sha256/ subdir was missing) - run() docstring: add Args section documenting all flags - --fail-fast flag: bail after first failure; useful in CI to avoid scanning an entire store once corruption is detected - Reject --all + --stdin (was silently combining; now consistent with --all + positional being rejected) - Text mode: append Checked/Failed summary line at end of output

Test expansion (42 → 78 tests): - Unit: zero-byte object, OSError path, error=None when ok, object_id preserved in result, sha256: prefix on iter_all output - Integration: result ordering, checked==len(results), failed count math, dedup behavior (same OID twice = verified twice), --fail-fast (stops early, duration_ms present, --all integration), text summary line, --quiet suppresses text format, --all+--stdin rejected - Data integrity: truncated file, completely emptied file, large-object streaming (4 MiB), multiple corrupt objects all reported - Security: path traversal rejected before I/O, unicode OID rejected, symlink shard directory skipped, CRLF stripping, all errors to stderr - Stress: 1000-object --all, duration_ms bounded < 5s for small ops

sha256:d098af2a7365c3451e7e1a14f546d29ec8cc454ac4d192d9401cbf2df2473808 sha
+41 ~28 −2 symbols
sha256:06af717b3b896452d8bf5edda10d53ac99380b6733c3b4f0976780f4f6eb7267 snapshot
+41
symbols added
~28
symbols modified
−2
symbols removed
0
dead code introduced
Semantic Changes 71 symbols
~ tests/test_cmd_verify_object.py .py 41 symbols added, 2 symbols removed, 25 symbols modified
− test_duration_ms_and_exit_code_in_json method method test_duration_ms_and_exit_code_in_json L274–284
− test_exit_code_nonzero_in_json_on_failure method method test_exit_code_nonzero_in_json_on_failure L286–292
+ test_all_plus_stdin_rejected method method test_all_plus_stdin_rejected L485–491
+ TestDataIntegrity class class TestDataIntegrity L681–722
+ test_completely_emptied_file_is_hash_mismatch method method test_completely_emptied_file_is_hash_mismatch L698–703
+ test_large_object_streams_without_loading_all method method test_large_object_streams_without_loading_all L705–712
+ test_multiple_corrupt_objects_all_reported method method test_multiple_corrupt_objects_all_reported L714–722
+ test_truncated_file_is_hash_mismatch method method test_truncated_file_is_hash_mismatch L690–696
+ test_zero_byte_blob_round_trips method method test_zero_byte_blob_round_trips L682–688
+ TestFailFast class class TestFailFast L546–590
+ test_fail_fast_duration_ms_present method method test_fail_fast_duration_ms_present L586–590
+ test_fail_fast_exits_nonzero method method test_fail_fast_exits_nonzero L567–570
+ test_fail_fast_with_all method method test_fail_fast_with_all L572–584
+ test_no_effect_when_all_pass method method test_no_effect_when_all_pass L559–565
+ test_stops_after_first_failure method method test_stops_after_first_failure L547–557
+ test_returns_sha256_prefixed_ids method method test_returns_sha256_prefixed_ids L133–138
+ test_checked_equals_len_results method method test_checked_equals_len_results L350–354
+ test_duplicate_id_verified_twice method method test_duplicate_id_verified_twice L371–377
+ test_duration_ms_and_exit_code_present method method test_duration_ms_and_exit_code_present L327–334
+ test_error_null_when_ok method method test_error_null_when_ok L365–369
+ test_exit_code_nonzero_on_failure method method test_exit_code_nonzero_on_failure L336–340
+ test_failed_count_matches_failed_results method method test_failed_count_matches_failed_results L356–363
+ test_results_order_matches_input method method test_results_order_matches_input L342–348
+ test_quiet_with_text_format_no_output method method test_quiet_with_text_format_no_output L444–449
+ test_all_error_goes_to_stderr_not_stdout method method test_all_error_goes_to_stderr_not_stdout L668–673
+ test_crlf_injection_in_stdin_does_not_corrupt_id method method test_crlf_injection_in_stdin_does_not_corrupt_id L660–666
+ test_path_traversal_in_object_id_rejected method method test_path_traversal_in_object_id_rejected L628–638
+ test_symlink_shard_directory_skipped method method test_symlink_shard_directory_skipped L645–658
+ test_unicode_in_object_id_rejected method method test_unicode_in_object_id_rejected L640–643
+ test_crlf_line_endings_stripped method method test_crlf_line_endings_stripped L532–538
+ test_1000_object_store_all_pass method method test_1000_object_store_all_pass L739–745
+ test_duration_ms_bounded_for_small_op method method test_duration_ms_bounded_for_small_op L761–766
+ test_summary_all_pass method method test_summary_all_pass L416–422
+ test_summary_line_present method method test_summary_line_present L400–406
+ test_summary_reflects_counts method method test_summary_reflects_counts L408–414
+ test_corrupt_object_has_size_bytes method method test_corrupt_object_has_size_bytes L204–212
+ test_empty_truncated_object_mismatch method method test_empty_truncated_object_mismatch L223–229
+ test_error_is_none_when_ok method method test_error_is_none_when_ok L163–169
+ test_io_error_returns_error_dict method method test_io_error_returns_error_dict L245–258
+ test_ok_result_preserves_object_id method method test_ok_result_preserves_object_id L156–161
+ test_truncated_object_mismatch method method test_truncated_object_mismatch L214–221
+ test_zero_byte_object_ok method method test_zero_byte_object_ok L179–185
+ _truncate_object function function _truncate_object L66–71
← 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:d098af2a7365c3451e7e1a14f546d29ec8cc454ac4d192d9401cbf2df2473808 --body "your comment"