feat: reflog entries for tag/release creation, muse reflog --tag (muse#54 item 5)
`muse tag add` and `muse release add` moved refs/tags/*-equivalent pointers with zero reflog trace -- exactly the gap this item describes.
Added a parallel reflog namespace for tags (.muse/logs/refs/tags/, mirroring .muse/logs/refs/heads/ for branches) with its own append_tag_reflog()/read_tag_reflog() pair in muse/core/reflog.py. Deliberately does NOT also write to the HEAD log the way append_reflog() does for branches: tagging doesn't move HEAD, so it has no business appearing in `muse reflog`'s default view.
`muse tag add` logs every call (new tag -- old_id=None -- or a re-point -- old_id=the previous commit_id), since `tag add`'s own semantics already allow silently repointing an existing tag to a different commit (confirmed by reading run_add: commit_id is always the newly-resolved ref, "existing" only preserves created_at/author/message). `muse release add` only ever creates (it already rejects an existing release for the same tag before reaching this point), so always logs old_id=None.
`muse reflog --tag <name>` reads the new namespace, mutually exclusive with --branch/--all (mixing ref-type filters doesn't make sense). Follows the exact same read_reflog()-based JSON contract as the branch case, just pointed at refs/tags/<name> instead of refs/heads/<name>.
New tests/test_tag_reflog.py (8): new tag logs a creation entry (old_id=all-zeros), re-pointing an existing tag logs both the old and new commit, tagging never pollutes the HEAD/branch reflog, a new release logs a creation entry, a draft release's operation notes "(draft)", `reflog --tag` returns the tag's own history, --tag + --branch together is rejected, and a tag that was never created returns an empty (not erroring) result. Confirmed genuine RED (7/8 failed -- ImportError on read_tag_reflog, unrecognized --tag flag) before GREEN with the fix restored.
Targeted regression suite -- the new file plus test_core_reflog.py, test_cmd_reflog.py, test_cmd_reflog_hardening.py, test_cmd_version_tags.py, test_release.py, test_cmd_release_hardening.py, test_release_tag_crosslink.py -- all pass (409 passed), zero regressions.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Semantic Changes
51 symbols
Files Changed
+1
~6
1223 in snapshot
0 comments
muse hub commit comment sha256:5b6ba190e9a1ab3db0166f2ff1b4881ccdcea6449081b77deccc4910954f734b --body "your comment"
No comments yet. Be the first to start the discussion.