Type to search pages and rules.

Use with Agents

Durable Delivery

Stack: anyConcern: infrastructure

Committed changes reach the outside world through durable delivery that survives crashes. This page states how the product stages after-commit effects in the outbox for a Worker to deliver. A team selects it for delivery that survives process failure.

Markdown42 provisions
On this page

Activation#

Activation scope: local.

Applicable specification kinds: use-case.

A use case selects this extension when a committed change needs delivery that survives a process failure. That delivery can carry an integration event to another system, a command that advances a journey step, or a side effect on an outside provider. Selecting it also activates litespec/backend/architecture#declare-the-execution-host-for-work-that-outlives-a-request: the project declares the execution host that runs the dispatcher.

Baseline Relationship#

This extension replaces litespec/backend/persistence#collect-events-without-a-public-unit-of-work.

This extension switches on no optional record type: integration events, settings, and runbooks belong to the core. The project writes an integration-event record for each integration event it delivers, setting records for the delivery bounds, and runbook records for recovery and rollback.

Standards#

Stage After-Commit Effects in the Outbox#

rulerequiredguidance
litespec/ext/outbox#stage-after-commit-effects-in-the-outbox
Statement

A use case declaring after-commit emits or runs effects MUST stage each effect in the outbox in the same transaction as its changes.

Applies toartifact: command-handler

Why

After-commit timing promises the message follows the commit: staged in the same transaction, the change and its message share one fate. An emits effect is a domain event the aggregate raises, and persistence stages that event in the outbox in the same commit as the aggregate, as litespec/backend/application#emit-declared-integration-events-after-commit requires. An effect sent from memory instead would vanish on a crash between the commit and the send. litespec/core/use-cases#declare-every-effect-with-one-verb-and-its-timing states the effect verbs and their timing, and async effects dispatch without the transaction.

Checka reviewer answers

Reviewed forWhich after-commit emits or runs effects, or domain events, stage outside the transaction of their aggregate changes? Look at each command handler's effects and the outbox writes beside them.

Marked guidance: a reviewer answers this question.

Declare Published Facts as Integration Events#

rulerequiredguidance
litespec/ext/outbox#declare-published-facts-as-integration-events
Statement

Each emits effect MUST name an integration-event record carrying direction, payload, and trust.

Applies toartifact: record:integration-event

Why

A published fact without a record is a promise nobody versioned: readers depend on fields no page states, and a field change breaks them without a diff. The integration-event record states the direction, the payload with its classifications, and the trust readers place in it. The edges page states the declaration and the record.

Checka reviewer answers

Reviewed forWhich emits effects name no integration-event record, or one without direction, payload, and trust? Look at each emits effect and the integration-event record it names.

Marked guidance: a reviewer answers this question.

Record Durable Delivery Behavior#

rulerequiredguidance
litespec/ext/outbox#record-durable-delivery-behavior
Statement

A durable-delivery specification MUST document delivery guarantee, downstream boundary, duplicate behavior, retry horizon, and recovery runbook.

Applies toartifact: any

Why

Delivery crosses a system boundary, so the team agrees up front on the guarantee, the boundary, the duplicate behavior, the retry horizon, and the runbook that recovers when delivery fails. Without that agreement, the writer assumes once-only delivery while the target assumes retries, and both discover the mismatch in production. The agreement lands before the first message does.

Checka reviewer answers

Reviewed forWhich delivery specifications leave out the guarantee, downstream boundary, duplicate behavior, retry horizon, or recovery runbook? Look at each durable-delivery specification.

Marked guidance: a reviewer answers this question.

Exclude Manually Repeatable Reactions and Jobs#

rulerequiredguidance
litespec/ext/outbox#exclude-manually-repeatable-reactions-and-jobs
Statement

A project MUST NOT activate outbox for a reaction or job whose loss the operators accept and which they can repeat manually.

Applies toartifact: reaction, job

Why

Outbox storage, dispatch, retries, and replay exist to prevent loss; a reaction or job whose loss the operators accept and can repeat by hand needs none of that machinery. The reaction's or job's onFailure states its handling, and the use case page records the accepted loss.

Checka reviewer answers

Reviewed forWhich reactions or jobs whose loss the operators accept still carry outbox records? Look at the outbox records and the reactions and jobs they name.

