generated from coulomb/repo-seed
feat: add durable store conformance harness
This commit is contained in:
@@ -231,6 +231,21 @@ adapter or provider concerns outside the domain service.
|
||||
|
||||
## Migration Contract
|
||||
|
||||
The isolated store exposes `SCHEMA_VERSION = 0001_initial` and a `migrate`
|
||||
hook. Database-backed stores must expose equivalent readiness semantics before
|
||||
they are accepted by platform adapters.
|
||||
`user_engine.migrations` exposes the ordered durable-store manifest,
|
||||
`LATEST_SCHEMA_VERSION`, logical record types, and adapter-neutral diagnostic
|
||||
count keys. The isolated store's `SCHEMA_VERSION` is derived from that manifest
|
||||
and its `migrate` hook must be idempotent. Database-backed stores must expose
|
||||
equivalent readiness semantics before they are accepted by platform adapters.
|
||||
|
||||
Provider-backed Postgres adapters can use
|
||||
`migrations/postgres/0001_user_engine_store.sql` as the bootstrap contract or
|
||||
translate it into their own migration framework while preserving schema-version
|
||||
tracking, logical record uniqueness, audit durability, and pending-outbox
|
||||
reads.
|
||||
|
||||
Future adapters should run
|
||||
`user_engine.testing.assert_user_engine_store_conformance(testcase, factory)`
|
||||
with a factory that returns a fresh store. The harness covers readiness,
|
||||
idempotent migration, core save/read/query behavior, transaction rollback,
|
||||
outbox ordering, and diagnostics that expose counts without raw factor or
|
||||
profile values.
|
||||
|
||||
Reference in New Issue
Block a user