14#include <neograph/tool_set.h>
16#include <asio/awaitable.hpp>
27namespace neograph::program {
30class CatalogRuntimeAccess;
31struct MaterializedProgram;
35class RecordedBindingSet;
36struct RecordedCapabilityMaterialization;
39struct ProgramAdmission {
40 std::string owner_scope;
41 AdmissionProfile profile;
42 PolicySnapshot policy;
43 std::vector<DependencyReceipt> dependency_receipts;
53 const std::vector<Diagnostic>& diagnostics()
const noexcept;
56 std::vector<Diagnostic> diagnostics_;
78 std::unique_ptr<Impl> impl_;
80 friend class ProgramCatalog;
93 std::vector<CapabilityBindingReceipt> receipts;
96using CatalogCapabilityBinder =
100 std::shared_ptr<ProgramStore> program_store;
101 RegistrySnapshot registry;
102 std::shared_ptr<EngineGenerationCache> engines;
103 std::string compiler_build_id;
104 CatalogCapabilityBinder capability_binder;
105 std::size_t worker_count = 1;
107 std::shared_ptr<const ModuleStore> module_store;
114 std::string host_identity;
122 std::string materialization_context_identity;
130 recorded_capability_binder;
141class NEOGRAPH_PROGRAM_API ProgramCatalog {
143 explicit ProgramCatalog(CatalogConfig config);
144 ProgramCatalog(ProgramCatalog&&) noexcept;
145 ProgramCatalog& operator=(ProgramCatalog&&) noexcept;
146 ProgramCatalog(const ProgramCatalog&) = delete;
147 ProgramCatalog& operator=(const ProgramCatalog&) = delete;
150 ProgramVersion admit(const ProgramBundle& bundle, ProgramAdmission admission);
155 ProgramVersion admit_composed(const ProgramBundle& bundle,
156 ProgramAdmission admission,
157 const ProgramComposition& composition);
158 std::optional<ProgramVersion> find_version(std::string_view
id) const;
159 std::optional<ProgramVersion> find_version(std::string_view owner_scope,
160 std::string_view
id) const;
161 std::optional<ProgramVersion> resolve_version(std::string_view owner_scope,
162 std::string_view
id);
163 std::optional<ProgramVersion> resolve_version_with_binding(
164 std::string_view owner_scope, std::string_view
id, CatalogCapabilityBinding binding);
167 MigrationPlan plan_migration(std::string_view owner_scope,
168 std::string_view source_version_id,
169 std::string_view target_version_id) const;
171 ProgramActivationResult activate(std::string_view owner_scope,
172 std::string_view version_id,
173 std::uint64_t expected_generation);
175 ProgramActivationResult rollback(std::string_view owner_scope,
176 std::string_view version_id,
177 std::uint64_t expected_generation);
178 std::optional<ProgramActivation>
179 activation(std::string_view owner_scope) const;
181 std::optional<ProgramActivationBinding>
182 active_binding(std::string_view owner_scope) const;
183 ProgramRetentionReport collect_retention(
184 std::string_view owner_scope,
185 const std::vector<std::
string>& pinned_version_ids);
194 asio::awaitable<ProgramVersion> admit_async(ProgramBundle bundle, ProgramAdmission admission);
195 asio::awaitable<ProgramVersion> admit_composed_async(ProgramBundle bundle,
196 ProgramAdmission admission,
197 ProgramComposition composition);
198 asio::awaitable<std::optional<ProgramVersion>> find_version_async(std::
string id) const;
199 asio::awaitable<std::optional<ProgramVersion>> find_version_async(std::
string owner_scope,
200 std::
string id) const;
201 asio::awaitable<std::optional<ProgramVersion>> resolve_version_async(std::
string owner_scope,
203 asio::awaitable<std::optional<ProgramVersion>> resolve_version_with_binding_async(
204 std::
string owner_scope, std::
string id, CatalogCapabilityBinding binding);
205 asio::awaitable<MigrationPlan> plan_migration_async(std::
string owner_scope,
206 std::
string source_version_id,
207 std::
string target_version_id) const;
208 asio::awaitable<ProgramActivationResult> activate_async(std::
string owner_scope,
209 std::
string version_id,
210 std::uint64_t expected_generation);
211 asio::awaitable<ProgramActivationResult> rollback_async(std::
string owner_scope,
212 std::
string version_id,
213 std::uint64_t expected_generation);
214 asio::awaitable<std::optional<ProgramActivation>> activation_async(std::
string owner_scope) const;
215 asio::awaitable<std::optional<ProgramActivationBinding>> active_binding_async(
216 std::
string owner_scope) const;
219 bool completes_inline() const noexcept;
220 asio::awaitable<ProgramRetentionReport> collect_retention_async(
221 std::
string owner_scope, std::vector<std::
string> pinned_version_ids);
226 asio::awaitable<ProgramVersion> materialize_async(
227 ProgramBundle bundle, ProgramAdmission admission,
228 std::optional<CatalogCapabilityBinding> supplied_binding,
229 std::optional<ProgramVersion> expected_version,
bool publish,
230 ExecutionGuarantee effective_execution_guarantee,
231 std::shared_ptr<const detail::MaterializedProgram>* isolated_materialization =
nullptr);
232 asio::awaitable<std::optional<ProgramVersion>> resolve_version_impl_async(
233 std::
string owner_scope, std::
string id,
234 std::optional<CatalogCapabilityBinding> supplied_binding,
235 std::shared_ptr<const detail::MaterializedProgram>* isolated_materialization =
nullptr);
238 std::unique_ptr<Impl> impl_;
240 friend class detail::CatalogRuntimeAccess;
Owner-scoped activation records for immutable Program versions.
Immutable Program admission and policy snapshots.
Marks an exception type as a configuration or definition verdict.
Process-local cache of fully linked Core generations.
Also a graph::ConfigurationFailure (#364): inside a Core node it is NG.ConfigError,...
Marker for exceptions that are configuration or definition verdicts (#364).
Graph engine type definitions: channels, edges, nodes, events, and control flow.
std::function< std::string(const NodeFailure &failure)> FailureTextRedactor
Decides the free text a failure record may carry (#364).
Explicit compatibility plans between admitted Program versions.
Immutable, owner-scoped Program modules and bounded child composition.
Atomic storage of admitted Program bundles and versions.
Dependency injection context passed to nodes during construction.
Exact host-resource receipt returned by the Catalog capability binder.
Constructed only by the Catalog's trusted captured-capability registration.