pub struct RunStore { /* private fields */ }Expand description
Persistence store for a single run.
Implementations§
Source§impl RunStore
impl RunStore
Sourcepub fn new(run_dir: &Path) -> Result<Arc<Self>, Error>
pub fn new(run_dir: &Path) -> Result<Arc<Self>, Error>
Create or open a run store at the given path.
Sourcepub fn upsert_agent_result(&self, cache: &AgentResultCache) -> Result<(), Error>
pub fn upsert_agent_result(&self, cache: &AgentResultCache) -> Result<(), Error>
Insert or update an agent result in the checkpoint directly. Used by JournalStore to persist cache_key_hash before appending the event.
Sourcepub fn upsert_agent_session(
&self,
session: &AgentSessionCheckpoint,
) -> Result<(), Error>
pub fn upsert_agent_session( &self, session: &AgentSessionCheckpoint, ) -> Result<(), Error>
Insert or update an agent session in the checkpoint.
Sourcepub fn init_run_with_meta(
&self,
run_id: RunId,
task: &str,
workflow_meta: Value,
) -> Result<(), Error>
pub fn init_run_with_meta( &self, run_id: RunId, task: &str, workflow_meta: Value, ) -> Result<(), Error>
Initialize a new run with declarative workflow metadata.
Sourcepub fn open_run(&self, _run_id: RunId) -> Result<Option<RunCheckpoint>, Error>
pub fn open_run(&self, _run_id: RunId) -> Result<Option<RunCheckpoint>, Error>
Open an existing run for resume.
Sourcepub fn append_event(&self, event: &AgentEvent) -> Result<(), Error>
pub fn append_event(&self, event: &AgentEvent) -> Result<(), Error>
Append an event to the log.
Sourcepub fn save_checkpoint(&self, checkpoint: &RunCheckpoint) -> Result<(), Error>
pub fn save_checkpoint(&self, checkpoint: &RunCheckpoint) -> Result<(), Error>
Save checkpoint to disk (public API, acquires lock).
Sourcepub fn get_checkpoint(&self) -> Option<RunCheckpoint>
pub fn get_checkpoint(&self) -> Option<RunCheckpoint>
Get current checkpoint.
Sourcepub fn get_findings(&self) -> Vec<Finding>
pub fn get_findings(&self) -> Vec<Finding>
Get all findings collected so far.
Sourcepub fn get_event_log(&self) -> Result<Vec<AgentEvent>, Error>
pub fn get_event_log(&self) -> Result<Vec<AgentEvent>, Error>
Get event log as a vector.
Sourcepub fn can_resume(&self) -> bool
pub fn can_resume(&self) -> bool
Check if a run can be resumed.
Sourcepub fn reset_status_to_running(&self) -> Result<(), Error>
pub fn reset_status_to_running(&self) -> Result<(), Error>
Reset checkpoint status to Running. Used when resuming a
failed/cancelled run — the terminal status is replaced so that
status queries reflect the active execution and a crash leaves a
resumable checkpoint.