gabriel / muse public
feat patch reflog task/supercharge-reflog #1 / 1
AI Agent gabriel · 162 days ago · Apr 17, 2026 · Diff

feat(reflog): supercharge — sha256: prefix on IDs, duration_ms, exit_code, 35 new tests

- _short_id() normalises bare-hex (on-disk format) to sha256:<12-hex> - Text output: new_id/old_id shown as sha256:<12-hex> short IDs - JSON output: new_id/old_id emitted as sha256:<64-hex> canonical form - Both _ReflogResultJson and _ReflogAllJson now include duration_ms + exit_code - duration_ms and exit_code present in all JSON paths (main, --all, empty) - Module docstring JSON schema updated to reflect new fields and sha256: IDs - 35 new tests covering: _short_id unit, text short IDs, JSON ID integrity, duration_ms/exit_code (8 cases), filter behaviour, security, performance

sha256:fea5edc7fedb0a9461f9fce4982dd5669b7890512a47ab7c430202993f181667 sha
+65 ~4 symbols
sha256:faaccedf712d52f522b142ed1a3fe68f62c2e34c9643435416ca4178417e45c1 snapshot
+65
symbols added
~4
symbols modified
0
dead code introduced
Semantic Changes 69 symbols
~ tests/test_reflog_supercharge.py .py 63 symbols added
+ TestDurationAndExitCode class class TestDurationAndExitCode L232–283
+ test_all_json_has_duration_ms method method test_all_json_has_duration_ms L262–267
+ test_duration_ms_3dp_precision method method test_duration_ms_3dp_precision L256–260
+ test_duration_ms_is_float method method test_duration_ms_is_float L245–249
+ test_duration_ms_non_negative method method test_duration_ms_non_negative L251–254
+ test_duration_ms_present_in_json method method test_duration_ms_present_in_json L233–237
+ test_empty_reflog_json_has_duration_ms method method test_empty_reflog_json_has_duration_ms L278–283
+ test_exit_code_zero_on_success method method test_exit_code_zero_on_success L239–243
+ test_filtered_json_has_duration_ms method method test_filtered_json_has_duration_ms L269–276
+ TestFilterBehaviour class class TestFilterBehaviour L291–350
+ test_limit_applied_after_all_filters method method test_limit_applied_after_all_filters L327–336
+ test_operation_and_author_filters_combined method method test_operation_and_author_filters_combined L338–350
+ test_since_after_until_errors method method test_since_after_until_errors L321–325
+ test_since_until_single_day method method test_since_until_single_day L306–319
+ test_total_reflects_post_filter_count method method test_total_reflects_post_filter_count L292–304
+ TestJsonIds class class TestJsonIds L182–224
+ test_new_id_is_full_sha256_in_json method method test_new_id_is_full_sha256_in_json L193–198
+ test_new_id_sha256_prefixed_in_json method method test_new_id_sha256_prefixed_in_json L185–191
+ test_new_id_value_round_trips method method test_new_id_value_round_trips L219–224
+ test_null_old_id_sha256_zeros_in_json method method test_null_old_id_sha256_zeros_in_json L212–217
+ test_old_id_is_full_sha256_in_json method method test_old_id_is_full_sha256_in_json L206–210
+ test_old_id_sha256_prefixed_in_json method method test_old_id_sha256_prefixed_in_json L200–204
+ TestPerformanceSupercharge class class TestPerformanceSupercharge L386–410
+ test_100_entries_under_500ms method method test_100_entries_under_500ms L395–404
+ test_duration_ms_plausible method method test_duration_ms_plausible L406–410
+ test_empty_reflog_under_100ms method method test_empty_reflog_under_100ms L387–393
+ TestSecuritySupercharge class class TestSecuritySupercharge L358–378
+ test_ansi_in_new_id_sanitized_in_text method method test_ansi_in_new_id_sanitized_in_text L359–366
+ test_no_traceback_on_bad_date method method test_no_traceback_on_bad_date L374–378
+ test_no_traceback_on_bad_format method method test_no_traceback_on_bad_format L368–372
+ TestShortId class class TestShortId L99–130
+ test_bare_hex_12_hex_chars_after_prefix method method test_bare_hex_12_hex_chars_after_prefix L107–110
+ test_bare_hex_prepends_sha256_prefix method method test_bare_hex_prepends_sha256_prefix L102–105
+ test_bare_hex_total_length_is_19 method method test_bare_hex_total_length_is_19 L112–114
+ test_matches_short_regex method method test_matches_short_regex L128–130
+ test_null_id_shows_zeros method method test_null_id_shows_zeros L123–126
+ test_sha256_prefixed_input_handled method method test_sha256_prefixed_input_handled L116–121
+ TestTextFormatShortId class class TestTextFormatShortId L138–174
+ _short_tokens method method _short_tokens L141–142
+ test_initial_entry_shows_initial_keyword method method test_initial_entry_shows_initial_keyword L161–166
+ test_new_id_shown_as_sha256_short_in_text method method test_new_id_shown_as_sha256_short_in_text L144–151
+ test_old_id_shown_as_sha256_short_in_text method method test_old_id_shown_as_sha256_short_in_text L153–159
+ test_text_short_id_length_is_19 method method test_text_short_id_length_is_19 L168–174
+ _NULL_ID variable variable _NULL_ID L26–26
+ _SHA256_FULL variable variable _SHA256_FULL L30–30
+ _SHA256_SHORT_19 variable variable _SHA256_SHORT_19 L31–31
+ _SHA_A variable variable _SHA_A L27–27
+ _SHA_B variable variable _SHA_B L28–28
+ _TS variable variable _TS L33–33
+ _append function function _append L52–86
+ _invoke function function _invoke L89–91
+ _make_repo function function _make_repo L41–49
+ CliRunner import import CliRunner L22–22
+ ExitCode import import ExitCode L20–20
+ InvokeResult import import InvokeResult L22–22
+ annotations import import annotations L12–12
+ append_reflog import import append_reflog L21–21
+ datetime import import datetime L14–14
+ json import import json L15–15
+ pathlib import import pathlib L16–16
+ re import import re L17–17
+ time import import time L18–18
+ runner variable variable runner L24–24
~ muse/cli/commands/reflog.py .py 2 symbols added, 4 symbols modified
+ _short_id function function _short_id L141–152
+ time import import time L79–79
~ run
← Older Oldest on task/supercharge-reflog
All commits
Newer → Latest on task/supercharge-reflog

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