Read-only runtime access to generated model history artifacts.
History is loaded from priv/llm_db/history (or config :llm_db, :history_dir).
NDJSON files are parsed into one immutable index published atomically through
:persistent_term for fast timeline/recent lookups without a cache process.
The cache uses one bounded key. Reloading replaces that key and therefore has
the normal :persistent_term global-GC update cost; reads remain lock-free.
Summary
Functions
Returns true when history artifacts are available and readable.
Returns parsed history metadata from meta.json.
Returns most recent events globally, ordered by captured_at then event_id descending.
Returns all timeline events for a model, lineage-aware and ordered by
captured_at then event_id ascending.
Types
@type event() :: map()
Functions
@spec available?() :: boolean()
Returns true when history artifacts are available and readable.
Returns parsed history metadata from meta.json.
@spec recent(pos_integer()) :: {:ok, [event()]} | {:error, term()}
Returns most recent events globally, ordered by captured_at then event_id descending.
Limit is capped to 500.
Returns all timeline events for a model, lineage-aware and ordered by
captured_at then event_id ascending.