jacquardSnapshot

← snapshot

1210 bytes
//! The content-addressed DAG: blobs, trees, and snapshots.
//!
//! # Shape
//!
//! Three object kinds, each identified by the digest of its canonical
//! encoding (see [`encode`]):
//!
//! - a [`Blob`] is file content;
//! - a [`Tree`] is a sorted, duplicate-free list of named entries;
//! - a [`Snapshot`] is a tree plus parents, author, message, timestamp — and
//!   **provenance, inside the hash**. The same tree authored by a human and by an agent
//!   is two different snapshots. That is the design decision this crate exists to
//!   enforce: who made a thing is part of what the thing *is*, so it cannot be quietly
//!   relabelled later.
//!
//! Storage is a port ([`ObjectStore`]); the in-memory fake
//! ([`MemoryObjectStore`]) lives beside it and re-hashes on read, so a store
//! that hands back tampered bytes is caught by the tests that use it.

pub mod diff;
pub mod encode;
pub mod object;
pub mod snapshot;
pub mod store;
pub mod tree;

pub use diff::diff_trees;
pub use encode::{blob_id, snapshot_id, tree_id};
pub use object::Blob;
pub use snapshot::Snapshot;
pub use store::{MemoryObjectStore, ObjectError, ObjectStore};
pub use tree::{Segment, Tree, TreeEntry, TreeError, TreeNode};