warehouse-systems fleet · executive briefing

seller-inbound

Helps sellers plan, pack, label and ship stock into the network, and grades how they did
eight capabilitys10 events out · 11 in16 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

Seller Inbound is one front door for seller stock, and it records every discrepancy instead of hiding it

1

Plans are checked against node limits and packaging rules before a carton ships.

2

Every carton carries a network-unique SSCC and GS1-128 label data.

3

Receipts close shipments as they are, with discrepancies and violations on record.

The ask

Decide the v1 fate of PlacementPlanSuggested, and make the order-sourcing consumer survive a late topic.

why it exists

Seller stock needs a front door that records the truth

Seller Inbound is the front door through which a seller gets stock into the retail network: the seller is onboarded, plans an inbound shipment to a vendor node in eaches (loose or case-packed), packs it into cartons each identified by an SSCC and a printed label, and ships it…

Today

Sellers plan shipments in eaches, pack cartons with SSCC labels and ship to a vendor node; the vendor's receipt closes the shipment.

The catch

One GS1 prefix guards the whole SSCC namespace, the capacity gate only records when volumes are undeclared, and the scorecard suspends nobody.

what it does

Plan, pack, label, ship and score: one path for seller stock

Seller onboarding

Onboard, suspend or reinstate sellers as explicit, safe human commands.

Inbound planning

Plans in eaches are checked against the destination node's inbound limits.

Packaging checks

Plan lines must fit the catalogue item's packaging hierarchy.

SSCC carton IDs

Every carton gets a valid, network-unique SSCC, issued by us if needed.

Labels and dispatch

A frozen manifest produces GS1-128 label data and the cartons ship.

Receipt-based closing

Vendor receipts close shipments, recording every discrepancy as found.

who it talks to

Four contexts feed it, three build on what it publishes

LISTENS TO · 11 EVENT TYPESIS HEARD BY · 3 CONTEXTSnode-topology5offer-availability3order-sourcing2vendor-connectivity1offer-availability3vendor-connectivity3node-performance1sellerinboundbadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

Plans, shipments, cartons and SSCCs are the words that matter

