hololake-system-architecture/product-source/hololake-native-desktop/scripts/subdomain-industry-channel.test.mjs
冰朔 add00a0377 fix: integrate language channel through numbered IPC and isolate education module
正向合并正律化(2026-08-20):
- 语言人格频道与执行手脚训练按编号 IPC 正律接入(MOD-0035/0036,OP-0158..0163),
  剥离直连 tauri::command,恢复单一 numbered 网关铁律
- 教育模块按冰朔谕与 2026-08-19 隔离回执整体移出(证据归隔离区),留空模块占位
- 光湖主域门户挂公告与版本中心(冰朔要求的公告与版本更新主阵地)
- 知识工作台内嵌共同工作频道(PersonaChannelBody embedded + knowledgeFocus)
- foundation/stage-one 合同补聊天运行时验收声明;版本对齐 0.9.1
- 测试名册计数与断言更新至合并后现实:JS 180/180,Rust 194/194
2026-08-20 12:23:02 +08:00

72 lines
3.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import assert from 'node:assert/strict'
import fs from 'node:fs'
import test from 'node:test'
const contract = JSON.parse(
fs.readFileSync(new URL('../contracts/subdomain-industry-routing.json', import.meta.url), 'utf8'),
)
const frontend = fs.readFileSync(new URL('../src/main.tsx', import.meta.url), 'utf8')
const architecture = JSON.parse(
fs.readFileSync(new URL('../../../routing/hololake-current-architecture.json', import.meta.url), 'utf8'),
)
test('human identity numbers and industry routing numbers remain separate', () => {
assert.equal(contract.numbering.human_number_role, 'SUBJECT_IDENTITY_ONLY')
assert.equal(contract.numbering.industry_number_role, 'SYSTEM_ROUTING_ONLY')
assert.equal(contract.numbering.human_number_mutation_by_industry, false)
assert.equal(contract.numbering.industry_order_is_industry_number, false)
assert.equal(contract.numbering.unregistered_industry_number_behavior, 'DISPLAY_PENDING_AND_DO_NOT_INVENT')
})
test('subdomain owns the locked industry order and honest development states', () => {
assert.equal(contract.domain, 'BRANCH_DOMAIN')
assert.equal(contract.entry_surface, 'PUBLIC_MAIN_WORLD_SUBDOMAIN')
assert.deepEqual(
contract.industries.map(({ key, state }) => [key, state]),
[
['WEB_NOVEL', 'PLANNED'],
['PET', 'PLANNED'],
['EDUCATION', 'IN_DEVELOPMENT'],
],
)
assert.equal(contract.industries[0].industry_number, 'IND-WEBNOVEL-001')
assert.equal(contract.industries[1].industry_number, null)
assert.equal(contract.industries[2].industry_number, null)
})
test('education initialization channel exposes the built-in foundation and development package features', () => {
const education = contract.industries.find((industry) => industry.key === 'EDUCATION')
assert.equal(education.initialization_channel.state, 'DEVELOPMENT_MODULE_MOUNTED')
assert.equal(education.initialization_channel.channel_id, 'GH-EDU-INIT-001')
assert.equal(education.initialization_channel.module_loading, 'HOT_PLUG_ON_DEMAND')
assert.equal(education.initialization_channel.module_slots.length, 5)
assert.deepEqual(
education.initialization_channel.module_slots.map((slot) => slot.state),
[
'DEVELOPMENT_MOUNTED',
'DEVELOPMENT_MOUNTED',
'DEVELOPMENT_MOUNTED',
'DEVELOPMENT_MOUNTED',
'DEVELOPMENT_MOUNTED',
],
)
assert.equal(education.initialization_channel.installed_native_modules, 1)
assert.equal(education.initialization_channel.development_mounted_modules, 1)
assert.equal(education.initialization_channel.installed_open_source_modules, 0)
})
test('the merged product routes industries through the numbered views of the canonical main line', () => {
// 2026-08-20 正向合并修正实例1的 subdomainIndustries 前端路由被 main 正版架构取代;
// 行业能力以编号视图(教育工作台/网文工作台)直达,不再走分域行业过渡层。
assert.match(frontend, /renderEducation/)
assert.match(frontend, /renderWebNovel/)
assert.match(frontend, /StarlakeSurface/)
assert.match(frontend, /WebNovelWorkspace/)
assert.doesNotMatch(frontend, /光湖零域 · 行业系统/)
assert.equal(architecture.current_native_edge.industry_entry_domain, 'BRANCH_DOMAIN')
assert.equal(architecture.current_native_edge.zero_domain_industry_entry, 'ABSENT_BY_CURRENT_CORRECTION')
assert.equal(
architecture.current_native_edge.education_initialization_channel,
'BUILT_IN_CHANNEL_WORKBENCH_WITH_DEVELOPMENT_EDUCATION_MODULE',
)
})