gabriel / muse public
feat BREAKING task/unified-object-store #8 / 9
AI Agent gabriel · 121 days ago · May 20, 2026 · Diff

feat: Git-idiomatic unified object store (issue #58 / #11)

Replace 2-byte binary header with Git-idiomatic type prefix across all object types. On-disk format is now '<type> <size>\0<payload>' for blobs, snapshots, and commits. The full string is hashed to produce the object ID so the type is baked into identity — identical payloads of different types can never collide.

- ids.py: hash_blob/hash_snapshot/hash_commit all use type-prefixed formula - object_store.py: write_muse_object/read_muse_object for unified store; write_object stores muse-format bytes; read_object strips header on read - store.py: write_commit/write_snapshot dual-write to unified object store; read_commit/read_snapshot fall back to object store when msgpack absent - snapshot.py: compute_commit_id/compute_snapshot_id delegate to ids.py - migrate.py: three-pass Phase 7 migration (blobs → snapshots → commits) with transitive ID chain resolution; non-destructive throughout - migrate.py: migrate_blob_ids, migrate_snapshot_ids, migrate_commit_ids wired into migrate() with combined transitive id_map for refs/reflogs - migrate CLI: expose blobs_rewritten, snapshots_rewritten, commits_unified - tests: test_unified_object_store.py (13 tests), test_migrate_object_store.py (10 tests)

sha256:e861d623b002e0f64881f55ca0b6dcf5e2be70503b100bf518c0437138267a9b sha
+70 ~20 −12 symbols
sha256:bc30b6594ae356a594b7a23cfed989aa2b91685be7b824d394e22fac98430881 snapshot
+70
symbols added
~20
symbols modified
−12
symbols removed
0
dead code introduced
Semantic Changes 102 symbols
~ tests/test_migrate_object_store.py .py 34 symbols added
+ BLOB_A variable variable BLOB_A L59–59
+ BLOB_B variable variable BLOB_B L60–60
+ _old_blob_id function function _old_blob_id L41–43
+ _old_commit_id function function _old_commit_id L225–245
+ _old_snapshot_id function function _old_snapshot_id L131–137
+ _write_old_blob function function _write_old_blob L46–52
+ _write_old_commit function function _write_old_commit L248–297
+ _write_old_snapshot function function _write_old_snapshot L140–160
+ annotations import import annotations L20–20
+ commits_dir import import commits_dir L33–33
+ hash_blob import import hash_blob L31–31
+ hash_commit import import hash_commit L31–31
+ hash_snapshot import import hash_snapshot L31–31
+ hashlib import import hashlib L22–22
+ json import import json L23–23
+ long_id import import long_id L34–34
+ msgpack import import msgpack L29–29
+ object_path import import object_path L32–32
+ objects_dir import import objects_dir L32–32
+ pathlib import import pathlib L24–24
+ pytest import import pytest L27–27
+ read_muse_object import import read_muse_object L32–32
+ snapshots_dir import import snapshots_dir L33–33
+ repo function function repo L64–66
+ test_migrate_blob_ids_dry_run_writes_nothing function function test_migrate_blob_ids_dry_run_writes_nothing L87–98
+ test_migrate_blob_ids_multiple_blobs function function test_migrate_blob_ids_multiple_blobs L114–124
+ test_migrate_blob_ids_skips_already_muse_format function function test_migrate_blob_ids_skips_already_muse_format L101–111
+ test_migrate_blob_ids_writes_muse_format_copy function function test_migrate_blob_ids_writes_muse_format_copy L73–84
+ test_migrate_commit_ids_dry_run_writes_nothing function function test_migrate_commit_ids_dry_run_writes_nothing L356–376
+ test_migrate_commit_ids_non_destructive function function test_migrate_commit_ids_non_destructive L337–353
+ test_migrate_commit_ids_writes_to_object_store function function test_migrate_commit_ids_writes_to_object_store L304–334
+ test_migrate_snapshot_ids_dry_run_writes_nothing function function test_migrate_snapshot_ids_dry_run_writes_nothing L190–202
+ test_migrate_snapshot_ids_non_destructive function function test_migrate_snapshot_ids_non_destructive L205–218
+ test_migrate_snapshot_ids_writes_to_object_store function function test_migrate_snapshot_ids_writes_to_object_store L167–187
~ .coverage .coverage
~ .cursorrules .cursorrules
~ .museattributes .museattributes
~ .museignore .museignore
~ .windsurfrules .windsurfrules
~ AGENTS.md .md
~ CLAUDE.md .md
~ README.md .md
~ dev-setup.sh .sh
~ muse/cli/commands/migrate.py .py 1 symbol modified
~ run
~ muse/core/ids.py .py 3 symbols modified
~ muse/core/migrate.py .py 6 symbols added, 2 symbols modified
+ BlobMigrateResult class class BlobMigrateResult L58–63
+ CommitMigrateResult class class CommitMigrateResult L558–563
+ SnapshotMigrateResult class class SnapshotMigrateResult L468–473
+ migrate_blob_ids function function migrate_blob_ids L390–460
+ migrate_commit_ids function function migrate_commit_ids L566–669
+ migrate_snapshot_ids function function migrate_snapshot_ids L476–550
~ muse/core/object_store.py .py 2 symbols added, 2 symbols modified
+ read_muse_object function function read_muse_object L760–784
+ write_muse_object function function write_muse_object L729–757
~ muse/core/store.py .py 5 symbols added, 2 symbols removed, 8 symbols modified
compute_commit_id import import compute_commit_id L86–86
compute_snapshot_id import import compute_snapshot_id L86–86
+ _hash_commit import import _hash_commit L87–87
+ _hash_snapshot import import _hash_snapshot L87–87
+ _json import import _json L86–86
+ _object_path import import _object_path L88–88
+ _read_muse_object import import _read_muse_object L88–88
~ pyproject.toml .toml
~ tests/test_unified_object_store.py .py 23 symbols added, 10 symbols removed, 2 symbols modified
TYPE_BLOB variable variable TYPE_BLOB L22–22
TYPE_COMMIT variable variable TYPE_COMMIT L20–20
TYPE_SNAPSHOT variable variable TYPE_SNAPSHOT L21–21
VERSION_1 variable variable VERSION_1 L24–24
_read_object function function _read_object L36–44
_write_object function function _write_object L30–33
test_mixed_read_resolves_type function function test_mixed_read_resolves_type L155–162
test_write_read_blob function function test_write_read_blob L121–126
test_write_read_commit function function test_write_read_commit L143–149
test_write_read_snapshot function function test_write_read_snapshot L131–137
+ CommitRecord import import CommitRecord L16–16
+ SnapshotRecord import import SnapshotRecord L16–16
+ read_commit import import read_commit L16–16
+ read_muse_object import import read_muse_object L15–15
+ read_object import import read_object L15–15
+ read_snapshot import import read_snapshot L16–16
+ write_commit import import write_commit L16–16
+ write_muse_object import import write_muse_object L15–15
+ write_object import import write_object L15–15
+ write_snapshot import import write_snapshot L16–16
+ test_blob_id_consistent_with_object_store function function test_blob_id_consistent_with_object_store L238–240
+ test_hash_blob_includes_type function function test_hash_blob_includes_type L99–104
+ test_hash_commit_includes_type function function test_hash_commit_includes_type L124–144
+ test_hash_snapshot_includes_type function function test_hash_snapshot_includes_type L110–118
+ test_read_commit_falls_back_to_object_store function function test_read_commit_falls_back_to_object_store L182–190
+ test_read_object_strips_muse_header function function test_read_object_strips_muse_header L254–257
+ test_read_snapshot_falls_back_to_object_store function function test_read_snapshot_falls_back_to_object_store L210–218
+ test_write_commit_lands_in_object_store function function test_write_commit_lands_in_object_store L196–204
+ test_write_object_accepts_hash_blob_id function function test_write_object_accepts_hash_blob_id L246–248
+ test_write_read_muse_object_blob function function test_write_read_muse_object_blob L150–154
+ test_write_read_muse_object_commit function function test_write_read_muse_object_commit L171–176
+ test_write_read_muse_object_snapshot function function test_write_read_muse_object_snapshot L160–165
+ test_write_snapshot_lands_in_object_store function function test_write_snapshot_lands_in_object_store L224–232

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