Context map
What is actually wired today
This is the ddd-crew Context Mapping
view of this context's slice of the fleet map. Every edge is labelled
with upstream (U) / downstream (D), the pattern(s), and the technology.
Every edge has code on both ends. Solid arrows are on in the reference
deployment (warehouse-infra terraform/locals.tf); dotted arrows are
wired but unused there: the REST labor-performance client, which the
reference deployment replaces with the kafka-cache feed. The Kafka edges and
Postgres are mandatory (ADR 0038).
Only the outbound REST edges are selected by an env var
(INSTALLED_CAPACITY_MODE, whose service default permissive rejects every commit, and
LABOR_PERFORMANCE_MODE=kafka-cache|http). There
are no arrows for deliberately absent relationships — those are listed in
the table.
Arrows point from upstream to downstream.
Source: internal/adapters/outbound/kafka/publisher.go,
internal/adapters/outbound/fulfillmentexecution/client.go,
internal/adapters/outbound/kafkacatalog/consumer.go,
internal/adapters/outbound/laborperformancecache/consumer.go,
internal/adapters/outbound/laborperformance/client.go,
internal/adapters/inbound/mcp/tools.go, cmd/workforce/main.go, and the
sibling files named in the table. Omits: sibling-to-sibling edges,
facility-layout, inventory-storage and product-master (no edge, see
below), and this
context's internal analytics topic.
The fulfillment-execution edge is drawn solid because the reference
deployment sets INSTALLED_CAPACITY_MODE=http; the service default,
permissive, rejects every commit, so any deployment must opt in.
| Relationship | U/D | Pattern | Technology | Status | Evidence |
|---|---|---|---|---|---|
→ wes-work-planning | WFM upstream | Customer/Supplier, Published Language; consumer-side translation into LaborPlanObserved | Kafka warehouse.workforce.events, com.warehouse.wes.workforce-management.shiftplan.ShiftPlanCommitted | live (always on) | here: internal/adapters/outbound/kafka/publisher.go; there: wes-work-planning/internal/adapters/inbound/kafka/consumer.go |
→ warehouse-planning | WFM upstream | Customer/Supplier, Published Language | same topic and type | live (always on) | there: warehouse-planning/internal/adapters/inbound/kafka/labor_capacity_consumer.go (group warehouse-planning-labor-capacity) |
← fulfillment-execution | WFM downstream | Open Host Service upstream, Conformist here | REST GET /capacity/{capability}, fail-loud | live in the kind cluster (INSTALLED_CAPACITY_MODE=http); service default permissive rejects every commit | here: internal/adapters/outbound/fulfillmentexecution/client.go; there: fulfillment-execution/internal/adapters/inbound/http/handlers.go (GetInstalledCapacityHandler) |
← process-path-management | WFM downstream | Published Language, Conformist | Kafka warehouse.process-path-management.events, com.warehouse.wes.process-path-management.processpath.ProcessPath{Created,Updated,Deactivated} | live (always on; the only catalogue source) | internal/adapters/outbound/kafkacatalog/consumer.go |
← labor-performance (events) | WFM downstream | Published Language, Conformist + ACL (taskTypeForPathId) | Kafka warehouse.labor-performance.events, com.warehouse.wes.labor-performance.performance.TaskPerformanceRecorded | live (LABOR_PERFORMANCE_MODE=kafka-cache, the service default) | internal/adapters/outbound/laborperformancecache/consumer.go |
← labor-performance (REST) | WFM downstream | Open Host Service upstream, Conformist + ACL here | REST GET /task-types/{taskType}/performance, fail-open | wired but unused in the kind cluster (it runs kafka-cache) | internal/adapters/outbound/laborperformance/client.go; there: labor-performance/internal/adapters/inbound/http/server.go |
→ warehouse-ops-agent | WFM upstream | Open Host Service | MCP get_staffing_gap, propose_path_heads; REST GET /reports/labor (+ /freshness) | live | there: internal/adapters/outbound/mcpclient/workforce_management.go, internal/adapters/outbound/restclient/reports_clients.go |
→ warehouse-console | WFM upstream | Open Host Service (presentation composition, not a domain edge) | REST via the workforce_mfe remote; REST GET /reports/labor | live | there: src/features/context-reports/workforceManagement.config.tsx; here: web/ (ADR 0011) |
fulfillment-execution at the task level | — | Separate Ways | none | deliberately absent | ADR 0002 |
inventory-storage | — | Separate Ways | none | deliberately absent | no adapter package; see "The WMS tier" below |
product-master | — | Separate Ways | none | deliberately absent | no adapter package and no consumer of warehouse.product-master.events; see "The WMS tier" below |
facility-layout | would be WFM downstream | Conformist, unexercised | none | deliberately absent | no adapter package; see below |
Unused surface: the MCP tool assign_labor is registered, but no sibling
calls it in code today.
Reading the diagram
One topic published, reads from three siblings, no shared database. This
service publishes ShiftPlanCommitted. It reads from siblings in three
ways, each selected by an env var (see Integration):
- the live installed capacity from
fulfillment-executionon everyCommitShiftPlan(ADR 0014); - measured rates and idle share from
labor-performance, either from its topic (kafka-cache, as in the kind cluster) or over HTTP (ADR 0012, 0019, 0020); - the process-path catalogue from
process-path-management's topic, whenPATH_CATALOGUE_SOURCE=kafka. Otherwise it comes from a file.
In every one of these edges, data flows into this service. The only
callers of this service are read-only: wes-work-planning and
warehouse-planning consume the topic, warehouse-console reads the labor
report, and warehouse-ops-agent calls two MCP tools (get_staffing_gap,
propose_path_heads) and reads the labor report (GET /reports/labor). No
sibling invokes one of this service's commands, so it is still in no Core
context's write path. The reverse no longer holds, though: CommitShiftPlan
now depends on fulfillment-execution being reachable, and fails loud (503)
when it is not.
The wes-work-planning edge is the supply side of planning. Work Planning
is the conductor — it decides what work to release and when, and it
flow-balances against live buffer telemetry. Committed headcount per path is
one of its inputs, and this service is the authoritative source of it. The edge
carries the plan, never the roster: no associate identity, no break state, no
individual assignment ever crosses it.
The edge to fulfillment-execution is capacity, not tasks. The two
services both deal in people doing work. The one contract between them is a
read of installed station capacity per capability
(GET /capacity/{capability}), which acts as a physical ceiling on committed
heads. No task, claim, or associate identity crosses it in either direction.
The path boundary still holds: this
context stops at "which path is this associate on," and task dispatch is a
seconds-cadence problem that evolves independently.
facility-layout is now consumed by the WMS/WES services, not by this one.
It is an Open Host Service by design. inventory-storage, wes-work-planning
and fulfillment-execution read locations or travel distances from it. This
service has no edge to it, for the reason given below.
Strategic relationships
The technical wiring above is narrower than the strategic picture. In context-mapping vocabulary:
workforce-management → wes-work-planning: Customer/Supplier
This context is the upstream supplier of committed labor; Work Planning is
the downstream customer. The supplier publishes a narrow, stable Published
Language — one event type, six scalar fields — and the customer translates
rather than conforms: ShiftPlanCommitted becomes LaborPlanObserved, a read
model in Work Planning's own vocabulary, never its ShiftPlan aggregate.
That translation matters. ShiftPlan exists in both services and means
different things: here it is the labor commitment a human made; there it is
Work Planning's own planning artefact derived from charge and CPT. The platform
DDD reference names this trap explicitly —
Same English word, two different models. Do not share the class across contexts.
— and Work Planning's own CLAUDE.md instructs its implementers, in capitals,
not to feed the consumed event into its own aggregate. The anti-corruption step
lives on the consumer side, which is where it belongs.
workforce-management ↔ fulfillment-execution: separated at the task level, Conformist on capacity
At the task level, not "not yet integrated" — separated, with a reason. The two contexts change at cadences three orders of magnitude apart (shift-length intervals versus per-task claims), so fusing them would make every dispatch-policy change a workforce-planning change.
The one live edge is narrower than that. This context is a downstream
Conformist on fulfillment-execution's installed-capacity read
(GET /capacity/{capability}, ADR 0014).
It uses the count as a ceiling on committed heads and learns nothing about
tasks or claims.
If a certification gate on station claims is ever wired to real data, the shape
is fulfillment-execution as a downstream Conformist to this context's
published read surface — read-only, one-way, no write access to
AssociateShift. The reverse — this context learning what task anyone is
performing — is the thing the boundary exists to prevent.
facility-layout → workforce-management: Conformist, unexercised
facility-layout is an Open Host Service with a Published Language and
declares all four siblings, including this one, as downstream Conformists.
For this context that conformance is likely to stay theoretical. A PathId
here is pack or pick — a queue with a service rate, not a place. Labor
planning needs no aisle geometry. If travel-time-aware planning were ever
built, that is when this edge would become real.
The WMS tier: no relationship, correctly
inventory-storage owns stock truth, and product-master owns SKU product
master data (handling classification and physical profile). The platform DDD
reference is emphatic that worker identity must stay out of the WMS tier:
WMS "has zero knowledge of individual workers, shifts, real-time location, or travel distance. If it acquires that knowledge, a supporting/generic concern (labor orchestration) has leaked into the core domain (order fulfillment truth), and every labor policy change now forces a WMS regression."
The absence of an edge between this service and inventory-storage or
product-master is that rule holding. Labor planning works per process path
and never needs a SKU's attributes.
Direction of dependency, summarised
CommitShiftPlan still takes installedStations in the request body
instead of looking it up from wes-work-planning, and validates it
independently. Since ADR 0014 it
also checks each line against fulfillment-execution's live installed
capacity. That call is fail-loud: when capacity cannot be verified, the commit
is rejected with 503 rather than silently allowed.
Presentation-layer composition (not a domain-coupling edge)
warehouse-ops-agent's fleet-wide ADR-0002 adds a seventh axis to this map
that is deliberately absent from the diagrams above: warehouse-console, a
Module Federation shell, composes one remote per bounded context at the UI
layer, including workforce-mfe (this context's own web/). This context's
adoption of that decision is recorded in
ADR-0011.
This is not a new domain relationship and is not drawn as an edge above:
workforce-mfe talks only to this service's own REST API
(WORKFORCE_API_BASE), never to a sibling's API or database, and the shell
contains none of this context's business logic. It does not change this
context's integration edges (listed in Integration) — it
is a browser composing
independently-owned screens, not a new integration contract between bounded
contexts. The one cross-cutting exception in the fleet (the Order Lifecycle
view, backed by a BFF in warehouse-ops-agent) does not read this context's
data at all today. warehouse-ops-agent's console reports read this
context's labor report (GET /reports/labor on cmd/workforce-reports), and
its agent calls this context's MCP tools. Both are reads of this context's
published surfaces.