# `Jido.AgentServer.ParentRef`
[🔗](https://github.com/agentjido/jido/blob/v2.3.0/lib/jido/agent_server/parent_ref.ex#L1)

Reference to a logical parent agent in Jido hierarchy tracking.

`ParentRef` models Jido's logical parent-child relationship, which is layered
on top of OTP supervision. Parent and child agents are still OTP peers under
a supervisor; the parent relationship is represented explicitly with this
struct, child-start signals, and process monitors.

While a child is attached, the runtime injects this value into
`agent.state.__parent__` so child actions can use `Directive.emit_to_parent/3`.
If the child becomes orphaned, the current parent ref is cleared and the former
parent is moved to `agent.state.__orphaned_from__`.

# `t`

```elixir
@type t() :: %Jido.AgentServer.ParentRef{
  id: binary(),
  meta: map(),
  partition: nil | any(),
  pid: any(),
  tag: any()
}
```

# `new`

```elixir
@spec new(map()) :: {:ok, t()} | {:error, term()}
```

Creates a new ParentRef from a map of attributes.

Returns `{:ok, parent_ref}` or `{:error, reason}`.

# `new!`

```elixir
@spec new!(map()) :: t()
```

Creates a new ParentRef from a map, raising on error.

# `validate`

```elixir
@spec validate(term()) :: {:ok, t()} | {:error, term()}
```

Validates that a value is a valid ParentRef.

