Squidie.Runtime.AgentRecovery (squidie v0.1.2)

Copy Markdown View Source

Restart recovery coordinator for Jido-native workflow and dispatch agents.

The coordinator rebuilds both agents from durable journals, then drains the two restart-safe recovery windows in order: missing dispatch intents first, completed dispatch results second.

Summary

Functions

Rebuilds a workflow agent and dispatch agent, then drains restart recovery.

Types

queue()

@type queue() :: Squidie.Runtime.DispatchAgent.queue() | atom()

recovery_update()

@type recovery_update() :: %{
  workflow_agent: Jido.Agent.t(),
  dispatch_agent: Jido.Agent.t(),
  scheduled_runnables: [map()],
  applied_attempts: [Squidie.Runtime.DispatchProtocol.ActionAttempt.t()]
}

storage_config()

@type storage_config() :: Squidie.Runtime.Journal.storage_config()

Functions

recover(storage, run_id, queue \\ "default", opts \\ [])

@spec recover(
  storage_config(),
  Squidie.Runtime.WorkflowAgent.run_id(),
  queue(),
  keyword()
) ::
  {:ok, recovery_update()} | {:error, term()}

Rebuilds a workflow agent and dispatch agent, then drains restart recovery.

Planned runnable dispatch recovery runs before completed result recovery so a restart observes all durable workflow intent before applying durable dispatch outcomes back to the run thread.