App Backends Pack
The App Backends Pack (@hellmai/lumenflow-packs-app-backends) defines what an application
backend is, independent of where its database runs, and gives provider authors the means to prove
their adapter honours that definition.
What ships
Section titled “What ships”- The contract (
/contract): zod schemas and types for backends, operations, migrations, restore points, exports and the capability document an adapter declares. Enums are closed; provider-specific values carry anx-prefix. See Contract. - The adapter SPI (
/spi): theAppBackendAdapterinterface with 25 operations, the operation context, the error taxonomy withretryableandoutcomeflags, and deadlines. See Adapter SPI. - Idempotency (
/idempotency): RFC 8785 request hashes, tenant-scoped operation records and a shared operation pipeline that gives an adapter the idempotency, deadline, capability and ownership rules without re-deriving them. - A conformance kit (
/conformance): a runner, a catalogue of 32 cases that include negative and adversarial ones, and the harness interfaces an adapter author implements. A bad adapter fails. See Conformance kit. - An in-memory reference adapter (
/testing): a complete adapter for tests and examples, not a production backend. - A bring-your-own Postgres adapter (
/adapters/postgres-url): runs backends as separate databases on a Postgres server you operate. See Postgres adapter. - A standalone export verifier and importer (
/export-format, and theapp-backends-exportcommand): checks aneutral-jsonl-v1export and loads it into any plain Postgres, with no adapter, control plane or LumenFlow configuration. See Export format.
What does not ship
Section titled “What does not ship”The data plane that serves a backend to an application (the gateway, the data API and the auth processes) is separate and is not in this pack. So is the custody service that holds credentials in production. The pack defines the sealed references that cross that boundary and the two-method sealing port the Postgres adapter needs; it does not implement production custody.
An adapter that passes the conformance kit is a statement about how it behaves at the SPI boundary. It is not a statement about the data plane in front of it.
Install
Section titled “Install”Requires Node.js 26 or later. pg is an optional peer dependency (version 8.11 or later); every
subpath except /adapters/postgres-url/pg imports without it, and the Postgres adapter loads it on first
use.
Subpaths: . (contract, SPI and idempotency), /contract, /spi, /idempotency, /conformance,
/testing, /adapters/postgres-url, /adapters/postgres-url/pg and /adapters/postgres-url/conformance.
A minimal end-to-end example
Section titled “A minimal end-to-end example”Run the conformance suite against the in-memory reference adapter. The adapter and its harness come
from createMemoryAdapter(), and runConformance takes them together.
Call the adapter directly with a context built by buildOpContext, which computes the request hash
for you:
To see the kit reject a bad adapter, build the reference adapter with an injected defect:
MEMORY_DEFECTS lists every defect the reference adapter can be built with, and
MEMORY_DEFECT_EXPECTED_FAILURES maps each one to the case ids that must fail.
Where to go next
Section titled “Where to go next”See also the pack catalog and Pack Contract v2.