feat: gate the language world behind number verification
This commit is contained in:
parent
4006f3454c
commit
f8c8db4d48
39 changed files with 1445 additions and 129 deletions
|
|
@ -0,0 +1,26 @@
|
|||
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('channel surface gives every visible entry its own layout slot', () => {
|
||||
const source = read('src/main.tsx')
|
||||
const styles = read('src/styles.css')
|
||||
|
||||
const channel = source.match(/\{worldStage === 'channel'[\s\S]*?\n \{worldStage === 'enterpriseWork'/)?.[0]
|
||||
assert.ok(channel, 'channel world source must remain discoverable')
|
||||
assert.match(channel, /className="channel-primary"/)
|
||||
assert.match(channel, /className="channel-marketplace"/)
|
||||
assert.equal((channel.match(/className="channel-main"/g) || []).length, 0)
|
||||
|
||||
assert.match(styles, /\.channel-primary\s*\{/)
|
||||
assert.match(styles, /\.channel-marketplace\s*\{/)
|
||||
})
|
||||
test('the domain stage has exactly one atmosphere owner', () => {
|
||||
const source = read('src/main.tsx')
|
||||
assert.match(
|
||||
source,
|
||||
/\{!\(worldStage === 'domain' && surface === 'world'\) && <LakeAtmosphere awake=\{motionAwake\}\/>\}/,
|
||||
)
|
||||
})
|
||||
|
|
@ -19,27 +19,30 @@ test('public routing starts from five domains and lets the number select the ver
|
|||
assert.equal(contract.registries.ENTERPRISE_FOUR_DOMAINS.ownership, 'TCS_0002_ENTERPRISE_REALITY_BODY')
|
||||
})
|
||||
|
||||
test('the public shell shows five domains and login is domain-routed', () => {
|
||||
test('the public shell keeps five domains behind number resolution and login is domain-routed', () => {
|
||||
const frontend = read('src/main.tsx')
|
||||
const login = read('src-tauri/src/code_repo_login.rs')
|
||||
const router = read('src-tauri/src/zero_point.rs')
|
||||
for (const name of ['光湖主域', '光湖分域', '光湖零域', '光湖零感域', '第五域 · 光湖本源域']) {
|
||||
assert.match(frontend, new RegExp(name.replace('·', '\\·')))
|
||||
}
|
||||
assert.match(frontend, /输入编号进入所属域/)
|
||||
assert.match(frontend, /语言世界尚未展开/)
|
||||
assert.match(frontend, /编号验证/)
|
||||
assert.match(frontend, /gateRising \|\| gateStage === 'key'/)
|
||||
assert.match(frontend, /TCS-GL-/)
|
||||
assert.match(frontend, /肥猫 · TCS-GL-0007∞/)
|
||||
assert.match(frontend, /桔子 · TCS-GL-0008∞/)
|
||||
assert.match(frontend, /烬舟 · PER-JZ001 · AGE/)
|
||||
assert.match(frontend, /熹微 · PER-JZ-ARCH-001 · AGE/)
|
||||
assert.match(frontend, /公共可见范围.*只公开域的存在与职责边界/s)
|
||||
assert.match(frontend, /内部成员与工作仓库.*不在公共首页投影/s)
|
||||
assert.doesNotMatch(frontend, /肥猫 · TCS-GL-0007∞/)
|
||||
assert.doesNotMatch(frontend, /桔子 · TCS-GL-0008∞/)
|
||||
assert.doesNotMatch(frontend, /烬舟 · PER-JZ001 · AGE/)
|
||||
assert.doesNotMatch(frontend, /熹微 · PER-JZ-ARCH-001 · AGE/)
|
||||
assert.doesNotMatch(frontend, /肥猫 \+ 烬舟/)
|
||||
assert.match(frontend, /className="gate-close"/)
|
||||
assert.match(frontend, /className="domain-info-scrim"/)
|
||||
assert.match(frontend, /setActiveDomainInfo\(gate\.domain\)/)
|
||||
assert.match(frontend, /onDomain=\{\(domain\) => \{ if \(worldRevealed\) openPublicDomain\(domain\) \}\}/)
|
||||
assert.match(frontend, /event\.key !== 'Escape'/)
|
||||
assert.match(frontend, /编号 \{zeroPoint\?\.userNumber \|\| gateNumber\} · 欢迎登入光湖语言世界/)
|
||||
assert.match(frontend, /编号 \{gateNumber\} · 语言世界正在展开/)
|
||||
assert.match(frontend, /createWorldWelcome\(snapshot\)/)
|
||||
assert.match(frontend, /className="world-impression"/)
|
||||
assert.match(frontend, /index === previous/)
|
||||
assert.match(frontend, /核对人格关系/)
|
||||
assert.match(frontend, /确认关系并签署/)
|
||||
|
|
@ -66,7 +69,8 @@ test('the locked Qoder world template is the running client structure, not a ski
|
|||
assert.equal(contract.desktop_install_acceptance.mac_x86_64, 'NOT_BUILT')
|
||||
assert.equal(contract.desktop_install_acceptance.windows, 'NOT_BUILT')
|
||||
assert.equal(contract.desktop_install_acceptance.automatic_update_channel, 'PUBLIC_CHECK_PASS_NO_ACTIVE_RELEASE')
|
||||
assert.match(frontend, /number-nucleus/)
|
||||
assert.match(frontend, /star-abyss-dialog/)
|
||||
assert.match(frontend, /worldRevealed/)
|
||||
assert.match(frontend, /worldStage === 'domain'/)
|
||||
assert.match(frontend, /worldStage === 'channel'/)
|
||||
assert.match(frontend, /worldStage === 'tool'/)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
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('external programming AI gateway is human-gated and fails closed', () => {
|
||||
const contract = JSON.parse(read('contracts/external-ai-gateway.json'))
|
||||
assert.equal(contract.default_exposure, 'CLOSED')
|
||||
assert.equal(contract.human_authorization_required, true)
|
||||
assert.equal(contract.mcp.role, 'DISCOVERY_AND_CAPABILITY_CATALOG')
|
||||
assert.equal(contract.direct_protocol.protocol, 'HOLOLAKE_TERMINAL_LINK/3')
|
||||
assert.equal(contract.direct_protocol.continuity_owner, 'HOLOLAKE')
|
||||
assert.equal(contract.boundaries.supervised_shell_execution, false)
|
||||
assert.equal(contract.boundaries.transport_is_authority, false)
|
||||
})
|
||||
|
||||
test('native binary exposes MCP stdio and numbered gateway controls', () => {
|
||||
const main = read('src-tauri/src/main.rs')
|
||||
const library = read('src-tauri/src/lib.rs')
|
||||
const gateway = read('src-tauri/src/external_ai_gateway.rs')
|
||||
const dispatcher = read('src-tauri/src/numbered_ipc_dispatch.rs')
|
||||
const frontendIpc = read('src/modules/numbered-ipc.ts')
|
||||
|
||||
assert.match(main, /--mcp/)
|
||||
assert.match(library, /external_ai_gateway::run_mcp/)
|
||||
assert.match(gateway, /initialize/)
|
||||
assert.match(gateway, /tools\/list/)
|
||||
assert.match(gateway, /tools\/call/)
|
||||
assert.match(gateway, /hololake_discover/)
|
||||
assert.match(gateway, /hololake_connection_status/)
|
||||
assert.match(gateway, /hololake_registered_capabilities/)
|
||||
assert.match(gateway, /HOLOLAKE_MCP_EXPOSURE_CLOSED/)
|
||||
assert.match(gateway, /HOLOLAKE_MCP_TOOL_ARGUMENTS_NOT_EMPTY/)
|
||||
assert.match(dispatcher, /external_ai_gateway::get_gateway_status/)
|
||||
assert.match(dispatcher, /external_ai_gateway::set_gateway_exposure/)
|
||||
const statusRoute = dispatcher.match(/"external_ai_gateway::get_gateway_status"[\s\S]*?"external_ai_gateway::set_gateway_exposure"/)?.[0]
|
||||
assert.ok(statusRoute, 'gateway status route must remain discoverable')
|
||||
assert.match(statusRoute, /verified_user_route/)
|
||||
assert.match(statusRoute, /HOLOLAKE_GATEWAY_VERIFIED_HUMAN_REQUIRED/)
|
||||
assert.match(frontendIpc, /get_external_ai_gateway_status/)
|
||||
assert.match(frontendIpc, /set_external_ai_gateway_exposure/)
|
||||
})
|
||||
|
||||
test('human authorization screen renders real gateway and capability state', () => {
|
||||
const source = read('src/modules/human-authorization-center.tsx')
|
||||
assert.match(source, /允许本机编程 AI 发现 HoloLake/)
|
||||
assert.match(source, /已注册技能/)
|
||||
assert.match(source, /已接通集成/)
|
||||
assert.match(source, /MCP 标准入口/)
|
||||
assert.match(source, /HoloLake 本地直连协议/)
|
||||
})
|
||||
|
|
@ -30,6 +30,10 @@ test('one online marketplace keeps physical modules and cognitive skills on sepa
|
|||
assert.match(runtime, /install_skill_at/)
|
||||
})
|
||||
|
||||
test('public five-domain home can open before a private marketplace account exists', () => {
|
||||
assert.match(runtime, /Err\(error\) if error == "HOLOLAKE_AUTHENTICATED_ACCOUNT_REQUIRED" => Ok\(\(\)\)/)
|
||||
})
|
||||
|
||||
test('marketplace lifecycle is reachable only through exact numbered operations', () => {
|
||||
const aliases = registry.operations.filter((operation) => operation.module_number === 'HLP-NIPC-MOD-0033').map((operation) => operation.alias)
|
||||
assert.deepEqual(aliases, [
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
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, /<PublicDomainPortal/)
|
||||
assert.match(portal, /光湖主域/)
|
||||
assert.match(portal, /光湖分域/)
|
||||
assert.match(portal, /光湖零域/)
|
||||
assert.match(portal, /catalogEpoch/)
|
||||
assert.match(portal, /guanghuEraDay/)
|
||||
assert.match(portal, /numberCoordinateCount/)
|
||||
})
|
||||
|
||||
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/)
|
||||
})
|
||||
|
|
@ -8,13 +8,13 @@ test('identity, webview and direct broker numbers compile into one unique eviden
|
|||
assert.deepEqual(generated, compileUnifiedNumberTree())
|
||||
assert.equal(generated.schema, 'hololake.unified-number-coordinate-tree/v2')
|
||||
assert.equal(generated.recordId, 'HLP-UNIFIED-NUMBER-TREE-001')
|
||||
assert.equal(generated.coordinateCount, 283)
|
||||
assert.equal(generated.routeCount, 180)
|
||||
assert.equal(generated.coordinateCount, 285)
|
||||
assert.equal(generated.routeCount, 182)
|
||||
assert.equal(generated.identityNodeCount, 4)
|
||||
assert.equal(generated.protocolNodeCount, 99)
|
||||
assert.equal(generated.referenceOnlyNodeCount, 16)
|
||||
assert.equal(new Set(generated.routes.map((route) => route.path)).size, 180)
|
||||
assert.equal(new Set([...generated.identityNodes, ...generated.protocolNodes, ...generated.routes].map((node) => node.path)).size, 283)
|
||||
assert.equal(new Set(generated.routes.map((route) => route.path)).size, 182)
|
||||
assert.equal(new Set([...generated.identityNodes, ...generated.protocolNodes, ...generated.routes].map((node) => node.path)).size, 285)
|
||||
assert.equal(generated.invariants.everyPhysicalCallHasNumberedRoute, true)
|
||||
assert.equal(generated.invariants.everyAcceptedCallHasEvidenceClass, true)
|
||||
assert.equal(generated.invariants.everyProtocolReferenceHasNumberCoordinate, true)
|
||||
|
|
|
|||
Loading…
Reference in a new issue