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

feat(code blast-risk): supercharge for agents — -j alias, exit_code, duration_ms, _ExplainJson TypedDict

- Add `-j` as shorthand alias for `--json` (store_true, dest=as_json) - Import start_timer and Callable; add elapsed = start_timer() in run() - Emit exit_code=0 and duration_ms=elapsed() on all three JSON paths: table output (_BlastRiskOutput), --explain dict, and _emit_empty() - Add exit_code/duration_ms fields to _BlastRiskOutput TypedDict - Add new _ExplainJson TypedDict for --explain output shape - Pass elapsed callable through to _emit_empty() (new final parameter) - Update run() docstring to document exit_code and duration_ms fields - Add tests/test_blast_risk_supercharge.py (43 tests across 7 classes): TestJsonAlias, TestDurationMs, TestExitCode, TestTypedDicts, TestDocstrings, TestAnsiSanitization, TestPerformance

sha256:bb5837552c31447a3910c66afa8221dd60f2024292bea4bdc8a7c93f35ee39d8 sha
+60 ~4 symbols
sha256:751dbac8586fa1b4cdd8eae354333b6524ce8b5d6dc00bbe2387b1539b0398f2 snapshot
+60
symbols added
~4
symbols modified
0
dead code introduced
Semantic Changes 64 symbols
~ tests/test_blast_risk_supercharge.py .py 57 symbols added
+ TestAnsiSanitization class class TestAnsiSanitization L336–352
+ test_explain_json_no_ansi_in_output method method test_explain_json_no_ansi_in_output L343–346
+ test_table_json_addresses_no_ansi method method test_table_json_addresses_no_ansi L348–352
+ test_table_json_no_ansi_in_output method method test_table_json_no_ansi_in_output L339–341
+ TestDocstrings class class TestDocstrings L317–328
+ test_run_docstring_mentions_duration_ms method method test_run_docstring_mentions_duration_ms L325–328
+ test_run_docstring_mentions_exit_code method method test_run_docstring_mentions_exit_code L320–323
+ TestDurationMs class class TestDurationMs L174–213
+ test_explain_json_duration_ms_is_float method method test_explain_json_duration_ms_is_float L204–208
+ test_explain_json_duration_ms_nonnegative method method test_explain_json_duration_ms_nonnegative L198–202
+ test_explain_json_has_duration_ms method method test_explain_json_has_duration_ms L192–196
+ test_j_alias_duration_ms_present method method test_j_alias_duration_ms_present L210–213
+ test_table_json_duration_ms_is_float method method test_table_json_duration_ms_is_float L187–190
+ test_table_json_duration_ms_nonnegative method method test_table_json_duration_ms_nonnegative L182–185
+ test_table_json_has_duration_ms method method test_table_json_has_duration_ms L177–180
+ TestExitCode class class TestExitCode L221–267
+ test_explain_json_exit_code_is_int method method test_explain_json_exit_code_is_int L253–257
+ test_explain_json_exit_code_zero_on_success method method test_explain_json_exit_code_zero_on_success L246–251
+ test_explain_json_has_exit_code method method test_explain_json_has_exit_code L240–244
+ test_j_alias_exit_code_present method method test_j_alias_exit_code_present L264–267
+ test_table_exit_code_mirrors_process_exit method method test_table_exit_code_mirrors_process_exit L259–262
+ test_table_json_exit_code_is_int method method test_table_json_exit_code_is_int L235–238
+ test_table_json_exit_code_zero_on_success method method test_table_json_exit_code_zero_on_success L229–233
+ test_table_json_has_exit_code method method test_table_json_has_exit_code L224–227
+ TestJsonAlias class class TestJsonAlias L123–166
+ test_j_alias_explain_exits_zero method method test_j_alias_explain_exits_zero L139–142
+ test_j_alias_explain_same_keys_as_json_flag method method test_j_alias_explain_same_keys_as_json_flag L158–166
+ test_j_alias_explain_valid_json method method test_j_alias_explain_valid_json L144–147
+ test_j_alias_table_exits_zero method method test_j_alias_table_exits_zero L126–128
+ test_j_alias_table_has_symbols_key method method test_j_alias_table_has_symbols_key L134–137
+ test_j_alias_table_same_keys_as_json_flag method method test_j_alias_table_same_keys_as_json_flag L149–156
+ test_j_alias_table_valid_json method method test_j_alias_table_valid_json L130–132
+ TestPerformance class class TestPerformance L360–381
+ test_duration_ms_is_float_not_int method method test_duration_ms_is_float_not_int L378–381
+ test_explain_json_duration_under_2000ms method method test_explain_json_duration_under_2000ms L372–376
+ test_table_json_duration_under_2000ms method method test_table_json_duration_under_2000ms L367–370
+ TestTypedDicts class class TestTypedDicts L275–309
+ test_blast_risk_output_has_duration_ms_annotation method method test_blast_risk_output_has_duration_ms_annotation L285–287
+ test_blast_risk_output_has_exit_code_annotation method method test_blast_risk_output_has_exit_code_annotation L281–283
+ test_blast_risk_output_has_symbols_annotation method method test_blast_risk_output_has_symbols_annotation L289–291
+ test_blast_risk_output_typed_dict_exists method method test_blast_risk_output_typed_dict_exists L278–279
+ test_explain_json_has_duration_ms_annotation method method test_explain_json_has_duration_ms_annotation L300–302
+ test_explain_json_has_exit_code_annotation method method test_explain_json_has_exit_code_annotation L296–298
+ test_explain_json_has_risk_annotation method method test_explain_json_has_risk_annotation L304–306
+ test_explain_json_typed_dict_exists method method test_explain_json_typed_dict_exists L293–294
+ test_symbol_risk_json_typed_dict_exists method method test_symbol_risk_json_typed_dict_exists L308–309
+ _env function function _env L33–34
+ _first_symbol_address function function _first_symbol_address L41–48
+ _run function function _run L37–38
+ blast_repo function function blast_repo L57–115
+ CliRunner import import CliRunner L23–23
+ annotations import import annotations L15–15
+ json import import json L17–17
+ pathlib import import pathlib L18–18
+ pytest import import pytest L21–21
+ textwrap import import textwrap L19–19
+ runner variable variable runner L25–25
~ muse/cli/commands/blast_risk.py .py 3 symbols added, 4 symbols modified
+ _ExplainJson class class _ExplainJson L226–244
+ Callable import import Callable L104–104
+ start_timer import import start_timer L116–116
~ 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:bb5837552c31447a3910c66afa8221dd60f2024292bea4bdc8a7c93f35ee39d8 --body "your comment"