# `LLMDB.History.Rebuilder`
[🔗](https://github.com/agentjido/llm_db/blob/main/lib/llm_db/history/rebuilder.ex#L1)

Rebuilds snapshot-based history artifacts from an ordered snapshot observation chain.

The observation chain is typically sourced from `snapshot-index.json` and contains
entries keyed by immutable `snapshot_id`, with optional provenance such as
`captured_at`, `source_commit`, and `parent_snapshot_id`.

Direct use is documentation-deprecated in favor of
`mix llm_db.history.rebuild`.

# `observation`

```elixir
@type observation() :: map()
```

# `summary`

```elixir
@type summary() :: %{
  snapshots_written: non_neg_integer(),
  unique_snapshots_written: non_neg_integer(),
  events_written: non_neg_integer(),
  output_dir: String.t(),
  snapshot_index_path: String.t(),
  latest_path: String.t(),
  from_snapshot_id: String.t() | nil,
  to_snapshot_id: String.t() | nil
}
```

# `rebuild`

```elixir
@spec rebuild(keyword()) :: {:ok, summary()} | {:error, term()}
```

---

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