Skip to content

Add durable delivery database core - #3

Closed
dakdevs wants to merge 1 commit into
agent/bootstrap-milestone-zerofrom
agent/neon-delivery-core
Closed

Add durable delivery database core#3
dakdevs wants to merge 1 commit into
agent/bootstrap-milestone-zerofrom
agent/neon-delivery-core

Conversation

@dakdevs

@dakdevs dakdevs commented Aug 11, 2026

Copy link
Copy Markdown
Member

What changed

  • adds the Drizzle schema and initial PostgreSQL migration for accounts, hooks, immutable webhook events, deliveries, and delivery attempts
  • adds a tenant-scoped DeliveryStore for atomic event recording, concurrent claims, ACK/NACK, heartbeat extension, and lease recovery
  • stores only hashes of short-lived lease tokens
  • adds a real-PostgreSQL integration harness that launches an ephemeral local cluster
  • adds a PostgreSQL 16 service to CI and documents Neon pooled connections and migration commands

Why

This implements the durable database core from PRD #1 before the Vercel ingress and CLI are wired to it. PostgreSQL is the source of truth, and all correctness-sensitive transitions use short atomic statements.

This is stacked on #2 and should be reviewed after the bootstrap PR.

Refs #1
Depends on #2

Validation

  • bun run db:generate reports no schema drift
  • bun run lint
  • bun run prettier:check
  • bun run typecheck
  • bun test — 11 tests, including 10 real-PostgreSQL delivery tests
  • bun run test:e2e
  • bun run build

The integration suite covers concurrent claim exclusion, tenant isolation, lease expiry and redelivery, stale-token rejection, retry scheduling, heartbeat extension, disabled hooks, and database-enforced webhook-event immutability.

@dakdevs

dakdevs commented Aug 12, 2026

Copy link
Copy Markdown
Member Author

Superseded by #8, which is merged into main.

@dakdevs dakdevs closed this Aug 12, 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.

1 participant