gabriel / muse public
feat patch dev
AI Agent gabriel · 161 days ago · Apr 19, 2026 · Diff

feat: supercharge muse code index — exit_code, duration_ms on all sub-commands

- Add start_timer import and elapsed() calls to run_status, run_rebuild, run_purge - status --json: wrap bare list in object with 'indexes', 'exit_code', 'duration_ms' (schema change — agents no longer need to iterate a raw list to check envelope) - rebuild --json: add exit_code=0, duration_ms to existing _RebuildResult TypedDict - purge --json: add exit_code=0, duration_ms via new _PurgeResult TypedDict - Add _StatusResult and _PurgeResult TypedDicts; expand _RebuildResult with docstring - Expand run_status, run_rebuild, run_purge docstrings with envelope section - Update module-level docstring to show new status --json envelope shape - Add test_index_supercharge.py — 49 tests across 5 classes

sha256:b41227c206f56d5e3b870397d6bef289d8d276bf36cd19229cb305c62215d232 sha
+68 ~4 symbols
sha256:bf8f7d008e3b12a3686644ad4d735deb01a875a8b2b8c1ebb0a2e67792385332 snapshot
+68
symbols added
~4
symbols modified
0
dead code introduced
Semantic Changes 72 symbols
~ tests/test_index_supercharge.py .py 64 symbols added
+ TestDocstrings class class TestDocstrings L302–330
+ test_run_purge_mentions_duration_ms method method test_run_purge_mentions_duration_ms L328–330
+ test_run_purge_mentions_exit_code method method test_run_purge_mentions_exit_code L323–326
+ test_run_rebuild_mentions_duration_ms method method test_run_rebuild_mentions_duration_ms L319–321
+ test_run_rebuild_mentions_exit_code method method test_run_rebuild_mentions_exit_code L314–317
+ test_run_status_mentions_duration_ms method method test_run_status_mentions_duration_ms L310–312
+ test_run_status_mentions_exit_code method method test_run_status_mentions_exit_code L305–308
+ TestPurgeJson class class TestPurgeJson L200–248
+ test_purge_absent_indexes_skipped_not_error method method test_purge_absent_indexes_skipped_not_error L239–248
+ test_purge_j_duration_ms_is_float method method test_purge_j_duration_ms_is_float L223–225
+ test_purge_j_exit_code_zero method method test_purge_j_exit_code_zero L215–217
+ test_purge_j_exits_zero method method test_purge_j_exits_zero L203–205
+ test_purge_j_has_duration_ms method method test_purge_j_has_duration_ms L219–221
+ test_purge_j_has_exit_code method method test_purge_j_has_exit_code L211–213
+ test_purge_j_has_purged_key method method test_purge_j_has_purged_key L227–229
+ test_purge_j_has_skipped_key method method test_purge_j_has_skipped_key L231–233
+ test_purge_j_no_ansi method method test_purge_j_no_ansi L235–237
+ test_purge_j_valid_json method method test_purge_j_valid_json L207–209
+ TestRebuildJson class class TestRebuildJson L148–192
+ test_rebuild_dry_run_j_duration_ms method method test_rebuild_dry_run_j_duration_ms L184–188
+ test_rebuild_dry_run_j_exit_code_zero method method test_rebuild_dry_run_j_exit_code_zero L179–182
+ test_rebuild_j_duration_ms_is_float method method test_rebuild_j_duration_ms_is_float L171–173
+ test_rebuild_j_exit_code_zero method method test_rebuild_j_exit_code_zero L163–165
+ test_rebuild_j_exits_zero method method test_rebuild_j_exits_zero L151–153
+ test_rebuild_j_has_duration_ms method method test_rebuild_j_has_duration_ms L167–169
+ test_rebuild_j_has_exit_code method method test_rebuild_j_has_exit_code L159–161
+ test_rebuild_j_has_rebuilt_key method method test_rebuild_j_has_rebuilt_key L175–177
+ test_rebuild_j_no_ansi method method test_rebuild_j_no_ansi L190–192
+ test_rebuild_j_valid_json method method test_rebuild_j_valid_json L155–157
+ TestStatusJson class class TestStatusJson L80–140
+ test_status_j_duration_ms_is_float method method test_status_j_duration_ms_is_float L111–113
+ test_status_j_duration_ms_nonnegative method method test_status_j_duration_ms_nonnegative L115–117
+ test_status_j_exit_code_zero method method test_status_j_exit_code_zero L103–105
+ test_status_j_exits_zero method method test_status_j_exits_zero L83–85
+ test_status_j_has_duration_ms method method test_status_j_has_duration_ms L107–109
+ test_status_j_has_exit_code method method test_status_j_has_exit_code L99–101
+ test_status_j_has_indexes_key method method test_status_j_has_indexes_key L91–93
+ test_status_j_index_entries_have_name method method test_status_j_index_entries_have_name L119–122
+ test_status_j_index_entries_have_status method method test_status_j_index_entries_have_status L124–127
+ test_status_j_indexes_is_list method method test_status_j_indexes_is_list L95–97
+ test_status_j_no_ansi method method test_status_j_no_ansi L129–131
+ test_status_j_valid_json method method test_status_j_valid_json L87–89
+ test_status_json_flag_same_as_j method method test_status_json_flag_same_as_j L133–140
+ TestTypedDicts class class TestTypedDicts L256–294
+ test_purge_result_has_duration_ms method method test_purge_result_has_duration_ms L292–294
+ test_purge_result_has_exit_code method method test_purge_result_has_exit_code L288–290
+ test_purge_result_typeddict_exists method method test_purge_result_typeddict_exists L285–286
+ test_rebuild_result_has_duration_ms method method test_rebuild_result_has_duration_ms L266–268
+ test_rebuild_result_has_exit_code method method test_rebuild_result_has_exit_code L262–264
+ test_rebuild_result_typeddict_exists method method test_rebuild_result_typeddict_exists L259–260
+ test_status_result_has_duration_ms method method test_status_result_has_duration_ms L281–283
+ test_status_result_has_exit_code method method test_status_result_has_exit_code L277–279
+ test_status_result_has_indexes method method test_status_result_has_indexes L273–275
+ test_status_result_typeddict_exists method method test_status_result_typeddict_exists L270–271
+ _env function function _env L38–39
+ _run function function _run L42–43
+ CliRunner import import CliRunner L28–28
+ annotations import import annotations L20–20
+ json import import json L22–22
+ pathlib import import pathlib L23–23
+ pytest import import pytest L26–26
+ textwrap import import textwrap L24–24
+ index_repo function function index_repo L52–72
+ runner variable variable runner L30–30
~ muse/cli/commands/index_rebuild.py .py 4 symbols added, 4 symbols modified
+ _PurgeResult class class _PurgeResult L164–180
+ _StatusIndexEntry class class _StatusIndexEntry L140–146
+ _StatusResult class class _StatusResult L149–161
+ start_timer import import start_timer L76–76
← 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:b41227c206f56d5e3b870397d6bef289d8d276bf36cd19229cb305c62215d232 --body "your comment"