warehouse-systems fleet · executive briefing

offer-availability

Tells the network what it can sell today, and from which warehouse
eight capabilitys9 events out · 8 in15 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

Offer Availability answers 'can we sell this item from this node?' so quoting starts from facts

1

It owns sellability, so items, listings and feeds have one place to be right.

2

It suppresses listings itself when a node, item or seller goes off, with no calls out.

3

Its weak spots are feed quality and queue health, which no metric shows today.

The ask

Add queue-health metrics and a seller report for received stock whose GTIN we can't resolve.

why it exists

Quoting is only as honest as our answer to 'can we sell this here?'

Supporting subdomain of the retail network (commerce tier) answering sellability: which catalogue items exist with their GS1 packaging hierarchies, which per-node listings are live or suppressed, what vendor inventory feeds claim, and a local copy of every node's status folded from node-topology events. It does not own node lifecycle, orders or pricing…

Today

It holds catalogue items, per-node listings and vendor inventory feeds, and keeps a local copy of node status from node-topology.

The catch

Vendor feeds are its weakest input, and nothing yet measures outbox backlog, relay or consumer lag.

what it does

It decides what is sellable, where, and how many we can ship

Catalogue lifecycle

Creates items with size, weight and hazmat flags, and discontinues them cleanly.

Packaging hierarchy

Knows how eaches roll up into inners, cases and pallets for every GTIN.

Live listings

Keeps one listing per item and node, live or suppressed with a clear reason.

Vendor inventory feeds

Applies vendor ship quantities per node, replaces stale feeds and records failed ones.

Seller listings

Turns seller stock received into owner listings, and restocks them on completed returns.

Node status copy

Suppresses listings when a node is suspended or retired, and restores them.

who it talks to

Three contexts feed it, ten build on what it publishes

LISTENS TO · 8 EVENT TYPESIS HEARD BY · 10 CONTEXTSnode-topology4seller-inbound3customer-returns1delivery-promise6product-discovery6order-sourcing5seller-inbound3vendor-connectivity3pricing2+4 more contextsofferavailabilitybadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

Items, listings and feeds are the three words everything hangs on

