neurocore.persistence.checkpoint_adapter

Adapt a NeuroCore RunStore to flowengine’s CheckpointStore.

flowengine’s sync FlowEngine.execute() auto-saves a Checkpoint when a component suspends, and FlowEngine.resume() reloads it. We back that with the same SQLite file the RunStore uses (the checkpoints table) so a single runs.db holds both durable history and transient checkpoints.

For the in-memory backend (tests), we fall back to flowengine’s own InMemoryCheckpointStore.

Classes

SQLiteCheckpointStore

flowengine CheckpointStore backed by a SQLiteRunStore's connection.

Functions

checkpoint_store_for(→ flowengine.CheckpointStore | None)

Return a flowengine CheckpointStore backed by run_store.

Module Contents

neurocore.persistence.checkpoint_adapter.checkpoint_store_for(run_store: neurocore.persistence.base.RunStore | None) flowengine.CheckpointStore | None[source]

Return a flowengine CheckpointStore backed by run_store.

Returns None when persistence is disabled, a SQLite-backed store for the sqlite backend, and a per-run_store in-memory store for the memory backend. The in-memory store is memoized on the run_store so checkpoints survive across the suspend/resume boundary (which makes two separate calls).