Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
docs(minikube): pulling is the default; document the tag and memory overrides
Jose Ramirez9ae73665de6b
diff --git a/.github/workflows/ci-public.yml b/.github/workflows/ci-public.ymlindex f20453b01..8edc9ee03 100644--- a/.github/workflows/ci-public.yml+++ b/.github/workflows/ci-public.yml@@ -369,6 +369,12 @@ jobs:- name: Test the minikube image verifier (recorded mode, E2E fixtures)run: bash scripts/tests/test-minikube-verify-images.sh+ # The ghcr path calls build-images.sh as --public-only, which builds+ # nothing. This proves it no longer narrates builds it never performs,+ # and that the local build path still announces every phase.+ - name: Test the build-images section banners+ run: bash scripts/tests/test-minikube-build-section-headers.sh+- name: Test minikube Makefile targetsrun: bash scripts/tests/test-minikube-makefile.shdiff --git a/README.md b/README.mdindex 792f5b631..1bb1ac4a5 100644--- a/README.md+++ b/README.md@@ -44,10 +44,29 @@ every service and a seeded agent named `chatllm`:git clone https://github.com/evenfire-ai/evenfire.git && cd evenfirecp .env.example .env# edit .env: set ADMIN_PASSWORD (required, no default ships) and ONE LLM key-make minikube-setup # first run ~5–10 min (image builds dominate); re-run safe-make minikube-status # wait for every deployment READY+MINIKUBE_IMAGE_TAG=latest make minikube-setup # see the note below on this override+make minikube-status # wait for every deployment READY```+**You do not build images.** `make minikube-setup` pulls them from+`ghcr.io/evenfire-ai`, which publishes `linux/amd64` and `linux/arm64`, so an+Apple Silicon Mac pulls a native image rather than compiling ~23 services.+Expect roughly 15 minutes on a cold cache — almost all of it network transfer —+and much less once the layers are local.++Two things a first run trips over:++- **`MINIKUBE_IMAGE_TAG=latest` is required today.** The cluster manifests pin+ the next release tag, which is not cut yet, so without the override the pull+ fails with a message naming this variable. Once that release is tagged and+ promoted, plain `make minikube-setup` works and this override goes away.+- **`MINIKUBE_MEMORY=9216`** if minikube fails to start. The default asks for+ 10240 MB, which exceeds a stock Docker Desktop memory ceiling.++To build locally instead — the old behaviour — use `make minikube-setup-local`+(or `IMAGE_SOURCE=local`). MCP servers are not part of either path: they are+installed on demand from the evenfire registry.+Then run the UIs from your workstation and say hello to the `chatllm` agent:```bash@@ -80,17 +99,17 @@ Evenfire is not just an agent runtime. It is nine first-class capabilities,each backed by code in this repo and declared as configuration. Each row linksto its deep dive.-| Capability | What you get | Deep dive |-| ---------- | ------------ | --------- |-| **Agents** | Real actions across Telegram / Email / Slack / desktop (`shell_exec`, HTTP, a real browser, files), plus memory and approval gates | [mcp-host](mcp-host/README.md) |-| **Console & client** | An admin **Control UI** console and an Electron **Desktop App**, plus a small Profile UI for invites | [surfaces](docs/surfaces/README.md) |-| **Connectors (MCP)** | Governed MCP servers with per-`Context` allowlists; stdio tools via the bridge; remote SaaS behind a pinned egress proxy | [mcp-servers](mcp-servers/README.md) |-| **Workflows** | Declarative multi-workload `WorkflowRecipe`s with a lifecycle: risk-based approval, shadow testing, rollback | [workflowrecipe](docs/crds/workflowrecipe.md) |-| **Plugins & registry** | Author, publish, and install connectors and recipes through a governed, trust-rated registry | [workflow-sdk](packages/workflow-sdk/README.md) |-| **Teams & access** | Profiles, teams, roles (admin / inviter / member), invitations, and session → scoped-RPC token brokerage | [external-rest-api](external-rest-api/README.md) |-| **Files** | Read-only team workspaces agents can draw on, plus a brokered, audited shared drive where every read and write is checked and logged | [gfs-controller](gfs-controller/README.md) |-| **Cost & governance** | Token budgets per scope (block/warn), usage and LLM-price accounting, and a connector-image allowlist | [token budgets](docs/how-to/token-budgets-and-usage.md) |-| **Config as code** | The whole fleet as eight `clerum.io` ([why that name?](docs/concepts/code-names.md)) CRDs: version-controlled, reviewable, GitOps-friendly | [crds](docs/crds/README.md) |+| Capability | What you get | Deep dive |+| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |+| **Agents** | Real actions across Telegram / Email / Slack / desktop (`shell_exec`, HTTP, a real browser, files), plus memory and approval gates | [mcp-host](mcp-host/README.md) |+| **Console & client** | An admin **Control UI** console and an Electron **Desktop App**, plus a small Profile UI for invites | [surfaces](docs/surfaces/README.md) |+| **Connectors (MCP)** | Governed MCP servers with per-`Context` allowlists; stdio tools via the bridge; remote SaaS behind a pinned egress proxy | [mcp-servers](mcp-servers/README.md) |+| **Workflows** | Declarative multi-workload `WorkflowRecipe`s with a lifecycle: risk-based approval, shadow testing, rollback | [workflowrecipe](docs/crds/workflowrecipe.md) |+| **Plugins & registry** | Author, publish, and install connectors and recipes through a governed, trust-rated registry | [workflow-sdk](packages/workflow-sdk/README.md) |+| **Teams & access** | Profiles, teams, roles (admin / inviter / member), invitations, and session → scoped-RPC token brokerage | [external-rest-api](external-rest-api/README.md) |+| **Files** | Read-only team workspaces agents can draw on, plus a brokered, audited shared drive where every read and write is checked and logged | [gfs-controller](gfs-controller/README.md) |+| **Cost & governance** | Token budgets per scope (block/warn), usage and LLM-price accounting, and a connector-image allowlist | [token budgets](docs/how-to/token-budgets-and-usage.md) |+| **Config as code** | The whole fleet as eight `clerum.io` ([why that name?](docs/concepts/code-names.md)) CRDs: version-controlled, reviewable, GitOps-friendly | [crds](docs/crds/README.md) |---@@ -142,29 +161,29 @@ A broad, growing set of providers behind one interface, from frontier labs tolocal models. Keys live in a Kubernetes Secret you create (dev mode: a singleenvironment variable; setup infers the matching provider).-| Provider | `provider` value | Integration |-| ----------------- | ---------------- | ----------------- |-| OpenAI | `openai` | Native SDK |-| Anthropic | `claude` | Native SDK |-| Z.AI | `zai` | OpenAI-compatible |-| Bailian | `bailian` | OpenAI-compatible |-| Google Vertex AI | `vertex` | Native SDK |-| Amazon Bedrock | `bedrock` | Native SDK |-| OpenRouter | `openrouter` | OpenAI-compatible |-| Google Gemini | `gemini` | OpenAI-compatible |-| DeepSeek | `deepseek` | OpenAI-compatible |-| Groq | `groq` | OpenAI-compatible |-| Together AI | `together` | OpenAI-compatible |-| Fireworks AI | `fireworks` | OpenAI-compatible |-| Mistral AI | `mistral` | OpenAI-compatible |-| xAI (Grok) | `xai` | OpenAI-compatible |-| Cerebras | `cerebras` | OpenAI-compatible |-| DeepInfra | `deepinfra` | OpenAI-compatible |-| Perplexity | `perplexity` | OpenAI-compatible |-| Moonshot (Kimi) | `moonshot` | OpenAI-compatible |-| Nebius | `nebius` | OpenAI-compatible |-| Novita AI | `novita` | OpenAI-compatible |-| Azure OpenAI | `azure` | Light driver |+| Provider | `provider` value | Integration |+| ---------------- | ---------------- | ----------------- |+| OpenAI | `openai` | Native SDK |+| Anthropic | `claude` | Native SDK |+| Z.AI | `zai` | OpenAI-compatible |+| Bailian | `bailian` | OpenAI-compatible |+| Google Vertex AI | `vertex` | Native SDK |+| Amazon Bedrock | `bedrock` | Native SDK |+| OpenRouter | `openrouter` | OpenAI-compatible |+| Google Gemini | `gemini` | OpenAI-compatible |+| DeepSeek | `deepseek` | OpenAI-compatible |+| Groq | `groq` | OpenAI-compatible |+| Together AI | `together` | OpenAI-compatible |+| Fireworks AI | `fireworks` | OpenAI-compatible |+| Mistral AI | `mistral` | OpenAI-compatible |+| xAI (Grok) | `xai` | OpenAI-compatible |+| Cerebras | `cerebras` | OpenAI-compatible |+| DeepInfra | `deepinfra` | OpenAI-compatible |+| Perplexity | `perplexity` | OpenAI-compatible |+| Moonshot (Kimi) | `moonshot` | OpenAI-compatible |+| Nebius | `nebius` | OpenAI-compatible |+| Novita AI | `novita` | OpenAI-compatible |+| Azure OpenAI | `azure` | Light driver |Most providers are OpenAI-compatible and plug in as config with no custom code;only a few (`claude`, `vertex`, `bedrock`, `azure`) need a dedicated integration.@@ -190,40 +209,40 @@ Contributor loop: [CONTRIBUTING.md](CONTRIBUTING.md).**Start here**-| Doc | For |-| ---------------------------------------------------------------------------------- | --------------------- |-| [docs/README.md](docs/README.md) | Docs index |-| [docs/get-started/learning-path.md](docs/get-started/learning-path.md) | Role-based path |-| [docs/concepts/why-evenfire.md](docs/concepts/why-evenfire.md) | Product intent |-| [docs/concepts/when-to-use-evenfire.md](docs/concepts/when-to-use-evenfire.md) | Fit by category |-| [docs/faq.md](docs/faq.md) | FAQ & troubleshooting |-| [ARCHITECTURE.md](ARCHITECTURE.md) | Architecture & data flow |-| [docs/crds/README.md](docs/crds/README.md) | Config as code (the 8 CRDs) |-| [docs/llms.txt](docs/llms.txt) | Map for coding agents |+| Doc | For |+| ------------------------------------------------------------------------------ | --------------------------- |+| [docs/README.md](docs/README.md) | Docs index |+| [docs/get-started/learning-path.md](docs/get-started/learning-path.md) | Role-based path |+| [docs/concepts/why-evenfire.md](docs/concepts/why-evenfire.md) | Product intent |+| [docs/concepts/when-to-use-evenfire.md](docs/concepts/when-to-use-evenfire.md) | Fit by category |+| [docs/faq.md](docs/faq.md) | FAQ & troubleshooting |+| [ARCHITECTURE.md](ARCHITECTURE.md) | Architecture & data flow |+| [docs/crds/README.md](docs/crds/README.md) | Config as code (the 8 CRDs) |+| [docs/llms.txt](docs/llms.txt) | Map for coding agents |**Components**: every deployable service has its own README (the deep dive):-| Component | Role |-| ---------------------------------------------------------------------------------------------- | ----------------------------------------------------- |-| [mcp-host](mcp-host/README.md) | Agent runtime: LLM loop, tools, approval gate |-| [channel-reader](channel-reader/README.md) | Telegram / Email / Slack ingress |-| [control-api](control-api/README.md) | Control plane: CRDs, secrets, token mint, usage |-| [control-ui](control-ui/README.md) | Admin dashboard |-| [profile-ui](profile-ui/README.md) | End-user profile and invitation confirmation |-| [desktop-app](desktop-app/README.md) | Electron + React desktop client |-| [external-rest-api](external-rest-api/README.md) | Auth, profiles, teams, RPC-token brokerage |-| [rpc-proxy](rpc-proxy/README.md) | External JWT-gated gateway for desktop/tenant traffic |-| [host-context-controller](host-context-controller/README.md) | Operator: CRDs → Deployments + NetworkPolicies |-| [workflow-recipes](workflow-recipes/README.md) | Operator: `WorkflowRecipe` lifecycle |-| [gfs-controller](gfs-controller/README.md) | Brokered `GlobalFileSystem` API + audit chain |-| [workspace-files-controller](workspace-files-controller/README.md) | `SharedFileSystem` write path |-| [mcp-proxy](mcp-proxy/README.md) | Optional centralized MCP router |-| [mcp-servers](mcp-servers/README.md) | Connector catalog (MongoDB, Airtable, …) |-| [stdio-bridge](stdio-bridge/README.md) | Sidecar: stdio MCP → StreamableHTTP |-| [nginx-egress-proxy](nginx-egress-proxy/README.md) | Pinned egress path for remote connectors |-| [webhook-gateway](webhook-gateway/README.md) | Per-recipe webhook signature verifier |-| [webhook-proxy](webhook-proxy/README.md) | Stateless public webhook router |-| [workflow-approval-request-reader](workflow-approval-request-reader/README.md) | Inbound Telegram/Slack approval callbacks |+| Component | Role |+| ------------------------------------------------------------------------------ | ----------------------------------------------------- |+| [mcp-host](mcp-host/README.md) | Agent runtime: LLM loop, tools, approval gate |+| [channel-reader](channel-reader/README.md) | Telegram / Email / Slack ingress |+| [control-api](control-api/README.md) | Control plane: CRDs, secrets, token mint, usage |+| [control-ui](control-ui/README.md) | Admin dashboard |+| [profile-ui](profile-ui/README.md) | End-user profile and invitation confirmation |+| [desktop-app](desktop-app/README.md) | Electron + React desktop client |+| [external-rest-api](external-rest-api/README.md) | Auth, profiles, teams, RPC-token brokerage |+| [rpc-proxy](rpc-proxy/README.md) | External JWT-gated gateway for desktop/tenant traffic |+| [host-context-controller](host-context-controller/README.md) | Operator: CRDs → Deployments + NetworkPolicies |+| [workflow-recipes](workflow-recipes/README.md) | Operator: `WorkflowRecipe` lifecycle |+| [gfs-controller](gfs-controller/README.md) | Brokered `GlobalFileSystem` API + audit chain |+| [workspace-files-controller](workspace-files-controller/README.md) | `SharedFileSystem` write path |+| [mcp-proxy](mcp-proxy/README.md) | Optional centralized MCP router |+| [mcp-servers](mcp-servers/README.md) | Connector catalog (MongoDB, Airtable, …) |+| [stdio-bridge](stdio-bridge/README.md) | Sidecar: stdio MCP → StreamableHTTP |+| [nginx-egress-proxy](nginx-egress-proxy/README.md) | Pinned egress path for remote connectors |+| [webhook-gateway](webhook-gateway/README.md) | Per-recipe webhook signature verifier |+| [webhook-proxy](webhook-proxy/README.md) | Stateless public webhook router |+| [workflow-approval-request-reader](workflow-approval-request-reader/README.md) | Inbound Telegram/Slack approval callbacks |Ops & platform directories:@@ -252,4 +271,4 @@ The code uses the internal name clerum for the same project (`clerum.io` CRDs,- **[CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)**: community standardsEvenfire is **open source** under the [Mozilla Public License 2.0](LICENSE)-(MPL-2.0), an OSI-approved, file-level copyleft license.+(MPL-2.0), an OSI-approved, file-level copyleft license.diff --git a/docs/deploy/minikube.md b/docs/deploy/minikube.mdindex dabb2a0ad..424c37cd8 100644--- a/docs/deploy/minikube.md+++ b/docs/deploy/minikube.md@@ -59,11 +59,41 @@ Ready before E2E results are interpreted.## Full Setup (First Time — from scratch)```bash-make minikube-setup # Single command: cluster → namespaces → CRDs → keys → secrets → images → deploy → verify-make minikube-status # Confirm all services after setup+MINIKUBE_IMAGE_TAG=latest make minikube-setup # cluster → namespaces → CRDs → keys → secrets → images → deploy → verify+make minikube-status # Confirm all services after setup```-This takes 5-10 minutes on first run (image build is the slowest part). The script is idempotent — safe to run again if interrupted or if something fails.+The script is idempotent — safe to run again if interrupted or if something fails.++### Images are pulled, not built++`make minikube-setup` builds nothing. It pulls every service image from+`ghcr.io/evenfire-ai`, published for `linux/amd64` and `linux/arm64`, so an+Apple Silicon machine gets a native image without compiling anything. A cold+run is roughly 15 minutes, dominated by network transfer; a warm cache is far+quicker.++`make minikube-setup-local` (equivalently `IMAGE_SOURCE=local`) restores the+previous build-everything behaviour.++MCP servers are no longer loaded into the cluster at setup. They are+distributed through the evenfire registry and installed on demand.++### Two overrides a first run needs++**`MINIKUBE_IMAGE_TAG=latest`** — required until the next release is tagged.+The ghcr component pins that release tag, and the images for it are created by+promotion _on_ the tag, so the pin names something that does not exist yet.+Without the override the pull fails with an explicit message naming the image,+the tag, and this variable — not a raw `MANIFEST_UNKNOWN`. After the release is+cut and promoted, drop the override.++**`MINIKUBE_MEMORY=9216`** — if minikube fails to start. The default requests+10240 MB, which is above a stock Docker Desktop ceiling.++A tag is never re-pointed to fix a bad release; recovery is forward. If a+release is broken, `MINIKUBE_IMAGE_TAG=<next-patch>` is the interim answer+while the fix ships.After rebasing or syncing with `dev`, do not assume the running cluster is fresh.Run the pre-gate sync before cluster-backed E2E so images, CRDs, manifests,@@ -239,12 +269,12 @@ Desktop App### Critical Invariants-| Invariant | Description |-| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| **Same RSA key** | `rpc-proxy-secrets.RPC_PROXY_JWT_PUBLIC_KEY` == `mcp-host-config.CLERUM_AUTH_JWT_PUBLIC_KEY` == public pair of `control-api-secrets.CONTROL_API_RPC_JWT_PRIVATE_KEY`. `scripts/minikube/generate-keys.sh` writes the two Secrets into `deploy/minikube/secrets/jwt-signing-keys.yaml`; the ConfigMap value is **not** in that manifest — `scripts/minikube/sync-auth-key.sh` copies the public key from the live `rpc-proxy-secrets` Secret into the live `mcp-host-config` ConfigMap. |-| **Token stops at rpc-proxy** | The RPC token (`aud: "rpc-proxy"`) is validated by rpc-proxy and is NOT forwarded. `/v1/runtime/*` routes on mcp-host are wrapped in `runtimeEdgeGuard`, which returns `401 Authorization is not accepted on this direct mcp-host runtime route` if an `Authorization` header is present. |-| **Issuer** | All RPC tokens have `iss: "control-api"`. mcp-host must have `CLERUM_AUTH_JWT_ISSUER=control-api` |-| **Edge headers** | `rpc-proxy/src/services/controlApiRestService.ts` returns `headers: {}` on purpose; `mcpProxyService.ts` then adds `x-clerum-edge-caller: rpc-proxy`, `x-clerum-edge-host-ref`, `x-clerum-edge-user-id`. Adding an `Authorization` header here would make every mcp-host call fail 401. |+| Invariant | Description |+| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| **Same RSA key** | `rpc-proxy-secrets.RPC_PROXY_JWT_PUBLIC_KEY` == `mcp-host-config.CLERUM_AUTH_JWT_PUBLIC_KEY` == public pair of `control-api-secrets.CONTROL_API_RPC_JWT_PRIVATE_KEY`. `scripts/minikube/generate-keys.sh` writes the two Secrets into `deploy/minikube/secrets/jwt-signing-keys.yaml`; the ConfigMap value is **not** in that manifest — `scripts/minikube/sync-auth-key.sh` copies the public key from the live `rpc-proxy-secrets` Secret into the live `mcp-host-config` ConfigMap. |+| **Token stops at rpc-proxy** | The RPC token (`aud: "rpc-proxy"`) is validated by rpc-proxy and is NOT forwarded. `/v1/runtime/*` routes on mcp-host are wrapped in `runtimeEdgeGuard`, which returns `401 Authorization is not accepted on this direct mcp-host runtime route` if an `Authorization` header is present. |+| **Issuer** | All RPC tokens have `iss: "control-api"`. mcp-host must have `CLERUM_AUTH_JWT_ISSUER=control-api` |+| **Edge headers** | `rpc-proxy/src/services/controlApiRestService.ts` returns `headers: {}` on purpose; `mcpProxyService.ts` then adds `x-clerum-edge-caller: rpc-proxy`, `x-clerum-edge-host-ref`, `x-clerum-edge-user-id`. Adding an `Authorization` header here would make every mcp-host call fail 401. |### Required Configuration Per Service@@ -436,10 +466,10 @@ there) cannot read the public key and all workflow JWTs fail with `401 Invalid t### Workflow Env Vars-| Variable | Value in base manifest | Usage |-| -------------------------- | ---------------------------------- | ------------------------------------------ |-| `CLERUM_COORDINATOR_IMAGE` | `clerum/workflow-coordinator:0.9.5` | Coordinator pod image |-| `CLERUM_MCP_HOST_IMAGE` | `clerum/mcp-host:0.9.5` | mcp_host image injected into workflows |+| Variable | Value in base manifest | Usage |+| -------------------------- | ------------------------------------------ | ------------------------------------------ |+| `CLERUM_COORDINATOR_IMAGE` | `clerum/workflow-coordinator:0.9.5` | Coordinator pod image |+| `CLERUM_MCP_HOST_IMAGE` | `clerum/mcp-host:0.9.5` | mcp_host image injected into workflows || `CLERUM_WRC_SERVICE_NAME` | not set (code fallback `workflow-recipes`) | Service name for coordinator DNS callbacks |The first two are set in `deploy/base/control-plane/workflow-recipes.yaml` (lines@@ -857,27 +887,27 @@ make minikube-restart-all # Restart all pods to pick up new keys## Known Issues and Solutions-| Symptom | Cause | Solution |-| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |-| `401: "Invalid token"` from chatllm | Only the two bearer routes (`GET /v1/runtime/sessions/search`, `POST /v1/runtime/compact`) can emit this — `requireScope` rejected the RS256 token (expired, wrong issuer, or wrong audience). The SSE poll of `/v1/runtime/status` carries no bearer token and cannot produce it. | Verify `CLERUM_AUTH_JWT_ISSUER=control-api` and `CLERUM_AUTH_JWT_AUDIENCE=rpc-proxy` in mcp-host-config, and that the public key matches. Restart chatllm. |-| `401: "Authorization is not accepted on this direct mcp-host runtime route"` | Something added an `Authorization` header to a `/v1/runtime/*` call. `controlApiRestService.ts` returns `headers: {}` on purpose | Do not forward the RPC token to mcp-host. Runtime calls must carry only the `x-clerum-edge-*` headers |-| `401: "Missing runtime edge caller context"` from chatllm | Call reached mcp-host without a valid `x-clerum-edge-caller` (must be `rpc-proxy`, `channel-reader` or `workflow-approval-request-reader`) | Call through rpc-proxy instead of hitting mcp-host directly |-| `401: "Invalid token"` in rpc-proxy when opening stream | Session token expired in Desktop App | Close and reopen the app, do logout/login |-| `403: "Forbidden: user cannot access this host"` | hostRef does not match what is authorized in control-api, or the Host CRD does not exist | Verify `kubectl get host chatllm -n mcp-host`, verify host assignment to team |-| Pod in `ImagePullBackOff` | Image not loaded in minikube | `make minikube-build-images` |-| Port forward dropped after pod restart | Kubernetes closes the tunnel when the pod restarts | `make minikube-pf-desktop` |-| `409 Conflict` on first setup | Previous data in postgres | `make minikube-db-reset` |-| SSE stream closes with `"auth-expired"` | mcp-host rejected 3 consecutive `/v1/runtime/status` polls with 401/403. Those polls carry only `x-clerum-edge-*` headers (no bearer token), so this is an edge-guard/host-access rejection, not RPC-token expiry. | The Desktop App clears its token cache and reconnects automatically. If it repeats, check chatllm logs for `Missing runtime edge caller context` / `Runtime edge host mismatch`. |-| **Workflow** — `WRC returned 404 on GET status` | Stale rollout, old WRC, or a legacy recipe CRD outside `sandbox-recipes` | Run the clean pre-gate sync, verify `kubectl get workflowrecipes -n sandbox-recipes`, and delete any legacy `workflowrecipes` in `mcp-server`. |-| **Workflow** — `Failed to connect to MCP servers` | NP-01: incorrect egress label (`{workloadId}` instead of `{recipeName}-{workloadId}`) or NP-02: missing ingress in `mcp-server` | List the recipe's NPs with `kubectl get netpol -n sandbox-recipes` and `-n mcp-server`. Reset workflow. |-| **Workflow** — step aborts early with `AbortError` on `/execute` | The step's own timeout elapsed. `/execute` is aborted at `timeoutSeconds * 1000 + 5000` ms (`packages/workflow-runtime-core/src/mcp-host-client/client.ts`) | Raise the step's `timeoutSeconds` (max 5400) or `MCP_HOST_STEP_TIMEOUT_SECONDS`; the buffer on top of the step timeout is only 5s. |-| **Workflow** — step timeout at 300s (no explicit error) | NP-03: missing egress NP for external LLM (ports 443/80) | Reset workflow + verify NP `{name}-mcp-host-to-llm-api` exists in `sandbox-recipes`. |-| **Workflow** — `401` in coordinator when reporting status | Coordinator JWT token expired (WRC restarted or token TTL expired) | Delete Secret `wf-{name}-coordinator-token` + pods + reset status. See "Full Workflow Reset" section. |-| **Workflow** — CRD phase stuck on `deploying` | Bug fixed in `workflowReconciler.ts`. Ensure updated WRC image. | `kubectl rollout restart deployment/workflow-recipes -n control-plane` |-| **Workflow** — `{{inputs.topic}}` in instruction (literal) | The reconciler did not execute `resolveInputs()` before the early return | Updated WRC image fixes this. Delete workflow ConfigMap + reset. |-| **Workflow** — step does not receive data from previous step | Missing `{{stepId:output}}` in the instruction (common in old templates) | Edit the step instruction in the CRD. `dependsOn` does not inject data. |-| `field is immutable` on PVC when applying manifests | `storageRequest` changed in manifest for existing PVC | `bash scripts/minikube/ensure-pvcs.sh` before `kubectl apply` |-| `clerum-wrc-public-key not found` in coordinator logs | Public key ConfigMap does not exist in `sandbox-recipes` | `FORCE_REGEN=true make minikube-gen-keys` — plain `minikube-gen-keys` skips (and writes nothing) once `control-api-secrets` exists |+| Symptom | Cause | Solution |+| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| `401: "Invalid token"` from chatllm | Only the two bearer routes (`GET /v1/runtime/sessions/search`, `POST /v1/runtime/compact`) can emit this — `requireScope` rejected the RS256 token (expired, wrong issuer, or wrong audience). The SSE poll of `/v1/runtime/status` carries no bearer token and cannot produce it. | Verify `CLERUM_AUTH_JWT_ISSUER=control-api` and `CLERUM_AUTH_JWT_AUDIENCE=rpc-proxy` in mcp-host-config, and that the public key matches. Restart chatllm. |+| `401: "Authorization is not accepted on this direct mcp-host runtime route"` | Something added an `Authorization` header to a `/v1/runtime/*` call. `controlApiRestService.ts` returns `headers: {}` on purpose | Do not forward the RPC token to mcp-host. Runtime calls must carry only the `x-clerum-edge-*` headers |+| `401: "Missing runtime edge caller context"` from chatllm | Call reached mcp-host without a valid `x-clerum-edge-caller` (must be `rpc-proxy`, `channel-reader` or `workflow-approval-request-reader`) | Call through rpc-proxy instead of hitting mcp-host directly |+| `401: "Invalid token"` in rpc-proxy when opening stream | Session token expired in Desktop App | Close and reopen the app, do logout/login |+| `403: "Forbidden: user cannot access this host"` | hostRef does not match what is authorized in control-api, or the Host CRD does not exist | Verify `kubectl get host chatllm -n mcp-host`, verify host assignment to team |+| Pod in `ImagePullBackOff` | Image not loaded in minikube | `make minikube-build-images` |+| Port forward dropped after pod restart | Kubernetes closes the tunnel when the pod restarts | `make minikube-pf-desktop` |+| `409 Conflict` on first setup | Previous data in postgres | `make minikube-db-reset` |+| SSE stream closes with `"auth-expired"` | mcp-host rejected 3 consecutive `/v1/runtime/status` polls with 401/403. Those polls carry only `x-clerum-edge-*` headers (no bearer token), so this is an edge-guard/host-access rejection, not RPC-token expiry. | The Desktop App clears its token cache and reconnects automatically. If it repeats, check chatllm logs for `Missing runtime edge caller context` / `Runtime edge host mismatch`. |+| **Workflow** — `WRC returned 404 on GET status` | Stale rollout, old WRC, or a legacy recipe CRD outside `sandbox-recipes` | Run the clean pre-gate sync, verify `kubectl get workflowrecipes -n sandbox-recipes`, and delete any legacy `workflowrecipes` in `mcp-server`. |+| **Workflow** — `Failed to connect to MCP servers` | NP-01: incorrect egress label (`{workloadId}` instead of `{recipeName}-{workloadId}`) or NP-02: missing ingress in `mcp-server` | List the recipe's NPs with `kubectl get netpol -n sandbox-recipes` and `-n mcp-server`. Reset workflow. |+| **Workflow** — step aborts early with `AbortError` on `/execute` | The step's own timeout elapsed. `/execute` is aborted at `timeoutSeconds * 1000 + 5000` ms (`packages/workflow-runtime-core/src/mcp-host-client/client.ts`) | Raise the step's `timeoutSeconds` (max 5400) or `MCP_HOST_STEP_TIMEOUT_SECONDS`; the buffer on top of the step timeout is only 5s. |+| **Workflow** — step timeout at 300s (no explicit error) | NP-03: missing egress NP for external LLM (ports 443/80) | Reset workflow + verify NP `{name}-mcp-host-to-llm-api` exists in `sandbox-recipes`. |+| **Workflow** — `401` in coordinator when reporting status | Coordinator JWT token expired (WRC restarted or token TTL expired) | Delete Secret `wf-{name}-coordinator-token` + pods + reset status. See "Full Workflow Reset" section. |+| **Workflow** — CRD phase stuck on `deploying` | Bug fixed in `workflowReconciler.ts`. Ensure updated WRC image. | `kubectl rollout restart deployment/workflow-recipes -n control-plane` |+| **Workflow** — `{{inputs.topic}}` in instruction (literal) | The reconciler did not execute `resolveInputs()` before the early return | Updated WRC image fixes this. Delete workflow ConfigMap + reset. |+| **Workflow** — step does not receive data from previous step | Missing `{{stepId:output}}` in the instruction (common in old templates) | Edit the step instruction in the CRD. `dependsOn` does not inject data. |+| `field is immutable` on PVC when applying manifests | `storageRequest` changed in manifest for existing PVC | `bash scripts/minikube/ensure-pvcs.sh` before `kubectl apply` |+| `clerum-wrc-public-key not found` in coordinator logs | Public key ConfigMap does not exist in `sandbox-recipes` | `FORCE_REGEN=true make minikube-gen-keys` — plain `minikube-gen-keys` skips (and writes nothing) once `control-api-secrets` exists |---diff --git a/scripts/minikube/build-images.sh b/scripts/minikube/build-images.shindex 178bd26d3..6a15c7bf7 100755--- a/scripts/minikube/build-images.sh+++ b/scripts/minikube/build-images.sh@@ -535,6 +535,22 @@ if [ "$PUBLIC_ONLY" = true ]; thenONLY_SVC="__none__"fi+# Section banner for the build phases below.+#+# On the default IMAGE_SOURCE=ghcr path, full-setup.sh calls this script as+# `--public-only`, which forces ONLY_SVC to a sentinel that matches no image:+# every build_image call below returns without building. Printing+# "=== Building Core Services ===" there tells a developer watching the setup+# that 28 images are being built when none are, which is the exact confusion+# the pull-by-default work exists to remove. Suppress the banners on the path+# that builds nothing.+build_section() {+ if [ "$PUBLIC_ONLY" = true ]; then+ return 0+ fi+ echo -e "\n${BOLD}=== $1 ===${NC}"+}+# ---- Build function ----build_image() {local name=$1 dir=$2 tag=$3 dockerfile=${4:-""}@@ -634,7 +650,7 @@ reuse_image_as_tag() {# ---- Build all services -----echo -e "\n${BOLD}=== Building Core Services ===${NC}"+build_section "Building Core Services"build_image "hcc" \"${PROJECT_DIR}" \@@ -741,7 +757,7 @@ build_image "workspace-files-controller" \"${PROJECT_DIR}/workspace-files-controller" \"clerum/workspace-files-controller:test"-echo -e "\n${BOLD}=== Building UI Services ===${NC}"+build_section "Building UI Services"if [ "$SKIP_UIS" = true ]; thenwarn "Skipping Control UI, Profile UI, and Desktop App image builds (--skip-uis)."@@ -777,7 +793,7 @@ fi# ref must already be in the daemon. full-setup.sh# sets MINIKUBE_BUILD_AIRTABLE_MCP_IMAGE for exactly# that branch and nothing else.-echo -e "\n${BOLD}=== Building MCP Servers ===${NC}"+build_section "Building MCP Servers"if [ "$MINIKUBE_BUILD_AIRTABLE_MCP_IMAGE" = "true" ]; thenbuild_image "airtable-mcp" \@@ -801,7 +817,7 @@ elsewarn "Skipping optional Playwright MCP local image. The default minikube overlay does not deploy clerum/playwright-mcp-server:test; GKE publishes this image as playwright-server:<tag>."fi-echo -e "\n${BOLD}=== Building Test Fixtures ===${NC}"+build_section "Building Test Fixtures"build_image "mock-mcp" \"${PROJECT_DIR}/tests/e2e/fixtures/mock-mcp-server" \@@ -912,9 +928,17 @@ fiok "Manifest: deploy/minikube/.image-manifest.json"# ---- Summary -----echo -e "\n${BOLD}=== Build Summary ===${NC}"+# Same reason as build_section: on the --public-only (IMAGE_SOURCE=ghcr) path+# nothing was built, so "All images built" is a false report of the run.+if [ "$PUBLIC_ONLY" = true ]; then+ echo -e "\n${BOLD}=== Public Image Summary ===${NC}"+else+ echo -e "\n${BOLD}=== Build Summary ===${NC}"+fiif [ ${#FAILED_IMAGES[@]} -eq 0 ]; then- if [ "$MINIKUBE_MULTI_NODE" = true ]; then+ if [ "$PUBLIC_ONLY" = true ]; then+ echo -e "${GREEN}${BOLD}Public third-party images loaded into minikube '${PROFILE}'. No images were built.${NC}"+ elif [ "$MINIKUBE_MULTI_NODE" = true ]; thenecho -e "${GREEN}${BOLD}All images built and loaded into multi-node minikube '${PROFILE}'.${NC}"elseecho -e "${GREEN}${BOLD}All images built directly in minikube '${PROFILE}' (no transfer needed).${NC}"diff --git a/scripts/tests/test-minikube-build-section-headers.sh b/scripts/tests/test-minikube-build-section-headers.shnew file mode 100755index 000000000..3a7b77133--- /dev/null+++ b/scripts/tests/test-minikube-build-section-headers.sh@@ -0,0 +1,297 @@+#!/usr/bin/env bash+set -u+FAIL=0++# On the default IMAGE_SOURCE=ghcr path, full-setup.sh runs+# `build-images.sh --public-only`, which loads the public third-party images+# (postgres, redis, nginx, ...) and builds NOTHING: --public-only forces+# ONLY_SVC to a sentinel that matches no image, so every build_image call is a+# no-op.+#+# It still printed the four build banners ("=== Building Core Services ===",+# "=== Building UI Services ===", "=== Building MCP Servers ===",+# "=== Building Test Fixtures ===") and closed with "All images built directly+# in minikube". Observed on a real 15-minute run: a developer watching the pull+# path is told the setup is building 28 images while it builds none, which is+# the exact confusion the pull-by-default work exists to remove.+#+# Every case runs the REAL script against PATH stubs for docker/minikube/+# kubectl (same technique as scripts/tests/test-minikube-verify-images.sh), so+# nothing here needs a cluster or a network. The two modes are compared against+# each other, not against source text: --public-only must be silent about+# building AND must build nothing, while an ordinary build run must print every+# banner AND actually invoke `docker build`. Inverting the suppression+# condition fails one direction or the other.++REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"++pass() { echo "PASS: $1"; }+fail() { echo "FAIL: $1"; FAIL=1; }++# The build phases under test, named exactly as the script names them. Kept as+# one list so a new phase added without a build_section() wrapper is caught by+# the same assertions. The banner is "=== <phase> ===".+BUILD_PHASES=(+ "Building Core Services"+ "Building UI Services"+ "Building MCP Servers"+ "Building Test Fixtures"+)++make_stubs() {+ local d=$1+ mkdir -p "$d/bin"+ cat > "$d/bin/minikube" <<'STUB'+#!/usr/bin/env bash+printf 'minikube %s\n' "$*" >>"${TEST_LOG_FILE:?}"+case "$*" in+ *docker-env*) echo 'export DOCKER_HOST="tcp://127.0.0.1:2376"'; exit 0 ;;+ *"image ls"*--format=json*) cat "${TEST_PRESENT_JSON:?}"; exit 0 ;;+esac+exit 0+STUB+ cat > "$d/bin/kubectl" <<'STUB'+#!/usr/bin/env bash+case "$*" in+ *"get nodes"*) echo "minikube Ready control-plane 1d v1.30.0"; exit 0 ;;+esac+exit 0+STUB+ cat > "$d/bin/docker" <<'STUB'+#!/usr/bin/env bash+printf 'docker %s\n' "$*" >>"${TEST_LOG_FILE:?}"+case "${1:-}" in+ inspect) echo "sha256:deadbeef0000cafedeadbeef0000cafedeadbeef" ;;+ # Empty: the host daemon holds no public image yet, so the public-image loop+ # takes its `docker pull` branch instead of "already present -- skipping".+ # That is the branch --public-only exists to run.+ images) : ;;+esac+exit 0+STUB+ chmod +x "$d/bin/minikube" "$d/bin/kubectl" "$d/bin/docker"+}++# An isolated PROJECT_DIR that is a copy of the real repo's deploy/ + scripts/,+# so the script under test is the real one and reads the real manifest.+prepare_repo() {+ local d=$1+ make_stubs "$d"+ mkdir -p "$d/repo"+ cp -R "$REPO_ROOT/deploy" "$d/repo/deploy"+ cp -R "$REPO_ROOT/scripts" "$d/repo/scripts"+ rm -rf "$d/repo/deploy/minikube"+ # An empty daemon inventory. Every base/public image then takes the "pull it"+ # branch, which is the slower path through the script and therefore the one+ # most likely to print something unexpected.+ printf '[]' > "$d/present.json"+}++# Runs the real script and leaves its stdout+stderr in $RUN_OUT and its exit+# code in $RUN_RC. `rc=$?` is on its own line on purpose: putting the capture+# in the same statement as a later command substitution resets $?.+RUN_OUT=""+RUN_RC=0+run_build() {+ local d=$1; shift+ : > "$d/ops.log"+ RUN_OUT="$(PATH="$d/bin:$PATH" \+ TEST_LOG_FILE="$d/ops.log" \+ TEST_PRESENT_JSON="$d/present.json" \+ bash "$d/repo/scripts/minikube/build-images.sh" "$@" 2>&1)"+ RUN_RC=$?+}++# What the run actually did, read from the stub call log rather than from the+# script's own narration. This is what makes the banner assertions meaningful:+# "prints no build banner" only matters if the same run also built nothing.+docker_build_count() {+ local d=$1+ grep -c '^docker build ' "$d/ops.log" || true+}++banners_present() {+ local out=$1 phase found=""+ for phase in "${BUILD_PHASES[@]}"; do+ if grep -qF "=== ${phase} ===" <<< "$out"; then+ found+="${phase}; "+ fi+ done+ printf '%s' "$found"+}++banners_absent() {+ local out=$1 phase missing=""+ for phase in "${BUILD_PHASES[@]}"; do+ if ! grep -qF "=== ${phase} ===" <<< "$out"; then+ missing+="${phase}; "+ fi+ done+ printf '%s' "$missing"+}++# ---------------------------------------------------------------------------+# The defect: the ghcr path announced builds it never performed+# ---------------------------------------------------------------------------++# The headline case. --public-only is exactly how full-setup.sh invokes this+# script when IMAGE_SOURCE=ghcr.+assert_the_public_only_run_prints_no_build_banner() {+ local d shown+ d="$(mktemp -d)"+ prepare_repo "$d"+ run_build "$d" --public-only+ shown="$(banners_present "$RUN_OUT")"+ if [ "$RUN_RC" -eq 0 ] && [ -z "$shown" ]; then+ pass "--public-only prints no 'Building ...' section banner"+ else+ fail "--public-only announced builds (rc=$RUN_RC): ${shown:-none} :: $RUN_OUT"+ fi+ rm -rf "$d"+}++# The other half of the same claim, and the reason the case above is not+# vacuous: the run that printed nothing about building also built nothing.+assert_the_public_only_run_really_builds_nothing() {+ local d builds+ d="$(mktemp -d)"+ prepare_repo "$d"+ run_build "$d" --public-only+ builds="$(docker_build_count "$d")"+ if [ "$RUN_RC" -eq 0 ] && [ "$builds" -eq 0 ]; then+ pass "--public-only invokes 'docker build' zero times"+ else+ fail "expected no docker build on the ghcr path; got rc=$RUN_RC, $builds builds"+ fi+ rm -rf "$d"+}++# --public-only is not a no-op run that trivially prints nothing: it still does+# the work it exists for. Without this, deleting the whole tail of the script+# would pass every case above.+assert_the_public_only_run_still_loads_the_public_images() {+ local d+ d="$(mktemp -d)"+ prepare_repo "$d"+ run_build "$d" --public-only+ if [ "$RUN_RC" -eq 0 ] \+ && grep -qF '=== Loading Public Images ===' <<< "$RUN_OUT" \+ && grep -q "^docker pull postgres:16-alpine$" "$d/ops.log"; then+ pass "--public-only still loads the public third-party images"+ else+ fail "--public-only stopped doing its real work (rc=$RUN_RC): $RUN_OUT"+ fi+ rm -rf "$d"+}++# The summary line is part of the same false report: "All images built directly+# in minikube" was the last thing the ghcr path printed.+assert_the_public_only_summary_does_not_claim_images_were_built() {+ local d+ d="$(mktemp -d)"+ prepare_repo "$d"+ run_build "$d" --public-only+ if [ "$RUN_RC" -eq 0 ] \+ && ! grep -qi 'All images built' <<< "$RUN_OUT" \+ && grep -qF 'No images were built' <<< "$RUN_OUT"; then+ pass "--public-only closes by saying nothing was built"+ else+ fail "the --public-only summary still claims a build happened (rc=$RUN_RC): $RUN_OUT"+ fi+ rm -rf "$d"+}++# ---------------------------------------------------------------------------+# The build path is untouched -- the fix cannot be "never print the banners"+# ---------------------------------------------------------------------------++# `make minikube-setup-local` reaches build-images.sh without --public-only.+# Every banner must still be there, so suppressing them unconditionally (or+# inverting the condition) fails here.+assert_a_real_build_run_prints_every_build_banner() {+ local d missing+ d="$(mktemp -d)"+ prepare_repo "$d"+ run_build "$d" --skip-public+ missing="$(banners_absent "$RUN_OUT")"+ if [ "$RUN_RC" -eq 0 ] && [ -z "$missing" ]; then+ pass "a build run still prints every 'Building ...' section banner"+ else+ fail "a build run lost banners (rc=$RUN_RC): ${missing:-none} :: $RUN_OUT"+ fi+ rm -rf "$d"+}++# Same pairing as the ghcr case: the run that announced builds performed them.+assert_a_real_build_run_really_builds() {+ local d builds+ d="$(mktemp -d)"+ prepare_repo "$d"+ run_build "$d" --skip-public+ builds="$(docker_build_count "$d")"+ if [ "$RUN_RC" -eq 0 ] && [ "$builds" -ge 10 ]; then+ pass "a build run invokes 'docker build' for the service images ($builds)"+ else+ fail "expected the build path to build; got rc=$RUN_RC, $builds builds"+ fi+ rm -rf "$d"+}++assert_a_real_build_run_still_reports_a_build_summary() {+ local d+ d="$(mktemp -d)"+ prepare_repo "$d"+ run_build "$d" --skip-public+ if [ "$RUN_RC" -eq 0 ] \+ && grep -qF '=== Build Summary ===' <<< "$RUN_OUT" \+ && grep -qi 'All images built' <<< "$RUN_OUT"; then+ pass "a build run still closes with the build summary"+ else+ fail "the build summary went missing (rc=$RUN_RC): $RUN_OUT"+ fi+ rm -rf "$d"+}++# ---------------------------------------------------------------------------+# The banner list itself must not silently empty out+# ---------------------------------------------------------------------------++# banners_present()/banners_absent() iterate BUILD_PHASES. An empty list makes+# both return "" and every case above pass vacuously.+assert_the_phase_list_is_not_empty() {+ if [ "${#BUILD_PHASES[@]}" -ge 4 ]; then+ pass "the phase list under test holds every build phase (${#BUILD_PHASES[@]})"+ else+ fail "BUILD_PHASES has ${#BUILD_PHASES[@]} entries; the assertions above are vacuous"+ fi+}++# A typo'd phase name cannot make the suppression case pass for the wrong+# reason: assert_a_real_build_run_prints_every_build_banner above demands the+# script emit every phase in this list, so a name the script never prints fails+# there.++assert_every_defined_case_is_invoked() {+ local self defined invoked missing+ self="$REPO_ROOT/scripts/tests/test-minikube-build-section-headers.sh"+ defined="$(grep -oE '^assert_[a-z_]+\(\) \{' "$self" | sed -E 's/\(\) \{$//' | sort -u)"+ invoked="$(grep -oE '^assert_[a-z_]+$' "$self" | sort -u)"+ missing="$(comm -23 <(printf '%s\n' "$defined") <(printf '%s\n' "$invoked"))"+ if [ -z "$missing" ]; then+ pass "every defined assert_ case is invoked in the call block"+ else+ fail "defined but never invoked: $(printf '%s ' $missing)"+ fi+}++assert_the_public_only_run_prints_no_build_banner+assert_the_public_only_run_really_builds_nothing+assert_the_public_only_run_still_loads_the_public_images+assert_the_public_only_summary_does_not_claim_images_were_built+assert_a_real_build_run_prints_every_build_banner+assert_a_real_build_run_really_builds+assert_a_real_build_run_still_reports_a_build_summary+assert_the_phase_list_is_not_empty+assert_every_defined_case_is_invoked++exit $FAIL