gabriel / muse public
refactor BREAKING store task/store-phase7-shelf #1 / 1
AI Agent gabriel · 113 days ago · May 21, 2026 · Diff

refactor(store): extract shelf layer into muse.core.shelf — completes decomposition

Move shelf_entry_path, write_shelf_entry, _read_shelf_file, read_shelf_entry, list_shelf_entries, and delete_shelf_entry out of muse/core/store.py into a new muse/core/shelf.py module.

All symbols remain re-exported from muse.core.store — zero callers updated.

With this commit store.py is a pure re-export facade: every symbol it exposes now lives in a focused module (io, refs, commits, snapshots, tags, releases, shelf). Stripped all stdlib, msgpack, domain, object_store, snapshot, validation, and paths imports that are no longer used locally in store.py.

sha256:ce34396898b64721162bcbe87f4b2d1efaad09455005364ed35731f8f8d6ae86 sha
+22 −39 symbols
sha256:bd7329d50d4b5bff0cb579eb9321adcdc4f1da9c0b9d82adcad574cc059cc0e8 snapshot
+22
symbols added
−39
symbols removed
0
dead code introduced
Semantic Changes 61 symbols
~ muse/core/shelf.py .py 16 symbols added
+ _read_shelf_file function function _read_shelf_file L100–127 ← moved from muse/core/store.py
+ delete_shelf_entry function function delete_shelf_entry L188–212 ← moved from muse/core/store.py
+ MAX_MSGPACK_BYTES import import MAX_MSGPACK_BYTES L19–19
+ _json import import _json L15–15 ← moved from muse/core/store.py
+ _read_msgpack_dict import import _read_msgpack_dict L19–19
+ _shelf_dir import import _shelf_dir L24–24
+ _write_shelf_header_atomic import import _write_shelf_header_atomic L19–19
+ annotations import import annotations L13–13
+ logging import import logging L16–16
+ pathlib import import pathlib L17–17 ← moved from muse/core/store.py
+ split_id import import split_id L25–25
+ list_shelf_entries function function list_shelf_entries L156–185 ← moved from muse/core/store.py
+ logger variable variable logger L27–27
+ read_shelf_entry function function read_shelf_entry L130–153 ← moved from muse/core/store.py
+ shelf_entry_path function function shelf_entry_path L34–60 ← moved from muse/core/store.py
+ write_shelf_entry function function write_shelf_entry L67–97 ← moved from muse/core/store.py
~ muse/core/store.py .py 6 symbols added, 39 symbols removed
_read_shelf_file function function _read_shelf_file L329–356 → moved to muse/core/shelf.py
delete_shelf_entry function function delete_shelf_entry L414–438 → moved to muse/core/shelf.py
Literal import import Literal L81–81
SemVerBump import import SemVerBump L125–125
StructuredDelta import import StructuredDelta L100–100
TypeGuard import import TypeGuard L81–81
TypedDict import import TypedDict L81–81
_commits_dir import import _commits_dir L156–156
_json import import _json L70–70 → moved to muse/core/shelf.py
_object_path import import _object_path L101–101
_objects_dir import import _objects_dir L101–101
_ref_path import import _ref_path L156–156
_remotes_dir import import _remotes_dir L156–156
_repo_json_path import import _repo_json_path L156–156
_shelf_dir import import _shelf_dir L156–156
_snapshots_dir import import _snapshots_dir L156–156
assert_not_symlink import import assert_not_symlink L103–103
compute_commit_id import import compute_commit_id L102–102
compute_snapshot_id import import compute_snapshot_id L102–102
contextlib import import contextlib L67–67
dataclass class import dataclass L79–79
datetime import import datetime L68–68
fcntl import import fcntl L69–69
field import import field L79–79
msgpack import import msgpack L78–78
os import import os L72–72
pathlib import import pathlib L73–73 → moved to muse/core/shelf.py
re import import re L74–74
sanitize_glob_prefix import import sanitize_glob_prefix L103–103
split_id import import split_id L125–125
sys import import sys L75–75
tempfile import import tempfile L76–76
validate_branch_name import import validate_branch_name L103–103
validate_ref_id import import validate_ref_id L103–103
validate_repo_id import import validate_repo_id L103–103
list_shelf_entries function function list_shelf_entries L383–412 → moved to muse/core/shelf.py
read_shelf_entry function function read_shelf_entry L358–381 → moved to muse/core/shelf.py
shelf_entry_path function function shelf_entry_path L264–290 → moved to muse/core/shelf.py
write_shelf_entry function function write_shelf_entry L297–327 → moved to muse/core/shelf.py
+ _read_shelf_file import import _read_shelf_file L229–229
+ delete_shelf_entry import import delete_shelf_entry L229–229
+ list_shelf_entries import import list_shelf_entries L229–229
+ read_shelf_entry import import read_shelf_entry L229–229
+ shelf_entry_path import import shelf_entry_path L229–229
+ write_shelf_entry import import write_shelf_entry L229–229
← Older Oldest on task/store-phase7-shelf
All commits
Newer → Latest on task/store-phase7-shelf

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