ADR 0015: Fulfillment centres receive inbound
Status
Accepted (2026-11-08). Amends the capability table of ADR 0002 and adds a capability gate to ADR 0007.
Context
The network model's node_types table (model.yaml) and the network ADR on
seller inbound give FULFILLMENT_CENTER the capabilities [OUTBOUND, INBOUND]:
a seller's cartons are received at the building that stores them.
INBOUND_CROSS_DOCK already had INBOUND. seller-inbound already treats
both types as receiving nodes. This service's typeRules
(internal/domain/node/types.go) still gave FULFILLMENT_CENTER only
OUTBOUND, so GET /nodes/{nodeId} reported inbound: false for a node that
receives seller cartons. The capability gate the design calls for was missing
too: ADR 0007 value-checks inbound limits (ErrValidation) on any node type, so
a sortation centre or a delivery station could declare carton limits it will
never apply. The network model's gap register records both differences as gap
G64.
Two alternatives were weighed. Keeping the table as it was and letting
consumers special-case fulfillment centres: refused, the capabilities are
derived from the type here (DefaultCapabilitiesByType) precisely so no
consumer has to. Refusing stored profiles that carry limits on a node type
without INBOUND (a restore check, or a data migration that strips them):
refused, the stored revisions are immutable facts (ADR 0002) that were valid
when they were declared, and a restore that refuses them would turn a contract
tightening into an outage. Only new declarations are gated.
Decision
The contract, verbatim:
- typeRules: FULFILLMENT_CENTER capabilities = [OUTBOUND, INBOUND]. INBOUND_CROSS_DOCK stays [INBOUND] and RETURNS_CENTER stays [RETURNS]. Parcel node types (SORTATION_CENTER, DELIVERY_STATION, AIR_HUB) are unchanged. Keep any capability ordering the code already uses.
- New domain error ErrInboundLimitsNotAllowed: declaring an operational profile (or any command that sets the
inboundlimits object) on a node whose type lacks INBOUND is refused. HTTP 422 with problem typeinbound-limits-not-allowed(follow the repo's problem-type naming and catalogue; add it to apis/openapi.yaml responses and the problem-types list, regenerate the REST docs). Value checks from ADR 0007 still apply when the type has INBOUND. - Already-persisted profiles that carry inbound limits on a non-INBOUND node stay restorable (Restore must not refuse them). Only NEW declarations are refused. No data migration.
- GET /nodes/{nodeId} (and list reads, and any MCP read tool exposing capabilities) report inbound:true for FULFILLMENT_CENTER. Regenerate the MCP golden if any output changes.
- No event shape change. NodeRegistered/NodeOperationalProfileDeclared payloads stay as they are. If an event carries a capabilities list, its values for FCs now include INBOUND; say so in the ADR consequences.
- ADR: the next free number (expected 0015), titled 'Fulfillment centres receive inbound'. Link the network model gap G64 in prose (no URL needed).
- Tests: unit tests for the capability table and the refusal; HTTP handler test for 422 inbound-limits-not-allowed; repocontract unchanged unless the snapshot changes; e2e/integration only if they assert capabilities (update their expectations).
How it is built:
Capabilitiesis a struct of booleans, so there is no list ordering to keep: theFULFILLMENT_CENTERrow oftypeRulessetsInbound: truebesideOutbound: true, andTestTypeRulesPinTheModelpins the row.node.ErrInboundLimitsNotAllowedis raised byNode.DeclareProfile(the only command that setsinbound) when the declaration carriesinboundand the node's type lacksINBOUND. The gate runs before the ADR 0007 value checks, so a node that may not declare limits learns that first, whatever the values. An explicit"inbound": nullin a request is still read as absent (ADR 0007 decision 5) and passes the gate.Restoredoes not call the gate: it keeps checking the stored limits' values only, as before.
Consequences
GET /nodes,GET /nodes/{nodeId}, the profilePUTresponse, the MCPget_nodeandlist_nodestools and the A2A skillsserving_stationandfind_nodesnow reportinbound: truefor every fulfillment centre, including the ones registered before this change: the capabilities are derived on read, never stored, so no data moves.- No event changes shape. Neither
NodeRegisterednorNodeOperationalProfileDeclaredcarries a capabilities list (ADR 0004: consumers derive capabilities fromnodeType). A consumer that derives them with the model'sDefaultCapabilitiesByTypenow derivesINBOUNDforFULFILLMENT_CENTER, the value the model always had. - A client that declared
inboundon a sortation centre, delivery station, air hub or returns centre now gets422 inbound-limits-not-allowed; the remedy is to drop the object. Revisions already stored with such limits stay readable, and a later revision withoutinboundsupersedes them for consumers. - No new endpoint, topic, consumer, migration or environment variable; the chart is unchanged.