# StatifierPersistence v0.1.0 - Table of Contents

> Durable stepper and storage adapters for Statifier

## Pages

- [StatifierPersistence](readme.md)
- [Changelog](changelog.md)

- Guides
  - [Surviving a restart: the demo host](restart-demo.md)

- Architecture Decision Records
  - [Architecture Decision Records](adr-index.md)
  - [ADR-0001: Record architecture decisions](0001-record-architecture-decisions.md)
  - [ADR-0002: Storage keys and table names are host-configurable; engine identities are not](0002-configurable-keys-and-table-names.md)
  - [ADR-0003: Storage adapter behaviour and the identity guard](0003-storage-adapter-behaviour-and-the-identity-guard.md)
  - [ADR-0004: Run lifecycle, the executor seam, and per-run serialization](0004-run-lifecycle-executor-seam-and-serialization.md)
  - [ADR-0005: The Ecto layer ships in this package; the test harness is real Postgres](0005-ecto-in-package-and-postgres-test-harness.md)

## Modules

- [StatifierPersistence](StatifierPersistence.md): Durable stepper and storage adapters for Statifier.

- [StatifierPersistence.Ecto](StatifierPersistence.Ecto.md): Compile-time Ecto configuration on the host's own module (ADR-0002).
- [StatifierPersistence.Ecto.Config](StatifierPersistence.Ecto.Config.md): The resolved configuration behind `use StatifierPersistence.Ecto`.
- [StatifierPersistence.Ecto.KeyGenerator](StatifierPersistence.Ecto.KeyGenerator.md): Behaviour a surrogate-key scheme implements for the Ecto layer.
- [StatifierPersistence.Ecto.KeyGenerator.Bigserial](StatifierPersistence.Ecto.KeyGenerator.Bigserial.md): Database-assigned auto-increment keys (ADR-0002 decision 2).
- [StatifierPersistence.Ecto.KeyGenerator.UUIDv7](StatifierPersistence.Ecto.KeyGenerator.UUIDv7.md): RFC 9562 UUIDv7 keys (ADR-0002 decision 2).
- [StatifierPersistence.Ecto.KeyGenerator.UXID](StatifierPersistence.Ecto.KeyGenerator.UXID.md): The default key generator: k-sortable UXID strings (ADR-0002 decision 2).
- [StatifierPersistence.Ecto.Migrations](StatifierPersistence.Ecto.Migrations.md): 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.
- [StatifierPersistence.Ecto.Migrations.V01](StatifierPersistence.Ecto.Migrations.V01.md): V01 of the package DDL: the `charts`, `positions`, and `runs` tables
per ADR-0002 (as amended) and the storage contract's field set
(ADR-0003 decision 3).
- [StatifierPersistence.Executor](StatifierPersistence.Executor.md): The seam through which a stepped run's effects reach the host (ADR-0004
decision 4).
- [StatifierPersistence.Run](StatifierPersistence.Run.md): The host-facing view of a durable run: what state is this run 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_run_position/3` path; this struct
carries the fields a host reads to decide what to do with a run.

- [StatifierPersistence.Runs](StatifierPersistence.Runs.md): The run lifecycle: create and step durable runs with no live Session
process, the loop this package exists to package.
- [StatifierPersistence.Serialization](StatifierPersistence.Serialization.md): The per-run serialization strategy behaviour (ADR-0004 decision 5):
the seam through which concurrent deliveries to one run are ordered.
- [StatifierPersistence.Serialization.AdapterLock](StatifierPersistence.Serialization.AdapterLock.md): The default `StatifierPersistence.Serialization` strategy (ADR-0004
decision 5): per-run ordering as the storage adapter's own lock.
- [StatifierPersistence.Storage](StatifierPersistence.Storage.md): The guarded entry point from a storage adapter to a
`Statifier.MachineState.t()`.
- [StatifierPersistence.Storage.Adapter](StatifierPersistence.Storage.Adapter.md): The storage contract: opaque blobs keyed by engine identities.
- [StatifierPersistence.Storage.Ecto](StatifierPersistence.Storage.Ecto.md): 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).
- [StatifierPersistence.Storage.InMemory](StatifierPersistence.Storage.InMemory.md): The reference `StatifierPersistence.Storage.Adapter`: an Agent holding
three maps - charts keyed by content hash, positions keyed by session id,
and runs keyed by run id.
- [StatifierPersistence.Testing.Charts](StatifierPersistence.Testing.Charts.md): Tiny compiled charts for this package's own tests and for the conformance
template (ADR-0003 decision 5).
- [StatifierPersistence.Testing.StorageConformance](StatifierPersistence.Testing.StorageConformance.md): 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

