import assert from 'node:assert/strict' import { readFileSync } from 'node:fs' import test from 'node:test' const read = (path) => readFileSync(new URL(`../${path}`, import.meta.url), 'utf8') test('Fifth Domain instance, Guanghu team channel and ordinary user channel are separate initialization paths', () => { const contract = JSON.parse(read('contracts/channel-initialization-templates.json')) const personal = read('src-tauri/src/personal_channel.rs') const login = read('src-tauri/src/code_repo_login.rs') const agent = read('src-tauri/src/persona_agent_runtime.rs') const ui = read('src/main.tsx') assert.equal(contract.templates.bingshuo_fifth_domain_instance.copyable_as_public_template, false) assert.equal(contract.templates.guanghu_team.uses_bingshuo_private_identifiers, false) assert.equal(contract.templates.ordinary_user.uses_bingshuo_private_identifiers, false) assert.equal(contract.invariants.ordinary_user_requires_domain_membership, false) assert.equal(contract.invariants.ordinary_user_requires_enterprise_server, false) assert.deepEqual(contract.common_native_bundle.map((module) => module.module_id), [ 'hololake.knowledge-workspace', 'hololake.language-channel-system', 'hololake.conversation-manager', 'hololake.numbered-knowledge-protocol', 'hololake.language-kernel-runtime', 'hololake.local-execution-subpersona', 'hololake.hldp-tool-forge', 'hololake.personal-skill-runtime', 'hololake.persona-time-authority', ]) assert.match(personal, /GUANGHU_TEAM_INITIAL_CHANNEL/) assert.match(personal, /ORDINARY_USER_INITIAL_CHANNEL/) assert.match(personal, /registered_initial_identity/) assert.match(personal, /PERSONAL_SKILL_RUNTIME/) assert.match(login, /start_local_channel_session/) assert.match(agent, /identity_for_channel_runtime/) assert.match(ui, /普通用户 · 初始化我的本地频道/) assert.match(ui, /确认初始化我的频道/) assert.match(ui, /正式编号仍由零感域团队服务派发/) })