
> baoer-pi-agent-labs@1.0.0 test
> node --test --test-reporter spec test/*.test.ts

✔ 真实 QuickJS VM 没有 Node / fetch 能力 (154.957815ms)
✔ 1.0.1 QuickJS output cap fails even when script catches the print error (227.189247ms)
✔ 成功 store 写入由宿主提交，load 获得上次状态 (182.9134ms)
✔ 失败脚本不提交 store，但先前工具副作用仍发生 (79.449467ms)
✔ 嵌套脚本调用复用 runToolCall 的授权 hook (83.273655ms)
✔ 实际三轮循环把工具结果带回下一次模型请求 (23.708307ms)
✔ 非法参数不会进入工具 execute (6.049881ms)
✔ beforeToolCall 拦截产生错误结果，阻止副作用 (2.540745ms)
✔ 被输出长度截断的工具调用不执行 (1.949546ms)
✔ 并行结束事件按完成顺序，历史按调用顺序 (5.563497ms)
✔ mixed batch 中一个 sequential 工具阻止其他工具提前启动 (12.706555ms)
✔ 等待 agent_end 监听器后才完成 prompt (2.257858ms)
✔ finishTurn 的有界 continuation 恰好补一轮 (1.799805ms)
✔ SessionManager 分支保留废弃历史，恢复选定路径 (84.884966ms)
✔ SDK 使用持久投影，内存篡改不会替代 canonical history (82.340913ms)
✔ 真实Core预算在第8轮toolUse之后停止，不发第9次模型请求 (6.813403ms)
✔ 实际SDK资源配置隔离目标项目的AGENTS/SYSTEM/APPEND与可执行扩展 (91.719854ms)
✔ branch只切内存leaf，未append便重开会恢复最后写入的分支 (5.579682ms)
✔ 路径提取与forkFrom全树复制语义不同 (4.492399ms)
✔ context_edit只改变投影并保留来源，旁支编辑不会泄漏 (0.97723ms)
✔ 压缩保留有效system checkpoint，近期消息保留，旧全文换成摘要 (1.241981ms)
✔ evidence: actual read content becomes submitted artifact and next request (31.181833ms)
✔ evidence: missing id reaches next request as error, then actual search id repairs it (8.570541ms)
✔ evidence: idle and successful provider response do not imply accepted task (13.220818ms)
✔ evidence: knowing a valid citation without reading it cannot create artifact (2.93471ms)
✔ evidence: SDK writes disk, restores into another instance, keeps receipts per run (160.034164ms)
✔ evidence: a real quote does not prove claim entailment (4.421779ms)
✔ 真实研究包加载 extension / skill / template，拦截 edit (390.430599ms)
ℹ tests 28
ℹ suites 0
ℹ pass 28
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 5961.365158
