Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

docs(#375): sweep zach88 R1-L1/L2/L4/L5 + R1-M1 backstop comment

Alfredo Lopez24a8dc894a06
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index 969060244..46b24481a 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.464",
+ "version": "0.1.465",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.464",
+ "version": "0.1.465",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/image-policy": "file:../packages/image-policy",
diff --git a/control-api/package.json b/control-api/package.json
index 81399954b..3ef3221f0 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.464",
+ "version": "0.1.465",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/src/services/pluginWorkloadSdkDb.ts b/control-api/src/services/pluginWorkloadSdkDb.ts
index 63a52170c..93f0a17cb 100644
--- a/control-api/src/services/pluginWorkloadSdkDb.ts
+++ b/control-api/src/services/pluginWorkloadSdkDb.ts
@@ -971,6 +971,11 @@ export async function revokePluginWorkloadSdkForRecipe(
* that the recipe-bound SDK endpoint and credentials are gone. The state
* transition is intentionally impossible from `active`, preventing callers
* from declaring a kill-switch success without the teardown boundary.
+ *
+ * issue #375 (B2 counterpart): finalize (`revoking`→`disabled`) deliberately
+ * emits NO grant-update pg_notify — it is terminal cleanup reachable only after
+ * teardown is proven, its only caller/consumer is the WRC itself, and the
+ * visible `revoke` transition already notified.
*/
export async function finalizePluginWorkloadSdkRevocation(
recipeNamespace: string,
diff --git a/scripts/e2e/e2e-plugin-workload-sdk.sh b/scripts/e2e/e2e-plugin-workload-sdk.sh
index 3e9c2ef38..36cb2b38c 100755
--- a/scripts/e2e/e2e-plugin-workload-sdk.sh
+++ b/scripts/e2e/e2e-plugin-workload-sdk.sh
@@ -1443,7 +1443,6 @@ nudge_rev_before="${nudge_rev_before:-0}"
# Re-upsert the promptBridge grant. The admin upsert increments policy_revision
# and (issue #375 P3) emits the transactional grant-update NOTIFY on COMMIT.
-nudge_started_at="$SECONDS"
# issue #375 (R5): fail LOUD on a grant re-upsert failure. `|| true` here only
# guards `set -e` so we can read ADMIN_CURL_HTTP_STATUS; the explicit assert
# below is the real gate. Without it, an admin-API failure (expired token,
@@ -1458,6 +1457,9 @@ fi
nudge_found=0
nudge_state=""
nudge_rev_after=""
+# issue #375 (R1-L4): measure the printed elapsed from the SAME origin as the
+# deadline (post-upsert), so the cosmetic "~Ns (≤Xs)" line cannot exceed the cap.
+nudge_started_at="$SECONDS"
nudge_deadline=$((SECONDS + E2E_WAIT_NUDGE_VALIDATED))
while [ "$SECONDS" -lt "$nudge_deadline" ]; do
gate_assert_deadline "waiting for event-driven policyRevision bump (issue #375 P3)"
diff --git a/workflow-recipes/package-lock.json b/workflow-recipes/package-lock.json
index b0f61a206..3de2ef679 100644
--- a/workflow-recipes/package-lock.json
+++ b/workflow-recipes/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "workload-recipes-controller",
- "version": "0.1.293",
+ "version": "0.1.294",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "workload-recipes-controller",
- "version": "0.1.293",
+ "version": "0.1.294",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@aws-sdk/client-s3": "^3.1009.0",
diff --git a/workflow-recipes/package.json b/workflow-recipes/package.json
index b1834b1ce..04cf4a1e9 100644
--- a/workflow-recipes/package.json
+++ b/workflow-recipes/package.json
@@ -1,6 +1,6 @@
{
"name": "workload-recipes-controller",
- "version": "0.1.293",
+ "version": "0.1.294",
"description": "Workload Recipes Controller (WRC) - WorkloadRecipe lifecycle management and MCP server interface",
"main": "dist/main.js",
"engines": {
diff --git a/workflow-recipes/src/k8sClient.ts b/workflow-recipes/src/k8sClient.ts
index 8643b8fd7..fac1f8959 100644
--- a/workflow-recipes/src/k8sClient.ts
+++ b/workflow-recipes/src/k8sClient.ts
@@ -699,6 +699,10 @@ export class WorkflowRecipeWatcher implements WorkflowRecipeProvider {
this.grantUpdateListenerPool = createGrantUpdateListenerPool(this.config.db)
this.grantUpdateListener = createGrantUpdateListener({
pool: this.grantUpdateListenerPool,
+ // `capabilityFamily` is accepted for forward-compat and intentionally
+ // unused: the dispatch force-reconciles the whole recipe from the DB
+ // source of truth (all families recomputed), and authorization is
+ // per-invocation in control-api, never derived from the notification.
onGrantUpdate: ({ recipeNamespace, recipeName }) =>
this.handleGrantUpdateNotification(recipeNamespace, recipeName),
})
@@ -1042,6 +1046,10 @@ export class WorkflowRecipeWatcher implements WorkflowRecipeProvider {
// tokens/secrets (sec-003).
const projectedSdkState = result.pluginWorkloadSdkProjection?.capability?.state
const persistedSdkState = recipe.status?.pluginWorkloadSdk?.state
+ // The `validated → capability:null` cleanup case is intentionally NOT
+ // forensically logged here (projectedSdkState is undefined for a cleared
+ // capability); its clearing PATCH is still emitted via
+ // `pluginWorkloadSdkProjectionChanged`, so the publish is covered.
if (projectedSdkState !== undefined && projectedSdkState !== persistedSdkState) {
console.log(
`[WR-K8s] Plugin Workload SDK state for "${recipe.metadata.name}": ` +
diff --git a/workflow-recipes/src/reconciler/grantUpdateListener.ts b/workflow-recipes/src/reconciler/grantUpdateListener.ts
index eeb184d97..67c1e60b8 100644
--- a/workflow-recipes/src/reconciler/grantUpdateListener.ts
+++ b/workflow-recipes/src/reconciler/grantUpdateListener.ts
@@ -12,7 +12,12 @@
* (`PLUGIN_WORKLOAD_SDK_GRANT_UPDATE_CHANNEL`). Keep them in sync.
*
* Semantics are deliberately best-effort: a lost NOTIFY (reconnect gap) degrades
- * to the existing polling backstop, never worse. The LISTEN session runs on its
+ * to the existing polling backstop, never worse. Concretely: the ≤30s
+ * level-triggered full reconcile driven by `workflowNeedsInfrastructureReconcile`
+ * (k8sClient.ts — unconditional for SDK recipes: stepless via the
+ * `!isWorkflow && spec.pluginWorkloadSdk` branch, steps>0 with no active run) on
+ * the runtime-credential refresh timer; NOT `workflowNeedsWorkloadStatusRefresh`,
+ * which explicitly excludes SDK recipes. The LISTEN session runs on its
* own dedicated `pool.connect()` client (a pooled query would not keep the
* session sticky for notifications), mirroring `dbRunProcessor.ts`. The payload
* is untrusted DATA, not a command: an unparseable payload or unknown recipe is