# `Pixir.Delegate.Owner`
[🔗](https://github.com/Ranvier-Technologies/pixir/blob/main/lib/pixir/delegate/owner.ex#L1)

Delegate owner boundary and service-state vocabulary.

This module is intentionally small: it does not start a daemon or keep a second durable
store. It names the live-capability boundary required by ADR 0034 so `status`,
`attach`, and `cancel` can report the difference between durable Log snapshots and
active owner-backed behavior.

Current service state:

  * `snapshot_only` means durable Log evidence was readable, but no resident Delegate
    owner is reachable for streaming attach or active cancellation.
  * `live_manager_handles` means the current BEAM runtime has Subagent Manager handles
    for active children, but this is not yet a resident Delegate owner.
  * `live_delegate_owner` means this BEAM runtime has a registered Delegate owner for
    active status/cancel capability. It does not imply cross-invocation daemon
    residency for one-shot escript callers.
  * `stale_handle` means durable evidence claims work was active, but no live handle
    exists in this runtime.
  * `owner_unavailable` means the runtime needed for a live operation could not be
    reached at all.

# `cancel_state`

```elixir
@spec cancel_state(map(), [map()], [map()], [map()], [map()], keyword()) ::
  {:ok, map()} | {:error, map()}
```

Classify cancel reachability from durable and live Manager evidence.

# `live_owner_state`

```elixir
@spec live_owner_state(map(), map(), keyword()) :: {:ok, map()} | {:error, map()}
```

Return live owner state for a current-runtime Delegate owner.

# `owner_unavailable_error`

```elixir
@spec owner_unavailable_error(map(), map() | nil, keyword()) ::
  {:ok, map()} | {:error, map()}
```

Build a structured owner-unavailable error for active operations.

# `snapshot_state`

```elixir
@spec snapshot_state(
  map(),
  keyword()
) :: {:ok, map()} | {:error, map()}
```

Return owner state for a durable snapshot operation.

# `stale_handle_error`

```elixir
@spec stale_handle_error(map(), [map()], keyword()) :: {:ok, map()} | {:error, map()}
```

Build a structured stale-handle error for active operations.

---

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