gabriel / muse public
fix BREAKING merge task/fix-manual-merge-false-conflicts #1 / 1
AI Agent gabriel · 160 days ago · Apr 16, 2026 · Diff

fix(merge): manual attribute strategy must not fire when l == r (false conflicts)

When both branches agree on a file — whether neither touched it (b == l == r) or both independently made the same edit (b != l == r) — the 'manual' strategy in .museattributes was incorrectly adding those paths to the conflict list.

Root cause: the l == r block in CodePlugin.merge() applied the manual override unconditionally ('even on clean paths'), producing false conflicts for every file matching a manual rule, regardless of whether either branch changed it.

Fix: remove the manual override from the l == r branch entirely. manual now only fires when at least one side diverged (elif b == l, elif b == r, or else).

Tests: 6 new tests in TestManualStrategyUnchangedFiles pin the exact semantics. Also fixes pre-existing TestMergeStateIO.test_write_and_read (sha256: prefix).

sha256:eb3fbe2610a12e6d13e780e83ae465c948ed9bc9ca575208b64d0daa978886cd sha
+15 ~5 symbols
sha256:35a9d01916fd0e8ee552a69f47660488715f87d61f018b8d3bf02ed2c43d5a00 snapshot
+15
symbols added
~5
symbols modified
0
dead code introduced
Semantic Changes 20 symbols
~ muse/plugins/code/plugin.py .py 2 symbols modified
~ tests/test_core_merge_engine.py .py 15 symbols added, 3 symbols modified
+ TestManualStrategyUnchangedFiles class class TestManualStrategyUnchangedFiles L444–497
+ test_73_unchanged_plus_one_real_conflict method method test_73_unchanged_plus_one_real_conflict L486–497
+ test_convergent_same_change_no_conflict method method test_convergent_same_change_no_conflict L454–460
+ test_divergent_changes_conflict method method test_divergent_changes_conflict L478–484
+ test_only_ours_changed_manual_forces_conflict method method test_only_ours_changed_manual_forces_conflict L462–468
+ test_only_theirs_changed_manual_forces_conflict method method test_only_theirs_changed_manual_forces_conflict L470–476
+ test_unchanged_no_conflict method method test_unchanged_no_conflict L447–452
+ _DUMMY_ROOT variable variable _DUMMY_ROOT L416–416
+ _code_plugin function function _code_plugin L419–420
+ _manual_attrs function function _manual_attrs L427–428
+ _merge_with_manual function function _merge_with_manual L431–441
+ _snap function function _snap L423–424
+ AttributeRule import import AttributeRule L37–37
+ CodePlugin import import CodePlugin L38–38
+ mock import import unittest.mock L11–11
← Older Oldest on task/fix-manual-merge-false-conflicts
All commits
Newer → Latest on task/fix-manual-merge-false-conflicts

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