gabriel / muse public
feat patch count-objects task/supercharge-count-objects #1 / 1
AI Agent gabriel · 148 days ago · Apr 17, 2026 · Diff

feat(count-objects): add elapsed_seconds/exit_code, fix unreachable detection, fix sha256: prefix

Implementation: - Add `import time`, TypedDicts (_ShardInfo, _CountObjectsJson) - Add t0 + elapsed_seconds/exit_code to JSON output path - Fix unreachable detection bug: object IDs on disk are reconstructed as raw hex (shard + filename) but reachable set contains sha256:-prefixed IDs — comparison always failed, reporting every object as unreachable. Fix: prepend 'sha256:' when constructing full_id for the set lookup - Update module docstring with correct schema including new fields

Tests: - Fix _sha() helper: prepend 'sha256:' prefix (same bug as content-grep, commit-tree — write_object now validates the prefix) - Fixes 16 pre-existing failures caused by the missing prefix - Add TestJsonSchemaComplete (8 tests), TestElapsedSeconds (7 tests), TestExitCode (5 tests), TestUnreachableDetection (4 tests) - 45/45 passing

sha256:92c1b18d6b867dcb90c12d7fb30fb90424bd4e69fbed76b5da45e3334b37433f sha
+36 ~3 symbols
sha256:b14a8e55ceced4726e33a2047de3311e33fccf404573145c862400a6fb20a8b9 snapshot
+36
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes 39 symbols
~ muse/cli/commands/count_objects.py .py 4 symbols added, 1 symbol modified
+ _CountObjectsJson class class _CountObjectsJson L92–101
+ _ShardInfo class class _ShardInfo L86–89
+ TypedDict import import TypedDict L67–67
+ time import import time L65–65
~ run
~ tests/test_cmd_count_objects.py .py 32 symbols added, 2 symbols modified
+ TestElapsedSeconds class class TestElapsedSeconds L448–494
+ _assert_elapsed method method _assert_elapsed L451–454
+ test_elapsed_all_flags method method test_elapsed_all_flags L473–477
+ test_elapsed_base method method test_elapsed_base L456–459
+ test_elapsed_is_float_not_int method method test_elapsed_is_float_not_int L479–483
+ test_elapsed_reasonable_upper_bound method method test_elapsed_reasonable_upper_bound L485–488
+ test_elapsed_six_decimal_places method method test_elapsed_six_decimal_places L490–494
+ test_elapsed_with_unreachable method method test_elapsed_with_unreachable L461–465
+ test_elapsed_with_verbose method method test_elapsed_with_verbose L467–471
+ TestExitCode class class TestExitCode L502–534
+ test_exit_code_matches_process_exit method method test_exit_code_matches_process_exit L531–534
+ test_exit_code_zero_empty_store method method test_exit_code_zero_empty_store L505–509
+ test_exit_code_zero_unreachable_flag method method test_exit_code_zero_unreachable_flag L518–523
+ test_exit_code_zero_verbose_flag method method test_exit_code_zero_verbose_flag L525–529
+ test_exit_code_zero_with_objects method method test_exit_code_zero_with_objects L511–516
+ TestJsonSchemaComplete class class TestJsonSchemaComplete L385–440
+ test_all_flags_keys_present method method test_all_flags_keys_present L412–418
+ test_base_keys_present method method test_base_keys_present L388–394
+ test_exit_code_field_is_zero_on_success method method test_exit_code_field_is_zero_on_success L420–424
+ test_exit_code_in_json_matches_process_exit method method test_exit_code_in_json_matches_process_exit L437–440
+ test_exit_code_is_integer method method test_exit_code_is_integer L426–429
+ test_json_is_compact method method test_json_is_compact L431–435
+ test_unreachable_keys_present method method test_unreachable_keys_present L396–402
+ test_verbose_keys_present method method test_verbose_keys_present L404–410
+ TestUnreachableDetection class class TestUnreachableDetection L542–577
+ test_all_committed_blobs_reachable method method test_all_committed_blobs_reachable L545–550
+ test_multiple_orphans_all_counted method method test_multiple_orphans_all_counted L559–566
+ test_orphan_blob_detected method method test_orphan_blob_detected L552–557
+ test_reachable_set_uses_sha256_prefix method method test_reachable_set_uses_sha256_prefix L568–577
+ _REQUIRED_KEYS variable variable _REQUIRED_KEYS L371–379
+ _REQUIRED_KEYS_UNREACHABLE variable variable _REQUIRED_KEYS_UNREACHABLE L381–381
+ _REQUIRED_KEYS_VERBOSE variable variable _REQUIRED_KEYS_VERBOSE L382–382
~ _sha
← Older Oldest on task/supercharge-count-objects
All commits
Newer → Latest on task/supercharge-count-objects

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:92c1b18d6b867dcb90c12d7fb30fb90424bd4e69fbed76b5da45e3334b37433f --body "your comment"