# `Jidoka.Session.Lineage`
[🔗](https://github.com/agentjido/jidoka/blob/v0.9.0/lib/jidoka/session/lineage.ex#L1)

Durable parentage for a session created from a safe snapshot fork.

Lineage identifies the direct parent, the source snapshot, and the root of
the fork tree. It does not permit state mutation or effect re-execution.

# `t`

```elixir
@type t() :: %Jidoka.Session.Lineage{
  depth: integer(),
  forked_at_ms: integer(),
  parent_session_id: binary(),
  root_session_id: binary(),
  source_snapshot_id: binary()
}
```

# `new`

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

Builds session lineage from keyword or map attributes.

# `new!`

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

Builds session lineage and raises if the attributes are invalid.

# `next`

```elixir
@spec next(t() | nil, String.t(), String.t(), non_neg_integer()) ::
  {:ok, t()} | {:error, term()}
```

Builds the next lineage record for a session fork.

# `schema`

```elixir
@spec schema() :: Zoi.schema()
```

Returns the Zoi schema for session lineage.

---

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