Skip to content

feat(payments): add deferred PostgreSQL payment state backend - #116

Closed
1amKhush wants to merge 9 commits into
ContextVM:masterfrom
1amKhush:feat/payment-postgres-backend
Closed

1amKhush wants to merge 9 commits into
ContextVM:masterfrom
1amKhush:feat/payment-postgres-backend

Conversation

@1amKhush

Copy link
Copy Markdown
Contributor

Add an optional PostgreSQL implementation of PaymentStateStore, separated from #110.

Keep this PR deferred until a deployment needs restart durability or coordination across processes sharing one paying server identity.

Changes

  • Add PostgresPaymentStateStore through @contextvm/sdk/payments/postgres.
  • Persist invoice bindings, grants, execution records, and replay tombstones.
  • Serialize namespace operations using short transactions and generation fences.
  • Validate schema versions and consistent worker policies during initialization.
  • Propagate database and uncertain commit failures without falling back to memory.
  • Add PostgreSQL dependencies, migrations, integration tests, and a PostgreSQL 17.7 CI service.

Applications own the connection pool and must call initialize() before injecting the store.

Validation

  • 28 PostgreSQL contract/integration tests and 6 shared PMI regressions passed.
  • Covered concurrent workers, worker crashes, reconnects, lost commit acknowledgements, and encrypted replay.
  • Typecheck and lint passed.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 05:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@1amKhush
1amKhush marked this pull request as draft October 27, 2026 05:30
@1amKhush 1amKhush closed this Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants