# `Jizoku.Runtime.AgentRecovery`
[🔗](https://github.com/dark-trench/jizoku/blob/main/lib/jizoku/runtime/agent_recovery.ex#L1)

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.

# `queue`

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

# `recovery_update`

```elixir
@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`

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

# `recover`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
