Skip to main content

Bounded Context Canvas

Following the ddd-crew Bounded Context Canvas v5. Part of the DDD artifact pack. Every message row maps to a real route (internal/adapters/inbound/http/server.go, reports_handler.go), MCP tool (internal/adapters/inbound/mcp/tools.go, report_tool.go) or Kafka topic/type (internal/adapters/kafka/cloudevents/types.go).

Canvas at a glance​

Two pictures of the sections below, laid out like the ddd-crew canvas: first the inbound collaborators feeding this context (purpose, domain roles and the business decisions it enforces), then the outbound collaborators it calls or notifies. Arrows follow the message type: solid blue commands (cmd), dotted green queries (qry), thick orange events (evt); each arrow names its channel and the messages it carries. Box shapes mark the collaborator kind: rounded = people, UI or any client; blue = sibling bounded context; double border = external system or platform; grey = this context's own projector, reports or dead-letter path; dashed = published today with no consumer. Channel names on the arrows are abbreviated (REST, MCP, Kafka, HTTP, port); the Inbound and Outbound Communication tables carry the exact route, tool, topic and CloudEvents type for every message.

Inbound​

Outbound​

Source: the Inbound Communication and Outbound Communication tables of this page, which map to internal/adapters/inbound/{http,kafka,mcp} and internal/adapters/outbound/. The diagram omits assumptions, verification metrics, open questions and the ubiquitous language (sections below), the relationship pattern per message (OHS, ACL, Conformist, Customer/Supplier - see the tables) and anything the tables mark as deprecated or platform-only (health probes).

Name​

Process Path Management (process-path-management, CloudEvents subdomain wes, short name pathmgmt).

Purpose​

Be the single, auditable source of truth for the process-path catalogue — a path's canonical identity (PathId), the matchPrefix rule consumers use to resolve a caller-supplied id to a path family, whether it is Direct, the capabilities a station/associate must hold to work it, its optional destination location role, and its fulfillment capability contract (cycleTimeP95, eligibility) — plus each site's recurring CPT schedule and the process flows, the ordered stages of paths a workload passes through (ADR 0042). It replaced a static YAML file that three services boot-loaded independently, and it publishes every change as a Kafka event so consumers keep local copies without ever calling it.

Strategic Classification​

AxisVerdict
DomainGeneric subdomain (ADR 0001; see the Core Domain Chart)
Business ModelCompliance / enabler — no revenue lever of its own; it makes the Core contexts' routing, planning and promise consistent
EvolutionCustom-built, heading towards product/commodity

Domain Roles​

RoleApplies?Note
Specification / Published Language ownerYesDefines the process-path and CPT-schedule language other contexts conform to.
Open Host ServiceYesOne stable topic warehouse.process-path-management.events for every consumer.
Gateway / configurationYesOperator-facing configuration surface (REST + process_path_mfe).
AnalysisAdditiveOwn "Process Path Catalogue Growth & Change" report (ADR 0007).
Execution / WorkflowNoNever claims, assigns or completes work.

Inbound Communication​

CollaboratorMessageTypeChannelRelationship
Operator / process_path_mfe (warehouse-console)Define pathCommandREST POST /process-paths (Idempotency-Key when Postgres is wired)OHS, Customer
Operator / process_path_mfeRevise pathCommandREST PUT /process-paths/{pathId}OHS, Customer
Operator / process_path_mfeDeactivate pathCommandREST DELETE /process-paths/{pathId}OHS, Customer
Operator / process_path_mfeList paths (?all=true for audit view)QueryREST GET /process-pathsOHS
Operator / audit toolingGet pathQueryREST GET /process-paths/{pathId}OHS
OperatorDefine or revise CPT scheduleCommandREST PUT /sites/{siteId}/cpt-scheduleOHS
OperatorGet CPT scheduleQueryREST GET /sites/{siteId}/cpt-scheduleOHS
OperatorDefine or revise process flowCommandREST PUT /process-flows/{flowId}OHS
OperatorRetire process flowCommandREST DELETE /process-flows/{flowId}OHS
Operator / audit toolingGet process flowQueryREST GET /process-flows/{flowId}OHS
Operator / audit toolingList process flows (?all=true for audit view)QueryREST GET /process-flowsOHS
Kubernetes probesLiveness / readinessQueryREST GET /healthz, GET /readyzInfrastructure
warehouse-console (context reports)Catalogue growth reportQueryREST GET /reports/catalogue-growth on pathmgmt-reportsOHS
warehouse-console (context reports)Report freshnessQueryREST GET /reports/catalogue-growth/freshness on pathmgmt-reportsOHS
warehouse-ops-agent (wired, unused)Get process pathQueryMCP get_process_pathOHS, Customer
warehouse-ops-agent (wired, unused)List process pathsQueryMCP list_process_pathsOHS, Customer
Any MCP host (no known caller)Get CPT scheduleQueryMCP get_cpt_scheduleOHS
Any MCP host or A2A caller (no known caller)Get / list process flowsQueryMCP get_process_flow, list_process_flows; A2A skills of the same namesOHS
Any MCP host (no known caller)Catalogue growth reportQueryMCP get_catalogue_growth_report (only when REPORTS_BASE_URL is set)OHS
Own pathmgmt-projectorProcessPathCreated / Updated / DeactivatedEventKafka warehouse.process-path-management.analytics, types com.warehouse.wes.process-path-management.processpath.*Internal (own topic)
Own pathmgmt-projectorCPTScheduleChanged and the three ProcessFlow* typesEventsame analytics topic; committed and skipped, never projectedInternal (own topic)

No sibling context sends this context a command or event.

Outbound Communication​

