Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
test(#408): cover HCC re-ack upgrade path + correct network-ready doc
Alfredo Lopez21881506d3cb
diff --git a/docs/architecture/platform-topology.md b/docs/architecture/platform-topology.mdindex 9fcbb32ff..c67d7a675 100644--- a/docs/architecture/platform-topology.md+++ b/docs/architecture/platform-topology.md@@ -875,7 +875,7 @@ WRC McpServer CRD HC| Annotation | Set by | Value | Meaning || -------------------------------------------- | ------ | ---------------------- | ------------------------------------------------------------------------------------------------------------------- || `clerum.io/pre-deploy` | WRC | `"true"` | McpServer CRD created before workload pods exist; HCC should apply NPs proactively |-| `clerum.io/network-ready` | HCC | `"true"` | L2/L3 NetworkPolicies applied; safe to start workload pods. Valid only together with a matching generation stamp |+| `clerum.io/network-ready` | HCC | `"true"` | L2/L3 NetworkPolicies applied; safe to start workload pods. Honored only when the generation stamp matches the current generation (a non-numeric generation is tolerated as fresh without a stamp — defensive; `metadata.generation` is always numeric in a real cluster) || `clerum.io/network-ready-observed-generation` | HCC | `"<metadata.generation>"` | Generation HCC observed when acking (Issue #408). WRC honors `network-ready` only when this equals the current generation, so a stale ack from a prior generation cannot satisfy the gate. HCC re-acks (re-stamps) when the generation advances |#### 11.4.4 Timeout and Graceful Degradationdiff --git a/host-context-controller/package-lock.json b/host-context-controller/package-lock.jsonindex 6b6a904d8..443829a72 100644--- a/host-context-controller/package-lock.json+++ b/host-context-controller/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-host-context-controller",- "version": "0.1.171",+ "version": "0.1.172","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-host-context-controller",- "version": "0.1.171",+ "version": "0.1.172","license": "SEE LICENSE IN LICENSE","dependencies": {"@clerum/image-policy": "file:../packages/image-policy",diff --git a/host-context-controller/package.json b/host-context-controller/package.jsonindex bf06f1a88..7c6a6a9ba 100644--- a/host-context-controller/package.json+++ b/host-context-controller/package.json@@ -1,6 +1,6 @@{"name": "clerum-host-context-controller",- "version": "0.1.171",+ "version": "0.1.172","description": "Host Context Controller - provides McpServer CRDs to mcp-host via REST API","main": "dist/main.js","engines": {diff --git a/host-context-controller/src/reconciler.test.ts b/host-context-controller/src/reconciler.test.tsindex 349a2a714..1554333b5 100644--- a/host-context-controller/src/reconciler.test.ts+++ b/host-context-controller/src/reconciler.test.ts@@ -232,6 +232,39 @@ describe('Reconciler managed:false guard (Risk 1.7)', () => {)})+ it('Issue #408: re-acks when the ack predates the stamp (upgrade path: stamp absent)', async () => {+ // A pre-#408 HCC set network-ready:'true' without an observed-generation stamp.+ // The re-ack guard's stale-generation branch (typeof gen === 'number' && stamp !==+ // String(gen), i.e. undefined !== '3') must fire so the ack gains a generation.+ const server = {+ ...makeServer({ name: 'stdio-mcp', managed: true }),+ generation: 3,+ annotations: {+ 'clerum.io/pre-deploy': 'true',+ 'clerum.io/network-ready': 'true',+ // no clerum.io/network-ready-observed-generation+ },+ }++ await reconciler.reconcile(server)++ expect(customApi.patchNamespacedCustomObject).toHaveBeenCalledWith(+ expect.objectContaining({+ plural: 'mcpservers',+ name: 'stdio-mcp',+ body: {+ metadata: {+ annotations: {+ 'clerum.io/network-ready': 'true',+ 'clerum.io/network-ready-observed-generation': '3',+ },+ },+ },+ }),+ expect.objectContaining({ middleware: expect.any(Array) })+ )+ })+it('should create Deployment when managed: undefined (default: true)', async () => {const server = makeServer({ name: 'mongo-mcp' })await reconciler.reconcile(server)