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
| Counterpart | U/D | Pattern(s) | Technology | Status | Evidence |
|---|---|---|---|---|---|
| workforce-management | they U, we D | C/S; their OHS+PL, our ACL | Kafka warehouse.workforce.events, com.warehouse.wes.workforce-management.shiftplan.ShiftPlanCommitted | Live | ours: internal/adapters/inbound/kafka/consumer.go (shiftPlanCommittedData) |
| inventory-storage (events) | they U, we D | C/S; their OHS+PL, our ACL | Kafka warehouse.inventory.events, com.warehouse.wms.inventory-storage.reservation.StockReserved / ReservationRevoked | Live (projection feeds no decision yet) | ours: consumer.go (inventoryEventData) |
| product-master | they U, we D | their PL, our local copy | Kafka 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 D | C/S; their OHS+PL, our ACL | Kafka warehouse.order-management.events, com.warehouse.wes.order-management.order.OrderAllocated / OrderPartiallyAllocated | Live | ours: consumer.go (orderAllocatedData), usecases.ApplyOrderAllocated (ADR-0031) |
| order-management (capacity) | we U, they D | C/S; our OHS+PL | Kafka warehouse.work-planning.events, com.warehouse.wes.work-planning.workpool.PathCapacityChanged | Live | theirs: internal/adapters/outbound/kafkapathcapacity/consumer.go (ADR-0018) |
| slotting-optimization | they U, we D | C/S; their OHS+PL, our ACL (slotPlanApprovedData → relocation.Plan) | Kafka warehouse.slotting-optimization.events, com.warehouse.wms.slotting-optimization.slotplan.SlotPlanApproved | Wired (fleet decision E1): each move becomes a RELOCATE work unit released to fulfillment-execution's RELOCATE task | ours: consumer.go (handleSlottingEvent), usecases.ApplySlotPlanApproved (ADR-0040) |
| network-inventory-planning | they U, we D | C/S; their OHS+PL, our ACL (workDemandReleasedData → ApplyWorkDemandReleasedRequest) | Kafka warehouse.network-inventory-planning.events, com.warehouse.wes.network-inventory-planning.workdemand.WorkDemandReleased | Wired: each transfer leg becomes one transfer-referenced work unit, id = demand_id | ours: consumer_handlers.go (handleNetworkDemandEvent), usecases.ApplyWorkDemandReleased (ADR-0033); theirs: apis/asyncapi.yaml (sendWorkDemandReleased) |
| pick-face-replenishment | they U, we D | C/S; their OHS+PL, our ACL (replenishmentRequestedData → workunit.ReplenishmentMove) | Kafka warehouse.pick-face-replenishment.events, com.warehouse.wms.pick-face-replenishment.replenishment.ReplenishmentRequested / ...ReplenishmentCancelled | Wired, 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 task | ours: replenishment_consumer.go, usecases.ApplyReplenishmentRequested / ApplyReplenishmentCancelled (ADR-0042) |
| process-path-management | they U, we D | their OHS+PL, we CF | Kafka warehouse.process-path-management.events, com.warehouse.wes.process-path-management.processpath.*; or a YAML file | Live with PATH_CATALOGUE_SOURCE=kafka; file source is the default | internal/adapters/outbound/kafkacatalog/, internal/adapters/outbound/filecatalog/ (ADR-0012, ADR-0030) |
| fulfillment-execution (release) | we U, they D | C/S; our OHS+PL | Kafka warehouse.work-planning.events, com.warehouse.wes.work-planning.workunit.WorkReleased (RELOCATE units add relocation, ADR-0040) | Live | theirs: internal/adapters/inbound/kafka/consumer.go; RELOCATE task: their ADR 0047 |
| fulfillment-execution (feedback) | they U, we D | C/S, roles reversed; their OHS+PL, our ACL | Kafka warehouse.fulfillment.events, com.warehouse.wes.fulfillment-execution.task.TaskCompleted | Live | ours: consumer.go (taskCompletedData), usecases.ApplyTaskCompleted |
| network-fulfillment | we U, they D | our OHS+PL, they CF | Kafka warehouse.work-planning.events, PathCapacityChanged | Live (behind their CAPABILITY_OFFER_ENABLED) | theirs: internal/adapters/outbound/pathcapacitycache/consumer.go |
| warehouse-ops-agent | we U, they D | our OHS | REST (WES_WORK_PLANNING_REST_URL, reports URL) and MCP (get_backlog_telemetry, get_rebalance_recommendation) | Live | theirs: internal/config/config.go |
| labor-performance | — | Separate Ways | none | Deliberately absent: does not consume warehouse.work-planning.events | git grep on its origin/develop finds no reference |
| warehouse-planning | — | Separate Ways | none at runtime | Deliberately 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 us | ours: internal/adapters/inbound/http/planning_moved_test.go (the removed routes answer 404); theirs: its ADR 0023 |
| facility-layout | — | Separate Ways | none | Deliberately absent since ADR-0049, which removed the commit-time travel-distance lookup | — |
| any sibling | — | Not SK, not P | — | Deliberately absent | no 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
| Tier | Horizon | Question | Services here |
|---|---|---|---|
| WMS | minutes → days | what needs to happen, and why | inventory-storage, product-master, order-management |
| WES | seconds → minutes | who does it, right now, in what order | wes-work-planning, fulfillment-execution |
| WCS | ms → seconds | how the machine performs the next step | not 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.