Skip to main content

Module engine

Module engine 

Source
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§

DiffEntry
A single diff entry representing a change between two trees.
MergeOutput
Result of a line-level three-way merge.

Enums§

ApplyError
Errors that can occur during patch application.
DiffType
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.