gabriel / muse public
fix BREAKING feat/directory-tracking #5 / 13
AI Agent gabriel · 11 days ago · May 28, 2026 · Diff

fix: untracked dirs invisible to muse diff; add 30-test dir lifecycle suite

- plugin.py: workdir_snapshot() filters on_disk_dirs to only tracked dirs (committed or staged) — untracked dirs must not appear in diff snapshots, matching git semantics where untracked content is invisible to diff - test_directory_tracking.py: update 3 diff tests to stage dirs before diffing (tests had wrong assumption that untracked dirs show in diff) - test_dir_lifecycle.py: 30 new tests covering all 6 directory states (untracked, staged-added, clean, unstaged-deleted, staged-deleted, staged-renamed) across status/diff/add/mv/reset/commit

sha256:8b3bbc331871a67d637a5dfd8fa2dcdcf6c73b682bab4cd11fb534220913e7bc sha
+60 ~7 symbols
sha256:51e3abd622222655f2f9686eee430ded56be2914353fa80685581e60949c0fef snapshot
+60
symbols added
~7
symbols modified
0
dead code introduced
Semantic Changes 67 symbols
~ tests/test_dir_lifecycle.py .py 60 symbols added
+ TestMvNonEmptyDir class class TestMvNonEmptyDir L393–432
+ test_mv_nonempty_dir_restages_all_files method method test_mv_nonempty_dir_restages_all_files L394–432
+ TestStateClean class class TestStateClean L177–193
+ test_clean_when_committed_dir_unchanged method method test_clean_when_committed_dir_unchanged L180–187
+ test_status_text_says_nothing_to_commit method method test_status_text_says_nothing_to_commit L189–193
+ TestStateStagedAdded class class TestStateStagedAdded L122–170
+ test_commit_includes_directory method method test_commit_includes_directory L162–170
+ test_diff_shows_as_added method method test_diff_shows_as_ L144–150
+ test_reset_clears_back_to_untracked method method test_reset_clears_back_to_untracked L152–160
+ test_shows_in_staged_added method method test_shows_in_staged_ L125–133
+ test_status_text_shows_new_directory method method test_status_text_shows_new_directory L135–142
+ TestStateStagedDeleted class class TestStateStagedDeleted L251–293
+ test_no_double_entry_in_deleted method method test_no_double_entry_in_deleted L285–293
+ test_reset_moves_back_to_unstaged method method test_reset_moves_back_to_unstaged L274–283
+ test_shows_in_staged_deleted method method test_shows_in_staged_deleted L254–262
+ test_status_text_shows_deleted_directory method method test_status_text_shows_deleted_directory L264–272
+ TestStateStagedRenamed class class TestStateStagedRenamed L300–386
+ test_diff_shows_r_not_a_plus_d method method test_diff_shows_r_not_a_plus_d L337–345
+ test_move_inside_existing_dir method method test_move_inside_existing_dir L378–386
+ test_rename_chain_collapses method method test_rename_chain_collapses L367–376
+ test_reset_clears_rename_map method method test_reset_clears_rename_map L347–356
+ test_staged_renamed_not_in_added_or_deleted method method test_staged_renamed_not_in_added_or_deleted L311–319
+ test_status_json_shows_renamed method method test_status_json_shows_renamed L303–309
+ test_status_text_shows_renamed_directory method method test_status_text_shows_renamed_directory L328–335
+ test_total_changes_is_one method method test_total_changes_is_one L321–326
+ test_trailing_slash_on_dest_is_cosmetic method method test_trailing_slash_on_dest_is_cosmetic L358–365
+ TestStateUnstagedDeleted class class TestStateUnstagedDeleted L200–244
+ test_code_add_dot_stages_deletion method method test_code_add_dot_stages_deletion L227–235
+ test_code_add_explicit_path_stages_deletion method method test_code_add_explicit_path_stages_deletion L237–244
+ test_in_unstaged_deleted method method test_in_unstaged_deleted L211–217
+ test_shows_in_deleted method method test_shows_in_deleted L203–209
+ test_status_text_shows_deleted method method test_status_text_shows_deleted L219–225
+ TestStateUntracked class class TestStateUntracked L86–115
+ test_diff_does_not_show_untracked method method test_diff_does_not_show_untracked L110–115
+ test_not_in_added_or_deleted method method test_not_in_added_or_deleted L103–108
+ test_status_json_shows_untracked method method test_status_json_shows_untracked L89–94
+ test_status_text_labels_untracked_directory method method test_status_text_labels_untracked_directory L96–101
+ _diff_json function function _diff_json L78–79
+ _env function function _env L70–71
+ _make_repo function function _make_repo L39–67
+ _status_json function function _status_json L74–75
+ CliRunner import import CliRunner L24–24
+ CommitRecord import import CommitRecord L28–28
+ SnapshotRecord import import SnapshotRecord L29–29
+ annotations import import annotations L14–14
+ blob_id import import blob_id L30–30
+ datetime import import datetime L16–16
+ hash_commit import import hash_commit L27–27
+ hash_snapshot import import hash_snapshot L27–27
+ json import import json L17–17
+ muse_dir import import muse_dir L25–25
+ os import import os L18–18
+ pathlib import import pathlib L19–19
+ pytest import import pytest L22–22
+ ref_path import import ref_path L25–25
+ shutil import import shutil L20–20
+ write_commit import import write_commit L28–28
+ write_object import import write_object L26–26
+ write_snapshot import import write_snapshot L29–29
+ runner variable variable runner L32–32

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