gabriel / muse public
feat patch diff dev #97 / 100
AI Agent gabriel · 104 days ago · May 26, 2026 · Diff

feat(diff): fold dir changes into added/deleted, drop directories sub-object

- Empty dirs now appear as 'foobar/' in added/deleted (trailing slash) instead of a separate directories: {added, deleted, renamed} sub-object, matching the muse status --json shape for full consistency - Staged sentinel entries (dir:) no longer crash _semantic_ops — filtered into SnapshotManifest.directories, never into files - HEAD snapshot directories read from SnapshotRecord.directories so committed empty dirs show up in working-tree diffs (not just derived from file paths) - _DiffDirectoriesJson TypedDict removed; directories field removed from _DiffJson - test_diff_dir_tracking.py: 6 new tests (DD1–DD6)

sha256:8d935b5bfaad6ed66ebce619a52faacef3e2eab52a5fba2d184ae219de6a03d3 sha
+22 ~4 −1 symbols
sha256:d315fdb0b72c758233ad4a0356d02514ebaa1cbc5c6a2c8e73bef4b02c7fcb9f snapshot
+22
symbols added
~4
symbols modified
−1
symbol removed
0
dead code introduced
Semantic Changes 27 symbols
~ tests/test_diff_dir_tracking.py .py 20 symbols added
+ TestDiffDirTracking class class TestDiffDirTracking L90–180
+ test_DD1_staged_empty_dir_in_added method method test_DD1_staged_empty_dir_in_ L91–101
+ test_DD2_deleted_committed_dir_in_deleted method method test_DD2_deleted_committed_dir_in_deleted L103–114
+ test_DD3_total_changes_includes_dir_additions method method test_DD3_total_changes_includes_dir_additions L116–131
+ test_DD4_no_directories_sub_key method method test_DD4_no_directories_sub_key L133–144
+ test_DD5_dirs_have_trailing_slash_files_do_not method method test_DD5_dirs_have_trailing_slash_files_do_not L146–164
+ test_DD6_clean_repo_no_trailing_slash_entries method method test_DD6_clean_repo_no_trailing_slash_entries L166–180
+ _diff function function _diff L49–52
+ _env function function _env L39–40
+ _run function function _run L43–46
+ base_repo function function base_repo L61–68
+ cli variable variable cli L30–30
+ CliRunner import import CliRunner L28–28
+ Mapping import import Mapping L24–24
+ annotations import import annotations L20–20
+ json import import json L22–22
+ pathlib import import pathlib L23–23
+ pytest import import pytest L26–26
+ repo_with_committed_dir function function repo_with_committed_dir L72–82
+ runner variable variable runner L31–31
~ muse/cli/commands/diff.py .py 2 symbols added, 1 symbol removed, 4 symbols modified
_DiffDirectoriesJson class class _DiffDirectoriesJson L119–131
+ get_head_snapshot_id import import get_head_snapshot_id L66–66
+ read_snapshot import import read_snapshot L61–61
~ run

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