Skip to main content

ADR 0001: slotting-optimization as the owner of forward-pick slotting decisions

Status​

Accepted (2026-10-08).

Context​

The fleet knows where things physically are (facility-layout models sites, zones, aisles and coded slots, including forward and reserve zones) and what a SKU is (product-master: handling classification and physical profile). It knows what customers ordered (order-management) and where stock sits (inventory-storage). Nothing decides which SKUs deserve a forward pick slot, and which slot each one gets. Today that decision is implicit in whoever stows first, so fast movers can end up in far or awkward slots while slow movers occupy the best ones. Gartner's 2026 WMS Magic Quadrant lists slotting among the capabilities "expected as standard"; Manhattan, Blue Yonder, SAP EWM and Infor all ship it.

Slotting is a planning computation over declarative inputs (demand, product facts, slot facts). It has a different lifecycle from every existing context (it runs when a planner asks, produces a proposal, and a human accepts or rejects it), so it is a context of its own, not a feature of facility-layout (which owns structure, not demand) or inventory-storage (which owns the stock ledger and must stay available on the floor).

Decision​

Introduce slotting-optimization as a new bounded context. It owns the SlotPlan: a reviewable proposal that assigns SKUs to forward pick slots for one site over a demand window, and the human decision taken on it.

Bounded context canvas​

FieldValue
Nameslotting-optimization
PurposeDecide, explainably and repeatably, which SKUs get a forward pick slot and which slot, and publish the approved assignment map.
Strategic classificationSupporting subdomain. Necessary for efficient picking and specific to this warehouse's policy, but replaceable policy objects (ranking, eligibility) rather than the competitive core; the WES conductor stays Core.
Tier / CloudEvents subdomainWMS ("what and where"), subdomain wms: the fifth wms context after facility-layout, inventory-storage, product-master and inbound-receiving. Type prefix com.warehouse.wms.slotting-optimization., source /warehouse/slotting-optimization.
Domain rolesPolicy engine (computes proposals), approval workflow (Draft, then Approved or Rejected).
Inbound communicationEvents from order-management, product-master, facility-layout (ADR 0003); REST commands from planners (POST /slot-plans, approve, reject).
Outbound communicationSlotPlanGenerated, SlotPlanApproved, SlotPlanRejected on warehouse.slotting-optimization.events (ADR 0004); REST reads for operators, the console and agents.
Ubiquitous languageSlotPlan, window, policy, assignment, move (Assign, Relocate, Vacate), unassigned (NoEligibleSlot, NoPhysicalProfile, NoCapacityFit), ABC class, forward slot, stickiness.
Business decisionsWhich SKUs are candidates; ABC class; slot eligibility; slot ranking; churn limit; human approval (ADR 0002).
AssumptionsForward slots are Storage slots in zones listed in FORWARD_ZONE_CODES (default FWD); one SKU per forward slot; demand site id equals the facility site code (both verified against live data later, ADR 0003).
VerificationDeterministic output (same input, same plan), mutation gate over both domain packages, golden tests per published type.

The model (v1)​

One aggregate, SlotPlan, and one pure domain service, planning.Planner (policy abc-velocity-v1). The details and invariants are ADR 0002.

Context map​

EdgeRelationshipStatus
order-management -> slotting-optimizationPublished Language (SiteSkuDemandChanged, warehouse.order-management.events); slotting-optimization is a Conformist and keeps a local demand copyContract verified on origin/develop 2026-10-08; consumer built in the service phase
product-master -> slotting-optimizationPublished Language (ProductClassified, ProductDimensionsDeclared, ProductMeasured); Conformist, local product copyContract verified 2026-10-08; consumer in the service phase
facility-layout -> slotting-optimizationOpen Host Service / Published Language (ZoneRegistered, LocationSlotRegistered, LocationSlotDecommissioned); Conformist, local slot copyContract verified 2026-10-08; consumer in the service phase
slotting-optimization -> warehouse-ops-agent, warehouse-consoleOpen Host Service (REST; MCP read tools, ADR 0005)REST and MCP built; the consumers are later phases
slotting-optimization -> process-path-management -> wes-work-planning -> fulfillment-executionSlotPlanApproved carries the moves; turning them into MOVE/REPLENISH work through the process-path catalogue is the execution pathPLANNED, not built (ADR 0002): needs its own ADRs in those contexts and a new task type

Exclusions​

  • No edge to inventory-storage. An approved plan does not move stock and does not change stow behaviour. Stow stays an RF action (item scan, location scan). The forward-slot map is advice published for others to use.
  • No edge to inbound-receiving or warehouse-planning.
  • Out of scope for v1 (later ADRs): replenishment min/max and triggers, affinity / ML slotting, multi-SKU slots, reserve-zone slotting, a travel-distance ranking (needs layout geometry events, ADR 0002), seasonal re-slotting calendars.

No live cross-context lookup, in either direction​

  • slotting-optimization never calls a sibling context at request time. It has no outbound HTTP client and no MCP client.
  • No sibling calls slotting-optimization either. They read warehouse.slotting-optimization.events; the REST GET endpoints exist for operators, the console and agents.

Consequences​

  • A new deployable (API, Postgres database, Kafka topic, Kong route /api/slotting-optimization) joins the fleet; warehouse-infra wires it by hand in the wiring wave.
  • The fleet CloudEvents rule that names the wms contexts and the warehouse-docs subdomain table gain two rows (this context and inbound-receiving); that change travels in the docs wave, not in this repo.
  • Plans are only as good as the local copies feeding them. An empty or stale copy yields an empty or partial plan; the plan lists SKUs it could not place with a reason instead of guessing.
  • Nothing happens on the floor until the planned execution edge exists.

Addendum 2026-11-13: current state​

Three statements above no longer match the code.

  • Execution is built, not planned. ADR 0010 (which supersedes ADR 0007) decided it: wes-work-planning consumes SlotPlanApproved and plans one RELOCATE work unit per move (wes-work-planning internal/adapters/inbound/kafka/consumer.go, wired in cmd/wes/serving.go); this context records progress per move (internal/adapters/inbound/kafka/stock_consumer.go, slot_plan_move_executions).
  • There is an edge to inventory-storage, but no command edge. This context consumes StockRelocated; inventory-storage consumes SlotPlanApproved into its forward-face read model (inventory-storage internal/adapters/inbound/kafka/slot_plan_consumer.go, its ADR 0050). An approved plan still moves no stock by itself.
  • Three contexts consume SlotPlanApproved: wes-work-planning, inventory-storage and pick-face-replenishment (internal/adapters/inbound/kafka/slotting_consumer.go). This context also consumes ProductPackLevelDeclared, ProductPackLevelRetired and ProductPackLevelMeasured (ADR 0012, internal/adapters/inbound/kafka/packlevel_consumer.go).

The API is routed through Kong at /api/slotting-optimization (warehouse-infra helm-values/slotting-optimization.yaml, gatewayApi).