Skip to content

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

TypeScript

fix(hcc): initialise safety-inventory certification fail-closed [R4-E]

Alfredo Lopez2c4879d9cf9d
diff --git a/host-context-controller/package-lock.json b/host-context-controller/package-lock.json
index 047ddbc59..c117752cd 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.221",
+ "version": "0.1.222",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-host-context-controller",
- "version": "0.1.221",
+ "version": "0.1.222",
"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.json
index 7428dcbf9..5c14474c8 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.221",
+ "version": "0.1.222",
"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/networkPolicyReconciler.test.ts b/host-context-controller/src/networkPolicyReconciler.test.ts
index e4a9b32e3..8d3f1582f 100644
--- a/host-context-controller/src/networkPolicyReconciler.test.ts
+++ b/host-context-controller/src/networkPolicyReconciler.test.ts
@@ -5332,9 +5332,13 @@ describe('NetworkPolicyReconciler', () => {
expect(reconciler.hasCertifiedSafetyInventory()).toBe(true)
})
- it('certifies a scoped delta when no safety pass has failed', async () => {
+ it('does not certify the safety inventory until an authoritative pass has run', async () => {
+ // Fail-closed default: before any authoritative safety pass certifies, the
+ // namespace-wide inventory is NOT certified, even though the scoped delta's
+ // own label-scoped revocation completes (returns true). A delta cannot
+ // vouch for the namespace-wide inventory it never enumerated.
expect(await reconciler.reconcileContext(deltaContext)).toBe(true)
- expect(reconciler.hasCertifiedSafetyInventory()).toBe(true)
+ expect(reconciler.hasCertifiedSafetyInventory()).toBe(false)
})
})
diff --git a/host-context-controller/src/networkPolicyReconciler.ts b/host-context-controller/src/networkPolicyReconciler.ts
index b1feac9c7..0cb2a9dce 100644
--- a/host-context-controller/src/networkPolicyReconciler.ts
+++ b/host-context-controller/src/networkPolicyReconciler.ts
@@ -414,8 +414,14 @@ export class NetworkPolicyReconciler {
* nothing but its own label selectors. A delta therefore cannot vouch for a
* namespace whose classified inventory is still stuck on an unresolved
* policy, and must not certify readiness on its behalf.
+ *
+ * Initialised fail-closed (true): hasCertifiedSafetyInventory() reports false
+ * until the first authoritative pass actually certifies, so certification
+ * cannot be implied before any pass has run. This does not depend on the
+ * readiness gate's generation-equality check for safety — it removes that
+ * coupling rather than relying on it.
*/
- private safetyPassLeftUncertified = false
+ private safetyPassLeftUncertified = true
// H2 (issue #299): smallest DNS TTL (ms) observed across external-egress
// resolutions. The resync loop advances to <= this/2 so a rotating low-TTL host