Skip to main content

suture_core/engine/
mod.rs

1//! Patch Application Engine — reconstructs file trees from patch chains.
2//!
3//! This module is the bridge between the abstract patch DAG and concrete
4//! filesystem state. It provides:
5//! - **FileTree**: A virtual filesystem snapshot (path → CAS blob hash)
6//! - **Patch application**: Transform a FileTree by applying a patch
7//! - **Chain application**: Build a FileTree from root to a given patch
8//! - **Diff computation**: Compare two FileTrees to find changes
9//!
10//! # Correctness
11//!
12//! Per YP-ALGEBRA-PATCH-001:
13//! - Applying a chain of patches produces a deterministic file state
14//! - The order of application matters (patches are NOT reordered)
15//! - Each operation type (Create/Modify/Delete/Move) has well-defined semantics
16
17#[doc(hidden)]
18pub mod apply;
19#[doc(hidden)]
20pub mod diff;
21#[doc(hidden)]
22pub mod merge;
23pub mod tree;
24
25pub use apply::{ApplyError, apply_patch, apply_patch_chain, resolve_payload_to_hash};
26pub use diff::{DiffEntry, DiffType, diff_trees};
27pub use merge::{MergeOutput, three_way_merge_lines};
28pub use tree::FileTree;