Portable snapshot export and import for the learned semantic cache.
Encodes review rows and their stored embeddings as JSON-compatible maps or an atomically written JSONL file, and restores online rows from snapshot maps or paths while re-validating labels against the agent's current cacheable routes.
Summary
Functions
Resolves snapshot input (path, rows, or keyword) into entry maps.
Loads snapshot entries as online rows, summarizing skips and errors.
Encodes rows as snapshot maps, or writes them to a JSONL path.
Functions
Resolves snapshot input (path, rows, or keyword) into entry maps.
Loads snapshot entries as online rows, summarizing skips and errors.
@spec write([Spectre.Router.SemanticCache.Learned.row()], String.t() | nil | term()) :: {:ok, String.t() | [map()]} | {:error, term()}
Encodes rows as snapshot maps, or writes them to a JSONL path.