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

feat: first-class directory tracking across status, diff, read, stage, reset

- plugin.py: directory op addresses carry trailing slash (AddressedInsertOp, AddressedDeleteOp, RenameOp) — canonical algebra signal for directories - symbol_diff.py: separate dir/file/symbol counts in stat summary; dirs reported as 'N added directory/directories' not 'N added file' - status.py: untracked dirs shown in long-form text (dir_added was computed but never rendered); 3-tier labels — 'new directory:', 'new file:', 'new symbol:', 'modified symbol:', 'deleted symbol:'; untracked entries labeled 'untracked file:' / 'untracked directory:' in red - code_stage.py: stage message distinguishes dirs from files ('Staged 1 directory.' not '1 file(s)'); reset message granular by dir/file/symbol - read.py: color-coded A/D/M/R lines (full line colored, not just prefix); Directories/Files/Symbols summary labels; fallback path includes dir diff from snapshot.directories; is_tty-gated, no ANSI in non-TTY mode - init.py: .vscode/, .idea/, *.iml added to global .museignore template - .museignore: add .vscode/, .idea/, *.iml to repo ignore rules - 6 new TDD test files covering all of the above (56 tests)

sha256:3767afb72520f9b56053bb98fd83d323f738ee4cad16e306e8cf6862608380e4 sha
+208 ~10 symbols
sha256:e8ef6f0d4dea4ecc8fb9cb8e1785f5c7c222c463e1616f9b8fba62eca1ea2c35 snapshot
+208
symbols added
~10
symbols modified
0
dead code introduced
Semantic Changes 218 symbols
~ tests/test_code_reset_granular.py .py 34 symbols added
+ TestResetAllGranular class class TestResetAllGranular L84–128
+ test_unstage_all_dirs_says_directory method method test_unstage_all_dirs_says_directory L85–100
+ test_unstage_all_files_says_file method method test_unstage_all_files_says_file L102–115
+ test_unstage_all_no_file_s_plural method method test_unstage_all_no_file_s_plural L117–128
+ TestResetDryRun class class TestResetDryRun L197–212
+ test_dry_run_all_granular method method test_dry_run_all_granular L198–212
+ TestResetMixed class class TestResetMixed L175–190
+ test_mixed_unstage_shows_dir_file_counts method method test_mixed_unstage_shows_dir_file_counts L176–190
+ TestResetSpecificDir class class TestResetSpecificDir L135–148
+ test_unstage_dir_says_directory method method test_unstage_dir_says_directory L136–148
+ TestResetSpecificFile class class TestResetSpecificFile L155–168
+ test_unstage_one_file_says_singular method method test_unstage_one_file_says_singular L156–168
+ _env function function _env L66–67
+ _init_repo function function _init_repo L33–42
+ _make_commit function function _make_commit L45–63
+ _stage_dir function function _stage_dir L70–72
+ _stage_file function function _stage_file L75–77
+ CliRunner import import CliRunner L18–18
+ CommitRecord import import CommitRecord L22–22
+ SnapshotRecord import import SnapshotRecord L23–23
+ annotations import import annotations L10–10
+ blob_id import import blob_id L24–24
+ datetime import import datetime L12–12
+ hash_commit import import hash_commit L21–21
+ hash_snapshot import import hash_snapshot L21–21
+ json import import json L13–13
+ muse_dir import import muse_dir L19–19
+ pathlib import import pathlib L14–14
+ pytest import import pytest L16–16
+ ref_path import import ref_path L19–19
+ write_commit import import write_commit L22–22
+ write_object import import write_object L20–20
+ write_snapshot import import write_snapshot L23–23
+ runner variable variable runner L26–26
~ tests/test_directory_tracking.py .py 35 symbols added
+ TestDiffStatDirectory class class TestDiffStatDirectory L215–250
+ test_stat_file_and_dir_counted_separately method method test_stat_file_and_dir_counted_separately L235–250
+ test_stat_shows_directory_not_file method method test_stat_shows_directory_not_file L216–233
+ TestDiffTextDirectory class class TestDiffTextDirectory L177–208
+ test_new_empty_dir_not_shown_without_slash method method test_new_empty_dir_not_shown_without_slash L194–208
+ test_new_empty_dir_shows_with_trailing_slash method method test_new_empty_dir_shows_with_trailing_slash L178–192
+ TestDirectoryOpsAlgebra class class TestDirectoryOpsAlgebra L257–337
+ test_addressed_delete_op_address_has_trailing_slash method method test_addressed_delete_op_address_has_trailing_slash L281–302
+ test_addressed_insert_op_address_has_trailing_slash method method test_addressed_insert_op_address_has_trailing_slash L258–279
+ test_rename_op_address_has_trailing_slash method method test_rename_op_address_has_trailing_slash L304–337
+ TestStatusJsonUntracked class class TestStatusJsonUntracked L139–170
+ test_dirty_when_untracked_empty_dir_present method method test_dirty_when_untracked_empty_dir_present L157–170
+ test_untracked_empty_dir_in_json_untracked method method test_untracked_empty_dir_in_json_untracked L140–155
+ TestStatusTextUntracked class class TestStatusTextUntracked L100–132
+ test_untracked_empty_dir_not_shown_without_slash method method test_untracked_empty_dir_not_shown_without_slash L117–132
+ test_untracked_empty_dir_shown_with_trailing_slash method method test_untracked_empty_dir_shown_with_trailing_slash L101–115
+ _env function function _env L92–93
+ _init_repo function function _init_repo L33–43
+ _make_commit function function _make_commit L46–89
+ CliRunner import import CliRunner L18–18
+ CommitRecord import import CommitRecord L22–22
+ SnapshotRecord import import SnapshotRecord L23–23
+ annotations import import annotations L11–11
+ blob_id import import blob_id L24–24
+ hash_commit import import hash_commit L21–21
+ hash_snapshot import import hash_snapshot L21–21
+ json import import json L13–13
+ muse_dir import import muse_dir L19–19
+ pathlib import import pathlib L14–14
+ pytest import import pytest L16–16
+ ref_path import import ref_path L19–19
+ write_commit import import write_commit L22–22
+ write_object import import write_object L20–20
+ write_snapshot import import write_snapshot L23–23
+ runner variable variable runner L26–26
~ tests/test_read_color.py .py 41 symbols added
+ TestColorOpLine class class TestColorOpLine L127–146
+ test_color_op_line_a_is_green method method test_color_op_line_a_is_green L128–131
+ test_color_op_line_d_is_red method method test_color_op_line_d_is_red L133–136
+ test_color_op_line_m_is_yellow method method test_color_op_line_m_is_yellow L138–141
+ test_color_op_line_no_color_non_tty method method test_color_op_line_no_color_non_tty L143–146
+ TestFormatOpColor class class TestFormatOpColor L91–120
+ test_delete_is_red method method test_delete_is_red L97–100
+ test_insert_is_green method method test_insert_is_green L92–95
+ test_no_color_when_not_tty method method test_no_color_when_not_tty L117–120
+ test_patch_is_yellow method method test_patch_is_yellow L112–115
+ test_rename_is_cyan method method test_rename_is_cyan L107–110
+ test_replace_is_yellow method method test_replace_is_yellow L102–105
+ TestNoColorIntegration class class TestNoColorIntegration L153–170
+ test_no_ansi_in_plain_fallback_path method method test_no_ansi_in_plain_fallback_path L163–170
+ test_no_ansi_in_plain_output method method test_no_ansi_in_plain_output L154–161
+ _BOLD variable variable _BOLD L33–33
+ _CYAN variable variable _CYAN L32–32
+ _GREEN variable variable _GREEN L29–29
+ _RED variable variable _RED L30–30
+ _RESET variable variable _RESET L34–34
+ _YELLOW variable variable _YELLOW L31–31
+ _env function function _env L83–84
+ _init_repo function function _init_repo L41–50
+ _make_commit function function _make_commit L53–80
+ CliRunner import import CliRunner L19–19
+ CommitRecord import import CommitRecord L23–23
+ SnapshotRecord import import SnapshotRecord L24–24
+ annotations import import annotations L11–11
+ blob_id import import blob_id L25–25
+ datetime import import datetime L13–13
+ hash_commit import import hash_commit L22–22
+ hash_snapshot import import hash_snapshot L22–22
+ json import import json L14–14
+ muse_dir import import muse_dir L20–20
+ pathlib import import pathlib L15–15
+ pytest import import pytest L17–17
+ ref_path import import ref_path L20–20
+ write_commit import import write_commit L23–23
+ write_object import import write_object L21–21
+ write_snapshot import import write_snapshot L24–24
+ runner variable variable runner L27–27
~ tests/test_read_granular_stat.py .py 30 symbols added
+ TestFallbackPathDirectoryDisplay class class TestFallbackPathDirectoryDisplay L87–108
+ test_directory_not_shown_without_slash method method test_directory_not_shown_without_slash L99–108
+ test_directory_shows_with_trailing_slash method method test_directory_shows_with_trailing_slash L88–97
+ TestFallbackPathSummary class class TestFallbackPathSummary L115–158
+ test_directory_only_shows_directory_summary method method test_directory_only_shows_directory_summary L116–129
+ test_file_and_directory_counted_separately method method test_file_and_directory_counted_separately L143–158
+ test_file_only_shows_file_summary method method test_file_only_shows_file_summary L131–141
+ TestStructuredDeltaPath class class TestStructuredDeltaPath L165–185
+ test_directory_insert_not_counted_as_file method method test_directory_insert_not_counted_as_file L166–185
+ _env function function _env L75–76
+ _init_repo function function _init_repo L32–41
+ _make_commit function function _make_commit L44–72
+ _read function function _read L79–80
+ CliRunner import import CliRunner L17–17
+ CommitRecord import import CommitRecord L21–21
+ SnapshotRecord import import SnapshotRecord L22–22
+ annotations import import annotations L9–9
+ blob_id import import blob_id L23–23
+ datetime import import datetime L11–11
+ hash_commit import import hash_commit L20–20
+ hash_snapshot import import hash_snapshot L20–20
+ json import import json L12–12
+ muse_dir import import muse_dir L18–18
+ pathlib import import pathlib L13–13
+ pytest import import pytest L15–15
+ ref_path import import ref_path L18–18
+ write_commit import import write_commit L21–21
+ write_object import import write_object L19–19
+ write_snapshot import import write_snapshot L22–22
+ runner variable variable runner L25–25
~ tests/test_status_staged_labels.py .py 31 symbols added
+ TestStagedDirectoryLabel class class TestStagedDirectoryLabel L78–93
+ test_new_directory_label method method test_new_directory_label L79–93
+ TestStagedFileLabel class class TestStagedFileLabel L100–112
+ test_new_file_label_unchanged method method test_new_file_label_unchanged L101–112
+ TestStagedSymbolLabels class class TestStagedSymbolLabels L119–159
+ test_deleted_symbol_label method method test_deleted_symbol_label L149–159
+ test_modified_symbol_label method method test_modified_symbol_label L134–147
+ test_new_symbol_label method method test_new_symbol_label L120–132
+ _env function function _env L66–67
+ _init_repo function function _init_repo L33–42
+ _make_commit function function _make_commit L45–63
+ _status function function _status L70–71
+ CliRunner import import CliRunner L17–17
+ CommitRecord import import CommitRecord L21–21
+ SnapshotRecord import import SnapshotRecord L22–22
+ annotations import import annotations L9–9
+ blob_id import import blob_id L23–23
+ datetime import import datetime L11–11
+ hash_commit import import hash_commit L20–20
+ hash_snapshot import import hash_snapshot L20–20
+ json import import json L12–12
+ make_entry import import make_entry L24–24
+ muse_dir import import muse_dir L18–18
+ pathlib import import pathlib L13–13
+ pytest import import pytest L15–15
+ ref_path import import ref_path L18–18
+ write_commit import import write_commit L21–21
+ write_object import import write_object L19–19
+ write_snapshot import import write_snapshot L22–22
+ write_stage import import write_stage L24–24
+ runner variable variable runner L26–26
~ tests/test_status_untracked_labels.py .py 28 symbols added
+ TestUntrackedDirectoryLabel class class TestUntrackedDirectoryLabel L89–115
+ test_untracked_directory_label method method test_untracked_directory_label L90–100
+ test_untracked_directory_not_labeled_as_file method method test_untracked_directory_not_labeled_as_file L103–115
+ TestUntrackedFileLabel class class TestUntrackedFileLabel L71–82
+ test_untracked_file_label method method test_untracked_file_label L72–82
+ TestUntrackedMixed class class TestUntrackedMixed L122–135
+ test_mixed_untracked_shows_both_labels method method test_mixed_untracked_shows_both_labels L123–135
+ _env function function _env L59–60
+ _init_repo function function _init_repo L27–35
+ _make_commit function function _make_commit L38–56
+ _status function function _status L63–64
+ CliRunner import import CliRunner L16–16
+ CommitRecord import import CommitRecord L20–20
+ SnapshotRecord import import SnapshotRecord L21–21
+ annotations import import annotations L8–8
+ blob_id import import blob_id L22–22
+ datetime import import datetime L10–10
+ hash_commit import import hash_commit L19–19
+ hash_snapshot import import hash_snapshot L19–19
+ json import import json L11–11
+ muse_dir import import muse_dir L17–17
+ pathlib import import pathlib L12–12
+ pytest import import pytest L14–14
+ ref_path import import ref_path L17–17
+ write_commit import import write_commit L20–20
+ write_object import import write_object L18–18
+ write_snapshot import import write_snapshot L21–21
+ runner variable variable runner L24–24
~ .museignore .museignore
~ muse/cli/commands/code_stage.py .py 1 symbol added, 2 symbols modified
+ _unstage_summary function function _unstage_summary L1084–1102
~ muse/cli/commands/read.py .py 8 symbols added, 2 symbols modified
+ _BOLD variable variable _BOLD L155–155
+ _CYAN variable variable _CYAN L154–154
+ _GREEN variable variable _GREEN L151–151
+ _RED variable variable _RED L152–152
+ _RESET variable variable _RESET L156–156
+ _YELLOW variable variable _YELLOW L153–153
+ _c function function _c L159–160
+ _color_op_line function function _color_op_line L163–171
~ run
~ muse/plugins/code/plugin.py .py 2 symbols modified

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