Skip to content

2.2.1: ecosystem guides — race-free upserts (ash_onetime, CI-proven) + graph events (ash_hooks) - #43

Merged
palermo-git merged 1 commit into
masterfrom
docs/ecosystem-integration
Oct 17, 2026
Merged

palermo-git merged 1 commit into
masterfrom
docs/ecosystem-integration

Conversation

@palermo-git

Copy link
Copy Markdown
Contributor

What

  • documentation/idempotent-upserts.md — the guide to exactly-once graph writes by pairing ash_age's upsert with ash_onetime's PostgreSQL-authoritative admission (the unique constraint becomes the arbiter AGE lacks). Honest about the seam: AshOnetime.Transaction (host-owned transaction) is the composable path — protect requires AshPostgres and does not apply to ash_age resources.
  • The executable proof: test/integration/onetime_upsert_test.exs runs in CI against live AGE, rendering ash_onetime's REAL install migration through Ecto.Migrator (no hand-rolled claim table). Three guarantees pinned: a two-transaction race on one key lands exactly one vertex; a replayed key returns the stored response verbatim with no new vertex; a rollback after the graph write removes the claim AND the vertex together.
  • documentation/webhooks-with-ash-hooks.md — cookbook for graph change events via ash_hooks: composes with zero integration code (edge actions included); exactly-once combination = ledger dedup (deliveries) + admission keys (effects).
  • README .env.example link fixed (relative link didn't resolve on hexdocs); usage-rules upsert section cross-links the guide; 2.2.1.

ash_onetime is a TEST-ONLY dependency (only: :test, OSV-clean) — never a runtime dep of the library.

Verification

503/503 incl. integration on live AGE; dialyzer, credo --strict, compile --warnings-as-errors, format, hex docs build — all clean. The three admission guarantees were driven to green against a live AGE + real claim-store DDL before the guide text was finalized (the guide cites the test).

… events (ash_hooks); 2.2.1

Two new hexdocs guides + the executable proof of the pattern they document:

- documentation/idempotent-upserts.md: pairing ash_age's upsert with
  ash_onetime's PostgreSQL-authoritative admission — the unique constraint
  becomes the arbiter AGE lacks. Written against the TEST-verified pattern,
  not the aspiration: test/integration/onetime_upsert_test.exs renders
  ash_onetime's real install migration through Ecto.Migrator (no hand-rolled
  claim table) and proves, against live AGE in CI: (1) a two-transaction race
  on one key lands exactly one vertex; (2) a replayed key returns the stored
  response verbatim with no new vertex; (3) a rollback after the graph write
  removes the claim AND the vertex together (a retry executes, no phantom
  claim). The guide names the seam honestly: AshOnetime.Transaction (the
  host-owned-transaction boundary) — 'protect' requires AshPostgres and does
  NOT apply to ash_age resources.
- documentation/webhooks-with-ash-hooks.md: cookbook for announcing/ingesting
  graph changes via ash_hooks — composes with zero integration code, edge
  actions included; the exactly-once combination is ledger dedup (deliveries)
  + admission keys (effects).
- ash_onetime joins as a TEST-ONLY dep (~> 1.6, only: :test, OSV-clean);
  usage-rules' upsert section and the README cross-link the guide.
- README .env.example link now an absolute repository URL (relative link did
  not resolve on hexdocs).
- 2.2.1 (docs + test additions; no library behavior change).

Gates: 503/503 incl. integration on live AGE; dialyzer, credo --strict,
compile --warnings-as-errors, format, hex docs build all clean.
@palermo-git
palermo-git requested a review from corepay as a code owner October 17, 2026 23:33
@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: de4fb3bd-781c-4e7f-9965-d4f577531059
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@palermo-git
palermo-git merged commit efdb43d into master Oct 17, 2026
10 checks passed
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