Marked guidance: a reviewer answers this question.

Emit Excluded Reactions and Jobs After Commit#

rulerequiredguidance
litespec/ext/outbox#emit-excluded-reactions-and-jobs-after-commit
Statement

A reaction or job the outbox excludes MUST emit after its commit succeeds without staging an outbox record.

Applies toartifact: reaction, job

Why

Without an outbox record, nothing survives a crash between the commit and the emit, so the reaction or job emits immediately after its commit succeeds and accepts the loss. Emitting before the commit risks worse: it fires for a change the database then rolls back.

Checka reviewer answers

Reviewed forWhich excluded reactions or jobs emit before their commit succeeds, or stage an outbox record? Look at each excluded reaction's and job's emit call.

Marked guidance: a reviewer answers this question.

Stage Messages with Business Work#

rulerequiredguidance
litespec/ext/outbox#stage-messages-with-business-work
Statement

A command post-handler MUST stage pending durable messages in the same scoped business session as its aggregate changes.

Applies toartifact: any

Why

The business change and its message share one fate: both persist or neither does. Staging the message in the same scoped business session as the aggregate changes puts both under one commit, so a crash can never leave an accepted change without its message or a message without its change.

Checka reviewer answers

Reviewed forWhich pending durable messages stage outside the scoped session of their aggregate changes? Look at each command post-handler and its session.

Marked guidance: a reviewer answers this question.

Serialize Durable Messages#

rulerequiredguidance
litespec/ext/outbox#serialize-durable-messages
Statement

An outbox writer MUST serialize each pending durable message into an outbox record.

Applies toartifact: any

Why

The command scope ends when the request ends, while dispatch happens later in a Worker that never saw the request. Serializing the message into an outbox record gives that Worker everything it needs after the scope is gone.

Checka reviewer answers

Reviewed forWhich pending durable messages reach no serialized outbox record? Look at the outbox writer and its record type.

Marked guidance: a reviewer answers this question.

Store Required Message Fields#

rulerequiredguidance
litespec/ext/outbox#store-required-message-fields
Statement

An outbox record MUST contain message identity, kind, stable type, schema version, time, payload, tenant, state, attempt, and next-attempt data.

Applies toartifact: any

Why

The dispatcher, the retry logic, and the operator each read the record: identity and type route it, the schema version selects its reader, time and tenant scope it, and state, attempt, and next-attempt data drive the retry. A field stored nowhere forces one of those readers to guess.

Checka reviewer answers

Reviewed forWhich outbox records lack identity, kind, type, schema version, time, payload, tenant, state, attempt, or next-attempt data? Look at the outbox record type.

Marked guidance: a reviewer answers this question.

Store Failure and Completion Evidence#

rulerequiredguidance
litespec/ext/outbox#store-failure-and-completion-evidence
Statement

An outbox record MUST retain its last error summary and completion time.

Applies toartifact: any

Why

When delivery stalls, the operator opens the record first: the last error summary says why the previous attempt failed, and the completion time says which records finished. Without that evidence on the record, each investigation starts from scattered logs instead.

Checka reviewer answers

Reviewed forWhich outbox records drop their last error summary or completion time? Look at the outbox record type and its update code.

Marked guidance: a reviewer answers this question.

Classify Message Kinds#

rulerequiredguidance
litespec/ext/outbox#classify-message-kinds
Statement

An outbox record MUST name its message kind as integration event, journey-step command, or provider side effect, with an integration event citing its integration-event record.

Applies toartifact: record:integration-event

Why

An integration event, a journey-step command, and a provider side effect dispatch through different owners and transports, so the record names which one it holds. The integration event cites its integration-event record, so the staged message traces to the published fact it carries.

Checka reviewer answers

Reviewed forWhich outbox records name no message kind, or an integration event that does not cite its integration-event record? Look at the outbox record type and the messages staged.

Marked guidance: a reviewer answers this question.

Reject Independent Outbox Commits#

rulerequiredguidance
litespec/ext/outbox#reject-independent-outbox-commits
Statement

An outbox writer MUST NOT use another connection or independent commit for required durable delivery.

Applies toartifact: any

Why

Two commits on two connections can split around a crash: the business change persists while the message rolls back, or the message persists for a change that never happened. Sharing one PostgreSQL database does not make separate transactions atomic, so the message joins the business transaction instead.

