warehouse-systems fleet · executive briefing

pick-face-replenishment

Refills pick shelves before they run dry, so pickers don't reach an empty bin
eight capabilitys4 events out · 8 in13 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

Pick-Face Replenishment spots a pick face nearing empty and asks for a refill, so picking keeps moving

1

Explicit min/max policies turn 'running low' into a clear, automatic refill request.

2

It never moves stock itself; inventory-storage's relocation event closes each request.

3

The loop is well tested, but it has never been watched end to end with sibling services.

The ask

Verify the full refill chain end to end once siblings deploy, and add lag, outbox and dead-letter metrics.

why it exists

An empty pick face stops picking; this context keeps them stocked

pick-face-replenishment is the WMS-tier Supporting bounded context that keeps forward pick faces from running dry. It holds an explicit min/max policy per site and SKU, watches each forward bin's stock level through event-fed local copies of neighbours, and when the projected level reaches the minimum raises a replenishment request: move stock from the fullest reserve bin to the forward bin…

Today

Min/max policies per site and SKU, plus event-fed bin levels, raise a refill request from the fullest reserve bin, capped at the max.

The catch

Telemetry is thin: one request histogram and one counter, no lag or outbox metrics, and the refill loop relies on siblings keeping their contracts.

what it does

It watches every pick face and raises a refill before it runs dry

Min/max policies

Sets versioned min and max levels per site and SKU, safe from conflicting edits.

Pick-face status

Shows every pick face as below min, OK, no source or no policy.

Three ways to raise

Raises refills automatically, on a site sweep, or by hand.

Close on relocation

Closes a request when inventory-storage moves the stock, recording units moved.

Clean cancellation

Cancels requests when an operator, slot plan or policy change says so.

Published refill events

Announces requested, completed and cancelled refills through an outbox.

who it talks to

Four contexts feed it, one context builds on what it publishes

LISTENS TO · 8 EVENT TYPESIS HEARD BY · 1 CONTEXTSfacility-layout3inventory-storage2product-master2slotting-optimization1wes-work-planning1pick-facereplenishmentbadge = event types on that edge · derived from the CloudEvents types each repo declares
the shared language

Policies, requests and projected levels are all the vocabulary

