fix: restore Kafka workbench authority

This commit is contained in:
AgentRun-Codex
2026-07-14 12:43:46 +02:00
parent 6ae0d1b5a4
commit f9f9f42c4a
23 changed files with 1170 additions and 254 deletions
@@ -3,14 +3,19 @@ import test from "node:test";
import { readStructuredFile } from "./src/structured-config.mjs";
const OBSOLETE_ARCHITECTURE_ENV = Object.freeze([
"HWLAB_KAFKA_DIRECT_PUBLISH_ENABLED",
"HWLAB_WORKBENCH_LIVE_KAFKA_SSE_ENABLED",
"HWLAB_WORKBENCH_KAFKA_REFRESH_REPLAY_ENABLED",
"HWLAB_KAFKA_TRANSACTIONAL_PROJECTOR_ENABLED",
"HWLAB_KAFKA_PROJECTION_OUTBOX_RELAY_ENABLED",
"HWLAB_WORKBENCH_PROJECTION_REALTIME_ENABLED"
]);
const CLOUD_API_ARCHITECTURE_ENV = Object.freeze({
HWLAB_KAFKA_DIRECT_PUBLISH_ENABLED: "true",
HWLAB_WORKBENCH_LIVE_KAFKA_SSE_ENABLED: "true",
HWLAB_KAFKA_TRANSACTIONAL_PROJECTOR_ENABLED: "false",
HWLAB_KAFKA_PROJECTION_OUTBOX_RELAY_ENABLED: "false",
HWLAB_WORKBENCH_PROJECTION_REALTIME_ENABLED: "false"
});
const CLOUD_WEB_ARCHITECTURE_ENV = Object.freeze({
HWLAB_WORKBENCH_LIVE_KAFKA_SSE_ENABLED: "true",
HWLAB_WORKBENCH_KAFKA_REFRESH_REPLAY_ENABLED: "true",
HWLAB_WORKBENCH_PROJECTION_REALTIME_ENABLED: "false"
});
const LIVE_KAFKA_CONTRACT = Object.freeze({
HWLAB_KAFKA_STDIO_TOPIC: "codex-stdio.raw.v1",
@@ -37,17 +42,15 @@ const ISOLATED_DEBUG_CONTRACT = Object.freeze({
HWLAB_WORKBENCH_KAFKA_DEBUG_REPLAY_TIMEOUT_MS: "15000"
});
test("v03 YAML fixes one transactional projection architecture without architecture env", async () => {
test("v03 YAML fixes direct publish, live Kafka SSE and retention replay authority", async () => {
const deploy = await readStructuredFile(process.cwd(), "deploy/deploy.yaml");
const cloudApi = deploy.lanes?.v03?.services?.find((service) => service.serviceId === "hwlab-cloud-api");
const cloudWeb = deploy.lanes?.v03?.serviceDeclarations?.["hwlab-cloud-web"];
assert.ok(cloudApi, "deploy.lanes.v03.services must declare hwlab-cloud-api");
assert.ok(cloudWeb, "deploy.lanes.v03.serviceDeclarations must declare hwlab-cloud-web");
for (const name of OBSOLETE_ARCHITECTURE_ENV) {
assert.equal(cloudApi.env?.[name], undefined, `${name} must not be rendered into cloud-api`);
assert.equal(cloudWeb.env?.[name], undefined, `${name} must not be rendered into cloud-web`);
}
for (const [name, expected] of Object.entries(CLOUD_API_ARCHITECTURE_ENV)) assert.equal(cloudApi.env?.[name], expected, `${name} must fix the cloud-api Kafka authority`);
for (const [name, expected] of Object.entries(CLOUD_WEB_ARCHITECTURE_ENV)) assert.equal(cloudWeb.env?.[name], expected, `${name} must fix the cloud-web Kafka authority`);
for (const [name, expected] of Object.entries(LIVE_KAFKA_CONTRACT)) {
assert.equal(cloudApi.env?.[name], expected, `${name} must preserve the pure Kafka live contract`);
}