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

feat: supercharge muse status — elapsed_ms, exit_code, sparse_checkout, upstream fix, branch-only schema

New in JSON output (all paths): - elapsed_ms: float — agent timing / latency monitoring - exit_code: int — always 0; confirms command success vs OS crash - sparse_checkout: {enabled, mode, patterns} | null — one status call reveals both working-tree state and active sparse config

Bug fixes: - Code-domain (staged) path hardcoded upstream/ahead/behind=None — fixed by threading upstream_info through _render_staged_status - --branch-only JSON schema was unstable (total=False, merge keys absent when no merge in progress) — fixed to always emit all keys

Security: - merge_from, checkout_target, branch sanitized before JSON serialisation (no raw ANSI escape bytes can leak into JSON values)

Tests: 40 new in test_cmd_status_supercharge.py covering: U1-U5 elapsed_ms/exit_code/sparse_checkout unit assertions I1-I8 integration (upstream fix, branch-only, checkout_interrupted) S1-S4 security (ANSI in JSON values) D1-D5 data integrity (float types, total_changes, patterns) P1-P3 performance (5k files, rapid calls) C1 concurrent (4 threads, isolated repos)

sha256:66f11d1367c3021e2c63090d6cdeb877acf0b9b71ebd59df16e0d92b78aff0be sha
+70 ~4 symbols
sha256:6d70475637a44415e02755e6e375c0c80c8081388929834a4c41ee71d3e1cb40 snapshot
+70
symbols added
~4
symbols modified
0
dead code introduced
Semantic Changes 74 symbols
~ tests/test_cmd_status_supercharge.py .py 67 symbols added
+ TestBranchOnlySchema class class TestBranchOnlySchema L278–323
+ test_I2_conflict_count_always_present method method test_I2_conflict_count_always_present L296–302
+ test_I2_merge_from_always_present method method test_I2_merge_from_always_present L288–294
+ test_I2_merge_in_progress_always_present method method test_I2_merge_in_progress_always_present L279–286
+ test_I2_no_merge_values_are_defaults method method test_I2_no_merge_values_are_defaults L304–312
+ test_I3_branch_only_exit_code_flag_exits_zero_when_dirty method method test_I3_branch_only_exit_code_flag_exits_zero_when_dirty L314–323
+ TestCheckoutInterrupted class class TestCheckoutInterrupted L331–365
+ test_I4_checkout_interrupted_true_when_file_exists method method test_I4_checkout_interrupted_true_when_file_exists L332–339
+ test_I5_checkout_target_matches_file_content method method test_I5_checkout_target_matches_file_content L341–347
+ test_I6_checkout_interrupted_cleared_after_file_removed method method test_I6_checkout_interrupted_cleared_after_file_ L357–365
+ test_I6_checkout_interrupted_false_when_absent method method test_I6_checkout_interrupted_false_when_absent L349–355
+ TestCodeDomainUpstream class class TestCodeDomainUpstream L251–270
+ test_I1_code_domain_includes_upstream_key method method test_I1_code_domain_includes_upstream_key L252–260
+ test_I1_code_domain_upstream_null_when_no_remote method method test_I1_code_domain_upstream_null_when_no_remote L262–270
+ TestConcurrent class class TestConcurrent L517–545
+ test_C1_four_concurrent_status_calls method method test_C1_four_concurrent_status_calls L518–545
+ TestDataIntegrity class class TestDataIntegrity L428–469
+ test_D1_elapsed_ms_is_float method method test_D1_elapsed_ms_is_float L429–432
+ test_D2_exit_code_is_int method method test_D2_exit_code_is_int L434–438
+ test_D4_total_changes_includes_renamed method method test_D4_total_changes_includes_renamed L440–452
+ test_all_required_keys_still_present_with_new_fields method method test_all_required_keys_still_present_with_new_fields L454–469
+ TestElapsedAndExitCode class class TestElapsedAndExitCode L121–164
+ test_U1_elapsed_ms_non_negative method method test_U1_elapsed_ms_non_negative L132–135
+ test_U1_elapsed_ms_present_code_domain method method test_U1_elapsed_ms_present_code_domain L122–125
+ test_U1_elapsed_ms_present_non_code_domain method method test_U1_elapsed_ms_present_non_code_domain L127–130
+ test_U2_elapsed_ms_present_in_branch_only method method test_U2_elapsed_ms_present_in_branch_only L160–164
+ test_U2_exit_code_present method method test_U2_exit_code_present L137–140
+ test_U2_exit_code_present_in_branch_only method method test_U2_exit_code_present_in_branch_only L154–158
+ test_U2_exit_code_zero_when_clean method method test_U2_exit_code_zero_when_clean L142–145
+ test_U2_exit_code_zero_when_dirty method method test_U2_exit_code_zero_when_dirty L147–152
+ TestPerformance class class TestPerformance L477–509
+ test_P1_5000_file_repo_completes method method test_P1_5000_file_repo_completes L479–489
+ test_P2_elapsed_ms_present_in_all_rapid_calls method method test_P2_elapsed_ms_present_in_all_rapid_calls L491–498
+ test_P3_elapsed_ms_consistent_across_clean_calls method method test_P3_elapsed_ms_consistent_across_clean_calls L500–509
+ TestSecurity class class TestSecurity L373–420
+ test_S1_ansi_in_merge_from_not_in_json_value method method test_S1_ansi_in_merge_from_not_in_json_value L374–393
+ test_S2_ansi_in_checkout_target_not_in_json_value method method test_S2_ansi_in_checkout_target_not_in_json_value L395–403
+ test_S3_ansi_in_branch_name_not_in_json method method test_S3_ansi_in_branch_name_not_in_json L405–414
+ test_S4_no_raw_ansi_in_json_output method method test_S4_no_raw_ansi_in_json_output L416–420
+ TestSparseCheckoutField class class TestSparseCheckoutField L172–243
+ test_D3_sparse_checkout_patterns_always_list method method test_D3_sparse_checkout_patterns_always_list L228–234
+ test_D5_sparse_checkout_null_after_disable method method test_D5_sparse_checkout_null_after_disable L236–243
+ test_U3_sparse_checkout_dict_when_active method method test_U3_sparse_checkout_dict_when_active L187–193
+ test_U3_sparse_checkout_key_present_when_disabled method method test_U3_sparse_checkout_key_present_when_disabled L173–178
+ test_U3_sparse_checkout_null_when_disabled method method test_U3_sparse_checkout_null_when_disabled L180–185
+ test_U4_sparse_checkout_enabled_field method method test_U4_sparse_checkout_enabled_field L195–201
+ test_U4_sparse_checkout_mode_cone method method test_U4_sparse_checkout_mode_cone L203–209
+ test_U4_sparse_checkout_mode_pattern method method test_U4_sparse_checkout_mode_pattern L211–218
+ test_U4_sparse_checkout_patterns_match_config method method test_U4_sparse_checkout_patterns_match_config L220–226
+ _CHDIR_LOCK variable variable _CHDIR_LOCK L52–52
+ _commit function function _commit L94–96
+ _disable_sparse function function _disable_sparse L112–113
+ _env function function _env L66–67
+ _fresh_code_repo function function _fresh_code_repo L99–104
+ _init_repo function function _init_repo L81–91
+ _invoke function function _invoke L70–72
+ _set_sparse function function _set_sparse L107–109
+ _status function function _status L75–78
+ CliRunner import import CliRunner L56–56
+ annotations import import annotations L44–44
+ json import import json L46–46
+ os import import os L47–47
+ pathlib import import pathlib L48–48
+ pytest import import pytest L54–54
+ threading import import threading L49–49
+ time import import time L50–50
+ runner variable variable runner L58–58
~ muse/cli/commands/status.py .py 3 symbols added, 4 symbols modified
+ _SparseCheckoutInfo class class _SparseCheckoutInfo L140–149
+ _read_sparse_checkout function function _read_sparse_checkout L220–246
+ time import import time L87–87
~ run
← Older Oldest on task/supercharge-status
All commits
Newer → Latest on task/supercharge-status

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:66f11d1367c3021e2c63090d6cdeb877acf0b9b71ebd59df16e0d92b78aff0be --body "your comment"