CollaboratorMessageTypeChannelRelationship
fulfillment-execution, wes-work-planning, workforce-management, order-management, network-fulfillmentProcessPathCreatedEventKafka warehouse.process-path-management.events, com.warehouse.wes.process-path-management.processpath.ProcessPathCreatedOHS + PL → CF
same fiveProcessPathUpdatedEventsame topic, com.warehouse.wes.process-path-management.processpath.ProcessPathUpdatedOHS + PL → CF
same fiveProcessPathDeactivatedEventsame topic, com.warehouse.wes.process-path-management.processpath.ProcessPathDeactivatedOHS + PL → CF
order-management, network-fulfillment, dock-scheduling, outbound-shippingCPTScheduleChangedEventsame topic, com.warehouse.wes.process-path-management.cptschedule.CPTScheduleChangedOHS + PL → CF
the consumers of each type aboveProcessPathUpdated and CPTScheduleChanged for the whole current catalogue, once per service start (RepublishCatalogue, ADR 0038)Eventsame topic only, not the analytics topicOHS + PL → CF
warehouse-planning (the consumer named in ADR 0042)ProcessFlowDefinedEventsame topic, com.warehouse.wes.process-path-management.processflow.ProcessFlowDefinedOHS + PL → CF
sameProcessFlowRevised, also one per ACTIVE flow at every service start (RepublishCatalogue, integration topic only)Eventsame topic, com.warehouse.wes.process-path-management.processflow.ProcessFlowRevisedOHS + PL → CF
sameProcessFlowRetiredEventsame topic, com.warehouse.wes.process-path-management.processflow.ProcessFlowRetiredOHS + PL → CF
Own pathmgmt-projectorall seven types (analytics copy)EventKafka warehouse.process-path-management.analyticsInternal
Own pathmgmt-reportsCatalogue growth reportQueryREST GET /reports/catalogue-growth from the MCP report toolInternal
Operators (manual replay)Poison analytics messageEventKafka warehouse.process-path-management.analytics.dlqInternal

No outbound call to any sibling — banned and enforced by TestNoSiblingContextOutboundCalls. See the Context Map.

Ubiquitous Language​

Full glossary with code identifiers: Ubiquitous Language. Top terms: ProcessPath, PathId, MatchPrefix, Direct, Capability (required capabilities), DestinationLocationRole, CycleTimeP95, Eligibility, Status (ACTIVE / DEACTIVATED), CPTSchedule, Cutoff, SiteId, ProcessFlow, Stage, ProcessType, FlowId.

Business Decisions​

  1. matchPrefix must be non-empty and lower-case — validated, never coerced (ErrEmptyMatchPrefix, ErrMatchPrefixNotLowercase).
  2. requiredCapabilities must be non-empty (ErrNoRequiredCapabilities).
  3. cycleTimeP95 must be strictly positive (ErrInvalidCycleTime).
  4. destinationLocationRole is optional, one of Drop/WorkCenter/ Shipping, immutable, never validated live against facility-layout.
  5. A path id is permanent: re-defining any existing id (active or deactivated) is a 409 (ErrPathAlreadyExists), including when two defines of the same id race (creation is insert-only).
  6. Deactivation is terminal and idempotent; a deactivated path cannot be revised (ErrPathDeactivated).
  7. No-op revisions and repeated deactivations publish nothing.
  8. A CPT schedule is per site, revised wholesale, needs a valid IANA timezone, at least one cutoff and unique cptIds; every eligiblePathIds entry must be an Active path (ErrIneligiblePathId, checked in the use case).
  9. Concurrent writers are detected by a version column and answered with 409 concurrent-modification (ADR 0017).
  10. A path that a CPT schedule still lists cannot be deactivated: 409 path-referenced-by-cpt-schedule until the schedule is revised (ErrPathReferencedByCPTSchedule, ADR 0026). The concurrent define-vs-deactivate race is closed with row locks (ADR 0028).
  11. A process flow is the ordered list of stages (pathId + one of eight processTypes) a workload passes through; every stage names an Active path, a path appears once, and a retired flow cannot be revised (ErrIneligibleStagePath, ErrDuplicateStagePath, ErrFlowRetired). Each flow event carries the full state and a version; consumers apply only a greater version (ADR 0042).
  12. A path that an ACTIVE flow has a stage on cannot be deactivated: 409 path-in-active-flow until the flow is revised or retired (ErrPathInActiveFlow, ADR 0042).

Assumptions​

  • Consumers keep their own local read model and never call this service on their hot path.
  • The capability, product-attribute, site and location-role vocabularies are owned elsewhere and stay in sync by convention (SKU handling classification such as hazmat or fragile: product-master; site and location role: facility-layout).
  • A path is live the moment it is defined — no draft or approval step.
  • Deactivation says nothing about work already in flight downstream.
  • The catalogue is small and slow-changing (operator-configured), so daily report buckets and full-replay consumers are enough.

Verification Metrics​

  • process_path_management.paths.defined counter, by outcome (accepted/rejected) — operator input quality (ADR 0019).
  • process_path_management.outbox.lag_seconds gauge — age of the oldest unpublished outbox row; 0 when drained (ADR 0018).
  • GET /reports/catalogue-growth/freshness → lagSeconds — analytics read-model lag (ADR 0007).
  • Number of live consumers of warehouse.process-path-management.events: 5 today (see the Context Map).
  • BDD: 153 Gherkin scenario definitions (268 executed with Examples rows); mutation testing on internal/domain gated at 99%.

Open Questions​

  • Should the destination_location_role field, decoded by three consumers, drive any routing decision, or stay declarative?
  • Should PUT endpoints accept an expected version (If-Match) so optimistic concurrency protects user edits end-to-end, not only the load-to-save window inside one request?
  • Will warehouse-ops-agent use its wired MCP client, or should the surface stay unused?
  • Does Direct's reserved multi-hop meaning need modelling before a consumer needs it?