Skip to main content

AsyncSqliteTaskRepository

Struct AsyncSqliteTaskRepository 

Source
pub struct AsyncSqliteTaskRepository { /* private fields */ }
Expand description

Async wrapper around SqliteTaskRepository built on AsyncDatabase.

Implementations§

Source§

impl AsyncSqliteTaskRepository

Source

pub fn new(async_db: Arc<AsyncDatabase>) -> Self

Creates a new async repository wrapper.

Source

pub async fn resolve_task_id(&self, prefix: &str) -> Result<String>

Resolves a full task identifier from an ID prefix.

Source

pub async fn load_task_summary(&self, task_id: &str) -> Result<TaskSummary>

Loads a summary row for a task.

Source

pub async fn load_task_detail_rows( &self, task_id: &str, ) -> Result<TaskDetailRows>

Loads the full detail bundle for a task.

Source

pub async fn load_task_item_counts( &self, task_id: &str, ) -> Result<(i64, i64, i64)>

Loads (total, resolved, unresolved) item counts for a task.

Source

pub async fn list_task_ids_ordered_by_created_desc(&self) -> Result<Vec<String>>

Lists task identifiers ordered by creation time descending.

Source

pub async fn find_latest_resumable_task_id( &self, include_pending: bool, ) -> Result<Option<String>>

Returns the latest resumable task, optionally including pending tasks.

Source

pub async fn load_task_runtime_row( &self, task_id: &str, ) -> Result<TaskRuntimeRow>

Loads execution state required to resume a task.

Source

pub async fn first_task_item_id(&self, task_id: &str) -> Result<Option<String>>

Returns the first task-item identifier for a task, if present.

Source

pub async fn count_unresolved_items(&self, task_id: &str) -> Result<i64>

Counts unresolved task items.

Source

pub async fn list_task_items_for_cycle( &self, task_id: &str, ) -> Result<Vec<TaskItemRow>>

Lists task items participating in the current cycle.

Source

pub async fn load_task_status(&self, task_id: &str) -> Result<Option<String>>

Loads the current task status string.

Source

pub async fn load_task_name(&self, task_id: &str) -> Result<Option<String>>

Loads the human-readable task name.

Source

pub async fn list_task_log_runs( &self, task_id: &str, limit: usize, ) -> Result<Vec<TaskLogRunRow>>

Lists recent command runs used for log inspection.

Source

pub async fn load_task_graph_debug_bundles( &self, task_id: &str, ) -> Result<Vec<TaskGraphDebugBundle>>

Loads graph-planning debug bundles for a task.

Source

pub async fn set_task_status( &self, task_id: &str, status: &str, set_completed: bool, ) -> Result<()>

Updates a task status and optionally marks completion.

Source

pub async fn reset_unresolved_items(&self, task_id: &str) -> Result<()>

Resets unresolved items back to pending without changing the task status. Called before enqueuing a task so the worker can re-process them.

Source

pub async fn prepare_task_for_start_batch(&self, task_id: &str) -> Result<()>

Resets a task into a fresh batch-start state.

Source

pub async fn update_task_cycle_state( &self, task_id: &str, current_cycle: u32, init_done: bool, ) -> Result<()>

Persists cycle counters and init_once state.

Source

pub async fn mark_task_item_running(&self, task_item_id: &str) -> Result<()>

Marks a task item as running.

Source

pub async fn set_task_item_terminal_status( &self, task_item_id: &str, status: &str, ) -> Result<()>

Sets a terminal status for a task item.

Source

pub async fn update_task_item_status( &self, task_item_id: &str, status: &str, ) -> Result<()>

Updates a task item to an arbitrary status.

Source

pub async fn update_task_item_pipeline_vars( &self, task_item_id: &str, pipeline_vars_json: &str, ) -> Result<()>

Persists accumulated pipeline variables back to the task item’s dynamic_vars column.

Source

pub async fn delete_task_and_collect_log_paths( &self, task_id: &str, ) -> Result<Vec<String>>

Deletes a task and returns log paths that should be removed.

Source

pub async fn insert_command_run(&self, run: NewCommandRun) -> Result<()>

Inserts a command-run record.

Source

pub async fn insert_event(&self, event: DbEventRecord) -> Result<()>

Inserts an event record.

Source

pub async fn update_command_run(&self, run: NewCommandRun) -> Result<()>

Updates an existing command-run record.