THE LANGUAGEOF THE DOMAINSellerInboundPlanInboundShipmentCartonSSCCLabelComplianceScorecardComplianceTier
REST19 operations over 17 paths on :8080
MCPRead-only MCP server (cmd/mcp, :8090…
A2ARead-only A2A agent (cmd/a2a, :8093): skills…
how it is built

Three deployables share one hexagonal core enforced by a test

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :808019 operations over 17 pathsMCP tools :8090Read-only MCP server…Kafka consumer · 11 eventsnode.NodeRegisterednode.NodeActivatedDOMAIN CORESellerInboundPlanInboundShipmentCartonPostgreSQLPostgreSQL onlyKafka producer · 10 eventsInboundShipmentLabelledInboundShipmentShippedTransactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

Ten seller facts go out, and eleven come in to keep plans honest

CONSUMED · BY SOURCE · 11PUBLISHED · BY ENTITY · 10node-topology 5offer-availability 3order-sourcing 2vendor-connectivity 14 inboundshipment4 seller1 inboundplan1 placementplanNodeRegisteredNodeActivatedNodeSuspendedNodeRetiredNodeOperationalProfileDeclaredCatalogItemPackagingDeclaredCatalogItemPackLevelRetiredListingAvailabilityChangedInboundShipmentLabelledInboundShipmentShippedInboundShipmentReceivedInboundDiscrepancyRecordedPlacementPlanSuggestedSellerOnboardedSellerSuspended
how we know it is healthy

Fleet-standard traces and logs track every shipment's path

Fleet observability standard (ADR 0008): OpenTelemetry OTLP/gRPC export to the in-cluster Collector (Jaeger + Prometheus behind it), never blocking…

What we watch

  • Trace continues across Kafka in the traceparent header of each published event and is picked up by consumers
  • Business counter seller_inbound.shipment.shipped with outcome/reason attributes
  • HTTP request duration histogram plus one server span and request-log line per call sharing a trace id

What stops a bad change

  • make check (pre-push) and check-fast: fmt, vet, build, lint, unit, handler, godog scenarios
  • Coverage gate >= 90% over internal/domain + internal/application (make coverage)
  • golangci-lint, complexity (gocyclo gate 15), blocking file-length check
by the numbers

Sixteen decisions and 13 BDD features back the seller flow

16
Architecture decisions
#21 of 45 in the fleet
5
DB migrations
#20 of 45 in the fleet
13
BDD feature files
#26 of 45 in the fleet
10
Events published
#11 of 45 in the fleet

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

One-command workflows (make)

arch-testbddbuildcheckcheck-allcheck-fastcoveragefmtfmt-checkguide-lintharness-testhelpintegrationlint
what comes next

Next, we settle one orphan event and harden a fragile consumer

NOW1Decide the v1 fate ofPlacementPlanSuggestedDecide the v1 fate ofPlacementPlanSuggested (ADR 0012): it ispublished to the events topic but noconsumer of it is evidenced in thisrepositoryNEXT2Sync the README feature-filecount with the treeSync the README feature-file count:README.md:209 says 6 feature files, 13*.feature exist in the treeLATER3Make the order-sourcingconsumer robust to a late topicMake the order-sourcing consumer robustto a late topic: a kafka-go groupconsumer that starts before its topicexists never picks it up later, so thepod must be restarted onceretailnetwork.order-sourcing.eventsexists (fleet gap row 45)
what could go wrong · and what we do about it

Our biggest risk is a contract that drifts without anyone noticing

Producer topics can drift from what we decode

Consumed-contract drift: four producer topics feed four consumers; order-sourcing merged-release fields (members, assignmentId…

→

Decoding is tolerant, so merged-release fields are ignored rather than breaking.

One GS1 prefix guards every SSCC

The network-wide SSCC namespace depends on a single configured GS1 company prefix (SSCC_COMPANY_PREFIX, 6-11 digits)…

→

A wrong prefix collides network-wide, so check the configured value before each rollout.

AT_RISK sellers rely on operator follow-up

The compliance scorecard is deliberately informational: suspension stays a human command…

→

The scorecard is informational on purpose; suspension stays a human command.

Unauthenticated endpoints, by fleet decision

Every REST, MCP and A2A endpoint is unauthenticated by decision (fleet-wide auth revert…

→

A decision, not a gap: the in-cluster boundary is the access control.

the decision we need

Decide the v1 fate of PlacementPlanSuggested, and make the order-sourcing consumer survive a late topic.

WHAT ISSellers plan shipments in eaches,pack cartons with SSCC labels andship to a vendor node; the vendor'sreceipt closes the shipment.THE CATCHOne GS1 prefix guards the whole SSCCnamespace, the capacity gate onlyrecords when volumes are undeclared,and the scorecard suspends nobody.WHAT COULD BEEvery published event has a purpose,consumers survive late topicswithout restarts, and operators acton an honest scorecard.
Why it matters

Seller Inbound is one front door for seller stock, and it records every discrepancy instead of hiding it

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal / ports & adapters, DDD bounded context; layering enforced as an executable fitness test, not a convention
Layoutcmd/{api,mcp,a2a} as independent deployables (composition root: REST + outbox relay + Kafka consumers + retention loop in one process) plus web/ Module Federation remote…
StoragePostgreSQL only (pgxpool repositories, embedded golang-migrate at boot, global idempotency-key store, transactional outbox + inbox); Kafka…
Testingmake test unit suites (-race); godog/Gherkin BDD (13 feature files); testcontainers Postgres+Kafka integration; gremlins mutation (mutation-fast blocking, mutation-full exhaustive)…
REST19 operations over 17 paths on :8080: /sellers, /sellers/{sellerId}/suspensions, /sellers/{sellerId}/reinstatements, /sellers/{sellerId}/scorecard…
Go 1.27chipgx/pgxpoolKafkaMCP Go SDKa2a-goCloudEvents 1.0golang-migrateGS1 SSCC issuingOpenTelemetryHelmgodog