gabriel / muse public
feat BREAKING phase6 dev
AI Agent gabriel · 107 days ago · May 21, 2026 · Diff

feat(phase6): migrate caches and indices from msgpack to plain JSON

- cache_base.py: replace msgpack with json; add binary-format guard (raw[0] > 0x7F → cache miss) - stat_cache: _CACHE_VERSION 3→4, _CACHE_FILENAME stat.msgpack→stat.json - callgraph_cache: _CACHE_VERSION 1→2, filename callgraph.msgpack→callgraph.json - symbol_cache: _CACHE_VERSION 1→2, filename symbols.msgpack→symbols.json - implicit_edge_cache: _CACHE_VERSION 1→2, filename implicit_edges.msgpack→implicit_edges.json - _invariants.py: _FILE_CACHE_VERSION 1→2, filename invariants.msgpack→invariants.json - test_history.py: _HISTORY_VERSION 1→2, filename test_history.msgpack→test_history.json - indices.py: _index_path uses .json; _read_msgpack→_read_json; serialise with json not msgpack - paths.py: all cache/index path helpers return .json filenames - tests: add test_phase6_caches_indices_json.py (20 tests); update existing test files to reflect new extensions and versions

sha256:0d0f1e8e12ca5e534d95434172695b0613daa260285c456f0679e254535d2a25 sha
+37 ~70 −14 symbols
sha256:9ee81dd8770e0d39b71da464942ae702ed1b5fe9534d9cc31f2c01a36d90daa8 snapshot
+37
symbols added
~70
symbols modified
−14
symbols removed
0
dead code introduced
Semantic Changes 121 symbols
+ TestCallgraphCacheJson class class TestCallgraphCacheJson L119–164
+ test_callgraph_cache_file_is_json method method test_callgraph_cache_file_is_json L136–149
+ test_callgraph_cache_has_json_extension method method test_callgraph_cache_has_json_extension L151–153
+ test_callgraph_cache_json_roundtrip method method test_callgraph_cache_json_roundtrip L120–134
+ test_stale_msgpack_callgraph_is_miss method method test_stale_msgpack_callgraph_is_miss L155–164
+ TestHistoryJson class class TestHistoryJson L300–359
+ test_stale_msgpack_history_is_miss method method test_stale_msgpack_history_is_miss L349–359
+ test_test_history_file_has_json_extension method method test_test_history_file_has_json_extension L343–347
+ test_test_history_file_is_json method method test_test_history_file_is_json L332–341
+ test_test_history_json_roundtrip method method test_test_history_json_roundtrip L301–330
+ TestIndicesJson class class TestIndicesJson L224–293
+ test_hash_occurrence_json_roundtrip method method test_hash_occurrence_json_roundtrip L271–281
+ test_index_file_has_json_extension method method test_index_file_has_json_extension L264–269
+ test_indices_json_roundtrip method method test_indices_json_roundtrip L225–243
+ test_stale_msgpack_index_is_miss method method test_stale_msgpack_index_is_miss L283–293
+ test_symbol_history_file_is_json method method test_symbol_history_file_is_json L245–262
+ TestStatCacheJson class class TestStatCacheJson L39–112
+ test_cache_file_has_json_extension method method test_cache_file_has_json_extension L40–52
+ test_stale_msgpack_stat_cache_is_miss method method test_stale_msgpack_stat_cache_is_miss L99–112
+ test_stat_cache_file_is_json method method test_stat_cache_file_is_json L79–97
+ test_stat_cache_json_roundtrip method method test_stat_cache_json_roundtrip L54–77
+ TestSymbolCacheJson class class TestSymbolCacheJson L171–217
+ test_stale_msgpack_symbol_cache_is_miss method method test_stale_msgpack_symbol_cache_is_miss L208–217
+ test_symbol_cache_has_json_extension method method test_symbol_cache_has_json_extension L204–206
+ test_symbol_cache_json_roundtrip method method test_symbol_cache_json_roundtrip L172–202
+ _make_repo function function _make_repo L24–26
+ _write_msgpack_cache function function _write_msgpack_cache L29–32
+ annotations import import annotations L11–11
+ json import import json L13–13
+ msgpack import import msgpack L16–16 ← moved from muse/core/test_history.py
+ pathlib import import pathlib L14–14
+ pytest import import pytest L17–17
~ muse/core/cache_base.py .py 1 symbol added, 2 symbols removed, 4 symbols modified
msgpack import import msgpack L37–37
read_msgpack_file import import read_msgpack_file L39–39
+ _json import import _json L31–31
~ load
~ save
~ muse/core/indices.py .py 2 symbols added, 6 symbols removed, 6 symbols modified
_INDEX_MAX_ARRAY_LEN variable variable _INDEX_MAX_ARRAY_LEN L161–161
_INDEX_MAX_BIN_LEN variable variable _INDEX_MAX_BIN_LEN L160–160
_INDEX_MAX_MAP_LEN variable variable _INDEX_MAX_MAP_LEN L162–162
_INDEX_MAX_STR_LEN variable variable _INDEX_MAX_STR_LEN L159–159
_read_msgpack function function _read_msgpack L174–198
msgpack import import msgpack L44–44
+ _read_json function function _read_json L170–189
+ _json import import _json L44–44
~ muse/core/stat_cache.py .py 1 symbol added, 4 symbols removed, 6 symbols modified
_MAX_ARRAY_LEN variable variable _MAX_ARRAY_LEN L96–96
_MAX_MAP_LEN variable variable _MAX_MAP_LEN L97–97
_MAX_STR_LEN variable variable _MAX_STR_LEN L95–95
msgpack import import msgpack L76–76
+ _json import import _json L76–76
~ load
~ save
~ muse/core/test_history.py .py 1 symbol added, 2 symbols removed, 8 symbols modified
msgpack import import msgpack L40–40 → moved to tests/test_phase6_caches_indices_json.py
read_msgpack_file import import read_msgpack_file L44–44
+ _json import import _json L40–40
← Older Oldest on dev
All commits
Newer → Latest on dev

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