fix: 移除 Workbench HTTP 自动补链
This commit is contained in:
@@ -3,13 +3,14 @@ import test from "node:test";
|
||||
|
||||
import { readStructuredFile } from "./src/structured-config.mjs";
|
||||
|
||||
const PRODUCT_CAPABILITIES = 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 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 LIVE_KAFKA_CONTRACT = Object.freeze({
|
||||
HWLAB_KAFKA_STDIO_TOPIC: "codex-stdio.raw.v1",
|
||||
@@ -21,7 +22,6 @@ const LIVE_KAFKA_CONTRACT = Object.freeze({
|
||||
});
|
||||
|
||||
const UNIDESK_OWNED_REFRESH_REPLAY_ENV = Object.freeze([
|
||||
"HWLAB_WORKBENCH_KAFKA_REFRESH_REPLAY_ENABLED",
|
||||
"HWLAB_WORKBENCH_KAFKA_REFRESH_REPLAY_GROUP_PREFIX",
|
||||
"HWLAB_WORKBENCH_KAFKA_REFRESH_REPLAY_TIMEOUT_MS",
|
||||
"HWLAB_WORKBENCH_KAFKA_REFRESH_REPLAY_SCAN_LIMIT",
|
||||
@@ -37,15 +37,16 @@ const ISOLATED_DEBUG_CONTRACT = Object.freeze({
|
||||
HWLAB_WORKBENCH_KAFKA_DEBUG_REPLAY_TIMEOUT_MS: "15000"
|
||||
});
|
||||
|
||||
test("v03 YAML keeps pure Kafka realtime capabilities independently composable", async () => {
|
||||
test("v03 YAML fixes one transactional projection architecture without architecture env", 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, expected] of Object.entries(PRODUCT_CAPABILITIES)) {
|
||||
assert.equal(cloudApi.env?.[name], expected, `${name} must be explicitly YAML-owned`);
|
||||
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(LIVE_KAFKA_CONTRACT)) {
|
||||
assert.equal(cloudApi.env?.[name], expected, `${name} must preserve the pure Kafka live contract`);
|
||||
@@ -59,8 +60,5 @@ test("v03 YAML keeps pure Kafka realtime capabilities independently composable",
|
||||
|
||||
assert.equal(cloudApi.env?.HWLAB_SESSION_COOKIE_DOMAIN, undefined, "internal and public origins require host-scoped session cookies");
|
||||
assert.notEqual(cloudApi.env?.HWLAB_KAFKA_AGENTRUN_EVENT_GROUP_ID, "hwlab-v03-agentrun-event-bridge");
|
||||
assert.equal(cloudWeb.env?.HWLAB_WORKBENCH_LIVE_KAFKA_SSE_ENABLED, "true");
|
||||
assert.equal(cloudWeb.env?.HWLAB_WORKBENCH_KAFKA_REFRESH_REPLAY_ENABLED, "true");
|
||||
assert.equal(cloudWeb.env?.HWLAB_WORKBENCH_PROJECTION_REALTIME_ENABLED, "false");
|
||||
assert.equal(cloudWeb.env?.HWLAB_WORKBENCH_KAFKA_DEBUG_REPLAY_ENABLED, "true");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user