gabriel / muse public
feat patch status task/status-dirs-trailing-slash #1 / 1
AI Agent gabriel · 111 days ago · May 26, 2026 · Diff

feat(status): fold empty-dir tracking into flat buckets with trailing slash

Directories are first-class symbols — they now appear in the same added, deleted, and staged.added lists as files, distinguished by a trailing / on their path (e.g. 'foobar/' instead of a separate 'directories' key).

- Remove _DirStatusJson TypedDict and 'directories' field from _StatusJson - dir_added paths → flat 'added' (untracked empty dirs) - dir_deleted paths → flat 'deleted' (committed dirs missing from disk) - dir_staged_added paths → flat 'added' + 'staged.added' (staged empty dirs) - total_changes now counts dir paths as part of the flat union - clean/dirty accounts for dir changes via the existing flat-bucket checks - Tests updated: D3 asserts staged dir in both staged.added AND added (consistent with how staged files behave)

sha256:9239370c14248bd1c28402f722251f2c68768ba0960a69cee42e4e66493b4b96 sha
+5 ~6 −6 symbols
sha256:78627bfb53049dccb4028d32225069926247ed3d4716a566a96a766e04ffff1f snapshot
+5
symbols added
~6
symbols modified
−6
symbols removed
0
dead code introduced
Semantic Changes 17 symbols
~ muse/cli/commands/status.py .py 1 symbol removed, 3 symbols modified
_DirStatusJson class class _DirStatusJson L154–164
~ run
~ tests/test_status_directory_tracking.py .py 5 symbols added, 5 symbols removed, 3 symbols modified
test_D1_new_empty_dir_appears_in_directories_added method method test_D1_new_empty_dir_appears_in_directories_ L84–96
test_D3_staged_dir_moves_from_untracked_to_staged method method test_D3_staged_dir_moves_from_untracked_to_staged L111–123
test_D5_deleted_committed_dir_in_directories_deleted method method test_D5_deleted_committed_dir_in_directories_deleted L137–149
test_D6_non_empty_dir_files_not_double_counted method method test_D6_non_empty_dir_files_not_double_counted L151–168
test_D8_directories_key_always_present method method test_D8_directories_key_always_present L182–195
+ test_D1_new_empty_dir_in_added_with_trailing_slash method method test_D1_new_empty_dir_in_added_with_trailing_slash L84–95
+ test_D3_staged_dir_appears_in_staged_added method method test_D3_staged_dir_appears_in_staged_ L110–127
+ test_D5_deleted_committed_dir_in_deleted_with_trailing_slash method method test_D5_deleted_committed_dir_in_deleted_with_trailing_slash L142–153
+ test_D6_non_empty_dir_not_in_added method method test_D6_non_empty_dir_not_in_ L155–167
+ test_D8_clean_repo_has_no_dir_entries method method test_D8_clean_repo_has_no_dir_entries L182–198
← Older Oldest on task/status-dirs-trailing-slash
All commits
Newer → Latest on task/status-dirs-trailing-slash

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