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

feat: supercharge pack-objects, unpack-objects, verify-pack

- Add duration_ms and exit_code to pack-objects --dry-run JSON output - Add object_bytes to pack-objects --dry-run (total uncompressed payload size so agents can choose buffer-vs-stream before committing to transfer) - Add duration_ms and exit_code to unpack-objects JSON output - Add duration_ms and exit_code to verify-pack JSON output (both full and --stat paths) - Delete test_cmd_pack_unpack.py and test_cmd_verify_pack.py — legacy files using pre-sha256: object IDs, fully superseded by mpack_cmd_* versions - Add test_pack_objects_supercharge.py (114 tests, all GREEN): dry-run schema, object_bytes correctness, unpack/verify duration_ms and exit_code, stat mode, idempotency, and existing field regression

sha256:ad589deb75bfb6ba249cae649d752f6a420217b52f400afb9f578632d6366fd6 sha
+74 ~4 −153 symbols
sha256:7947a1a5bf514f7ffb8d285ced1ffcd6783d45453f215212f0a7e130cc41c698 snapshot
+74
symbols added
~4
symbols modified
−153
symbols removed
0
dead code introduced
Semantic Changes 231 symbols
+ TestPackObjectsDryRunGreen class class TestPackObjectsDryRunGreen L209–255
+ test_commits_field_present method method test_commits_field_present L226–231
+ test_have_field_present method method test_have_field_present L219–224
+ test_have_pruning_reduces_objects method method test_have_pruning_reduces_objects L247–255
+ test_objects_field_present method method test_objects_field_present L240–245
+ test_snapshots_field_present method method test_snapshots_field_present L233–238
+ test_want_field_present method method test_want_field_present L212–217
+ TestPackObjectsDryRunSupercharge class class TestPackObjectsDryRunSupercharge L124–202
+ test_dry_run_duration_ms_non_negative method method test_dry_run_duration_ms_non_negative L136–142
+ test_dry_run_exit_code_is_zero_on_success method method test_dry_run_exit_code_is_zero_on_success L152–158
+ test_dry_run_has_duration_ms method method test_dry_run_has_duration_ms L127–134
+ test_dry_run_has_exit_code method method test_dry_run_has_exit_code L144–150
+ test_dry_run_has_object_bytes method method test_dry_run_has_object_bytes L160–167
+ test_dry_run_object_bytes_is_int method method test_dry_run_object_bytes_is_int L187–193
+ test_dry_run_object_bytes_matches_content_size method method test_dry_run_object_bytes_matches_content_size L169–176
+ test_dry_run_object_bytes_sums_multiple_objects method method test_dry_run_object_bytes_sums_multiple_objects L178–185
+ test_dry_run_object_bytes_zero_for_empty_pack method method test_dry_run_object_bytes_zero_for_empty_pack L195–202
+ TestUnpackObjectsGreen class class TestUnpackObjectsGreen L311–346
+ test_commits_written_field method method test_commits_written_field L312–317
+ test_idempotent_second_unpack_skips_all method method test_idempotent_second_unpack_skips_all L340–346
+ test_objects_skipped_field method method test_objects_skipped_field L333–338
+ test_objects_written_field method method test_objects_written_field L326–331
+ test_snapshots_written_field method method test_snapshots_written_field L319–324
+ TestUnpackObjectsSupercharge class class TestUnpackObjectsSupercharge L262–304
+ test_unpack_duration_ms_non_negative method method test_unpack_duration_ms_non_negative L274–279
+ test_unpack_duration_ms_under_two_seconds method method test_unpack_duration_ms_under_two_seconds L295–304
+ test_unpack_exit_code_zero_on_success method method test_unpack_exit_code_zero_on_success L288–293
+ test_unpack_json_has_duration_ms method method test_unpack_json_has_duration_ms L265–272
+ test_unpack_json_has_exit_code method method test_unpack_json_has_exit_code L281–286
+ TestVerifyPackGreen class class TestVerifyPackGreen L419–451
+ test_all_ok_field_clean_bundle method method test_all_ok_field_clean_bundle L420–424
+ test_failures_empty_on_clean_bundle method method test_failures_empty_on_clean_bundle L426–430
+ test_objects_checked_field method method test_objects_checked_field L432–436
+ test_stat_commits_count method method test_stat_commits_count L447–451
+ test_stat_objects_count method method test_stat_objects_count L438–445
+ TestVerifyPackSupercharge class class TestVerifyPackSupercharge L353–412
+ test_verify_duration_ms_non_negative method method test_verify_duration_ms_non_negative L364–368
+ test_verify_duration_ms_under_two_seconds method method test_verify_duration_ms_under_two_seconds L406–412
+ test_verify_exit_code_nonzero_on_corrupt method method test_verify_exit_code_nonzero_on_corrupt L382–390
+ test_verify_exit_code_zero_on_clean method method test_verify_exit_code_zero_on_clean L376–380
+ test_verify_json_has_duration_ms method method test_verify_json_has_duration_ms L356–362
+ test_verify_json_has_exit_code method method test_verify_json_has_exit_code L370–374
+ test_verify_stat_has_duration_ms method method test_verify_stat_has_duration_ms L392–398
+ test_verify_stat_has_exit_code method method test_verify_stat_has_exit_code L400–404
+ _TS variable variable _TS L36–36
+ _commit function function _commit L60–80
+ _json_out function function _json_out L112–117
+ _make_bundle function function _make_bundle L103–109
+ _make_repo function function _make_repo L43–50 ← moved from tests/test_cmd_pack_unpack.py
+ _pack function function _pack L83–84
+ _unpack function function _unpack L87–92
+ _verify function function _verify L95–100
+ _write_obj function function _write_obj L53–57
+ CliRunner import import CliRunner L32–32
+ CommitRecord import import CommitRecord L31–31
+ ExitCode import import ExitCode L28–28 ← moved from tests/test_cmd_pack_unpack.py
+ InvokeResult import import InvokeResult L32–32 ← moved from tests/test_cmd_verify_pack.py
+ SnapshotRecord import import SnapshotRecord L31–31
+ annotations import import annotations L18–18 ← moved from tests/test_cmd_verify_pack.py
+ compute_commit_id import import compute_commit_id L30–30
+ compute_snapshot_id import import compute_snapshot_id L30–30 ← moved from tests/test_cmd_pack_unpack.py
+ datetime import import datetime L20–20 ← moved from tests/test_cmd_verify_pack.py
+ hashlib import import hashlib L21–21 ← moved from tests/test_cmd_verify_pack.py
+ json import import json L22–22 ← moved from tests/test_cmd_verify_pack.py
+ msgpack import import msgpack L25–25 ← moved from tests/test_cmd_verify_pack.py
+ pathlib import import pathlib L23–23 ← moved from tests/test_cmd_verify_pack.py
+ pytest import import pytest L26–26 ← moved from tests/test_cmd_verify_pack.py
+ write_commit import import write_commit L31–31
+ write_object import import write_object L29–29 ← moved from tests/test_cmd_pack_unpack.py
+ write_snapshot import import write_snapshot L31–31 ← moved from tests/test_cmd_verify_pack.py
+ runner variable variable runner L34–34 ← moved from tests/test_cmd_verify_pack.py
~ tests/test_cmd_pack_unpack.py .py 55 symbols removed
− TestPackObjects class class TestPackObjects L104–179
− test_dry_run_head method method test_dry_run_head L138–146
− test_dry_run_returns_json method method test_dry_run_returns_json L126–136
− test_have_prunes_old_commits method method test_have_prunes_old_commits L148–157
− test_head_no_commits_errors method method test_head_no_commits_errors L171–174
− test_invalid_have_id_rejected method method test_invalid_have_id_rejected L164–169
− test_invalid_want_id_rejected method method test_invalid_want_id_rejected L159–162
− test_no_traceback_on_bad_want method method test_no_traceback_on_bad_want L176–179
− test_pack_explicit_commit method method test_pack_explicit_commit L116–124
− test_pack_head method method test_pack_head L105–114
− TestPackObjectsSecurity class class TestPackObjectsSecurity L286–320
− test_200_sequential_dry_run method method test_200_sequential_dry_run L313–320
− test_ansi_in_want_rejected method method test_ansi_in_want_rejected L301–305
− test_dry_run_json_has_expected_keys method method test_dry_run_json_has_expected_keys L287–299
− test_empty_want_list_errors method method test_empty_want_list_errors L307–311
− TestStress class class TestStress L257–278
− test_200_unpack_idempotency_rounds method method test_200_unpack_idempotency_rounds L270–278
− test_5_commit_chain_pack method method test_5_commit_chain_pack L258–268
− TestUnpackObjects class class TestUnpackObjects L187–249
− test_corrupted_msgpack_errors method method test_corrupted_msgpack_errors L235–238
− test_empty_stdin_treated_as_empty_pack method method test_empty_stdin_treated_as_empty_pack L240–244
− test_idempotent_double_unpack method method test_idempotent_double_unpack L202–213
− test_json_shorthand method method test_json_shorthand L215–223
− test_no_traceback_on_corrupt_input method method test_no_traceback_on_corrupt_input L246–249
− test_round_trip method method test_round_trip L188–200
− test_text_format method method test_text_format L225–233
− TestUnpackObjectsSecurity class class TestUnpackObjectsSecurity L323–367
− test_format_error_to_stderr method method test_format_error_to_stderr L324–329
− test_full_round_trip_with_objects method method test_full_round_trip_with_objects L336–352
− test_no_traceback_on_bad_format method method test_no_traceback_on_bad_format L331–334
− test_no_traceback_on_invalid_msgpack method method test_no_traceback_on_invalid_msgpack L364–367
− test_unpack_text_output_format method method test_unpack_text_output_format L354–362
− _commit function function _commit L53–72
− _make_repo function function _make_repo L32–39 → moved to tests/test_pack_objects_supercharge.py
− _po function function _po L80–86
− _set_head function function _set_head L75–77
− _snap function function _snap L42–50
− _uo function function _uo L89–96
− CliRunner import import CliRunner L23–23
− CommitRecord import import CommitRecord L20–20
− ExitCode import import ExitCode L18–18 → moved to tests/test_pack_objects_supercharge.py
− InvokeResult import import InvokeResult L23–23
− Manifest import import Manifest L22–22
− SnapshotRecord import import SnapshotRecord L20–20
− annotations import import annotations L10–10
− compute_commit_id import import compute_commit_id L19–19
− compute_snapshot_id import import compute_snapshot_id L19–19 → moved to tests/test_pack_objects_supercharge.py
− datetime import import datetime L12–12
− json import import json L13–13
− msgpack import import msgpack L16–16
− pathlib import import pathlib L14–14
− write_commit import import write_commit L20–20
− write_object import import write_object L21–21 → moved to tests/test_pack_objects_supercharge.py
− write_snapshot import import write_snapshot L20–20
− runner variable variable runner L25–25
~ tests/test_cmd_verify_pack.py .py 98 symbols removed
− TestCommitConsistency class class TestCommitConsistency L337–372
− _commit_entry method method _commit_entry L338–339
− test_commit_entry_not_dict method method test_commit_entry_not_dict L362–372
− test_commit_missing_snapshot_fails method method test_commit_missing_snapshot_fails L352–360
− test_commit_with_bundled_snapshot method method test_commit_with_bundled_snapshot L341–350
− TestJsonOutputClean class class TestJsonOutputClean L159–196
− test_empty_bundle method method test_empty_bundle L160–170
− test_json_shorthand method method test_json_shorthand L181–186
− test_multiple_good_objects method method test_multiple_good_objects L188–196
− test_single_good_object method method test_single_good_object L172–179
− TestMalformedInput class class TestMalformedInput L472–514
− test_commits_not_a_list method method test_commits_not_a_list L508–514
− test_malformed_msgpack method method test_malformed_msgpack L473–477
− test_missing_file method method test_missing_file L487–489
− test_msgpack_scalar method method test_msgpack_scalar L479–485
− test_objects_not_a_list method method test_objects_not_a_list L491–498
− test_snapshots_not_a_list method method test_snapshots_not_a_list L500–506
− TestObjectIntegrity class class TestObjectIntegrity L203–274
− test_bad_hash_detected method method test_bad_hash_detected L204–212
− test_binary_object_passes method method test_binary_object_passes L268–274
− test_empty_object_passes method method test_empty_object_passes L259–266
− test_entry_not_dict method method test_entry_not_dict L238–249
− test_invalid_object_id_format method method test_invalid_object_id_format L224–236
− test_missing_content_field method method test_missing_content_field L251–257
− test_mix_good_and_bad method method test_mix_good_and_bad L214–222
− TestQuietMode class class TestQuietMode L452–465
− test_quiet_clean_exits_zero_no_output method method test_quiet_clean_exits_zero_no_output L453–458
− test_quiet_failure_exits_nonzero_no_output method method test_quiet_failure_exits_nonzero_no_output L460–465
− TestSchemas class class TestSchemas L128–152
− test_failure_fields method method test_failure_fields L129–133
− test_format_choices method method test_format_choices L150–152
− test_stat_result_fields method method test_stat_result_fields L146–148
− test_verify_pack_result_fields method method test_verify_pack_result_fields L135–144
− TestSecurity class class TestSecurity L521–583
− test_ansi_in_object_id_sanitized_in_text method method test_ansi_in_object_id_sanitized_in_text L530–538
− test_deeply_nested_msgpack method method test_deeply_nested_msgpack L573–583
− test_format_error_to_stderr method method test_format_error_to_stderr L522–528
− test_json_output_encodes_ansi_safely method method test_json_output_encodes_ansi_safely L554–565
− test_no_traceback_on_corrupt_bundle method method test_no_traceback_on_corrupt_bundle L547–552
− test_no_traceback_on_invalid_format method method test_no_traceback_on_invalid_format L540–545
− test_path_traversal_in_bundle_file method method test_path_traversal_in_bundle_file L567–571
− TestSnapshotConsistency class class TestSnapshotConsistency L281–330
− _snap_entry method method _snap_entry L282–283
− test_skip_local_check_allows_missing method method test_skip_local_check_allows_missing L318–330
− test_snapshot_entry_not_dict method method test_snapshot_entry_not_dict L306–316
− test_snapshot_missing_object_fails method method test_snapshot_missing_object_fails L295–304
− test_snapshot_with_all_objects_present method method test_snapshot_with_all_objects_present L285–293
− TestStatMode class class TestStatMode L406–445
− test_stat_counts_all_sections method method test_stat_counts_all_sections L434–445
− test_stat_does_not_verify_hashes method method test_stat_does_not_verify_hashes L425–432
− test_stat_json method method test_stat_json L407–416
− test_stat_text method method test_stat_text L418–423
− TestStress class class TestStress L590–638
− test_200_sequential_verifications method method test_200_sequential_verifications L612–617
− test_500_object_bundle method method test_500_object_bundle L591–599
− test_500_object_bundle_one_corrupt method method test_500_object_bundle_one_corrupt L601–610
− test_large_object_hashing method method test_large_object_hashing L619–628
− test_stat_on_large_bundle method method test_stat_on_large_bundle L630–638
− TestTextFormat class class TestTextFormat L379–399
− test_text_format_clean method method test_text_format_clean L380–385
− test_text_format_counts method method test_text_format_counts L394–399
− test_text_format_failure_shows_fail method method test_text_format_failure_shows_fail L387–392
− _BadObjectEntry variable variable _BadObjectEntry L58–58
− _BundleDict variable variable _BundleDict L59–59
− _CommitEntry class class _CommitEntry L51–53
− _CommitEntryDict variable variable _CommitEntryDict L57–57
− _EnvMap variable variable _EnvMap L56–56
− _ObjectEntry class class _ObjectEntry L41–43
− _SnapshotEntry class class _SnapshotEntry L46–48
− _bad_hash_obj function function _bad_hash_obj L91–92
− _env function function _env L79–80
− _good_obj function function _good_obj L87–88
− _init_repo function function _init_repo L66–76
− _make_bundle function function _make_bundle L95–105
− _sha function function _sha L83–84
− _vp function function _vp L108–121
− CliRunner import import CliRunner L22–22
− CommitRecord import import CommitRecord L30–30
− InvokeResult import import InvokeResult L22–22 → moved to tests/test_pack_objects_supercharge.py
− Manifest import import Manifest L31–31
− SnapshotRecord import import SnapshotRecord L30–30
− TypedDict import import TypedDict L32–32
− _FORMAT_CHOICES import import _FORMAT_CHOICES L24–24
− _Failure import import _Failure L24–24
− _StatResult import import _StatResult L24–24
− _VerifyPackResult import import _VerifyPackResult L24–24
− annotations import import annotations L11–11 → moved to tests/test_pack_objects_supercharge.py
− datetime import import datetime L13–13 → moved to tests/test_pack_objects_supercharge.py
− hashlib import import hashlib L14–14 → moved to tests/test_pack_objects_supercharge.py
− io import import io L15–15
− json import import json L16–16 → moved to tests/test_pack_objects_supercharge.py
− msgpack import import msgpack L20–20 → moved to tests/test_pack_objects_supercharge.py
− pathlib import import pathlib L17–17 → moved to tests/test_pack_objects_supercharge.py
− pytest import import pytest L21–21 → moved to tests/test_pack_objects_supercharge.py
− uuid import import uuid L18–18
− write_commit import import write_commit L30–30
− write_snapshot import import write_snapshot L30–30 → moved to tests/test_pack_objects_supercharge.py
− runner variable variable runner L34–34 → moved to tests/test_pack_objects_supercharge.py
~ muse/cli/commands/pack_objects.py .py 1 symbol added, 2 symbols modified
+ time import import time L47–47
~ run
~ muse/cli/commands/unpack_objects.py .py 1 symbol added, 1 symbol modified
+ time import import time L36–36
~ run
~ muse/cli/commands/verify_pack.py .py 1 symbol added, 1 symbol modified
+ time import import time L90–90
~ run
← Older Oldest on task/supercharge-pack-objects
All commits
Newer → Latest on task/supercharge-pack-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:ad589deb75bfb6ba249cae649d752f6a420217b52f400afb9f578632d6366fd6 --body "your comment"