warehouse-systems fleet · executive briefing

facility-layout

Keeps the single map of every warehouse location and what may be stored there
seven capabilitys2 events out · 1 in45 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

Facility layout is the warehouse map every tier builds on, and it only ever stores legal locations

1

Placement rules run at registration, so every stored slot is legal by construction.

2

15 published events and REST let other tiers use the map without depending on each other.

3

Layouts, floor plans and travel distances reach consoles, WES and agents over REST, MCP and A2A.

The ask

Give wes-work-planning event-driven travel input so it stops reading distance synchronously.

why it exists

Every pick and putaway starts with knowing where things may go

Owns the warehouse map as a standalone Generic Subdomain: whether a coded location exists, is active, and is legal for a given kind of storage unit. Placement legality (e.g. no ambient product in the frozen zone) is enforced once, at registration time, so every slot in the database is legal by construction…

Today

It registers sites, zones, aisles and slots, checks placement rules once at registration, and publishes the map as events.

The catch

Decommissioning is one-way, maintenance status cannot be set, and travel across zones is only a straight-line estimate.

what it does

One map answers where a location is and what may go there

Site, zone and aisle setup

Registers sites, zones and aisles with temperature, hazmat and walk order.

Placement legality

Decides once, at registration, which storage types are legal where.

Warehouse visualization

Serves nested layouts, zone grids and SVG floor plans ready for screens.

Travel geometry

Builds a travel graph and shortest-path distances between slots.

Slot attributes for stow

Adds handling unit, GLN identity and yard spot kinds to slots.

Bulk layout import

Bootstraps a whole building in one call, reporting row by row.

who it talks to

It starts the flow: ten build on what it publishes

LISTENS TO · 0 EVENT TYPESIS HEARD BY · 10 CONTEXTSNo upstream events: it starts the flowtask-interleaving4dock-scheduling3inventory-storage3pick-face-replenishment3yard-management3inbound-receiving2+4 more contextsfacilitylayoutbadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

A location code is the identity, readable by people and machines

THE LANGUAGEOF THE DOMAINLocationSlotSite / Zone / Aisle…PlacementRuleLocationCode value objectTravel graph per zone with…
REST38 operations over 30 paths on :8080
MCPMCP server (cmd/mcp, :8090, Streamable HTTP): 6 read-only…
A2AA2A agent (cmd/a2a, :8093): 2 read-only skills…
how it is built

