4#include <neograph/program/core_provider_call.h>
6#include <neograph/types.h>
7#include <neograph/provider.h>
8#include <core/native_archive.h>
9#include <runtime/client.h>
21namespace neograph::program {
29 sp::runtime::Result outcome, std::exception_ptr cause,
30 std::exception_ptr observer_error = {})
32 std::move(outcome), std::move(cause)),
33 observer_error_(std::move(observer_error)) {}
34 const std::exception_ptr& observer_error()
const noexcept {
return observer_error_; }
36 std::exception_ptr observer_error_;
52 std::exception_ptr cause = {})
66 :
public std::runtime_error,
82 std::string source_run_id, std::string source_call_id);
83 Reason reason() const noexcept {
return reason_; }
85 const std::string&
call_id() const noexcept {
return call_id_; }
86 const std::string& source_run_id() const noexcept {
return source_run_id_; }
88 const std::string&
source_call_id() const noexcept {
return source_call_id_; }
91 std::string call_id_, source_run_id_, source_call_id_;
108 :
public std::runtime_error,
113 const std::string&
call_id() const noexcept {
return call_id_; }
115 const std::string&
later_call_id() const noexcept {
return later_call_id_; }
117 std::string call_id_, later_call_id_;
163 std::string database_path, std::shared_ptr<sp::NativeArchive> native_archive = {});
172 std::string provider_binding_identity);
181 std::string provider_binding_identity);
186 enum class State { Dispatched, Succeeded, ReconciliationRequired, Failed };
189 std::string request_digest;
190 std::string provider_binding_identity;
191 std::string original_attempt;
192 std::string outcome_digest;
193 std::string provider_name;
197 std::string original_deadline;
198 std::uint32_t encoding_version;
200 std::uint64_t claim_amount;
201 std::uint64_t committed_amount;
205 std::optional<ProgramMonetaryRecord> monetary_record;
210 std::uint32_t identity_version = 2;
212 std::string content_digest;
214 std::string policy_identity;
216 std::string producer;
219 bool opens_upload_session =
false;
222 std::uint32_t restarts = 0;
226 bool superseded =
false;
228 std::optional<Record> inspect(std::string_view owner_scope,
229 std::string_view dispatch_id)
const;
234 enum class Via : std::uint8_t {
240 std::string journaled_policy_identity;
241 std::string observed_policy_identity;
242 std::uint64_t attempt = 0;
243 Via via = Via::Replay;
248 std::string_view dispatch_id)
const;
260 Reason reason = Reason::OutcomeUnknown;
261 std::uint64_t attempt = 0;
263 State replaced_state = State::Dispatched;
264 std::string replaced_outcome_digest;
269 std::vector<Restart>
restarts(std::string_view owner_scope,
270 std::string_view dispatch_id)
const;
287 std::string evidence_identity, sp::runtime::Result completion);
291 std::shared_ptr<Impl> impl_;
Post-dispatch host failure retaining the exact drained provider outcome.
Marks an exception type as a configuration or definition verdict.
A dispatch may have reached the provider, but no outcome is known: the transport raised instead of re...
A fork reached a provider call its source already journaled at the same position, and could neither a...
const std::string & call_id() const noexcept
The fork's logical call id (SQLiteProgramProviderCallJournal::logical_call_id).
const std::string & source_call_id() const noexcept
The source's logical call id of the record that could not be adopted.
Transport returned this exact outcome, but its durable settlement failed.
A resumed Program reached a chunked upload that cannot continue (#541).
const std::string & later_call_id() const noexcept
The logical call id of the first later call of the same node that the journal holds.
const std::string & call_id() const noexcept
The logical call id (SQLiteProgramProviderCallJournal::logical_call_id) of the call that opened the u...
Host-owned SQLite dispatch journal.
void reconcile_success(std::string_view owner_scope, std::string_view dispatch_id, std::string evidence_identity, sp::runtime::Result completion)
Only after independent provider-side evidence establishes this exact result.
std::vector< PolicyChange > policy_changes(std::string_view owner_scope, std::string_view dispatch_id) const
The policy changes noted for one call, oldest first.
ProgramCoreProviderCallBinding bind(const ProgramCoreProviderCallContext &context, std::string provider_binding_identity)
The provider identity is the host's immutable deployment/credential-route digest.
ProgramCoreProviderCallBinding bind_priced(const ProgramCoreProviderCallContext &context, std::string provider_binding_identity)
bind() that also prices every call against the context's monetary account, as bind_priced_provider_ca...
static std::string logical_call_id(const ProgramCoreProviderCallContext &context, const graph::ProviderCallIdentity &call)
Stable across Program attempts; request content is bound to the slot.
std::vector< Restart > restarts(std::string_view owner_scope, std::string_view dispatch_id) const
The restarts noted for one call, oldest first.
Marker for exceptions that are configuration or definition verdicts (#364).
Immutable outcome of one Program run attempt.
Stable Core call identity.
Host binding for one Program operation.
Exact Program operation requesting a host-owned Core provider broker.
A time a call was matched to its record under another descriptor policy identity than the record name...
A time a resume sent a call that opens a chunked upload's session again, in place of its record (#541...