Skip to content

A02: durable PostgreSQL intent ledger and API boundary - #15

Merged
kapustazh merged 1 commit into
developfrom
milestone/a02-durable-intents
Sep 7, 2026
Merged

kapustazh merged 1 commit into
developfrom
milestone/a02-durable-intents

Conversation

@kapustazh

@kapustazh kapustazh commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Implements Coder A's milestone A02: durable PostgreSQL intent ledger, transactional migrations, canonical domain fingerprinting, and Fastify HTTP boundary controls. Rebased cleanly onto latest develop (including C01 reconciliation contracts).

  • Schema and migration safety: Transactional migrations with advisory locking, checksum verification, and rollback safety. Adds tables for business_intents, attempts, settlements, evidence_observations, outbox_jobs, and schema_versions.
  • Authoritative settlement & attempt identity: Enforces unique intent identity, immutable payload fingerprint, single settlement row per intent, and unique transaction hash.
  • Canonical fingerprint: Validates and normalizes recipient, atomic amount, asset, network, and purpose. Rejects negative, floating, scientific, and padded amounts.
  • Atomic create & replay: Atomic insert-or-replay semantics. New valid intents atomically enqueue the first attempt and an authorize_intent outbox job. Returns 202 Accepted for new intents, 200 OK for identical replayed intents, and 409 Conflict for conflicting payloads with no extra jobs.
  • Query projections: Status projections for intents and recovery views. Reconcile endpoint enqueues jobs only when permitted.
  • HTTP Boundary controls: Service bearer authentication, request size limit, rate limit seam, correlation ID preservation, and sanitized error bodies preventing leak of internal database errors or SQL.
  • Handoff artifacts: Published migration set, storage-v1 schema digest (09b7fc0ce90a3db9dfd0437ae1abdac7260603154216b223116d0e123967d742), synthetic database fixtures, and containerized integration test suite.

Scope and acceptance criteria

  • The change is limited to milestone A02.
  • All A02 small tasks and acceptance criteria are satisfied.
  • Real PostgreSQL integration tests verify atomic insert/replay, conflict mapping, and restart survival.
  • 76 unit and contract tests pass cleanly.

Validation

pnpm install --frozen-lockfile: PASS
pnpm format:check: PASS
pnpm lint: PASS
pnpm typecheck: PASS
pnpm check:generated: PASS
pnpm validate:fixtures: PASS (9 fixtures)
pnpm test: PASS (8 files, 76 tests)
markdownlint-cli2: PASS (59 files, 0 errors)
storage-v1 schema digest: 09b7fc0ce90a3db9dfd0437ae1abdac7260603154216b223116d0e123967d742

Independent review evidence

Gate A — exact candidate tree before push

  • Base commit SHA: a2af79c96ef3a1e0187c22608f135b83b78eeba0

  • Candidate tree SHA: 841f77bc48ffcd601ed19614b13f7f1e5ce25d36

  • Candidate commit SHA: 3e788123566e0099d8c67fd425e2c55ab94a496d

  • Reviewer tool: Antigravity CLI

  • Reviewer model: Gemini 3.8 Flash (High)

  • Verdict: VERDICT: PASS

  • Findings or residual risks: no blockers; non-blocking auth status code consistency and migration advisory lock ordering noted for future polish.

  • The reviewed tree equals the committed tree.

Gate B — exact remote PR head

  • Pull request URL/number: A02: durable PostgreSQL intent ledger and API boundary #15

  • Remote head commit SHA: 3e788123566e0099d8c67fd425e2c55ab94a496d

  • Remote head tree SHA: 841f77bc48ffcd601ed19614b13f7f1e5ce25d36

  • Reviewer tool: Antigravity CLI

  • Reviewer model: Gemini 3.8 Flash (High)

  • Verdict: VERDICT: PASS

  • Findings or residual risks: no blockers; Cloudflare Workers build is non-required and non-applicable because A02 has no deployable Worker yet.

  • Gate B reviewed the current remote head and matches Gate A's approved tree.

  • Agent policy / repository-policy and all applicable CI checks pass.

Risk and rollback

  • Revert commit 3e788123566e0099d8c67fd425e2c55ab94a496d if needed.
  • Migrations are append-only; rollback operations are documented in packages/storage-postgres/MIGRATIONS.md.

Human merge

  • A human owner has reviewed the evidence and will perform the merge.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
oneshot 3e78812 Sep 07 2026, 03:08 PM

@kapustazh
kapustazh force-pushed the milestone/a02-durable-intents branch from 0f8ffbf to 3e78812 Compare September 7, 2026 15:05
@kapustazh
kapustazh merged commit 64d0a6f into develop Sep 7, 2026
3 of 4 checks passed
@SuPuHe
SuPuHe deleted the milestone/a02-durable-intents branch September 7, 2026 21:15
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