Skip to main content

Configuration reference

This repository builds five binaries from one image (Dockerfile copies them to /app/wes, /app/mcp, /app/wes-projector, /app/wes-reports, /app/a2a). Each reads its own environment once at boot; nothing is re-read at runtime. There is no config file other than the process-path catalogue YAML.

Conventions used below:

  • Default is what the binary uses when the variable is unset or empty (every reader uses a getenv(key, fallback) helper that treats "" as unset).
  • Required means the process refuses to start without it and the error names the variable. "Conditional" means it is required only in the mode named in the meaning column. Postgres and Kafka are the only runtime (ADR-0044): no binary has an in-memory, log-only or optional-consumer mode.
  • Durations are Go time.ParseDuration strings (500ms, 30s, 1h, 168h).
  • Test-only variables (the *_TEST_* family read by integration tests) are not listed.

REST and MCP are unauthenticated fleet-wide (ADR-0016): there is no API-key, token or scope variable to set.

cmd/wes — OLTP REST API, Kafka consumers, outbox relay, housekeeper​

Process and persistence​

VariableDefaultRequiredMeaningRead in
HTTP_ADDR:8080noListen address of the REST API (and /healthz, /readyz).cmd/wes/config.go:50
LOG_LEVELinfonodebug, info, warn or error (case-insensitive; anything else is info). JSON to stdout.cmd/wes/main.go:31
DATABASE_URL(none)yesOLTP Postgres DSN. Unset or blank is the boot error DATABASE_URL is required: there is no in-memory mode. The process migrates the schema, opens a pgxpool (MaxConns=10, statement_timeout=5s) and wires the Postgres adapters and UnitOfWork.cmd/wes/config.go
MIGRATIONS_DATABASE_URLvalue of DATABASE_URLnoDSN used only for the golang-migrate startup step. Point it at a direct (non-PgBouncer) connection: golang-migrate takes a session-scoped pg_advisory_lock, which PgBouncer's transaction pooling breaks (ADR-0026). The runtime pool always uses DATABASE_URL.cmd/wes/config.go:52
MIGRATIONS_PATHmigrationsnoDirectory of the OLTP *.up.sql files applied on start (relative to the working directory; the image's working directory is /app, which contains migrations/).cmd/wes/config.go:53

Events and Kafka​

VariableDefaultRequiredMeaningRead in
EVENT_PUBLISHERkafkanoKept because the chart and warehouse-infra set it. kafka (or unset) is the only value: events are written to the outbox in the same transaction as the state change and an always-on in-process relay publishes them to warehouse.work-planning.events and warehouse.wes.analytics (ADR-0014). log and any other value are the boot error EVENT_PUBLISHER=... is not supported.cmd/wes/config.go
KAFKA_BROKERS(none)yesComma-separated broker list (localhost:9092 from the host with docker compose up). Unset or blank is the boot error KAFKA_BROKERS is required. The inbound integration-event consumer on six topics (including warehouse.slotting-optimization.events, ADR-0040) is always on.cmd/wes/config.go
KAFKA_CONSUMER_GROUP(none)yesGroup id of the integration-event consumer, shared by every replica (the chart renders wes-work-planning). Unset or blank is the boot error KAFKA_CONSUMER_GROUP is required. Give any second process against the shared broker (a developer's go run, the e2e harness) a unique value, or the rebalance hands the partition to one member and the other silently consumes nothing.cmd/wes/config.go
OUTBOX_RELAY_INTERVAL1snoSleep between relay passes that found nothing to publish (a pass that drained a full batch of 100 loops immediately). The relay is always on. A malformed or non-positive value falls back to 1s.cmd/wes/publisher.go
OUTBOX_MAX_ATTEMPTS20noOutbox relay attempt cap (ADR-0039): a row that has failed this many sends is no longer claimed, logged once at ERROR (outbox relay: row reached the attempt cap and is no longer claimed) and left in outbox_events for inspection; later rows, including rows with the same key, overtake it. 0 = unlimited (one poison row blocks the relay forever). A malformed or negative value falls back to 20. Re-arm a row with UPDATE outbox_events SET attempts = 0 WHERE id = ... (Runbook). Chart value config.outboxMaxAttempts.cmd/wes/publisher.go:72

Slot-plan relocation​

VariableDefaultRequiredMeaningRead in
RELOCATION_CPT_HORIZON24hnoGo duration added to a slot plan's approved_at to give its RELOCATE work units their CPT (ADR-0040). A malformed or non-positive value falls back to 24h. Chart value config.relocationCptHorizon.cmd/wes/config.go
REPLENISHMENT_MODEkafkanoUnset or kafka: the ReplenishmentRequested/ReplenishmentCancelled consumer that plans REPLENISH work always runs (ADR-0042). permissive, off and any other value fail the boot with REPLENISHMENT_MODE=... is not supported.cmd/wes/replenishment.go
REPLENISHMENT_CONSUMER_GROUP(none)yesThe STABLE consumer group every replica shares for warehouse.pick-face-replenishment.events. Missing is the boot error REPLENISHMENT_CONSUMER_GROUP is required.cmd/wes/replenishment.go
REPLENISHMENT_CPT_HORIZON8hnoGo duration added to a NORMAL request's requested_at to give its REPLENISH work unit its CPT. A malformed or non-positive value falls back to 8h.cmd/wes/replenishment.go
REPLENISHMENT_URGENT_CPT_HORIZON1hnoSame for an URGENT request (the front band); capped at the normal horizon. A malformed or non-positive value falls back to 1h.cmd/wes/replenishment.go

Process-path catalogue​

VariableDefaultRequiredMeaningRead in
PATH_CATALOGUE_SOURCEfilenofile loads PATH_CATALOGUE_FILE once at boot. kafka replays warehouse.process-path-management.events from the beginning under a per-process consumer group and blocks startup until the replay catches up (60 s budget, kafkacatalog.WaitReadyTimeout) (ADR-0030). Any other value behaves like file.cmd/wes/catalogue.go:24
PATH_CATALOGUE_FILE/etc/wes-work-planning/process-paths.yamlyes, in file modeCatalogue YAML. A missing or invalid file stops the process from starting — there is no empty-catalogue fallback (ADR-0012). The Helm chart mounts it from a ConfigMap.cmd/wes/catalogue.go:81

Sibling lookups​

VariableDefaultRequiredMeaningRead in
PRODUCT_CLASSIFICATION_MODEkafkanoUnset or kafka: product-master's ProductClassified is consumed into the Postgres product_classification_copy table and the hazmat/fragile hints are read from it (ADR-0035). permissive, off, http (the retired live lookup) and every other value fail the boot, naming the variable (ADR-0044).cmd/wes/classification.go
PRODUCT_CLASSIFICATION_CONSUMER_GROUP(none)yesStable consumer group of the ProductClassified consumer, shared by every replica (the copy is shared state). Missing is the boot error PRODUCT_CLASSIFICATION_CONSUMER_GROUP is required. warehouse-infra sets wes-work-planning-product-classification.cmd/wes/classification.go
PACK_VIEW_CONSUMER_GROUP(none)yesStable consumer group of the pack-level consumer, shared by every replica: it feeds product_pack_level_copy from product-master's ProductPackLevelDeclared, ProductPackLevelRetired and ProductPackLevelMeasured on warehouse.product-master.events (ADR-0045). Missing is the boot error PACK_VIEW_CONSUMER_GROUP is required; a value equal to PRODUCT_CLASSIFICATION_CONSUMER_GROUP is the boot error PACK_VIEW_CONSUMER_GROUP must differ from PRODUCT_CLASSIFICATION_CONSUMER_GROUP (the classification group has already committed past the pack events, so it could never replay them). Chart value config.packViewConsumerGroup (default wes-work-planning-pack-view).cmd/wes/packview.go

TRAVEL_DISTANCE_MODE and FACILITY_LAYOUT_BASE_URL are gone with the facility-layout travel-distance lookup (ADR-0049); the binary no longer reads them.

Housekeeping​

The retention sweeper (ADR-0032) runs in every process, because DATABASE_URL is mandatory.

VariableDefaultRequiredMeaningRead in
HOUSEKEEPING_INTERVAL1hnoTime between sweeps (the first sweep runs at startup). Malformed or non-positive falls back to 1h.cmd/wes/housekeeper.go:23
IDEMPOTENCY_KEY_TTL24hnoAge after which idempotency_keys rows are deleted. An explicit 0 (or 0s) disables this sweep; malformed or negative falls back to 24h.cmd/wes/housekeeper.go:24
OUTBOX_RETENTION168h (7 days)noAge, measured from published_at, after which published outbox_events rows are deleted. Unpublished rows are never deleted. 0 disables; malformed or negative falls back to 168h.cmd/wes/housekeeper.go:25

HTTP edge and telemetry​

VariableDefaultRequiredMeaningRead in
CORS_ALLOWED_ORIGINShttp://localhost:5173,http://localhost:5183noComma-separated browser origins allowed to call the REST API directly (the console shell's dev port and this repo's web/ remote dev port). Methods GET, POST, PUT, DELETE; headers Content-Type, Authorization, Idempotency-Key; no credentials.internal/adapters/inbound/http/router.go:89
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noOTLP/gRPC Collector endpoint for traces and metrics. Accepts bare host:port or a URL (http://host:4317). Nothing listening is not an error: exporters dial lazily and drop data.cmd/wes/main.go:94
OTEL_SERVICE_NAMEwes-work-planningnoservice.name resource attribute and the otelchi server name.cmd/wes/config.go:56
SERVICE_VERSIONdevnoservice.version resource attribute (the chart sets the image tag).cmd/wes/main.go:93
ENVIRONMENTlocalnodeployment.environment.name resource attribute.internal/adapters/outbound/telemetry/telemetry.go:54

cmd/mcp — MCP server (Streamable HTTP)​

cmd/mcp runs the same SampleBacklog, RebalanceDecision and ReleaseNextWork use cases as the REST API over the same OLTP database (ADR-0008). It never runs migrations, requires the same real Postgres and Kafka as cmd/wes (boot errors name the variable), never starts a Kafka consumer, never runs the outbox relay (the relay in cmd/wes drains every outbox row, whichever process wrote it) and never writes the classification copy. See MCP tools.

VariableDefaultRequiredMeaningRead in
MCP_ADDR:8090noListen address. The MCP endpoint is mounted at both / and /mcp; GET /healthz answers {"status":"ok"}.cmd/mcp/main.go:93
LOG_LEVELinfonoAs for cmd/wes.cmd/mcp/main.go:49
DATABASE_URL(none)yesOLTP Postgres DSN (the same database as cmd/wes, which must have migrated it). Unset or blank is the boot error DATABASE_URL is required; the MCP server has no stores of its own.cmd/mcp/main.go, cmd/mcp/config.go
EVENT_PUBLISHERkafkanoSame contract as cmd/wes: kafka (or unset) writes outbox rows that the cmd/wes relay drains; log and any other value are a boot error.cmd/mcp/config.go
KAFKA_BROKERS(none)yesUnset or blank is the boot error KAFKA_BROKERS is required. Opens writers only for the event encoders; no consumer.cmd/mcp/config.go
PRODUCT_CLASSIFICATION_MODEkafkanoUnset or kafka: reads the product_classification_copy table cmd/wes maintains (read-only). permissive, off, http and unknown values fail the boot.cmd/mcp/main.go, cmd/mcp/config.go
REPORTS_BASE_URL(unset)noBase URL of cmd/wes-reports. Set, the get_release_throughput_report tool is registered (10 s HTTP client timeout); unset, the tool does not exist. The chart points it at the release's reports Service when analytics.enabled=true.cmd/mcp/main.go:237
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noAs for cmd/wes.cmd/mcp/main.go:60
OTEL_SERVICE_NAMEwes-work-planning-mcpnoservice.name.cmd/mcp/main.go:55
SERVICE_VERSIONdevnoservice.version.cmd/mcp/main.go:59
ENVIRONMENTlocalnodeployment.environment.name.internal/adapters/outbound/telemetry/telemetry.go:54

cmd/wes-projector — analytics writer​

Consumes warehouse.wes.analytics under the fixed group wes-analytics and projects into the analytical database it owns (ADR-0011).

VariableDefaultRequiredMeaningRead in
ANALYTICS_DATABASE_URL(unset)yesRead-write DSN of the analytical database. Missing it exits with ANALYTICS_DATABASE_URL is required. Pool: MaxConns=5, statement_timeout=10s.cmd/wes-projector/main.go:70
ANALYTICS_MIGRATIONS_PATHmigrations/analyticsnoDirectory of the analytical *.up.sql files, applied at start and recorded in schema_migrations_analytics.cmd/wes-projector/main.go:75
KAFKA_BROKERS(none)yesBroker list. Unset or blank exits with KAFKA_BROKERS is required (there is no localhost:9092 default any more; ADR-0044). The projector always consumes.cmd/wes-projector/main.go
ADMIN_ADDR:8091noAdmin listener serving only GET /healthz.cmd/wes-projector/main.go:69
LOG_LEVELinfonoAlso accepts warning as a synonym of warn.cmd/wes-projector/main.go:47
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noAs above.cmd/wes-projector/main.go:56
OTEL_SERVICE_NAMEwes-projectornoservice.name.cmd/wes-projector/main.go:51
SERVICE_VERSIONdevnoservice.version.cmd/wes-projector/main.go:55
ENVIRONMENTlocalnodeployment.environment.name.internal/adapters/outbound/telemetry/telemetry.go:54

cmd/wes-reports — analytics reader​

Serves GET /reports/throughput and GET /reports/throughput/freshness read-only (see Release throughput report).

VariableDefaultRequiredMeaningRead in
ANALYTICS_DATABASE_URL(unset)yesDSN of the analytical database — use a read-only role. Every connection is additionally pinned to default_transaction_read_only=on; MaxConns=5, statement_timeout=15s. The chart feeds it the ANALYTICS_READER_DATABASE_URL secret key.cmd/wes-reports/main.go:63
HTTP_ADDR:8092noListen address.cmd/wes-reports/main.go:62
LOG_LEVELinfonoAlso accepts warning.cmd/wes-reports/main.go:40
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noAs above.cmd/wes-reports/main.go:49
OTEL_SERVICE_NAMEwes-reportsnoservice.name.cmd/wes-reports/main.go:44
SERVICE_VERSIONdevnoservice.version.cmd/wes-reports/main.go:48
ENVIRONMENTlocalnodeployment.environment.name.internal/adapters/outbound/telemetry/telemetry.go:54

cmd/a2a — A2A agent (JSON-RPC over HTTP)​

cmd/a2a serves the Agent2Agent protocol over the same use cases and the same OLTP database as the REST API (ADR-0046): the Agent Card at /.well-known/agent-card.json, the JSON-RPC endpoint at / and /a2a, and GET /healthz (cmd/a2a/main.go:276-279). It runs only on real Postgres and Kafka (ADR-0044): cmd/a2a/config.go reports every missing or rejected variable at once, each naming the variable, before anything is opened or bound. It never runs migrations, a Kafka consumer or the outbox relay: release_next_work writes WorkReleased to outbox_events and the relay in cmd/wes drains it. The chart deploys it only when a2a.enabled=true (off by default).

VariableDefaultRequiredMeaningRead in
A2A_ADDR:8093noListen address of the agent (Agent Card, JSON-RPC, /healthz). Chart value a2a.httpAddr.cmd/a2a/main.go:109
A2A_AGENT_URL(none)yesAbsolute http(s) URL of this agent's JSON-RPC endpoint, advertised on the Agent Card (e.g. http://<release>-a2a.<ns>.svc.cluster.local:8093/). Unset, blank, relative or schemeless is the boot error A2A_AGENT_URL is required / ... is not an absolute http(s) URL. The chart defaults it to the release's in-cluster Service DNS; set a2a.agentUrl to advertise another URL, such as a gateway path.cmd/a2a/main.go:104, cmd/a2a/config.go:64
DATABASE_URL(none)yesOLTP Postgres DSN (the database cmd/wes migrated). Unset or blank is the boot error DATABASE_URL is required.cmd/a2a/main.go:85, cmd/a2a/config.go
KAFKA_BROKERS(none)yesUnset or blank is the boot error KAFKA_BROKERS is required. Used only for the event encoders; the agent starts no consumer.cmd/a2a/main.go:96, cmd/a2a/config.go
EVENT_PUBLISHERkafkanoSame contract as cmd/wes: unset or kafka; log and any other value are a boot error. Chart value a2a.eventPublisher (empty inherits config.eventPublisher).cmd/a2a/config.go
PRODUCT_CLASSIFICATION_MODEkafkanoUnset or kafka: reads the product_classification_copy table cmd/wes maintains. Any other value fails the boot.cmd/a2a/main.go:91, cmd/a2a/config.go
LOG_LEVELinfonoAs for cmd/wes.cmd/a2a/main.go:56
OTEL_EXPORTER_OTLP_ENDPOINTlocalhost:4317noAs for cmd/wes.cmd/a2a/main.go:72
OTEL_SERVICE_NAMEwes-work-planning-a2anoservice.name.cmd/a2a/main.go:67
SERVICE_VERSIONdevnoservice.version, also the Agent Card version.cmd/a2a/main.go:71, cmd/a2a/main.go:105
ENVIRONMENTlocalnodeployment.environment.name.internal/adapters/outbound/telemetry/telemetry.go:54

Where the Helm chart sets them​

charts/wes-work-planning renders only part of this list natively; the rest reaches a container through extraEnv (api) or mcp.extraEnv (MCP).

The chart's env ConfigMap (templates/configmap.yaml: HTTP_ADDR, EVENT_PUBLISHER, OUTBOX_MAX_ATTEMPTS and KAFKA_BROKERS, always) is mounted into the api Deployment with envFrom: configMapRef (gap fix D14; explicit env entries win for the same key). The MCP, projector and reports Deployments do not mount it: they set their own env explicitly, and the ConfigMap's HTTP_ADDR is the api's listen address. charts/wes-work-planning/tests/render_test.sh (CI job chart-tests, make chart-test) asserts both.

Chart valueEnv var(s)Container
config.httpAddr, config.eventPublisher, config.logLevelHTTP_ADDR, EVENT_PUBLISHER (only kafka), LOG_LEVELapi (EVENT_PUBLISHER/LOG_LEVEL also MCP)
config.consumerGroup, config.productClassificationConsumerGroup, config.replenishmentConsumerGroup, config.packViewConsumerGroup (all required, defaults wes-work-planning, wes-work-planning-product-classification, wes-work-planning-replenishment, wes-work-planning-pack-view; all but the first are skipped when extraEnv already names the variable)KAFKA_CONSUMER_GROUP, PRODUCT_CLASSIFICATION_CONSUMER_GROUP, REPLENISHMENT_CONSUMER_GROUP, PACK_VIEW_CONSUMER_GROUP (explicit env entries of the api Deployment)api
config.outboxMaxAttempts (default 20)OUTBOX_MAX_ATTEMPTSapi
config.relocationCptHorizon (default 24h)RELOCATION_CPT_HORIZONapi
database.url / database.existingSecret + existingSecretKey (one is required; the render fails naming the value)DATABASE_URLapi, MCP
database.migrationsExistingSecretKey (optional: true)MIGRATIONS_DATABASE_URLapi
kafka.brokers (required; kafka.enabled: false fails the render)KAFKA_BROKERSapi, MCP, projector
pathCatalogue.enabled + pathCatalogue.mountPathPATH_CATALOGUE_FILEapi
otel.enabled, otel.endpoint, otel.serviceName, environment, image tagOTEL_EXPORTER_OTLP_ENDPOINT, OTEL_SERVICE_NAME, ENVIRONMENT, SERVICE_VERSIONall five (service names fixed per Deployment)
mcp.httpAddr, mcp.eventPublisher, mcp.reportsBaseUrlMCP_ADDR, EVENT_PUBLISHER, REPORTS_BASE_URLMCP
analytics.projector.adminAddr, analytics.migrationsPathADMIN_ADDR, ANALYTICS_MIGRATIONS_PATHprojector
analytics.reports.httpAddrHTTP_ADDRreports
a2a.httpAddr, a2a.agentUrl (empty = the release's in-cluster Service DNS), a2a.eventPublisherA2A_ADDR, A2A_AGENT_URL, EVENT_PUBLISHERa2a (only with a2a.enabled=true; also gets DATABASE_URL, KAFKA_BROKERS, LOG_LEVEL and, with otel.enabled, the telemetry variables; a2a.extraEnv adds the rest)
analytics.database.* (secret keys ANALYTICS_DATABASE_URL, ANALYTICS_READER_DATABASE_URL)ANALYTICS_DATABASE_URLprojector (writer key), reports (reader key)
extraEnveverything else (PATH_CATALOGUE_SOURCE, OUTBOX_RELAY_INTERVAL, housekeeping, CORS_ALLOWED_ORIGINS)api

In the kind cluster, warehouse-infra's terraform/locals.tf adds PRODUCT_CLASSIFICATION_MODE=kafka and PRODUCT_CLASSIFICATION_CONSUMER_GROUP=wes-work-planning-product-classification to the api container, and PRODUCT_CLASSIFICATION_MODE=kafka to the MCP container. It no longer sets TRAVEL_DISTANCE_MODE or FACILITY_LAYOUT_BASE_URL (ADR-0049; the chart's render test fails if its mirror of the infra values does).