2.7 KiB
id, type, title, domain, repo, status, owner, topic_slug, planning_priority, planning_order, created, updated, depends_on
| id | type | title | domain | repo | status | owner | topic_slug | planning_priority | planning_order | created | updated | depends_on | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| USER-WP-0018 | workplan | Postgres Store Adapter | netkingdom | user-engine | finished | codex | netkingdom | medium | 18 | 2026-06-16 | 2026-06-16 |
|
USER-WP-0018 - Postgres Store Adapter
Goal
Add a dependency-free Postgres store adapter behind UserEngineStore that uses
the migration and serialization contracts from USER-WP-0016 and USER-WP-0017.
Scope Direction
The adapter should accept a provider-supplied DB-API or psycopg-like connection and avoid owning credentials, pooling, deployment, backups, or platform observability.
Non-Goals
- Do not vendor or require a Postgres driver in the core package.
- Do not add Docker or live database requirements to the unit test suite.
- Do not implement outbox claim/ack/retry or provider restore validation yet.
Tasks
id: USER-WP-0018-T1
status: done
priority: high
Add a Postgres adapter that implements the UserEngineStore protocol using the
generic record, audit, and outbox tables.
id: USER-WP-0018-T2
status: done
priority: high
Wire the adapter to StoreRecord serialization and deterministic record keys.
id: USER-WP-0018-T3
status: done
priority: high
Support schema readiness, migration execution, transactions, audit reads, pending outbox reads, and adapter-neutral record counts.
id: USER-WP-0018-T4
status: done
priority: medium
Add a fake Postgres connection that runs the shared conformance harness without requiring production infrastructure.
id: USER-WP-0018-T5
status: done
priority: medium
Document the provider boundary and remaining provider-backed conformance work.
Acceptance Criteria
- The adapter has no hard runtime dependency on a specific Postgres driver.
- The adapter passes the same store conformance harness as the in-memory store.
- Migration readiness uses the shared latest schema version.
- Record counts stay redacted and adapter-neutral.
- Docs explain that provider repositories still own live-driver, lock, restore, and outbox claiming validation.
Expected Outputs
user_engine.adapters.postgres.PostgresUserEngineStore.- Fake Postgres adapter tests.
- Durable-store documentation updates.
Implementation Notes
Implemented on 2026-06-16:
- Added
PostgresUserEngineStoreusing provider-supplied DB-API/psycopg-like connections. - Reused
StoreRecordserialization for all generic record writes and reads. - Added transaction, migration, readiness, audit, outbox, and record count support.
- Added fake connection tests that run the shared store conformance harness.