feat(hololake): add domain-routed language membrane and user PNCC
This commit is contained in:
parent
cda2e32c00
commit
d563e6fd73
34 changed files with 1949 additions and 144 deletions
|
|
@ -0,0 +1,31 @@
|
|||
import assert from 'node:assert/strict'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import test from 'node:test'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
||||
const read = (relative) => fs.readFileSync(path.join(root, relative), 'utf8')
|
||||
|
||||
test('the circular lake membrane rejects protocol-external input before language runtime', () => {
|
||||
const contract = JSON.parse(read('contracts/circular-lake-membrane.json'))
|
||||
assert.equal(contract.default, 'DISCARD')
|
||||
assert.equal(contract.protocol_external_input_reaches_persona_context, false)
|
||||
assert.equal(contract.natural_language_grants_execution_authority, false)
|
||||
assert.equal(contract.intent_inference_required_for_protocol_rejection, false)
|
||||
assert.equal(contract.deterministic_membrane_before_persona_parser, true)
|
||||
assert.deepEqual(contract.accepted_language_protocols, ['GLP/1.0'])
|
||||
})
|
||||
|
||||
test('nearby discovery supports automatic local visitor discovery and a closed persona route', () => {
|
||||
const contract = JSON.parse(read('contracts/nearby-ai-discovery.json'))
|
||||
assert.equal(contract.same_device.auto_discovery, true)
|
||||
assert.equal(contract.same_device.copy_large_invitation_required, false)
|
||||
assert.equal(contract.connection_modes.GENERIC_AI_VISITOR.state, 'EXPRESSION_ONLY_READY')
|
||||
assert.equal(contract.connection_modes.GUANGHU_PERSONA.state, 'BINDING_EVIDENCE_REQUIRED')
|
||||
assert.equal(contract.local_network.state, 'DEFERRED_UNTIL_ENCRYPTED_TRANSPORT_AND_APPROVAL')
|
||||
const broker = read('src-tauri/src/direct_local_broker.rs')
|
||||
assert.match(broker, /DiscoverNearby/)
|
||||
assert.match(broker, /OpenVisitorSession/)
|
||||
assert.match(broker, /ReceiveLanguage/)
|
||||
})
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
import assert from 'node:assert/strict'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import test from 'node:test'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
||||
const read = (relative) => fs.readFileSync(path.join(root, relative), 'utf8')
|
||||
|
||||
test('public routing starts from five domains and lets the number select the verifier', () => {
|
||||
const contract = JSON.parse(read('contracts/domain-number-routing.json'))
|
||||
assert.equal(contract.public_entry, 'FIVE_DOMAIN_HOME')
|
||||
assert.equal(contract.user_selects_domain_before_number, false)
|
||||
assert.equal(contract.route_key, 'USER_NUMBER')
|
||||
assert.equal(contract.routing.number_shape_is_authority, false)
|
||||
assert.equal(contract.routing.client_supplied_domain_is_authority, false)
|
||||
assert.equal(contract.routing.unknown_or_unavailable_route, 'FAIL_CLOSED_BEFORE_LOGIN')
|
||||
assert.equal(contract.registries.FIFTH_DOMAIN.ownership, 'ICE-GL_INFINITY_PRIVATE_DOMAIN')
|
||||
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', () => {
|
||||
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(login, /login_host_for_domain/)
|
||||
assert.match(login, /DOMAIN_LOGIN_NOT_PROVISIONED/)
|
||||
assert.match(router, /verified_user_route/)
|
||||
assert.match(router, /FIFTH_DOMAIN.*MAIN_DOMAIN.*BRANCH_DOMAIN.*ZERO_DOMAIN.*ZERO_SENSE_DOMAIN/s)
|
||||
})
|
||||
|
||||
test('enterprise root runs a domain-specific Guanghu OS runtime while Linux remains subordinate', () => {
|
||||
const contract = JSON.parse(read('contracts/domain-number-routing.json'))
|
||||
assert.equal(contract.server_runtime.enterprise_root, 'ENTERPRISE_FOUR_DOMAIN_GUANGHU_OS_RUNTIME_ON_ENTERPRISE_ROOT_SERVER')
|
||||
assert.equal(contract.server_runtime.linux_role, 'SUBORDINATE_HARDWARE_SERVICE_AND_RESCUE_BRIDGE')
|
||||
assert.equal(contract.server_runtime.ordinary_user_node_requires_full_os_install, false)
|
||||
})
|
||||
|
|
@ -92,10 +92,10 @@ test('broadcast remains Tauri-compatible and carries HoloLake human metadata', (
|
|||
)
|
||||
})
|
||||
|
||||
test('stage one is an AI operating platform while five domains remain hidden foundation', () => {
|
||||
test('public entry presents five domains while domain contents remain isolated', () => {
|
||||
assert.equal(foundation.first_public_product, 'GH-AIOS_GENERAL_AI_OPERATING_PLATFORM')
|
||||
assert.equal(foundation.visible_five_domain_navigation_in_stage_one, false)
|
||||
assert.equal(stageOne.five_domain_primary_navigation_visible, false)
|
||||
assert.equal(foundation.visible_five_domain_navigation_in_stage_one, true)
|
||||
assert.equal(stageOne.five_domain_primary_navigation_visible, true)
|
||||
assert.ok(stageOne.human_surface.includes('HUMAN_APPROVAL_CENTER'))
|
||||
assert.ok(stageOne.modules.includes('EVENT_AND_LAKE_LAMP'))
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
import assert from 'node:assert/strict'
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
import test from 'node:test'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
|
||||
const readText = (relative) => fs.readFileSync(path.join(root, relative), 'utf8')
|
||||
const readJson = (relative) => JSON.parse(readText(relative))
|
||||
|
||||
test('the native user PNCC contract binds verified number, signed-in account and embedded Git', () => {
|
||||
const contract = readJson('contracts/user-pncc-channel.json')
|
||||
assert.equal(contract.engine, 'GIT')
|
||||
assert.equal(contract.human_projection, 'HOLOLAKE_NATIVE')
|
||||
assert.equal(contract.forgejo_role, 'OPTIONAL_REMOTE_COLLABORATION_ADAPTER')
|
||||
assert.equal(contract.binding.requires_verified_user_number, true)
|
||||
assert.equal(contract.binding.domain_resolved_before_login, true)
|
||||
assert.equal(contract.binding.domain_specific_login_and_node_entry_required, true)
|
||||
assert.equal(contract.binding.requires_authenticated_repository_account, true)
|
||||
assert.equal(contract.binding.password_written_to_repository, false)
|
||||
assert.equal(contract.binding.persona_binding_claimed, false)
|
||||
assert.equal(contract.local_repository.automatic_idempotent_initialization, true)
|
||||
})
|
||||
|
||||
test('the user PNCC is a native command and first-class HoloLake projection', () => {
|
||||
const native = readText('src-tauri/src/lib.rs')
|
||||
const frontend = readText('src/main.tsx')
|
||||
assert.match(native, /user_pncc_channel::get_user_pncc_channel/)
|
||||
assert.match(native, /user_pncc_channel::ensure_user_pncc_channel/)
|
||||
assert.match(frontend, /GH-PNCC · 人格原生代码频道/)
|
||||
assert.match(frontend, /Forgejo 协作适配器/)
|
||||
assert.match(frontend, /ensure_user_pncc_channel/)
|
||||
assert.doesNotMatch(frontend, /Forgejo 页面/)
|
||||
})
|
||||
Loading…
Reference in a new issue