THE LANGUAGEOF THE DOMAINCatalogItemGTINPackaging HierarchyListingownerRefInventoryFeedFeed BasisNodeStatusView
REST10 operations over 9 paths on :8080
MCPRead-only MCP server (cmd/mcp, :8090…
A2ARead-only A2A agent (cmd/a2a, :8093, JSON-RPC over HTTP…
how it is built

A hexagonal core with a local node-status copy and no outbound calls

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :808010 operations over 9 pathsMCP tools :8090Read-only MCP server…Kafka consumer · 8 eventsnode.NodeRegisterednode.NodeActivatedDOMAIN CORECatalogItemGTINPackaging HierarchyListingPostgreSQLPostgreSQL via pgx with 4…Kafka producer · 9 eventsCatalogItemCreatedCatalogItemDiscontinuedTransactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

Eight event types come in and nine go out through an outbox

CONSUMED · BY SOURCE · 8PUBLISHED · BY ENTITY · 9node-topology 4seller-inbound 3customer-returns 14 catalogitem4 listing1 inventoryfeedNodeRegisteredNodeActivatedNodeSuspendedNodeRetiredSellerSuspendedSellerReinstatedInboundShipmentReceivedReturnCompletedCatalogItemCreatedCatalogItemDiscontinuedCatalogItemPackagingDeclaredCatalogItemPackLevelRetiredListingCreatedListingAvailabilityChangedListingSuppressed
how we know it is healthy

Traces, metrics and a 90% gate show sellability is sound

OpenTelemetry SDK -> OTLP/gRPC Collector (Jaeger traces, Prometheus metrics); JSON logs on stdout shipped by Alloy to Loki

What we watch

  • W3C traceparent + baggage propagation installed globally in every binary; traceparent stamped into outbox rows and extracted by the node-topology…
  • Business counters: availability.inventory_feeds.applied (outcome applied/superseded/failed/rejected)…
  • http.server.request.duration histogram on all REST/MCP/A2A binaries

What stops a bad change

  • Coverage gate 90% over internal/domain + internal/application (make coverage, CI test job)
  • make check = fmt-check + vet + build + lint + test; check-all adds coverage + arch-test + bdd; check-fast = fmt-check + vet + arch-test
  • internal/architecture fitness tests fail the build on layering violations
by the numbers

Fifteen recorded decisions and 14 BDD features back the rules

15
Architecture decisions
#22 of 45 in the fleet
4
DB migrations
#22 of 45 in the fleet
14
BDD feature files
#24 of 45 in the fleet
9
Events published
#13 of 45 in the fleet

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

One-command workflows (make)

helpbuildvetfmtfmt-checklinttestcoverageintegrationbddarch-testmutationmutation-fullvuln
what comes next

Next, make queue health visible and close the GTIN gap

NOW1Add outbox, relayand consumer-lagmetricsAdd queue-healthinstruments:observability.md statesthere is nooutbox-backlog, relay orconsumer-lag metric(bounded-context-canvas.md:226lists them as…NEXT2Reconcile receivedstock whose GTINcannot be resolvedAdd a seller-facingreconciliation forgtin_unresolved receivedstock: it is now counted(availability.seller_events.ignored)but not reconciled (notevidenced in docs)NEXT3Raise mutationgate from 90/90toward the 99/99Raise the mutation gatefrom efficacy 90 /mutant-coverage 90toward the 99/99 fleetstandard(.gremlins.yaml:33-34)LATER4Letthroughput-limitedfeeds dampenAddcapacity/throughput-basisweighting soTHROUGHPUT_CONSTRAINEDfeeds can dampen quotingrather than only statequantityLATER5Set the Docker Hubsecrets to finishpackagingClose the open packagingfollow-up: repositorysecretsDOCKERHUB_USERNAME/DOCKERHUB_TOKEN(before-first-release.mdrow 11)
what could go wrong · and what we do about it

Our biggest risk is a bad vendor feed misstating what we can sell

A broken vendor feed misstates availability

Vendor feed quality is the weakest input: a broken feed zeroes or misstates availability that downstream quoting trusts

→

Failed feeds are recorded and superseded; queue-health metrics are not yet built.

A stale node-status copy can oversell

Local NodeStatusView can lag node-topology reality; quoting on a stale copy oversells from suspended nodes

→

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

Suppression rules grow harder with each owner rule

Suppression-reason precedence (NODE_NOT_SELLABLE, DISCONTINUED, OWNER_SUSPENDED) grows in complexity with every owner rule added

→

BDD scenarios and mutation testing guard the domain rules as precedence grows.

Unauthenticated endpoints, by fleet decision

Every REST, MCP and A2A endpoint is unauthenticated by decision (fleet-wide auth revert; CLAUDE.md:23,45)

→

A decision, not a gap: relies on the trusted network boundary.

the decision we need

Add queue-health metrics and a seller report for received stock whose GTIN we can't resolve.

WHAT ISIt holds catalogue items, per-nodelistings and vendor inventory feeds,and keeps a local copy of nodestatus from node-topology.THE CATCHVendor feeds are its weakest input,and nothing yet measures outboxbacklog, relay or consumer lag.WHAT COULD BEQueue trouble shows on a dashboard,and received stock with an unknownGTIN gets reconciled instead of onlycounted.
Why it matters

Offer Availability answers 'can we sell this item from this node?' so quoting starts from facts

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal / ports-and-adapters with DDD aggregates (CatalogItem, Listing, InventoryFeed) plus a NodeStatusView read model; layering enforced by fitness tests
Layoutcmd/api (REST + node-topology, seller-inbound and customer-returns consumers + relay + janitor), cmd/mcp, cmd/a2a…
StoragePostgreSQL via pgx with 4 embedded migrations and pgtx UnitOfWork; transactional outbox with capped relay…
TestingUnit + integration with testcontainers Postgres/Kafka, godog BDD (14 feature files) over features/*.feature, MCP tool-registry golden file, architecture fitness tests (layering…
REST10 operations over 9 paths on :8080: /catalog-items, /catalog-items/{catalogItemId}/discontinuations…
Go 1.27.4chi v5pgx v5 / PostgreSQLMCP Go SDKa2a-gosegmentio kafka-goCloudEvents 1.0golang-migrateOpenTelemetrygodog BDDtestcontainersReact/Vite MFE console