API Reference StatifierPersistence v#0.12.0

Copy Markdown View Source

Modules

Durable stepper and storage adapters for Statifier.

Execution-to-quiescence over StatifierPersistence.Executions: the loop that answers the chart's <invoke> calls and keeps stepping until it stops asking.

Compile-time Ecto configuration on the host's own module (ADR-0002).

The resolved configuration behind use StatifierPersistence.Ecto.

Behaviour a surrogate-key scheme implements for the Ecto layer.

Database-assigned auto-increment keys (ADR-0002 decision 2).

RFC 9562 UUIDv7 keys (ADR-0002 decision 2).

The default key generator: k-sortable UXID strings (ADR-0002 decision 2).

Versioned migrations for this package's tables, in the Oban.Migration mold: the host writes one ordinary migration that delegates here, and later package versions ship higher-numbered migration modules the same call picks up.

V01 of the package DDL: the charts, positions, and executions tables per ADR-0002 (as amended) and the storage contract's field set (ADR-0003 decision 3).

V02 of the package DDL: the nullable metadata jsonb column on the executions table (ADR-0006 decision 3, decision 4's migration shape).

V03 of the package DDL: the executions table's nullable outcome_blob column, and a GIN index on metadata.

V04 of the package DDL: rebuilds V03's metadata GIN index with CREATE INDEX CONCURRENTLY.

V05 of the package DDL: the per-execution input log table (ADR-0010 decision 9).

V06 of the package DDL: the conditional, in-place rename of the durable noun (ADR-0011 decision 3).

The host-facing view of a durable execution: what state is this execution in - never what its bytes are. The position blob stays on the stored record (ADR-0004 decision 1), loaded only through the guarded StatifierPersistence.Storage.load_execution_position/3 path; this struct carries the fields a host reads to decide what to do with an execution.

A durable subchart child's parent linkage: the reserved, package-owned namespace inside an execution's metadata (ADR-0008 decision 2).

The execution lifecycle: create and step durable executions with no live Session process, the loop this package exists to package.

The seam through which a stepped execution's effects reach the host (ADR-0004 decision 4).

The per-execution serialization strategy behaviour (ADR-0004 decision 5): the seam through which concurrent deliveries to one execution are ordered.

The default StatifierPersistence.Serialization strategy (ADR-0004 decision 5): per-execution ordering as the storage adapter's own lock.

The guarded entry point from a storage adapter to a Statifier.MachineState.t().

The storage contract: opaque blobs keyed by engine identities.

The Ecto StatifierPersistence.Storage.Adapter: the storage contract over the schemas a host generates with use StatifierPersistence.Ecto (ADR-0002), against the tables the versioned migrations helper creates. Requires the optional ecto_sql dependency (ADR-0005).

The reference StatifierPersistence.Storage.Adapter: an Agent holding three maps - charts keyed by content hash, positions keyed by session id, and executions keyed by execution id.

The :telemetry surface for this package's storage-phase seams (ADR-0009) - the single definition site for every [:statifier_persistence, ...] event name, and the one module in lib/ that calls :telemetry.execute/3.

Tiny compiled charts for this package's own tests and for the conformance template (ADR-0003 decision 5).

The conformance suite every StatifierPersistence.Storage.Adapter must pass. Ships in lib/ (ADR-0003 decision 5, st-ADR-0053's shape) so an adapter in another package runs the identical suite