Skip to main content

TaskRepository

Trait TaskRepository 

Source
pub trait TaskRepository {
Show 38 methods // Required methods fn resolve_task_id(&self, task_id_or_prefix: &str) -> Result<String>; fn load_task_summary(&self, task_id: &str) -> Result<TaskSummary>; fn load_task_detail_rows(&self, task_id: &str) -> Result<TaskDetailRows>; fn load_task_item_counts(&self, task_id: &str) -> Result<(i64, i64, i64)>; fn list_task_ids_ordered_by_created_desc(&self) -> Result<Vec<String>>; fn find_latest_resumable_task_id( &self, include_pending: bool, ) -> Result<Option<String>>; fn load_task_runtime_row(&self, task_id: &str) -> Result<TaskRuntimeRow>; fn first_task_item_id(&self, task_id: &str) -> Result<Option<String>>; fn count_unresolved_items(&self, task_id: &str) -> Result<i64>; fn list_task_items_for_cycle( &self, task_id: &str, ) -> Result<Vec<TaskItemRow>>; fn load_task_status(&self, task_id: &str) -> Result<Option<String>>; fn set_task_status( &self, task_id: &str, status: &str, set_completed: bool, ) -> Result<()>; fn prepare_task_for_start_batch(&self, task_id: &str) -> Result<()>; fn update_task_cycle_state( &self, task_id: &str, current_cycle: u32, init_done: bool, ) -> Result<()>; fn mark_task_item_running(&self, task_item_id: &str) -> Result<()>; fn set_task_item_terminal_status( &self, task_item_id: &str, status: &str, ) -> Result<()>; fn update_task_item_status( &self, task_item_id: &str, status: &str, ) -> Result<()>; fn update_task_item_pipeline_vars( &self, task_item_id: &str, pipeline_vars_json: &str, ) -> Result<()>; fn load_task_name(&self, task_id: &str) -> Result<Option<String>>; fn list_task_log_runs( &self, task_id: &str, limit: usize, ) -> Result<Vec<TaskLogRunRow>>; fn insert_task_graph_run(&self, run: &NewTaskGraphRun) -> Result<()>; fn update_task_graph_run_status( &self, graph_run_id: &str, status: &str, ) -> Result<()>; fn insert_task_graph_snapshot( &self, snapshot: &NewTaskGraphSnapshot, ) -> Result<()>; fn load_task_graph_debug_bundles( &self, task_id: &str, ) -> Result<Vec<TaskGraphDebugBundle>>; fn delete_task_and_collect_log_paths( &self, task_id: &str, ) -> Result<Vec<String>>; fn insert_command_run(&self, run: &NewCommandRun) -> Result<()>; fn insert_event(&self, event: &DbEventRecord) -> Result<()>; fn update_command_run(&self, run: &NewCommandRun) -> Result<()>; fn update_command_run_with_events( &self, run: &NewCommandRun, events: &[DbEventRecord], ) -> Result<()>; fn persist_phase_result_with_events( &self, run: &NewCommandRun, events: &[DbEventRecord], ) -> Result<()>; fn update_command_run_pid(&self, run_id: &str, pid: i64) -> Result<()>; fn find_active_child_pids(&self, task_id: &str) -> Result<Vec<i64>>; fn find_inflight_command_runs_for_task( &self, task_id: &str, ) -> Result<Vec<InflightRunRecord>>; fn find_completed_runs_for_pending_items( &self, task_id: &str, ) -> Result<Vec<CompletedRunRecord>>; fn count_stale_pending_items(&self, task_id: &str) -> Result<i64>; fn count_recent_heartbeats_for_items( &self, task_id: &str, item_ids: &[String], cutoff_ts: &str, ) -> Result<i64>; fn update_task_pipeline_vars( &self, task_id: &str, pipeline_vars_json: &str, ) -> Result<()>; fn update_task_item_tickets( &self, task_item_id: &str, ticket_files_json: &str, ticket_content_json: &str, ) -> Result<()>;
}
Expand description

Synchronous repository interface for task, run, and event persistence.

Required Methods§

Source

fn resolve_task_id(&self, task_id_or_prefix: &str) -> Result<String>

Resolves a full task identifier from an exact ID or prefix.

Source

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

Loads the summary row for a task.

Source

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

Loads the full detail row bundle for a task.

Source

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

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

Source

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

Lists task identifiers ordered from newest to oldest.

Source

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

Returns the latest resumable task, optionally including pending tasks.

Source

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

Loads execution state needed to resume a task.

Source

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

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

Source

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

Counts unresolved items for the task.

Source

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

Lists task items participating in the current cycle.

Source

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

Loads the current task status string.

Source

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

Updates the task status and optionally stamps completion metadata.

Source

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

Prepares a task for a fresh start by resetting batch-execution state.

Source

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

Persists cycle counters and init_once completion state for a task.

Source

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

Marks a task item as currently running.

Source

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

Sets a terminal status for a task item.

Source

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

Updates a task item to an arbitrary status value.

Source

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

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

Loads the human-readable name of a task.

Source

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

Lists recent command runs for log streaming or inspection.

Source

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

Inserts a new task-graph planning run record.

Source

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

Updates the status of an existing task-graph run.

Source

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

Persists one task-graph snapshot.

Source

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

Loads debug bundles for graph-planning diagnostics.

Source

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

Deletes a task and returns log paths that should be cleaned up afterward.

Source

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

Inserts a command-run record.

Source

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

Inserts an event record.

Source

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

Updates an existing command-run record.

Source

fn update_command_run_with_events( &self, run: &NewCommandRun, events: &[DbEventRecord], ) -> Result<()>

Updates a command run and appends events in a single repository call.

Source

fn persist_phase_result_with_events( &self, run: &NewCommandRun, events: &[DbEventRecord], ) -> Result<()>

Persists a completed phase result together with its emitted events.

Source

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

Updates the operating-system PID associated with a running command.

Source

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

Returns active child PIDs for a task.

Source

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

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

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

Counts stale pending items (FR-038).

Source

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

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

Source

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

Persists the serialized pipeline-variable map for a task.

Source

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

Persists the active ticket lists and preview content for a task item.

Implementors§