gabriel / muse public
feat patch show task/show-json-schema #1 / 1
gabriel · 161 days ago · Apr 16, 2026 · Diff

feat(show): add total_changes to --json output + comprehensive schema tests

- Add total_changes field to muse show --json (sum of files_added + files_modified + files_removed) - Add tests/test_show_json_schema.py with 24 tests covering: schema invariants, agent provenance fields (model_id, toolchain_id, reviewed_by, test_runs), file stat correctness, error handling (JSON error on bad refs), structured delta - Verify commit_id sha256: prefix, reviewed_by/test_runs presence, model_id emitted - Fix test_IV2 to parse JSON line from combined stdout/stderr in CliRunner output - Mark P2 'show traceback on invalid sha256: ID' as resolved (already clean exit 1)

sha256:ae31e5b256bdf1431d0ec9465b083c4677d87c073b229c7ed33343b8437b9c75 sha
+43 ~1 symbols
sha256:7858220abda23c5e1c8f60a96d9d40a367149a77e0d77a91a36a5311ce38c0f8 snapshot
+43
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 44 symbols
~ tests/test_show_json_schema.py .py 43 symbols added
+ TestAgentProvenanceII class class TestAgentProvenanceII L219–277
+ test_II1_agent_id_populated_from_flag method method test_II1_agent_id_populated_from_flag L220–235
+ test_II2_model_id_populated_from_flag method method test_II2_model_id_populated_from_flag L237–252
+ test_II3_agent_id_empty_string_for_human_commit method method test_II3_agent_id_empty_string_for_human_commit L254–261
+ test_II4_model_id_empty_string_for_human_commit method method test_II4_model_id_empty_string_for_human_commit L263–270
+ test_II5_toolchain_id_is_string_not_null method method test_II5_toolchain_id_is_string_not_null L272–277
+ TestErrorHandlingIV class class TestErrorHandlingIV L341–428
+ test_IV1_nonexistent_ref_exits_1 method method test_IV1_nonexistent_ref_exits_1 L342–347
+ test_IV2_json_error_on_nonexistent_ref method method test_IV2_json_error_on_nonexistent_ref L349–365
+ test_IV3_json_error_has_required_keys method method test_IV3_json_error_has_required_keys L367–380
+ test_IV4_invalid_sha256_hex_exits_1 method method test_IV4_invalid_sha256_hex_exits_1 L382–388
+ test_IV5_ambiguous_prefix_returns_json_error method method test_IV5_ambiguous_prefix_returns_json_error L390–428
+ TestFileStatsIII class class TestFileStatsIII L285–333
+ test_III1_total_changes_present_by_default method method test_III1_total_changes_present_by_default L286–293
+ test_III2_total_changes_equals_sum_of_buckets method method test_III2_total_changes_equals_sum_of_buckets L295–309
+ test_III3_total_changes_absent_with_no_stat method method test_III3_total_changes_absent_with_no_stat L311–322
+ test_III4_file_buckets_absent_with_no_stat method method test_III4_file_buckets_absent_with_no_stat L324–333
+ TestSchemaInvariantsI class class TestSchemaInvariantsI L160–211
+ test_I1_all_required_keys_present method method test_I1_all_required_keys_present L161–167
+ test_I2_commit_id_sha256_prefixed method method test_I2_commit_id_sha256_prefixed L169–174
+ test_I3_committed_at_is_iso8601_with_tz method method test_I3_committed_at_is_iso8601_with_tz L176–183
+ test_I4_sem_ver_bump_valid_enum method method test_I4_sem_ver_bump_valid_enum L185–190
+ test_I5_breaking_changes_always_list method method test_I5_breaking_changes_always_list L192–197
+ test_I6_reviewed_by_always_list method method test_I6_reviewed_by_always_list L199–204
+ test_I7_test_runs_always_int method method test_I7_test_runs_always_int L206–211
+ TestStructuredDeltaV class class TestStructuredDeltaV L436–465
+ test_V1_structured_delta_present_on_second_commit method method test_V1_structured_delta_present_on_second_commit L437–444
+ test_V2_structured_delta_null_on_initial_commit method method test_V2_structured_delta_null_on_initial_commit L446–454
+ test_V3_no_delta_omits_key method method test_V3_no_delta_omits_key L456–465
+ _REQUIRED_KEYS variable variable _REQUIRED_KEYS L89–105
+ _VALID_SEM_VER_BUMPS variable variable _VALID_SEM_VER_BUMPS L107–107
+ _env function function _env L110–111
+ _show function function _show L114–117
+ _show_raw function function _show_raw L120–122
+ cli variable variable cli L86–86
+ CliRunner import import CliRunner L84–84
+ annotations import import annotations L77–77
+ json import import json L79–79
+ pathlib import import pathlib L80–80
+ pytest import import pytest L82–82
+ repo function function repo L126–136
+ repo_with_two_commits function function repo_with_two_commits L140–152
+ runner variable variable runner L87–87
~ muse/cli/commands/show.py .py 1 symbol modified
~ run
← Older Oldest on task/show-json-schema
All commits
Newer → Latest on task/show-json-schema

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