Skip to main content

Context map

warehouse-systems is a fleet of Go services, one bounded context each, plus an external WCS tier that is not built. This page is this service's slice of the fleet context map, drawn with the ddd-crew Context Mapping vocabulary. It is honest about the difference between live (a real topic or route, a real adapter, running code, on by default), opt-in (the adapter exists but an env var switches it on), and deliberately absent (a real relationship in the domain with no wire, by decision).

Pattern legend​

AbbreviationPatternSits on
U / DUpstream / Downstream — who can change the contract and who must followeach end of an edge
OHSOpen Host Service — a general-purpose protocol published for many clientsupstream end
PLPublished Language — a documented interchange format (here: CloudEvents types + apis/asyncapi.yaml, apis/openapi.yaml)upstream end
CFConformist — downstream adopts the upstream model without translationdownstream end
ACLAnti-Corruption Layer — downstream translates at its boundarydownstream end
C/SCustomer/Supplier — downstream's needs are a real input to upstream's planningthe edge
PPartnershipthe edge (none here)
SKShared Kernelthe edge (none here — no shared Go types or tables)
Separate WaysNo integration, by decision—

The map​

Every arrow points from upstream to downstream (the direction the model flows), whatever the transport direction of the call.

Source: internal/adapters/inbound/kafka/consumer.go, internal/adapters/outbound/kafka/publisher.go, internal/adapters/outbound/kafkacatalog/consumer.go, internal/adapters/inbound/kafka/product_classified_consumer.go, internal/adapters/outbound/productclassificationcopy/, internal/adapters/outbound/facilitylayout/client.go, internal/adapters/inbound/http/router.go, cmd/mcp/router.go, internal/application/ports/equipment.go, apis/asyncapi.yaml. Thick arrows are Kafka (live when EVENT_PUBLISHER=kafka); thin solid arrows are synchronous calls into this service; dotted arrows are opt-in or absent. Omitted: edges between other contexts (see each service's own map), this service's internal analytics topic (warehouse.fulfillment.analytics, produced and consumed only by this context), and browser clients (warehouse-console / the web/ MFE), which are not bounded contexts. Path parameters are written without braces in the diagram labels.

Relationships with evidence​

#Upstream → DownstreamPatternsTechnologyStatusEvidence (this repo)
1wes-work-planning → thisC/S; U: PL; D: ACLKafka warehouse.work-planning.events, com.warehouse.wes.work-planning.workunit.WorkReleased; group WORK_RELEASED_CONSUMER_GROUP (default fulfillment-execution)Live (consumer always starts)internal/adapters/inbound/kafka/consumer.go (TypeWorkReleased, WorkReleasedData, handleClaimedEvent → CreateTask)
2this → wes-work-planningC/S (feedback edge); U: OHS + PL; D: CFKafka warehouse.fulfillment.events, com.warehouse.wes.fulfillment-execution.task.TaskCompletedLive with EVENT_PUBLISHER=kafkainternal/adapters/outbound/kafka/publisher.go (encodeTaskCompleted, work_unit_id enrichment)
3this → labor-performanceU: OHS + PL; D: CFKafka warehouse.fulfillment.events, com.warehouse.wes.fulfillment-execution.task.TaskCompleted (associate_id, duration_seconds, task_type)Live with EVENT_PUBLISHER=kafkasame publisher; ADR-0014, ADR-0023
4this → order-managementU: OHS + PL; D: CFKafka warehouse.fulfillment.events, com.warehouse.wes.fulfillment-execution.task.TaskCPTMissed, com.warehouse.wes.fulfillment-execution.package.PackageManifestedLive with EVENT_PUBLISHER=kafkapublisher.go (encodeTaskCPTMissed, encodePackageManifested); ADR-0025
5this → exception-managementU: OHS + PL; D: CFKafka warehouse.fulfillment.events, com.warehouse.wes.fulfillment-execution.package.PackageDiverted, com.warehouse.wes.fulfillment-execution.package.WeightDiscrepancyDetected (promoted from the analytics topic; byte-identical data)Published; consumer repo not built yet (dashed above)publisher.go (encodePackageDiverted, encodeWeightDiscrepancyDetected); ADR-0053
6this → workforce-managementU: OHS; D: CFREST GET /capacity/{capability} (called by workforce-management)Liveinternal/adapters/inbound/http/router.go, usecases.GetInstalledCapacity; ADR-0018
7this → warehouse-ops-agentU: OHS; D: CFMCP Streamable HTTP (cmd/mcp, tools get_queue_status, find_claimable_work, diagnose_stuck_tasks, complete_task, plus get_fulfillment_throughput_report / get_on_time_to_cpt when REPORTS_BASE_URL is set); REST GET /tasks?orderRef= from the console BFFLivecmd/mcp/router.go, internal/adapters/inbound/mcp/tools.go; ADR-0008, ADR-0013
8process-path-management → thisU: PL; D: CFKafka warehouse.process-path-management.events, com.warehouse.wes.process-path-management.processpath.ProcessPathCreated / ProcessPathUpdated / ProcessPathDeactivated; per-process groupOpt-in (PATH_CATALOGUE_SOURCE=kafka; default file reads the same shape from YAML)internal/adapters/outbound/kafkacatalog/consumer.go; ADR-0017
9product-master → thisU: PL; D: ACL (ports.ClassificationInfo) over a local copyKafka warehouse.product-master.events, com.warehouse.wms.product-master.product.ProductClassified → table product_classification_copy, read per scanned SKU at seal time; group PRODUCT_CLASSIFICATION_CONSUMER_GROUPOpt-in (PRODUCT_CLASSIFICATION_MODE=kafka; default permissive no-op; http, the former inventory-storage REST lookup, fails the boot)internal/adapters/inbound/kafka/product_classified_consumer.go, internal/adapters/outbound/productclassificationcopy/; ADR-0039 (supersedes the live lookup of ADR-0010)
10task-interleaving → thisU: PL; D: ACL (ports.InterleavingHint) over a local copyKafka warehouse.task-interleaving.events, com.warehouse.wes.task-interleaving.stationtrip.InterleavingHintIssued → table interleaving_hints (one ACTIVE hint per station), read by ClaimNext as an advisory tie-break inside one priority band; group TASK_INTERLEAVING_CONSUMER_GROUPOpt-in (TASK_INTERLEAVING_MODE=kafka; default permissive no-op, fail-open everywhere)internal/adapters/inbound/kafka/interleaving_hint_consumer.go, internal/adapters/outbound/interleavinghintcopy/; ADR-0051
11facility-layout → thisU: OHS; D: ACL (ports.LocationRoleInfo), conforming to the LocationRole vocabularyREST GET /locations/{locationCode}, called once per RegisterStation with a locationCode, behind retry + circuit breakerOpt-in (LOCATION_ROLE_MODE=http + FACILITY_LAYOUT_BASE_URL; default permissive no-op)internal/adapters/outbound/facilitylayout/; ADR-0024
12this → WCS / equipmentStrategically U: this; D: WCS; ACL seam on this sidenoneDeliberately absent — the port declares no methods and has no adapterinternal/application/ports/equipment.go; ADR-0015
13inventory-storage, facility-layout, order-management events → thisSeparate WaysnoneDeliberately absent — stock, layout and order facts reach this context only through what wes-work-planning releases (plus the opt-in facility-layout lookup and product-master copy above)no consumer for those topics in internal/adapters/inbound/kafka/

All REST and MCP surfaces are unauthenticated (ADR-0022). No Shared Kernel and no Partnership exist: no Go type, table or library is shared with another context — even the DOT segregation matrix is a deliberate, documented duplicate of inventory-storage's (internal/domain/package/segregation.go).

The control loop with Work Planning​

Edges 1 and 2 form a closed loop: Work Planning releases, this service executes, Work Planning learns that it landed — the drum-buffer-rope feedback edge: Execution → Orchestration.

Source: internal/adapters/inbound/kafka/consumer.go, internal/application/usecases/claim_next.go, internal/application/usecases/complete_task.go, internal/adapters/outbound/kafka/publisher.go. Omits the outbox relay hop and the analytics fan-out (see Domain message flow).

Why the WES tier is two services, not one​

The reference model describes Work Orchestration and Task & Labor Management as a Partnership — "they evolve together; sequencing and assignment are two halves of one optimization loop."

This platform splits them anyway. Work Planning answers how much work should be on the floor and when to release it — changing when flow-balancing policy changes. Fulfillment Execution answers how a released unit safely reaches completion — changing when dispatch or claim semantics change. Those are different reasons to change, on different cadences. So the edge is Customer/Supplier over a Published Language, not a Partnership.

The cost of the split is real: the two must agree on work_unit_id as a correlation key and on the CPT semantics that drive priority. That agreement is the published language on both topics, and it is exactly what the apis/asyncapi.yaml catalogue documents.

The strategic reasoning behind each pattern is on Context relationships; the operational detail (envelopes, mappings, idempotency, configuration) is on Integration contracts.