feat(code api-surface): supercharge for agents — -j alias, exit_code, duration_ms, envelope TypedDicts
- Add `-j` as shorthand alias for `--json` (store_true, dest=as_json) - Import start_timer and Callable; add elapsed = start_timer() in run() - Pass elapsed callable to _run_list_mode and _run_diff_mode - Emit exit_code=0 and duration_ms=elapsed() on both JSON paths: list mode and diff mode - Add _ListJson, _DiffJson TypedDicts for type-safe envelope construction - Update run() docstring to document exit_code and duration_ms fields - Add tests/test_api_surface_supercharge.py (45 tests across 7 classes): TestJsonAlias, TestDurationMs, TestExitCode, TestTypedDicts, TestDocstrings, TestSchema, TestAnsiSanitization, TestPerformance
sha256:e06fe5842705a76395766a71380dd07e4ef6ad5baf10bfbe157bd3ea868744ea
sha
+72
~6
symbols
sha256:d732eaca062926c993d0a50e4ac7984475cde2d9f53cc8cc3e38f4ed6833ab4f
snapshot
+72
symbols added
~6
symbols modified
0
dead code introduced
Semantic Changes
78 symbols
+
test_run_docstring_mentions_duration_ms
method
method test_run_docstring_mentions_duration_ms L324–327
+
test_run_docstring_mentions_exit_code
method
method test_run_docstring_mentions_exit_code L319–322
+
test_diff_json_duration_ms_nonnegative
method
method test_diff_json_duration_ms_nonnegative L192–196
+
test_list_json_duration_ms_nonnegative
method
method test_list_json_duration_ms_nonnegative L176–179
+
test_diff_json_exit_code_zero_on_success
method
method test_diff_json_exit_code_zero_on_success L240–246
+
test_list_exit_code_mirrors_process_exit
method
method test_list_exit_code_mirrors_process_exit L254–257
+
test_list_json_exit_code_zero_on_success
method
method test_list_json_exit_code_zero_on_success L223–227
+
test_j_alias_diff_same_keys_as_json_flag
method
method test_j_alias_diff_same_keys_as_json_flag L152–160
+
test_j_alias_list_mode_has_results_key
method
method test_j_alias_list_mode_has_results_key L127–130
+
test_j_alias_list_same_keys_as_json_flag
method
method test_j_alias_list_same_keys_as_json_flag L143–150
+
test_diff_json_changed_entries_have_breaking_flag
method
method test_diff_json_changed_entries_have_breaking_flag L375–381
+
test_diff_json_stability_pct_in_range
method
method test_diff_json_stability_pct_in_range L344–348
+
test_list_json_results_have_address_and_kind
method
method test_list_json_results_have_address_and_kind L388–393
+
test_list_json_total_matches_results_len
method
method test_list_json_total_matches_results_len L383–386
+
test_diff_json_has_breaking_count_annotation
method
method test_diff_json_has_breaking_count_annotation L303–305
+
test_diff_json_has_duration_ms_annotation
method
method test_diff_json_has_duration_ms_annotation L295–297
+
test_diff_json_has_exit_code_annotation
method
method test_diff_json_has_exit_code_annotation L291–293
+
test_diff_json_has_semver_impact_annotation
method
method test_diff_json_has_semver_impact_annotation L299–301
+
test_list_json_has_duration_ms_annotation
method
method test_list_json_has_duration_ms_annotation L280–282
+
test_list_json_has_exit_code_annotation
method
method test_list_json_has_exit_code_annotation L276–278
+
test_list_json_has_results_annotation
method
method test_list_json_has_results_annotation L284–286
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:e06fe5842705a76395766a71380dd07e4ef6ad5baf10bfbe157bd3ea868744ea --body "your comment"
No comments yet. Be the first to start the discussion.