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

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.

Bare and decoded parent Session ids use `Pixir.SessionId` exactly as supplied. This
boundary never trims or otherwise normalizes an invalid id before validation.

# `build`

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

Build a versioned Delegate handle from a parent Session id.

# `resolve`

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

---

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