Pixir.SessionTree (pixir v0.1.0)

Copy Markdown View Source

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.

Summary

Functions

Project one root Session into a JSON-serializable tree.

Render a compact human-readable tree.

Functions

project(session_id, opts \\ [])

@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(tree)

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

Render a compact human-readable tree.