Skip to content

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

TypeScript

fix(tracing): say what the cross-service literal actually guarantees

Alfredo Lopezf663d7dcee17
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index 900dc4ee9..198596027 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.592",
+ "version": "0.1.593",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.592",
+ "version": "0.1.593",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/grok-provider-attempt-contract": "file:../packages/grok-provider-attempt-contract",
diff --git a/control-api/package.json b/control-api/package.json
index 5a7c785da..68e2a3c02 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.592",
+ "version": "0.1.593",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/test/services.adminOperationBindingResolver.test.ts b/control-api/test/services.adminOperationBindingResolver.test.ts
index 5483d8eb5..dc44669bb 100644
--- a/control-api/test/services.adminOperationBindingResolver.test.ts
+++ b/control-api/test/services.adminOperationBindingResolver.test.ts
@@ -14,8 +14,16 @@ const principal = {
* Cross-service format contract (#694). `STATUS_REF_FROM_HCC` is the exact
* string host-context-controller emits
* (host-context-controller/src/administrativeOutcomeReporter.ts), which pins
- * this same literal in its own test. The two packages cannot import each
- * other, so change one side and the other side's test fails.
+ * this same literal in its own test.
+ *
+ * The duplication is a convention, not an enforced contract. The two packages
+ * cannot import each other, so nothing mechanically ties this literal to the
+ * template that produces it: if the emitter gained a segment, only its own
+ * test would fail, and this one would keep parsing the string below and stay
+ * green. Drift surfaces in production instead, as the `$`-anchored STATUS_REF
+ * refusing the new suffix -- a 403 with no `code`, which HCC classifies as
+ * retryable, so the outcome is re-enqueued rather than lost. Change one side
+ * and you must change this literal by hand.
*/
const HOST_UID = '6f1c2f3a-2f4b-4d3a-9b2e-7c0d1a5e8b44'
const STATUS_REF_FROM_HCC = `host:mcp-host/chatllm:generation=7:uid=${HOST_UID}`
diff --git a/host-context-controller/package-lock.json b/host-context-controller/package-lock.json
index 054ca389b..30bc257eb 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.343",
+ "version": "0.1.344",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-host-context-controller",
- "version": "0.1.343",
+ "version": "0.1.344",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@clerum/codex-catalog-projection": "file:../packages/codex-catalog-projection",
diff --git a/host-context-controller/package.json b/host-context-controller/package.json
index 9ea05aa9a..e308a7a4c 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.343",
+ "version": "0.1.344",
"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/administrativeOutcomeReporter.test.ts b/host-context-controller/src/administrativeOutcomeReporter.test.ts
index d9267bb59..ccf89e93a 100644
--- a/host-context-controller/src/administrativeOutcomeReporter.test.ts
+++ b/host-context-controller/src/administrativeOutcomeReporter.test.ts
@@ -9,10 +9,17 @@ import { administrativeOutcomeReporterTotal } from './metrics'
/**
* Cross-service format contract (#694). `EXPECTED_STATUS_REF` is the exact
* string control-api's `STATUS_REF` must parse
- * (control-api/src/services/tracing/adminOperationBindingResolver.ts). The two
- * packages cannot import each other, so control-api pins this same literal in
- * control-api/test/services.adminOperationBindingResolver.test.ts. Change one
- * side and the other side's test fails.
+ * (control-api/src/services/tracing/adminOperationBindingResolver.ts), which
+ * pins this same literal in
+ * control-api/test/services.adminOperationBindingResolver.test.ts.
+ *
+ * The duplication is a convention, not an enforced contract. The two packages
+ * cannot import each other, so nothing mechanically ties the two literals
+ * together: add a segment to the template below and this test fails while
+ * control-api's keeps parsing the old string and stays green. Drift surfaces
+ * in production instead, as a 403 with no `code` from the `$`-anchored
+ * STATUS_REF, which reporterHttpFailure classifies as retryable. Change one
+ * side and you must change the other literal by hand.
*/
const HOST_UID = '6f1c2f3a-2f4b-4d3a-9b2e-7c0d1a5e8b44'
const HOST_REF = { name: 'chatllm', namespace: 'mcp-host', generation: 7, uid: HOST_UID }
diff --git a/host-context-controller/src/infrastructureTelemetryReporter.ts b/host-context-controller/src/infrastructureTelemetryReporter.ts
index 91b8c467a..6bc0ee641 100644
--- a/host-context-controller/src/infrastructureTelemetryReporter.ts
+++ b/host-context-controller/src/infrastructureTelemetryReporter.ts
@@ -83,7 +83,7 @@ export function hccReconcileOutcomeSourceId(projection: HccReconcileOutcomeProje
projection.hostLookupReference.namespace,
projection.hostLookupReference.name,
projection.hostLookupReference.generation ?? 0,
- projection.hostLookupReference.uid ?? null,
+ projection.hostLookupReference.uid,
payload.reason_code ?? null,
payload.error_class ?? null,
payload.phase ?? null,