feat: add Zhuyuan Fifth Domain controller gate

This commit is contained in:
冰朔 2026-09-13 13:18:44 +08:00
commit 708265d98f
15 changed files with 633 additions and 26 deletions

View file

@ -26,13 +26,16 @@ const waitReady = child => new Promise((resolve, reject) => {
test('server exposes all baby loops while refusing off-channel baby events', async () => {
const temporary = fs.mkdtempSync(path.join(os.tmpdir(), 'persona-server-integration-'));
const key = path.join(temporary, 'key.pem'), seed = path.join(temporary, 'seed.json');
const world = path.join(temporary, 'world.json');
const pair = crypto.generateKeyPairSync('ed25519');
fs.writeFileSync(key, pair.privateKey.export({type:'pkcs8',format:'pem'}));
fs.copyFileSync(path.join(directory, 'seed.json'), seed);
fs.writeFileSync(world, JSON.stringify({schema:'guanghu.fifth-domain-runtime-navigation-state/v1',source_commit:'a'.repeat(40),tcs_root_freshness:'b'.repeat(64),fifth_domain_private:true,nodes:[]}));
const port = await freePort();
const child = spawn(process.execPath, [path.join(directory, 'server.mjs')], {env:{...process.env,
TCS_MOTHER_BRAIN_PORT:String(port), TCS_MOTHER_BODY_STATE_ROOT:path.join(temporary, 'state'),
TCS_MOTHER_SIGNING_KEY:key, TCS_MOTHER_SEED:seed, TCS_PERSONA_ROUTES:path.join(directory, 'persona-routes.json'),
TCS_WORLD_STATE_PATH:world,
TCS_PERSONA_RUNTIME_REGISTRY:path.join(directory, 'persona-runtime-registry.json'), TCS_PERSONA_REPO_ROOT:repoRoot,
TCS_LIT_NAVIGATION_MAP:path.join(repoRoot, 'routing/linguistic-echo-lamp-map.json'), OPENLUX_API_KEY:'test-not-used'},
stdio:['ignore','pipe','pipe']});
@ -45,6 +48,9 @@ test('server exposes all baby loops while refusing off-channel baby events', asy
assert.equal(supervisorStatus.phase, 'PERSONA_RUNTIME_READY');
assert.equal(supervisorStatus.persona_runtime_count, 14);
assert.equal(supervisorStatus.default_persona, null);
const controllerStatus = await (await fetch(`http://127.0.0.1:${port}/v1/fifth-domain/controller/status`)).json();
assert.equal(controllerStatus.state, 'ZHUYUAN_PERSONA_CONTROLLER_FIRST_GATE_READY');
assert.equal(JSON.parse(controllerStatus.controller_proof.payload).controller_persona_id, 'ICE-P-ZY001');
const status = await (await fetch(`http://127.0.0.1:${port}/v1/persona/ICE-BB-0005/status`)).json();
assert.equal(status.persona_id, 'ICE-BB-0005');
assert.equal(status.life_line.wake_allowed, true);