Trait TaskRegistry
pub trait TaskRegistry: Send + Sync {
Show 17 methods
// Required methods
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 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 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 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 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;
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;
// Provided methods
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_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 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 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 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 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 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 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 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 { ... }
}Expand description
THE stable seam. One trait, backed once by SQLite. The ACP session store and the delegate/subagent/peer producers all converge here (CROSS-CUTTING epic-A D1).
Required Methods§
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
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 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,
Sourcefn 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.
Provided Methods§
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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 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,
Sourcefn 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.
Sourcefn 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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".