feat: implement muse patch-id — content-based commit identity
- _compute_patch_id: SHA-256 of sorted-file unified diff content lines (+/- only, no @@ or file headers); --stable strips trailing whitespace so cosmetic differences don't produce new patch-ids - _resolve_commit: resolves HEAD, branch names, and commit IDs to CommitRecord - run: resolves commit → loads parent manifest → computes patch-id → text output '<patch_id> <commit_id>' or JSON with subject line - ANSI/control-char rejection in ref argument - 16 tests: unit (same diff = same id, different = different, whitespace normalization, deterministic empty diff), integration (JSON schema, text format, specific commit, branch ref, error cases), security (ANSI rejected), stress (10 distinct diffs produce 10 distinct patch-ids)
sha256:df9844bc6776600449ef2e14666547d4c1ff1f8fcf0e2d4b2543a6bf13fafae3
sha
+64
~28
symbols
sha256:5e3e3fa66b1e16a6e86b9ac88be71e30ab2ac739ff0945537d8adcf26bf4742a
snapshot
+64
symbols added
~28
symbols modified
0
dead code introduced
Semantic Changes
92 symbols
+
test_compute_patch_id_different_diff_different_id
function
function test_compute_patch_id_different_diff_different_id L120–131
+
test_compute_patch_id_empty_diff_is_deterministic
function
function test_compute_patch_id_empty_diff_is_deterministic L134–142
+
test_compute_patch_id_same_diff_same_id
function
function test_compute_patch_id_same_diff_same_id L109–117
+
test_compute_patch_id_stable_normalizes_whitespace
function
function test_compute_patch_id_stable_normalizes_whitespace L145–160
+
test_compute_patch_id_without_stable_is_sensitive_to_whitespace
function
function test_compute_patch_id_without_stable_is_sensitive_to_whitespace L163–177
+
test_patch_id_different_commits_have_different_ids
function
function test_patch_id_different_commits_have_different_ids L315–330
+
test_patch_id_empty_repo_exits_nonzero
function
function test_patch_id_empty_repo_exits_nonzero L292–295
+
test_patch_id_json_commit_id_matches_head
function
function test_patch_id_json_commit_id_matches_head L207–214
+
test_patch_id_json_subject_is_commit_message
function
function test_patch_id_json_subject_is_commit_message L198–204
+
test_patch_id_nonexistent_ref_exits_nonzero
function
function test_patch_id_nonexistent_ref_exits_nonzero L285–289
+
test_patch_id_same_diff_same_id_across_commits
function
function test_patch_id_same_diff_same_id_across_commits L241–253
+
test_patch_id_text_output_has_two_parts
function
function test_patch_id_text_output_has_two_parts L222–233
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:df9844bc6776600449ef2e14666547d4c1ff1f8fcf0e2d4b2543a6bf13fafae3 --body "your comment"
No comments yet. Be the first to start the discussion.