Checka reviewer answers

Reviewed forWhich outbox writers use a separate connection or commit? Look at each writer source and its path into the business session.

Marked guidance: a reviewer answers this question.

Dispatch Claimed Records in Worker#

rulerequiredguidance
litespec/ext/outbox#dispatch-claimed-records-in-worker
Statement

A Worker MUST claim pending outbox records, dispatch a bounded batch, and record success or retry information.

Applies toartifact: any

Why

Dispatch needs time, retries, and network calls that no request transaction can hold. The Worker claims pending records, dispatches a bounded batch, and records each outcome, so the request commits fast while delivery proceeds on its own schedule.

Checka reviewer answers

Reviewed forWhich Worker loops dispatch unbounded batches or skip recording an outcome? Look at the dispatcher's claim and batch code.

Marked guidance: a reviewer answers this question.

Exclude Request-Transaction Dispatch#

rulerequiredguidance
litespec/ext/outbox#exclude-request-transaction-dispatch
Statement

WebApi MUST NOT dispatch a durable message inside the request transaction.

Applies toartifact: endpoint

Why

A network call inside the request transaction holds database locks while the outside world answers, and a slow target slows every request behind it. The request commits only to make the message eligible; the Worker performs the delivery later.

Checka reviewer answers

Reviewed forWhich request paths dispatch a durable message inside the request transaction? Look at the endpoint and command handler paths.

Marked guidance: a reviewer answers this question.

Define Claim Ownership#

rulerequiredguidance
litespec/ext/outbox#define-claim-ownership
Statement

An outbox claim MUST use a short transaction with the lease owner, lease expiry, and fencing value that litespec/ext/jobs#store-execution-leases defines.

Applies toartifact: any

Why

Several Workers poll the same store, so each dispatch attempt needs one owner: the lease owner, the lease expiry, and the fencing value name it. The short transaction takes the claim without holding locks into the delivery itself.

Checka reviewer answers

Reviewed forWhich claims take no owner, expiry, or fencing value, or hold them outside a short transaction? Look at the claim code in the outbox store.

Marked guidance: a reviewer answers this question.

Release Claim Transactions Before Calls#

rulerequiredguidance
litespec/ext/outbox#release-claim-transactions-before-calls
Statement

A Worker MUST NOT hold an outbox claim transaction open during a network call.

Applies toartifact: any

Why

A network call to a slow target can last seconds or minutes. Holding the claim transaction open across that call pins database locks and connection slots, starving the Workers behind it; releasing the claim first lets the database serve other work while the call runs.

Checka reviewer answers

Reviewed forWhich claim transactions stay open across a network call? Look at the Worker's dispatch path.

Marked guidance: a reviewer answers this question.

Restrict Completion to Current Lease Owners#

rulerequiredguidance
litespec/ext/outbox#restrict-completion-to-current-lease-owners
Statement

A Worker MUST update an outbox record only while it owns the matching lease and fencing value.

Applies toartifact: any

Why

A Worker that lost its lease, through a crash, a pause, or an expiry, can wake up after another Worker claimed the same record. Checking the lease and fencing value before each update stops the stale Worker from overwriting the current owner's result.

Checka reviewer answers

Reviewed forWhich record updates run without checking the current lease and fencing value? Look at each update statement in the outbox store.

Marked guidance: a reviewer answers this question.

Requeue Expired Claims#

rulerequiredguidance
litespec/ext/outbox#requeue-expired-claims
Statement

An outbox store MUST return expired claims to eligible work.

Applies toartifact: any

Why

A Worker can die between claiming a record and dispatching it. Returning expired claims to eligible work lets a live Worker pick them up, so one crash delays a message instead of losing it.

Checka reviewer answers

Reviewed forWhich expired claims stay out of eligible work? Look at the requeue query in the outbox store and its tests.

Marked guidance: a reviewer answers this question.

Accept Repeated Delivery#

rulerequiredguidance
litespec/ext/outbox#accept-repeated-delivery
Statement

An event handler that receives an outbox delivery MUST handle the same message more than once.

Applies toartifact: reaction

Why

The target can accept a message while the Worker crashes before recording completion, and the requeued claim then dispatches it again. Delivery promises at-least-once, so every event handler handles the same message more than once without corrupting its state.

