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]>
Semantic Changes
24 symbols
Files Changed
+1
~2
1239 in snapshot
0 comments
muse hub commit comment sha256:b1e8171f3a34834bb8eb9b5a111e9365ae9735403e6ed67b7177ecfea9a1f548 --body "your comment"
No comments yet. Be the first to start the discussion.