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

feat(coupling): supercharge for agent usability

- Add -j alias for --json - Add _CouplingOutputJson TypedDict with exit_code/duration_ms annotations - Add exit_code=0 and duration_ms to both JSON output paths (main + file-not-found early return) - Import start_timer; elapsed = start_timer() at top of run() - Update run() docstring with JSON envelope section - 37 new TDD tests in test_coupling_supercharge.py

sha256:40c07f5f49d35614b0f8994fda5275fbf75480ffffef4369403fcf7e21190923 sha
+59 ~2 symbols
sha256:8a2aae0874e5dc6f872147ee6ae9c41379ac6c80555f52bbb7671a46246d0229 snapshot
+59
symbols added
~2
symbols modified
0
dead code introduced
Semantic Changes 61 symbols
~ tests/test_coupling_supercharge.py .py 54 symbols added
+ TestAnsiSanitization class class TestAnsiSanitization L317–332
+ test_j_alias_output_no_ansi method method test_j_alias_output_no_ansi L324–326
+ test_json_output_no_ansi method method test_json_output_no_ansi L320–322
+ test_json_output_no_ansi_with_file_filter method method test_json_output_no_ansi_with_file_filter L328–332
+ TestDocstrings class class TestDocstrings L298–309
+ test_run_docstring_mentions_duration_ms method method test_run_docstring_mentions_duration_ms L306–309
+ test_run_docstring_mentions_exit_code method method test_run_docstring_mentions_exit_code L301–304
+ TestDurationMs class class TestDurationMs L171–204
+ test_duration_ms_on_file_not_found_path method method test_duration_ms_on_file_not_found_path L190–198
+ test_duration_ms_with_file_filter method method test_duration_ms_with_file_filter L200–204
+ test_j_alias_duration_ms_present method method test_j_alias_duration_ms_present L186–188
+ test_json_duration_ms_is_float method method test_json_duration_ms_is_float L182–184
+ test_json_duration_ms_nonnegative method method test_json_duration_ms_nonnegative L178–180
+ test_json_has_duration_ms method method test_json_has_duration_ms L174–176
+ TestExitCode class class TestExitCode L212–254
+ test_exit_code_mirrors_process_exit method method test_exit_code_mirrors_process_exit L232–234
+ test_exit_code_zero_on_file_not_found_path method method test_exit_code_zero_on_file_not_found_path L236–244
+ test_exit_code_zero_with_file_filter method method test_exit_code_zero_with_file_filter L251–254
+ test_exit_code_zero_with_filters method method test_exit_code_zero_with_filters L246–249
+ test_j_alias_exit_code_present method method test_j_alias_exit_code_present L228–230
+ test_json_exit_code_is_int method method test_json_exit_code_is_int L224–226
+ test_json_exit_code_zero method method test_json_exit_code_zero L219–222
+ test_json_has_exit_code method method test_json_has_exit_code L215–217
+ TestJsonAlias class class TestJsonAlias L116–163
+ test_j_alias_exits_zero method method test_j_alias_exits_zero L119–121
+ test_j_alias_has_commits_analysed_key method method test_j_alias_has_commits_analysed_key L131–133
+ test_j_alias_has_pairs_key method method test_j_alias_has_pairs_key L127–129
+ test_j_alias_pair_count_matches_json_flag method method test_j_alias_pair_count_matches_json_flag L146–151
+ test_j_alias_same_top_level_keys_as_json_flag method method test_j_alias_same_top_level_keys_as_json_flag L135–144
+ test_j_alias_valid_json method method test_j_alias_valid_json L123–125
+ test_j_alias_with_file_filter method method test_j_alias_with_file_filter L153–157
+ test_j_alias_with_min_filter method method test_j_alias_with_min_filter L159–163
+ TestPerformance class class TestPerformance L340–353
+ test_duration_ms_is_float_not_int method method test_duration_ms_is_float_not_int L351–353
+ test_j_alias_duration_under_2000ms method method test_j_alias_duration_under_2000ms L347–349
+ test_json_duration_under_2000ms method method test_json_duration_under_2000ms L343–345
+ TestTypedDicts class class TestTypedDicts L262–290
+ test_coupling_output_json_typeddict_exists method method test_coupling_output_json_typeddict_exists L265–266
+ test_has_duration_ms_annotation method method test_has_duration_ms_annotation L272–274
+ test_has_exit_code_annotation method method test_has_exit_code_annotation L268–270
+ test_retains_commits_analysed_annotation method method test_retains_commits_analysed_annotation L280–282
+ test_retains_filters_annotation method method test_retains_filters_annotation L288–290
+ test_retains_pairs_annotation method method test_retains_pairs_annotation L276–278
+ test_retains_truncated_annotation method method test_retains_truncated_annotation L284–286
+ _env function function _env L39–40
+ _run function function _run L43–44
+ coupling_repo function function coupling_repo L53–108
+ CliRunner import import CliRunner L29–29
+ annotations import import annotations L21–21
+ json import import json L23–23
+ pathlib import import pathlib L24–24
+ pytest import import pytest L27–27
+ textwrap import import textwrap L25–25
+ runner variable variable runner L31–31
~ muse/cli/commands/coupling.py .py 5 symbols added, 2 symbols modified
+ _CouplingFilters class class _CouplingFilters L68–72
+ _CouplingOutputJson class class _CouplingOutputJson L75–97
+ Any import import Any L43–43
+ TypedDict import import TypedDict L43–43
+ start_timer import import start_timer L48–48
~ 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:40c07f5f49d35614b0f8994fda5275fbf75480ffffef4369403fcf7e21190923 --body "your comment"