Skip to main content

EventStorming

Design-level EventStorming in the notation of the ddd-crew EventStorming glossary and cheat sheet, reconstructed from the code on develop rather than from a workshop. Hotspots are only gaps already recorded in ADRs, the README Deferred list or .claude/rules/deferred-and-known-gaps.md.

Legend​

Source: ddd-crew cheat-sheet colours. Omits: nothing — legend only.

1. Intake, allocation and release​

Source: internal/application/usecases/receive_order.go, allocation.go, retry_allocation.go, product_classification.go, internal/adapters/inbound/kafka/product_classification_consumer.go, release_confirmation_consumer.go, release_confirmation.go, internal/domain/order/path_selection.go, promise_policy.go. Omits: the reconfirm Order Line Backordered (lost reservation) and the analytics fan-out of every event. The release confirmation branch (Work Unit Created, Confirm Release, Order Release Unconfirmed) exists only with RELEASE_CONFIRMATION_MODE=kafka (ADR 0043), which is off by default.

2. Hold, release and cancellation​

Source: internal/application/usecases/release_held_order.go, cancel_order.go, internal/domain/order/intake_intent.go, order.go (EnsureCancellable, EnsureReleasable), ADR 0004, ADR 0020; the orphaned-hold sweep is network-fulfillment's internal/application/usecases/sweep_orphaned_holds.go (its ADR 0024), which cancels through DELETE /orders/{id}. Omits: cancellation by a direct customer (same command, different actor).

3. Re-promise and planned capacity​

Source: internal/adapters/inbound/kafka/repromise_consumer.go, planned_capacity_consumer.go, internal/application/usecases/repromise_order.go, planned_capacity.go, internal/adapters/outbound/{kafkacatalog,kafkacptschedule,kafkapathcapacity}; the OrderRepromised consumer is exception-management's internal/adapters/inbound/kafka/order_correlation_consumer.go. Omits: the analytics projector (a read model built from every event, see Order Funnel report).

Stickies and their evidence​

StickyKindCode evidence
Customer channel, Operator, Console user or AI agentActorREST callers of internal/adapters/inbound/http, MCP get_order
Receive OrderCommandusecases.ReceiveOrder, POST /orders
Retry AllocationCommandusecases.RetryAllocation, POST /orders/{id}/allocation-retries
Release Held OrderCommandusecases.ReleaseHeldOrder, POST /orders/{id}/releases
Cancel OrderCommandusecases.CancelOrder, DELETE /orders/{id}
Repromise OrderCommandusecases.RepromiseOrder
Apply Planned CapacityCommandusecases.ApplyPlannedCapacity
Apply Product ClassificationCommandusecases.ApplyProductClassification (ADR 0036)
Confirm ReleaseCommandusecases.ConfirmRelease, driven by inbound/kafka/release_confirmation_consumer.go (ADR 0043; opt-in)
OrderAggregateorder.Order
Order Received … Order RepromisedDomain Eventinternal/domain/shared/events.go
Task CPT Missed, Package ManifestedDomain Event (upstream)inbound/kafka/repromise_consumer.go
Capacity Plan Created, Published, Shortage DetectedDomain Event (upstream)inbound/kafka/planned_capacity_consumer.go
Product ClassifiedDomain Event (upstream, product-master)inbound/kafka/product_classification_consumer.go
Work Unit CreatedDomain Event (upstream, wes-work-planning)inbound/kafka/release_confirmation_consumer.go (reads only reference and line_no; ADR 0043)
Path selection policyPolicyorder.PathSelectionPolicy (ADR 0021)
Promise policyPolicyorder.PromisePolicy (ADR 0014, 0017, 0020)
Allocate every line on receiptPolicyReceiveOrder calls allocateAndRelease
Reconfirm then release unless ship-complete is blockedPolicyreconfirmBeforeRelease, releaseAllocatedLines, Order.EnsureReleasable (BR3)
Release confirmation: PENDING, CONFIRMED or UNCONFIRMED after a timeoutPolicy (process manager)releaseconfirmation.Confirmation, openReleaseConfirmations, usecases.FlagUnconfirmedReleases (ADR 0043; opt-in)
Held order must be ship-completePolicyorder.ValidateIntakeIntent
No cancel once any line is releasedPolicyOrder.EnsureCancellable (BR6)
Re-promise on CPT missed or package manifestedPolicyRepromiseConsumer → RepromiseOrder
Catalogue, CPT schedule and capacity cachesRead Modelkafkacatalog, kafkacptschedule, kafkapathcapacity
Planned capacity windowsRead Modelplanned_capacity_windows, order.PlannedCapacityWindow
Product classification copyRead Modelproduct_classification_copy, ports.ProductClassificationLookup (ADR 0036)
Order view with promiseDateRead ModelGET /orders/{id} response (orderResponse)
inventory-storage, product-master, wes-work-planning, process-path-management, fulfillment-execution, warehouse-planning, network-fulfillment, exception-managementExternal Systemoutbound and inbound adapters listed on Context Map
Order Line Released and Order Released raised only on the analytics topicEventpublishReleaseFacts in allocation.go, ADR 0034
Order Release Unconfirmed raised only on the analytics topic, by the housekeeping timeoutEventFlagUnconfirmedReleases, ADR 0043
Release confirmation is off by default, an unconfirmed line triggers no automatic actionHotspotADR 0043, README Deferred list
network-fulfillment sweeps an undecided hold past acknowledgeBy plus graceExternal Systemnetwork-fulfillment internal/application/usecases/sweep_orphaned_holds.go (its ADR 0024) cancels through DELETE /orders/{id}; the sweep is not in this service by design (ADR 0020 accepted deferral, README Deferred list)
BR3 blocking a release is a hold, answered 201/200 with a Backordered order (no ship-complete-blocked problem type)PolicyreleaseAllocatedLines, Order.EnsureReleasable, br3_block_test.go, ADR 0003
exception-management consumes Order RepromisedExternal Systempublished on warehouse.order-management.events (outbound/kafka.Publisher); exception-management internal/adapters/inbound/kafka/order_correlation_consumer.go uses it to auto-resolve the order's open exception cases