gabriel / muse public
feat patch code blame dev
AI Agent gabriel · 161 days ago · Apr 19, 2026 · Diff

feat(code blame): supercharge for agents — -j alias, exit_code, duration_ms

- Add `-j` as shorthand alias for `--json` (store_true, dest=as_json) - Import start_timer; add elapsed = start_timer() at top of run() - Add exit_code: int and duration_ms: float to _BlameResultJson TypedDict - Emit exit_code=0 and duration_ms=elapsed() in the single JSON path - Update run() docstring to document exit_code and duration_ms fields - Add tests/test_blame_supercharge.py (35 tests across 7 classes): TestJsonAlias, TestDurationMs, TestExitCode, TestTypedDicts, TestDocstrings, TestAnsiSanitization, TestPerformance

sha256:a24088171a2495efed994f4cec32a1d94d4599c327ceb369f1844ba7ebbe9c2c sha
+52 ~3 symbols
sha256:385bd30fefa6f9e2436783f0e7bfd1511326a7152850ab732a76da391e6092c6 snapshot
+52
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes 55 symbols
~ tests/test_blame_supercharge.py .py 51 symbols added
+ TestAnsiSanitization class class TestAnsiSanitization L297–314
+ test_j_alias_output_no_ansi method method test_j_alias_output_no_ansi L305–308
+ test_json_address_field_no_ansi method method test_json_address_field_no_ansi L310–314
+ test_json_output_no_ansi method method test_json_output_no_ansi L300–303
+ TestDocstrings class class TestDocstrings L278–289
+ test_run_docstring_mentions_duration_ms method method test_run_docstring_mentions_duration_ms L286–289
+ test_run_docstring_mentions_exit_code method method test_run_docstring_mentions_exit_code L281–284
+ TestDurationMs class class TestDurationMs L148–187
+ test_duration_ms_with_all_flag method method test_duration_ms_with_all_flag L182–187
+ test_duration_ms_with_kind_filter method method test_duration_ms_with_kind_filter L175–180
+ test_j_alias_duration_ms_present method method test_j_alias_duration_ms_present L169–173
+ test_json_duration_ms_is_float method method test_json_duration_ms_is_float L163–167
+ test_json_duration_ms_nonnegative method method test_json_duration_ms_nonnegative L157–161
+ test_json_has_duration_ms method method test_json_has_duration_ms L151–155
+ TestExitCode class class TestExitCode L195–235
+ test_exit_code_mirrors_process_exit method method test_exit_code_mirrors_process_exit L223–227
+ test_exit_code_zero_with_no_events_found method method test_exit_code_zero_with_no_events_found L229–235
+ test_j_alias_exit_code_present method method test_j_alias_exit_code_present L217–221
+ test_json_exit_code_is_int method method test_json_exit_code_is_int L211–215
+ test_json_exit_code_zero_on_success method method test_json_exit_code_zero_on_success L204–209
+ test_json_has_exit_code method method test_json_has_exit_code L198–202
+ TestJsonAlias class class TestJsonAlias L101–140
+ test_j_alias_address_matches method method test_j_alias_address_matches L136–140
+ test_j_alias_exits_zero method method test_j_alias_exits_zero L104–107
+ test_j_alias_has_address_key method method test_j_alias_has_address_key L120–124
+ test_j_alias_has_events_key method method test_j_alias_has_events_key L114–118
+ test_j_alias_same_top_level_keys_as_json_flag method method test_j_alias_same_top_level_keys_as_json_flag L126–134
+ test_j_alias_valid_json method method test_j_alias_valid_json L109–112
+ TestPerformance class class TestPerformance L322–341
+ test_duration_ms_is_float_not_int method method test_duration_ms_is_float_not_int L337–341
+ test_j_alias_duration_under_1000ms method method test_j_alias_duration_under_1000ms L331–335
+ test_json_duration_under_1000ms method method test_json_duration_under_1000ms L325–329
+ TestTypedDicts class class TestTypedDicts L243–270
+ test_blame_event_json_exists method method test_blame_event_json_exists L265–266
+ test_blame_event_json_has_commit_id method method test_blame_event_json_has_commit_id L268–270
+ test_blame_result_json_exists method method test_blame_result_json_exists L246–247
+ test_blame_result_json_has_duration_ms_annotation method method test_blame_result_json_has_duration_ms_annotation L253–255
+ test_blame_result_json_has_exit_code_annotation method method test_blame_result_json_has_exit_code_annotation L249–251
+ test_blame_result_json_retains_address_annotation method method test_blame_result_json_retains_address_annotation L261–263
+ test_blame_result_json_retains_events_annotation method method test_blame_result_json_retains_events_annotation L257–259
+ _blame_address function function _blame_address L91–93
+ _env function function _env L37–38
+ _run function function _run L41–42
+ blame_repo function function blame_repo L51–88
+ CliRunner import import CliRunner L27–27
+ annotations import import annotations L19–19
+ json import import json L21–21
+ pathlib import import pathlib L22–22
+ pytest import import pytest L25–25
+ textwrap import import textwrap L23–23
+ runner variable variable runner L29–29
~ muse/cli/commands/blame.py .py 1 symbol added, 3 symbols modified
+ start_timer import import start_timer L92–92
~ 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:a24088171a2495efed994f4cec32a1d94d4599c327ceb369f1844ba7ebbe9c2c --body "your comment"