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

feat(symbols): supercharge with TypedDict, -j alias, and JSON envelope

- Add _SymbolsJson TypedDict with schema_version, exit_code, duration_ms - Add -j alias for --json (within mutually-exclusive group with --count) - _emit_json: inject schema_version, exit_code, duration_ms into output - Wire start_timer() in run(); pass duration_ms to _emit_json - Expand register() docstring listing all 8 arguments - Expand run() docstring documenting all JSON envelope fields - 91 new seven-tier tests: unit (_c, _normalise_language, _file_matches, _resolve_file_filter, _lang_counts, _print_human, _emit_json), integration, e2e, stress, data integrity, security, performance

sha256:87360db06eaa3d39cbffe427a62030a69c4425b320a24187f0e9d35987553856 sha
+132 ~3 symbols
sha256:17a0b383c112e3a3411cfa9d5c93752ce123f66183b3f92fb879b6e1f15bcc58 snapshot
+132
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes 135 symbols
~ tests/test_symbols_supercharge.py .py 127 symbols added
+ TestAliasRegistration class class TestAliasRegistration L424–441
+ test_j_alias_registered method method test_j_alias_registered L425–432
+ test_json_long_form_works method method test_json_long_form_works L434–441
+ TestColorHelper class class TestColorHelper L143–159
+ test_multiple_codes_all_applied method method test_multiple_codes_all_applied L155–159
+ test_no_tty_returns_plain_text method method test_no_tty_returns_plain_text L144–146
+ test_tty_wraps_with_ansi method method test_tty_wraps_with_ansi L148–153
+ TestDataIntegrity class class TestDataIntegrity L666–726
+ test_all_result_fields_present method method test_all_result_fields_present L679–685
+ test_duration_ms_nonnegative method method test_duration_ms_nonnegative L697–700
+ test_exit_code_is_int method method test_exit_code_is_int L692–695
+ test_file_filter_propagated_to_results method method test_file_filter_propagated_to_results L713–717
+ test_json_results_ordered_by_lineno method method test_json_results_ordered_by_lineno L673–677
+ test_kind_filter_propagated_to_results method method test_kind_filter_propagated_to_results L707–711
+ test_lang_counts_total_matches_total_symbols method method test_lang_counts_total_matches_total_symbols L719–726
+ test_schema_version_is_string method method test_schema_version_is_string L687–690
+ test_total_symbols_matches_results_length method method test_total_symbols_matches_results_length L667–671
+ test_working_tree_is_bool method method test_working_tree_is_bool L702–705
+ TestDocstrings class class TestDocstrings L444–460
+ test_register_mentions_json_alias method method test_register_mentions_json_alias L445–448
+ test_run_mentions_duration_ms method method test_run_mentions_duration_ms L454–456
+ test_run_mentions_exit_code method method test_run_mentions_exit_code L450–452
+ test_run_mentions_schema_version method method test_run_mentions_schema_version L458–460
+ TestEmitJson class class TestEmitJson L350–416
+ _tree method method _tree L351–363
+ test_emits_json_with_duration_ms method method test_emits_json_with_duration_ms L377–382
+ test_emits_json_with_exit_code method method test_emits_json_with_exit_code L371–375
+ test_emits_json_with_schema_version method method test_emits_json_with_schema_version L365–369
+ test_empty_map_emits_zero_results method method test_empty_map_emits_zero_results L411–416
+ test_result_entry_fields_complete method method test_result_entry_fields_complete L396–403
+ test_result_entry_has_path_field method method test_result_entry_has_path_field L390–394
+ test_total_symbols_correct method method test_total_symbols_correct L384–388
+ test_working_tree_false_propagated method method test_working_tree_false_propagated L405–409
+ TestEndToEnd class class TestEndToEnd L505–605
+ test_basic_exits_zero method method test_basic_exits_zero L506–507
+ test_basic_shows_symbols method method test_basic_shows_symbols L509–512
+ test_commit_head_exits_zero method method test_commit_head_exits_zero L572–575
+ test_count_and_json_mutually_exclusive method method test_count_and_json_mutually_exclusive L568–570
+ test_count_flag method method test_count_flag L514–519
+ test_file_filter method method test_file_filter L537–540
+ test_file_filter_no_match_shows_no_symbols method method test_file_filter_no_match_shows_no_symbols L542–545
+ test_hashes_flag method method test_hashes_flag L563–566
+ test_invalid_commit_ref_exits_nonzero method method test_invalid_commit_ref_exits_nonzero L603–605
+ test_invalid_kind_exits_nonzero method method test_invalid_kind_exits_nonzero L533–535
+ test_j_alias_works_in_cli method method test_j_alias_works_in_cli L597–601
+ test_json_result_path_field method method test_json_result_path_field L591–595
+ test_json_working_tree_false_with_commit method method test_json_working_tree_false_with_commit L584–589
+ test_json_working_tree_true_when_no_commit method method test_json_working_tree_true_when_no_commit L577–582
+ test_kind_class_filter class method test_kind_class_filter L521–525
+ test_kind_function_filter method method test_kind_function_filter L527–531
+ test_language_filter_case_insensitive method method test_language_filter_case_insensitive L552–556
+ test_language_filter_python method method test_language_filter_python L547–550
+ test_language_no_match_shows_no_symbols method method test_language_no_match_shows_no_symbols L558–561
+ TestFileMatches class class TestFileMatches L195–220
+ test_deep_path_suffix_matches method method test_deep_path_suffix_matches L218–220
+ test_exact_path_matches method method test_exact_path_matches L196–198
+ test_no_match_returns_false method method test_no_match_returns_false L209–211
+ test_partial_name_does_not_match method method test_partial_name_does_not_match L204–207
+ test_suffix_with_slash_anchor_matches method method test_suffix_with_slash_anchor_matches L200–202
+ test_windows_backslash_normalised method method test_windows_backslash_normalised L213–216
+ TestJsonAlias class class TestJsonAlias L487–497
+ test_j_parity_with_json method method test_j_parity_with_json L488–497
+ TestJsonEnvelope class class TestJsonEnvelope L463–484
+ test_duration_ms_is_float method method test_duration_ms_is_float L474–478
+ test_exit_code_zero method method test_exit_code_zero L469–472
+ test_schema_version_nonempty_string method method test_schema_version_nonempty_string L480–484
+ test_schema_version_present method method test_schema_version_present L464–467
+ TestLangCounts class class TestLangCounts L261–286
+ _tree method method _tree L262–264
+ test_empty_map_returns_empty method method test_empty_map_returns_empty L279–281
+ test_multiple_files_summed_per_language method method test_multiple_files_summed_per_language L271–277
+ test_single_python_file method method test_single_python_file L266–269
+ test_unknown_extension_grouped_correctly method method test_unknown_extension_grouped_correctly L283–286
+ TestNormaliseLanguage class class TestNormaliseLanguage L167–187
+ test_python_lowercase_normalised method method test_python_lowercase_normalised L168–170
+ test_python_mixed_normalised method method test_python_mixed_normalised L176–178
+ test_python_uppercase_normalised method method test_python_uppercase_normalised L172–174
+ test_strips_whitespace method method test_strips_whitespace L184–187
+ test_unknown_language_returned_unchanged method method test_unknown_language_returned_unchanged L180–182
+ TestPerformance class class TestPerformance L782–795
+ test_10000_file_matches_under_500ms method method test_10000_file_matches_under_500ms L783–789
+ test_duration_ms_under_30000ms method method test_duration_ms_under_30000ms L791–795
+ TestPrintHuman class class TestPrintHuman L294–342
+ test_empty_map_prints_no_symbols method method test_empty_map_prints_no_symbols L295–299
+ test_non_empty_map_shows_file_and_symbol method method test_non_empty_map_shows_file_and_symbol L301–315
+ test_show_hashes_appends_hash_suffix method method test_show_hashes_appends_hash_suffix L317–330
+ test_summary_line_shows_count method method test_summary_line_shows_count L332–342
+ TestResolveFileFilter class class TestResolveFileFilter L228–253
+ _manifest method method _manifest L229–230
+ test_ambiguous_raises_system_exit method method test_ambiguous_raises_system_exit L247–253
+ test_exact_match_returns_path method method test_exact_match_returns_path L232–235
+ test_no_match_returns_none method method test_no_match_returns_none L242–245
+ test_suffix_match_returns_full_path method method test_suffix_match_returns_full_path L237–240
+ TestSecurity class class TestSecurity L734–774
+ test_ansi_in_file_filter_does_not_crash method method test_ansi_in_file_filter_does_not_crash L735–737
+ test_file_matches_with_ansi_in_path method method test_file_matches_with_ansi_in_path L747–752
+ test_hostile_detail_survives_json_serialisation method method test_hostile_detail_survives_json_serialisation L754–770
+ test_sql_injection_in_file_filter_does_not_crash method method test_sql_injection_in_file_filter_does_not_crash L743–745
+ test_unicode_in_file_filter_does_not_crash method method test_unicode_in_file_filter_does_not_crash L772–774
+ test_very_long_language_does_not_crash method method test_very_long_language_does_not_crash L739–741
+ TestStress class class TestStress L613–658
+ test_10000_normalise_language_calls method method test_10000_normalise_language_calls L619–623
+ test_1000_file_matches_calls method method test_1000_file_matches_calls L614–617
+ test_concurrent_file_matches method method test_concurrent_file_matches L644–658
+ test_emit_json_500_symbol_map method method test_emit_json_500_symbol_map L625–642
+ TestTypedDict class class TestTypedDict L115–135
+ test_has_core_fields method method test_has_core_fields L131–135
+ test_has_duration_ms method method test_has_duration_ms L127–129
+ test_has_exit_code method method test_has_exit_code L123–125
+ test_has_schema_version method method test_has_schema_version L119–121
+ test_symbols_json_typeddict_exists method method test_symbols_json_typeddict_exists L116–117
+ _commit function function _commit L46–57
+ _invoke function function _invoke L60–66
+ _syms function function _syms L69–70
+ CliRunner import import CliRunner L36–36
+ InvokeResult import import InvokeResult L36–36
+ annotations import import annotations L24–24
+ get_type_hints import import get_type_hints L32–32
+ json import import json L26–26
+ os import import os L27–27
+ pathlib import import pathlib L28–28
+ pytest import import pytest L34–34
+ textwrap import import textwrap L29–29
+ threading import import threading L30–30
+ time import import time L31–31
+ runner variable variable runner L38–38
+ sym_repo function function sym_repo L74–107
~ muse/cli/commands/symbols.py .py 5 symbols added, 3 symbols modified
+ _SymbolsJson class class _SymbolsJson L88–95
+ Any import import Any L70–70
+ TypedDict import import TypedDict L70–70
+ __version__ import import __version__ L72–72
+ start_timer import import start_timer L83–83
~ 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:87360db06eaa3d39cbffe427a62030a69c4425b320a24187f0e9d35987553856 --body "your comment"