Skip to main content

Context relationships

The technical wiring — topics, payloads, what is actually running — is on the Ecosystem pages. This page is the strategic view: which context-mapping pattern governs each relationship, and why.

The vocabulary is Evans/Vernon as used by the platform's strategic reference: Customer/Supplier (C/S), Conformist (CF), Anti-Corruption Layer (ACL), Open-Host Service (OHS), Published Language (PL), Partnership (P).

Relationship table​

CounterpartDirectionPatternNotes
inventory-storage (WMS tier)upstream of usCustomer/Supplier + OHS/PL, with an ACL on our sideWMS is the authoritative supplier of stock reality. We consume its published events only; we never read or write its aggregates. It is no longer asked for product classification (its ADR 0034; our ADR-0035).
product-master (WMS tier)upstream of usPublished Language, consumed into a local copy (ACL on our side)Owns SKU classification. With PRODUCT_CLASSIFICATION_MODE=kafka we keep a version-guarded copy of its ProductClassified events and read it once per WorkReleased; we never call it (ADR-0035).
workforce-managementupstream of usCustomer/Supplier, with an ACL on our sideSupplies committed labour plans as ShiftPlanCommitted. Translated at the boundary into a different type.
fulfillment-executiondownstream of usCustomer/Supplier, we are the supplier; OHS + Published LanguageWe publish WorkReleased; Execution builds its own Task from it. It does not get access to our WorkPool.
fulfillment-execution (feedback edge)upstream of usCustomer/Supplier, roles reversedTaskCompleted flows back and closes the loop. Two directed relationships between the same pair, not one bidirectional one.
order-managementupstream of usCustomer/Supplier, with an ACL on our sideOrderAllocated/OrderPartiallyAllocated become one EnqueueWorkUnit per line. Fire-and-forget.
network-inventory-planningupstream of usCustomer/Supplier, with an ACL on our sideWorkDemandReleased becomes one transfer WorkUnit per demand, id = demand_id (ADR-0033).
slotting-optimizationupstream of usCustomer/Supplier, with an ACL on our sideSlotPlanApproved becomes one RELOCATE WorkUnit per move; a newer plan cancels the older plan's unreleased moves (ADR-0040).
pick-face-replenishmentupstream of usCustomer/Supplier, with an ACL on our sideReplenishmentRequested becomes one REPLENISH WorkUnit per request; ReplenishmentCancelled withdraws it while it is Pending (ADR-0042).
order-management (capacity edge)downstream of usCustomer/Supplier, we are the supplier; OHS + Published LanguageWe publish PathCapacityChanged (ADR-0018); its kafkapathcapacity adapter caches remaining capacity per (path, cutoff).
network-fulfillmentdownstream of usOHS + Published Language on our side, Conformist on theirsIts pathcapacitycache adapter consumes the same PathCapacityChanged into its CapabilityOffer; we do not know about it.
warehouse-planningneitherno integrationOwns the charge forecast (workload forecast) and the labour plan, with their drift, since ADR-0049. No message flows between us; our two old planning POSTs answered 410 naming its routes for one release and were removed in stage E.
process-path-managementupstream of usConformist to its OHS/PLOwns the process-path catalogue every pathId is validated against (ADR-0012); consumed from Kafka with PATH_CATALOGUE_SOURCE=kafka, else from the same catalogue as YAML.

WMS → WES: Customer/Supplier, ACL in both directions​

The strategic reference is explicit:

WMS → WES: Customer/Supplier, with WMS as the upstream customer of demand and WES as supplier of fulfilment progress. WMS defines an Open Host Service (OHS) with a Published Language that WES conforms to. WES does not get write access to WMS's Order/Inventory aggregates — only to the published events/API.

and:

WMS ↔ WES boundary is an Anti-Corruption Layer in both directions: WMS never reaches into WES's Assignment aggregate to pick a worker; WES never reaches into WMS's Order aggregate to check inventory truth.

In this codebase that ACL is a concrete, locatable thing — the inbound Kafka adapter, internal/adapters/inbound/kafka/consumer.go. It holds private structs whose only job is to be the external shape:

type inventoryEventData struct {
SKU string `json:"sku"`
Quantity int `json:"quantity"`
DemandRef string `json:"demand_ref"`
}

That struct is unexported and never crosses into the application layer. What crosses is a translated call into an inbound-event use case (ObserveInventoryChange). Inventory's wire format can change without a single domain file being touched — which is the entire point of an ACL, and the reason it is worth the extra type.

WES → Execution: we become the Open Host Service​

Downstream, this context is the supplier. WorkReleased on warehouse.work-planning.events is our Published Language: a stable, documented contract (apis/asyncapi.yaml) that consumers conform to.

The payload is enriched at the adapter with cpt and ref precisely so the contract is self-sufficient — a consumer can build its own Task without calling back into us. An OHS that forces callbacks is not much of a host.

Crucially, fulfillment-execution's Task is its own model, built from our event. The reference model names this trap directly: a business-level demand signal and an execution-level unit bound to a worker at a moment are different classes with different lifecycles, and sharing the class across the boundary is the mistake to avoid.

The feedback edge is a separate relationship​

fulfillment-execution is downstream of us for release and upstream of us for completion. These are two directed Customer/Supplier relationships between the same pair of contexts, not one "bidirectional" relationship.

Modelling it as two matters: the two edges have different contracts (warehouse.work-planning.events vs warehouse.fulfillment.events), different payloads, and different failure modes. On the feedback edge we are the customer and conform to their published TaskCompleted shape.

The Conformist relationship​

This context no longer conforms to facility-layout: its one fact, the distance between two location codes read when a shift plan was committed, was retired with the shift plan (ADR-0049).

process-path-management is a Generic subdomain and owns the process-path catalogue. We conform to it rather than keeping our own list of paths (ADR-0012).

This follows the reference model's guidance to extract generic logic once instead of duplicating it in every context. See the context map.

What we are not​

Two patterns that would be wrong to claim here:

  • Not a Shared Kernel with any sibling. No types, schemas or database tables are shared. The CloudEvents envelope and the cross-service type strings are duplicated by agreement in each service's own internal/adapters/kafka/cloudevents package (ADR-0027) — deliberately copied rather than extracted into a shared library, so no service can be forced to redeploy by another service's release.
  • Not a Partnership. The reference model uses Partnership for contexts that must evolve together (orchestration and labour assignment as two halves of one optimisation loop). This platform split those into separate services with an event contract between them, which is Customer/Supplier — a looser coupling, chosen deliberately, and worth being accurate about rather than claiming the tighter pattern.