gabriel / muse public
feat BREAKING feat/53-symlog-show #1 / 1
AI Agent gabriel · 10 hours ago · Oct 22, 2026 · Diff

feat: muse#53 item 9 — muse symlog show

Adds `muse symlog show "file.py::Symbol@{N}" [--follow] [--json]`: a human-focused convenience view equivalent to `muse code cat "addr@{N}"`, printing a header (commit, author, timestamp, operation) before the full reconstructed symbol body — avoids a second lookup for interactive exploration ("show me what this function looked like two changes ago").

Reuses resolve_symlog_addr() + resolve_symbol_body() exactly like run_resolve() does, with one core addition: SymlogResolution gained an `author: str = ""` field (both of its two construction sites in resolve_symlog_addr() now populate it from the underlying entry) since the existing resolution type didn't expose it and `show`'s header needs it. Purely additive on a frozen dataclass with a default, so the two existing call sites needed no changes.

Covered by tests/test_cmd_symlog_show.py (6 cases: body+metadata returned correctly, older index returns older body content, missing symbol errors, out-of-range index errors, invalid ref form (missing @{N}) errors, text-mode prints header and body). Confirmed genuine RED by reverting both changed files and re-running (3 of 6 failed — the success-path cases — while the 3 error-path cases passed incidentally via the pre-existing unrecognized-subcommand fallback), then GREEN with the fix restored plus the full symlog regression suite (222 tests across stat/read/lifecycle/refs/core/commit-integration, zero regressions). Live-verified via muse-dev against a disposable /tmp sandbox (older and newer index both reconstructed the correct body text, text and --json modes both checked).

Co-Authored-By: Claude Sonnet 5 <[email protected]>

sha256:d094fde565da48ec3c284d1be24d39c85f9b3b57dc25f9e66773128aabf7b063 sha
+22 ~6 symbols
4 changed · 1233 in snapshot files
sha256:a70bc4b40f92beb2b6e30fcf25841c825424529d76f4c9e65118785d43a20ca7 snapshot
+22
symbols added
~6
symbols modified
4
files changed
1233
files in snapshot
0
dead code introduced
Semantic Changes 28 symbols
~ tests/test_cmd_symlog_show.py .py 20 symbols added
+ TestSymlogShow class class TestSymlogShow L62–115
+ test_show_at_older_index_returns_older_body method method test_show_at_older_index_returns_older_body L78–88
+ test_show_invalid_ref_form_errors method method test_show_invalid_ref_form_errors L102–105
+ test_show_missing_symbol_errors method method test_show_missing_symbol_errors L90–93
+ test_show_out_of_range_index_errors method method test_show_out_of_range_index_errors L95–100
+ test_show_returns_body_and_metadata method method test_show_returns_body_and_metadata L63–76
+ test_show_text_mode_prints_header_and_body method method test_show_text_mode_prints_header_and_body L107–115
+ _commit function function _commit L40–50
+ _init_repo function function _init_repo L29–31
+ _invoke function function _invoke L20–26
+ _make_repo function function _make_repo L53–55
+ _symlog function function _symlog L58–59
+ _write_file function function _write_file L34–37
+ CliRunner import import CliRunner L15–15
+ annotations import import annotations L8–8
+ json import import json L10–10
+ os import import os L11–11
+ pathlib import import pathlib L12–12
+ textwrap import import textwrap L13–13
+ runner variable variable runner L17–17
~ muse/cli/commands/symlog.py .py 2 symbols added, 1 symbol modified
+ _ShowJson class class _ShowJson L181–191
+ run_show function function run_show L1041–1157
~ run
Files Changed
+1 ~3
1233 in snapshot
← Older Oldest on feat/53-symlog-show
All commits
Newer → Latest on feat/53-symlog-show

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