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

feat: supercharge verify-pack — 76 tests, duration_ms in stat text, docstring fixes

- Add tests/test_cmd_verify_pack.py (76 tests, zero prior coverage) Tiers: TypedDicts, JSON envelope, stat mode, quiet mode, file input, --no-local, object integrity, snapshot consistency, commit consistency, malformed input, text format, data integrity, security hardening, no-prose pollution, stress (500 objects, mixed clean/corrupt) - Fix --stat text mode: add duration_ms to output line - Fix module docstring: JSON examples now include duration_ms and exit_code for both full-verify and stat-only outputs

sha256:057c5e4412abcc29488c3c76a5511fb66f2d80613d73d0beaf66e20e4b8ea239 sha
+110 ~1 symbols
sha256:edb5b6d7999a13b048ac4d5471a96ace38bf17679a3041a85b0b448257f226ef snapshot
+110
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 111 symbols
~ tests/test_cmd_verify_pack.py .py 110 symbols added
+ TestCommitConsistency class class TestCommitConsistency L554–612
+ test_commit_missing_snapshot_id_field method method test_commit_missing_snapshot_id_field L600–612
+ test_commits_field_not_list_exits_nonzero method method test_commits_field_not_list_exits_nonzero L590–598
+ test_missing_snapshot_reported method method test_missing_snapshot_reported L555–568
+ test_non_dict_commit_entry_reported method method test_non_dict_commit_entry_reported L578–588
+ test_snapshot_in_bundle_resolves_commit method method test_snapshot_in_bundle_resolves_commit L570–576
+ TestDataIntegrity class class TestDataIntegrity L705–780
+ test_bit_flip_in_content_detected method method test_bit_flip_in_content_detected L734–747
+ test_correct_oid_passes method method test_correct_oid_passes L749–761
+ test_one_corrupt_among_many method method test_one_corrupt_among_many L763–780
+ test_truncated_content_detected method method test_truncated_content_detected L706–718
+ test_zeroed_content_detected method method test_zeroed_content_detected L720–732
+ TestFileInput class class TestFileInput L331–357
+ test_file_flag_reads_from_disk method method test_file_flag_reads_from_disk L332–339
+ test_file_missing_error_on_stderr method method test_file_missing_error_on_stderr L346–349
+ test_file_missing_exits_nonzero method method test_file_missing_exits_nonzero L341–344
+ test_shorthand_i_flag method method test_shorthand_i_flag L351–357
+ TestFormatText class class TestFormatText L662–698
+ test_shorthand_json_flag method method test_shorthand_json_flag L694–698
+ test_text_exit_nonzero_on_failure method method test_text_exit_nonzero_on_failure L683–692
+ test_text_failure_line_on_corrupt method method test_text_failure_line_on_corrupt L671–681
+ test_text_summary_line_on_clean method method test_text_summary_line_on_clean L663–669
+ TestJsonOutputContract class class TestJsonOutputContract L147–222
+ test_all_ok_true_on_clean method method test_all_ok_true_on_clean L159–163
+ test_all_required_keys_present method method test_all_required_keys_present L150–157
+ test_commits_checked_count_correct method method test_commits_checked_count_correct L211–215
+ test_duration_ms_is_nonneg_float method method test_duration_ms_is_nonneg_float L191–197
+ test_empty_bundle_clean method method test_empty_bundle_clean L217–222
+ test_exit_code_nonzero_on_failure method method test_exit_code_nonzero_on_failure L177–189
+ test_exit_code_zero_on_clean method method test_exit_code_zero_on_clean L171–175
+ test_failures_empty_on_clean method method test_failures_empty_on_clean L165–169
+ test_objects_checked_count_correct method method test_objects_checked_count_correct L199–203
+ test_snapshots_checked_count_correct method method test_snapshots_checked_count_correct L205–209
+ TestMalformedInput class class TestMalformedInput L619–655
+ test_empty_bytes_exits_nonzero method method test_empty_bytes_exits_nonzero L631–634
+ test_invalid_format_exits_nonzero method method test_invalid_format_exits_nonzero L651–655
+ test_invalid_msgpack_exits_nonzero method method test_invalid_msgpack_exits_nonzero L620–623
+ test_not_a_dict_exits_nonzero method method test_not_a_dict_exits_nonzero L625–629
+ test_oversized_bundle_exits_nonzero method method test_oversized_bundle_exits_nonzero L641–649
+ test_plain_string_exits_nonzero method method test_plain_string_exits_nonzero L636–639
+ TestNoLocal class class TestNoLocal L364–391
+ test_no_local_skips_store_check_for_snapshot_ref method method test_no_local_skips_store_check_for_snapshot_ref L365–384
+ test_without_no_local_requires_repo method method test_without_no_local_requires_repo L386–391
+ TestNoProsePollution class class TestNoProsePollution L843–887
+ test_corrupt_bundle_json_output_is_valid method method test_corrupt_bundle_json_output_is_valid L863–872
+ test_failures_list_uses_sha256_prefix method method test_failures_list_uses_sha256_prefix L874–887
+ test_no_emoji_in_json_output method method test_no_emoji_in_json_output L850–855
+ test_no_traceback_in_output method method test_no_traceback_in_output L857–861
+ test_stdout_is_valid_json method method test_stdout_is_valid_json L844–848
+ TestObjectIntegrity class class TestObjectIntegrity L398–477
+ test_hash_mismatch_reported method method test_hash_mismatch_reported L399–410
+ test_invalid_object_id_format_reported method method test_invalid_object_id_format_reported L425–435
+ test_mismatch_failure_id_is_declared_oid method method test_mismatch_failure_id_is_declared_oid L412–423
+ test_missing_content_field_reported method method test_missing_content_field_reported L449–459
+ test_multiple_objects_all_checked method method test_multiple_objects_all_checked L461–467
+ test_non_dict_object_entry_reported method method test_non_dict_object_entry_reported L437–447
+ test_objects_field_not_list_exits_nonzero method method test_objects_field_not_list_exits_nonzero L469–477
+ TestQuietMode class class TestQuietMode L291–324
+ test_quiet_exit_0_on_clean method method test_quiet_exit_0_on_clean L292–296
+ test_quiet_exit_1_on_corrupt method method test_quiet_exit_1_on_corrupt L304–313
+ test_quiet_no_output_on_clean method method test_quiet_no_output_on_clean L298–302
+ test_quiet_no_output_on_corrupt method method test_quiet_no_output_on_corrupt L315–324
+ TestSecurityHardening class class TestSecurityHardening L787–836
+ test_binary_junk_in_object_id method method test_binary_junk_in_object_id L809–820
+ test_bundle_file_path_traversal_handled method method test_bundle_file_path_traversal_handled L788–795
+ test_extremely_long_error_string_safe method method test_extremely_long_error_string_safe L822–836
+ test_non_string_object_id_in_bundle method method test_non_string_object_id_in_bundle L797–807
+ TestSnapshotConsistency class class TestSnapshotConsistency L484–547
+ test_manifest_ref_in_bundle_objects_passes method method test_manifest_ref_in_bundle_objects_passes L500–506
+ test_manifest_ref_in_local_store_passes method method test_manifest_ref_in_local_store_passes L530–547
+ test_non_dict_snapshot_entry_reported method method test_non_dict_snapshot_entry_reported L508–518
+ test_orphaned_manifest_ref_reported method method test_orphaned_manifest_ref_reported L485–498
+ test_snapshots_field_not_list_exits_nonzero method method test_snapshots_field_not_list_exits_nonzero L520–528
+ TestStatMode class class TestStatMode L229–284
+ test_stat_does_not_hash_objects method method test_stat_does_not_hash_objects L263–276
+ test_stat_empty_bundle_zeros method method test_stat_empty_bundle_zeros L278–284
+ test_stat_json_has_counts method method test_stat_json_has_counts L230–238
+ test_stat_json_has_duration_ms method method test_stat_json_has_duration_ms L240–246
+ test_stat_json_has_exit_code method method test_stat_json_has_exit_code L248–252
+ test_stat_text_shows_counts method method test_stat_text_shows_counts L254–261
+ TestStress class class TestStress L894–929
+ test_500_objects_duration_bounded method method test_500_objects_duration_bounded L905–911
+ test_500_objects_verified_correctly method method test_500_objects_verified_correctly L895–903
+ test_mixed_clean_and_corrupt_at_scale method method test_mixed_clean_and_corrupt_at_scale L913–929
+ TestTypedDicts class class TestTypedDicts L111–140
+ test_failure_exists method method test_failure_exists L112–114
+ test_failure_has_required_annotations method method test_failure_has_required_annotations L124–128
+ test_stat_result_exists method method test_stat_result_exists L120–122
+ test_stat_result_has_required_annotations method method test_stat_result_has_required_annotations L136–140
+ test_verify_pack_result_exists method method test_verify_pack_result_exists L116–118
+ test_verify_pack_result_has_required_annotations method method test_verify_pack_result_has_required_annotations L130–134
+ _REPO_ID variable variable _REPO_ID L36–36
+ _clean_bundle function function _clean_bundle L56–78
+ _empty_bundle function function _empty_bundle L81–83
+ _init_repo function function _init_repo L86–94
+ _invoke function function _invoke L97–104
+ _make_object function function _make_object L52–53
+ _pack function function _pack L43–45
+ _sha function function _sha L48–49
+ CliRunner import import CliRunner L33–33
+ annotations import import annotations L21–21
+ blob_id import import blob_id L31–31
+ get_type_hints import import get_type_hints L26–26
+ hashlib import import hashlib L23–23
+ json import import json L24–24
+ msgpack import import msgpack L28–28
+ pathlib import import pathlib L25–25
+ pytest import import pytest L29–29
+ write_object import import write_object L32–32
+ runner variable variable runner L35–35
~ muse/cli/commands/verify_pack.py .py 1 symbol modified
~ run
← 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:057c5e4412abcc29488c3c76a5511fb66f2d80613d73d0beaf66e20e4b8ea239 --body "your comment"