Checka reviewer answers

Reviewed forWhich event handlers keep wrong state when the same message arrives twice? Look at the handler tests that deliver a message twice.

Marked guidance: a reviewer answers this question.

Identify Repeated Delivery#

rulerequiredguidance
litespec/ext/outbox#identify-repeated-delivery
Statement

An event handler that receives an outbox delivery MUST use message ID or a business idempotency key at its Command or side-effect boundary.

Applies toartifact: reaction

Why

Handling a repeat means recognizing it: the message ID or a business idempotency key gives the event handler a stable identity to check at its command or side-effect boundary. Without that key, the handler processes the repeat as new work and pays, notifies, or ships twice.

Checka reviewer answers

Reviewed forWhich event handlers process a repeated message as new work? Look at each handler's Command or side-effect boundary.

Marked guidance: a reviewer answers this question.

Deliver Each Event to Each Handler Separately#

rulerequiredguidance
litespec/ext/outbox#deliver-each-event-to-each-handler-separately
Statement

The outbox MUST deliver an event to each of its handlers as a separate delivery with its own retries and dead letter.

Applies toartifact: any

Why

One delivery for all handlers retries every handler when one fails. Each handler therefore gets its own delivery with its own retries and dead letter, and each delivery still ends in repeat-safe handling under litespec/ext/outbox#accept-repeated-delivery.

Example

A loan-borrowed event feeds a due-notice handler and a statistics handler. The notice delivery retries on its own schedule while the statistics delivery stays complete.

Checka reviewer answers

Reviewed forWhich events reach several handlers as one delivery? Look at the outbox delivery records for each handler.

Marked guidance: a reviewer answers this question.

Await Target Acceptance#

rulerequiredguidance
litespec/ext/outbox#await-target-acceptance
Statement

A Worker MUST NOT mark an outbox record complete before the target boundary accepts it.

Applies toartifact: any

Why

Marking a record complete before the target accepts it declares a delivery that never happened, and no retry follows because the record looks done. The Worker waits for the target boundary's acceptance before recording completion.

Checka reviewer answers

Reviewed forWhich outbox records mark completion before the target accepts the message? Look at the Worker's completion code and the target's acceptance response.

Marked guidance: a reviewer answers this question.

Bound Delivery Retries#

rulerequiredguidance
litespec/ext/outbox#bound-delivery-retries
Statement

An outbox dispatcher MUST use bounded exponential backoff with jitter.

Applies toartifact: any

Why

A failing target with ten thousand pending messages meets a retry storm when every message retries at once on a fixed interval. Bounded exponential backoff with jitter spreads the retries over time and caps the total, so the target recovers instead of drowning.

Checka reviewer answers

Reviewed forWhich retry schedules lack a bound, backoff, or jitter? Look at the dispatcher's retry code.

Marked guidance: a reviewer answers this question.

Classify Permanent Delivery Failure#

rulerequiredguidance
litespec/ext/outbox#classify-permanent-delivery-failure
Statement

An outbox dispatcher MUST classify permanent failures, stop automatic retry at its retry bound, and retain safe investigation and replay data.

Applies toartifact: any

Why

Some failures never clear on retry: a deleted destination, a rejected payload, a revoked credential. Retrying those forever burns resources and buries the real backlog, so the dispatcher classifies them, stops at its retry bound, and keeps the evidence an operator needs to investigate and replay safely.

Checka reviewer answers

Reviewed forWhich permanent failures retry past their bound, or lose their investigation and replay data? Look at the dispatcher's failure classification and its tests.

Marked guidance: a reviewer answers this question.

Distinguish Dependency Outage#

rulerequiredguidance
litespec/ext/outbox#distinguish-dependency-outage
Statement

A dispatcher MUST distinguish an unavailable outbox store from a failed claimed message.

Applies toartifact: any

Why

A dead outbox store and a failed delivery ask for different recoveries: the first needs a database restored, the second needs one destination investigated. Each carries its own signal. The store's availability is a gauge the readiness endpoint reads, while a claimed message's outcome is a counter carrying the result, following the OpenTelemetry metrics specification. A single error counter cannot tell an operator whether to restore a database or investigate one destination.

Checka reviewer answers

