gabriel / muse public
fix BREAKING stage,status dev #61 / 100
AI Agent gabriel · 18 days ago · May 26, 2026 · Diff

fix(stage,status): don't re-stage or surface already-committed empty dirs

Two bugs, both about empty dirs that are already in HEAD's snapshot.directories:

1. muse code add . was sentinel-staging committed empty dirs on every run because the empty_dirs_to_stage loop had no check against HEAD dirs. Fix: skip any dir already in _head_snapshot_dirs() before staging.

2. muse status was showing committed empty dirs as staged.added when their sentinel was in the stage index, because staged_added_dirs wasn't filtered against committed_empty_dirs when building DirStatus. Fix: staged_added=sorted(staged_added_dirs - committed_empty_dirs).

Regression tests: TestStageIdempotency (4 tests) in test_code_stage.py, D9/D10 in test_status_directory_tracking.py.

sha256:00518230287e4eef5012e619cd030beb8883260e0b170ee53d68d89bbe058928 sha
sha256:b5ba3cc0123fffd9e94c60392fb969e29a4fc00c3566386a69c21902dce45040 snapshot

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