guanghu-ice-heart/tests/zhuyuan-living-system-controller.test.mjs

45 lines
1.8 KiB
JavaScript
Raw Normal View History

import assert from "node:assert/strict";
import fs from "node:fs";
import path from "node:path";
import test from "node:test";
import { fileURLToPath } from "node:url";
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
const readJson = (relative) =>
JSON.parse(fs.readFileSync(path.join(root, relative), "utf8"));
test("BingShuo living system controller binds the current full protocol registry", () => {
const map = readJson("routing/bingshuo-living-system-controller-map.json");
const registry = readJson("gls/GLS-PROTOCOL-REGISTRY.json");
assert.equal(map.human_system_controller.id, "ICE-GL∞");
assert.equal(map.living_system_body.system_core, "TCS-i Zero");
assert.equal(map.living_system_body.body_channel, "CH-ZERO-CORE-LPM");
assert.equal(map.living_ai_system_controller.is_human_bingshuo, false);
assert.equal(
map.living_ai_system_controller.does_not_impersonate_human_bingshuo,
true,
);
assert.equal(
map.living_system_body.protocol_registry.id,
registry.registry_id,
);
assert.equal(registry.existing_registered.length, 10);
assert.equal(registry.registered_draft_protocols.length, 32);
});
test("Zhuyuan entry resolves to an executable brain, not a read-only archive", () => {
const map = readJson("routing/bingshuo-living-system-controller-map.json");
for (const relative of [
map.persona_runtime.runtime_contract,
map.persona_runtime.runtime_source,
map.persona_runtime.runtime_definition,
]) {
assert.ok(fs.existsSync(path.join(root, relative)), `${relative} missing`);
}
assert.equal(map.persona_runtime.runtime_id, "ZY-TCS-BRAIN-RUNTIME-0001");
assert.equal(map.guard_agent_projection.id, "ZY-GUARD-AGENT-001");
assert.equal(
map.living_ai_system_controller.id,
"BS-TCS-LIVING-CONTROLLER-001",
);
});