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

feat(cat): supercharge for agents — -j alias, exit_code, _CatOutputJson TypedDict

- Add -j alias to --json (--format json) - Add _CatOutputJson TypedDict documenting the full JSON envelope - Add exit_code to JSON output (0=success, 1=any error present) - Update run() docstring with exit_code and duration_ms documentation - Extend test_cat_supercharge.py with 27 new tests: TestJsonAlias, TestExitCode, TestTypedDicts, TestDocstrings, TestAnsiSanitization - All 104 cat tests pass (77 existing + 27 new)

sha256:5cd5818a2d8e51ae53e2937faa3eadaafbac12350ce248987c9e0ba3d188d644 sha
+33 ~2 symbols
sha256:e5ebfcbae53783f47e150617b7cf51d30c23ff90b50b6db62f7b9661e6e9d1f9 snapshot
+33
symbols added
~2
symbols modified
0
dead code introduced
Semantic Changes 35 symbols
~ muse/cli/commands/cat.py .py 1 symbol added, 2 symbols modified
+ _CatOutputJson class class _CatOutputJson L92–114
~ run
~ tests/test_cat_supercharge.py .py 32 symbols added
+ TestAnsiSanitization class class TestAnsiSanitization L619–632
+ test_error_path_json_no_ansi method method test_error_path_json_no_ansi L630–632
+ test_j_alias_output_no_ansi method method test_j_alias_output_no_ansi L626–628
+ test_json_output_no_ansi method method test_json_output_no_ansi L622–624
+ TestDocstrings class class TestDocstrings L600–611
+ test_run_docstring_mentions_duration_ms method method test_run_docstring_mentions_duration_ms L608–611
+ test_run_docstring_mentions_exit_code method method test_run_docstring_mentions_exit_code L603–606
+ TestExitCode class class TestExitCode L510–554
+ test_exit_code_mirrors_process_exit_on_error method method test_exit_code_mirrors_process_exit_on_error L545–548
+ test_exit_code_mirrors_process_exit_on_success method method test_exit_code_mirrors_process_exit_on_success L534–537
+ test_exit_code_nonzero_on_symbol_not_found method method test_exit_code_nonzero_on_symbol_not_found L539–543
+ test_exit_code_zero_with_all_flag method method test_exit_code_zero_with_all_flag L550–554
+ test_j_alias_exit_code_present method method test_j_alias_exit_code_present L529–532
+ test_json_exit_code_is_int method method test_json_exit_code_is_int L524–527
+ test_json_exit_code_zero_on_success method method test_json_exit_code_zero_on_success L518–522
+ test_json_has_exit_code method method test_json_has_exit_code L513–516
+ TestJsonAlias class class TestJsonAlias L468–502
+ test_j_alias_exits_zero method method test_j_alias_exits_zero L471–473
+ test_j_alias_has_errors_key method method test_j_alias_has_errors_key L484–487
+ test_j_alias_has_results_key method method test_j_alias_has_results_key L479–482
+ test_j_alias_result_address_matches method method test_j_alias_result_address_matches L498–502
+ test_j_alias_same_top_level_keys_as_json_flag method method test_j_alias_same_top_level_keys_as_json_flag L489–496
+ test_j_alias_valid_json method method test_j_alias_valid_json L475–477
+ TestTypedDicts class class TestTypedDicts L562–592
+ test_cat_error_exists method method test_cat_error_exists L591–592
+ test_cat_output_json_exists method method test_cat_output_json_exists L565–566
+ test_cat_output_json_has_duration_ms_annotation method method test_cat_output_json_has_duration_ms_annotation L572–574
+ test_cat_output_json_has_errors_annotation method method test_cat_output_json_has_errors_annotation L580–582
+ test_cat_output_json_has_exit_code_annotation method method test_cat_output_json_has_exit_code_annotation L568–570
+ test_cat_output_json_has_results_annotation method method test_cat_output_json_has_results_annotation L576–578
+ test_cat_output_json_has_source_ref_annotation method method test_cat_output_json_has_source_ref_annotation L584–586
+ test_cat_result_exists method method test_cat_result_exists L588–589
← 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:5cd5818a2d8e51ae53e2937faa3eadaafbac12350ce248987c9e0ba3d188d644 --body "your comment"