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
+
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
+
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_table_json_duration_ms_nonnegative
method
method test_table_json_duration_ms_nonnegative L182–185
+
test_explain_json_exit_code_zero_on_success
method
method test_explain_json_exit_code_zero_on_success L246–251
+
test_table_exit_code_mirrors_process_exit
method
method test_table_exit_code_mirrors_process_exit L259–262
+
test_table_json_exit_code_zero_on_success
method
method test_table_json_exit_code_zero_on_success L229–233
+
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_table_same_keys_as_json_flag
method
method test_j_alias_table_same_keys_as_json_flag L149–156
+
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
+
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_symbol_risk_json_typed_dict_exists
method
method test_symbol_risk_json_typed_dict_exists L308–309
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:bb5837552c31447a3910c66afa8221dd60f2024292bea4bdc8a7c93f35ee39d8 --body "your comment"
No comments yet. Be the first to start the discussion.