refactor
BREAKING
store
task/store-phase1-io
#1 / 1
refactor(store): Phase 1 — extract raw I/O primitives into muse/core/io.py
Move all I/O primitives with no domain knowledge out of the 2571-line store.py god object into a new focused module:
muse/core/io.py — MAX_MSGPACK_BYTES, MAX_PACK_MSGPACK_BYTES, safe_unpackb, _read_msgpack, _read_msgpack_dict, write_text_atomic, zstd_decompress_if_needed, _zstd_compress, _ZSTD_*, _validated_store_parents, read_msgpack_file, _write_json_atomic, _write_shelf_header_atomic, _fsync_robust
store.py retains all domain types and business logic; it now imports the above from muse.core.io. All 15 source callers and 9 test files updated. Patches in tests updated to target muse.core.io.* since that is where the constants live at runtime. Fixes missing json/_json/tempfile/fcntl imports in store.py after extraction.
sha256:b561b3dbe85d8f76917476655c0b39e77f247f795a9eb924ff614cdb550e505e
sha
+47
~128
−20
symbols
sha256:0647b6d2ba90a8400b69fd55920bcaee3397fa67ce13e189766e0fd6c8308be5
snapshot
+47
symbols added
~128
symbols modified
−20
symbols removed
0
dead code introduced
Semantic Changes
195 symbols
+
MAX_PACK_MSGPACK_BYTES
variable
variable MAX_PACK_MSGPACK_BYTES L40–40 ← moved from muse/core/store.py
+
_MSGPACK_MAX_ARRAY_LEN
variable
variable _MSGPACK_MAX_ARRAY_LEN L46–46 ← moved from muse/core/store.py
+
_MSGPACK_MAX_BIN_LEN
variable
variable _MSGPACK_MAX_BIN_LEN L44–44 ← moved from muse/core/store.py
+
_MSGPACK_MAX_BIN_LEN_PACK
variable
variable _MSGPACK_MAX_BIN_LEN_PACK L45–45 ← moved from muse/core/store.py
+
_MSGPACK_MAX_MAP_LEN
variable
variable _MSGPACK_MAX_MAP_LEN L47–47 ← moved from muse/core/store.py
+
_MSGPACK_MAX_STR_LEN
variable
variable _MSGPACK_MAX_STR_LEN L43–43 ← moved from muse/core/store.py
+
_ZSTD_COMPRESS_THRESHOLD
variable
variable _ZSTD_COMPRESS_THRESHOLD L59–59 ← moved from muse/core/store.py
+
_validated_store_parents
variable
variable _validated_store_parents L91–91 ← moved from muse/core/store.py
−
MAX_PACK_MSGPACK_BYTES
variable
variable MAX_PACK_MSGPACK_BYTES L127–127 → moved to muse/core/io.py
−
_MSGPACK_MAX_ARRAY_LEN
variable
variable _MSGPACK_MAX_ARRAY_LEN L139–139 → moved to muse/core/io.py
−
_MSGPACK_MAX_BIN_LEN_PACK
variable
variable _MSGPACK_MAX_BIN_LEN_PACK L138–138 → moved to muse/core/io.py
−
_ZSTD_COMPRESS_THRESHOLD
variable
variable _ZSTD_COMPRESS_THRESHOLD L693–693 → moved to muse/core/io.py
−
_validated_store_parents
variable
variable _validated_store_parents L468–468 → moved to muse/core/io.py
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:b561b3dbe85d8f76917476655c0b39e77f247f795a9eb924ff614cdb550e505e --body "your comment"
No comments yet. Be the first to start the discussion.