2026-08-21 11:00:10 +08:00
|
|
|
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, /结果未知的现实动作先读回再继续/)
|
2026-08-21 11:57:39 +08:00
|
|
|
assert.match(anchor, /提交方、模型载体和 Agent 运行时不得自行构造/)
|
|
|
|
|
assert.match(anchor, /独立见证验签根尚未真实接入时必须保持未绑定/)
|
|
|
|
|
assert.match(anchor, /不得通过 `include_bytes!`、Tauri resources 或其他公共构建输入进入公开应用二进制/)
|
2026-08-21 11:00:10 +08:00
|
|
|
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')
|
|
|
|
|
})
|