2026-08-12 10:29:00 +08:00
|
|
|
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 readJson = (relative) => JSON.parse(fs.readFileSync(path.join(root, relative), 'utf8'))
|
|
|
|
|
const readText = (relative) => fs.readFileSync(path.join(root, relative), 'utf8')
|
|
|
|
|
|
|
|
|
|
const foundation = readJson('foundation.json')
|
|
|
|
|
const trust = readJson('src-tauri/release-trust.json')
|
|
|
|
|
const tauriConfig = readJson('src-tauri/tauri.conf.json')
|
|
|
|
|
const capability = readJson('src-tauri/capabilities/default.json')
|
|
|
|
|
const broadcast = readJson('contracts/release-broadcast.schema.json')
|
2026-08-12 17:11:08 +08:00
|
|
|
const stageOne = readJson('contracts/stage-one-platform.json')
|
2026-08-12 10:29:00 +08:00
|
|
|
|
|
|
|
|
test('clean Tauri foundation contains no inherited product updater endpoint', () => {
|
|
|
|
|
assert.deepEqual(foundation.upstream_product_update_endpoints, [])
|
|
|
|
|
assert.deepEqual(trust.endpoints, [])
|
|
|
|
|
assert.deepEqual(trust.allowedReleaseHosts, [])
|
|
|
|
|
assert.equal(trust.state, 'UNPROVISIONED_FAIL_CLOSED')
|
|
|
|
|
assert.equal(trust.publicKey, '')
|
|
|
|
|
for (const relative of [
|
|
|
|
|
'foundation.json',
|
|
|
|
|
'src-tauri/release-trust.json',
|
|
|
|
|
'src-tauri/tauri.conf.json',
|
|
|
|
|
'src-tauri/src/release_trust.rs',
|
|
|
|
|
]) {
|
|
|
|
|
const source = readText(relative)
|
|
|
|
|
assert.doesNotMatch(source, /refactoringhq|tolaria|outline/i)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
test('release activation remains explicitly human controlled', () => {
|
|
|
|
|
assert.equal(trust.automaticCheckOnStartup, false)
|
|
|
|
|
assert.equal(trust.automaticDownload, false)
|
|
|
|
|
assert.equal(trust.humanOptInInstallRequired, true)
|
|
|
|
|
assert.equal(trust.automaticRestart, false)
|
|
|
|
|
assert.equal(foundation.automatic_update_check_on_startup, false)
|
|
|
|
|
assert.equal(foundation.human_opt_in_download_install_required, true)
|
|
|
|
|
assert.equal(foundation.automatic_restart_allowed, false)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
test('Tauri can emit signed updater artifacts without exposing updater IPC', () => {
|
|
|
|
|
assert.equal(tauriConfig.bundle.createUpdaterArtifacts, true)
|
|
|
|
|
assert.deepEqual(capability.permissions, ['core:default'])
|
|
|
|
|
assert.equal(capability.permissions.includes('updater:default'), false)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
test('broadcast remains Tauri-compatible and carries HoloLake human metadata', () => {
|
|
|
|
|
const platform = broadcast.properties.platforms.additionalProperties
|
|
|
|
|
assert.equal(platform.required.includes('signature'), true)
|
|
|
|
|
assert.equal(platform.required.includes('url'), true)
|
|
|
|
|
assert.equal(broadcast.required.includes('pub_date'), true)
|
|
|
|
|
assert.equal(broadcast.required.includes('publishedAt'), false)
|
|
|
|
|
assert.equal(broadcast.required.includes('notes'), true)
|
|
|
|
|
assert.equal(broadcast.required.includes('hololake'), true)
|
|
|
|
|
assert.equal(
|
|
|
|
|
broadcast.properties.hololake.properties.restart.properties.automaticAllowed.const,
|
|
|
|
|
false,
|
|
|
|
|
)
|
|
|
|
|
})
|
2026-08-12 17:11:08 +08:00
|
|
|
|
|
|
|
|
test('stage one is an AI operating platform while five domains remain hidden foundation', () => {
|
|
|
|
|
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.ok(stageOne.human_surface.includes('HUMAN_APPROVAL_CENTER'))
|
|
|
|
|
assert.ok(stageOne.modules.includes('EVENT_AND_LAKE_LAMP'))
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
test('stage one separates realtime, Git, knowledge and model reasoning boundaries', () => {
|
|
|
|
|
assert.equal(stageOne.git_is_realtime_transport, false)
|
|
|
|
|
assert.equal(stageOne.knowledge_projection_is_authority_source, false)
|
|
|
|
|
assert.equal(stageOne.hidden_model_reasoning_collection_allowed, false)
|
|
|
|
|
assert.equal(stageOne.exact_host_compaction_prediction_claimed, false)
|
|
|
|
|
assert.equal(stageOne.implementation_complete, false)
|
|
|
|
|
})
|