Reviewed forWhich outbox metrics use the wrong instrument type for store availability or claimed-message outcomes? Look at the metrics the outbox publishes.

Marked guidance: a reviewer answers this question.

Back off Unavailable-Store Polling#

rulerequiredguidance
litespec/ext/outbox#back-off-unavailable-store-polling
Statement

A Worker MUST apply bounded backoff and rate-limited logging when its outbox store is unavailable.

Applies toartifact: any

Why

A Worker that polls a dead store on a tight loop writes an exception per iteration and fills disks and log quotas before anyone reads the first one. Bounded backoff with rate-limited logging keeps the Worker alive and quiet until the store returns.

Checka reviewer answers

Reviewed forWhich Worker loops poll an unavailable store without backoff or rate-limited logging? Look at the Worker's poll loop and its outage tests.

Marked guidance: a reviewer answers this question.

Restrict Message Retry to Claimed Records#

rulerequiredguidance
litespec/ext/outbox#restrict-message-retry-to-claimed-records
Statement

A Worker MUST apply message retry and poison handling only to claimed outbox records.

Applies toartifact: any

Why

Retry and poison handling act on a claimed message; when the store itself is down, no claim exists and no message waits for delivery. Running retry logic against the outage double-counts attempts and can dead-letter messages whose only fault was an unreachable store.

Checka reviewer answers

Reviewed forWhich retry or poison-handling paths act on records that hold no claim? Look at the dispatcher's retry and poison code.

Marked guidance: a reviewer answers this question.

Gate Dispatch on Readiness#

rulerequiredguidance
litespec/ext/outbox#gate-dispatch-on-readiness
Statement

A Worker host exposing readiness MUST gate dispatch and stop polling stores that cannot serve requests.

Applies toartifact: any

Why

A host that reports unready still serves traffic it cannot finish when its Workers keep polling dead stores. Gating dispatch on readiness stops the polling, so the host fails fast and recovers instead of churning against storage that cannot answer.

Checka reviewer answers

Reviewed forWhich unready hosts keep dispatching or polling a store that cannot serve requests? Look at the readiness check and the Worker's dispatch loop.

Marked guidance: a reviewer answers this question.

Version Message Types#

rulerequiredguidance
litespec/ext/outbox#version-message-types
Statement

An outbox message MUST use a stable type name and explicit schema version.

Applies toartifact: any

Why

An outbox record outlives the deployment that wrote it, so the dispatcher meets records written by several versions at once. A stable type name with an explicit schema version tells the dispatcher which reader parses each record; without the pair, one shape change breaks every record written before it.

Checka reviewer answers

Reviewed forWhich outbox messages lack a stable type name or an explicit schema version? Look at each outbox message type.

Marked guidance: a reviewer answers this question.

Support Coexisting Message Producers#

rulerequiredguidance
litespec/ext/outbox#support-coexisting-message-producers
Statement

A deployed dispatcher MUST process records from every application version that can coexist during rollout or rollback.

Applies toartifact: any

Why

During rollout and rollback, several application versions share one store and write different valid shapes into it. The dispatcher reads from every version that can coexist, or the deployment itself causes delivery failures.

Each message record therefore carries its own shape version, and the dispatcher selects a reader from that value. Adding an optional member with a defined absent-value behavior needs no new version. Removing a member, renaming one, narrowing a type, or changing a discriminator needs a new version, and the reader for each version stays until no record carries that version.

Checka reviewer answers

Reviewed forWhich application versions that can coexist have no reader in the dispatcher? Look at the dispatcher's version selection and its tests.

Marked guidance: a reviewer answers this question.

Publish Backlog Indicators#

rulerequiredguidance
litespec/ext/outbox#publish-backlog-indicators
Statement

An outbox deployment MUST publish pending count, failed count, oldest pending age, attempts, dispatch duration, and success rate.

Applies toartifact: any

Why

Pending count, failed count, oldest pending age, attempts, dispatch duration, and success rate together show whether delivery keeps up: growth in the backlog or age reveals a stall, while duration and success rate reveal a struggling target. Without these indicators, the first sign of failure is a customer asking where their message went.

Checka reviewer answers

Reviewed forWhich of the six backlog indicators does the deployment leave unpublished? Look at the metrics the Worker exports.

Marked guidance: a reviewer answers this question.

Set Delivery Alerts#

