pub struct SqliteRuntimeRepository { /* private fields */ }Available on crate feature
sqlite-persistence only.Implementations§
Source§impl SqliteRuntimeRepository
impl SqliteRuntimeRepository
pub fn new(db_path: &str) -> Result<SqliteRuntimeRepository, KernelError>
pub fn enqueue_attempt( &self, attempt_id: &str, run_id: &str, ) -> Result<(), KernelError>
pub fn set_attempt_timeout_policy( &self, attempt_id: &str, policy: &TimeoutPolicyConfig, ) -> Result<(), KernelError>
pub fn set_attempt_priority( &self, attempt_id: &str, priority: i32, ) -> Result<(), KernelError>
pub fn set_attempt_tenant_id( &self, attempt_id: &str, tenant_id: Option<&str>, ) -> Result<(), KernelError>
pub fn get_attempt_status( &self, attempt_id: &str, ) -> Result<Option<(u32, AttemptExecutionStatus)>, KernelError>
pub fn set_attempt_trace_context( &self, attempt_id: &str, trace_id: &str, parent_span_id: Option<&str>, span_id: &str, trace_flags: &str, ) -> Result<(), KernelError>
pub fn get_attempt_trace_context( &self, attempt_id: &str, ) -> Result<Option<AttemptTraceContextRow>, KernelError>
pub fn latest_attempt_trace_for_run( &self, run_id: &str, ) -> Result<Option<AttemptTraceContextRow>, KernelError>
pub fn latest_attempt_id_for_run( &self, run_id: &str, ) -> Result<Option<String>, KernelError>
pub fn advance_attempt_trace( &self, attempt_id: &str, next_span_id: &str, ) -> Result<Option<AttemptTraceContextRow>, KernelError>
pub fn set_attempt_started_at_for_test( &self, attempt_id: &str, started_at: Option<DateTime<Utc>>, ) -> Result<(), KernelError>
pub fn get_lease_for_attempt( &self, attempt_id: &str, ) -> Result<Option<LeaseRecord>, KernelError>
pub fn get_lease_by_id( &self, lease_id: &str, ) -> Result<Option<LeaseRecord>, KernelError>
pub fn active_leases_for_worker( &self, worker_id: &str, now: DateTime<Utc>, ) -> Result<usize, KernelError>
pub fn active_leases_for_tenant( &self, tenant_id: &str, now: DateTime<Utc>, ) -> Result<usize, KernelError>
pub fn queue_depth(&self, now: DateTime<Utc>) -> Result<usize, KernelError>
pub fn a2a_compat_queue_depth(&self) -> Result<usize, KernelError>
pub fn list_dispatchable_attempt_contexts( &self, now: DateTime<Utc>, limit: usize, ) -> Result<Vec<DispatchableAttemptContext>, KernelError>
pub fn heartbeat_lease_with_version( &self, lease_id: &str, worker_id: &str, expected_version: u64, heartbeat_at: DateTime<Utc>, lease_expires_at: DateTime<Utc>, ) -> Result<(), KernelError>
pub fn mark_attempt_status( &self, attempt_id: &str, status: AttemptExecutionStatus, ) -> Result<(), KernelError>
pub fn ack_attempt( &self, attempt_id: &str, status: AttemptExecutionStatus, retry_policy: Option<&RetryPolicyConfig>, now: DateTime<Utc>, ) -> Result<AttemptAckOutcome, KernelError>
pub fn get_attempt_retry_history( &self, attempt_id: &str, ) -> Result<Option<AttemptRetryHistorySnapshot>, KernelError>
pub fn list_dead_letters( &self, status_filter: Option<&str>, limit: usize, ) -> Result<Vec<DeadLetterRow>, KernelError>
pub fn get_dead_letter( &self, attempt_id: &str, ) -> Result<Option<DeadLetterRow>, KernelError>
pub fn replay_dead_letter( &self, attempt_id: &str, now: DateTime<Utc>, ) -> Result<DeadLetterRow, KernelError>
pub fn claim_replay_effect( &self, thread_id: &str, replay_target: &str, fingerprint: &str, now: DateTime<Utc>, ) -> Result<ReplayEffectClaim, KernelError>
pub fn complete_replay_effect( &self, fingerprint: &str, response_json: &str, now: DateTime<Utc>, ) -> Result<(), KernelError>
pub fn abandon_replay_effect( &self, fingerprint: &str, ) -> Result<(), KernelError>
pub fn list_replay_effects_for_thread( &self, thread_id: &str, ) -> Result<Vec<ReplayEffectLogRow>, KernelError>
pub fn upsert_job( &self, thread_id: &str, status: &str, ) -> Result<(), KernelError>
pub fn list_runs( &self, limit: usize, offset: usize, status_filter: Option<&str>, ) -> Result<Vec<(String, String, DateTime<Utc>)>, KernelError>
pub fn insert_interrupt( &self, interrupt_id: &str, thread_id: &str, run_id: &str, attempt_id: &str, value_json: &str, ) -> Result<(), KernelError>
pub fn list_interrupts( &self, status_filter: Option<&str>, run_id_filter: Option<&str>, limit: usize, ) -> Result<Vec<InterruptRow>, KernelError>
pub fn get_interrupt( &self, interrupt_id: &str, ) -> Result<Option<InterruptRow>, KernelError>
pub fn update_interrupt_status( &self, interrupt_id: &str, status: &str, ) -> Result<(), KernelError>
pub fn persist_interrupt_resume_result( &self, interrupt_id: &str, resume_payload_hash: &str, resume_response_json: &str, ) -> Result<(), KernelError>
pub fn record_step_report( &self, worker_id: &str, attempt_id: &str, action_id: &str, status: &str, dedupe_token: &str, ) -> Result<StepReportWriteResult, KernelError>
pub fn upsert_api_key_record( &self, key_id: &str, secret_hash: &str, active: bool, role: &str, ) -> Result<(), KernelError>
pub fn get_api_key_record( &self, key_id: &str, ) -> Result<Option<ApiKeyRow>, KernelError>
pub fn set_api_key_status( &self, key_id: &str, active: bool, ) -> Result<(), KernelError>
pub fn has_any_api_keys(&self) -> Result<bool, KernelError>
pub fn upsert_a2a_session( &self, session: &A2aSessionRow, ) -> Result<(), KernelError>
pub fn get_active_a2a_session( &self, sender_id: &str, now: DateTime<Utc>, ) -> Result<Option<A2aSessionRow>, KernelError>
pub fn purge_expired_a2a_sessions( &self, now: DateTime<Utc>, ) -> Result<u64, KernelError>
pub fn create_bounty( &self, bounty_id: &str, title: &str, description: Option<&str>, reward: i64, created_by: &str, created_at: DateTime<Utc>, ) -> Result<BountyRow, KernelError>
pub fn get_bounty( &self, bounty_id: &str, ) -> Result<Option<BountyRow>, KernelError>
pub fn accept_bounty( &self, bounty_id: &str, accepted_by: &str, accepted_at: DateTime<Utc>, ) -> Result<bool, KernelError>
pub fn close_bounty( &self, bounty_id: &str, closed_at: DateTime<Utc>, ) -> Result<bool, KernelError>
pub fn create_swarm_task( &self, parent_task_id: &str, decomposition_json: &str, proposer_id: &str, proposer_reward_pct: i32, solver_reward_pct: i32, aggregator_reward_pct: i32, status: &str, created_at: DateTime<Utc>, ) -> Result<SwarmTaskRow, KernelError>
pub fn get_swarm_task( &self, parent_task_id: &str, ) -> Result<Option<SwarmTaskRow>, KernelError>
pub fn upsert_worker_registration( &self, worker_id: &str, domains_json: &str, max_load: i32, metadata_json: Option<&str>, status: &str, now: DateTime<Utc>, ) -> Result<WorkerRegistryRow, KernelError>
pub fn get_worker_registration( &self, worker_id: &str, ) -> Result<Option<WorkerRegistryRow>, KernelError>
pub fn count_active_claims_for_worker( &self, worker_id: &str, now: DateTime<Utc>, ) -> Result<u64, KernelError>
pub fn create_dispute( &self, dispute_id: &str, bounty_id: &str, opened_by: &str, description: &str, created_at: DateTime<Utc>, ) -> Result<DisputeRow, KernelError>
pub fn get_dispute( &self, dispute_id: &str, ) -> Result<Option<DisputeRow>, KernelError>
pub fn append_dispute_evidence( &self, dispute_id: &str, submitted_by: &str, evidence_json: &str, ) -> Result<bool, KernelError>
pub fn resolve_dispute( &self, dispute_id: &str, resolved_by: &str, resolution: &str, resolved_at: DateTime<Utc>, ) -> Result<Option<DisputeRow>, KernelError>
pub fn settle_bounty_via_dispute( &self, bounty_id: &str, settlement_status: &str, closed_at: DateTime<Utc>, ) -> Result<bool, KernelError>
pub fn create_recipe(&self, recipe: &RecipeRow) -> Result<(), KernelError>
pub fn get_recipe( &self, recipe_id: &str, ) -> Result<Option<RecipeRow>, KernelError>
pub fn create_organism(&self, organism: &OrganismRow) -> Result<(), KernelError>
pub fn get_organism( &self, organism_id: &str, ) -> Result<Option<OrganismRow>, KernelError>
pub fn update_organism_status( &self, organism_id: &str, status: &str, current_step: i32, ) -> Result<bool, KernelError>
pub fn upsert_a2a_compat_task( &self, task: &A2aCompatTaskRow, ) -> Result<(), KernelError>
pub fn list_a2a_compat_tasks( &self, sender_id: &str, protocol_version: &str, ) -> Result<Vec<A2aCompatTaskRow>, KernelError>
pub fn claim_a2a_compat_task( &self, sender_id: &str, protocol_version: &str, now: DateTime<Utc>, lease_duration_ms: u64, requested_task_id: Option<&str>, ) -> Result<A2aCompatClaimOutcome, KernelError>
pub fn get_a2a_compat_task( &self, session_id: &str, ) -> Result<Option<A2aCompatTaskRow>, KernelError>
pub fn touch_a2a_compat_task_lease( &self, session_id: &str, sender_id: &str, now: DateTime<Utc>, lease_duration_ms: u64, ) -> Result<bool, KernelError>
pub fn remove_a2a_compat_task( &self, session_id: &str, ) -> Result<u64, KernelError>
pub fn append_audit_log(&self, entry: &AuditLogEntry) -> Result<(), KernelError>
pub fn list_audit_logs( &self, limit: usize, ) -> Result<Vec<AuditLogRow>, KernelError>
pub fn list_audit_logs_filtered( &self, request_id: Option<&str>, action: Option<&str>, from_ms: Option<i64>, to_ms: Option<i64>, limit: usize, ) -> Result<Vec<AuditLogRow>, KernelError>
Trait Implementations§
Source§impl Clone for SqliteRuntimeRepository
impl Clone for SqliteRuntimeRepository
Source§fn clone(&self) -> SqliteRuntimeRepository
fn clone(&self) -> SqliteRuntimeRepository
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl RuntimeRepository for SqliteRuntimeRepository
impl RuntimeRepository for SqliteRuntimeRepository
Source§fn list_dispatchable_attempts(
&self,
now: DateTime<Utc>,
limit: usize,
) -> Result<Vec<AttemptDispatchRecord>, KernelError>
fn list_dispatchable_attempts( &self, now: DateTime<Utc>, limit: usize, ) -> Result<Vec<AttemptDispatchRecord>, KernelError>
Return attempts eligible for dispatch at the current time.
Source§fn upsert_lease(
&self,
attempt_id: &str,
worker_id: &str,
lease_expires_at: DateTime<Utc>,
) -> Result<LeaseRecord, KernelError>
fn upsert_lease( &self, attempt_id: &str, worker_id: &str, lease_expires_at: DateTime<Utc>, ) -> Result<LeaseRecord, KernelError>
Create or replace a lease for an attempt.
Source§fn heartbeat_lease(
&self,
lease_id: &str,
heartbeat_at: DateTime<Utc>,
lease_expires_at: DateTime<Utc>,
) -> Result<(), KernelError>
fn heartbeat_lease( &self, lease_id: &str, heartbeat_at: DateTime<Utc>, lease_expires_at: DateTime<Utc>, ) -> Result<(), KernelError>
Refresh heartbeat for an existing lease.
Source§fn expire_leases_and_requeue(
&self,
stale_before: DateTime<Utc>,
) -> Result<u64, KernelError>
fn expire_leases_and_requeue( &self, stale_before: DateTime<Utc>, ) -> Result<u64, KernelError>
Expire stale leases and requeue affected attempts.
Source§fn transition_timed_out_attempts(
&self,
now: DateTime<Utc>,
) -> Result<u64, KernelError>
fn transition_timed_out_attempts( &self, now: DateTime<Utc>, ) -> Result<u64, KernelError>
Transition attempts that exceeded their configured execution timeout.
Source§fn latest_seq_for_run(&self, _run_id: &String) -> Result<u64, KernelError>
fn latest_seq_for_run(&self, _run_id: &String) -> Result<u64, KernelError>
Returns latest persisted sequence for a run (used by replay wiring).
Source§fn upsert_bounty(&self, bounty: &BountyRecord) -> Result<(), KernelError>
fn upsert_bounty(&self, bounty: &BountyRecord) -> Result<(), KernelError>
Create or update a bounty
Source§fn get_bounty(
&self,
bounty_id: &str,
) -> Result<Option<BountyRecord>, KernelError>
fn get_bounty( &self, bounty_id: &str, ) -> Result<Option<BountyRecord>, KernelError>
Get a bounty by ID
Source§fn list_bounties(
&self,
status: Option<&str>,
limit: usize,
) -> Result<Vec<BountyRecord>, KernelError>
fn list_bounties( &self, status: Option<&str>, limit: usize, ) -> Result<Vec<BountyRecord>, KernelError>
List bounties by status
Source§fn accept_bounty(
&self,
bounty_id: &str,
accepted_by: &str,
) -> Result<(), KernelError>
fn accept_bounty( &self, bounty_id: &str, accepted_by: &str, ) -> Result<(), KernelError>
Accept a bounty (transition to accepted)
Source§fn close_bounty(&self, bounty_id: &str) -> Result<(), KernelError>
fn close_bounty(&self, bounty_id: &str) -> Result<(), KernelError>
Close a bounty (transition to closed)
Source§fn upsert_swarm_decomposition(
&self,
task: &SwarmTaskRecord,
) -> Result<(), KernelError>
fn upsert_swarm_decomposition( &self, task: &SwarmTaskRecord, ) -> Result<(), KernelError>
Create or update swarm task decomposition
Source§fn get_swarm_decomposition(
&self,
parent_task_id: &str,
) -> Result<Option<SwarmTaskRecord>, KernelError>
fn get_swarm_decomposition( &self, parent_task_id: &str, ) -> Result<Option<SwarmTaskRecord>, KernelError>
Get swarm task decomposition
Source§fn register_worker(&self, worker: &WorkerRecord) -> Result<(), KernelError>
fn register_worker(&self, worker: &WorkerRecord) -> Result<(), KernelError>
Register a worker
Source§fn get_worker(
&self,
worker_id: &str,
) -> Result<Option<WorkerRecord>, KernelError>
fn get_worker( &self, worker_id: &str, ) -> Result<Option<WorkerRecord>, KernelError>
Get a worker by ID
Source§fn list_workers(
&self,
domain: Option<&str>,
status: Option<&str>,
limit: usize,
) -> Result<Vec<WorkerRecord>, KernelError>
fn list_workers( &self, domain: Option<&str>, status: Option<&str>, limit: usize, ) -> Result<Vec<WorkerRecord>, KernelError>
List workers by domain and status
Source§fn heartbeat_worker(
&self,
worker_id: &str,
heartbeat_at_ms: i64,
) -> Result<(), KernelError>
fn heartbeat_worker( &self, worker_id: &str, heartbeat_at_ms: i64, ) -> Result<(), KernelError>
Update worker heartbeat
Source§fn create_recipe(&self, recipe: &RecipeRecord) -> Result<(), KernelError>
fn create_recipe(&self, recipe: &RecipeRecord) -> Result<(), KernelError>
Create a recipe
Source§fn get_recipe(
&self,
recipe_id: &str,
) -> Result<Option<RecipeRecord>, KernelError>
fn get_recipe( &self, recipe_id: &str, ) -> Result<Option<RecipeRecord>, KernelError>
Get a recipe by ID
Source§fn fork_recipe(
&self,
original_id: &str,
new_id: &str,
new_author: &str,
) -> Result<Option<RecipeRecord>, KernelError>
fn fork_recipe( &self, original_id: &str, new_id: &str, new_author: &str, ) -> Result<Option<RecipeRecord>, KernelError>
Fork a recipe (create a copy with new ID)
Source§fn list_recipes(
&self,
author_id: Option<&str>,
limit: usize,
) -> Result<Vec<RecipeRecord>, KernelError>
fn list_recipes( &self, author_id: Option<&str>, limit: usize, ) -> Result<Vec<RecipeRecord>, KernelError>
List recipes by author
Source§fn express_organism(&self, organism: &OrganismRecord) -> Result<(), KernelError>
fn express_organism(&self, organism: &OrganismRecord) -> Result<(), KernelError>
Express a recipe as an organism
Source§fn get_organism(
&self,
organism_id: &str,
) -> Result<Option<OrganismRecord>, KernelError>
fn get_organism( &self, organism_id: &str, ) -> Result<Option<OrganismRecord>, KernelError>
Get an organism by ID
Source§fn update_organism(
&self,
organism_id: &str,
current_step: i32,
status: &str,
) -> Result<(), KernelError>
fn update_organism( &self, organism_id: &str, current_step: i32, status: &str, ) -> Result<(), KernelError>
Update organism status (step progression)
Source§fn create_session(&self, session: &SessionRecord) -> Result<(), KernelError>
fn create_session(&self, session: &SessionRecord) -> Result<(), KernelError>
Create a collaborative session
Source§fn get_session(
&self,
session_id: &str,
) -> Result<Option<SessionRecord>, KernelError>
fn get_session( &self, session_id: &str, ) -> Result<Option<SessionRecord>, KernelError>
Get a session by ID
Source§fn add_session_message(
&self,
message: &SessionMessageRecord,
) -> Result<(), KernelError>
fn add_session_message( &self, message: &SessionMessageRecord, ) -> Result<(), KernelError>
Add a message to session history
Source§fn get_session_history(
&self,
session_id: &str,
limit: usize,
) -> Result<Vec<SessionMessageRecord>, KernelError>
fn get_session_history( &self, session_id: &str, limit: usize, ) -> Result<Vec<SessionMessageRecord>, KernelError>
Get session message history
Source§fn open_dispute(&self, dispute: &DisputeRecord) -> Result<(), KernelError>
fn open_dispute(&self, dispute: &DisputeRecord) -> Result<(), KernelError>
Open a dispute
Source§fn get_dispute(
&self,
dispute_id: &str,
) -> Result<Option<DisputeRecord>, KernelError>
fn get_dispute( &self, dispute_id: &str, ) -> Result<Option<DisputeRecord>, KernelError>
Get a dispute by ID
Source§fn get_disputes_for_bounty(
&self,
bounty_id: &str,
) -> Result<Vec<DisputeRecord>, KernelError>
fn get_disputes_for_bounty( &self, bounty_id: &str, ) -> Result<Vec<DisputeRecord>, KernelError>
Get disputes for a bounty
Source§fn resolve_dispute(
&self,
dispute_id: &str,
resolution: &str,
resolved_by: &str,
) -> Result<(), KernelError>
fn resolve_dispute( &self, dispute_id: &str, resolution: &str, resolved_by: &str, ) -> Result<(), KernelError>
Resolve a dispute
Auto Trait Implementations§
impl Freeze for SqliteRuntimeRepository
impl RefUnwindSafe for SqliteRuntimeRepository
impl Send for SqliteRuntimeRepository
impl Sync for SqliteRuntimeRepository
impl Unpin for SqliteRuntimeRepository
impl UnsafeUnpin for SqliteRuntimeRepository
impl UnwindSafe for SqliteRuntimeRepository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more