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.ParseDurationstrings (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
| Variable | Default | Required | Meaning | Read in |
|---|---|---|---|---|
HTTP_ADDR | :8080 | no | Listen address of the REST API (and /healthz, /readyz). | cmd/wes/config.go:50 |
LOG_LEVEL | info | no | debug, info, warn or error (case-insensitive; anything else is info). JSON to stdout. | cmd/wes/main.go:31 |
DATABASE_URL | (none) | yes | OLTP 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_URL | value of DATABASE_URL | no | DSN 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_PATH | migrations | no | Directory 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
| Variable | Default | Required | Meaning | Read in |
|---|---|---|---|---|
EVENT_PUBLISHER | kafka | no | Kept 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) | yes | Comma-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) | yes | Group 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_INTERVAL | 1s | no | Sleep 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_ATTEMPTS | 20 | no | Outbox 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
| Variable | Default | Required | Meaning | Read in |
|---|---|---|---|---|
RELOCATION_CPT_HORIZON | 24h | no | Go 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_MODE | kafka | no | Unset 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) | yes | The 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_HORIZON | 8h | no | Go 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_HORIZON | 1h | no | Same 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
| Variable | Default | Required | Meaning | Read in |
|---|---|---|---|---|
PATH_CATALOGUE_SOURCE | file | no | file 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.yaml | yes, in file mode | Catalogue 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
| Variable | Default | Required | Meaning | Read in |
|---|---|---|---|---|
PRODUCT_CLASSIFICATION_MODE | kafka | no | Unset 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) | yes | Stable 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) | yes | Stable 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.
| Variable | Default | Required | Meaning | Read in |
|---|---|---|---|---|
HOUSEKEEPING_INTERVAL | 1h | no | Time between sweeps (the first sweep runs at startup). Malformed or non-positive falls back to 1h. | cmd/wes/housekeeper.go:23 |
IDEMPOTENCY_KEY_TTL | 24h | no | Age 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_RETENTION | 168h (7 days) | no | Age, 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
| Variable | Default | Required | Meaning | Read in |
|---|---|---|---|---|
CORS_ALLOWED_ORIGINS | http://localhost:5173,http://localhost:5183 | no | Comma-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_ENDPOINT | localhost:4317 | no | OTLP/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_NAME | wes-work-planning | no | service.name resource attribute and the otelchi server name. | cmd/wes/config.go:56 |
SERVICE_VERSION | dev | no | service.version resource attribute (the chart sets the image tag). | cmd/wes/main.go:93 |
ENVIRONMENT | local | no | deployment.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.
| Variable | Default | Required | Meaning | Read in |
|---|---|---|---|---|
MCP_ADDR | :8090 | no | Listen address. The MCP endpoint is mounted at both / and /mcp; GET /healthz answers {"status":"ok"}. | cmd/mcp/main.go:93 |
LOG_LEVEL | info | no | As for cmd/wes. | cmd/mcp/main.go:49 |
DATABASE_URL | (none) | yes | OLTP 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_PUBLISHER | kafka | no | Same 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) | yes | Unset 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_MODE | kafka | no | Unset 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) | no | Base 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_ENDPOINT | localhost:4317 | no | As for cmd/wes. | cmd/mcp/main.go:60 |
OTEL_SERVICE_NAME | wes-work-planning-mcp | no | service.name. | cmd/mcp/main.go:55 |
SERVICE_VERSION | dev | no | service.version. | cmd/mcp/main.go:59 |
ENVIRONMENT | local | no | deployment.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).
| Variable | Default | Required | Meaning | Read in |
|---|---|---|---|---|
ANALYTICS_DATABASE_URL | (unset) | yes | Read-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_PATH | migrations/analytics | no | Directory of the analytical *.up.sql files, applied at start and recorded in schema_migrations_analytics. | cmd/wes-projector/main.go:75 |
KAFKA_BROKERS | (none) | yes | Broker 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 | :8091 | no | Admin listener serving only GET /healthz. | cmd/wes-projector/main.go:69 |
LOG_LEVEL | info | no | Also accepts warning as a synonym of warn. | cmd/wes-projector/main.go:47 |
OTEL_EXPORTER_OTLP_ENDPOINT | localhost:4317 | no | As above. | cmd/wes-projector/main.go:56 |
OTEL_SERVICE_NAME | wes-projector | no | service.name. | cmd/wes-projector/main.go:51 |
SERVICE_VERSION | dev | no | service.version. | cmd/wes-projector/main.go:55 |
ENVIRONMENT | local | no | deployment.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).
| Variable | Default | Required | Meaning | Read in |
|---|---|---|---|---|
ANALYTICS_DATABASE_URL | (unset) | yes | DSN 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 | :8092 | no | Listen address. | cmd/wes-reports/main.go:62 |
LOG_LEVEL | info | no | Also accepts warning. | cmd/wes-reports/main.go:40 |
OTEL_EXPORTER_OTLP_ENDPOINT | localhost:4317 | no | As above. | cmd/wes-reports/main.go:49 |
OTEL_SERVICE_NAME | wes-reports | no | service.name. | cmd/wes-reports/main.go:44 |
SERVICE_VERSION | dev | no | service.version. | cmd/wes-reports/main.go:48 |
ENVIRONMENT | local | no | deployment.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).
| Variable | Default | Required | Meaning | Read in |
|---|---|---|---|---|
A2A_ADDR | :8093 | no | Listen address of the agent (Agent Card, JSON-RPC, /healthz). Chart value a2a.httpAddr. | cmd/a2a/main.go:109 |
A2A_AGENT_URL | (none) | yes | Absolute 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) | yes | OLTP 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) | yes | Unset 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_PUBLISHER | kafka | no | Same 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_MODE | kafka | no | Unset 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_LEVEL | info | no | As for cmd/wes. | cmd/a2a/main.go:56 |
OTEL_EXPORTER_OTLP_ENDPOINT | localhost:4317 | no | As for cmd/wes. | cmd/a2a/main.go:72 |
OTEL_SERVICE_NAME | wes-work-planning-a2a | no | service.name. | cmd/a2a/main.go:67 |
SERVICE_VERSION | dev | no | service.version, also the Agent Card version. | cmd/a2a/main.go:71, cmd/a2a/main.go:105 |
ENVIRONMENT | local | no | deployment.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 value | Env var(s) | Container |
|---|---|---|
config.httpAddr, config.eventPublisher, config.logLevel | HTTP_ADDR, EVENT_PUBLISHER (only kafka), LOG_LEVEL | api (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_ATTEMPTS | api |
config.relocationCptHorizon (default 24h) | RELOCATION_CPT_HORIZON | api |
database.url / database.existingSecret + existingSecretKey (one is required; the render fails naming the value) | DATABASE_URL | api, MCP |
database.migrationsExistingSecretKey (optional: true) | MIGRATIONS_DATABASE_URL | api |
kafka.brokers (required; kafka.enabled: false fails the render) | KAFKA_BROKERS | api, MCP, projector |
pathCatalogue.enabled + pathCatalogue.mountPath | PATH_CATALOGUE_FILE | api |
otel.enabled, otel.endpoint, otel.serviceName, environment, image tag | OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_SERVICE_NAME, ENVIRONMENT, SERVICE_VERSION | all five (service names fixed per Deployment) |
mcp.httpAddr, mcp.eventPublisher, mcp.reportsBaseUrl | MCP_ADDR, EVENT_PUBLISHER, REPORTS_BASE_URL | MCP |
analytics.projector.adminAddr, analytics.migrationsPath | ADMIN_ADDR, ANALYTICS_MIGRATIONS_PATH | projector |
analytics.reports.httpAddr | HTTP_ADDR | reports |
a2a.httpAddr, a2a.agentUrl (empty = the release's in-cluster Service DNS), a2a.eventPublisher | A2A_ADDR, A2A_AGENT_URL, EVENT_PUBLISHER | a2a (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_URL | projector (writer key), reports (reader key) |
extraEnv | everything 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).
Related pages
- Runbook — what each setting means for a deployment.
- Running locally — the minimal set for a laptop.
- Observability — what the telemetry variables produce.