THE LANGUAGEOF THE DOMAINReplenishmentPolicyReplenishmentRequestDetector verdictsPick face / forward binReserve bin and usable stockProjected level =…Source-bin policy…Priority URGENT
REST14 operations over 11 paths on :8080: GET /policies…
MCPMCP server (cmd/mcp, :8090, Streamable HTTP): 5 read-only…
A2ARead-only A2A agent (cmd/a2a, :8093, JSON-RPC…
how it is built

Five binaries keep refill decisions apart from analytics

DRIVERS · INBOUNDOUTBOUND · ADAPTERSREST API :808014 operations over 11 pathsMCP tools :8090MCP server (cmd/mcp, :8090…Kafka consumer · 8 eventsProductPackLevelDeclaredProductPackLevelRetiredDOMAIN COREReplenishmentPolicyReplenishmentRequestDetector verdictsPick face / forward binPostgreSQLPostgreSQL only for the…Kafka producer · 4 eventsReplenishmentRequestedReplenishmentCompletedTransactional outboxrelay · DLQ on x-dlq-*commands inevents inevents outstorage / infra
event traffic · CloudEvents 1.0 on Kafka

Eight event types in and four out keep the refill loop turning

CONSUMED · BY SOURCE · 8PUBLISHED · BY ENTITY · 4facility-layout 3inventory-storage 2product-master 2slotting-optimization 13 replenishment1 policyProductPackLevelDeclaredProductPackLevelRetiredBinStockLevelChangedStockRelocatedSlotPlanApprovedZoneRegisteredLocationSlotRegisteredReplenishmentRequestedReplenishmentCompletedReplenishmentCancelledReplenishmentPolicyDeclared
how we know it is healthy

Traces and logs are on the fleet standard, but queue health is dark

Fleet observability standard (ADR 0013): all five binaries push OTLP/gRPC traces and metrics (lazy, non-blocking) — http.server.request.duration on api/mcp/a2a/reports, runtime metrics, otelchi server spans…

What we watch

  • One JSON log line per lifecycle event, aggregated invalid-configuration errors at boot
  • Readiness flips behind 503 /readyz for postgres and kafka
  • Consumer dead-lettering with logged poison messages; outbox relay attempt caps
  • Analytics freshness surfaced as a REST report (GET /reports/freshness) for the read side

What stops a bad change

  • make check / check-all / check-fast (fmt, vet, golangci-lint, test -race, arch-test)
  • make coverage with a 90% gate over domain and application
  • make api-lint (Spectral), guide-lint, harness-test, mutation (gremlins 90/90), integration (CI job)
by the numbers

Thirteen decisions and nine BDD feature files pin the refill rules

13
Architecture decisions
#27 of 45 in the fleet
3
DB migrations
#26 of 45 in the fleet
9
BDD feature files
#36 of 45 in the fleet
4
Events published
#22 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, prove the full chain works and light up the queue metrics

NOW1Verify the refill chainend to end oncesiblings deployVerify the full execution chainend-to-end (wes-work-planningREPLENISH work,fulfillment-execution task,inventory-storage relocation)once siblings deploy; theREPLENISH path is still anoperator seed step (README)NEXT2Mark the pack-derivedmultiple decision asAcceptedMark ADR 0009 (pack-derivedmultiple) Accepted: its Statusstill reads Proposed althoughits 2026-11-13 addendum says itis implemented on developLATER3Extract trace contextin the Kafka consumersExtract the trace context inthe Kafka consumers soconsumer-raised outbox rowscarry a traceparent (notevidenced ininternal/adapters/inbound/kafka)LATER4Raise mutation gatefrom 90/90 to the 99/99standardRaise the mutation gate(.gremlins.yaml 90% efficacy /90% mutant-coverage) to thefleet 99/99 standard
what could go wrong · and what we do about it

Our biggest risk is a sibling change that silently stops refills

A producer change can silently stop completions

The replenishment loop depends on siblings honouring the chain (StockRelocated with reason REPLENISHMENT and source_ref = request id)…

→

Golden JSON event tests help; verify the chain end to end once siblings deploy.

Lag, outbox depth and dead letters are not measured

Instrumentation is one request histogram and one request-raised counter: consumer lag…

→

Instrument consumer lag, outbox depth and dead-letter rate; check the dashboard panels fill.

Stale local copies can blur detection

Stale local copies: a cutoff/assignment removed upstream leaves copies stale until the next event (documented…

→

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

Unauthenticated endpoints, by fleet decision

REST, MCP and A2A are unauthenticated BY DECISION (fleet-wide)

→

A decision, not a gap: fleet-wide.

the decision we need

Verify the full refill chain end to end once siblings deploy, and add lag, outbox and dead-letter metrics.

WHAT ISMin/max policies per site and SKU,plus event-fed bin levels, raise arefill request from the fullestreserve bin, capped at the max.THE CATCHTelemetry is thin: one requesthistogram and one counter, no lag oroutbox metrics, and the refill looprelies on siblings keeping theirWHAT COULD BEWe've watched a request travel fromdetection to relocation, anddashboards show live refill flow andqueue health.
Why it matters

Pick-Face Replenishment spots a pick face nearing empty and asks for a refill, so picking keeps moving

appendix · for the engineers in the room

The fine print: how it is put together

StyleHexagonal (ports and adapters) with a pure detection function and DDD aggregates; event-driven, integration by published contracts and local copies only
LayoutFive binaries: cmd/api (REST :8080 + four Kafka consumers — inventory, slotting, layout, product-master pack levels…
StoragePostgreSQL only for the write side (pgx, unit of work, 3 embedded migrations (schema, forward_assignment_maps, pack_derived_policies)…
Testingtable-driven -race unit tests with in-memory doubles; godog BDD (9 feature files); testcontainers integration tests…
REST14 operations over 11 paths on :8080: GET /policies, PUT|GET|DELETE /policies/{siteId}/{sku}, GET /pick-faces, GET|POST /replenishments…
Go 1.27.4chipgx v5 + golang-migratekafka-go + CloudEvents SDK v2MCP go-sdk v1.8.0OpenTelemetry Go SDK v1.47.0godog + testcontainersAnalytics read sideReact/Vite web remoteHelm chart