Skip to main content

Context map

This is the ddd-crew context map for this bounded context: what is actually wired and running, with the strategic pattern on every edge. A context map that blurs wiring and wishes is a wish list, so every edge below has a real producer and consumer, verified against this service's cmd/wes/main.go and adapters and against each sibling's origin/develop.

Pattern abbreviations: U/D upstream/downstream, OHS Open Host Service, PL Published Language, CF Conformist, ACL Anti-Corruption Layer, C/S Customer/Supplier, P Partnership, SK Shared Kernel.

The map​

Solid edges are Kafka (CloudEvents 1.0); dashed edges are synchronous calls. Arrows point from upstream to downstream. The facility-layout travel-distance lookup is gone with the shift plan (ADR-0049), so this context makes no outbound synchronous call.

Source: internal/adapters/inbound/kafka/consumer.go, internal/adapters/inbound/kafka/pack_level_consumer.go, internal/adapters/inbound/kafka/product_classification_consumer.go, internal/adapters/outbound/kafka/publisher.go, internal/adapters/outbound/kafkacatalog/consumer.go, internal/adapters/outbound/productclassificationcopy/, and each sibling's consumer file listed below. Omits: the warehouse-console shell, which mounts this repo's web/ micro-frontend and calls the same REST API, and this service's own analytics topic warehouse.wes.analytics.

Relationships and evidence​

CounterpartU/DPattern(s)TechnologyStatusEvidence
workforce-managementthey U, we DC/S; their OHS+PL, our ACLKafka warehouse.workforce.events, com.warehouse.wes.workforce-management.shiftplan.ShiftPlanCommittedLiveours: internal/adapters/inbound/kafka/consumer.go (shiftPlanCommittedData)
inventory-storage (events)they U, we DC/S; their OHS+PL, our ACLKafka warehouse.inventory.events, com.warehouse.wms.inventory-storage.reservation.StockReserved / ReservationRevokedLive (projection feeds no decision yet)ours: consumer.go (inventoryEventData)
product-masterthey U, we Dtheir PL, our local copyKafka warehouse.product-master.events, com.warehouse.wms.product-master.product.ProductClassified (version-guarded copy, read at release) and ...ProductPackLevelDeclared / ...ProductPackLevelRetired / ...ProductPackLevelMeasured (pack-level copy keyed by GTIN, own group PACK_VIEW_CONSUMER_GROUP)Wired, always on (PRODUCT_CLASSIFICATION_MODE defaults to kafka; permissive/off are boot errors, ADR-0044; the pack-level consumer needs PACK_VIEW_CONSUMER_GROUP)internal/adapters/inbound/kafka/product_classification_consumer.go, internal/adapters/inbound/kafka/pack_level_consumer.go, internal/adapters/outbound/productclassificationcopy/ (ADR-0035, ADR-0045; replaces the retired inventory-storage REST lookup of ADR-0009)
order-management (demand)they U, we DC/S; their OHS+PL, our ACLKafka warehouse.order-management.events, com.warehouse.wes.order-management.order.OrderAllocated / OrderPartiallyAllocatedLiveours: consumer.go (orderAllocatedData), usecases.ApplyOrderAllocated (ADR-0031)
order-management (capacity)we U, they DC/S; our OHS+PLKafka warehouse.work-planning.events, com.warehouse.wes.work-planning.workpool.PathCapacityChangedLivetheirs: internal/adapters/outbound/kafkapathcapacity/consumer.go (ADR-0018)
slotting-optimizationthey U, we DC/S; their OHS+PL, our ACL (slotPlanApprovedData → relocation.Plan)Kafka warehouse.slotting-optimization.events, com.warehouse.wms.slotting-optimization.slotplan.SlotPlanApprovedWired (fleet decision E1): each move becomes a RELOCATE work unit released to fulfillment-execution's RELOCATE taskours: consumer.go (handleSlottingEvent), usecases.ApplySlotPlanApproved (ADR-0040)
network-inventory-planningthey U, we DC/S; their OHS+PL, our ACL (workDemandReleasedData → ApplyWorkDemandReleasedRequest)Kafka warehouse.network-inventory-planning.events, com.warehouse.wes.network-inventory-planning.workdemand.WorkDemandReleasedWired: each transfer leg becomes one transfer-referenced work unit, id = demand_idours: consumer_handlers.go (handleNetworkDemandEvent), usecases.ApplyWorkDemandReleased (ADR-0033); theirs: apis/asyncapi.yaml (sendWorkDemandReleased)
pick-face-replenishmentthey U, we DC/S; their OHS+PL, our ACL (replenishmentRequestedData → workunit.ReplenishmentMove)Kafka warehouse.pick-face-replenishment.events, com.warehouse.wms.pick-face-replenishment.replenishment.ReplenishmentRequested / ...ReplenishmentCancelledWired, always on (REPLENISHMENT_MODE defaults to kafka; permissive/off are boot errors, ADR-0044): each request becomes ONE REPLENISH work unit released to fulfillment-execution's REPLENISH taskours: replenishment_consumer.go, usecases.ApplyReplenishmentRequested / ApplyReplenishmentCancelled (ADR-0042)
process-path-managementthey U, we Dtheir OHS+PL, we CFKafka warehouse.process-path-management.events, com.warehouse.wes.process-path-management.processpath.*; or a YAML fileLive with PATH_CATALOGUE_SOURCE=kafka; file source is the defaultinternal/adapters/outbound/kafkacatalog/, internal/adapters/outbound/filecatalog/ (ADR-0012, ADR-0030)
fulfillment-execution (release)we U, they DC/S; our OHS+PLKafka warehouse.work-planning.events, com.warehouse.wes.work-planning.workunit.WorkReleased (RELOCATE units add relocation, ADR-0040)Livetheirs: internal/adapters/inbound/kafka/consumer.go; RELOCATE task: their ADR 0047
fulfillment-execution (feedback)they U, we DC/S, roles reversed; their OHS+PL, our ACLKafka warehouse.fulfillment.events, com.warehouse.wes.fulfillment-execution.task.TaskCompletedLiveours: consumer.go (taskCompletedData), usecases.ApplyTaskCompleted
network-fulfillmentwe U, they Dour OHS+PL, they CFKafka warehouse.work-planning.events, PathCapacityChangedLive (behind their CAPABILITY_OFFER_ENABLED)theirs: internal/adapters/outbound/pathcapacitycache/consumer.go
warehouse-ops-agentwe U, they Dour OHSREST (WES_WORK_PLANNING_REST_URL, reports URL) and MCP (get_backlog_telemetry, get_rebalance_recommendation)Livetheirs: internal/config/config.go
labor-performance—Separate WaysnoneDeliberately absent: does not consume warehouse.work-planning.eventsgit grep on its origin/develop finds no reference
warehouse-planning—Separate Waysnone at runtimeDeliberately absent: owns the charge forecast (workload forecast), the labour plan and their drift since ADR-0049; our two old planning POSTs answered 410 naming its routes for one release and were removed in stage E (404), and no message flows between usours: internal/adapters/inbound/http/planning_moved_test.go (the removed routes answer 404); theirs: its ADR 0023
facility-layout—Separate WaysnoneDeliberately absent since ADR-0049, which removed the commit-time travel-distance lookup—
any sibling—Not SK, not P—Deliberately absentno shared types, schemas or tables; envelope duplicated by agreement (ADR-0027)

