gabriel / muse public
feat patch feat/54-reflog-anchor #1 / 1
AI Agent gabriel · 8 hours ago · Oct 21, 2026 · Diff

feat: muse#54 item 8 — muse reflog anchor COMMIT

Adds `muse reflog anchor COMMIT [--json]`: given a commit ID, searches the HEAD log and every branch's reflog for entries whose new_id matches the target commit, reporting the owning ref and @{N} index of each match. Answers "how did I get to this commit, and from how many different paths?" for post-mortem analysis of complex rebase sequences.

Accepts both sha256:<hex> and bare hex via the existing long_id() normalizer.

Covered by tests/test_reflog_anchor.py (5 cases: HEAD-log match, named-branch-log match, unmatched commit returns empty, bare-hex input normalization, correct index isolation between commits). Confirmed genuine RED by reverting the fix file and re-running (all 5 failed, exit 2, unrecognized subcommand), then GREEN with the fix restored plus the full reflog regression suite (108 passed, zero regressions). Live-verified via muse-dev against a disposable /tmp sandbox.

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

sha256:0471c16969dec806b1879428130fb224c414a8ae6ac98a4b567f1b00cfebe6d2 sha
+22 ~4 symbols
3 changed · 1226 in snapshot files
sha256:2d73e9883fd71286762fe47a4ddaf1998d97e109e33828f0d2bf485571637400 snapshot
+22
symbols added
~4
symbols modified
3
files changed
1226
files in snapshot
0
dead code introduced
Semantic Changes 26 symbols
~ tests/test_reflog_anchor.py .py 19 symbols added
+ TestReflogAnchor class class TestReflogAnchor L53–108
+ test_accepts_bare_hex_without_prefix method method test_accepts_bare_hex_without_prefix L86–95
+ test_finds_commit_on_head_log method method test_finds_commit_on_head_log L54–64
+ test_finds_commit_on_named_branch_log method method test_finds_commit_on_named_branch_log L66–73
+ test_second_commit_not_anchored_at_first_commits_index method method test_second_commit_not_anchored_at_first_commits_index L97–108
+ test_unmatched_commit_returns_empty method method test_unmatched_commit_returns_empty L75–84
+ _commit_file function function _commit_file L44–50
+ _env function function _env L20–21
+ _init_repo function function _init_repo L28–41
+ _run function function _run L24–25
+ cli variable variable cli L16–16
+ CliRunner import import CliRunner L12–12
+ Manifest import import Manifest L13–13
+ annotations import import annotations L7–7
+ fake_id import import fake_id L13–13
+ json import import json L9–9
+ muse_dir import import muse_dir L14–14
+ pathlib import import pathlib L10–10
+ runner variable variable runner L17–17
~ muse/cli/commands/reflog.py .py 3 symbols added, 1 symbol modified
+ _AnchorJson class class _AnchorJson L160–165
+ _AnchorMatchJson class class _AnchorMatchJson L150–158
+ run_anchor function function run_anchor L883–960
Files Changed
+1 ~2
1226 in snapshot
← Older Oldest on feat/54-reflog-anchor
All commits
Newer → Latest on feat/54-reflog-anchor

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