hololake-system-architecture/product-source/hololake-native-desktop/scripts/product-intent-anchor.test.mjs

22 lines
1.3 KiB
JavaScript

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('Bingshuo natural-language anchor is a mandatory development and acceptance gate', () => {
const agents = read('AGENTS.md')
const anchor = read('docs/product-intent/BINGSHUO-HOLOLAKE-NATURAL-LANGUAGE-DEVELOPMENT-ANCHOR.md')
const terminal = JSON.parse(read('contracts/programming-ai-terminal-link.json'))
const gateway = JSON.parse(read('contracts/external-ai-gateway.json'))
assert.match(agents, /必须完整读取/)
assert.match(agents, /测试通过只证明实现没有触发已知工程回归,不能替代逐条自然语言验收/)
assert.match(anchor, /MCP 外部连接入口 → HoloLake 握手与门禁 → 切换为光湖原生协议运行时/)
assert.match(anchor, /MCP 断开时只允许暂停运输/)
assert.match(anchor, /不能退回通用 AI 层/)
assert.match(anchor, /结果未知的现实动作先读回再继续/)
assert.equal(gateway.native_runtime.continuity_owner, 'HOLOLAKE')
assert.equal(terminal.continuity.mcp_disconnect_never_falls_back_to_generic_runtime, true)
assert.equal(terminal.native_runtime_checkpoint.transport_disconnect_effect, 'PAUSE_TRANSPORT_KEEP_NATIVE_ENVIRONMENT')
})