rulerequiredguidance
litespec/ext/outbox#set-delivery-alerts
Statement

An outbox deployment MUST set alert thresholds as setting records from its use-case delivery target.

Applies toartifact: record:setting

Why

A shipment notice delayed an hour and a receipt delayed a week carry different business consequences, so each use case sets alert thresholds from its own delivery target. Setting records hold those thresholds, so the alert fires when delay passes what the business accepted.

Checka reviewer answers

Reviewed forWhich alert thresholds sit outside a setting record derived from a use-case delivery target? Look at the setting records beside each use case.

Marked guidance: a reviewer answers this question.

Model Outbox Lifecycle States#

rulerequiredguidance
litespec/ext/outbox#model-outbox-lifecycle-states
Statement

An outbox record MUST model its lifecycle as an abstract state base with one sealed record for each of pending, processing, dispatched, and dead-letter.

Applies toartifact: state-record

Why

pending becomes processing, and processing becomes dispatched, pending, or dead-letter, while audited replay moves dead-letter back to pending. Three of the four states carry data the others do not: processing holds a lease expiry, dispatched holds a dispatch time, and dead-letter holds a failure reason and an attempt count. A four-value label forces those onto nullable columns that mean something in one state each, which is the shape litespec/backend/domain#model-every-closed-set-of-domain-values-as-a-closed-type-hierarchy removes everywhere else.

Example

OutboxState.Processing carries one unexpired lease before a dispatcher records OutboxState.Dispatched or a retry state.

Checka reviewer answers

Reviewed forWhich outbox states lack a sealed record under the abstract base, or a documented transition? Look at the outbox state types and their transitions.

Marked guidance: a reviewer answers this question.

Preserve Message Identity During Retry#

rulerequiredguidance
litespec/ext/outbox#preserve-message-identity-during-retry
Statement

An outbox dispatcher MUST preserve message ID across retry and replay.

Applies toartifact: any

Why

The target suppresses a repeat by recognizing its identity, which works only when every retry and replay carries the same message ID. A dispatcher that mints a new ID per attempt turns each retry into a new message the target processes again.

Checka reviewer answers

Reviewed forWhich retry or replay paths mint a new message ID? Look at the dispatcher's retry and replay code.

Marked guidance: a reviewer answers this question.

Audit Outbox Replay#

rulerequiredguidance
litespec/ext/outbox#audit-outbox-replay
Statement

An outbox replay MUST record actor, reason, time, and failure without editing the payload: an audit record when audit is selected, a standalone record otherwise.

Applies toartifact: any

Why

A replay dispatches a message the system already handled or dead-lettered, so the team records who replayed it, why, when, and which failure it answers. Without that record, a duplicate delivery looks like a dispatcher bug instead of an operator's decision, and nobody can reconstruct the choice.

Checka reviewer answers

Reviewed forWhich replays omit the actor, reason, time, or failure, or edit the payload? Look at the replay code and its audit records.

Marked guidance: a reviewer answers this question.

Protect Active Worker Compatibility#

rulerequiredguidance
litespec/ext/outbox#protect-active-worker-compatibility
Statement

New WebApi code MUST emit a message only after every active Worker can read its type and schema version.

Applies toartifact: endpoint

Why

WebApi writers and Worker dispatchers deploy independently, so a writer can run ahead of the oldest active Worker. When the writer emits a shape that Worker cannot read, those messages dead-letter on arrival through no fault of their own.

Checka reviewer answers

Reviewed forWhich new messages carry a type or schema version that an active Worker cannot read? Look at the Worker's readers and the messages the WebApi emits.

Marked guidance: a reviewer answers this question.

Deploy Readers Before Writers#

rulerequiredguidance
litespec/ext/outbox#deploy-readers-before-writers
Statement

A release MUST deploy compatible readers before writers for additive event versions.

Applies toartifact: any

Why

In a mixed-version rollout, old and new records sit in one store. Deploying compatible readers before the writers that emit new shapes keeps every record dispatchable at every step; the reverse order strands new records until the readers catch up.

Checka reviewer answers

Reviewed forWhich release plans deploy an additive writer before its readers? Look at the deployment order in the release runbook.

Marked guidance: a reviewer answers this question.

Plan Undispatched Rollback Records#

