gabriel / muse public
feat patch feat/53-revert-symlog #1 / 1
AI Agent gabriel · 1 day ago · Oct 22, 2026 · Diff

feat: muse#53 item 11 — symlog entries for muse revert

`muse revert` writes its own CommitRecord directly via write_commit() rather than going through muse commit's run() function, so it bypassed the _write_symlogs() call entirely — a revert that restored a prior symbol body left no trace in that symbol's journal, even though it already wrote a reflog entry for the branch ref move.

Fixes by calling the exact same _write_symlogs() helper commit.py uses, right after revert's own append_reflog() call, with the same non-fatal try/except wrapping (a symlog write failure must never fail a revert, matching commit.py's established pattern). --no-commit mode (stages changes without creating a commit) correctly does not call this — there's no commit for a symlog entry to attach to yet.

Covered by tests/test_revert_symlog.py (2 cases: a revert of a symbol-modifying commit produces a new symbol-modified entry in that symbol's journal; --no-commit mode does not write one). Confirmed genuine RED by reverting the fix file and re-running (the symlog-entry assertion failed, total stayed at 2 instead of 3; the --no-commit case passed incidentally since it asserts absence of a change), then GREEN with the fix restored plus the full revert + symlog regression suite (218 tests, zero regressions). Live-verified via muse-dev against a disposable /tmp sandbox: reverting a "double the total" commit produced a `symbol-modified: Revert "double"` symlog entry as expected.

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

sha256:46b7d9d1e17a4f87e7330dc6cfadab13241976587bc6b855cc2682667c95183e sha
+17 ~4 symbols
3 changed · 1237 in snapshot files
sha256:f0910d3575a214bb55edb7ada3c82d5c27cfad5cc872f730ca84dc1b589d523d snapshot
+17
symbols added
~4
symbols modified
3
files changed
1237
files in snapshot
0
dead code introduced
Semantic Changes 21 symbols
~ tests/test_revert_symlog.py .py 16 symbols added
+ TestRevertWritesSymlog class class TestRevertWritesSymlog L53–90
+ test_revert_no_commit_does_not_write_symlog method method test_revert_no_commit_does_not_write_symlog L74–90
+ test_revert_of_symbol_modifying_commit_writes_symlog_entry method method test_revert_of_symbol_modifying_commit_writes_symlog_entry L54–72
+ _commit function function _commit L42–46
+ _env function function _env L23–24
+ _symlog function function _symlog L49–50
+ _write function function _write L36–39
+ cli variable variable cli L19–19
+ CliRunner import import CliRunner L17–17
+ Mapping import import Mapping L13–13
+ annotations import import annotations L9–9
+ json import import json L11–11
+ pathlib import import pathlib L12–12
+ pytest import import pytest L15–15
+ repo function function repo L28–33
+ runner variable variable runner L20–20
~ muse/cli/commands/revert.py .py 1 symbol added, 1 symbol modified
+ _write_symlogs import import _write_symlogs L81–81
~ run
Files Changed
+1 ~2
1237 in snapshot
← Older Oldest on feat/53-revert-symlog
All commits
Newer → Latest on feat/53-revert-symlog

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