warehouse-systems fleet · executive briefing

slotting-optimization

Puts the fastest-selling items in the closest pick slots, with a planner signing off
seven capabilitys4 events out · 5 in15 recorded decisions

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. · November 2026

the short version · read this if nothing else

Slotting turns pick history into a reviewable plan, so the best slots go to the items that move most

1

A pure, repeatable planner ranks items by picks and explains every item it could not place.

2

Nothing changes on the floor until a planner approves, and one approved plan rules each site.

3

Read-only MCP and A2A doors exist for plans and slot maps, but ship switched off.

The ask

Fund travel-distance slot ranking, and switch the operator workbench on so the console and ops agent can use it.

why it exists

Fast movers parked in far slots quietly lengthen every pick walk

Owns the forward-slotting decision the rest of the fleet leaves implicit: today fast movers can sit in far slots while slow movers hold the best ones. It computes a reviewable SlotPlan proposal per site and demand window from event-fed local copies (demand, product facts, slot facts, pack levels), a planner either accepts or rejects it…

Today

The fleet leaves forward slotting implicit, so fast movers can sit in far slots while slow movers hold the best ones.

The catch

Slots rank by location code, not walking distance, and plans are only as good as their event-fed copies.

what it does

It proposes, a planner approves, and the floor carries out the moves

Slot plan generation

Ranks items by picks, respects hazmat and temperature, and limits needless churn.

Human approval

Plans stay drafts until a planner approves or rejects; one approved plan per site.

Case-pick faces

Plans case picking only where demand arrives in whole cases.

Execution progress

Shows how many approved moves have actually happened on the floor.

Operator read side

Operators see the current slot map and each item's pick velocity.

Plan funnel analytics

Tracks plans proposed, approved and rejected, and how long approval takes.

who it talks to

Four contexts feed it, two build on what it publishes

LISTENS TO · 5 EVENT TYPESIS HEARD BY · 2 CONTEXTSproduct-master2facility-layout1inventory-storage1order-management1e2e-tests1pick-face-replenishment1slottingoptimizationbadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

A slot plan is only a proposal until a planner says yes

