Skip to main content

agent_storage/contracts/
task_run_store.rs

1//! Associates scheduled task definitions with durable agent runs.
2
3use super::{StorageError, StoredRun};
4use async_trait::async_trait;
5use uuid::Uuid;
6
7/// Associates a task occurrence with the run submitted for it.
8///
9/// Task definitions currently live in TOML files, so task IDs deliberately
10/// have no foreign key: history survives deletion of a task definition.
11#[async_trait]
12pub trait TaskRunStore: Send + Sync {
13    async fn associate_task_run(&self, task_id: Uuid, run_id: Uuid) -> Result<(), StorageError> {
14        let _ = (task_id, run_id);
15        Err(StorageError::Backend(
16            "task execution history is not supported by this storage backend".into(),
17        ))
18    }
19
20    async fn list_task_runs(&self, task_id: Uuid) -> Result<Vec<StoredRun>, StorageError> {
21        let _ = task_id;
22        Err(StorageError::Backend(
23            "task execution history is not supported by this storage backend".into(),
24        ))
25    }
26}