gabriel / muse public
feat patch check-ref-format task/supercharge-check-ref-format #1 / 1
AI Agent gabriel · 154 days ago · Apr 17, 2026 · Diff

feat(check-ref-format): add elapsed_seconds, exit_code, --invalid-only

- elapsed_seconds: wall-clock timing in default and --rules JSON output. Absent from text output. - exit_code: 0 when all_valid, 1 when any invalid — mirrors the process exit code exactly. Present in both default and --rules JSON. Agents can evaluate the result without inspecting all_valid or the process exit code separately. - _CheckRefFormatResult TypedDict gains elapsed_seconds and exit_code fields. - --invalid-only: filter displayed results to invalid names only. valid_count and invalid_count still reflect the full input batch (so agents can see how many passed without reading the suppressed valid results). Mutually exclusive with --quiet and --rules (exit 1). - --rules JSON now wraps _RULES with elapsed_seconds and exit_code instead of emitting the bare dict.

17 new tests across TestElapsed, TestExitCode, TestInvalidOnly, and 2 new TestSchemas assertions. 83/83 passing.

sha256:9018f3819268c37f34a669c1e8f3a5be513193b179e7af0ba79da0a03ea80251 sha
+21 ~4 symbols
sha256:8ac6062e587f9071f94519526867c2948ffed63f451ea1c9130fc9c0f4d38009 snapshot
+21
symbols added
~4
symbols modified
0
dead code introduced
Semantic Changes 25 symbols
~ muse/cli/commands/check_ref_format.py .py 1 symbol added, 3 symbols modified
+ time import import time L122–122
~ run
~ tests/test_cmd_check_ref_format.py .py 20 symbols added, 1 symbol modified
+ TestElapsed class class TestElapsed L483–499
+ test_elapsed_absent_from_text_output method method test_elapsed_absent_from_text_output L497–499
+ test_elapsed_in_default_json method method test_elapsed_in_default_json L484–489
+ test_elapsed_in_rules_json method method test_elapsed_in_rules_json L491–495
+ TestExitCode class class TestExitCode L507–533
+ test_exit_code_0_when_all_valid method method test_exit_code_0_when_all_valid L508–510
+ test_exit_code_1_when_any_invalid method method test_exit_code_1_when_any_invalid L512–516
+ test_exit_code_in_rules_json method method test_exit_code_in_rules_json L530–533
+ test_exit_code_matches_process_exit method method test_exit_code_matches_process_exit L518–528
+ TestInvalidOnly class class TestInvalidOnly L541–591
+ test_all_results_when_all_invalid method method test_all_results_when_all_invalid L559–563
+ test_counts_reflect_full_set_not_filtered method method test_counts_reflect_full_set_not_filtered L565–570
+ test_empty_results_when_all_valid method method test_empty_results_when_all_valid L552–557
+ test_filters_to_invalid_names method method test_filters_to_invalid_names L542–550
+ test_incompatible_with_quiet method method test_incompatible_with_quiet L585–587
+ test_incompatible_with_rules method method test_incompatible_with_rules L589–591
+ test_stdin_compatible method method test_stdin_compatible L579–583
+ test_text_format method method test_text_format L572–577
+ test_check_ref_format_result_has_elapsed method method test_check_ref_format_result_has_elapsed L78–79
+ test_check_ref_format_result_has_exit_code method method test_check_ref_format_result_has_exit_code L81–82
← Older Oldest on task/supercharge-check-ref-format
All commits
Newer → Latest on task/supercharge-check-ref-format

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:9018f3819268c37f34a669c1e8f3a5be513193b179e7af0ba79da0a03ea80251 --body "your comment"