Expand description
Patch Application Engine — reconstructs file trees from patch chains.
This module is the bridge between the abstract patch DAG and concrete filesystem state. It provides:
- FileTree: A virtual filesystem snapshot (path → CAS blob hash)
- Patch application: Transform a FileTree by applying a patch
- Chain application: Build a FileTree from root to a given patch
- Diff computation: Compare two FileTrees to find changes
§Correctness
Per YP-ALGEBRA-PATCH-001:
- Applying a chain of patches produces a deterministic file state
- The order of application matters (patches are NOT reordered)
- Each operation type (Create/Modify/Delete/Move) has well-defined semantics
Re-exports§
pub use tree::FileTree;
Modules§
- tree
- FileTree — a virtual filesystem snapshot.
Structs§
- Diff
Entry - A single diff entry representing a change between two trees.
- Merge
Output - Result of a line-level three-way merge.
Enums§
- Apply
Error - Errors that can occur during patch application.
- Diff
Type - The type of change detected between two trees.
Functions§
- apply_
patch - Apply a single patch to a FileTree, producing a new FileTree.
- apply_
patch_ chain - Apply a chain of patches (from oldest to newest) to produce a final FileTree.
- diff_
trees - Compute the diff between two FileTrees.
- resolve_
payload_ to_ hash - Resolve a patch’s payload to a CAS blob hash.
- three_
way_ merge_ lines - Perform a line-level three-way merge.