gabriel / muse public
feat BREAKING task/phase2-or-set-symbol-independence #1 / 1
AI Agent gabriel · 164 days ago · Apr 17, 2026 · Diff

feat: Phase 2 — OR-Set CRDT semantics + symbol-level independence-aware merge

Tier 1 (OR-Set): concurrent import and variable additions from different branches never conflict — add-wins semantics for unordered element sets.

Tier 2 (symbol independence): branches adding or modifying different named symbols in the same file auto-merge cleanly. merge_ops() now detects when all child op pairs commute (no symbol-level conflict) and reconstructs the merged blob via _independence_merge_blob() using three_way_merge_lines with union fallback for concurrent insertions at the same position (Manyana add-wins at the text level).

Multi-agent workflows editing the same module no longer produce spurious file-level conflicts when agents touch different functions or imports.

- _independence_merge_blob(): union-aware text merge for independent symbols - merge_ops() Step 1.5: derive symbol ops, check commutativity, reconstruct - 16 new TDD tests in test_phase2_or_set_symbol_independence.py

sha256:84b64e2493b3b8630aff4273ce7070d745932f0d63ee3bdd575a0646c1f4c1f5 sha
+34 ~3 symbols
sha256:3d39b66f2ab9a57f3490e18d59f11db6085586f5c3af4d7ff674a7ed0c484602 snapshot
+34
symbols added
~3
symbols modified
0
dead code introduced
Semantic Changes 37 symbols
+ TestMergedBlobCorrectness class class TestMergedBlobCorrectness L427–469
+ test_merged_blob_has_no_conflict_markers method method test_merged_blob_has_no_conflict_markers L430–447
+ test_merged_blob_is_valid_python method method test_merged_blob_is_valid_python L449–469
+ TestORSetImports class class TestORSetImports L75–148
+ test_concurrent_import_adds_both_present_in_merged method method test_concurrent_import_adds_both_present_in_merged L96–112
+ test_concurrent_import_adds_no_conflict method method test_concurrent_import_adds_no_conflict L78–94
+ test_same_import_added_on_both_sides_deduplicates method method test_same_import_added_on_both_sides_deduplicates L133–148
+ test_three_concurrent_import_adds_all_survive method method test_three_concurrent_import_adds_all_survive L114–131
+ TestORSetVariables class class TestORSetVariables L155–192
+ test_concurrent_variable_adds_both_present method method test_concurrent_variable_adds_both_present L176–192
+ test_concurrent_variable_adds_no_conflict method method test_concurrent_variable_adds_no_conflict L158–174
+ TestSymbolConflictPreserved class class TestSymbolConflictPreserved L354–420
+ test_mixed_file_some_symbols_conflict_some_independent method method test_mixed_file_some_symbols_conflict_some_independent L375–420
+ test_same_function_modified_both_sides_conflicts method method test_same_function_modified_both_sides_conflicts L357–373
+ TestSymbolIndependence class class TestSymbolIndependence L199–347
+ test_concurrent_class_adds_no_conflict class method test_concurrent_class_adds_no_conflict L312–326
+ test_concurrent_function_adds_both_present method method test_concurrent_function_adds_both_present L237–254
+ test_concurrent_function_adds_no_conflict method method test_concurrent_function_adds_no_conflict L202–235
+ test_different_functions_modified_both_present method method test_different_functions_modified_both_present L294–310
+ test_different_functions_modified_no_conflict method method test_different_functions_modified_no_conflict L256–292
+ test_independent_changes_in_multiple_files_all_clean method method test_independent_changes_in_multiple_files_all_clean L328–347
+ _oid function function _oid L44–45
+ _read_merged_blob function function _read_merged_blob L63–68
+ _snap function function _snap L55–60
+ _write_blob function function _write_blob L48–52
+ CodePlugin import import CodePlugin L37–37
+ annotations import import annotations L29–29
+ hashlib import import hashlib L31–31
+ pathlib import import pathlib L32–32
+ pytest import import pytest L35–35
+ textwrap import import textwrap L33–33
~ muse/plugins/code/plugin.py .py 3 symbols added, 3 symbols modified
+ _independence_merge_blob function function _independence_merge_blob L1173–1224
+ compute_regions import import compute_regions L102–102
+ write_object import import write_object L103–103
← Older Oldest on task/phase2-or-set-symbol-independence
All commits
Newer → Latest on task/phase2-or-set-symbol-independence

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