Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
test: fail closed on stale SDK gateway routes
Alfredo Lopezd7bd401ab71a
diff --git a/scripts/minikube/pre-gate-runtime.sh b/scripts/minikube/pre-gate-runtime.shindex e82af0614..360fc9d0f 100755--- a/scripts/minikube/pre-gate-runtime.sh+++ b/scripts/minikube/pre-gate-runtime.sh@@ -59,6 +59,35 @@ rollout_namespace_deployments() {done <<<"${names}"}+# The workflow gateway mounts nginx.conf through a subPath, so a ConfigMap can+# be updated while a running pod continues serving the previous route table.+# The manifest-level test prevents omission in source; this runtime assertion+# prevents a stale or partially applied profile from being used for an SDK gate.+assert_workflow_gateway_prompt_bridge_finalization_route() {+ local deployment="nginx-workflow-approval-gateway"+ local namespace="control-plane"+ local pod++ if ! ${KC} get deployment "${deployment}" -n "${namespace}" >/dev/null 2>&1; then+ log "ERROR: ${namespace}/${deployment} is absent; refusing Plugin Workload SDK gate"+ return 1+ fi++ pod="$(${KC} get pods -n "${namespace}" -l app="${deployment}" \+ --field-selector=status.phase=Running -o jsonpath='{.items[0].metadata.name}' 2>/dev/null || true)"+ if [[ -z "${pod}" ]]; then+ log "ERROR: ${namespace}/${deployment} has no Running pod; refusing Plugin Workload SDK gate"+ return 1+ fi++ if ! ${KC} exec -n "${namespace}" "${pod}" -c nginx -- nginx -T 2>&1 | \+ grep -Fq 'location ~ ^/api/v1/mcp-host/plugin-workload-sdk/invocations/[^/]+/finalize$'; then+ log "ERROR: running ${namespace}/${deployment} does not serve the SDK finalization route; refusing gate"+ return 1+ fi+ log "Workflow gateway serves the SDK promptBridge finalization route"+}+gate_needs_registry() {[[ "${GATE_NAME}" == *registry* || "${GATE_NAME}" == *marketplace* || "${GATE_NAME}" == *plugin-workload-sdk* ]]}diff --git a/scripts/minikube/pre-gate-sync.sh b/scripts/minikube/pre-gate-sync.shindex a2a72a863..0c68d69c1 100755--- a/scripts/minikube/pre-gate-sync.sh+++ b/scripts/minikube/pre-gate-sync.sh@@ -358,6 +358,8 @@ if [[ "${cluster_changed}" == "true" ]]; thenrollout_if_present control-plane nginx-workflow-approval-gatewayfi+ assert_workflow_gateway_prompt_bridge_finalization_route+rollout_if_present control-plane host-context-controllerrollout_if_present control-plane workflow-recipesrollout_if_present control-plane control-ui@@ -388,5 +390,6 @@ elselog "No cluster sync required before ${GATE_NAME}"assert_no_legacy_prompt_bridge_grantsensure_evenfire_registry+ assert_workflow_gateway_prompt_bridge_finalization_route${KC} get deploy -A --no-headers 2>/dev/null | grep -v kube-system || truefidiff --git a/scripts/tests/test-minikube-pre-gate-sync-state.sh b/scripts/tests/test-minikube-pre-gate-sync-state.shindex f99f8a814..ae8d7a90e 100755--- a/scripts/tests/test-minikube-pre-gate-sync-state.sh+++ b/scripts/tests/test-minikube-pre-gate-sync-state.sh@@ -120,12 +120,21 @@ fiif contains 'nginx.conf is mounted through a subPath' &&contains 'INCREMENTAL_FULL_DEPLOYMENT' &&contains 'rollout_restart_with_retry control-plane nginx-workflow-approval-gateway' &&- contains 'rollout_if_present control-plane nginx-workflow-approval-gateway'; then+ contains 'rollout_if_present control-plane nginx-workflow-approval-gateway' &&+ contains 'assert_workflow_gateway_prompt_bridge_finalization_route'; thenpass "pre-gate sync refreshes the subPath-mounted workflow gateway after deployment changes"elsefail "pre-gate sync can leave a stale workflow gateway after ConfigMap changes"fi+if runtime_contains 'assert_workflow_gateway_prompt_bridge_finalization_route()' &&+ runtime_contains 'nginx -T' &&+ runtime_contains 'invocations/[^/]+/finalize'; then+ pass "pre-gate sync fails closed when the running gateway lacks SDK finalization"+else+ fail "pre-gate sync does not verify the running SDK finalization route"+fi+if contains 'fingerprint_dir packages/workflow-runtime-core' &&contains 'run_if_changed packages/workflow-runtime-core "npm test && npm run build"' &&contains 'ensure_artifact packages/workflow-runtime-core dist/index.js "npm run build"'; then