gabriel / muse public
patch dev
AI Agent gabriel · 159 days ago · Apr 19, 2026 · Diff

supercharge(hotspots): -j alias, exit_code, duration_ms, TypedDict, docstring

- Add from typing import Any, TypedDict - Add from muse.core.timing import start_timer - Add _HotspotsOutputJson TypedDict with from_ref, to_ref, commits_analysed, truncated, filters, hotspots, exit_code, duration_ms annotations - Add -j alias for --json - Add elapsed = start_timer() at top of run() - Emit exit_code=0 and duration_ms=elapsed() in JSON output - Expand run() docstring with JSON envelope section - Add 53-test supercharge suite (first hotspots tests ever written)

sha256:3ceb3e599bfea9b160eebaa8131b366869f850ff7957600c1a1ca6772682a6f4 sha
+75 ~2 symbols
sha256:eb5c1c8333bcc75d75ea0f8d264e3bee176ab745fa6b8fe4b4b5a350decad435 snapshot
+75
symbols added
~2
symbols modified
0
dead code introduced
Semantic Changes 77 symbols
~ tests/test_hotspots_supercharge.py .py 71 symbols added
+ TestAnsiSanitization class class TestAnsiSanitization L350–363
+ test_j_alias_output_no_ansi method method test_j_alias_output_no_ansi L357–359
+ test_json_no_ansi_with_results method method test_json_no_ansi_with_results L361–363
+ test_json_output_no_ansi method method test_json_output_no_ansi L353–355
+ TestDocstrings class class TestDocstrings L331–342
+ test_run_docstring_mentions_duration_ms method method test_run_docstring_mentions_duration_ms L339–342
+ test_run_docstring_mentions_exit_code method method test_run_docstring_mentions_exit_code L334–337
+ TestDurationMs class class TestDurationMs L196–231
+ test_duration_ms_with_kind_filter method method test_duration_ms_with_kind_filter L221–225
+ test_duration_ms_with_min_filter method method test_duration_ms_with_min_filter L215–219
+ test_duration_ms_with_top_filter method method test_duration_ms_with_top_filter L227–231
+ test_j_alias_duration_ms_present method method test_j_alias_duration_ms_present L211–213
+ test_json_duration_ms_is_float method method test_json_duration_ms_is_float L207–209
+ test_json_duration_ms_nonnegative method method test_json_duration_ms_nonnegative L203–205
+ test_json_has_duration_ms method method test_json_has_duration_ms L199–201
+ TestExitCode class class TestExitCode L239–279
+ test_exit_code_mirrors_process_exit method method test_exit_code_mirrors_process_exit L259–261
+ test_exit_code_zero_with_kind_filter method method test_exit_code_zero_with_kind_filter L271–274
+ test_exit_code_zero_with_min_filter method method test_exit_code_zero_with_min_filter L263–269
+ test_exit_code_zero_with_top_filter method method test_exit_code_zero_with_top_filter L276–279
+ test_j_alias_exit_code_present method method test_j_alias_exit_code_present L255–257
+ test_json_exit_code_is_int method method test_json_exit_code_is_int L251–253
+ test_json_exit_code_zero method method test_json_exit_code_zero L246–249
+ test_json_has_exit_code method method test_json_has_exit_code L242–244
+ TestJsonAlias class class TestJsonAlias L136–188
+ test_j_alias_exits_zero method method test_j_alias_exits_zero L139–141
+ test_j_alias_has_commits_analysed_key method method test_j_alias_has_commits_analysed_key L151–153
+ test_j_alias_has_filters_key method method test_j_alias_has_filters_key L155–157
+ test_j_alias_has_hotspots_key method method test_j_alias_has_hotspots_key L147–149
+ test_j_alias_hotspot_count_matches_json_flag method method test_j_alias_hotspot_count_matches_json_flag L170–177
+ test_j_alias_same_top_level_keys_as_json_flag method method test_j_alias_same_top_level_keys_as_json_flag L159–168
+ test_j_alias_valid_json method method test_j_alias_valid_json L143–145
+ test_j_alias_with_kind_filter method method test_j_alias_with_kind_filter L184–188
+ test_j_alias_with_top_filter method method test_j_alias_with_top_filter L179–182
+ TestPerformance class class TestPerformance L436–449
+ test_duration_ms_is_float_not_int method method test_duration_ms_is_float_not_int L447–449
+ test_j_alias_duration_under_2000ms method method test_j_alias_duration_under_2000ms L443–445
+ test_json_duration_under_2000ms method method test_json_duration_under_2000ms L439–441
+ TestSchema class class TestSchema L371–428
+ test_commits_analysed_positive method method test_commits_analysed_positive L390–392
+ test_filters_has_include_imports method method test_filters_has_include_imports L417–420
+ test_filters_has_kind method method test_filters_has_kind L407–410
+ test_filters_has_min_changes method method test_filters_has_min_changes L412–415
+ test_has_from_ref method method test_has_from_ref L374–376
+ test_has_to_ref method method test_has_to_ref L378–380
+ test_has_truncated method method test_has_truncated L382–384
+ test_hotspot_items_have_address method method test_hotspot_items_have_address L394–398
+ test_hotspot_items_have_changes method method test_hotspot_items_have_changes L400–405
+ test_min_filter_removes_low_churn method method test_min_filter_removes_low_churn L426–428
+ test_top_bounds_hotspot_count method method test_top_bounds_hotspot_count L422–424
+ test_truncated_is_bool method method test_truncated_is_bool L386–388
+ TestTypedDicts class class TestTypedDicts L287–323
+ test_has_duration_ms_annotation method method test_has_duration_ms_annotation L297–299
+ test_has_exit_code_annotation method method test_has_exit_code_annotation L293–295
+ test_hotspots_output_json_typeddict_exists method method test_hotspots_output_json_typeddict_exists L290–291
+ test_retains_commits_analysed_annotation method method test_retains_commits_analysed_annotation L305–307
+ test_retains_filters_annotation method method test_retains_filters_annotation L313–315
+ test_retains_from_ref_annotation method method test_retains_from_ref_annotation L317–319
+ test_retains_hotspots_annotation method method test_retains_hotspots_annotation L301–303
+ test_retains_to_ref_annotation method method test_retains_to_ref_annotation L321–323
+ test_retains_truncated_annotation method method test_retains_truncated_annotation L309–311
+ _env function function _env L43–44
+ _run function function _run L47–48
+ hotspots_repo function function hotspots_repo L57–128
+ CliRunner import import CliRunner L33–33
+ annotations import import annotations L25–25
+ json import import json L27–27
+ pathlib import import pathlib L28–28
+ pytest import import pytest L31–31
+ textwrap import import textwrap L29–29
+ runner variable variable runner L35–35
~ muse/cli/commands/hotspots.py .py 4 symbols added, 2 symbols modified
+ _HotspotsOutputJson class class _HotspotsOutputJson L88–118
+ Any import import Any L45–45
+ TypedDict import import TypedDict L45–45
+ start_timer import import start_timer L49–49
~ run
← Older Oldest on dev
All commits
Newer → Latest on dev

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