Skip to main content

suture_core/
lib.rs

1//! Suture Core — The central library for the Suture Universal Semantic Version Control System.
2//!
3//! This crate provides:
4//! - **CAS** (Content Addressable Storage): BLAKE3-indexed blob storage with Zstd compression
5//! - **Patch Algebra**: Commutativity detection, merge computation, conflict handling
6//! - **Patch DAG**: Directed acyclic graph of patches with branch management
7//! - **Metadata Store**: SQLite-backed persistent metadata
8//! - **Repository**: High-level API combining all of the above
9//!
10//! # Example
11//!
12//! ```no_run
13//! use suture_core::repository::Repository;
14//!
15//! // Initialize a new repository
16//! let mut repo = Repository::init(
17//!     std::path::Path::new("my-project"),
18//!     "alice",
19//! )?;
20//!
21//! // Create a branch
22//! repo.create_branch("feature", None)?;
23//!
24//! // Stage and commit
25//! repo.add("src/main.rs")?;
26//! let patch_id = repo.commit("Initial commit")?;
27//!
28//! // View log
29//! for patch in repo.log(None)? {
30//!     println!("[{}] {}", patch.id, patch.message);
31//! }
32//! # Ok::<(), suture_core::repository::RepoError>(())
33//! ```
34
35pub mod cas;
36pub mod dag;
37pub mod engine;
38pub mod hooks;
39pub mod metadata;
40pub mod patch;
41pub mod repository;
42pub mod signing;
43
44// Re-export common types for convenience
45pub use suture_common::{BranchName, CommonError, FileStatus, Hash, RepoPath};