Pixir.Delegate.Owner (pixir v0.1.6)

Copy Markdown View Source

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.

Summary

Functions

Classify cancel reachability from durable and live Manager evidence.

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

Build a structured owner-unavailable error for active operations.

Return owner state for a durable snapshot operation.

Build a structured stale-handle error for active operations.

Functions

cancel_state(handle, manager_children, cancelled_children, errors, stale_children, opts \\ [])

@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(handle, details \\ %{}, opts \\ [])

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

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

owner_unavailable_error(handle, cause \\ nil, opts \\ [])

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

Build a structured owner-unavailable error for active operations.

snapshot_state(handle, opts \\ [])

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

Return owner state for a durable snapshot operation.

stale_handle_error(handle, stale_children, opts \\ [])

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

Build a structured stale-handle error for active operations.