Struct SqliteTaskStore
pub struct SqliteTaskStore { /* private fields */ }Implementations§
Source§impl SqliteTaskStore
impl SqliteTaskStore
Sourcepub fn new(data_dir: &Path) -> Result<Self>
pub fn new(data_dir: &Path) -> Result<Self>
Open (creating if absent) the control-plane DB at <data_dir>/control_plane.db.
Additive: a fresh install gets an empty DB and today’s behavior is unchanged.
Sourcepub fn new_in_memory() -> Result<Self>
pub fn new_in_memory() -> Result<Self>
In-memory store for unit tests.
Sourcepub fn count_by_agent(&self, agent: &str) -> Result<u64>
pub fn count_by_agent(&self, agent: &str) -> Result<u64>
Admin enumeration — count this agent’s records (mirrors AcpSessionStore’s
count_*_by_agent; used by alias-delete cascades / observability).
Sourcepub fn delete_by_agent(&self, agent: &str) -> Result<u64>
pub fn delete_by_agent(&self, agent: &str) -> Result<u64>
Admin enumeration — delete this agent’s records (alias-delete cascade).
Trait Implementations§
Source§impl GoalTaskRegistry for SqliteTaskStore
impl GoalTaskRegistry for SqliteTaskStore
fn create_goal<'life0, 'async_trait>(
&'life0 self,
task: TaskRecord,
goal: GoalTaskRecord,
continuation_context: Option<TaskContinuationContext>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn latest_active_goal_for_agent<'life0, 'life1, 'async_trait>(
&'life0 self,
agent: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn latest_active_goal_for_agent<'life0, 'life1, 'async_trait>(
&'life0 self,
agent: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve the latest non-terminal goal task for
agent directly from the
canonical task table. This is a read-only resolver, not cached state.fn latest_active_goal_for_context<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
agent: &'life1 str,
originator_route: Option<&'life2 str>,
principal_id: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Source§fn latest_active_goal_id_for_context<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
agent: &'life1 str,
originator_route: Option<&'life2 str>,
principal_id: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn latest_active_goal_id_for_context<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
agent: &'life1 str,
originator_route: Option<&'life2 str>,
principal_id: Option<&'life3 str>,
) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Resolve only the id of the latest non-terminal goal for the trusted
runtime context. This is a read-only projection from
tasks.id, used
by hot attribution paths that do not need the full task record.fn get_goal_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<GoalTaskRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_goal_objective<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
objective: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn update_goal_limits<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
token_limit: Option<u64>,
cost_limit_usd: Option<f64>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_goal_limits<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
token_limit: Option<u64>,
cost_limit_usd: Option<f64>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Replace the persisted effective budget limits for a goal.
These are creation/update-time policy limits only. Consumed and
remaining usage stay derived from canonical usage ledger rows.
fn update_goal_pause<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
pause: Option<GoalPauseState>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn pause_goal_task<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
pause: GoalPauseState,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resume_goal_task<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
owner_pid: u32,
owner_boot_id: &'life2 str,
continuation_context: Option<TaskContinuationContext>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn set_continuation_context<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
context: Option<TaskContinuationContext>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_continuation_context<'life0, 'life1, 'async_trait>(
&'life0 self,
task_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskContinuationContext>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl TaskRegistry for SqliteTaskStore
impl TaskRegistry for SqliteTaskStore
Source§fn create<'life0, 'async_trait>(
&'life0 self,
rec: TaskRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create<'life0, 'async_trait>(
&'life0 self,
rec: TaskRecord,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Register a new unit of work. Idempotent on
rec.id.Source§fn heartbeat<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner_boot_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn heartbeat<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner_boot_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Stamp a liveness beat for
id from the heart-beating owner.Source§fn record_progress<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner_boot_id: &'life2 str,
progress: &'life3 TaskProgress,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn record_progress<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner_boot_id: &'life2 str,
progress: &'life3 TaskProgress,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Record live progress for a running task and refresh its heartbeat.
Only the owning boot can write, and only while the task is running;
returns
false when either check fails.Source§fn update_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
status: TaskStatus,
output: Option<String>,
error: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_status<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
status: TaskStatus,
output: Option<String>,
error: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Transition
id to status, optionally recording terminal output/error.Source§fn transition_terminal<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
status: TaskStatus,
output: Option<String>,
error: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn transition_terminal<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
status: TaskStatus,
output: Option<String>,
error: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Atomically settle a non-terminal task and record its terminal payload.
Returns
true only for the caller that won the terminal transition.Source§fn transition_terminal_if_owner<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner_pid: u32,
owner_boot_id: &'life2 str,
status: TaskStatus,
output: Option<String>,
error: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn transition_terminal_if_owner<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner_pid: u32,
owner_boot_id: &'life2 str,
status: TaskStatus,
output: Option<String>,
error: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Atomically settle
id only when the captured owner still matches and
the task remains non-terminal. Returns false when ownership or
lifecycle changed first.Source§fn persist_terminal_settlement_intent<'life0, 'async_trait>(
&'life0 self,
intent: TerminalSettlementIntent,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn persist_terminal_settlement_intent<'life0, 'async_trait>(
&'life0 self,
intent: TerminalSettlementIntent,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Record an unapplied terminal transition before its artifact is published.
Returns
false when the task is no longer non-terminal or owner-matched.Source§fn list_terminal_settlement_intents<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<TerminalSettlementIntent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_terminal_settlement_intents<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<TerminalSettlementIntent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List terminal transitions that still need recovery.
Source§fn promote_terminal_settlement<'life0, 'life1, 'async_trait>(
&'life0 self,
intent: &'life1 TerminalSettlementIntent,
resolved_status: TaskStatus,
output: Option<String>,
error: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn promote_terminal_settlement<'life0, 'life1, 'async_trait>(
&'life0 self,
intent: &'life1 TerminalSettlementIntent,
resolved_status: TaskStatus,
output: Option<String>,
error: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Apply a settlement intent and delete that unchanged intent in one SQLite
transaction.
resolved_status is normally the intent’s desired status;
recovery may conservatively resolve a corrupt artifact as Failed.Source§fn discard_terminal_settlement_intent<'life0, 'life1, 'async_trait>(
&'life0 self,
intent: &'life1 TerminalSettlementIntent,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn discard_terminal_settlement_intent<'life0, 'life1, 'async_trait>(
&'life0 self,
intent: &'life1 TerminalSettlementIntent,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove an unchanged stale intent without changing the canonical task row.
fn claim_owner<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner_pid: u32,
owner_boot_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_snapshot<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskSnapshot>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_running<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<TaskRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_by_agent<'life0, 'life1, 'async_trait>(
&'life0 self,
agent: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<TaskRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn reconcile_lost<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
_now_boot_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn reconcile_lost<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 str,
_now_boot_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Reaper/recovery seam: mark a record terminal-loss ONLY when this process is
authoritative for it. Returns
false (no write) when another live process
owns it. now_boot_id remains part of the recovery seam for reaper filtering.
See crate::control_plane::authority::is_authoritative.Source§fn reconcile_timed_out<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner_pid: u32,
owner_boot_id: &'life2 str,
heartbeat_at: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn reconcile_timed_out<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
id: &'life1 str,
owner_pid: u32,
owner_boot_id: &'life2 str,
heartbeat_at: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Mark a stale-heartbeat task timed out only if the observed owner and
heartbeat still match. Returns
false when liveness changed first.Auto Trait Implementations§
impl !Freeze for SqliteTaskStore
impl !RefUnwindSafe for SqliteTaskStore
impl !UnwindSafe for SqliteTaskStore
impl Send for SqliteTaskStore
impl Sync for SqliteTaskStore
impl Unpin for SqliteTaskStore
impl UnsafeUnpin for SqliteTaskStore
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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