jellycell.cache.store

Cache store — blob store (via :mod:diskcache) plus manifest JSON files.

Filesystem is the source of truth. SQLite index (:mod:jellycell.cache.index) is a derived accelerator. Layout (spec §2.3)::

.jellycell/cache/
├── blobs/                    # diskcache — content-addressed binary blobs
├── manifests/<cache-key>.json
└── state.db                  # SQLite index (see index.py)

Module Contents

Classes

CacheStore

Combined blob + manifest store for a project’s .jellycell/cache/.

API

class jellycell.cache.store.CacheStore(root: pathlib.Path)

Combined blob + manifest store for a project’s .jellycell/cache/.

Usable as a context manager for clean diskcache teardown.

Initialization

put_blob(data: bytes) str

Store raw bytes; return sha256 hex digest (the blob key).

get_blob(digest: str) bytes

Fetch a blob by its sha256 digest. Raises KeyError if missing.

has_blob(digest: str) bool

Check whether a blob exists.

manifest_path(cache_key: str) pathlib.Path

The on-disk path for a cache key’s manifest.

put_manifest(manifest: jellycell.cache.manifest.Manifest) pathlib.Path

Write the manifest; return its on-disk path.

get_manifest(cache_key: str) jellycell.cache.manifest.Manifest

Read the manifest for a cache key. Raises if missing.

has(cache_key: str) bool

Whether a manifest exists for this cache key.

iter_manifests() list[jellycell.cache.manifest.Manifest]

All manifests in insertion-free order (by filename).

close() None

Close the backing diskcache. Idempotent.