Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
docs(hcc): resolve the 4 non-blocking findings from the final audit
Alfredo Lopez37856b2b73cc
diff --git a/Makefile b/Makefileindex 7334f00fc..b92b177d7 100644--- a/Makefile+++ b/Makefile@@ -944,7 +944,7 @@ test-e2e-hcc-readiness-bootstrap: ## Prove HCC readiness while its initial HostE2E_HCC_READINESS_FAULT_INJECTION=1 E2E_EXPECTED_PRE_GATE_GATE="$(E2E_EXPECTED_PRE_GATE_GATE)" MINIKUBE_PROFILE=$(E2E_KUBECONTEXT) KUBECONTEXT=$(E2E_KUBECONTEXT) bash scripts/e2e/e2e-hcc-readiness-bootstrap.sh.PHONY: test-e2e-hcc-watch-churn-readiness-test-e2e-hcc-watch-churn-readiness: ## Prove HCC readiness survives sustained apiserver watch churn (PR #205 GKE livelock). EXPECT_LIVELOCK=1 reproduces the bug.+test-e2e-hcc-watch-churn-readiness: ## Prove HCC readiness CONVERGES under sustained apiserver watch churn (PR #205 GKE livelock). Positive-only; the livelock RED lives in host-context-controller/src/k8sClient.test.ts. EXPECT_LIVELOCK=1 is refused.@echo "Running HCC watch-churn readiness gate..."@test -n "$(E2E_EXPECTED_PRE_GATE_GATE)" || { echo "Set E2E_EXPECTED_PRE_GATE_GATE to the gate recorded by the branch-owned pre-gate sync" >&2; exit 1; }E2E_HCC_WATCH_FAULT_INJECTION=1 EXPECT_LIVELOCK=$(EXPECT_LIVELOCK) E2E_EXPECTED_PRE_GATE_GATE="$(E2E_EXPECTED_PRE_GATE_GATE)" MINIKUBE_PROFILE=$(E2E_KUBECONTEXT) KUBECONTEXT=$(E2E_KUBECONTEXT) bash scripts/e2e/e2e-hcc-watch-churn-readiness.shdiff --git a/host-context-controller/src/k8sClient.ts b/host-context-controller/src/k8sClient.tsindex 465f120a8..ff4874570 100644--- a/host-context-controller/src/k8sClient.ts+++ b/host-context-controller/src/k8sClient.ts@@ -207,6 +207,10 @@ type HostWatchEventType = 'ADDED' | 'MODIFIED' | 'DELETED'type InitialConvergenceLane = 'McpServer' | 'NetworkPolicy'type NetworkPolicySafetyCertificate = {+ // VESTIGIAL — retained for record shape only, never read in any decision.+ // The certificate is identified SOLELY by content revision (the PR #382 fix);+ // the generation fields survive as diagnostics and MUST NOT gate readiness+ // (reading them would reintroduce the channel-identity livelock).contextGeneration: numberserverGeneration: numbercontextRevision: number@@ -1656,6 +1660,12 @@ export class McpServerWatcher implements McpServerProvider {// Kubernetes bumps metadata.generation only on a spec change (not on the// status writes HCC itself makes), and the uid distinguishes a delete+recreate// of the same name. Same (uid, generation) = same desired Host state.+ // SCOPE: unlike the McpServer/Context comparators (which hash spec+labels++ // annotations), this is blind to Host annotations/labels — correct today+ // because no Host annotation/label is load-bearing for a mutation (the wake+ // annotation drives dispatch, not template content). If a Host annotation or+ // label ever becomes mutation-relevant, extend this to hash it, or a+ // reconnect that re-LISTs an unchanged (uid, generation) would skip the bump.private sameHostDesiredRevision(previous: HostCRD, current: HostCRD): boolean {return previous.uid === current.uid && previous.generation === current.generation}diff --git a/scripts/e2e/e2e-hcc-watch-churn-readiness.sh b/scripts/e2e/e2e-hcc-watch-churn-readiness.shindex 578d71b18..c894191a1 100755--- a/scripts/e2e/e2e-hcc-watch-churn-readiness.sh+++ b/scripts/e2e/e2e-hcc-watch-churn-readiness.sh@@ -83,8 +83,9 @@ CHURN_MIN_AGE_MS="${CHURN_MIN_AGE_MS:-3000}"CHURN_MIN_CUTS="${CHURN_MIN_CUTS:-3}"READINESS_BUDGET_SEC="${READINESS_BUDGET_SEC:-360}"STABILITY_WINDOW_SEC="${STABILITY_WINDOW_SEC:-30}"-# Longest tolerated CONTINUOUS 503 streak under churn: 5s recovery timer +-# re-LIST + one retried cut cycle. A livelock produces an unbounded streak.+# Longest tolerated CONTINUOUS 503 streak under churn: immediate re-LIST ++# re-WATCH + a jittered backoff retry if that first attempt fails. A livelock+# produces an unbounded streak.RECOVERY_BUDGET_SEC="${RECOVERY_BUDGET_SEC:-15}"# 1Hz observation window under churn after first Ready (fix mode): ~8 cut# cycles at the default 7s cadence, enough for repeated 503->200 evidence.