LLMDB.History.Migrator (LLM DB v2026.4.6)

Copy Markdown View Source

One-time migration from Git-tracked metadata history into snapshot-store artifacts.

The migrator walks reachable metadata commits, reconstructs canonical snapshots, materializes immutable snapshot artifacts by content hash, deduplicates adjacent identical states, and then rebuilds local history artifacts from the resulting snapshot observation chain.

Summary

Types

summary()

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

Functions

run(opts \\ [])

@spec run(keyword()) :: {:ok, summary()} | {:error, term()}