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

feat(deps): supercharge for agent usability

- Add -j alias for --json in register() - Add from typing import TypedDict + from muse.core.timing import start_timer - Add _DepsFileJson and _DepsSymbolJson TypedDicts documenting all fields - Add elapsed = start_timer() at top of run() - Add exit_code=0 and duration_ms=elapsed() to all 6 JSON emit paths: file-forward, file-reverse, symbol-forward-depth1, symbol-forward-transitive, symbol-reverse-depth1, symbol-reverse-transitive - Expand run() docstring with JSON envelope section (exit_code, duration_ms) - Add tests/test_deps_supercharge.py: 45 tests across 7 classes (TestJsonAlias, TestDurationMs, TestExitCode, TestTypedDicts, TestDocstrings, TestAnsiSanitization, TestPerformance)

sha256:06f2d3d2ce67f2a55e2e533132ba88a8c531321a49ed68e17bbcd906a108759e sha
+67 ~2 symbols
sha256:4b4e832a2a5ee365a35a20a1f377807857b26305a81d450eb334ad2f5de6de99 snapshot
+67
symbols added
~2
symbols modified
0
dead code introduced
Semantic Changes 69 symbols
~ tests/test_deps_supercharge.py .py 63 symbols added
+ TestAnsiSanitization class class TestAnsiSanitization L384–397
+ test_json_output_no_ansi_file_forward method method test_json_output_no_ansi_file_forward L387–389
+ test_json_output_no_ansi_file_reverse method method test_json_output_no_ansi_file_reverse L391–393
+ test_json_output_no_ansi_symbol_forward method method test_json_output_no_ansi_symbol_forward L395–397
+ TestDocstrings class class TestDocstrings L365–376
+ test_run_docstring_mentions_duration_ms method method test_run_docstring_mentions_duration_ms L373–376
+ test_run_docstring_mentions_exit_code method method test_run_docstring_mentions_exit_code L368–371
+ TestDurationMs class class TestDurationMs L188–247
+ test_duration_ms_file_forward method method test_duration_ms_file_forward L191–196
+ test_duration_ms_file_reverse method method test_duration_ms_file_reverse L198–203
+ test_duration_ms_symbol_forward_depth1 method method test_duration_ms_symbol_forward_depth1 L205–210
+ test_duration_ms_symbol_forward_transitive method method test_duration_ms_symbol_forward_transitive L212–219
+ test_duration_ms_symbol_reverse_depth1 method method test_duration_ms_symbol_reverse_depth1 L221–226
+ test_duration_ms_symbol_reverse_transitive method method test_duration_ms_symbol_reverse_transitive L228–235
+ test_j_alias_duration_ms_present_file_forward method method test_j_alias_duration_ms_present_file_forward L237–241
+ test_j_alias_duration_ms_present_symbol method method test_j_alias_duration_ms_present_symbol L243–247
+ TestExitCode class class TestExitCode L255–318
+ test_exit_code_file_forward method method test_exit_code_file_forward L258–263
+ test_exit_code_file_reverse method method test_exit_code_file_reverse L265–270
+ test_exit_code_is_int_file_forward method method test_exit_code_is_int_file_forward L304–306
+ test_exit_code_mirrors_process_exit method method test_exit_code_mirrors_process_exit L308–310
+ test_exit_code_symbol_forward_depth1 method method test_exit_code_symbol_forward_depth1 L272–277
+ test_exit_code_symbol_forward_transitive method method test_exit_code_symbol_forward_transitive L279–286
+ test_exit_code_symbol_reverse_depth1 method method test_exit_code_symbol_reverse_depth1 L288–293
+ test_exit_code_symbol_reverse_transitive method method test_exit_code_symbol_reverse_transitive L295–302
+ test_j_alias_exit_code_present_file method method test_j_alias_exit_code_present_file L312–314
+ test_j_alias_exit_code_present_symbol method method test_j_alias_exit_code_present_symbol L316–318
+ TestJsonAlias class class TestJsonAlias L125–180
+ test_j_alias_exits_zero_file_forward method method test_j_alias_exits_zero_file_forward L128–130
+ test_j_alias_exits_zero_file_reverse method method test_j_alias_exits_zero_file_reverse L140–142
+ test_j_alias_exits_zero_symbol_forward method method test_j_alias_exits_zero_symbol_forward L148–150
+ test_j_alias_exits_zero_symbol_transitive method method test_j_alias_exits_zero_symbol_transitive L156–158
+ test_j_alias_has_by_depth_key method method test_j_alias_has_by_depth_key L160–162
+ test_j_alias_has_calls_key method method test_j_alias_has_calls_key L152–154
+ test_j_alias_has_imported_by_key method method test_j_alias_has_imported_by_key L144–146
+ test_j_alias_has_imports_key method method test_j_alias_has_imports_key L136–138
+ test_j_alias_same_imports_list_file_forward method method test_j_alias_same_imports_list_file_forward L175–180
+ test_j_alias_same_top_level_keys_file_forward method method test_j_alias_same_top_level_keys_file_forward L164–173
+ test_j_alias_valid_json_file_forward method method test_j_alias_valid_json_file_forward L132–134
+ TestPerformance class class TestPerformance L405–420
+ test_duration_ms_is_float_not_int method method test_duration_ms_is_float_not_int L418–420
+ test_json_duration_under_2000ms_file_forward method method test_json_duration_under_2000ms_file_forward L408–412
+ test_json_duration_under_2000ms_symbol method method test_json_duration_under_2000ms_symbol L414–416
+ TestTypedDicts class class TestTypedDicts L326–357
+ test_deps_file_json_typeddict_exists method method test_deps_file_json_typeddict_exists L329–330
+ test_deps_symbol_json_typeddict_exists method method test_deps_symbol_json_typeddict_exists L332–333
+ test_file_json_has_duration_ms_annotation method method test_file_json_has_duration_ms_annotation L339–341
+ test_file_json_has_exit_code_annotation method method test_file_json_has_exit_code_annotation L335–337
+ test_file_json_retains_path_annotation method method test_file_json_retains_path_annotation L351–353
+ test_symbol_json_has_duration_ms_annotation method method test_symbol_json_has_duration_ms_annotation L347–349
+ test_symbol_json_has_exit_code_annotation method method test_symbol_json_has_exit_code_annotation L343–345
+ test_symbol_json_retains_address_annotation method method test_symbol_json_retains_address_annotation L355–357
+ _SYMBOL variable variable _SYMBOL L41–41
+ _env function function _env L49–50
+ _run function function _run L53–54
+ deps_repo function function deps_repo L63–117
+ CliRunner import import CliRunner L37–37
+ annotations import import annotations L29–29
+ json import import json L31–31
+ pathlib import import pathlib L32–32
+ pytest import import pytest L35–35
+ textwrap import import textwrap L33–33
+ runner variable variable runner L39–39
~ muse/cli/commands/deps.py .py 4 symbols added, 2 symbols modified
+ _DepsFileJson class class _DepsFileJson L91–107
+ _DepsSymbolJson class class _DepsSymbolJson L110–134
+ TypedDict import import TypedDict L63–63
+ start_timer import import start_timer L69–69
~ run
← 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:06f2d3d2ce67f2a55e2e533132ba88a8c531321a49ed68e17bbcd906a108759e --body "your comment"