Skip to content

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

TypeScript

test(control-api): pin the clientId discriminator with disagreeing status fixtures

Jose Ramirezcaddae30032b
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index 38e38fe3d..66f083368 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.380",
+ "version": "0.1.381",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.380",
+ "version": "0.1.381",
"dependencies": {
"@clerum/image-policy": "file:../packages/image-policy",
"@clerum/llm-providers": "file:../packages/llm-providers",
diff --git a/control-api/package.json b/control-api/package.json
index 664ca403d..8333eddc2 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.380",
+ "version": "0.1.381",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/test/main.selfHostedBootGuard.test.ts b/control-api/test/main.selfHostedBootGuard.test.ts
index 9e018f800..3fc4ac8e5 100644
--- a/control-api/test/main.selfHostedBootGuard.test.ts
+++ b/control-api/test/main.selfHostedBootGuard.test.ts
@@ -56,6 +56,28 @@ describe('logRegistryConnectionState', () => {
)
})
+ // Discriminator pin: status and clientId deliberately disagree. If the
+ // discriminator ever regressed from `clientId != null` to a status check,
+ // this fails — the two fixtures above alone would not catch that mutation
+ // because in both of them status and clientId happen to point the same way.
+ it('reports connected for a pending-status row that already holds a clientId', async () => {
+ connDb.getRegistryConnection.mockResolvedValue({ status: 'pending', clientId: 'cid' })
+ await logRegistryConnectionState()
+ expect(logger.rootLogger.info).toHaveBeenCalledWith(
+ expect.objectContaining({ connected: true }),
+ expect.any(String)
+ )
+ })
+
+ it('reports NOT connected for a connected-status row with no clientId', async () => {
+ connDb.getRegistryConnection.mockResolvedValue({ status: 'connected', clientId: null })
+ await logRegistryConnectionState()
+ expect(logger.rootLogger.info).toHaveBeenCalledWith(
+ expect.objectContaining({ connected: false }),
+ expect.any(String)
+ )
+ })
+
it('no-op in managed mode — does not even read the row', async () => {
cfg.registryConnectionMode = 'managed'
await expect(logRegistryConnectionState()).resolves.toBeUndefined()