gabriel / muse public
feat patch commit task/supercharge-commit #1 / 1
AI Agent gabriel · 160 days ago · Apr 17, 2026 · Diff

feat(commit): supercharge for agents — elapsed_seconds, exit_code, bare hex display

- Add import time; t0 = time.monotonic() at top of run() - Add elapsed_seconds and exit_code to all 4 JSON paths: real commit (exit_code=0), dry-run with changes (exit_code=0), nothing-to-commit (exit_code=0), dry-run clean tree (exit_code=1) - Fix text output hex slices: commit_id[:8] → .removeprefix('sha256:')[:8] dry-run and real commit both now show 8 bare hex chars - Update module docstring and run() docstring with full JSON contract including model_id, toolchain_id, elapsed_seconds, exit_code - Fix test_text_shows_branch_and_short_id to expect bare hex not sha256: prefix - Add 23 new tests: TestElapsed (5), TestExitCode (4), TestJsonSchemaComplete (5), TestTextOutputHex (3), TestDataIntegrity (4), TestPerformance (2)

sha256:6299cfc7eef06f847ed7c6b344a2f9e01d21902c33215c81290a200b92ea5203 sha
+32 ~3 symbols
sha256:16490eece0a9a308bb7469bac89f82ef9cc1caca80a0ee3d0655799e1780829c snapshot
+32
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes 35 symbols
~ muse/cli/commands/commit.py .py 1 symbol added, 1 symbol modified
+ time import import time L66–66
~ run
~ tests/test_cmd_commit.py .py 31 symbols added, 2 symbols modified
+ TestDataIntegrity class class TestDataIntegrity L1108–1149
+ test_commit_id_on_disk_matches_json method method test_commit_id_on_disk_matches_json L1111–1120
+ test_files_changed_count_matches_reality method method test_files_changed_count_matches_reality L1141–1149
+ test_parent_commit_id_matches_disk method method test_parent_commit_id_matches_disk L1131–1139
+ test_snapshot_id_on_disk_matches_json method method test_snapshot_id_on_disk_matches_json L1122–1129
+ TestElapsed class class TestElapsed L974–1007
+ test_dry_run_clean_tree_has_elapsed method method test_dry_run_clean_tree_has_elapsed L997–1002
+ test_dry_run_with_changes_has_elapsed method method test_dry_run_with_changes_has_elapsed L984–988
+ test_elapsed_is_non_negative method method test_elapsed_is_non_negative L1004–1007
+ test_nothing_to_commit_has_elapsed method method test_nothing_to_commit_has_elapsed L990–995
+ test_real_commit_has_elapsed method method test_real_commit_has_elapsed L977–982
+ TestExitCode class class TestExitCode L1010–1038
+ test_dry_run_clean_tree_exit_code_1 method method test_dry_run_clean_tree_exit_code_1 L1032–1038
+ test_dry_run_with_changes_exit_code_0 method method test_dry_run_with_changes_exit_code_0 L1019–1023
+ test_nothing_to_commit_exit_code_0 method method test_nothing_to_commit_exit_code_0 L1025–1030
+ test_real_commit_exit_code_0 method method test_real_commit_exit_code_0 L1013–1017
+ TestJsonSchemaComplete class class TestJsonSchemaComplete L1041–1073
+ test_dry_run_with_changes_schema_complete method method test_dry_run_with_changes_schema_complete L1050–1054
+ test_model_id_in_real_commit_json method method test_model_id_in_real_commit_json L1063–1067
+ test_nothing_to_commit_has_exit_code method method test_nothing_to_commit_has_exit_code L1056–1061
+ test_real_commit_schema_complete method method test_real_commit_schema_complete L1044–1048
+ test_toolchain_id_in_real_commit_json method method test_toolchain_id_in_real_commit_json L1069–1073
+ TestPerformance class class TestPerformance L1152–1172
+ test_elapsed_seconds_plausible method method test_elapsed_seconds_plausible L1162–1172
+ test_first_commit_under_2s method method test_first_commit_under_2s L1155–1160
+ TestTextOutputHex class class TestTextOutputHex L1076–1105
+ test_dry_run_shows_8_hex_chars method method test_dry_run_shows_8_hex_chars L1088–1093
+ test_real_commit_shows_8_hex_chars method method test_real_commit_shows_8_hex_chars L1079–1086
+ test_text_output_no_sha256_prefix_in_short_id method method test_text_output_no_sha256_prefix_in_short_id L1095–1105
+ _FULL_KEYS variable variable _FULL_KEYS L958–964
+ _parse_json function function _parse_json L967–971
← Older Oldest on task/supercharge-commit
All commits
Newer → Latest on task/supercharge-commit

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:6299cfc7eef06f847ed7c6b344a2f9e01d21902c33215c81290a200b92ea5203 --body "your comment"