gabriel / muse public
feat BREAKING task/status-working-tree-rename-detection #1 / 1
AI Agent gabriel · 111 days ago · May 26, 2026 · Diff

feat: working-tree rename detection in muse status

When a tracked file disappears and an untracked file with the same content_id appears, muse status now classifies the pair as a rename (renamed: {old → new}) rather than deleted + untracked.

- StageStatus TypedDict gains a renamed field (Manifest, old → new) - stage_status() in code plugin detects renames by content_id matching; greedy first-alphabetical match when multiple candidates share content - Staged deletes (explicit muse rm) are excluded from rename detection - status.py _render_stage_status() surfaces renamed in JSON flat view and in long/short text output (cyan R label) - total_changes counts renames; clean/dirty account for renames - 10 new TDD tests covering R1–R10 scenarios

sha256:ee366d04d54321bdfe98cf940d1fb2f5c543580410a95124b075530e94184643 sha
+22 ~4 symbols
sha256:416867a831b16d675334bb4a4a85e99bfb5646652278762c44638526da8dcca2 snapshot
+22
symbols added
~4
symbols modified
0
dead code introduced
Semantic Changes 26 symbols
~ tests/test_status_rename_detection.py .py 22 symbols added
+ TestWorkingTreeRenameDetection class class TestWorkingTreeRenameDetection L69–228
+ test_R10_staged_delete_does_not_trigger_rename method method test_R10_staged_delete_does_not_trigger_rename L205–228
+ test_R1_rename_appears_in_renamed_not_deleted_or_untracked method method test_R1_rename_appears_in_renamed_not_deleted_or_untracked L70–82
+ test_R2_renamed_flat_dict_maps_old_to_new method method test_R2_renamed_flat_dict_maps_old_to_new L84–94
+ test_R3_untracked_excludes_rename_target method method test_R3_untracked_excludes_rename_target L96–105
+ test_R4_deleted_excludes_rename_source method method test_R4_deleted_excludes_rename_source L107–116
+ test_R5_total_changes_counts_rename_as_one method method test_R5_total_changes_counts_rename_as_one L118–135
+ test_R6_dirty_true_after_rename method method test_R6_dirty_true_after_rename L137–145
+ test_R7_different_content_stays_deleted_and_untracked method method test_R7_different_content_stays_deleted_and_untracked L147–161
+ test_R8_rename_plus_other_modification method method test_R8_rename_plus_other_modification L163–180
+ test_R9_one_source_two_identical_targets_first_match_wins method method test_R9_one_source_two_identical_targets_first_match_wins L182–203
+ _env function function _env L41–42
+ _status_json function function _status_json L45–48
+ cli variable variable cli L32–32
+ code_repo function function code_repo L52–61
+ CliRunner import import CliRunner L30–30
+ Mapping import import Mapping L26–26
+ annotations import import annotations L22–22
+ json import import json L24–24
+ pathlib import import pathlib L25–25
+ pytest import import pytest L28–28
+ runner variable variable runner L33–33
~ muse/domain.py .py 1 symbol modified
~ muse/plugins/code/plugin.py .py 2 symbols modified
← Older Oldest on task/status-working-tree-rename-detection
All commits
Newer → Latest on task/status-working-tree-rename-detection

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