Skip to main content

WES — Work Planning & Release

Study project

This documentation site is an educational Domain-Driven Design exercise. It follows real industry-standard patterns and terminology, but it is not a production system and is not affiliated with, endorsed by, or representative of any real-world company.

This is the core bounded context of the WES (Warehouse Execution System) tier of the warehouse-systems platform. Its job in one sentence:

Release work continuously in priority order and flow-balance the floor from live buffer telemetry. (Turning a shift's charge into a plan moved to warehouse-planning, ADR-0049.)

It is the conductor: downstream of WMS planning and inventory truth, upstream of WCS equipment control and of task execution. It never owns inventory truth, never schedules a shift's workforce, and never drives a PLC — it decides when work enters the floor and in what order.

The three-layer position​

LayerHorizonAnswersThis service
WMSminutes → daysWhat needs to happen, and whyupstream of us
WESseconds → minutesWho does it, right now, in what orderthis service
WCSmilliseconds → secondsHow the machine performs the next stepdownstream of us

What you'll find here​

SectionContents
OverviewWhat the service does, its hexagonal layering, how to run it
Business ContextDomain vision, ubiquitous language, the reasoning behind waveless release and Drum-Buffer-Rope flow balancing
Domain-Driven DesignSubdomain classification, the ddd-crew artifact pack (core domain chart, bounded context canvas, aggregate design canvas, message flow, EventStorming, UML/ER/sequence diagrams), every domain event, read models
API ReferenceThe REST API generated from the real apis/openapi.yaml, the event contract from apis/asyncapi.yaml, and the RFC 7807 error model
EcosystemThe context map, Kafka topics and REST lookups actually wired today, and the sibling services
AI Ecosystem (MCP)The MCP governance charter this service's cmd/mcp server follows
Analytics (Data Product)The Release Throughput & Backlog Health report contract
ADRsThirty-five architecture decision records

At a glance​

  • Language / runtime: Go 1.26, module github.com/claudioed/wes-work-planning
  • Architecture: hexagonal (ports & adapters), enforced by executable fitness tests (ADR-0007)
  • Binaries: cmd/wes (OLTP REST + Kafka), cmd/wes-projector and cmd/wes-reports (analytics data product), cmd/mcp (MCP server)
  • Inbound adapters: REST (chi), Kafka consumer, MCP (Streamable HTTP)
  • Outbound adapters: Postgres (pgx/v5, transactional outbox), the Kafka event publishers (outbox relay), in-memory repositories as unit-test doubles only, process-path catalogue (file or Kafka), product-master classification local copy (Kafka-fed)
  • Aggregates: WorkPool, WorkUnit (ChargeForecast and ShiftPlan/PathPlan moved to warehouse-planning, ADR-0049)
  • Read models (projections, not aggregates): LaborPlanObserved (a pure projection of workforce-management's plan), UsableInventoryObserved, backlog telemetry, rebalance recommendation, and the analytics throughput_rollup
  • Integration: publishes WorkReleased (consumed by fulfillment-execution) and PathCapacityChanged (consumed by order-management and network-fulfillment), plus six further domain events with no consumer today (three more are retired, ADR-0049); consumes ShiftPlanCommitted, StockReserved, ReservationRevoked, TaskCompleted, OrderAllocated, OrderPartiallyAllocated, WorkDemandReleased, SlotPlanApproved, ReplenishmentRequested, ReplenishmentCancelled, ProductClassified, ProductPackLevelDeclared, ProductPackLevelRetired, ProductPackLevelMeasured, and — with PATH_CATALOGUE_SOURCE=kafka — process-path-management's catalogue events. Work enters the WorkPool from four sources: allocated orders (one work unit per order line), released transfer demands, approved slot plans and replenishment requests
Disclaimer

This project is a domain-driven design study. It is not associated with, endorsed by or affiliated with any company, and it uses no company's code, data, logos or trademarks. All names, figures and examples are illustrative or synthetic.