Jizoku.Runtime.AgentRecovery (jizoku v0.4.0)

Copy Markdown View Source

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

The coordinator rebuilds both agents from durable journals, resolves a pending continuation for the target run, then drains the remaining restart-safe windows in order: missing dispatch intents first, completed dispatch results second. Resolution repairs a valid continuation or aborts its fence after a durable competing predecessor transition wins.

Summary

Functions

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

Types

queue()

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

recovery_update()

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

storage_config()

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

Functions

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

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

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

Pending continuation resolution runs before ordinary recovery so a durable fence cannot expose predecessor work again. Planned runnable dispatch recovery then runs before completed result recovery so a restart observes all durable workflow intent before applying durable dispatch outcomes back to the run thread.