Skip to main content

Integration

This page is the operational view of every edge: what is called, how it is configured, and how a failure shows up. The strategic view (context mapping patterns, subdomain classes) is on the Context map. Every call is a read made at request time; the agent never writes to another context, never subscribes to an event and publishes none.

Transport conventions​

ProtocolClientTimeoutAuthFailure classification
MCP Streamable HTTPinternal/adapters/outbound/mcpclient (go-sdk v1.8.0), a fresh session per tool call, client name warehouse-ops-agent 0.1.010 s per call (Session)none (ADR 0006)an isError result whose text starts with a validation slug (malformed-*, invalid-*, *-required, validation-failed, missing-location-code) maps to ErrUpstreamInvalidInput, a *-not-found slug to ErrUpstreamNotFound, anything else is an upstream failure (ADR 0018, tool_error.go)
REST (OLTP and *-reports)internal/adapters/outbound/restclient, GET only5 snoneany 404 becomes ports.ErrNotFound (only the order-management lookup turns it into a 404 response); any other non-2xx or transport error is a failure
A2A (JSON-RPC over HTTP, a2a-go/v2)internal/adapters/outbound/a2a, three clients over one transport: Client (the ADR-0027 write: release_next_work at wes-work-planning, human-confirmed, opt-in WES_WORK_PLANNING_A2A_URL), LaborClient (the ADR-0029 write: assign_labor at workforce-management with proposalId/approvedBy/agentId, human-confirmed, opt-in WORKFORCE_MANAGEMENT_A2A_URL) and ExceptionClient (the ADR-0028 read-only advisory lookup: find_exceptions at exception-management, opt-in EXCEPTION_MANAGEMENT_A2A_URL)10 s (release) / 3 s (lookup)nonethe peer's in-band problem or any transport or off-contract failure: the release maps onto typed outcomes (404/409/502); the lookup collapses to exceptionContext.status = unavailable and never fails the proposal
Prometheus HTTP APIinternal/adapters/outbound/telemetry5 snoneany error marks prometheus unavailable
Loki HTTP APIinternal/adapters/outbound/logs5 snoneany error marks loki unavailable
Anthropic Messages APIinternal/adapters/outbound/llm/anthropic12 s per call, 8 s per reasoning run (LLM_TIMEOUT)x-api-key header5xx and transport errors retried (3 attempts), 4xx permanent, breaker per process

Every outbound call goes through an otelhttp transport (internal/adapters/outbound/httpclient): it gets a client span and carries a W3C traceparent header, so the upstream's span joins the agent's trace; see Observability.

Upstream MCP servers​

Configured by one *_MCP_ENDPOINT variable each (Configuration). An empty endpoint builds no client (ADR 0023). For a "core" upstream the use cases report it as unavailable (the "On failure" column); for an "optional" one the feature is off.

