Pixir.Delegate.Handle (pixir v0.1.5)

Copy Markdown View Source

Stable Delegate handle helpers.

Delegate service mode has two identities:

  • delegate_id is the user-facing service handle returned by Delegate surfaces;
  • parent_session_id is the durable Pixir Session Log root used for diagnostics, tree projection, and restart-safe status.

The current implementation has no separate durable Delegate index. To keep status/attach/cancel useful before a resident owner exists, delegate_id is a reversible dlg1_... wrapper around parent_session_id. Future owner-backed service mode may move this mapping into a durable index, but it must continue exposing the parent Session id instead of hiding Log truth behind an opaque service id.

Summary

Functions

Build a versioned Delegate handle from a parent Session id.

Resolve either a Delegate id or a parent Session id into the stable handle shape.

Functions

build(parent_session_id, opts \\ [])

@spec build(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, map()}

Build a versioned Delegate handle from a parent Session id.

resolve(handle_or_session_id, opts \\ [])

@spec resolve(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, map()}

Resolve either a Delegate id or a parent Session id into the stable handle shape.

Bare Session ids remain accepted for compatibility with the existing attached runner and diagnostics commands. A future durable Delegate index can replace the reversible encoding without changing callers that already inspect parent_session_id.