gabriel / muse public
feat patch tag task/supercharge-tag #1 / 1
AI Agent gabriel · 161 days ago · Apr 18, 2026 · Diff

feat(tag): supercharge — elapsed_ms, exit_code, JSON errors to stdout, fix --allow-duplicate, sha256 IDs

- Add elapsed_ms (float, ms) and exit_code to all JSON outputs: add, list, remove - _emit_error() pattern in run_add/run_list/run_remove: JSON errors → stdout in JSON mode so agents always receive parseable output regardless of outcome - Fix --allow-duplicate: generate unique blob_id(os.urandom(32)) per write so multiple copies coexist and all get removed by a single tag remove call - Extend _TagJson TypedDict with elapsed_ms and exit_code fields - Update docstrings and in-parser help text: replace '<uuid>' with '<sha256:...>' - Fix test_cmd_tag_hardening.py: update 5 stale assertions expecting UUID or bare-hex formats to match sha256-prefixed reality - Add tests/test_cmd_tag_supercharge.py: 32 new tests covering elapsed_ms, exit_code, JSON errors to stdout, data integrity, performance, concurrency

sha256:3b5fd188b41eebd45f37816e3101cc01286a5f250ede884f189aaf52a9a0ec2f sha
+57 ~13 −1 symbols
sha256:6f69148dd34fafe20193b4a2e18bbbfbdcff8bbffc7ab3015e4a41cd4ba6f187 snapshot
+57
symbols added
~13
symbols modified
−1
symbol removed
0
dead code introduced
Semantic Changes 71 symbols
~ tests/test_cmd_tag_supercharge.py .py 53 symbols added
+ TestConcurrent class class TestConcurrent L364–404
+ test_c1_concurrent_list_isolated_repos method method test_c1_concurrent_list_isolated_repos L365–404
+ TestDataIntegrity class class TestDataIntegrity L297–331
+ test_d1_tag_id_sha256_on_add method method test_d1_tag_id_sha256_on_add L298–303
+ test_d2_tag_id_sha256_on_list method method test_d2_tag_id_sha256_on_list L305–309
+ test_d3_commit_id_sha256_on_add method method test_d3_commit_id_sha256_on_add L311–316
+ test_d4_commit_id_sha256_on_list method method test_d4_commit_id_sha256_on_list L318–323
+ test_d5_commit_id_sha256_on_remove method method test_d5_commit_id_sha256_on_remove L325–331
+ TestElapsedMsExitCode class class TestElapsedMsExitCode L144–206
+ test_i1_add_has_elapsed_ms method method test_i1_add_has_elapsed_ms L145–150
+ test_i2_add_has_exit_code_zero method method test_i2_add_has_exit_code_zero L152–156
+ test_i3_add_dry_run_has_elapsed_ms method method test_i3_add_dry_run_has_elapsed_ms L158–164
+ test_i4_add_already_tagged_has_elapsed_ms method method test_i4_add_already_tagged_has_elapsed_ms L166–173
+ test_i5_list_has_elapsed_ms method method test_i5_list_has_elapsed_ms L175–181
+ test_i6_list_empty_has_elapsed_ms method method test_i6_list_empty_has_elapsed_ms L183–189
+ test_i7_remove_has_elapsed_ms method method test_i7_remove_has_elapsed_ms L191–197
+ test_i8_remove_not_found_has_elapsed_ms method method test_i8_remove_not_found_has_elapsed_ms L199–206
+ TestErrorJsonSchema class class TestErrorJsonSchema L263–290
+ test_s1_add_invalid_tag_error_schema method method test_s1_add_invalid_tag_error_schema L266–270
+ test_s2_add_commit_not_found_error_schema method method test_s2_add_commit_not_found_error_schema L272–278
+ test_s3_list_commit_not_found_error_schema method method test_s3_list_commit_not_found_error_schema L280–284
+ test_s4_remove_invalid_tag_error_schema method method test_s4_remove_invalid_tag_error_schema L286–290
+ TestJsonErrorsToStdout class class TestJsonErrorsToStdout L213–256
+ test_e1_add_invalid_tag_json_to_stdout method method test_e1_add_invalid_tag_json_to_stdout L214–220
+ test_e2_add_commit_not_found_json_to_stdout method method test_e2_add_commit_not_found_json_to_stdout L222–228
+ test_e3_bad_format_exits_nonzero method method test_e3_bad_format_exits_nonzero L230–234
+ test_e4_list_commit_not_found_json_to_stdout method method test_e4_list_commit_not_found_json_to_stdout L236–241
+ test_e5_remove_invalid_tag_json_to_stdout method method test_e5_remove_invalid_tag_json_to_stdout L243–248
+ test_e6_remove_commit_not_found_json_to_stdout method method test_e6_remove_commit_not_found_json_to_stdout L250–256
+ TestPerformance class class TestPerformance L338–357
+ test_p1_elapsed_ms_is_float method method test_p1_elapsed_ms_is_float L339–344
+ test_p2_elapsed_ms_under_5000 method method test_p2_elapsed_ms_under_5000 L346–350
+ test_p3_elapsed_ms_is_positive method method test_p3_elapsed_ms_is_positive L352–357
+ TestUnit class class TestUnit L107–137
+ test_u1_typeddict_has_elapsed_ms method method test_u1_typeddict_has_elapsed_ms L108–112
+ test_u2_typeddict_has_exit_code method method test_u2_typeddict_has_exit_code L114–118
+ test_u3_format_error_json_mode method method test_u3_format_error_json_mode L120–124
+ test_u4_tag_id_is_sha256 method method test_u4_tag_id_is_sha256 L126–130
+ test_u5_commit_id_is_sha256 method method test_u5_commit_id_is_sha256 L132–137
+ _CHDIR_LOCK variable variable _CHDIR_LOCK L80–80
+ _env function function _env L83–84
+ cli variable variable cli L77–77
+ CliRunner import import CliRunner L75–75
+ annotations import import annotations L65–65
+ json import import json L67–67
+ os import import os L68–68
+ pathlib import import pathlib L69–69
+ pytest import import pytest L73–73
+ threading import import threading L70–70
+ time import import time L71–71
+ repo function function repo L88–94
+ runner variable variable runner L78–78
+ tagged_repo function function tagged_repo L98–100
~ muse/cli/commands/tag.py .py 3 symbols added, 6 symbols modified
+ blob_id import import blob_id L69–69
+ os import import os L63–63
+ time import import time L66–66
~ tests/test_cmd_tag_hardening.py .py 1 symbol added, 1 symbol removed, 7 symbols modified
← Older Oldest on task/supercharge-tag
All commits
Newer → Latest on task/supercharge-tag

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:3b5fd188b41eebd45f37816e3101cc01286a5f250ede884f189aaf52a9a0ec2f --body "your comment"