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

feat(checkout-symbol): supercharge for agents — -j alias, exit_code, duration_ms

- Add -j alias to --json - Add _CheckoutSymbolOutputJson TypedDict covering all 14 JSON fields - Add start_timer() → elapsed() wired to duration_ms on all three JSON paths (no-op, dry-run, write) — each path now emits exit_code=0 and duration_ms - Update run() docstring with JSON envelope section - Add tests/test_checkout_symbol_supercharge.py (38 tests): TestJsonAlias, TestDurationMs, TestExitCode, TestTypedDicts, TestDocstrings, TestAnsiSanitization, TestPerformance - Fix stale test_json_restored_from_is_8_hex: short_id() now returns 'sha256:<12hex>' (19 chars), not bare 8-char hex — updated assertion - All 98 checkout-symbol tests pass

sha256:c1587c7720bd174f6b266241245f9a8ca91a19cea4ab81543eec202e73419ed1 sha
+61 ~3 −1 symbols
sha256:affab52c629bf45a84c40406ab7aeb1525fdb8ff00bc12c755c7f368b3417c31 snapshot
+61
symbols added
~3
symbols modified
−1
symbol removed
0
dead code introduced
Semantic Changes 65 symbols
+ ADDRESS variable variable ADDRESS L101–101
+ TestAnsiSanitization class class TestAnsiSanitization L337–354
+ test_dry_run_json_no_ansi method method test_dry_run_json_no_ansi L340–343
+ test_noop_json_no_ansi method method test_noop_json_no_ansi L350–354
+ test_write_json_no_ansi method method test_write_json_no_ansi L345–348
+ TestDocstrings class class TestDocstrings L318–329
+ test_run_docstring_mentions_duration_ms method method test_run_docstring_mentions_duration_ms L326–329
+ test_run_docstring_mentions_exit_code method method test_run_docstring_mentions_exit_code L321–324
+ TestDurationMs class class TestDurationMs L160–206
+ test_dry_run_duration_ms_is_float method method test_dry_run_duration_ms_is_float L175–179
+ test_dry_run_duration_ms_nonnegative method method test_dry_run_duration_ms_nonnegative L169–173
+ test_dry_run_has_duration_ms method method test_dry_run_has_duration_ms L163–167
+ test_j_alias_dry_run_duration_ms_present method method test_j_alias_dry_run_duration_ms_present L202–206
+ test_noop_path_has_duration_ms method method test_noop_path_has_duration_ms L193–200
+ test_write_path_duration_ms_nonnegative method method test_write_path_duration_ms_nonnegative L187–191
+ test_write_path_has_duration_ms method method test_write_path_has_duration_ms L181–185
+ TestExitCode class class TestExitCode L214–274
+ test_dry_run_exit_code_is_int method method test_dry_run_exit_code_is_int L230–234
+ test_dry_run_exit_code_zero method method test_dry_run_exit_code_zero L223–228
+ test_dry_run_has_exit_code method method test_dry_run_has_exit_code L217–221
+ test_exit_code_mirrors_process_exit_dry_run method method test_exit_code_mirrors_process_exit_dry_run L264–268
+ test_exit_code_mirrors_process_exit_write method method test_exit_code_mirrors_process_exit_write L270–274
+ test_noop_path_exit_code_zero method method test_noop_path_exit_code_zero L256–262
+ test_noop_path_has_exit_code method method test_noop_path_has_exit_code L249–254
+ test_write_path_exit_code_zero method method test_write_path_exit_code_zero L242–247
+ test_write_path_has_exit_code method method test_write_path_has_exit_code L236–240
+ TestJsonAlias class class TestJsonAlias L109–152
+ test_j_alias_dry_run_exits_zero method method test_j_alias_dry_run_exits_zero L112–115
+ test_j_alias_dry_run_valid_json method method test_j_alias_dry_run_valid_json L117–120
+ test_j_alias_has_address_key method method test_j_alias_has_address_key L122–126
+ test_j_alias_has_changed_key method method test_j_alias_has_changed_key L128–132
+ test_j_alias_same_top_level_keys_as_json_flag method method test_j_alias_same_top_level_keys_as_json_flag L134–142
+ test_j_alias_write_path_exits_zero method method test_j_alias_write_path_exits_zero L144–147
+ test_j_alias_write_path_valid_json method method test_j_alias_write_path_valid_json L149–152
+ TestPerformance class class TestPerformance L362–381
+ test_dry_run_duration_under_2000ms method method test_dry_run_duration_under_2000ms L365–369
+ test_duration_ms_is_float_not_int method method test_duration_ms_is_float_not_int L377–381
+ test_write_duration_under_2000ms method method test_write_duration_under_2000ms L371–375
+ TestTypedDicts class class TestTypedDicts L282–310
+ test_checkout_symbol_output_json_exists method method test_checkout_symbol_output_json_exists L285–286
+ test_has_duration_ms_annotation method method test_has_duration_ms_annotation L292–294
+ test_has_exit_code_annotation method method test_has_exit_code_annotation L288–290
+ test_retains_address_annotation method method test_retains_address_annotation L296–298
+ test_retains_changed_annotation method method test_retains_changed_annotation L300–302
+ test_retains_dry_run_annotation method method test_retains_dry_run_annotation L304–306
+ test_retains_verified_annotation method method test_retains_verified_annotation L308–310
+ _env function function _env L36–37
+ _run function function _run L40–41
+ _v1_commit_id function function _v1_commit_id L93–98
+ cs_repo function function cs_repo L50–90
+ CliRunner import import CliRunner L26–26
+ annotations import import annotations L18–18
+ json import import json L20–20
+ pathlib import import pathlib L21–21
+ pytest import import pytest L24–24
+ textwrap import import textwrap L22–22
+ runner variable variable runner L28–28
~ muse/cli/commands/checkout_symbol.py .py 3 symbols added, 2 symbols modified
+ _CheckoutSymbolOutputJson class class _CheckoutSymbolOutputJson L115–156
+ TypedDict import import TypedDict L95–95
+ start_timer import import start_timer L103–103
~ run
~ tests/test_cmd_checkout_symbol.py .py 1 symbol added, 1 symbol removed, 1 symbol modified
− test_json_restored_from_is_8_hex method method test_json_restored_from_is_8_hex L391–397
+ test_json_restored_from_is_short_id method method test_json_restored_from_is_short_id L391–400
← 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:c1587c7720bd174f6b266241245f9a8ca91a19cea4ab81543eec202e73419ed1 --body "your comment"