gabriel / muse public
refactor BREAKING task/rename-op #1 / 1
AI Agent gabriel · 102 days ago · May 27, 2026 · Diff

refactor: replace DirectoryRenameOp with unified RenameOp

- domain.py: RenameOp(op='rename', address, from_address) replaces DirectoryRenameOp. No file_count — that was validation metadata, not semantic. DomainOp union updated. - PatchOp.from_address removed; rename and modify are now orthogonal ops. A moved+edited file emits RenameOp then PatchOp. - plugins/code/plugin.py: emits op='rename' for directory renames. - plugins/code/symbol_diff.py: emits RenameOp+PatchOp pair for move+edit; delta_summary unifies file and directory rename counts under 'all_renamed'. - cli/commands/diff.py: _print_structured_delta renders op='rename' as R old → new; JSON path maps op='rename' into the renamed dict (was silently dropped). - cli/commands/status.py: op='rename' populates renamed map. - core/semver_classifier.py: dispatches op='rename' to _classify_directory_rename. - plugins/code/_query.py: flat_directory_ops and touched_directories use op='rename'. - tests/test_rename_op.py: 25 TDD tests covering all aspects of the change. - tests/test_directories_feature.py, test_directory_dimension.py, test_sem_ver.py: updated to use RenameOp and op='rename'.

sha256:68048c0e8c64e100d6c62bd87d1cc466134af88bb5c2819aa0ec6cd35f44052d sha
+50 ~56 −6 symbols
sha256:0b837f61de16fd7919781453f757b8bea4ff349534493877ca8fd272004b5275 snapshot
+50
symbols added
~56
symbols modified
−6
symbols removed
0
dead code introduced
Semantic Changes 112 symbols
~ tests/test_rename_op.py .py 43 symbols added
+ TestCodePluginDirectoryRename class class TestCodePluginDirectoryRename L82–150
+ _plugin method method _plugin L85–87
+ _snap method method _snap L89–93
+ test_directory_rename_emits_rename_op method method test_directory_rename_emits_rename_op L95–104
+ test_directory_rename_op_has_no_file_count method method test_directory_rename_op_has_no_file_count L106–113
+ test_directory_rename_suppresses_file_level_ops method method test_directory_rename_suppresses_file_level_ops L124–134
+ test_no_directory_rename_op_in_delta method method test_no_directory_rename_op_in_delta L115–122
+ test_plain_dir_add_still_emits_insert method method test_plain_dir_add_still_emits_insert L136–142
+ test_plain_dir_delete_still_emits_delete method method test_plain_dir_delete_still_emits_delete L144–150
+ TestDeltaSummaryRenameOp class class TestDeltaSummaryRenameOp L316–341
+ _rename method method _rename L319–321
+ test_directory_rename_not_counted_as_file method method test_directory_rename_not_counted_as_file L335–341
+ test_single_directory_rename method method test_single_directory_rename L323–327
+ test_two_directory_renames_plural method method test_two_directory_renames_plural L329–333
+ TestDiffJsonRenameOp class class TestDiffJsonRenameOp L236–274
+ test_diff_json_includes_renamed_key method method test_diff_json_includes_renamed_key L239–256
+ test_diff_json_renamed_is_dict method method test_diff_json_renamed_is_dict L258–274
+ TestFileRenameOps class class TestFileRenameOps L158–182
+ _plugin method method _plugin L161–163
+ _snap method method _snap L165–169
+ test_no_patch_op_has_from_address method method test_no_patch_op_has_from_address L171–182
+ TestPrintStructuredDeltaRenameOp class class TestPrintStructuredDeltaRenameOp L190–228
+ _invoke method method _invoke L193–204
+ test_no_directory_rename_op_in_print_path method method test_no_directory_rename_op_in_print_path L222–228
+ test_rename_op_counted_in_return_value method method test_rename_op_counted_in_return_value L215–220
+ test_rename_op_printed_as_R method method test_rename_op_printed_as_R L206–213
+ TestQueryHelpersRenameOp class class TestQueryHelpersRenameOp L282–308
+ _rename method method _rename L285–287
+ test_flat_directory_ops_carries_from_address method method test_flat_directory_ops_carries_from_address L296–301
+ test_flat_directory_ops_yields_rename_op method method test_flat_directory_ops_yields_rename_op L289–294
+ test_touched_directories_rename_op_adds_both_dirs method method test_touched_directories_rename_op_adds_both_dirs L303–308
+ TestRenameOpType class class TestRenameOpType L27–74
+ test_directory_rename_op_not_exported method method test_directory_rename_op_not_exported L46–50
+ test_patch_op_has_no_from_address method method test_patch_op_has_no_from_address L62–68
+ test_rename_op_has_correct_fields method method test_rename_op_has_correct_fields L33–38
+ test_rename_op_has_no_file_count method method test_rename_op_has_no_file_count L40–44
+ test_rename_op_importable method method test_rename_op_importable L30–31
+ test_rename_op_in_domain_op_union method method test_rename_op_in_domain_op_union L52–60
+ test_rename_op_is_leaf_or_top_level_domain_op method method test_rename_op_is_leaf_or_top_level_domain_op L70–74
+ annotations import import annotations L16–16
+ json import import json L18–18
+ pathlib import import pathlib L19–19
+ pytest import import pytest L20–20
~ muse/cli/commands/status.py .py 1 symbol modified
~ run
~ muse/core/semver_classifier.py .py 1 symbol modified
~ muse/domain.py .py 1 symbol added, 1 symbol removed, 3 symbols modified
DirectoryRenameOp class class DirectoryRenameOp L339–352
+ RenameOp class class RenameOp L339–352
~ muse/plugins/code/plugin.py .py 1 symbol added, 1 symbol removed, 17 symbols modified
~ muse/plugins/code/symbol_diff.py .py 1 symbol added, 7 symbols modified
~ tests/test_directories_feature.py .py 3 symbols added, 3 symbols removed, 11 symbols modified
test_directory_rename_emits_directory_rename_op method method test_directory_rename_emits_directory_rename_op L606–615
test_zero_file_count_allowed method method test_zero_file_count_allowed L582–589
DirectoryRenameOp import import DirectoryRenameOp L49–49
+ test_directory_rename_emits_rename_op method method test_directory_rename_emits_rename_op L600–608
+ test_rename_op_has_no_file_count method method test_rename_op_has_no_file_count L580–583
+ RenameOp import import RenameOp L49–49
~ tests/test_directory_dimension.py .py 1 symbol added, 1 symbol removed, 10 symbols modified
← Older Oldest on task/rename-op
All commits
Newer → Latest on task/rename-op

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