Files
aevolution/docs/adr/0016-persistence-and-region-ownership.md
2026-10-08 12:08:53 -04:00

1.4 KiB

[Reviewed]

ADR-0016: Persistence and region ownership

Status

Proposed; no persistent services in M0.

M7.1 scope accepted via ADR-0058: full checkpoint batches and atomic permanent outcomes under fenced ownership. General replay segments and cross-region handoff remain proposed; no storage implementation is claimed by the design gate.

Context

Semantic history alone cannot recover physical state; timeout-only ownership permits stale writes.

Decision

PostgreSQL fenced epochs and expected heads, immutable recovery segments, snapshots, transactional decisions/history/outbox, distinct simulated/committed ticks. Same command ID with different request digest fails.

Alternatives Considered

Per-tick DB, universal scalar event sourcing, snapshots alone and broker/Redis/Kubernetes leases alone do not satisfy complete replay/fencing requirements.

Benefits

Inspectable authority and idempotent irreversible biology.

Costs

Commit latency, complete replay verification, gateway epoch registration and orphan GC.

Risks

Incomplete recovery, stale gateway output, partitions and host disaster loss.

Consequences

Fault-test every upload/commit/ACK/handoff boundary before M7. Same lease-row lock guards acquire/renew/commit/release. PostgreSQL time decides expiry; local deadlines fail conservatively. Resolve independent disaster durability before World0. PostgreSQL locks.