Skip to content

Add transactional outbox for durable at-least-once event delivery#315

Merged
JE-Chen merged 1 commit into
devfrom
feat/outbox-batch
Jun 22, 2026
Merged

Add transactional outbox for durable at-least-once event delivery#315
JE-Chen merged 1 commit into
devfrom
feat/outbox-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

events.cloud_events posts synchronously with no durability — a crash between doing the work and sending the event loses it, and a network blip drops it. This adds the transactional outbox pattern: persist each event first, then drain pending entries through an injected sink with at-least-once delivery and a dead-letter cap.

Layers

  • Headless core: je_auto_control/utils/outbox/outbox.pyOutbox with enqueue / pending / dead_letters / drain (retry until max_attempts, then dead-letter) / to_dict / from_dict / save / load. Pure stdlib (json), no PySide6, injected sink → deterministic.
  • Facade: Outbox re-exported from je_auto_control + __all__.
  • Executor: AC_outbox_enqueue{id, pending}, AC_outbox_pending{pending} via a named-instance registry.
  • MCP: ac_outbox_enqueue / ac_outbox_pending.
  • Script Builder: two CommandSpecs under Flow.

Tests / docs

  • test/unit_test/headless/test_outbox_batch.py — 9 headless tests (enqueue/drain/retry/dead-letter/resume/max_batch/save-load + wiring + facade). Full headless suite green (3019 passed).
  • EN/Zh feature docs v107_features_doc.rst + toctrees; 3 README What's-new sections.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 43 complexity · 2 duplication

Metric Results
Complexity 43
Duplication 2

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 6a9566c into dev Jun 22, 2026
17 of 18 checks passed
@sonarqubecloud

Copy link
Copy Markdown

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