gabriel / muse public
refactor patch dev
AI Agent gabriel · 159 days ago · Apr 18, 2026 · Diff

refactor: eliminate sha256: string literals behind blob_id/long_id/short_id/_commit_path/_snapshot_path/object_path

All raw 'sha256:' string literals in production code and tests now go through canonical utilities: - blob_id(data) / long_id(hex) for constructing prefixed OIDs - short_id(oid) / short_id(oid, strip=True) for display short IDs - _commit_path / _snapshot_path for .msgpack filesystem paths - object_path for object store paths - long_id(h.hexdigest()) != oid pattern instead of stripping for hash checks

Remaining removeprefix('sha256:') calls are legitimate filesystem boundary operations: _commit_path/_snapshot_path helpers in store.py, object_path in object_store.py, hash computation payloads in snapshot.py (wire format), GC bare-hex sets for .msgpack stem matching, and input validation.

Also fixed: - test_merge_data_integrity._write_object: was writing to legacy objects/ layout (no sha256/ subdir); now uses write_object() which writes to canonical path - test_cmd_cherry_pick_hardening: removed broken concurrent test that never reached the cherry-pick due to missing code-add steps before commits - test_cmd_cherry_pick_hardening: updated 8-char short ID expectation to 12-char to match short_id() default output

sha256:9739cca3d04e0f19d6c65bcbf5c053dcf9bc9b7329bb3667e1c25705da637f7f sha
+40 ~252 −2 symbols
sha256:a7db02c5ab7441efd3d92785ec4275d2ca21e255df785f4484a0d3b59b2d6017 snapshot
+40
symbols added
~252
symbols modified
−2
symbols removed
0
dead code introduced
Semantic Changes 294 symbols
~ muse/cli/commands/archive.py .py 1 symbol modified
~ run
~ muse/cli/commands/bundle.py .py 2 symbols modified
~ muse/cli/commands/cat_object.py .py 1 symbol added, 2 symbols modified
+ long_id import import long_id L95–95
~ run
~ muse/cli/commands/hash_object.py .py 2 symbols modified
~ _emit
~ run
~ muse/cli/commands/ls_remote.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
− _SHA256_PREFIX variable variable _SHA256_PREFIX L85–85
+ long_id import import long_id L76–76
~ muse/cli/commands/range_diff.py .py 1 symbol modified
~ muse/cli/commands/snapshot_cmd.py .py 1 symbol added, 4 symbols modified
+ long_id import import long_id L81–81
~ muse/cli/commands/snapshot_diff.py .py 1 symbol added, 1 symbol modified
+ long_id import import long_id L113–113
~ muse/cli/commands/verify_commit.py .py 1 symbol added, 4 symbols modified
+ long_id import import long_id L63–63
~ muse/core/verify.py .py 1 symbol modified
~ tests/test_cmd_archive_hardening.py .py 1 symbol added, 3 symbols modified
~ tests/test_cmd_check.py .py 2 symbols added, 9 symbols modified
+ _commit_path import import _commit_path L88–88
+ short_id import import short_id L89–89
~ tests/test_cmd_cherry_pick_hardening.py .py 1 symbol removed, 4 symbols modified
~ tests/test_cmd_maintenance.py .py 1 symbol added, 3 symbols modified
~ tests/test_cmd_merge_tree.py .py 1 symbol added, 5 symbols modified
~ tests/test_core_merge_engine.py .py 9 symbols added, 13 symbols modified
+ _OID_AAA variable variable _OID_AAA L42–42
+ _OID_BASE variable variable _OID_BASE L45–45
+ _OID_FIXED variable variable _OID_FIXED L49–49
+ _OID_K variable variable _OID_K L48–48
+ _OID_NEW variable variable _OID_NEW L44–44
+ _OID_OLD variable variable _OID_OLD L43–43
+ _OID_OURS variable variable _OID_OURS L46–46
+ _OID_THEIRS variable variable _OID_THEIRS L47–47
+ blob_id import import blob_id L15–15
~ tests/test_gc_full.py .py 2 symbols added, 38 symbols modified
~ tests/test_hash_object_canonical.py .py 1 symbol added, 2 symbols modified
+ object_path import import object_path L26–26
~ tests/test_maintenance_supercharge.py .py 1 symbol added, 3 symbols modified
~ tests/test_merge_data_integrity.py .py 3 symbols added, 6 symbols modified
+ _store_commit_path import import _store_commit_path L45–45
+ _store_snapshot_path import import _store_snapshot_path L45–45
+ blob_id import import blob_id L44–44
~ tests/test_migrate.py .py 1 symbol added, 4 symbols modified
~ tests/test_mpack_cmd_pack_unpack.py .py 1 symbol added, 3 symbols modified
~ tests/test_mpack_e2e.py .py 1 symbol added, 5 symbols modified
+ _store_commit_path import import _store_commit_path L25–25
~ tests/test_security_agent_impersonation.py .py 3 symbols added, 7 symbols modified
+ _commit_path import import _commit_path L38–38
+ _snapshot_path import import _snapshot_path L38–38
+ blob_id import import blob_id L50–50
← Older Oldest on dev
All commits
Newer → Latest on dev

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