Six further event types on warehouse.work-planning.events (everything except WorkReleased and PathCapacityChanged) are published but unconsumed — see Domain events.

The loop​

WorkReleased out to Execution, TaskCompleted back in, is a genuine closed control loop rather than a one-way pipeline:

Source: internal/application/usecases/release_next_work.go, apply_task_completed.go, record_completion.go.

The loop is what makes the WIP limit meaningful. Without the feedback edge, WIP would only ever grow and a release-fed pool would deadlock at its limit after wipLimit releases.

Why each pattern​

WMS → WES is Customer/Supplier with an ACL in both directions​

The platform's strategic reference states it directly: WMS is the upstream customer of demand and WES the supplier of fulfilment progress; WMS publishes an Open Host Service with a Published Language that WES conforms to; and the boundary carries an Anti-Corruption Layer in both directions.

In this repository that ACL is not a diagram box, it is internal/adapters/inbound/kafka/consumer.go: unexported structs (inventoryEventData, shiftPlanCommittedData, taskCompletedData, orderAllocatedData) hold the foreign shape and never leave the adapter. What crosses into the application layer is a translated call, never a foreign type.

order-management → WES is Customer/Supplier, choreographed and fire-and-forget​

order-management used to call POST /paths/{pathId}/work-units synchronously — a coupling this service's owners rejected in favour of the same publish-and-forget choreography every other upstream context uses. There is no reply event: order-management does not learn from Kafka whether its lines were enqueued. That is a confirmed v1 design choice (ADR-0031).

WES → Execution, order-management and network-fulfillment: we are the host​

Downstream, the roles flip. warehouse.work-planning.events is our Open Host Service and its CloudEvents types are our Published Language (apis/asyncapi.yaml). fulfillment-execution builds its own Task from WorkReleased; order-management and network-fulfillment each cache PathCapacityChanged by path and cutoff. network-fulfillment is a pure Conformist: we did nothing for it and do not know it is there.

process-path-management: Conformist, read-only​

This context conforms to a Generic context without owning or reshaping its facts: the process-path catalogue every pathId is validated against. The catalogue stays there. (facility-layout's travel distance, the other fact it once read, was retired with the shift plan, ADR-0049.)

Three-tier view​

TierHorizonQuestionServices here
WMSminutes → dayswhat needs to happen, and whyinventory-storage, product-master, order-management
WESseconds → minuteswho does it, right now, in what orderwes-work-planning, fulfillment-execution
WCSms → secondshow the machine performs the next stepnot built — no equipment-control service exists in this platform

workforce-management (Supporting), facility-layout and process-path-management (Generic) sit beside the tiers: they supply labour capacity, physical structure and the path catalogue to whoever asks.