gabriel / muse public
fix BREAKING muse#52 fix/reflog-long-ids #1 / 1
AI Agent gabriel · 9 days ago · Jul 8, 2026 · Diff

fix(muse#52): reflog human text output uses long_id, not short_id

_fmt_entry rendered commit IDs as sha256:<12-hex> in human text output, inconsistent with every other Muse command (all of which use the full sha256:<64-hex> canonical form) and a genuine prefix-collision risk for IDs copied out of reflog output. The JSON output path was already correct.

- _fmt_entry now uses long_id for both new_id and old_id; the 'initial' sentinel for a null old_id is unchanged. - Removed the unused short: int = 12 parameter and the now-dead short_id import. - Fixed the docstring's false claim that short IDs were used 'for consistency with all other Muse commands' -- the opposite was true. - Fixed the module-level format spec (<new_sha12> -> <new_sha256>). - Updated tests/test_reflog_supercharge.py's TestTextFormatShortId class (renamed TestTextFormatLongId) -- it explicitly asserted the buggy short-ID behavior as correct; now asserts the fixed long-ID behavior.

TDD: tests/test_cmd_reflog_long_ids.py, 7 tests (LI_01-LI_06), red-first, all green. Full reflog regression sweep: 278 passed across 11 test files.

sha256:97740e0836930191f9f6b756651581010478b51744537383727954f45e8c3cd2 sha
+18 ~4 −6 symbols
sha256:6cc694b4002413ea4582e1416789a364ae8994ca0a5544535d370e924c95f241 snapshot
+18
symbols added
~4
symbols modified
−6
symbols removed
0
dead code introduced
Semantic Changes 28 symbols
~ tests/test_cmd_reflog_long_ids.py .py 13 symbols added
+ _entry function function _entry L20–29
+ NULL_COMMIT_ID import import NULL_COMMIT_ID L17–17
+ annotations import import annotations L12–12
+ datetime import import datetime L14–14
+ inspect import import inspect L15–15
+ long_id import import long_id L17–17
+ test_li_01_new_id_rendered_as_long_id function function test_li_01_new_id_rendered_as_long_id L37–45
+ test_li_02_old_id_rendered_as_long_id function function test_li_02_old_id_rendered_as_long_id L53–60
+ test_li_02b_initial_sentinel_unchanged_for_null_old_id function function test_li_02b_initial_sentinel_unchanged_for_null_old_id L63–70
+ test_li_03_short_parameter_removed function function test_li_03_short_parameter_ L78–82
+ test_li_04_docstring_no_stale_short_id_claim function function test_li_04_docstring_no_stale_short_id_claim L90–94
+ test_li_05_module_docstring_format_spec_updated function function test_li_05_module_docstring_format_spec_updated L102–106
+ test_li_06_fmt_entry_output_has_no_12_char_short_form function function test_li_06_fmt_entry_output_has_no_12_char_short_form L114–133
~ muse/cli/commands/reflog.py .py 1 symbol removed, 3 symbols modified
short_id import import short_id L86–86
~ tests/test_reflog_supercharge.py .py 5 symbols added, 5 symbols removed, 1 symbol modified
TestTextFormatShortId class class TestTextFormatShortId L134–170
_short_tokens method method _short_tokens L137–138
test_new_id_shown_as_sha256_short_in_text method method test_new_id_shown_as_sha256_short_in_text L140–147
test_old_id_shown_as_sha256_short_in_text method method test_old_id_shown_as_sha256_short_in_text L149–155
test_text_short_id_length_is_19 method method test_text_short_id_length_is_19 L164–170
+ TestTextFormatLongId class class TestTextFormatLongId L134–173
+ _full_tokens method method _full_tokens L139–140
+ test_new_id_shown_as_sha256_full_in_text method method test_new_id_shown_as_sha256_full_in_text L142–148
+ test_old_id_shown_as_sha256_full_in_text method method test_old_id_shown_as_sha256_full_in_text L150–156
+ test_text_id_length_is_64_hex method method test_text_id_length_is_64_hex L165–173
← Older Oldest on fix/reflog-long-ids
All commits
Newer → Latest on fix/reflog-long-ids

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:97740e0836930191f9f6b756651581010478b51744537383727954f45e8c3cd2 --body "your comment"