Source

pub async fn update_command_run_with_events( &self, run: NewCommandRun, events: Vec<DbEventRecord>, ) -> Result<()>

Updates a command run and appends emitted events.

Source

pub async fn persist_phase_result_with_events( &self, run: NewCommandRun, events: Vec<DbEventRecord>, ) -> Result<()>

Persists a completed phase result together with emitted events.

Source

pub async fn update_command_run_pid(&self, run_id: &str, pid: i64) -> Result<()>

Updates the PID associated with a running command.

Source

pub async fn find_active_child_pids(&self, task_id: &str) -> Result<Vec<i64>>

Returns active child PIDs for a task.

Source

pub async fn find_inflight_command_runs_for_task( &self, task_id: &str, ) -> Result<Vec<InflightRunRecord>>

Returns in-flight command runs for a task (FR-038).

Source

pub async fn find_completed_runs_for_pending_items( &self, task_id: &str, ) -> Result<Vec<CompletedRunRecord>>

Returns completed runs whose parent items are still pending (FR-038).

Source

pub async fn count_stale_pending_items(&self, task_id: &str) -> Result<i64>

Counts stale pending items (FR-038).

Source

pub async fn count_recent_heartbeats_for_items( &self, task_id: &str, item_ids: &[String], cutoff_ts: &str, ) -> Result<i64>

FR-052: Counts recent heartbeat events for specified item IDs since cutoff.

Source

pub async fn update_task_pipeline_vars( &self, task_id: &str, pipeline_vars_json: &str, ) -> Result<()>

Persists the serialized pipeline-variable map for a task.

Source

pub async fn update_task_item_tickets( &self, task_item_id: &str, ticket_files_json: &str, ticket_content_json: &str, ) -> Result<()>

Persists active ticket paths and preview content for a task item.

Source

pub async fn insert_task_graph_run(&self, run: NewTaskGraphRun) -> Result<()>

Inserts a task-graph planning run.

Source

pub async fn update_task_graph_run_status( &self, graph_run_id: &str, status: &str, ) -> Result<()>

Updates the status of a task-graph planning run.

Source

pub async fn pause_all_running_tasks_and_items(&self) -> Result<usize>

Blanket-pause all running tasks and reset their items to pending. Used during daemon shutdown before exec() to prevent orphaned state.

Source

pub async fn pause_restart_pending_tasks_and_items(&self) -> Result<usize>

Pauses only tasks in restart_pending status and resets their running items.

Source

pub async fn recover_orphaned_running_items( &self, ) -> Result<Vec<(String, Vec<String>)>>

Recovers all orphaned running items across all tasks.

Source

pub async fn recover_orphaned_running_items_for_task( &self, task_id: &str, ) -> Result<Vec<String>>

Recovers orphaned running items for a single task.

Source

pub async fn recover_stalled_running_items( &self, stall_threshold_secs: u64, exclude_task_ids: HashSet<String>, ) -> Result<Vec<(String, Vec<String>)>>

Recovers stalled running items older than the given threshold.

Tasks in exclude_task_ids are skipped (they have active workers).

Source

pub async fn insert_task_graph_snapshot( &self, snapshot: NewTaskGraphSnapshot, ) -> Result<()>

Persists one task-graph snapshot payload.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyExt for T
where T: Any + ?Sized,

Source§

fn downcast_ref<T>(this: &Self) -> Option<&T>
where T: Any,

Attempts to downcast this to T behind reference
Source§

fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>
where T: Any,

Attempts to downcast this to T behind mutable reference
Source§

fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>
where T: Any,

Attempts to downcast this to T behind Rc pointer
Source§

fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>
where T: Any,

Attempts to downcast this to T behind Arc pointer
Source§

fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>
where T: Any,

Attempts to downcast this to T behind Box pointer
Source§

fn downcast_move<T>(this: Self) -> Option<T>
where T: Any, Self: Sized,

Attempts to downcast owned Self to T, useful only in generic context as a workaround for specialization
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, X> CoerceTo<T> for X
where T: CoerceFrom<X> + ?Sized,

Source§

fn coerce_rc_to(self: Rc<X>) -> Rc<T>

Source§

fn coerce_box_to(self: Box<X>) -> Box<T>

Source§

fn coerce_ref_to(&self) -> &T

Source§

fn coerce_mut_to(&mut self) -> &mut T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more