NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
neograph::program::ProgramTransitionStore Class Referenceabstract

The durable store of Program transitions, as the runtime uses it (#556). More...

#include <transition_store.h>

Inheritance diagram for neograph::program::ProgramTransitionStore:
[legend]

Public Member Functions

virtual asio::awaitable< ProgramTransitionPublishResult > compare_publish (std::string_view owner_scope, std::string_view expected_journal_head, ProgramTransitionPublication publication)=0
 Atomically publishes the run snapshot, journal head, events, effect outbox, and JavaScript command appends.
 
virtual asio::awaitable< ProgramTransitionPublishResult > compare_publish_execution (std::string_view owner_scope, std::string_view expected_journal_head, ProgramTransitionPublication publication, std::optional< ProgramExecutionLease > expected_lease, std::optional< ProgramExecutionLease > next_lease)
 Atomically publishes and acquires, releases, or replaces a dispatch lease.
 
virtual asio::awaitable< ProgramTransitionPublishResult > compare_publish_graph_safe_point (std::string_view owner_scope, std::string_view expected_journal_head, ProgramTransitionPublication publication, const ProgramGraphSafePointEvidence &evidence, const GraphMigrationCapsule &capsule, const ProgramExecutionLease &execution_lease)
 Host-only peer for a running source checkpoint; evidence is never serialized.
 
virtual asio::awaitable< std::optional< ProgramRunRecord > > load (std::string_view owner_scope, std::string_view run_id) const =0
 Wrong-owner lookups are indistinguishable from absence.
 
virtual asio::awaitable< std::vector< ProgramChildSynthesisRecord > > load_child_syntheses (std::string_view owner_scope, std::string_view run_id) const
 Current synthesis heads.
 
virtual asio::awaitable< std::optional< ProgramCommandPublicationHead > > load_command_publication_head (std::string_view owner_scope, std::string_view run_id) const
 Read one coherent run/journal head and the last command append.
 
virtual asio::awaitable< std::vector< ProgramContextPublication > > load_context_publications (std::string_view owner_scope, std::string_view run_id, std::uint64_t after_sequence=0) const
 Durable provider-context evidence, ordered by ContextEpoch sequence.
 
virtual asio::awaitable< ProgramEffectiveRuntimeState > load_effective_runtime_state (std::string_view owner_scope, std::string_view run_id) const
 Target-local state plus source-origin hook heads authorized by its generation.
 
virtual asio::awaitable< std::optional< ProgramExecutionLease > > load_execution_lease (std::string_view, std::string_view) const
 Current backend-global root Core dispatch owner, when one is active.
 
virtual asio::awaitable< std::optional< ProgramRunGeneration > > load_generation (std::string_view, std::string_view, std::uint64_t) const
 One immutable topology generation retained by ordinal.
 
virtual asio::awaitable< std::optional< ProgramTransitionPublication > > load_generation_initial_publication (std::string_view, std::string_view, std::uint64_t) const
 Exact immutable publication that created one topology generation.
 
virtual asio::awaitable< std::optional< GraphMigrationCapsule > > load_graph_migration_capsule (std::string_view, std::string_view, std::string_view) const
 Immutable source hold captured atomically with one graph safe point.
 
virtual asio::awaitable< std::vector< HookOutboxEntry > > load_hook_outbox_entries (std::string_view owner_scope, std::string_view run_id) const
 Current durable heads, including pending and reconciliation-required hooks.
 
virtual asio::awaitable< std::vector< ProgramJavaScriptCommandJournalEntry > > load_javascript_commands (std::string_view owner_scope, std::string_view run_id, std::uint64_t after_sequence=0) const
 Durable yielded-command journal, ordered by append sequence.
 
virtual asio::awaitable< std::optional< ProgramRunLineage > > load_lineage (std::string_view, std::string_view) const
 Current immutable lineage head, when the run uses generation accounting.
 
virtual asio::awaitable< std::optional< ProgramRunLineage > > load_lineage_head (std::string_view, std::string_view, std::string_view) const
 One immutable historical lineage head addressed by its content identity.
 
virtual asio::awaitable< std::optional< MigrationPlan > > load_migration_plan (std::string_view, std::string_view) const
 Durable migration proof published with a fork, if this run is a fork.
 
virtual asio::awaitable< std::optional< ProgramRunLineage > > load_run_lineage (std::string_view owner_scope, std::string_view run_id) const
 Current lineage head associated with one run generation.
 
virtual asio::awaitable< std::optional< ProgramRunPublicationHead > > load_run_publication_head (std::string_view owner_scope, std::string_view run_id) const
 Read one coherent record/journal pair without requiring JavaScript support.
 
virtual std::string process_coordination_key () const
 Process-local namespace used to coordinate wrappers over one backend.
 

Detailed Description

The durable store of Program transitions, as the runtime uses it (#556).

Every operation is awaitable: a store whose backend is synchronous completes it at once (SyncProgramTransitionStore), and a host's store may complete it on a later turn of the host's event loop. The arguments of a call, string views included, must stay alive until the awaitable completes: await it in the full expression that makes the call.

Definition at line 185 of file transition_store.h.

Member Function Documentation

◆ compare_publish()

virtual asio::awaitable< ProgramTransitionPublishResult > neograph::program::ProgramTransitionStore::compare_publish ( std::string_view  owner_scope,
std::string_view  expected_journal_head,
ProgramTransitionPublication  publication 
)
pure virtual

Atomically publishes the run snapshot, journal head, events, effect outbox, and JavaScript command appends.

A throw has the strong exception guarantee. An exact retry is AlreadyPresent.

Implemented in neograph::program::SyncProgramTransitionStore.

◆ load_child_syntheses()

virtual asio::awaitable< std::vector< ProgramChildSynthesisRecord > > neograph::program::ProgramTransitionStore::load_child_syntheses ( std::string_view  owner_scope,
std::string_view  run_id 
) const
virtual

Current synthesis heads.

Unsupported stores fail closed, never report an empty journal.

Reimplemented in neograph::program::SyncProgramTransitionStore.

◆ load_command_publication_head()

virtual asio::awaitable< std::optional< ProgramCommandPublicationHead > > neograph::program::ProgramTransitionStore::load_command_publication_head ( std::string_view  owner_scope,
std::string_view  run_id 
) const
virtual

Read one coherent run/journal head and the last command append.

Native stores use a single snapshot without materializing command history. The compatibility implementation fences the existing virtual reads with a second head read; a changed head returns absence so publication fails closed. This read grants no write authority: publication must still CAS the head.

Reimplemented in neograph::program::SyncProgramTransitionStore.

◆ load_javascript_commands()

virtual asio::awaitable< std::vector< ProgramJavaScriptCommandJournalEntry > > neograph::program::ProgramTransitionStore::load_javascript_commands ( std::string_view  owner_scope,
std::string_view  run_id,
std::uint64_t  after_sequence = 0 
) const
virtual

Durable yielded-command journal, ordered by append sequence.

The base implementation fails closed. Stores that participate in JavaScript control recovery must override this operation rather than making an unreadable journal look empty.

Reimplemented in neograph::program::SyncProgramTransitionStore.

◆ load_run_publication_head()

virtual asio::awaitable< std::optional< ProgramRunPublicationHead > > neograph::program::ProgramTransitionStore::load_run_publication_head ( std::string_view  owner_scope,
std::string_view  run_id 
) const
virtual

Read one coherent record/journal pair without requiring JavaScript support.

Native stores capture one snapshot. The compatibility implementation fences virtual reads with a second record read and retries at most three times when that head changes. Absence or exhausted contention fails closed; read errors propagate. Acquisition grants no publication authority and retries no effects.

Reimplemented in neograph::program::SyncProgramTransitionStore.


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