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

Base of a ProgramTransitionStore whose backend is synchronous: the in-memory store, SQLite and PostgreSQL. More...

#include <transition_store.h>

Inheritance diagram for neograph::program::SyncProgramTransitionStore:
[legend]
Collaboration diagram for neograph::program::SyncProgramTransitionStore:
[legend]

Public Member Functions

asio::awaitable< ProgramTransitionPublishResult > compare_publish (std::string_view owner_scope, std::string_view expected_journal_head, ProgramTransitionPublication publication) final
 Atomically publishes the run snapshot, journal head, events, effect outbox, and JavaScript command appends.
 
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) final
 Atomically publishes and acquires, releases, or replaces a dispatch lease.
 
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) final
 Host-only peer for a running source checkpoint; evidence is never serialized.
 
bool completes_at_once () const noexcept
 True when every awaitable operation completes at once on the calling thread, not on a pool thread.
 
asio::awaitable< std::optional< ProgramRunRecord > > load (std::string_view owner_scope, std::string_view run_id) const final
 Wrong-owner lookups are indistinguishable from absence.
 
asio::awaitable< std::vector< ProgramChildSynthesisRecord > > load_child_syntheses (std::string_view owner_scope, std::string_view run_id) const final
 Current synthesis heads.
 
asio::awaitable< std::optional< ProgramCommandPublicationHead > > load_command_publication_head (std::string_view owner_scope, std::string_view run_id) const final
 Read one coherent run/journal head and the last command append.
 
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 final
 Durable provider-context evidence, ordered by ContextEpoch sequence.
 
asio::awaitable< ProgramEffectiveRuntimeState > load_effective_runtime_state (std::string_view owner_scope, std::string_view run_id) const final
 Target-local state plus source-origin hook heads authorized by its generation.
 
asio::awaitable< std::optional< ProgramExecutionLease > > load_execution_lease (std::string_view owner_scope, std::string_view run_id) const final
 Current backend-global root Core dispatch owner, when one is active.
 
asio::awaitable< std::optional< ProgramRunGeneration > > load_generation (std::string_view owner_scope, std::string_view lineage_id, std::uint64_t generation) const final
 One immutable topology generation retained by ordinal.
 
asio::awaitable< std::optional< ProgramTransitionPublication > > load_generation_initial_publication (std::string_view owner_scope, std::string_view lineage_id, std::uint64_t generation) const final
 Exact immutable publication that created one topology generation.
 
asio::awaitable< std::optional< GraphMigrationCapsule > > load_graph_migration_capsule (std::string_view owner_scope, std::string_view source_run_id, std::string_view source_lineage_head_id) const final
 Immutable source hold captured atomically with one graph safe point.
 
asio::awaitable< std::vector< HookOutboxEntry > > load_hook_outbox_entries (std::string_view owner_scope, std::string_view run_id) const final
 Current durable heads, including pending and reconciliation-required hooks.
 
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 final
 Durable yielded-command journal, ordered by append sequence.
 
asio::awaitable< std::optional< ProgramRunLineage > > load_lineage (std::string_view owner_scope, std::string_view lineage_id) const final
 Current immutable lineage head, when the run uses generation accounting.
 
asio::awaitable< std::optional< ProgramRunLineage > > load_lineage_head (std::string_view owner_scope, std::string_view lineage_id, std::string_view head_id) const final
 One immutable historical lineage head addressed by its content identity.
 
asio::awaitable< std::optional< MigrationPlan > > load_migration_plan (std::string_view owner_scope, std::string_view run_id) const final
 Durable migration proof published with a fork, if this run is a fork.
 
asio::awaitable< std::optional< ProgramRunLineage > > load_run_lineage (std::string_view owner_scope, std::string_view run_id) const final
 Current lineage head associated with one run generation.
 
asio::awaitable< std::optional< ProgramRunPublicationHead > > load_run_publication_head (std::string_view owner_scope, std::string_view run_id) const final
 Read one coherent record/journal pair without requiring JavaScript support.
 
- Public Member Functions inherited from neograph::program::ProgramTransitionStore
virtual std::string process_coordination_key () const
 Process-local namespace used to coordinate wrappers over one backend.
 

Protected Member Functions

virtual bool offloads () const noexcept
 True for a backend that blocks for long: each operation then runs on a pool thread.
 

Detailed Description

Base of a ProgramTransitionStore whose backend is synchronous: the in-memory store, SQLite and PostgreSQL.

A derived class implements the ..._sync operations and gets the awaitable interface from them. Each awaitable operation runs the synchronous one at once on the calling thread, or on a thread of a bounded pool when offloads() is true. An operation with a default keeps the default it had.

Definition at line 340 of file transition_store.h.

Member Function Documentation

◆ compare_publish()

asio::awaitable< ProgramTransitionPublishResult > neograph::program::SyncProgramTransitionStore::compare_publish ( std::string_view  owner_scope,
std::string_view  expected_journal_head,
ProgramTransitionPublication  publication 
)
finalvirtual

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.

Implements neograph::program::ProgramTransitionStore.

◆ load_child_syntheses()

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

Current synthesis heads.

Unsupported stores fail closed, never report an empty journal.

Reimplemented from neograph::program::ProgramTransitionStore.

◆ load_command_publication_head()

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

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 from neograph::program::ProgramTransitionStore.

◆ load_javascript_commands()

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

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 from neograph::program::ProgramTransitionStore.

◆ load_run_publication_head()

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

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 from neograph::program::ProgramTransitionStore.


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