4#include <neograph/context_store.h>
16namespace neograph::program {
18struct RuntimeDeveloperInstructionData {
19 std::string owner_scope;
20 std::string source_run_id;
22 std::uint64_t sequence = 0;
23 std::optional<std::string> predecessor_record_id;
24 std::int64_t submitted_at_ms = 0;
26 json payload = json::object();
27 std::vector<std::string> requested_capabilities;
28 std::vector<std::string> requested_effects;
34 static constexpr std::uint32_t STORAGE_SCHEMA_VERSION = 1;
38 const RuntimeDeveloperInstructionData& data()
const noexcept;
39 const std::string& id()
const noexcept;
40 std::string serialize_canonical()
const;
45 std::shared_ptr<const Impl> impl_;
48enum class RuntimeInstructionAction : std::uint8_t {
55NEOGRAPH_PROGRAM_API std::string_view to_string(RuntimeInstructionAction action)
noexcept;
56NEOGRAPH_PROGRAM_API RuntimeInstructionAction runtime_instruction_action_from_string(
57 std::string_view value);
59struct RuntimeInstructionDecisionData {
60 std::string instruction_id;
61 std::string source_run_id;
62 std::string expected_lineage_head_id;
63 std::string policy_identity;
64 RuntimeInstructionAction action = RuntimeInstructionAction::Rejected;
65 std::string target_program_version_id;
66 std::string target_run_id;
73 static constexpr std::uint32_t STORAGE_SCHEMA_VERSION = 1;
77 const RuntimeInstructionDecisionData& data()
const noexcept;
78 const std::string& id()
const noexcept;
79 std::string serialize_canonical()
const;
84 std::shared_ptr<const Impl> impl_;
87using RuntimeInstructionPlanner = std::function<RuntimeInstructionDecisionData(
92struct RuntimeInstructionPlan {
98struct RuntimeInstructionControllerConfig {
99 std::shared_ptr<DurableContextStore> context_store;
100 std::shared_ptr<ProgramTransitionStore> transitions;
101 std::shared_ptr<ProgramCatalog> catalog;
102 RuntimeInstructionPlanner planner;
110 RuntimeInstructionPlan submit_and_plan(
112 const std::optional<std::string>& expected_history_head_id);
114 ProgramHandle apply_replacement(
116 ProgramRuntime& runtime,
119 std::shared_ptr<ProgramEventSink> events = {})
const;
121 ProgramHandle apply_graph_migration(
123 ProgramRuntime& runtime,
124 const ProgramHandle& source,
125 std::shared_ptr<ProgramEventSink> events = {})
const;
128 RuntimeInstructionControllerConfig config_;
Admission and process-local materialization of immutable Programs.
Immutable context material.
One immutable, content-addressed line in the authoritative RAW history feed.
Immutable identity of one admitted topology generation in a run lineage.
Immutable content-addressed head of one stable run lineage.
Immutable developer input.
Host-owned bridge from durable developer input to existing transition APIs.
Immutable host decision over one exact active generation.
Execution service for admitted immutable Programs.
Exact completed JavaScript checkpoint coordinate selected by the host.
One owner-scoped Program request.