Skip to main content
Topics are the message channels through which operations communicate asynchronously. An operation publishes to a topic through a publication effect; another operation subscribes to a topic through a subscription input. Topics carry most of the guarantees that allow the verifier to reason about ordering, idempotency, and duplicate delivery across service boundaries. What you declare on a topic is an implementation guarantee — a fact the verifier may rely on, subject to the real infrastructure conforming to it.

Topic fields

Messages

messages is the set of schemas the topic is allowed to carry. Membership means the topic may carry that schema — it does not assert that such a message is ever published.

Ordering

Topic ordering is a guarantee provided by the topic abstraction about the sequence in which messages are logically observed at the subscription boundary. For keyed ordering, the mapping identifies which field in each carried schema holds the topic’s logical key. Different schemas may map differently named fields into the same key domain.
Topic ordering describes the order in which messages are logically observed at the subscription boundary. It does not imply that consumer invocations cannot overlap, that effects produced by the consumer cannot overtake one another, or that there is a meaningful business-level causal relationship between independently produced messages. To carry ordering through operation execution, dispatch routing and lane concurrency facts must also support it.

Ordering is not execution serialization

A keyed topic may impose a transport sequence between two concurrently produced messages for the same key. That sequence is a real transport order, but it does not prove that either message was semantically required to precede the other. The verifier distinguishes between an order that merely exists because transport serialized concurrent inputs, and a genuine upstream causal precedence the architecture is required to preserve.

Message identity

message_identity is a guarantee provided by the topic’s producers: it declares where the identity of one logical message lives in the payload. For keyed identity, if two messages carried by the topic have equal values at the declared identity fields, they are the same logical message — same schema, equal payloads. This has three deliberate consequences:
  1. Two publications sharing an identity are attempts at publishing one logical message. The declaration says nothing about how often that message is delivered; delivery semantics govern that separately.
  2. Because equal identity implies the same schema, cross-schema identity collisions are excluded. Do not map two schemas into the same identity domain if distinct logical messages of those schemas can share an identity value.
  3. The mapping may cover a subset of the carried schemas. keyed ordering must route every carried message; identity is meaningful knowledge per schema and may be declared for only the schemas where you need it.
Message identity is not the ordering key. An order_id field correctly identifies which order’s messages belong together (the ordering key domain), but it does not identify a single logical message — OrderCreated and OrderPaid for the same order share order_id while being different messages. Use a dedicated event_id field as the message identity.

When to declare message identity

Declare message identity when you are willing for a correctness proof to rely on “same identity value implies same payload.” A producer that stamps a fresh timestamp or nonce into each publication attempt does not conform to this guarantee and must not declare it. Message identity is essential for idempotency proofs involving publication effects. For the verifier to prove a publication effect safe under retries, it must establish that duplicate publications carry the same logical message (requiring keyed identity on the topic) and that every modeled consumer collapses duplicate deliveries of that message.

Subscription delivery and dispatch

Subscription inputs declare how deliveries arrive and how they are routed to execution lanes. These declarations are the consumer-side counterpart to topic ordering.

Delivery semantics

at_least_once delivery means you must account for duplicate invocations. It is the driver for completion: guaranteed recoverability proofs: at_least_once delivery on the triggering subscription is one of the modeled retry drivers the verifier accepts for a guaranteed-completion proof.

Dispatch routing

Dispatch routing says how deliveries are assigned to logical execution lanes.

Lane concurrency

A logical lane dispatches its deliveries in the order they entered it. A delivery leaves the lane only when its invocation has completed; a failed attempt is re-dispatched at the head of the lane before any later delivery. Lane concurrency controls whether invocations from one lane may overlap.

The ordering proof pattern

The canonical pattern for proving same-key ordered serial execution through a subscription is a chain of three declarations, each contributing a distinct fact:
None of these three facts substitutes for another. A keyed topic without single-lane dispatch does not route same-key messages to a common execution context. Single-lane dispatch without bounded(1) concurrency does not prevent overlap. Bounded(1) concurrency without keyed routing does not establish which deliveries are subject to the bound.

Full topic example

The following is topic.order_events from the flash checkout model — a keyed topic carrying six event schemas, all keyed on order_id, with per-schema event_id message identity.