gabriel / muse public
refactor BREAKING store task/store-phase4-snapshots #1 / 1
AI Agent gabriel · 114 days ago · May 21, 2026 · Diff

refactor(store): extract snapshot layer into muse.core.snapshots

Move SnapshotRecord, SnapshotDict, write_snapshot, read_snapshot, read_snapshot_result, the typed result variants (SnapshotReadOk/NotFound/Corrupt), snapshot_read_is_ok/corrupt, snapshot_path, _verify_snapshot_id, get_commit_snapshot_manifest, and get_head_snapshot_manifest out of muse/core/store.py into a new muse/core/snapshots.py module.

All symbols remain importable from muse.core.store via re-exports so no callers need updating. _SNAPSHOT_SCHEMA_VERSION is also re-exported to preserve existing test imports.

sha256:ae1db9b73aaea38adb29f40dbdadd19c6dc9ec95def4b81d418ff5ff263aba32 sha
+52 −17 symbols
sha256:d963bc984b4b602896ee517ce2e2921655fbf5bad9300802d6f01252f9242231 snapshot
+52
symbols added
−17
symbols removed
0
dead code introduced
Semantic Changes 69 symbols
~ muse/core/snapshots.py .py 37 symbols added
+ SnapshotDict class class SnapshotDict L55–63 ← moved from muse/core/store.py
+ SnapshotReadCorrupt class class SnapshotReadCorrupt L273–276 ← moved from muse/core/store.py
+ SnapshotReadNotFound class class SnapshotReadNotFound L269–270 ← moved from muse/core/store.py
+ SnapshotReadOk class class SnapshotReadOk L264–266 ← moved from muse/core/store.py
+ SnapshotRecord class class SnapshotRecord L71–125 ← moved from muse/core/store.py
+ from_dict method method from_dict L102–125 ← moved from muse/core/store.py
+ to_dict method method to_dict L91–99 ← moved from muse/core/store.py
+ _SNAPSHOT_SCHEMA_VERSION variable variable _SNAPSHOT_SCHEMA_VERSION L48–48 ← moved from muse/core/store.py
+ _verify_snapshot_id function function _verify_snapshot_id L147–176
+ get_commit_snapshot_manifest function function get_commit_snapshot_manifest L322–339
+ get_head_snapshot_manifest function function get_head_snapshot_manifest L342–353
+ Manifest import import Manifest L43–43
+ MsgpackDict import import MsgpackDict L43–43
+ TypeGuard import import TypeGuard L37–37
+ TypedDict import import TypedDict L37–37
+ _json import import _json L31–31
+ _object_path import import _object_path L40–40
+ _str_dict import import _str_dict L41–41
+ _str_val import import _str_val L41–41
+ annotations import import annotations L28–28
+ assert_not_symlink import import assert_not_symlink L44–44
+ compute_snapshot_id import import compute_snapshot_id L42–42
+ dataclass class import dataclass L36–36
+ datetime import import datetime L30–30
+ field import import field L36–36
+ logging import import logging L32–32
+ os import import os L33–33
+ pathlib import import pathlib L34–34
+ tempfile import import tempfile L35–35
+ write_text_atomic import import write_text_atomic L39–39
+ logger variable variable logger L46–46
+ read_snapshot function function read_snapshot L231–257 ← moved from muse/core/store.py
+ read_snapshot_result function function read_snapshot_result L293–315 ← moved from muse/core/store.py
+ snapshot_path function function snapshot_path L132–140 ← moved from muse/core/store.py
+ snapshot_read_is_corrupt function function snapshot_read_is_corrupt L286–290 ← moved from muse/core/store.py
+ snapshot_read_is_ok function function snapshot_read_is_ok L279–283 ← moved from muse/core/store.py
+ write_snapshot function function write_snapshot L183–228
~ muse/core/store.py .py 15 symbols added, 17 symbols removed
SnapshotDict class class SnapshotDict L314–322 → moved to muse/core/snapshots.py
SnapshotReadCorrupt class class SnapshotReadCorrupt L743–746 → moved to muse/core/snapshots.py
SnapshotReadNotFound class class SnapshotReadNotFound L740–741 → moved to muse/core/snapshots.py
SnapshotReadOk class class SnapshotReadOk L736–738 → moved to muse/core/snapshots.py
SnapshotRecord class class SnapshotRecord L342–396 → moved to muse/core/snapshots.py
from_dict method method from_dict L373–396 → moved to muse/core/snapshots.py
to_dict method method to_dict L362–370 → moved to muse/core/snapshots.py
_SNAPSHOT_SCHEMA_VERSION variable variable _SNAPSHOT_SCHEMA_VERSION L289–289 → moved to muse/core/snapshots.py
_verify_snapshot_id function function _verify_snapshot_id L633–662
get_commit_snapshot_manifest function function get_commit_snapshot_manifest L784–800
get_head_snapshot_manifest function function get_head_snapshot_manifest L802–812
read_snapshot function function read_snapshot L708–734 → moved to muse/core/snapshots.py
read_snapshot_result function function read_snapshot_result L760–782 → moved to muse/core/snapshots.py
snapshot_path function function snapshot_path L551–559 → moved to muse/core/snapshots.py
snapshot_read_is_corrupt function function snapshot_read_is_corrupt L754–758 → moved to muse/core/snapshots.py
snapshot_read_is_ok function function snapshot_read_is_ok L748–752 → moved to muse/core/snapshots.py
write_snapshot function function write_snapshot L668–706
+ SnapshotDict import import SnapshotDict L221–221
+ SnapshotReadCorrupt import import SnapshotReadCorrupt L221–221
+ SnapshotReadNotFound import import SnapshotReadNotFound L221–221
+ SnapshotReadOk import import SnapshotReadOk L221–221
+ SnapshotRecord import import SnapshotRecord L221–221
+ _SNAPSHOT_SCHEMA_VERSION import import _SNAPSHOT_SCHEMA_VERSION L221–221
+ _verify_snapshot_id import import _verify_snapshot_id L221–221
+ get_commit_snapshot_manifest import import get_commit_snapshot_manifest L221–221
+ get_head_snapshot_manifest import import get_head_snapshot_manifest L221–221
+ read_snapshot import import read_snapshot L221–221
+ read_snapshot_result import import read_snapshot_result L221–221
+ snapshot_path import import snapshot_path L221–221
+ snapshot_read_is_corrupt import import snapshot_read_is_corrupt L221–221
+ snapshot_read_is_ok import import snapshot_read_is_ok L221–221
+ write_snapshot import import write_snapshot L221–221
← Older Oldest on task/store-phase4-snapshots
All commits
Newer → Latest on task/store-phase4-snapshots

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