NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
neograph::tenant::ScopedCheckpointStore Class Referencefinal

Checkpoint namespace owned by one trusted tenant. More...

#include <tenant.h>

Inheritance diagram for neograph::tenant::ScopedCheckpointStore:
[legend]
Collaboration diagram for neograph::tenant::ScopedCheckpointStore:
[legend]

Public Member Functions

void clear_writes (const std::string &thread_id, const std::string &parent_checkpoint_id) override
 Discard pending writes for a parent checkpoint once its successor super-step has been fully committed.
 
void delete_thread (const std::string &thread_id) override
 Delete all checkpoints for a thread.
 
std::vector< graph::PendingWrite > get_writes (const std::string &thread_id, const std::string &parent_checkpoint_id) override
 Load all pending writes attached to a parent checkpoint.
 
std::vector< graph::Checkpoint > list (const std::string &thread_id, int limit=100) override
 List checkpoints for a thread, most recently saved first, one entry per ID; the first entry is load_latest().
 
std::optional< graph::Checkpoint > load_by_id (const std::string &id) override
 Load a checkpoint by its unique ID.
 
std::optional< graph::Checkpoint > load_latest (const std::string &thread_id) override
 Load the most recently saved checkpoint for a thread.
 
void put_writes (const std::string &thread_id, const std::string &parent_checkpoint_id, const graph::PendingWrite &write) override
 Record a successful node execution within an in-progress super-step.
 
bool requires_managed_budget (const std::string &thread_id) override
 Whether this trusted checkpoint namespace/thread has ever held an active standalone managed bank.
 
bool retains_native_checkpoint () const noexcept override
 Describes real local C++ custody, not a financial admission/grant.
 
void save (const graph::Checkpoint &cp) override
 Save a checkpoint.
 

Detailed Description

Checkpoint namespace owned by one trusted tenant.

Definition at line 157 of file tenant.h.

Member Function Documentation

◆ clear_writes()

void neograph::tenant::ScopedCheckpointStore::clear_writes ( const std::string &  ,
const std::string &   
)
overridevirtual

Discard pending writes for a parent checkpoint once its successor super-step has been fully committed.

Called by the engine after the new super-step checkpoint has been durably saved, so pending writes are never cleared while still being the only record of a node's output.

Parameters
thread_idThread identifier.
parent_checkpoint_idCheckpoint whose pending writes to clear.

Reimplemented from neograph::graph::CheckpointStore.

◆ delete_thread()

void neograph::tenant::ScopedCheckpointStore::delete_thread ( const std::string &  thread_id)
overridevirtual

Delete all checkpoints for a thread.

Parameters
thread_idThread identifier to delete.

Reimplemented from neograph::graph::CheckpointStore.

◆ get_writes()

std::vector< graph::PendingWrite > neograph::tenant::ScopedCheckpointStore::get_writes ( const std::string &  ,
const std::string &   
)
overridevirtual

Load all pending writes attached to a parent checkpoint.

Called by the engine on resume to skip already-completed tasks. Default implementation returns an empty vector.

Parameters
thread_idThread identifier.
parent_checkpoint_idCheckpoint whose pending writes to load.
Returns
Vector of pending writes, in insertion order.

Reimplemented from neograph::graph::CheckpointStore.

◆ list()

std::vector< graph::Checkpoint > neograph::tenant::ScopedCheckpointStore::list ( const std::string &  thread_id,
int  limit = 100 
)
overridevirtual

List checkpoints for a thread, most recently saved first, one entry per ID; the first entry is load_latest().

Parameters
thread_idThread identifier.
limitMaximum number of checkpoints to return (default: 100).
Returns
Vector of checkpoints.

Reimplemented from neograph::graph::CheckpointStore.

◆ load_by_id()

std::optional< graph::Checkpoint > neograph::tenant::ScopedCheckpointStore::load_by_id ( const std::string &  id)
overridevirtual

Load a checkpoint by its unique ID.

Parameters
idCheckpoint UUID.
Returns
The checkpoint, or std::nullopt if not found.

Reimplemented from neograph::graph::CheckpointStore.

◆ load_latest()

std::optional< graph::Checkpoint > neograph::tenant::ScopedCheckpointStore::load_latest ( const std::string &  thread_id)
overridevirtual

Load the most recently saved checkpoint for a thread.

"Latest" is save order, not timestamp or step: a later run on a thread restarts at step 0, and saves can share a millisecond.

Parameters
thread_idThread identifier.
Returns
The latest checkpoint, or std::nullopt if none exists.

Reimplemented from neograph::graph::CheckpointStore.

◆ put_writes()

void neograph::tenant::ScopedCheckpointStore::put_writes ( const std::string &  ,
const std::string &  ,
const graph::PendingWrite &   
)
overridevirtual

Record a successful node execution within an in-progress super-step.

Called by the engine immediately after a node returns successfully and before its writes are applied to the shared GraphState. The parent_checkpoint_id anchors the pending write to the super-step boundary it was produced under.

Default implementation is a no-op so custom stores keep working; such stores fall back to "full super-step replay" on resume.

Parameters
thread_idThread identifier.
parent_checkpoint_idCheckpoint marking the start of the in-progress super-step.
writeThe pending write record to persist.

Reimplemented from neograph::graph::CheckpointStore.

◆ requires_managed_budget()

bool neograph::tenant::ScopedCheckpointStore::requires_managed_budget ( const std::string &  thread_id)
overridevirtual

Whether this trusted checkpoint namespace/thread has ever held an active standalone managed bank.

Saving stripped state or deleting checkpoints must not clear the obligation. This flag grants no currency; the original complete bank must still authenticate before restoration. Unsupported backends throw rather than authorize an absent bank.

Reimplemented from neograph::graph::CheckpointStore.

◆ save()

void neograph::tenant::ScopedCheckpointStore::save ( const graph::Checkpoint &  cp)
overridevirtual

Save a checkpoint.

Saving an ID the thread already holds replaces that checkpoint and makes it the thread's latest, as if it were saved for the first time.

Parameters
cpThe checkpoint to persist.

Reimplemented from neograph::graph::CheckpointStore.


The documentation for this class was generated from the following file: