Skip to content

feat(dactyl): complete atomic transaction/batch contract (#24) - #43

Merged
alexhraber merged 1 commit into
mainfrom
agent/unknown/bugs-01kz2dy4m8vxdmsf
Aug 2, 2026
Merged

feat(dactyl): complete atomic transaction/batch contract (#24)#43
alexhraber merged 1 commit into
mainfrom
agent/unknown/bugs-01kz2dy4m8vxdmsf

Conversation

@alexhraber

Copy link
Copy Markdown
Contributor

Summary

Completes the remaining proof obligations for dactyl#24 after the partial implementation in PR #31.

Contract docs

  • Nesting: not supported (no SAVEPOINT; one fresh adapter per call)
  • Retry: caller-owned (dactyl never retries)
  • Timeout: no public deadline (reqwest defaults / local SQLite)
  • Idempotency: not provided — design deterministic keys if replaying after ambiguous transport failures
  • Empty batch → Ok([])

Adapter

  • Neon execute_batch reads response bytes first so non-2xx error bodies surface as Adapter errors without a success-shaped decode.

Proof

  • Neon mock /batch is snapshot-atomic (apply statements, rollback snapshot on any error).
  • atomic_transaction_rollback_neon_mock — mid-batch duplicate key leaves no partial row.
  • atomic_event_plus_state_sqlite / _neon_mock — state + event in one unit; failure leaves neither side.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --features "sqlite neon" -- -D warnings
  • cargo test --features "sqlite neon" (15 conformance + 7 unit + 5 release)

Closes #24

Close remaining #24 proof gaps after PR #31:

- Document nesting (unsupported), retry (caller-owned), timeout (none on
  public surface), and idempotency (not provided) for `transaction`.
- Neon adapter: decode batch error bodies without requiring success shape.
- Conformance mock `/batch` is snapshot-atomic with insert/select/count.
- Tests: Neon failure-injection rollback; event-plus-state fixture on
  SQLite and Neon mock; empty-batch no-op.

Links DecapodLabs/decapod#1111 and #1120 as consumers of this contract.
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.

[dactyl] Provide atomic transaction and batch-write semantics

1 participant