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

feat(release): supercharge — _short_id, duration_ms, exit_code, fix pre-existing breakage, 40 new tests

_short_id() helper: - Handles both sha256:-prefixed and bare-hex commit IDs - Returns sha256:<12-hex> (19 chars) — consistent with all Muse commands - Used everywhere text format showed a commit ID

Text format fixes (pre-existing bug): - commit_id[:8] on sha256:-prefixed IDs yielded 'sha256:a' — just the prefix - All text paths (_format_release, run_list, run_suggest drivers) now use _short_id() - Changelog entries in read/text also fixed

duration_ms + exit_code on every JSON path: - run_add: full ReleaseRecord dict + metadata fields - run_list: {total, releases, duration_ms, exit_code} envelope - run_read: full ReleaseRecord dict + metadata fields - run_push: _ReleasePushJson extended with duration_ms + exit_code - run_delete: _ReleaseDeleteJson extended with duration_ms + exit_code (all 3 status paths) - run_suggest: payload dict extended with duration_ms + exit_code

Pre-existing test breakage fixed (36 → 0 failures): - release show → release read (subcommand was renamed) - list JSON schema: tests expected bare [] array; output is now {total, releases} envelope - j_alias tests: duration_ms varies between runs; compare with key excluded

New tests (40): TestShortId, TestDurationAndExitCode (16 cases across all subcommands), TestTextFormatShortId, TestListJsonEnvelope, TestSecuritySupercharge, TestPerformanceSupercharge

sha256:94c3b61d43bb71ad9a32df7feff7c3a8b97c408b93ec33cd632344a12e318baf sha
+64 ~67 symbols
sha256:5557376b48ba6e8c025a696567e59d2f5dea96f14d686a01a10ecd6a45cff54d snapshot
+64
symbols added
~67
symbols modified
0
dead code introduced
Semantic Changes 131 symbols
~ tests/test_release_supercharge.py .py 62 symbols added
+ TestDurationAndExitCode class class TestDurationAndExitCode L137–247
+ test_add_duration_ms_is_float method method test_add_duration_ms_is_float L152–155
+ test_add_json_exit_code_zero method method test_add_json_exit_code_zero L146–150
+ test_add_json_has_duration_ms method method test_add_json_has_duration_ms L140–144
+ test_delete_dry_run_json_exit_code_zero method method test_delete_dry_run_json_exit_code_zero L216–223
+ test_delete_dry_run_json_has_duration_ms method method test_delete_dry_run_json_has_duration_ms L207–214
+ test_duration_ms_3dp_precision method method test_duration_ms_3dp_precision L243–247
+ test_duration_ms_non_negative method method test_duration_ms_non_negative L237–241
+ test_list_empty_json_has_duration_ms method method test_list_empty_json_has_duration_ms L169–173
+ test_list_json_exit_code_zero method method test_list_json_exit_code_zero L164–167
+ test_list_json_has_duration_ms method method test_list_json_has_duration_ms L157–162
+ test_push_dry_run_json_exit_code_zero method method test_push_dry_run_json_exit_code_zero L198–205
+ test_push_dry_run_json_has_duration_ms method method test_push_dry_run_json_has_duration_ms L189–196
+ test_read_json_exit_code_zero method method test_read_json_exit_code_zero L182–187
+ test_read_json_has_duration_ms method method test_read_json_has_duration_ms L175–180
+ test_suggest_json_exit_code_zero method method test_suggest_json_exit_code_zero L231–235
+ test_suggest_json_has_duration_ms method method test_suggest_json_has_duration_ms L225–229
+ TestListJsonEnvelope class class TestListJsonEnvelope L313–356
+ test_bare_release_json_flag_uses_envelope method method test_bare_release_json_flag_uses_envelope L351–356
+ test_list_json_empty_total_is_zero method method test_list_json_empty_total_is_zero L345–349
+ test_list_json_has_releases_key method method test_list_json_has_releases_key L326–329
+ test_list_json_has_total_key method method test_list_json_has_total_key L321–324
+ test_list_json_releases_is_array method method test_list_json_releases_is_array L331–334
+ test_list_json_top_level_is_object method method test_list_json_top_level_is_object L316–319
+ test_list_json_total_matches_releases_length method method test_list_json_total_matches_releases_length L336–343
+ TestPerformanceSupercharge class class TestPerformanceSupercharge L400–426
+ test_duration_ms_plausible method method test_duration_ms_plausible L422–426
+ test_list_50_releases_under_500ms method method test_list_50_releases_under_500ms L401–410
+ test_suggest_50_commits_under_500ms method method test_suggest_50_commits_under_500ms L412–420
+ TestSecuritySupercharge class class TestSecuritySupercharge L364–392
+ test_add_json_error_on_duplicate method method test_add_json_error_on_duplicate L383–392
+ test_no_traceback_on_bad_semver method method test_no_traceback_on_bad_semver L365–369
+ test_no_traceback_on_missing_read method method test_no_traceback_on_missing_read L371–375
+ test_no_traceback_on_suggest_no_commits method method test_no_traceback_on_suggest_no_commits L377–381
+ TestShortId class class TestShortId L103–129
+ test_bare_hex_also_handled method method test_bare_hex_also_handled L115–119
+ test_idempotent_on_short_input method method test_idempotent_on_short_input L125–129
+ test_matches_short_regex method method test_matches_short_regex L121–123
+ test_result_is_19_chars method method test_result_is_19_chars L111–113
+ test_sha256_prefixed_returns_sha256_short method method test_sha256_prefixed_returns_sha256_short L106–109
+ TestTextFormatShortId class class TestTextFormatShortId L255–305
+ _short_tokens method method _short_tokens L258–259
+ test_changelog_entries_show_sha256_short method method test_changelog_entries_show_sha256_short L297–305
+ test_list_text_shows_sha256_short_commit method method test_list_text_shows_sha256_short_commit L270–277
+ test_read_text_commit_not_bare_hex_prefix_only method method test_read_text_commit_not_bare_hex_prefix_only L287–295
+ test_read_text_shows_sha256_short_commit method method test_read_text_shows_sha256_short_commit L261–268
+ test_suggest_text_shows_sha256_short_in_driver method method test_suggest_text_shows_sha256_short_in_driver L279–285
+ _SHA256_SHORT_19 variable variable _SHA256_SHORT_19 L26–26
+ _add function function _add L91–95
+ _commit function function _commit L52–82
+ _invoke function function _invoke L85–88
+ _make_repo function function _make_repo L34–49
+ CliRunner import import CliRunner L22–22
+ ExitCode import import ExitCode L21–21
+ InvokeResult import import InvokeResult L22–22
+ annotations import import annotations L13–13
+ datetime import import datetime L15–15
+ json import import json L16–16
+ pathlib import import pathlib L17–17
+ time import import time L18–18
+ uuid import import uuid L19–19
+ runner variable variable runner L24–24
~ muse/cli/commands/release.py .py 2 symbols added, 9 symbols modified
+ _short_id function function _short_id L149–158
+ time import import time L78–78
~ tests/test_cmd_release_hardening.py .py 58 symbols modified
← Older Oldest on task/supercharge-release
All commits
Newer → Latest on task/supercharge-release

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