@@ -33,7 +33,13 @@ MESSAGING_DRIVER=bullmq
3333# Leave unset to use ConsoleSpanExporter (dev mode — verbose, not suitable for production)
3434# OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318/v1/traces
3535
36- # Comma-separated list of agent IDs this worker node serves (required)
36+ # Process role for the single combined image (src/main/index.ts dispatches on it).
37+ # ROLE=gateway → HTTP / WebSocket / A2A / MCP front door only (no task-consuming actors)
38+ # ROLE=worker → loads the AGENT_IDS pool and wires real LLM-backed handlers
39+ # Unset defaults to "gateway". (ADR-013 gateway/worker split.)
40+ # ROLE=gateway
41+
42+ # Comma-separated list of agent IDs this worker node serves (required for ROLE=worker)
3743AGENT_IDS = researcher,writer,editor
3844
3945# LLM Configuration — Standard OpenAI OR OpenRouter (or any OpenAI-compatible API)
@@ -86,6 +92,7 @@ OPENAI_API_KEY=your_openai_api_key_here
8692
8793# ── Security: Redis password (recommended) ─────────────────────
8894# Set this to require a password on the Redis server (matches docker-compose.yml)
95+ # (compose-only) — consumed by docker-compose, not read directly by src/; fold it into REDIS_URL below.
8996# REDIS_PASSWORD=<random 32+ chars>
9097# When set, use: REDIS_URL=redis://:${REDIS_PASSWORD}@localhost:6379
9198
@@ -98,6 +105,36 @@ OPENAI_API_KEY=your_openai_api_key_here
98105# JWT secret for agent/orchestrator service tokens. When set, POST /a2a/rpc requires Bearer token.
99106# A2A_JWT_SECRET=<random 32+ bytes, base64-encoded>
100107
108+ # ── Federation: MCP server (Phase M — OFF by default) ──────────────────────────────────────
109+ # Exposes allow-listed Tools/Resources/Prompts + elicitation (HITL consent) over Streamable HTTP,
110+ # behind the gateway's security chain (rate-limit + the A2A_JWT_SECRET bearer above). See docs/federation/MCP.md.
111+ # ⚠ SECURITY: the MCP route is authenticated ONLY when A2A_JWT_SECRET (above) is set. If you enable
112+ # MCP in production WITHOUT A2A_JWT_SECRET, the MCP surface (dispatch_task + agent resources) is
113+ # UNAUTHENTICATED (still rate-limited + dispatch is elicitation-consent-gated). Set A2A_JWT_SECRET.
114+ # MCP_SERVER_ENABLED=false # master switch (default false)
115+ # MCP_SERVER_PATH=/mcp # mount path on the gateway
116+ # MCP_DISPATCH_CONSENT=true # require elicitation consent before dispatch_task (fail-closed)
117+ # Optional least-privilege allow-lists (CSV). Unset ⇒ the full curated set ships; empty ⇒ none of that kind.
118+ # MCP_ALLOWED_TOOLS=dispatch_task
119+ # MCP_ALLOWED_RESOURCES=agents,agent-status
120+ # MCP_ALLOWED_PROMPTS=delegate_task
121+
122+ # ── Economics / FinOps (Phase E — OFF by default) ──────────────────────────────────────────
123+ # Fleet-wide rate + cost control on top of per-task accounting (which is unchanged). 0 = unlimited.
124+ # See docs/economics/ECONOMICS.md. The per-task MAX_TOKEN_BUDGET above is separate and still applies.
125+ # ECONOMICS_ENABLED=false # master switch (default false)
126+ # ECONOMICS_MAX_REQUESTS_PER_WINDOW=0 # request-rate ceiling per scope (0 = unlimited)
127+ # ECONOMICS_MAX_COST_PER_WINDOW=0 # cost-unit budget per tenant/agent scope (0 = unlimited)
128+ # ECONOMICS_GLOBAL_COST_CEILING=0 # cost-unit ceiling across ALL scopes (0 = unlimited)
129+ # ECONOMICS_WINDOW_SECONDS=60 # sliding window length (seconds)
130+ # ECONOMICS_DEGRADE_THRESHOLD=0.75 # utilization at/above which to DEGRADE (run cheaper)
131+
132+ # ── Governance / Action Gate (Phase G — OFF by default) ────────────────────────────────────
133+ # Non-bypassable enforcement (firewall + breaker + cost + policy + kill-switch), hash-chained audit,
134+ # policy-as-code, agent registry/kill-switch, memory RBAC. See docs/governance/GOVERNANCE.md.
135+ # GOVERNANCE_ENABLED=false # master switch (default false → gate is a no-op allow)
136+ # GOVERNANCE_POLICIES_PATH=/etc/kaiban/policies.yml # optional policy-as-code file (see src/governance/policies.yml)
137+
101138# ── Security: Redis Channel Signing (optional, strongly recommended in production) ─────────
102139# HMAC-SHA256 secret for signing state events on Redis pub/sub. When set, fake state injection
103140# from anyone with Redis access is blocked.
@@ -109,13 +146,16 @@ OPENAI_API_KEY=your_openai_api_key_here
109146
110147# ── Telemetry: OTLP auth (optional) ────────────────────────────
111148# When using an authenticated OTLP collector, add an Authorization header:
149+ # (reserved — not yet wired in code; honored by the OTLP SDK env contract, not parsed by src/)
112150# OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer <token>
113151
114152# ── HITL Decision Options ───────────────────────────────────────
115153# Comma-separated list of valid human decisions for the HITL gate.
116154# The gateway validates incoming board decisions against this list.
117- # VIEW is informational only (re-prompts terminal); it does not resolve the gate.
118- VALID_HITL_DECISIONS = PUBLISH,REVISE,REJECT,VIEW
155+ # This matches the code default (src/main/config.ts). Do NOT add VIEW here:
156+ # VIEW is an interactive terminal-only action that re-prompts the orchestrator
157+ # prompt — it does not resolve the gate and is NOT a valid board/gateway decision.
158+ VALID_HITL_DECISIONS = PUBLISH,REVISE,REJECT
119159
120160# ── Agent Identity (set per-node process / container) ───────────
121161# Each agent node reads its own identity from AGENT_ID.
@@ -137,6 +177,11 @@ VALID_HITL_DECISIONS=PUBLISH,REVISE,REJECT,VIEW
137177#
138178AGENT_ID = researcher
139179
180+ # Public base URL advertised in the A2A AgentCard (/.well-known/agent-card.json).
181+ # Set this to the gateway's externally-reachable URL for federated deployments
182+ # behind a public hostname/proxy. Defaults to http://localhost:${PORT}.
183+ # A2A_PUBLIC_URL=https://agents.example.com
184+
140185# ── Example Orchestrator Vars (set in docker-compose or shell) ──
141186# These are only used by the example orchestrators, not the core library.
142187#
@@ -147,6 +192,11 @@ AGENT_ID=researcher
147192# WRITE_WAIT_MS=240000 # Timeout for write phase (ms)
148193# EDIT_WAIT_MS=300000 # Timeout for edit phase (ms)
149194#
195+ # WORKFLOW_ID — both example orchestrators read it to namespace the Redis
196+ # checkpoint (crash-safe resume). Unset → derived from the topic/context, so a
197+ # restart with the same input RESUMES; set a unique value to force a fresh run.
198+ # WORKFLOW_ID=my-run-001
199+ #
150200# Global Research orchestrator:
151201# GATEWAY_URL=http://localhost:3000 # Gateway HTTP endpoint
152202# QUERY=The Future of AI Agents # Research query
@@ -168,3 +218,9 @@ AGENT_TIMEOUT_MS=300000
168218# Max cumulative tokens per AgentStatePublisher instance before it raises an error.
169219# Use to cap LLM spend per agent process. 0 = unlimited (default).
170220MAX_TOKEN_BUDGET = 0
221+ # Workflow-level spend guard for the example orchestrators (checked between phases
222+ # and before each revision). Caps the WHOLE workflow's cumulative spend so a runaway
223+ # (e.g. repeated revisions) stops gracefully instead of draining the budget. The
224+ # example compose files default MAX_WORKFLOW_COST_USD to 0.50; 0 = unlimited.
225+ MAX_WORKFLOW_COST_USD = 0
226+ MAX_WORKFLOW_TOKENS = 0
0 commit comments