gabriel / muse public
feat patch feat/53-checkout-symbol-symlog-ref #1 / 1
AI Agent gabriel · 12 hours ago · Oct 22, 2026 · Diff

feat: muse#53 item 7 — checkout-symbol accepts embedded symlog @{N} ref

`muse code checkout-symbol ADDRESS --commit REF` already existed (restores one symbol's body surgically into the working tree from a historical commit), but required --commit REF for every call even though a symlog ref already resolves to a commit internally. This item makes ADDRESS able to embed the symlog ref directly:

muse code checkout-symbol "file.py::Symbol@{N}"

— the natural extension of `muse code cat`/`muse symlog resolve`'s addr@{N} syntax: cat reads, checkout-symbol restores. Resolved via the existing resolve_symlog_addr(), which returns None for a plain address (no @{...} suffix) so the original --commit-required path is entirely unchanged for backward compatibility. Passing both an @{N}-embedding ADDRESS and --commit together is rejected as ambiguous.

No new top-level `muse checkout-symbol` alias was added — the command already lives at `muse code checkout-symbol` and one name per command is the workspace convention; the followup doc for this item notes the actual command path explicitly since the ticket heading assumed a bare top-level name that was never real.

Covered by tests/test_checkout_symbol_symlog_ref.py (6 cases: restores an older version via @{1}, @{0} is a no-op matching the current body, embedding @{N} alongside --commit errors as ambiguous, an out-of-range index errors, non-regression of the plain-address-without-commit error path, non-regression of the original --commit REF form). Confirmed genuine RED by reverting the fix file and re-running (2 of 6 failed with argparse exit 2, since --commit was previously required=True; the other 4 passed incidentally since they already expected non-zero exits for other reasons), then GREEN with the fix restored plus the full checkout-symbol regression suite (106 tests, zero regressions). Live-verified via muse-dev against a disposable /tmp sandbox: checking out "billing.py::compute@{1}" correctly restored the pre-"* 2" body while leaving surrounding code untouched.

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

sha256:b1e8171f3a34834bb8eb9b5a111e9365ae9735403e6ed67b7177ecfea9a1f548 sha
+19 ~4 −1 symbols
3 changed · 1239 in snapshot files
sha256:fc112e31c5b4120d39724d2ebb02a12d38fd764b959001e58c6363ed6dbe4f4d snapshot
+19
symbols added
~4
symbols modified
−1
symbol removed
3
files changed
1239
files in snapshot
0
dead code introduced
Semantic Changes 24 symbols
+ TestCheckoutSymbolWithSymlogRef class class TestCheckoutSymbolWithSymlogRef L51–105
+ test_at_index_0_is_a_noop method method test_at_index_0_is_a_noop L65–74
+ test_out_of_range_index_errors method method test_out_of_range_index_errors L85–89
+ test_plain_address_with_commit_still_works method method test_plain_address_with_commit_still_works L98–105
+ test_plain_address_without_commit_still_errors method method test_plain_address_without_commit_still_errors L91–96
+ test_restores_older_version_via_symlog_ref method method test_restores_older_version_via_symlog_ref L52–63
+ test_symlog_ref_and_commit_flag_together_errors method method test_symlog_ref_and_commit_flag_together_errors L76–83
+ cli variable variable cli L18–18
+ CliRunner import import CliRunner L16–16
+ annotations import import annotations L8–8
+ json import import json L10–10
+ pathlib import import pathlib L11–11
+ pytest import import pytest L14–14
+ textwrap import import textwrap L12–12
+ repo function function repo L23–28
+ runner variable variable runner L19–19
+ two_commit_repo function function two_commit_repo L32–48
~ docs/issues/symlog-followup.md .md 1 symbol added, 1 symbol removed, 2 symbols modified
− Symbol@{N}" section 7. muse checkout-symbol "file.py::Symbol@{N}" L73–79
+ Symbol@{N}" ✅ IMPLEMENTED section 7. muse checkout-symbol "file.py::Symbol@{N}" ✅ IMPLEMENTED L73–88
~ muse/cli/commands/checkout_symbol.py .py 1 symbol added, 2 symbols modified
+ resolve_symlog_addr import import resolve_symlog_addr L102–102
~ run
Files Changed
+1 ~2
1239 in snapshot
← Older Oldest on feat/53-checkout-symbol-symlog-ref
All commits
Newer → Latest on feat/53-checkout-symbol-symlog-ref

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