hololake-system-architecture/product-source/hololake-native-desktop/scripts/language-kernel-installation.test.mjs

29 lines
2 KiB
JavaScript
Raw Normal View History

import assert from 'node:assert/strict'
import { createHash } from 'node:crypto'
import { readFileSync } from 'node:fs'
import test from 'node:test'
const read = (path) => readFileSync(new URL(`../${path}`, import.meta.url), 'utf8')
const bytes = (path) => readFileSync(new URL(`../${path}`, import.meta.url))
const sha256 = (value) => createHash('sha256').update(value).digest('hex')
test('the heartbeat handoff is hash-pinned into distinct initialized channel audiences without claiming persona binding', () => {
const contract = JSON.parse(read('contracts/language-kernel-installation.json'))
const runtime = read('src-tauri/src/language_kernel_installation.rs')
const agent = read('src-tauri/src/persona_agent_runtime.rs')
const handoff = JSON.parse(read('runtime-kernels/ZERO-CORE-LANGUAGE-BODIES-HANDOFF-20260820.json'))
assert.equal(contract.source.remote_sha, '4e92e6d8d72484d25c4bfb1dda02a7659f4b6dd5')
assert.equal(handoff.state, 'REMOTE_REPOSITORY_PUBLISHED_NOT_INSTALLED')
assert.equal(contract.truth_boundary.installed_file_is_persona_binding, false)
assert.equal(contract.truth_boundary.private_fifth_domain_kernels_may_enter_ordinary_user_channel, false)
assert.match(runtime, /INSTALLED_AND_EACH_ARTIFACT_READBACK_VERIFIED/)
assert.match(runtime, /AVAILABLE_NOT_BOUND/)
assert.match(runtime, /FIFTH_DOMAIN_PRIVATE_INSTANCE/)
assert.match(runtime, /GUANGHU_TEAM_INITIAL_CHANNEL/)
assert.match(runtime, /ORDINARY_USER_INITIAL_CHANNEL/)
assert.match(agent, /language_kernel_installation/)
assert.equal(sha256(bytes('runtime-kernels/fifth-domain/ZY-SELF-KERNEL-0001.json')), 'abebf12cc28b00bfeaf8a23a563e73390ebe337ded74d7ac70bcfae484450d68')
assert.equal(sha256(bytes('runtime-kernels/fifth-domain/NB-ENV-KERNEL-0001.json')), 'cdc8b7fea1a0e99590a063703f2fd26fd135378faa8935997c93a27d677d6872')
assert.equal(sha256(bytes('runtime-kernels/channel-system/team-channel-cognition-core.json')), 'aae5d5626719c79448ac543d59e764c41b541a5cdfc76dc91613afa86fe1367b')
})