gabriel / muse public
fix task/fix-short-id-prefix #1 / 1
AI Agent gabriel · 162 days ago · Apr 17, 2026 · Diff

fix: _short_id keeps sha256: prefix canonical; document deletion-staging trap

_short_id in both rebase.py and range_diff.py was stripping the sha256: prefix and returning bare hex. The prefix is canonical in Muse everywhere except on-disk shard paths — stripping it for display is wrong and loses algorithm provenance.

New behavior: _short_id('sha256:abcdef1234567890...') -> 'sha256:abcdef12' (range-diff, 8 hex) _short_id('sha256:abcdef1234567890...') -> 'sha256:abcdef123456' (rebase, 12 hex)

Tests updated accordingly: - TestShortId: inverted assertions — now verifies prefix is kept, hex truncated - test_text_short_id_has_sha256_prefix: expects sha256:<8-hex> tokens in output - test_text_short_ids_are_sha256_plus_8_hex: verifies 15-char total length - test_text_output_shows_sha256_short_id: expects sha256:<12-hex> in dry-run text - test_abort_text_shows_sha256_short_id: expects sha256:<12-hex> in abort text

Agent guide (docs/agent-guide.md + .muse/agent.md): muse code add <path> silently does nothing when the file no longer exists on disk. Added explicit note: use -u to stage tracked deletions, with a warning callout in the standard cycle block.

sha256:8ed6bbcb858d9ff1cb3a15247039bc7a5c5d71a94935c0aa0fe4ab63adb7a72d sha
+8 ~34 −8 symbols
sha256:781c26d5ca98fd452680f25dfd2fcfe8237c839542da3c6fbde606c17de5587b snapshot
+8
symbols added
~34
symbols modified
−8
symbols removed
0
dead code introduced
Semantic Changes 50 symbols
~ muse/cli/commands/range_diff.py .py 1 symbol modified
~ muse/cli/commands/rebase.py .py 1 symbol modified
~ tests/test_range_diff_supercharge.py .py 2 symbols added, 2 symbols removed, 1 symbol modified
− test_text_short_id_is_bare_hex_not_prefix method method test_text_short_id_is_bare_hex_not_prefix L594–614
− test_text_short_ids_are_8_hex_chars method method test_text_short_ids_are_8_hex_chars L616–634
+ test_text_short_id_has_sha256_prefix method method test_text_short_id_has_sha256_prefix L594–609
+ test_text_short_ids_are_sha256_plus_8_hex method method test_text_short_ids_are_sha256_plus_8_hex L611–626
~ tests/test_rebase_supercharge.py .py 5 symbols added, 5 symbols removed, 3 symbols modified
− test_abort_text_shows_bare_hex_short_id method method test_abort_text_shows_bare_hex_short_id L675–689
− test_short_id_is_12_chars method method test_short_id_is_12_chars L142–147
− test_short_id_is_bare_hex method method test_short_id_is_bare_hex L149–154
− test_short_id_strips_prefix method method test_short_id_strips_prefix L135–140
− test_text_output_does_not_show_sha256_prefix method method test_text_output_does_not_show_sha256_prefix L163–175
+ test_abort_text_shows_sha256_short_id method method test_abort_text_shows_sha256_short_id L676–690
+ test_short_id_keeps_prefix method method test_short_id_keeps_prefix L135–140
+ test_short_id_total_length method method test_short_id_total_length L149–154
+ test_short_id_truncates_hex_to_12 method method test_short_id_truncates_hex_to_12 L142–147
+ test_text_output_shows_sha256_short_id method method test_text_output_shows_sha256_short_id L163–176
← Older Oldest on task/fix-short-id-prefix
All commits
Newer → Latest on task/fix-short-id-prefix

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