UpstreamEndpoint variableTools called (live)Tools wired, not calledUsed byOn failure
wes-work-planningWES_WORK_PLANNING_MCP_ENDPOINT (core)get_backlog_telemetry, get_rebalance_recommendationnonedaily brief, flow balance; LLM allow-list by defaultbrief: "wes-work-planning: <error>" in the path's unavailable; flow balance: hold, partial: true, missing wes-work-planning.get_rebalance_recommendation, no utilization overlay
fulfillment-executionFULFILLMENT_EXECUTION_MCP_ENDPOINT (core)get_queue_status, diagnose_stuck_tasksnonedaily brief, flow balance, detect_stranded_reservation; LLM allow-list by defaultbrief: unavailable entry; flow balance: partial; stranded reservation: hold ("expired-lease signal is unavailable")
workforce-managementWORKFORCE_MANAGEMENT_MCP_ENDPOINT (core)get_staffing_gapnonedaily brief, flow balance; LLM allow-list by defaultbrief: unavailable entry; flow balance: partial, never guesses a labor gap
facility-layoutFACILITY_LAYOUT_MCP_ENDPOINT (core)list_sites, estimate_travel_distancenonedaily brief (site names), explain-travel-factorbrief: empty siteName; explain-travel-factor: 502, or 400 for a validation slug; 503 and no explain_travel_factor tool when the endpoint is empty
inventory-storageINVENTORY_STORAGE_MCP_ENDPOINT (core)check_availability, get_bin_occupancynonedetect_stranded_reservationhold with the reason in rationale; never a revoke recommendation on partial evidence
labor-performanceLABOR_PERFORMANCE_MCP_ENDPOINT (core)get_task_type_utilizationnoneflow-balance utilization overlay (ADR 0008)overlay omitted; the decision is unchanged
order-managementORDER_MANAGEMENT_MCP_ENDPOINT (core)get_promise_healthget_order (published by order-management; no use case here calls it)daily-brief promiseHealth section, today so far (ADR 0024)the section carries an unavailable line; the brief is still 200
warehouse-planningWAREHOUSE_PLANNING_MCP_ENDPOINT (optional)get_process_path_capacitynonedaily-brief capacityOutlook (ADR 0013)the path's capacityOutlook carries an omittedReason; the brief is still 200
product-masterPRODUCT_MASTER_MCP_ENDPOINT (optional)list_productsnoneGET /master-data-gaps, find_master_data_gaps (ADR 0020)502, no partial report; 400 for a rejected cursor
inbound-receivingINBOUND_RECEIVING_MCP_ENDPOINT (optional)list_asns, list_appointments, list_receiptsnoneGET /inbound-outlook, get_inbound_outlook (ADR 0021)the failing section is omitted with a reason; 502 only when every attempted section failed
network-inventory-planningNETWORK_INVENTORY_PLANNING_MCP_ENDPOINT (optional)find_stuck_transfers, get_transfer, simulate_transfer_optionsnone/transfer-watch/* and the three transfer-watch tools (ADR 0019)502; 404 for *-not-found; 400 for a validation slug; the imbalance fails closed until NIP's read models are fresh
slotting-optimizationSLOTTING_OPTIMIZATION_MCP_ENDPOINT (optional)list_slot_plans, get_slot_planget_forward_slots, get_sku_velocity (published; no use case here calls them)daily-brief slotPlanWatch section (ADR 0024)the section carries an unavailable line (or an explicit noApproved); the brief is still 200
returns-processingRETURNS_PROCESSING_MCP_ENDPOINT (optional)get_return, list_returns_by_order, get_disposition_policynonenone yet (wired for the returns read surface; no consuming use case)none: unset = no client, nothing depends on it (fail-open)
exception-managementEXCEPTION_MANAGEMENT_MCP_ENDPOINT (optional)list_open_exceptions, get_exception, get_exception_policies, get_sla_reportnonenone yet (wired for the exceptions read surface; no consuming use case)none: unset = no client, nothing depends on it (fail-open)

| customer-ordering | CUSTOMER_ORDERING_MCP_ENDPOINT (optional) | get_order, get_order_tracking, get_ship_to | none | get_network_order_outlook (anchor: order, tracking, shipTo sections, ADR 0026) | unset = no outlook, tool not registered (fail-open); the outlook section is omitted with the reason; the tool errors only when every attempted section failed | | delivery-promise | DELIVERY_PROMISE_MCP_ENDPOINT (optional) | list_promises_by_order, get_promise | get_current_policy, get_delivery_offer, list_promise_books (published; no use case here calls them) | get_network_order_outlook (promises section, incl. the per-group get_promise fallback, ADR 0026) | the outlook section is omitted with the reason; the tool errors only when every attempted section failed | | last-mile-delivery | LAST_MILE_DELIVERY_MCP_ENDPOINT (optional) | list_waves | get_wave_stops, get_route (published; no use case here calls them) | get_network_node_outlook (waves section, DELIVERY_STATION nodes only, the node's local service date, ADR 0026) | the outlook section is omitted with the reason; the tool errors only when every attempted section failed | | linehaul-transportation | LINEHAUL_TRANSPORTATION_MCP_ENDPOINT (optional) | list_departures | get_departure (published; no use case here calls it) | get_network_node_outlook (departures section, origin=node, from=now, ADR 0026) | the outlook section is omitted with the reason; the tool errors only when every attempted section failed | | node-performance | NODE_PERFORMANCE_MCP_ENDPOINT (optional) | get_scorecard | list_scorecards_by_grade (published; no use case here calls it) | get_network_node_outlook (scorecards section, ADR 0026) | the outlook section is omitted with the reason; the tool errors only when every attempted section failed | | node-topology | NODE_TOPOLOGY_MCP_ENDPOINT (optional) | get_node, list_lanes | get_region, list_nodes, list_regions, resolve_service_area (published; no use case here calls them) | get_network_node_outlook (anchor: node, inboundLanes, outboundLanes sections; the vendorRef keys vendor-connectivity's sections, ADR 0026) | unset = no outlook, tool not registered (fail-open); the outlook section is omitted with the reason; the tool errors only when every attempted section failed | | offer-availability | OFFER_AVAILABILITY_MCP_ENDPOINT (optional) | list_listings, get_inventory_feed | browse_catalog, get_catalog_item (published; no use case here calls them) | get_network_node_outlook (listings + inventoryFeed sections, the freshest feed the node's listings reference, ADR 0026) | the outlook section is omitted with the reason; the tool errors only when every attempted section failed | | order-sourcing | ORDER_SOURCING_MCP_ENDPOINT (optional) | list_assignments (filtered by order) | get_assignment (published; no use case here calls it) | get_network_order_outlook (sourcing section; assignment tracking numbers also feed the journeys section, ADR 0026) | the outlook section is omitted with the reason; the tool errors only when every attempted section failed | | shipping-and-tracking | SHIPPING_AND_TRACKING_MCP_ENDPOINT (optional) | get_journey | none | get_network_order_outlook (journeys section: one summarized journey per tracking number, at most 20 reads, ADR 0026) | the outlook section is omitted with the reason; the tool errors only when every attempted section failed | | seller-inbound | SELLER_INBOUND_MCP_ENDPOINT (optional) | get_seller_scorecard, get_inbound_plan, get_shipment_labels, get_inbound_shipment | none (all four are wired; no use case here calls them yet, ADR 0027) | — | — | | vendor-connectivity | VENDOR_CONNECTIVITY_MCP_ENDPOINT (optional) | get_vendor_node, get_node_scorecard | get_vendor, list_vendor_nodes, get_purchase_order, poll_purchase_orders, get_inbound_shipment, poll_inbound_shipments, get_transaction (published; no use case here calls them) | get_network_node_outlook (vendor + vendorScores sections, only when node-topology registered the node under a vendor, ADR 0026) | the outlook section is omitted with the reason; the tool errors only when every attempted section failed | | task-interleaving | TASK_INTERLEAVING_MCP_ENDPOINT (optional) | get_hint, get_site_policy, get_station, list_hints | none | none yet (ADR 0025; wired for the interleaving read surface; no consuming use case) | none: unset = no client, nothing depends on it (fail-open) | | pick-face-replenishment | PICK_FACE_REPLENISHMENT_MCP_ENDPOINT (optional) | get_policy, list_policies, get_replenishment, list_replenishments, list_pick_faces | none | none yet (ADR 0025; wired for the pick-face read surface; no consuming use case) | none: unset = no client, nothing depends on it (fail-open) |

process-path-management is the thirteenth client (ADR 0026): its two-tool client was deleted by ADR 0024 (gap A9), but its registry has since grown get_cpt_schedule (an ops signal) and the fleet's posture on wired-unconsumed clients changed with ADR 0025 — so the client is back, pinned to the current three-tool registry (the upstream's older TSV registry golden was converted into this repo's JSON golden convention), wired-unconsumed for now, and PROCESS_PATH_MANAGEMENT_MCP_ENDPOINT is rendered by the chart again from upstreams.processPathManagement.endpoint:

| process-path-management | PROCESS_PATH_MANAGEMENT_MCP_ENDPOINT (optional) | none | get_process_path, list_process_paths, get_cpt_schedule (published; no use case here calls them yet) | none yet (ADR 0026; wired for the path-catalogue + CPT-schedule read surface; a CPT-countdown consumer is the natural follow-up) | none: unset = no client, nothing depends on it (fail-open) |

task-interleaving and pick-face-replenishment remain wired-unconsumed exactly as ADR 0025 left them: the former is keyed by WMS site/station codes (no published site↔node mapping exists to fold it into the node outlook), the latter is warehouse-internal replenishment state with no order/node-picture role that would not be a fake section.

The zero-write tests (internal/architecture/zerowrite) fail the build if any client calls a tool outside the read set, and pin product-master's, inbound-receiving's, slotting-optimization's, returns-processing's, exception-management's and the twelve ADR-0025 clients' files to exactly the tools above.

Tools the LLM may call​

When LLM_MODE is shadow or on, the reasoner can call the MCP tools on LLM_TOOL_ALLOWLIST through the same clients (ToolInvoker). Only five upstreams have a reasoner session: wes-work-planning, fulfillment-execution, workforce-management, inventory-storage and facility-layout (cmd/agent/reasoner.go). The default list is wes-work-planning/get_backlog_telemetry, wes-work-planning/get_rebalance_recommendation, workforce-management/get_staffing_gap, fulfillment-execution/get_queue_status and fulfillment-execution/diagnose_stuck_tasks. Arguments are validated against each tool's discovered schema before the call; a refused call never reaches the upstream.

Upstream REST APIs (console-bff)​

Base URLs default to localhost ports and are overridden in the cluster (Configuration).

UpstreamVariableRequestUsed byOn failure
order-management (OLTP)ORDER_MANAGEMENT_REST_URLGET /orders/<id>GET /console/orders/{id}/lifecycle404 passes through as 404; anything else nulls orderManagement
inventory-storage (OLTP)INVENTORY_STORAGE_REST_URLGET /reservations?demandRef=<id>order lifecycleinventory: null
wes-work-planning (OLTP)WES_WORK_PLANNING_REST_URLGET /work-units?reference=<id>order lifecycleplanning: null, and no task lookup follows
fulfillment-execution (OLTP)FULFILLMENT_EXECUTION_REST_URLGET /tasks?orderRef=<workUnitId> per work unitorder lifecyclefulfillment: null
order-management-reportsORDER_MANAGEMENT_REPORTS_REST_URLGET /reports/funnel, /reports/funnel/freshnessWMS dashboard order-funnelsection available: false; a failed freshness call only nulls freshnessLagSeconds
inventory-storage-reportsINVENTORY_STORAGE_REPORTS_REST_URLGET /reports/flow-accuracy (+ /freshness)WMS inventory-flow-accuracysame
facility-layout-reportsFACILITY_LAYOUT_REPORTS_REST_URLGET /reports/catalog-growth (+ /freshness)WMS catalog-growthsame
wes-work-planning-reportsWES_WORK_PLANNING_REPORTS_REST_URLGET /reports/throughput (+ /freshness)WES planning-throughputsame
fulfillment-execution-reportsFULFILLMENT_EXECUTION_REPORTS_REST_URLGET /reports/throughput (+ /freshness)WES fulfillment-throughputsame
workforce-management-reportsWORKFORCE_MANAGEMENT_REPORTS_REST_URLGET /reports/labor (+ /freshness)WES labor-managementsame
labor-performance-reportsLABOR_PERFORMANCE_REPORTS_REST_URLGET /reports/performance (+ /freshness)WES labor-performancesame

Every report call carries from and to as UTC RFC3339. The sections of one dashboard run concurrently, so one slow reader delays only its own section, up to the 5 s timeout.

Observability backends​

UpstreamVariableQueryUsed byOn failure or when unset
PrometheusPROMETHEUS_URLGET /api/v1/query with istio_requests_total and istio_request_duration_milliseconds_bucket over 10 minutes, per service in RUNTIME_SIGNALS_SERVICESGET /runtime-signalsunset: stub reader, every metric 0; failure: prometheus in unavailableSources
LokiLOKI_URLGET /loki/api/v1/query_range for {namespace="<RUNTIME_SIGNALS_NAMESPACE>"} lines matching error or fatal, 50 lines over 600 sGET /runtime-signalsloki in unavailableSources
OTel CollectorOTEL_EXPORTER_OTLP_ENDPOINTOTLP/gRPC push of traces and metricsalltelemetry dropped, opentelemetry error logged; requests unaffected

External: Anthropic Messages API​

ItemValue
EndpointPOST <LLM_BASE_URL or https://api.anthropic.com>/v1/messages, API version header 2023-06-01
ModelLLM_MODEL, default claude-sonnet-4-5
Whenonly GET /flow-balance/{pathId} and get_flow_balance_exception, only when LLM_MODE is shadow or on (ADR 0004)
Contractthe model must answer through the submit_plan tool (recommendedAction from the closed set, proposedHeads 0–50, rationale); policy.ValidatePlan rejects anything else
On failureshadow: invisible to the caller; on: source: fallback with the deterministic decision. Breaker opens after 5 consecutive failures or more than 50 % of at least 10 requests in 30 s, stays open 30 s (ADR 0011)

Downstream callers​

CallerProtocolContractNotes
warehouse-console (browser)REST over Kong (/api/warehouse-ops-agent) or http://localhost:8096 in devGET /daily-brief (Floor screen, polled every 15 s), GET /console/orders/{id}/lifecycle (Order Lifecycle screen), GET /console/reports/wms and /wes (report dashboards)DTOs are kept in sync by hand with the console's types.ts files; CORS must allow the console origin (CORS_ALLOWED_ORIGINS, chart value config.corsAllowedOrigins)
MCP hosts and LLM agentsMCP Streamable HTTP at /mcp, statelessup to ten read-only tools (MCP tools)errors are plain messages, not ADR 0018 slugs
OperatorsRESTevery route on HTTP routesno auth

Edges that do not exist​

EdgeStatusWhy
Kafka (any topic, produce or consume)absentthe agent reads at request time only; it has no Kafka client and publishes no CloudEvents (Domain events)
network-fulfillmentabsentno client in internal/adapters/outbound; Separate Ways on the Context map
slotting-optimizationabsentno client
Any write call to a siblingforbiddenzero-write tests; detect_stranded_reservation recommends revoke_reservation but never calls it
A Go import of a sibling moduleforbiddenTestNoDirectDependencyOnBoundedContexts
Postgres or any other storeabsentthe agent is stateless

Failure behaviour in one picture​

Source: internal/adapters/inbound/http/router.go, internal/adapters/inbound/http/{master_data_gaps,inbound_outlook,transfer_watch}.go, internal/adapters/outbound/mcpclient/tool_error.go. Simplification: inbound outlook returns 502 when every attempted section failed, and only the transfer-status route maps *-not-found to 404.