Context
PR #207 introduces MerchantOfferStore with an in-memory implementation for single-process deployments. Multi-replica hosts need a durable implementation with an atomic one-shot execution claim.
The bridge already has a Postgres-backed precursor, while the gateway is separately tracking a shared durable consistency domain in planetarium/foundry-x402-gateway#12.
Scope
- Decide where a standard durable implementation belongs without leaking database dependencies into the root
@a2x/sdk entry.
- Implement or publish a reference Postgres-compatible
MerchantOfferStore for:
- atomic
publishing with rollback;
- frozen
MerchantOffer reads;
- compare-and-set
claim;
- expiry and
delete;
- multi-replica correctness.
- Evaluate a read-only claimed-state fast path so known replays can avoid a facilitator
verify round trip, while retaining the post-verify atomic claim as the arbiter.
- Add concurrency, expiry, rollback, and restart tests.
- Document schema migration and operational cleanup.
Constraints
- Preserve host-owned connection and transaction management.
- Do not make a database driver a root SDK runtime dependency.
Dependencies
Context
PR #207 introduces
MerchantOfferStorewith an in-memory implementation for single-process deployments. Multi-replica hosts need a durable implementation with an atomic one-shot execution claim.The bridge already has a Postgres-backed precursor, while the gateway is separately tracking a shared durable consistency domain in planetarium/foundry-x402-gateway#12.
Scope
@a2x/sdkentry.MerchantOfferStorefor:publishingwith rollback;MerchantOfferreads;claim;delete;verifyround trip, while retaining the post-verify atomic claim as the arbiter.Constraints
Dependencies