gabriel / muse public
feat patch phase6 task/phase1-merge-engine #8 / 16
AI Agent gabriel · 14 hours ago · Jun 11, 2026 · Diff

feat(phase6): unified MergeEngine code path via run_merge()

- Add run_merge() to muse/core/merge_engine.py — pure function shared by CLI and server; handles all four diff_units and three resolution policies - Add ours/theirs entries to STRATEGY_MAP so --strategy ours/theirs routes correctly without alias-expansion side effects on reported_strategy - Remove alias expansion at execute() level that was shadowing reported_strategy - Replace Case 3 in muse/cli/commands/merge.py with run_merge() call - Replace Case 4 in muse/cli/commands/merge.py with run_merge() call; remove dead base_snap_obj/ours_snap_obj/theirs_snap_obj assignments - Add tests/test_phase6_unified_merge_engine.py — 12 tests covering all diff_units, resolution policies, clean merges, and musehub canonical routes - Fix snapshot diff_unit plugin path: plugin always gets real base (not {}), keeping old three_way behaviour for plugin-aware merges

sha256:ecfc7b5d19db951f256942ac0908b53d55a2da37c6cd1e6cf85b4a6088870865 sha
+25 ~10 symbols
sha256:dbd9ee4a081ad8a38fc05bf29ea52550360ee78fbc55f75c839108dc57d66436 snapshot
+25
symbols added
~10
symbols modified
0
dead code introduced
Semantic Changes 35 symbols
+ BASE variable variable BASE L26–30
+ OURS variable variable OURS L32–37
+ THEIRS variable variable THEIRS L39–44
+ _oid function function _oid L22–23
+ MergeEngine import import MergeEngine L15–15
+ STRATEGY_MAP import import STRATEGY_MAP L15–15
+ annotations import import annotations L8–8
+ pytest import import pytest L13–13
+ run_merge import import run_merge L15–15
+ sys import import sys L10–10
+ types import import types L11–11
+ test_ME_01_three_way_escalate_conflicts function function test_ME_01_three_way_escalate_conflicts L51–62
+ test_ME_02_three_way_prefer_ours function function test_ME_02_three_way_prefer_ours L69–74
+ test_ME_03_three_way_prefer_theirs function function test_ME_03_three_way_prefer_theirs L81–85
+ test_ME_04_snapshot_prefer_theirs function function test_ME_04_snapshot_prefer_theirs L92–101
+ test_ME_05_snapshot_escalate function function test_ME_05_snapshot_escalate L108–112
+ test_ME_06_replay_ours function function test_ME_06_replay_ours L119–127
+ test_ME_07_replay_theirs function function test_ME_07_replay_theirs L134–142
+ test_ME_08_strategy_map_entries function function test_ME_08_strategy_map_entries L149–155
+ test_ME_09_clean_merge_no_conflicts function function test_ME_09_clean_merge_no_conflicts L162–170
+ test_ME_10_musehub_overlay_via_run_merge function function test_ME_10_musehub_overlay_via_run_merge L177–191
+ test_ME_11_musehub_recursive_surfaces_conflicts function function test_ME_11_musehub_recursive_surfaces_conflicts L194–205
+ test_ME_12_musehub_replay_applies_from_delta function function test_ME_12_musehub_replay_applies_from_delta L208–219
~ muse/cli/commands/merge.py .py 1 symbol added, 9 symbols modified
~ muse/core/merge_engine.py .py 1 symbol added, 1 symbol modified
+ run_merge function function run_merge L640–811

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