A hexagonal core publishing an open map anyone may read

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :808038 operations over 30 pathsMCP tools :8090MCP server (cmd/mcp, :8090…Kafka consumer · 1 eventsservicesDOMAIN CORELocationSlotSite / Zone / Aisle…PlacementRuleLocationCode value objectPostgreSQLPostgres OLTP via pgxpool…Kafka producer · 2 eventsevents: SiteRegistered…analytics for the Layout…Transactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

15 map facts go out, and nothing comes in from siblings

CONSUMED · BY SOURCE · 0PUBLISHED · BY ENTITY · 22 facilityNoneSiteRegisteredSiteCapabilityChangedSiteRoleChangedZoneRegisteredAisleRegisteredLocationTypeRegisteredPlacementRuleDefinedLocationSlotRegisteredConsumes nothing: it is a source
how we know it is healthy

All three OpenTelemetry signals flow, with a business metric too

OpenTelemetry all three signals (traces, metrics, logs) over OTLP/gRPC to a Collector, wired in all five binaries via telemetry.Setup; no /metrics endpoint (Collector owns Prometheus exposition)…

What we watch

  • Server spans named by chi route pattern (never raw path); normalized-SQL DB child spans via otelpgx
  • W3C traceparent extracted inbound and injected into Kafka headers, carried across the outbox in outbox_events.headers (ADR-0038)
  • Business metric facility.location_slot.registrations recorded in RegisterLocationSlot and ImportFacilityLayout with…

What stops a bad change

  • make check-fast / check / check-all mirroring every CI sensor locally; lefthook pre-commit and pre-push hooks
  • CI: lint, complexity and file-length gates, test with 90% coverage gate, bdd, contract, evals-tests, integration…
by the numbers

45 recorded decisions and 13 migrations shape the map

45
Architecture decisions
#5 of 45 in the fleet
13
DB migrations
#6 of 45 in the fleet
21
BDD feature files
#5 of 45 in the fleet
2
Events published
#30 of 45 in the fleet

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

One-command workflows (make)

check-fastcheckcheck-allcoverageintegrationbddcontractarch-testmutationvuln
competitive position

Against the market leaders, this is where we trail

GapFacility Layout & Slotting vs Blue Yonder (Advanced Slotting), Manhattan, SAP EWM, Geek+, Körber

Where we match or lead

  • System of record for Site-Area-Zone-Aisle-Bay-Level-Position hierarchy
  • Placement-rule legality (Deny/Allow by zone predicate)
  • Metre-weighted travel graph with shortest-path /distance and SVG floor plan
  • Bulk layout import with atomic-per-row partial success

Gaps to close

  • High No slotting engine: re-slotting is declared rare, whereas every leader sells it as a core optimizer
  • Medium Cross-zone distance is a straight-line estimate unless both slots carry geometry
  • Low Hierarchical codes change when the building is reorganised (accepted trade-off)
  • Low UnderMaintenance state exists but no use case sets it; decommission is one-way

Leader capabilities are vendor-published; gaps reflect repo docs reviewed in November 2026.

what comes next

Next: event-driven travel, routed zones, and locations that come back

NOW1Event-driventravel input forwork planningEvent-driven travelinput forwes-work-planning isopen: it still readsdistance synchronously(TRAVEL_DISTANCE_MODE=http)and consumes none of theAisle/CrossAisle …NEXT2Routed cross-zonetravelRouted cross-zone travelis open: the travelgraph is per zone;across zones /distancereturns a straight-lineestimate(estimated:true) or 422no-route-between-zones(ADR-0017)NEXT3Raise the mutationgate to the 99/99standardRaise the gremlinsthresholds from efficacy89 / mutant-coverage 95toward the 99/99 fleetstandard(.gremlins.yaml:30,33;measured 89.90%efficacy, 10 of 99 …LATER4Add a reactivationuse case and amaintenance setterReactivation use caseabsent: decommission isone-way in v1(ADR-0005);UnderMaintenance is amodelled state but nouse case sets it (notevidenced in …LATER5Switch on MCP,A2A, analytics andfrontend in theChart defaults keep mcp,a2a, analytics andfrontend off(values.yaml); atrue-to-scale mixedfloor plan is deferred(ADR-0017:182)
what could go wrong · and what we do about it

Renumbering the building changes codes, a trade-off we chose

No authentication on REST, MCP or A2A, by decision

Every REST, MCP and A2A endpoint is unauthenticated by decision (ADR-0015 reverted ADR-0014)…

→

No mitigation on the roadmap yet: this one needs an owner.

Reorganising the building changes location codes

Hierarchical location code means re-organizing the building changes codes - accepted trade-off (re-slotting is rare…

→

Accepted trade-off: re-slotting is rare while reads run into millions a day.

Postgres and Kafka are mandatory; no in-memory mode

Postgres and Kafka are the only runtime (ADR-0039): DATABASE_URL and KAFKA_BROKERS are mandatory, no in-memory mode…

→

/readyz checks both dependencies, so a broken deployment shows as not ready.

Cross-zone distance can be a straight-line guess

Cross-zone /distance is a straight-line estimate (estimated:true) unless both slots have position geometry…

→

Responses flag estimates, and position geometry on both slots gives a real route.

the decision we need

Give wes-work-planning event-driven travel input so it stops reading distance synchronously.

WHAT ISIt registers sites, zones, aislesand slots, checks placement rulesonce at registration, and publishesthe map as events.THE CATCHDecommissioning is one-way,maintenance status cannot be set,and travel across zones is only astraight-line estimate.WHAT COULD BERouted cross-zone travel, locationsthat can return from decommission orgo into maintenance, and a strongermutation gate.
Why it matters

Facility layout is the warehouse map every tier builds on, and it only ever stores legal locations

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal / ports and adapters; dependency rule enforced as an executable arch-go test; DDD Open Host Service with Published Language; no inbound service dependencies…
Layoutcmd/{facility,facility-projector,facility-reports,mcp,a2a}; internal/{domain (site,zone,aisle,placement,slot,structure,travel,shared), application (ports,usecases)…
StoragePostgres OLTP via pgxpool with golang-migrate (13 OLTP *.up.sql migrations + analytics set…
TestingUnit tests with explicit failing-path coverage per invariant, 90% coverage gate on domain+application; godog BDD (21 *.feature), MCP eval and governance tests, arch-go fitness tests…
REST38 operations over 30 paths on :8080: /healthz, /readyz, /sites, /sites/{siteCode}, /sites/{siteCode}/role, /site-roles/transfer-defaults…
Gochi routerpgx/v5 + pgxpoolgolang-migratesegmentio/kafka-goCloudEvents sdk-go v2OpenTelemetrymodelcontextprotocol/go-sdkA2A agentgodog BDDarch-go fitness testsgremlins mutation testing