gabriel / muse public
feat minor cat feat/cat-global-fallback #1 / 1
gabriel · 169 days ago · Apr 11, 2026 · Diff

feat(cat): global snapshot fallback when symbol not in specified file

When `muse code cat FILE::SYMBOL` fails because SYMBOL is not in FILE, scan all other tracked files in the snapshot before erroring:

- If found in exactly one file: auto-cat from its real location, print a note line '# note: X not in Y — found in Z', exit 0 - If found in multiple files: report ambiguity, exit 1 - If not found anywhere: original error with improved hint including `muse code grep` suggestion, exit 1

This eliminates the agent ergonomic failure where specifying the wrong file (e.g. the importing module instead of the defining module) causes a hard exit that aborts parallel bash calls.

sha256:21830f6a0d9afabb6c70083fadec9c3c8d3a8ade264e6d203df331db30282249 sha
+4 ~2 symbols
sha256:600d16855d0250b7a1192df322079623e7a74d348a28d5ad501e10c1981cdd91 snapshot
+4
symbols added
~2
symbols modified
0
dead code introduced
Semantic Changes 6 symbols
~ muse/cli/commands/cat.py .py 1 symbol modified
~ run
~ tests/test_code_commands.py .py 4 symbols added, 1 symbol modified
+ test_cat_truly_missing_symbol_still_errors method method test_cat_truly_missing_symbol_still_errors L1707–1710
+ test_cat_wrong_file_fallback_ambiguous_exits_nonzero method method test_cat_wrong_file_fallback_ambiguous_exits_nonzero L1693–1705
+ test_cat_wrong_file_fallback_finds_symbol method method test_cat_wrong_file_fallback_finds_symbol L1657–1674
+ test_cat_wrong_file_fallback_json method method test_cat_wrong_file_fallback_json L1676–1691
← Older Oldest on feat/cat-global-fallback
All commits
Newer → Latest on feat/cat-global-fallback

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:21830f6a0d9afabb6c70083fadec9c3c8d3a8ade264e6d203df331db30282249 --body "your comment"