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

refactor: extract snapshot_identity_bytes from compute_snapshot_id

compute_snapshot_id is now a thin wrapper over snapshot_identity_bytes, which returns the canonical payload whose sha256 equals the snapshot_id. Mirrors the commit_identity_bytes extraction done for Phase 1.

Tests: TestSnapshotIdentityBytes — seven cases covering importability, return type, sha256 round-trip, directories variant, order independence, field sensitivity, and empty manifest. Written red first.

sha256:7bcbe048d72c384845cc83e535817db4c6c2b0c12b13996b05562b02d863933c sha
+9 ~1 symbols
sha256:f8d01bdcfaf97be6ba854e0636ae8acb6765a925ba45052f39b7b67a1a846805 snapshot
+9
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 10 symbols
~ muse/core/snapshot.py .py 1 symbol added, 1 symbol modified
+ snapshot_identity_bytes function function snapshot_identity_bytes L314–336
~ tests/test_core_snapshot.py .py 8 symbols added
+ TestSnapshotIdentityBytes class class TestSnapshotIdentityBytes L131–173
+ test_different_manifests_different_bytes method method test_different_manifests_different_bytes L163–167
+ test_empty_manifest method method test_empty_manifest L169–173
+ test_importable method method test_importable L134–135
+ test_order_independent method method test_order_independent L157–161
+ test_returns_bytes method method test_returns_bytes L137–140
+ test_sha256_of_bytes_equals_compute_snapshot_id method method test_sha256_of_bytes_equals_compute_snapshot_id L142–147
+ test_with_directories method method test_with_directories L149–155
← Older Oldest on task/snapshot-identity-bytes
All commits
Newer → Latest on task/snapshot-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:7bcbe048d72c384845cc83e535817db4c6c2b0c12b13996b05562b02d863933c --body "your comment"