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('number verification is an unknown star abyss and the world stays veiled until it resolves', () => { const surface = read('src/modules/qoder-surface/StarlakeSurface.tsx') const styles = read('src/modules/qoder-surface/starlake-surface.css') const app = read('src/main.tsx') assert.match(surface, /worldRevealed/) assert.match(surface, /worldRevealing/) assert.match(surface, /gateExpanded/) assert.match(surface, /className=\{`star-abyss-entry/) assert.match(surface, /className="abyss-field"/) assert.match(surface, /className="abyss-stars"/) assert.match(surface, /编号验证/) assert.match(surface, /验证后展开语言世界/) assert.doesNotMatch(surface, /lighthouse-/) assert.doesNotMatch(surface, /光湖灯塔/) assert.doesNotMatch(surface, /className="channel-entry"/) assert.match(styles, /\.starlake-scene\.world-veiled \.domains/) assert.match(styles, /\.starlake-scene\.world-veiled \.masthead/) assert.match(styles, /\.starlake-scene \.star-abyss-entry\s*\{/) assert.match(styles, /left:50%/) assert.match(styles, /@keyframes sl-domain-rise/) assert.match(styles, /@keyframes sl-abyss-open/) assert.match(app, /className="star-abyss-dialog"/) assert.match(app, /语言世界尚未展开/) assert.match(app, /gateRising \|\| gateStage === 'key'/) assert.match(app, /gateExpanded=\{gateOpen && gateStage === 'number'\}/) }) test('main branch and zero domains are public portals with real runtime projections', () => { const surface = read('src/modules/qoder-surface/StarlakeSurface.tsx') const app = read('src/main.tsx') const portal = read('src/modules/public-domain/PublicDomainPortal.tsx') assert.match(surface, /publicAccess: true/) assert.equal((surface.match(/publicAccess: true/g) || []).length, 3) assert.match(app, /openPublicDomain/) assert.match(app, / { const styles = read('src/modules/qoder-surface/starlake-surface.css') const rule = styles.match(/\.starlake-scene \.world-channel-return\s*\{[^}]+\}/)?.[0] assert.ok(rule, 'world return control must have an explicit style boundary') assert.match(rule, /pointer-events:auto/) }) test('switching UI families enters the selected real home instead of retaining the other family inner stage', () => { const app = read('src/main.tsx') const chooser = app.match(/const chooseSurface = \(next:[\s\S]*?window\.localStorage\.setItem\('hololake-surface', next\)\n \}/)?.[0] assert.ok(chooser) assert.match(chooser, /setWorldStage\('domain'\)/) assert.match(chooser, /setView\('overview'\)/) assert.match(chooser, /setPublicDomain\(null\)/) }) test('language-world themes alter the whole scene through semantic optical tokens', () => { const styles = read('src/modules/qoder-surface/starlake-surface.css') assert.match(styles, /background:linear-gradient\(180deg, var\(--surface-sky\)/) assert.match(styles, /opacity:var\(--primitive-scene-opacity\)/) assert.match(styles, /background:var\(--accent-light\)/) assert.match(styles, /color:var\(--content-primary\)/) assert.match(styles, /color:var\(--content-secondary\)/) }) test('zero-sense and fifth-domain boundaries remain explicit', () => { const app = read('src/main.tsx') const portal = read('src/modules/public-domain/PublicDomainPortal.tsx') const protectedFacts = app.match(/domain: 'ZERO_SENSE_DOMAIN'[\s\S]*?domain: 'FIFTH_DOMAIN'[\s\S]*?\n \] \},/)?.[0] assert.match(app, /ZERO_SENSE_DOMAIN.*setActiveDomainInfo/s) assert.match(app, /FIFTH_DOMAIN.*setActiveDomainInfo/s) assert.match(portal, /前三域公共只读入口/) assert.match(portal, /不授予安装、写入或域内管理权限/) assert.ok(protectedFacts, 'protected domain facts must remain discoverable') assert.doesNotMatch(protectedFacts, /TCS-GL-|PER-|ICE-GL/) })