Expand description
The storage layer — responsible for all filesystem operations.
This module manages the Content-Addressable Storage (CAS) vault where all encrypted blobs live on disk. It deliberately knows nothing about users, sessions, or metadata — that is the model layer’s concern.
§Key responsibilities
- Accepting a raw byte stream and committing it to disk atomically.
- Naming blobs by their BLAKE3 hash (CAS semantics).
- Serving blobs back as file handles for streaming to clients.
- Deleting blobs when their reference count drops to zero.
§Atomicity guarantee
Every write goes through an internal transaction. The transaction
streams bytes to a <uuid>.tmp staging file first, then does an atomic
rename(2) into the vault. If anything fails mid-stream, the temp file
is cleaned up and the vault is left untouched.
Enums§
- Error
- Errors that can occur in the storage layer.