# `Pixir.SessionTree`
[🔗](https://github.com/Ranvier-Technologies/pixir/blob/main/lib/pixir/session_tree.ex#L1)

Read-only Session tree projection over Pixir Logs.

This module does not create a second message store. It folds each Session's Log,
reads durable `subagent_event` and `session_fork` facts, and projects parent/child
relationships for presenters and diagnostics.

# `project`

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

Project one root Session into a JSON-serializable tree.

The root Session must have a Log in `opts[:workspace]`. Child Sessions referenced by
Subagent lifecycle events or fork lineage may be missing; those are represented
honestly with `"log_exists" => false`. Fork children are discovered by scanning
workspace Logs for `session_fork.parent_session_id` (ADR 0024).

# `render`

```elixir
@spec render(map()) :: String.t()
```

Render a compact human-readable tree.

---

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