Skip to main content

Module cas

Module cas 

Source
Expand description

Content Addressable Storage (CAS) — BLAKE3-indexed blob store with Zstd compression.

The CAS is the foundational storage layer of Suture. Every piece of data — file content, patch payloads, metadata — is stored as a blob indexed by its BLAKE3 hash. Identical blobs are deduplicated automatically.

§On-Disk Layout

.suture/
  objects/
    ab/           # First 2 hex chars of hash (256 buckets)
      cdef...     # Remaining 62 hex chars = blob filename
  metadata.db     # SQLite database (handled by metadata module)

§Correctness Properties

  • Integrity: get(H(data)) == data (BLAKE3 collision resistance)
  • Deduplication: Storing the same blob twice uses one copy
  • Lossless: Zstd compression/decompression is lossless

Re-exports§

pub use store::BlobStore;
pub use store::CasError;

Modules§

store
Blob Store — the primary CAS interface for storing and retrieving blobs.