import assert from 'node:assert/strict' import { readFile } from 'node:fs/promises' import test from 'node:test' const root = new URL('../', import.meta.url) const read = (path) => readFile(new URL(path, root), 'utf8') test('release center records every shipped HoloLake line from 0.4.0 through current', async () => { const contract = JSON.parse(await read('contracts/product-release-center.json')) assert.equal(contract.schema, 'hololake.product-release-center/v1') assert.equal(contract.currentVersion, '0.9.0') const versions = contract.releases.map((release) => release.version) for (const version of ['0.4.0', '0.4.1', '0.5.0', '0.6.0', '0.7.0', '0.8.1', '0.9.0']) assert.ok(versions.includes(version), version) assert.equal(contract.releases.filter((release) => release.state === 'CURRENT').length, 1) for (const release of contract.releases) { assert.ok(release.title.length > 0) assert.ok(release.summary.length > 0) assert.ok(release.highlights.length >= 3) assert.ok(release.evidence.length >= 1) } }) test('one engine exposes Guanghu and standard workbench projections with a human default', async () => { const source = await read('src/main.tsx') assert.match(source, /type PresentationMode = 'guanghu' \| 'workbench'/) assert.match(source, /type AudienceLayer = 'human' \| 'execution'/) assert.match(source, /hololake-presentation-mode/) assert.match(source, /hololake-audience-layer/) assert.match(source, /\|\| 'human'/) assert.match(source, /className="standard-workbench"/) assert.match(source, /HoloLake · V\{productReleaseCenter\.currentVersion\}/) assert.doesNotMatch(source, /HoloLake · V0\.8\.1/) assert.match(source, /renderHumanView\(\)/) assert.match(source, /renderExecutionProjection\(\)/) assert.match(source, /人格体结构化执行界面/) }) test('main domain routes to the public release center instead of a descriptive popup', async () => { const source = await read('src/main.tsx') assert.match(source, /gate\.domain === 'MAIN_DOMAIN'/) assert.match(source, /setWorldStage\('mainDomain'\)/) assert.match(source, /光湖主域公告与版本中心/) assert.match(source, /renderReleaseCenter\(audienceLayer\)/) }) test('public language persona copy is formal and keeps a visible human composer', async () => { const source = await read('src/modules/persona-channel-body/index.tsx') assert.match(source, /