NeoGraph 0.16.0
A C++20 Graph Agent Engine Library — LangGraph for C++
Loading...
Searching...
No Matches
sqlite_transition_store.h
Go to the documentation of this file.
1
5#pragma once
6
8
9#include <memory>
10#include <string>
11#include <string_view>
12
13namespace neograph::program {
14
24class NEOGRAPH_PROGRAM_API SQLiteProgramTransitionStore final
26public:
27 explicit SQLiteProgramTransitionStore(std::string database_path);
33
34 std::string process_coordination_key() const override;
35
36 std::optional<ProgramRunPublicationHead> load_run_publication_head_sync(
37 std::string_view owner_scope, std::string_view run_id) const override;
38
39 std::optional<ProgramCommandPublicationHead> load_command_publication_head_sync(
40 std::string_view owner_scope, std::string_view run_id) const override;
41
42 std::optional<ProgramRunRecord> load_sync(std::string_view owner_scope,
43 std::string_view run_id) const override;
44 std::optional<ProgramJournalRecord> latest_sync(std::string_view owner_scope,
45 std::string_view run_id) const override;
46 std::vector<ProgramEvent> load_events_sync(std::string_view owner_scope,
47 std::string_view run_id,
48 std::uint64_t after_sequence = 0) const override;
49 std::vector<ProgramEffectOutboxEntry>
50 load_effects_sync(std::string_view owner_scope,
51 std::string_view run_id,
52 std::uint64_t after_sequence = 0) const override;
53 std::vector<ProgramJavaScriptCommandJournalEntry>
54 load_javascript_commands_sync(std::string_view owner_scope,
55 std::string_view run_id,
56 std::uint64_t after_sequence = 0) const override;
57 std::vector<ProgramContextPublication> load_context_publications_sync(
58 std::string_view owner_scope,
59 std::string_view run_id,
60 std::uint64_t after_sequence = 0) const override;
61 std::vector<HookOutboxEntry> load_hook_outbox_entries_sync(
62 std::string_view owner_scope, std::string_view run_id) const override;
63 std::vector<ProgramChildSynthesisRecord> load_child_syntheses_sync(
64 std::string_view owner_scope, std::string_view run_id) const override;
65 std::optional<MigrationPlan> load_migration_plan_sync(std::string_view owner_scope,
66 std::string_view run_id) const override;
67 std::optional<ProgramRunLineage> load_lineage_sync(std::string_view owner_scope,
68 std::string_view lineage_id) const override;
69 std::optional<ProgramRunLineage> load_run_lineage_sync(std::string_view owner_scope,
70 std::string_view run_id) const override;
71 std::optional<ProgramRunLineage> load_lineage_head_sync(std::string_view owner_scope,
72 std::string_view lineage_id,
73 std::string_view head_id) const override;
74 std::optional<ProgramRunGeneration> load_generation_sync(std::string_view owner_scope,
75 std::string_view lineage_id,
76 std::uint64_t generation) const override;
77 std::optional<ProgramTransitionPublication> load_generation_initial_publication_sync(
78 std::string_view owner_scope,
79 std::string_view lineage_id,
80 std::uint64_t generation) const override;
81 std::optional<GraphMigrationCapsule> load_graph_migration_capsule_sync(
82 std::string_view owner_scope,
83 std::string_view source_run_id,
84 std::string_view source_lineage_head_id) const override;
85 std::optional<ProgramExecutionLease> load_execution_lease_sync(
86 std::string_view owner_scope,
87 std::string_view run_id) const override;
88 ProgramTransitionPublishResult
89 compare_publish_sync(std::string_view owner_scope,
90 std::string_view expected_journal_head,
91 ProgramTransitionPublication publication) override;
92 ProgramTransitionPublishResult compare_publish_execution_sync(
93 std::string_view owner_scope,
94 std::string_view expected_journal_head,
95 ProgramTransitionPublication publication,
96 std::optional<ProgramExecutionLease> expected_lease,
97 std::optional<ProgramExecutionLease> next_lease) override;
98 ProgramTransitionPublishResult compare_publish_graph_safe_point_sync(
99 std::string_view owner_scope,
100 std::string_view expected_journal_head,
101 ProgramTransitionPublication publication,
102 const ProgramGraphSafePointEvidence& evidence,
103 const GraphMigrationCapsule& capsule,
104 const ProgramExecutionLease& execution_lease) override;
105
106private:
107 ProgramTransitionPublishResult compare_publish_impl(
108 std::string_view owner_scope,
109 std::string_view expected_journal_head,
110 ProgramTransitionPublication publication,
111 const ProgramGraphSafePointEvidence* evidence,
112 const GraphMigrationCapsule* capsule,
113 const ProgramExecutionLease* expected_lease,
114 const ProgramExecutionLease* next_lease);
115 struct Impl;
116 std::unique_ptr<Impl> impl_;
117};
118
119} // namespace neograph::program
Exact, content-addressed source evidence captured at a durable Core boundary.
Backend-global ownership of one migration-capable root Core dispatch.
Host-only, non-serializable evidence for one running safe-point publication.
Durable owner-scoped ProgramTransitionStore.
std::string process_coordination_key() const override
Process-local namespace used to coordinate wrappers over one backend.
Base of a ProgramTransitionStore whose backend is synchronous: the in-memory store,...
Atomic owner-scoped Program transition publication.