gabriel / muse public
refactor BREAKING store task/store-phase1-io #1 / 1
AI Agent gabriel · 20 days ago · May 21, 2026 · Diff

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
26 changed · 1052 in snapshot files
sha256:0647b6d2ba90a8400b69fd55920bcaee3397fa67ce13e189766e0fd6c8308be5 snapshot
26
files changed
1052
files in snapshot
Files Changed
+1 ~25
1052 in snapshot
← Older Oldest on task/store-phase1-io
All commits
Newer → Latest on task/store-phase1-io

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