feat: implement muse rerere — reuse recorded conflict resolutions
Adds domain-agnostic rerere (Reuse Recorded Resolution) to Muse VCS. Fingerprints conflicts by a SHA-256 of the sorted ours/theirs object ID pair (commutative, content-addressed) and replays cached resolutions automatically on future identical conflicts.
New modules: - muse/core/rerere.py — fingerprinting, atomic preimage/resolution I/O, auto_apply(), record_resolutions(), list/forget/clear/gc operations - muse/cli/commands/rerere.py — muse rerere [record|status|forget|clear|gc] with --dry-run, --format (text|json), --yes flags; full short+long forms
Protocol extension (non-breaking): - domain.py: RererePlugin optional sub-protocol with conflict_fingerprint() method; falls back to the default content fingerprint when absent
Integration: - merge.py: auto-applies cached rerere resolutions before writing MERGE_STATE.json; records preimages for remaining conflicts; adds --rerere-autoupdate/--no-rerere-autoupdate flag - commit.py: records user resolutions after a merge commit and clears MERGE_STATE.json (previously never cleared)
Storage: .muse/rr-cache/<fingerprint>/{meta.json, resolution} All I/O uses UTF-8 encoding and atomic writes (temp + os.replace).
Tests: 57 new tests covering fingerprinting, preimage lifecycle, apply_cached, auto_apply, record_resolutions, bulk ops, CLI commands, and the RererePlugin protocol — all passing; 2609 total tests green. mypy strict: 0 errors. typing_audit --max-any 0: 0 violations.
No comments yet. Be the first to start the discussion.