suture_core/cas/mod.rs
1//! Content Addressable Storage (CAS) — BLAKE3-indexed blob store with Zstd compression.
2//!
3//! The CAS is the foundational storage layer of Suture. Every piece of data —
4//! file content, patch payloads, metadata — is stored as a blob indexed by its
5//! BLAKE3 hash. Identical blobs are deduplicated automatically.
6//!
7//! # On-Disk Layout
8//!
9//! ```text
10//! .suture/
11//! objects/
12//! ab/ # First 2 hex chars of hash (256 buckets)
13//! cdef... # Remaining 62 hex chars = blob filename
14//! metadata.db # SQLite database (handled by metadata module)
15//! ```
16//!
17//! # Correctness Properties
18//!
19//! - **Integrity**: `get(H(data)) == data` (BLAKE3 collision resistance)
20//! - **Deduplication**: Storing the same blob twice uses one copy
21//! - **Lossless**: Zstd compression/decompression is lossless
22
23#[doc(hidden)]
24pub mod compressor;
25#[doc(hidden)]
26pub mod hasher;
27#[doc(hidden)]
28pub mod pack;
29pub mod store;
30
31pub use store::{BlobStore, CasError};