THE LANGUAGEOF THE DOMAINSlotPlan aggregateState machine Draft ->…planning.PlannerSlotPlanApproved carries…Local copies
REST11 operations over 10 paths: api :8080…
MCPMCP server (cmd/mcp, :8090, Streamable HTTP…
A2Aread-only A2A agent on :8093 (ADR 0013): JSON-RPC at / and…
how it is built

A pure planner sits at the centre; adapters do all the I/O

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :808011 operations over 10 paths…MCP tools :8090MCP server (cmd/mcp, :8090…Kafka consumer · 5 eventsSiteSkuDemandChangedproduct.ProductClassifiedDOMAIN CORESlotPlan aggregateState machine Draft ->…planning.PlannerSlotPlanApproved carries…PostgreSQLPostgres OLTPKafka producer · 4 eventsslotplan.SlotPlanGeneratedslotplan.SlotPlanApprovedTransactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

3 plan decisions go out; demand, product, slot and move facts come in

CONSUMED · BY SOURCE · 5PUBLISHED · BY ENTITY · 4product-master 2facility-layout 1inventory-storage 1order-management 13 slotplan1 slotting-optimizationSiteSkuDemandChangedProductClassifiedProductPackLevelDeclaredZoneRegisteredStockRelocatedSlotPlanGeneratedSlotPlanApprovedSlotPlanRejectedanalytics twins of the…
how we know it is healthy

Readiness checks Postgres and Kafka; counters track every decision

OTel OTLP/gRPC traces+metrics (30 s push) -> collector (fleet standard); Prometheus scrape at GET /metrics on cmd/api only (Go + process collectors; mcp, projector and reports expose none)…

What we watch

  • W3C trace context crosses the transactional outbox onto the Kafka message (ADR 0009)
  • Business counters slotting_optimization.slot_plans.decided (per decision outcome) and slotting_optimization.relocations.observed (execution progress…

What stops a bad change

  • make check / check-all / check-fast (fmt, vet, build, golangci-lint, test)
  • 90% coverage gate on domain+application+analytics (Makefile:21-22)
  • arch-test fitness rules incl. inbound MCP/A2A read-only governance, hexagonal dependency rule
by the numbers

15 decisions, 10 BDD features and 3 migrations stand behind it

15
Architecture decisions
#22 of 45 in the fleet
3
DB migrations
#26 of 45 in the fleet
10
BDD feature files
#33 of 45 in the fleet
4
Events published
#22 of 45 in the fleet

Ranked against all 45 briefed repositories (dot = one repository, highest on the left).

One-command workflows (make)

buildlinttestcoverageintegrationbddarch-testmutationmutation-fullcheckcheck-allcheck-fastguide-lintharness-test
what comes next

Next: rank slots by real travel distance, then close the loop

NOW1Rank slots byreal traveldistanceTravel-distance slotranking behind theSlotRankingPolicyport — v1 ranksslots lexicallybecausefacility-layoutevents carry no …NEXT2Bring the opsagent andconsole onboardFleet consumers ofthe Open HostService are laterphases:warehouse-ops-agent/ warehouse-consoleadoption of REST+MCPper ADR 0001…NEXT3Feed executedmoves back intoplanningClose the executionfeedback loop:relocation progressis a read model onlyand does not gateproposals in v1 —feeding observedoutcomes back into …LATER4Work the v1backlog:replenishmentv1 out-of-scopebacklog from ADR0001: replenishmentmin/max andtriggers,affinity/MLslotting, multi-SKUslots, reserve-zone…LATER5Check site anddemandassumptions onVerify ADR 0001'sstated assumptionsagainst live data:demand site idequals facility sitecode (upstream sendsa static site,assignment_version …LATER6Mutation-testthe pack-levelcode in themutation-fast gatesonly./internal/domain/slotplanand./internal/domain/planning(ci.yml:200-202);packlevel is mutatedonly in the weekly …
what could go wrong · and what we do about it

Plans inherit every gap in their data and in the floor path

Auth is off by decision, even on approve and reject

Every REST, MCP and A2A endpoint is unauthenticated by decision (fleet-wide revert), including the plan approve/reject POSTs…

→

MCP and A2A stay read-only, and the build fails if a write tool ever appears.

Stale or empty data copies give partial plans

Plans are only as good as the event-fed local copies: an empty or stale copy yields an empty or partial plan (mitigated by explicit…

→

Plans list unplaced items with explicit reasons instead of guessing.

Slots ranked by code, not by walking distance

Slot ranking is the lexical order of location codes — placements can be far from travel-optimal until facility-layout publishes…

→

Ranking sits behind a port, so a travel-distance policy can drop in once geometry exists.

Demand timing and site mapping are proxies

Demand timing is proxied: due_at is the only date SiteSkuDemandChanged carries (promise cutoff, not pick time)…

→

Next step: verify ADR 0001's site and demand assumptions against live data.

the decision we need

Fund travel-distance slot ranking, and switch the operator workbench on so the console and ops agent can use it.

WHAT ISThe fleet leaves forward slottingimplicit, so fast movers can sit infar slots while slow movers hold thebest ones.THE CATCHSlots rank by location code, notwalking distance, and plans are onlyas good as their event-fed copies.WHAT COULD BEPlans rank slots by real walkingdistance, learn from executed moves,and are read by the console and theops agent.
Why it matters

Slotting turns pick history into a reviewable plan, so the best slots go to the items that move most

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal / Ports & Adapters (DDD bounded context, 'wms' event subdomain tier — fifth wms context; strategic classification: Supporting subdomain)…
Layoutcmd/{api,mcp,a2a,slotting-projector,slotting-reports}; internal/domain/{slotplan,planning,packlevel}; internal/application/{usecases,ports,repository,outbox}…
StoragePostgres OLTP (3 golang-migrate migrations: slotting_schema, slot_plan_move_executions…
Testingtable-driven unit tests with -race and a 90% coverage gate on domain+application+analytics; godog BDD (10 feature files); testcontainers Postgres+Kafka integration (make integration)…
REST11 operations over 10 paths: api :8080 — POST/GET /slot-plans, GET /slot-plans/{planId}, POST /slot-plans/{planId}/approvals…
Go 1.27.4chi/v5 HTTP router + go-chi/corspgx/v5 + pgxpool Postgresgolang-migratesegmentio/kafka-gocloudevents/sdk-go v2modelcontextprotocol/go-sdka2a-go/v2OpenTelemetry v1.47Prometheus clienttestcontainers-gogodog