rulerequiredguidance
litespec/ext/outbox#plan-undispatched-rollback-records
Statement

A rollback Runbook MUST include records created by the new writer but not yet dispatched.

Applies toartifact: record:runbook

Why

Rolling back the deployment does not roll back the store: records the new writer staged but nobody dispatched stay behind. The rollback Runbook names how the previous version handles them, or they sit undispatched with no owner and no reader.

Checka reviewer answers

Reviewed forWhich rollback runbooks omit records the new writer staged but nobody dispatched? Look at each rollback runbook record.

Marked guidance: a reviewer answers this question.

Conventions#

Group Outbox Infrastructure#

conventiondefaultguidance
litespec/ext/outbox#group-outbox-infrastructure
Default

Keep outbox record, storage, claim, and dispatch infrastructure under Infrastructure/Messaging/Outbox/.

ReplacementA project names another home for outbox infrastructure in its documentation.

Applies toartifact: any

Why

The outbox record, storage, claim, and dispatch code form one mechanism with one owner. Keeping it under Infrastructure/Messaging/Outbox/ puts every persistent dispatch question in one folder instead of scattered across the project.

Checka reviewer answers

Reviewed forWhich outbox infrastructure sits outside Infrastructure/Messaging/Outbox/ with no other home named in the documentation? Look at the outbox code folders and the project's documentation.

Marked guidance: a reviewer answers this question.

Isolate the Worker Host#

conventiondefaultguidance
litespec/ext/outbox#isolate-the-worker-host
Default

Keep the outbox Worker host in its own project.

ReplacementA project hosts outbox dispatch inside its request host.

Applies toartifact: any

Why

The Worker runs as its own process with its own lifetime, scaling, and configuration, apart from the request host. Its own project keeps that independence visible and stops request concerns leaking into dispatch configuration.

Checka reviewer answers

Reviewed forWhich outbox Worker hosts share a project with the request host, with no documented choice? Look at the solution's projects.

Marked guidance: a reviewer answers this question.

Keep Provider Mapping with Integration#

conventiondefaultguidance
litespec/ext/outbox#keep-provider-mapping-with-integration
Default

Keep Integration Event-to-provider mapping in the integration that owns the side effect.

ReplacementA project keeps provider mapping in the shared dispatch path.

Applies toartifact: any

Why

Each provider speaks its own transport with its own mapping, retries, and quirks. The integration that owns the side effect owns that mapping, so a provider change touches one integration instead of the shared dispatch path.

Checka reviewer answers

Reviewed forWhich provider mappings sit in the shared dispatch path with no documented choice? Look at the dispatch code and the integration projects.

Marked guidance: a reviewer answers this question.

Dispatch Journey-Step Commands in a New Scope#

conventiondefaultguidance
litespec/ext/outbox#dispatch-journey-step-commands-in-a-new-scope
Default

Dispatch a journey-step command through ICommandMediator in a fresh Worker scope.

ReplacementA project runs journey-step commands inline in the dispatcher scope.

Applies toartifact: any

Why

A journey-step command is a full command with validation, authorization, and its own transaction, not a subroutine of the dispatcher. Sending it through ICommandMediator in a fresh Worker scope runs the whole application pipeline for it.

Checka reviewer answers

Reviewed forWhich journey-step commands run inline in the dispatcher scope with no documented choice? Look at the dispatcher's journey-step code.

Marked guidance: a reviewer answers this question.

Avoid Automatic Durable-Bus Adoption#

conventiondefaultguidance
litespec/ext/outbox#avoid-automatic-durable-bus-adoption
Default

Use project-owned Marten records and Worker dispatch unless a manifest-pinned durable package passes a shared-transaction integration test.

ReplacementA project names a durable bus package as its dispatch transport in its documentation.

Applies toartifact: any

Why

A durable bus package earns its place only when an integration test proves it commits the message in the same transaction as the business work. Until that evidence exists, project-owned Marten records with Worker dispatch carry delivery without depending on behavior nobody verified.

Checka reviewer answers

Reviewed forWhich dispatchers run on a durable bus package with no pinned manifest entry or documented choice? Look at the manifest and the dispatch transport.

Marked guidance: a reviewer answers this question.

Dependencies#

Packages: None.

Related extensions: integrations, jobs, realtime.

Guides: None.