gabriel / muse public
refactor BREAKING phase1 task/phase1-from-dict-rename #1 / 1
AI Agent gabriel · 119 days ago · May 21, 2026 · Diff

refactor(phase1): rename from_msgpack → from_dict on all storage record classes

- CommitRecord, SnapshotRecord, TagRecord, ReleaseRecord: merged the two-method pattern (defensive from_msgpack + trusting from_dict) into a single from_dict that uses the defensive body. Deleted from_msgpack. - SymbolHistoryEntry: same merge; from_msgpack deleted, from_dict rewritten with defensive .get() pattern. - muse/core/test_history.py: _record_from_msgpack → _record_from_dict, _record_to_msgpack → _record_to_dict. - Updated all 9 source call sites and all test files that referenced from_msgpack or the private helpers. - Added tests/test_phase1_naming.py: 21 TDD tests that enforce no from_msgpack method exists anywhere and no .from_msgpack( call remains in source or test files.

Closes issue #12 phase 1 (naming fix).

sha256:2d04edd1c8bae30686ae49061151b3f3ddb98d48136d76cde3af696a03e9b33e sha
+71 ~66 −25 symbols
sha256:a017004c83dcd76cd394d32588b9f28988b712b486e4aea43f241ab14928f280 snapshot
+71
symbols added
~66
symbols modified
−25
symbols removed
0
dead code introduced
Semantic Changes 162 symbols
~ tests/test_phase1_naming.py .py 53 symbols added
+ TestCommitRecordFromDict class class TestCommitRecordFromDict L37–70
+ _minimal method method _minimal L38–46
+ test_from_dict_exists method method test_from_dict_exists L48–49
+ test_from_msgpack_does_not_exist method method test_from_msgpack_does_not_exist L51–54
+ test_optional_fields_absent method method test_optional_fields_absent L61–64
+ test_raises_on_bad_committed_at method method test_raises_on_bad_committed_at L66–70
+ test_roundtrip method method test_roundtrip L56–59
+ TestNoFromMsgpackRemains class class TestNoFromMsgpackRemains L219–250
+ test_no_from_msgpack_calls_in_source method method test_no_from_msgpack_calls_in_source L227–236
+ test_no_from_msgpack_calls_in_tests method method test_no_from_msgpack_calls_in_tests L238–250
+ test_no_from_msgpack_on_record_classes class method test_no_from_msgpack_on_record_classes L220–225
+ TestReleaseRecordFromDict class class TestReleaseRecordFromDict L142–169
+ _minimal method method _minimal L143–156
+ test_from_dict_exists method method test_from_dict_exists L158–159
+ test_from_msgpack_does_not_exist method method test_from_msgpack_does_not_exist L161–164
+ test_roundtrip method method test_roundtrip L166–169
+ TestSnapshotRecordFromDict class class TestSnapshotRecordFromDict L77–103
+ _minimal method method _minimal L78–84
+ test_from_dict_exists method method test_from_dict_exists L86–87
+ test_from_msgpack_does_not_exist method method test_from_msgpack_does_not_exist L89–92
+ test_raises_on_bad_created_at method method test_raises_on_bad_created_at L99–103
+ test_roundtrip method method test_roundtrip L94–97
+ TestSymbolHistoryEntryFromDict class class TestSymbolHistoryEntryFromDict L176–198
+ _minimal method method _minimal L177–185
+ test_from_dict_exists method method test_from_dict_exists L187–188
+ test_from_msgpack_does_not_exist method method test_from_msgpack_does_not_exist L190–193
+ test_roundtrip method method test_roundtrip L195–198
+ TestTagRecordFromDict class class TestTagRecordFromDict L110–135
+ _minimal method method _minimal L111–122
+ test_from_dict_exists method method test_from_dict_exists L124–125
+ test_from_msgpack_does_not_exist method method test_from_msgpack_does_not_exist L127–130
+ test_roundtrip method method test_roundtrip L132–135
+ _CID variable variable _CID L27–27
+ _NOW variable variable _NOW L25–25
+ _RECORD_CLASSES class variable _RECORD_CLASSES L207–207
+ _REPO_ROOT variable variable _REPO_ROOT L205–205
+ _RID variable variable _RID L29–29
+ _SID variable variable _SID L28–28
+ _TID variable variable _TID L30–30
+ _TS variable variable _TS L26–26
+ _has_from_msgpack_call function function _has_from_msgpack_call L210–216
+ CommitRecord import import CommitRecord L21–21
+ MsgpackDict import import MsgpackDict L23–23
+ ReleaseRecord import import ReleaseRecord L21–21
+ SnapshotRecord import import SnapshotRecord L21–21
+ SymbolHistoryEntry import import SymbolHistoryEntry L22–22
+ TagRecord import import TagRecord L21–21
+ annotations import import annotations L14–14
+ datetime import import datetime L16–16
+ fake_id import import fake_id L23–23
+ long_id import import long_id L23–23
+ pathlib import import pathlib L17–17
+ pytest import import pytest L19–19
~ muse/core/indices.py .py 1 symbol removed, 3 symbols modified
from_msgpack method method from_msgpack L109–121
~ muse/core/store.py .py 4 symbols removed, 22 symbols modified
from_msgpack method method from_msgpack L1008–1076
from_msgpack method method from_msgpack L1352–1377
from_msgpack method method from_msgpack L1159–1182
from_msgpack method method from_msgpack L1243–1262
~ muse/core/test_history.py .py 1 symbol added, 1 symbol removed, 3 symbols modified
_record_from_msgpack function function _record_from_msgpack L213–282
+ _record_from_dict function function _record_from_dict L213–282
~ tests/test_cmd_snapshot_hardening.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
test_snapshot_record_note_round_trips_from_msgpack function function test_snapshot_record_note_round_trips_from_msgpack L321–330
+ test_snapshot_record_note_round_trips_from_dict function function test_snapshot_record_note_round_trips_from_dict L321–330
~ tests/test_commit_from_dict_timestamp_loss.py .py 4 symbols added, 4 symbols removed, 1 symbol modified
TestFromMsgpackStillRaises class class TestFromMsgpackStillRaises L539–553
test_from_msgpack_raises_on_empty_committed_at method method test_from_msgpack_raises_on_empty_committed_at L540–546
test_from_msgpack_raises_on_garbage_committed_at method method test_from_msgpack_raises_on_garbage_committed_at L548–553
test_from_msgpack_raises_on_empty_created_at method method test_from_msgpack_raises_on_empty_created_at L594–598
+ TestFromDictStillRaises class class TestFromDictStillRaises L539–553
+ test_from_dict_raises_on_empty_committed_at method method test_from_dict_raises_on_empty_committed_at L540–546
+ test_from_dict_raises_on_garbage_committed_at method method test_from_dict_raises_on_garbage_committed_at L548–553
+ test_from_dict_raises_on_empty_created_at_via_defensive_path method method test_from_dict_raises_on_empty_created_at_via_defensive_path L594–598
~ tests/test_commit_record_schema.py .py 5 symbols added, 5 symbols removed, 1 symbol modified
TestCommitRecordFromMsgpack class class TestCommitRecordFromMsgpack L118–146
test_falls_back_to_created_on_branch_for_old_records method method test_falls_back_to_created_on_branch_for_old_records L124–132
test_from_msgpack_ignores_format_version_key method method test_from_msgpack_ignores_format_version_key L140–146
test_raises_when_neither_key_present method method test_raises_when_neither_key_present L134–138
test_reads_branch_key method method test_reads_branch_key L119–122
+ TestCommitRecordFromDict class class TestCommitRecordFromDict L118–146
+ test_falls_back_to_created_on_branch_for_old_records method method test_falls_back_to_created_on_branch_for_old_records L124–132
+ test_from_dict_ignores_format_version_key method method test_from_dict_ignores_format_version_key L140–146
+ test_raises_when_neither_key_present method method test_raises_when_neither_key_present L134–138
+ test_reads_branch_key method method test_reads_branch_key L119–122
~ tests/test_core_test_history.py .py 2 symbols added, 2 symbols removed, 16 symbols modified
_record_from_msgpack import import _record_from_msgpack L23–23
_record_to_msgpack import import _record_to_msgpack L23–23
+ _record_from_dict import import _record_from_dict L23–23
+ _record_to_dict import import _record_to_dict L23–23
~ tests/test_directories_feature.py .py 3 symbols added, 4 symbols removed, 2 symbols modified
test_from_msgpack_filters_non_string_items method method test_from_msgpack_filters_non_string_items L479–488
test_from_msgpack_missing_field_defaults_empty method method test_from_msgpack_missing_field_defaults_empty L469–477
test_from_msgpack_non_list_directories_defaults_empty method method test_from_msgpack_non_list_directories_defaults_empty L490–499
test_from_msgpack_roundtrip method method test_from_msgpack_roundtrip L463–467
+ test_from_dict_filters_non_string_items method method test_from_dict_filters_non_string_items L479–488
+ test_from_dict_missing_field_defaults_empty method method test_from_dict_missing_field_defaults_empty L469–477
+ test_from_dict_non_list_directories_defaults_empty method method test_from_dict_non_list_directories_defaults_empty L490–499
~ tests/test_snapshot_schema_version_and_compression.py .py 1 symbol added, 2 symbols removed, 1 symbol modified
test_from_msgpack_defaults_schema_version_for_old_files method method test_from_msgpack_defaults_schema_version_for_old_files L175–182
test_from_msgpack_reads_schema_version method method test_from_msgpack_reads_schema_version L167–173
+ test_from_dict_defaults_schema_version_for_old_files method method test_from_dict_defaults_schema_version_for_old_files L175–182
← Older Oldest on task/phase1-from-dict-rename
All commits
Newer → Latest on task/phase1-from-dict-rename

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