Skip to main content

Module store

Module store 

Source
Expand description

Content-addressed payload store. The cache key is the blake3 hash of the canonical input bytes for a tool call (not the output); the value is the exact output payload bytes that the MCP tool fed back to the model on its original execution. The store is append-only for M1; M2 will add eviction.

Layout on disk:

<root>/
  ab/                       # first two hex chars of the key
    ab12cd...ef.payload     # raw bytes
    ab12cd...ef.meta.json   # invalidation metadata (raw_hash, size, kind)

Keys are 64-char lowercase hex strings; we shard by the first two chars so a single project does not produce a directory with 100k+ entries.

Structs§

FileRootSerde
FileStore
Key
Lowercase hex blake3 digest. Wrapping in a newtype so we can’t confuse a payload-hash with the cache key (which hashes inputs, not outputs).
Payload
PayloadMeta

Enums§

StoreError

Traits§

Store
Storage backend trait. Concrete impls: FileStore (local content-addressed disk), and (M4 step 7+) RemoteStore over HTTP. LiveCache owns one Box<dyn Store> and routes every content-addressed read/write through this trait so the same cache state machine works against either backend without conditional compilation in the runtime layer.