gabriel / muse public
refactor patch feat/directory-tracking #3 / 13
AI Agent gabriel · 10 days ago · May 28, 2026 · Diff

refactor: directories are proper content-addressed objects (EMPTY_DIR_OID)

Replace the magic sentinel string 'dir:' with a real content hash: EMPTY_DIR_OID = blob_id(b'') # sha256:473a0f4c...

- stage.py: define EMPTY_DIR_OID, export it; migrate legacy 'dir:' entries on read so existing stage.json files upgrade transparently - plugin.py: _DIR_SENTINEL = EMPTY_DIR_OID; write zero-byte object to store when staging dirs (store is now complete and pushable) - code_stage.py: import EMPTY_DIR_OID; write_object() before staging dirs - mv.py: import EMPTY_DIR_OID; write_object() in dir branch - diff.py: check EMPTY_DIR_OID instead of 'dir:' - status.py: import _DIR_SENTINEL from stage; remove local re-definitions

sha256:3f46367650ccd121654f3bbe06ed3471a9007c3229fe9556d1069d64b6a2550a sha
+10 ~27 symbols
sha256:1e42ca724a43389c5ab860402c883533baf53efa79472e47154dda550918784d snapshot
+10
symbols added
~27
symbols modified
0
dead code introduced
Semantic Changes 37 symbols
~ muse/cli/commands/code_stage.py .py 2 symbols added, 9 symbols modified
+ EMPTY_DIR_OID import import EMPTY_DIR_OID L59–59
+ write_object import import write_object L69–69
~ muse/cli/commands/diff.py .py 1 symbol added, 2 symbols modified
+ EMPTY_DIR_OID import import EMPTY_DIR_OID L78–78
~ run
~ muse/cli/commands/mv.py .py 2 symbols added, 7 symbols modified
+ EMPTY_DIR_OID import import EMPTY_DIR_OID L66–66
+ write_object import import write_object L65–65
~ run
~ muse/cli/commands/status.py .py 1 symbol added, 1 symbol modified
+ _DIR_SENTINEL import import _DIR_SENTINEL L92–92
~ muse/plugins/code/plugin.py .py 1 symbol added, 6 symbols modified
+ EMPTY_DIR_OID import import EMPTY_DIR_OID L128–128
~ muse/plugins/code/stage.py .py 3 symbols added, 2 symbols modified
+ EMPTY_DIR_OID variable variable EMPTY_DIR_OID L41–41
+ _DIR_SENTINEL_LEGACY variable variable _DIR_SENTINEL_LEGACY L44–44
+ blob_id import import blob_id L35–35

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:3f46367650ccd121654f3bbe06ed3471a9007c3229fe9556d1069d64b6a2550a --body "your comment"