Skip to main content

suture_core/patch/
mod.rs

1//! Patch Algebra — the mathematical heart of Suture.
2//!
3//! This module implements the core patch theory:
4//! - **Patches** as typed operations with touch sets
5//! - **Commutativity** detection based on disjoint touch sets
6//! - **Merge** computation via set-union of independent patches
7//! - **Conflict** detection and first-class conflict nodes
8//!
9//! # Formal Foundation
10//!
11//! See YP-ALGEBRA-PATCH-001 for the mathematical proofs:
12//! - THM-COMM-001: Disjoint touch sets imply commutativity
13//! - THM-MERGE-001: Merging produces a deterministic, unique result
14//! - THM-CONF-001: Conflict nodes preserve all information from both branches
15
16#[doc(hidden)]
17pub(crate) mod commute;
18#[doc(hidden)]
19pub(crate) mod compose;
20pub mod conflict;
21pub mod merge;
22pub mod types;
23
24pub use commute::{CommuteResult, commute};
25pub use compose::{ComposeError, ComposeResult, compose, compose_chain};
26pub use conflict::{Conflict, ConflictClass, ConflictNode};
27pub use merge::{MergeError, MergeResult, merge};
28pub use types::{Operation, OperationType, Patch, PatchId, TouchSet};