gabriel / muse public
feat BREAKING task/phase3-weave-union-docs #1 / 1
AI Agent gabriel · 60 days ago · Apr 17, 2026 · Diff

feat: Phase 3 — weave-based union for docs/markdown + _find_sync_regions bugfix

Phase 3: union strategy now performs real line-level merge using _independence_merge_blob() instead of silently discarding theirs' content. Both sides' prose additions survive in the merged blob with no conflict markers.

Bonus fix: _find_sync_regions in cohen_transform.py had a sentinel bug — prev_bp initialised to -1 caused the first stable element (bp=0) to falsely enter the 'extend run' branch via 0 == -1+1, leaving run_bp=-1 and flushing nothing. Fixed by initialising prev_bp to -2. This caused all three-way merges where stable content starts at line 0 to treat the entire file as a single conflict region rather than finding the common prefix.

- cohen_transform._find_sync_regions: prev sentinel -1 → -2 (bugfix) - CodePlugin.merge() union branch: read blobs and call _independence_merge_blob - 11 new TDD tests in test_phase3_weave_union_docs.py

sha256:f582f125162c55629f2b03172f73293585bc5ac6b598ce4ed1b5a6f4635f5da9 sha
sha256:61233f30828794a3e1dec581f07d212f7aefe07893a7d7a0a8da6bb8625ff857 snapshot
← Older Oldest on task/phase3-weave-union-docs
All commits
Newer → Latest on task/phase3-weave-union-docs

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