In-memory versioned store for source-bearing capability preludes.
V1 is deliberately prelude-specific and volatile: it provides list/1,
history/2, read/2, compile-on-write write/4, and explicit
set_default/4 over a small handle backed by a single owner process and ETS
rows. Filesystem persistence remains a later plan chunk.
Bounds are fail-closed. :max_versions is the retained version window per
id, not a lifetime write count; version numbers remain monotonic while old
superseded rows may be pruned. A version selected with set_default/4 is
retained alongside the latest-version window.
:max_ids, :max_total_bytes, and :max_metadata_bytes cap node-lifetime
store growth.
Summary
Functions
Returns bounded summary rows for retained versions of one prelude id.
Returns one bounded current row per prelude id, sorted by id.
Starts a volatile in-memory prelude store and returns its handle.
Reads a candidate by bare id, id@version, or %{id, version, checksum} ref.
Moves the bare-id default/current pointer to an existing version.
Compiles and appends a new prelude version.
Types
@type t() :: %PtcRunner.PreludeStore{opts: keyword(), pid: GenServer.server()}
Functions
Returns bounded summary rows for retained versions of one prelude id.
Returns one bounded current row per prelude id, sorted by id.
Starts a volatile in-memory prelude store and returns its handle.
@spec read(t(), String.t() | map()) :: {:ok, PtcRunner.PreludeCandidate.t()} | {:error, map()}
Reads a candidate by bare id, id@version, or %{id, version, checksum} ref.
Moves the bare-id default/current pointer to an existing version.
id + version is the preferred explicit form. id@version or a
%{id, version, checksum} ref are also accepted for checksum-pinned default
changes.
Compiles and appends a new prelude version.
The compiled namespace list must be exactly [id]. Stored source and metadata
are untrusted; public projections bound and filter them.