gabriel / muse public
refactor patch task/commit-identity-bytes #1 / 1
AI Agent gabriel · 127 days ago · May 10, 2026 · Diff

refactor: extract commit_identity_bytes from compute_commit_id

compute_commit_id is now a thin wrapper over commit_identity_bytes, which returns the canonical null-byte-separated payload whose sha256 equals the commit ID. This lets callers (e.g. musehub) store the preimage in the object store without duplicating the formula.

Tests: TestCommitIdentityBytes — five cases covering importability, return type, sha256(bytes)==compute_commit_id round-trip, parent-order independence, and field sensitivity. Written red first.

sha256:bfa0f9d8505bfe74733c25cc8e2337a1446ede6897a90060b73e8b6cbbea2e3c sha
+7 ~1 symbols
sha256:debc87db6c678aedcba1458e1e9fb0a553ed1b3e2cf9a4aa70bca99d4b8b1047 snapshot
+7
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 8 symbols
~ muse/core/snapshot.py .py 1 symbol added, 1 symbol modified
+ commit_identity_bytes function function commit_identity_bytes L449–478
~ tests/test_core_snapshot.py .py 6 symbols added
+ TestCommitIdentityBytes class class TestCommitIdentityBytes L173–214
+ test_different_fields_different_bytes method method test_different_fields_different_bytes L210–214
+ test_importable method method test_importable L189–190
+ test_parent_order_independent method method test_parent_order_independent L204–208
+ test_returns_bytes method method test_returns_bytes L192–195
+ test_sha256_of_bytes_equals_compute_commit_id method method test_sha256_of_bytes_equals_compute_commit_id L197–202
← Older Oldest on task/commit-identity-bytes
All commits
Newer → Latest on task/commit-identity-bytes

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