gabriel / muse public
feat patch read dev #89 / 100
AI Agent gabriel · 103 days ago · May 27, 2026 · Diff

feat(read): idiomatic JSON output — null provenance, omit empty fields

- Optional provenance strings (agent_id, model_id, toolchain_id, prompt_hash, signature, signer_public_key, signer_key_id, status) are now null instead of empty string when unset. null means 'not set'; empty string means 'set to nothing' — distinct semantics. - metadata, reviewed_by, labels, notes omitted when empty. - test_runs omitted when 0, score omitted when null. - parent2_commit_id omitted on linear commits (only present on merges).

18 new tests in TestJsonIdioms cover all cases including round-trip verification that agent commits and merge commits still emit the fields.

sha256:45f2939a0a8e1941d7b8f3aa0f37d6e582e08396c0742565f7594fa98504f1d7 sha
+21 ~2 −1 symbols
sha256:540ebb07ff13010d75d410d55cd8bbf9acfc65e9ea9108f93d11bd4ec3b5eb8a snapshot
+21
symbols added
~2
symbols modified
−1
symbol removed
0
dead code introduced
Semantic Changes 24 symbols
~ muse/cli/commands/read.py .py 1 symbol modified
~ run
~ tests/test_cmd_show.py .py 21 symbols added, 1 symbol removed, 1 symbol modified
test_parent2_commit_id_null_on_linear_commit method method test_parent2_commit_id_null_on_linear_commit L486–489
+ TestJsonIdioms class class TestJsonIdioms L546–643
+ _data method method _data L550–553
+ test_agent_id_is_null_for_human_commit method method test_agent_id_is_null_for_human_commit L556–558
+ test_agent_id_non_null_for_agent_commit method method test_agent_id_non_null_for_agent_commit L618–623
+ test_labels_absent_when_empty method method test_labels_absent_when_empty L597–599
+ test_metadata_absent_when_empty method method test_metadata_absent_when_empty L589–591
+ test_metadata_present_when_populated method method test_metadata_present_when_populated L625–630
+ test_model_id_is_null_for_human_commit method method test_model_id_is_null_for_human_commit L560–562
+ test_notes_absent_when_empty method method test_notes_absent_when_empty L601–603
+ test_parent2_commit_id_absent_on_linear_commit method method test_parent2_commit_id_absent_on_linear_commit L613–615
+ test_parent2_present_on_merge_commit method method test_parent2_present_on_merge_commit L632–643
+ test_prompt_hash_is_null_for_unsigned_commit method method test_prompt_hash_is_null_for_unsigned_commit L568–570
+ test_reviewed_by_absent_when_empty method method test_reviewed_by_absent_when_empty L593–595
+ test_score_absent_when_null method method test_score_absent_when_null L609–611
+ test_signature_is_null_for_unsigned_commit method method test_signature_is_null_for_unsigned_commit L572–574
+ test_signer_key_id_is_null_for_unsigned_commit method method test_signer_key_id_is_null_for_unsigned_commit L580–582
+ test_signer_public_key_is_null_for_unsigned_commit method method test_signer_public_key_is_null_for_unsigned_commit L576–578
+ test_status_is_null_when_unset method method test_status_is_null_when_unset L584–586
+ test_test_runs_absent_when_zero method method test_test_runs_absent_when_zero L605–607
+ test_toolchain_id_is_null_for_human_commit method method test_toolchain_id_is_null_for_human_commit L564–566
+ test_parent2_commit_id_absent_on_linear_commit method method test_parent2_commit_id_absent_on_linear_commit L484–487

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