Warehouse Ops Agent
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.
Warehouse Ops Agent is the fleet's agentic layer: the "AI teammate
that sees, analyzes, and recommends" over the warehouse-systems bounded
contexts — originally five (inventory-storage, wes-work-planning,
fulfillment-execution, workforce-management, facility-layout), plus
two second-wave MCP clients (labor-performance, order-management;
see
ADR 0007), plus
warehouse-planning (read tools only,
ADR 0013), plus
product-master (read-only,
ADR 0020), plus
inbound-receiving (read-only,
ADR 0021), plus
network-inventory-planning (read tools only,
ADR 0019), plus
slotting-optimization (read tools only,
ADR 0024). The
process-path-management client was removed (ADR 0024): catalogue
configuration is not an ops signal. It is a
Customer of those contexts' published MCP Open Host Services — it owns
no aggregate, enforces no new business invariant, and persists no domain
state. Its "domain" layer is decision policy: pure correlation rules
over facts read from those contexts.
What it is not
It is not a sixth bounded context in the domain sense. See ADR 0001 for the full placement reasoning: there is no aggregate or invariant for this repo to own, so calling it a "context" would be a domain in name only.
The see → analyze → act surface it consumes
Each upstream context already exposes a curated, intent-level MCP read
surface (the fleet's
MCP Governance Charter).
This agent's outbound adapters (internal/adapters/outbound/mcpclient/)
are thin, schema-typed clients over exactly those tools — never a Go
import of any sibling's internal packages:
| Upstream context | Read tools the client implements | Consumed today by |
|---|---|---|
wes-work-planning | get_backlog_telemetry, get_rebalance_recommendation | daily brief, flow balance |
fulfillment-execution | get_queue_status, diagnose_stuck_tasks | daily brief, flow balance |
workforce-management | get_staffing_gap | daily brief, flow balance (get_staffing_gap) |
facility-layout | list_sites, estimate_travel_distance | daily brief (list_sites), explain travel factor |
inventory-storage | check_availability, get_bin_occupancy | E2 stranded reservation (MCP tool detect_stranded_reservation) |
labor-performance | get_task_type_utilization | flow-balance utilization overlay (get_task_type_utilization, ADR 0008) |
order-management | get_promise_health | daily brief promiseHealth section (today so far; ADR 0024); get_order stays published but unwired |
slotting-optimization | get_slot_plan, list_slot_plans (two of its four published read tools) | daily brief slotPlanWatch section: Approved plans with unexecuted moves after SLOT_PLAN_STALE_AGE (ADR 0024); get_forward_slots and get_sku_velocity deliberately unwired |
warehouse-planning | get_process_path_capacity (read tool only; its write tools are never called) | daily brief capacity outlook (get_process_path_capacity, ADR 0013) |
product-master | list_products (one of its six read tools; its two pack-level write tools are never called) | master-data gaps report (list_products, GET /master-data-gaps / find_master_data_gaps, ADR 0020). Switched on in the kind cluster (warehouse-infra sets PRODUCT_MASTER_MCP_ENDPOINT) |
inbound-receiving | list_asns, list_appointments, list_receipts (three of its seven read-only tools) | inbound outlook (list_asns, list_appointments, list_receipts; GET /inbound-outlook / get_inbound_outlook, ADR 0021). Off until INBOUND_RECEIVING_MCP_ENDPOINT is set |
network-inventory-planning | get_transfer, find_stuck_transfers, simulate_transfer_options (read tools only) | transfer watch (/transfer-watch/*, triage_stuck_transfers, get_transfer_status, explain_network_imbalance, ADR 0019) |
returns-processing | get_return, list_returns_by_order, get_disposition_policy (its three read-only tools) | none yet: the client is wired but no use case consumes it. Off until RETURNS_PROCESSING_MCP_ENDPOINT is set |
exception-management | list_open_exceptions, get_exception, get_exception_policies, get_sla_report (its four read-only tools) | none yet: the client is wired but no use case consumes it. Off until EXCEPTION_MANAGEMENT_MCP_ENDPOINT is set |
| customer-ordering | get_order, get_order_tracking, get_ship_to (its three read-only tools) | none yet: the client is wired but no use case consumes it. Off until CUSTOMER_ORDERING_MCP_ENDPOINT is set (ADR 0025) |
| delivery-promise | get_current_policy, get_delivery_offer, get_promise, list_promise_books, list_promises_by_order (its five read-only tools) | none yet: the client is wired but no use case consumes it. Off until DELIVERY_PROMISE_MCP_ENDPOINT is set (ADR 0025) |
| last-mile-delivery | list_waves, get_wave_stops, get_route (its three read-only tools) | none yet: the client is wired but no use case consumes it. Off until LAST_MILE_DELIVERY_MCP_ENDPOINT is set (ADR 0025) |
| linehaul-transportation | get_departure, list_departures (its two read-only tools) | none yet: the client is wired but no use case consumes it. Off until LINEHAUL_TRANSPORTATION_MCP_ENDPOINT is set (ADR 0025) |
| node-performance | get_scorecard, list_scorecards_by_grade (its two read-only tools) | none yet: the client is wired but no use case consumes it. Off until NODE_PERFORMANCE_MCP_ENDPOINT is set (ADR 0025) |
| node-topology | get_node, get_region, list_nodes, list_regions, list_lanes, resolve_service_area (its six read-only tools) | none yet: the client is wired but no use case consumes it. Off until NODE_TOPOLOGY_MCP_ENDPOINT is set (ADR 0025) |
| offer-availability | browse_catalog, get_catalog_item, list_listings, get_inventory_feed (its four read-only tools) | none yet: the client is wired but no use case consumes it. Off until OFFER_AVAILABILITY_MCP_ENDPOINT is set (ADR 0025) |
| order-sourcing | get_assignment, list_assignments (its two read-only tools) | none yet: the client is wired but no use case consumes it. Off until ORDER_SOURCING_MCP_ENDPOINT is set (ADR 0025) |
| shipping-and-tracking | get_journey (its one read-only tool) | none yet: the client is wired but no use case consumes it. Off until SHIPPING_AND_TRACKING_MCP_ENDPOINT is set (ADR 0025) |
| seller-inbound | get_seller_scorecard, get_inbound_plan, get_shipment_labels, get_inbound_shipment (its four read-only tools) | none yet: the client is wired but no use case consumes it. Off until SELLER_INBOUND_MCP_ENDPOINT is set (ADR 0027) |
| vendor-connectivity | get_vendor, get_vendor_node, list_vendor_nodes, get_purchase_order, poll_purchase_orders, get_inbound_shipment, poll_inbound_shipments, get_transaction, get_node_scorecard (its nine read-only tools) | none yet: the client is wired but no use case consumes it. Off until VENDOR_CONNECTIVITY_MCP_ENDPOINT is set (ADR 0025) |
| task-interleaving | get_hint, get_site_policy, get_station, list_hints (its four read-only tools) | none yet: the client is wired but no use case consumes it. Off until TASK_INTERLEAVING_MCP_ENDPOINT is set (ADR 0025) |
| pick-face-replenishment | get_policy, list_policies, get_replenishment, list_replenishments, list_pick_faces (its five read-only tools) | none yet: the client is wired but no use case consumes it. Off until PICK_FACE_REPLENISHMENT_MCP_ENDPOINT is set (ADR 0025) |
Beyond MCP, the agent also reads Prometheus and Loki for its
runtime-signals report, and fans out over plain REST
for the console-bff routes (see the context map).
"Analyze" is the pure internal/domain/policy correlation layer described
below. "Act" is deliberately not built yet — see
Governance note.
The three exceptions
| Exception | What it correlates | Recommended action |
|---|---|---|
| E1 — FlowBalanceException | wes's rebalance recommendation + workforce-management's staffing gap + fulfillment-execution's stuck-task diagnostic, for one process path | assign_labor, release_next_work, or hold |
| E2 — StrandedReservation | fulfillment-execution's expired/expiring task leases + inventory-storage's usable-stock shortfall for the affected SKU | revoke_reservation (with a mandatory blast-radius readout) or hold |
| E3 — DailyBrief | backlog telemetry, staffing gap, queue depth, and stuck-task counts across every monitored path, grouped by facility-layout site | flags a path an open exception only when two or more independent signals correlate — never a single metric alone |
Every decision this agent returns carries its full evidence trail
(which upstream tool reading drove the call) and degrades to a
conservative hold — never a guess — whenever a signal it needs is
unavailable. See Domain vision for
why that degrade-to-hold discipline is the whole point of the design.
Where to go next
- Getting started — run it locally.
- Architecture — the single binary, the hexagonal layout and the dependency rules.
- Configuration, Runbook, Observability and Troubleshooting — operating it.
- Testing — the test pyramid and CI jobs.
- Use cases — what each query does and the rules it applies.
- HTTP routes and MCP tools — the full REST and MCP contract.
- Integration — every upstream and downstream edge and its failure behaviour.
- Domain vision — why this agent exists the way it does, and the guardrails that keep it that way.
- Ubiquitous language — the exact vocabulary this service uses, including the terms it borrows from its upstream contexts.
- DDD artifacts (ddd-crew) — core domain chart, bounded context canvas, EventStorming, class / ER / sequence diagrams.
- API surface — the REST and MCP tools this agent exposes.
- Context map — how this agent sits among the bounded contexts.
- Governance note — the read-only v1 posture and what a future write-capable slice would require.
- Architecture Decision Records — the decisions, and why.
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.