gabriel / muse public
feat patch cat task/cat-supercharge #1 / 1
AI Agent gabriel · 161 days ago · Apr 16, 2026 · Diff

feat(cat): supercharge with --raw, --limit, total_symbols, redirected_from; fix fmt NameError

- --raw flag: read raw file content at working tree or --at <ref>; single-file JSON returns flat {file_path, content, size_bytes, source_ref}; multi-file uses {files:[]} - --limit N: cap --all results; JSON includes truncated: bool + total_symbols - total_symbols: always in --all --json output (pre-filter count, stable across --kind) - redirected_from: JSON field on results that came from global-fallback (wrong file specified) - Fix UnboundLocalError: fmt/as_json now assigned before the 'no addresses' guard - Fix test_blob_not_found: fake manifest used bare hex, needs sha256: prefix - 40 new tests in test_cmd_cat_supercharged.py, all green

sha256:6a6d2b4a0aebae5547a9ffb0656bc757a6d868c03aeda82cd242789010ff6d9d sha
+80 ~4 symbols
sha256:44a1a0c57665414834be024e7f9563bc98bdbfdea1b8d596de85919411bbca23 snapshot
+80
symbols added
~4
symbols modified
0
dead code introduced
Semantic Changes 84 symbols
~ tests/test_cmd_cat_supercharged.py .py 80 symbols added
+ TestAllJsonTotalSymbols class class TestAllJsonTotalSymbols L326–376
+ test_all_json_has_total_symbols method method test_all_json_has_total_symbols L327–333
+ test_all_json_kind_filter_shows_unfiltered_total method method test_all_json_kind_filter_shows_unfiltered_total L343–360
+ test_all_json_total_symbols_count method method test_all_json_total_symbols_count L335–341
+ test_all_json_total_symbols_stable_across_filters method method test_all_json_total_symbols_stable_across_filters L362–376
+ TestAllLimit class class TestAllLimit L384–453
+ _big_repo method method _big_repo L385–389
+ test_limit_caps_results method method test_limit_caps_results L391–398
+ test_limit_larger_than_results_not_truncated method method test_limit_larger_than_results_not_truncated L416–425
+ test_limit_sets_truncated_true method method test_limit_sets_truncated_true L400–406
+ test_limit_text_mode_respects_cap method method test_limit_text_mode_respects_cap L437–445
+ test_limit_without_all_is_ignored method method test_limit_without_all_is_ignored L447–453
+ test_limit_zero_shows_zero_results method method test_limit_zero_shows_zero_results L427–435
+ test_no_limit_truncated_false method method test_no_limit_truncated_false L408–414
+ TestCatRawHistorical class class TestCatRawHistorical L279–318
+ test_raw_at_bad_ref_exits_one method method test_raw_at_bad_ref_exits_one L314–318
+ test_raw_at_first_commit method method test_raw_at_first_commit L280–293
+ test_raw_at_json_source_ref_has_commit method method test_raw_at_json_source_ref_has_commit L302–312
+ test_raw_head_has_updated_content method method test_raw_head_has_updated_content L295–300
+ TestCatRawSecurity class class TestCatRawSecurity L511–537
+ test_raw_ansi_injection_in_path_sanitized method method test_raw_ansi_injection_in_path_sanitized L524–531
+ test_raw_path_traversal_rejected method method test_raw_path_traversal_rejected L533–537
+ test_raw_symlink_rejected method method test_raw_symlink_rejected L512–522
+ TestCatRawUnit class class TestCatRawUnit L192–271
+ test_raw_and_symbol_address_are_mutually_exclusive method method test_raw_and_symbol_address_are_mutually_exclusive L264–271
+ test_raw_full_file_not_just_symbols method method test_raw_full_file_not_just_symbols L198–203
+ test_raw_json_content_matches_file method method test_raw_json_content_matches_file L222–228
+ test_raw_json_schema method method test_raw_json_schema L211–220
+ test_raw_json_size_bytes_correct method method test_raw_json_size_bytes_correct L230–236
+ test_raw_json_source_ref_working_tree method method test_raw_json_source_ref_working_tree L238–243
+ test_raw_multiple_files method method test_raw_multiple_files L245–262
+ test_raw_outputs_file_content method method test_raw_outputs_file_content L193–196
+ test_raw_untracked_file_exits_one method method test_raw_untracked_file_exits_one L205–209
+ TestDataIntegrity class class TestDataIntegrity L545–610
+ test_all_symbols_cover_all_defs method method test_all_symbols_cover_all_defs L584–594
+ test_at_ref_gives_different_content_than_head method method test_at_ref_gives_different_content_than_head L556–574
+ test_limit_preserves_lineno_order method method test_limit_preserves_lineno_order L596–610
+ test_raw_content_equals_disk_bytes method method test_raw_content_equals_disk_bytes L576–582
+ test_symbol_source_matches_file_bytes method method test_symbol_source_matches_file_bytes L546–554
+ TestFmtBugFix class class TestFmtBugFix L164–184
+ test_no_address_json_contains_error_key method method test_no_address_json_contains_error_key L179–184
+ test_no_address_json_flag_no_unbound_error method method test_no_address_json_flag_no_unbound_error L165–172
+ test_no_address_text_mode_no_crash method method test_no_address_text_mode_no_crash L174–177
+ TestPerformance class class TestPerformance L618–655
+ large_repo method method large_repo L620–624
+ test_limit_10_faster_than_all method method test_limit_10_faster_than_all L635–646
+ test_raw_json_200_symbols_file_under_1s method method test_raw_json_200_symbols_file_under_1s L648–655
+ test_raw_large_file_under_1s method method test_raw_large_file_under_1s L626–633
+ TestRedirectedFrom class class TestRedirectedFrom L461–503
+ test_json_global_fallback_has_redirected_from method method test_json_global_fallback_has_redirected_from L462–486
+ test_text_fallback_still_prints_note method method test_text_fallback_still_prints_note L488–503
+ _REPO_ID variable variable _REPO_ID L40–40
+ _SIMPLE_PY variable variable _SIMPLE_PY L111–121
+ _UPDATED_PY variable variable _UPDATED_PY L123–133
+ _add_file function function _add_file L68–75
+ _counter variable variable _counter L41–41
+ _env function function _env L64–65
+ _init_repo function function _init_repo L53–61
+ _make_commit function function _make_commit L78–108
+ _sha function function _sha L49–50
+ cli variable variable cli L37–37
+ CliRunner import import CliRunner L30–30
+ CommitRecord import import CommitRecord L33–33
+ SnapshotRecord import import SnapshotRecord L33–33
+ annotations import import annotations L21–21
+ compute_commit_id import import compute_commit_id L32–32
+ compute_snapshot_id import import compute_snapshot_id L32–32
+ datetime import import datetime L34–34
+ hashlib import import hashlib L35–35
+ json import import json L23–23
+ pathlib import import pathlib L24–24
+ pytest import import pytest L28–28
+ textwrap import import textwrap L25–25
+ time import import time L26–26
+ write_commit import import write_commit L33–33
+ write_object import import write_object L31–31
+ write_snapshot import import write_snapshot L33–33
+ repo function function repo L142–145
+ runner variable variable runner L38–38
+ two_commit_repo function function two_commit_repo L149–156
~ muse/cli/commands/cat.py .py 2 symbols modified
← Older Oldest on task/cat-supercharge
All commits
Newer → Latest on task/cat-supercharge

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:6a6d2b4a0aebae5547a9ffb0656bc757a6d868c03aeda82cd242789010ff6d9d --body "your comment"