3-Way Text Merge

The reconcile solves a fundamental challenge in collaborative editing: what happens when multiple people edit the same text simultaneously? reconcile(parent: str, left: str, right: str) -> str takes conflicting concurrent edits and intelligently merges them into a unified result. Beyond basic conflict resolution, it offers sophisticated merging heuristics, flexible tokenization options, and cursor position tracking.

The algorithm begins with your chosen tokenizer, then applies Myers' diff algorithm to compare the original text with both conflicting versions. These diffs undergo transformation to preserve meaningful change sequences, before a final merge strategy—inspired by Operational Transformation (OT)—reconciles all conflicting modifications without losing any edits.

For more details, see the README.