diff --git a/TASKLIST.md b/TASKLIST.md index 29a5520..53fe656 100644 --- a/TASKLIST.md +++ b/TASKLIST.md @@ -1015,23 +1015,31 @@ - 覆盖 encode/parse 边界、malformed message 报错与 `isBuiltinMessage` 行为 ### YNX-1102 编写 Server 单元测试 +**状态** +- [x] 已完成(2026-04-09) + **目标** - 覆盖 registry、pairing、auth、heartbeat sweep -**当前进展(2026-04-09)** +**已完成内容** - 已为 `Yonexus.Server` 接入 `vitest` 测试基础设施(`package.json` + `vitest.config.ts`) - 已新增 `tests/pairing-and-rules.test.ts` - 已覆盖 pairing request 创建、有效/无效/过期 code 校验、通知状态迁移 - 已覆盖 server rule registry 的 exact-match dispatch、保留字拒绝、重复注册拒绝 - 已新增 `tests/pairing-auth-liveness.test.ts` - 已覆盖 auth 校验(public key/timestamp/nonce/rate limit/签名)与心跳 liveness 判定 -- **待补**:runtime/registry 协作、真实 transport flow 相关测试 +- 已新增 `tests/runtime-flow.test.ts` +- 已覆盖 hello -> pair_request、pair_confirm -> auth_request -> heartbeat、未认证 rule message 拒绝、liveness sweep 触发 `status_update` / `disconnect_notice` +- 补齐测试过程中暴露的服务端 publicKey 标准化问题:hello 阶段已统一 trim,避免 PEM 尾部换行导致 `auth_request` 误判 `invalid_signature` ### YNX-1103 编写 Client 单元测试 +**状态** +- [x] 已完成(2026-04-09) + **目标** - 覆盖状态机、keypair、auth 构造、heartbeat timer -**当前进展(2026-04-09)** +**已完成内容** - 已为 `Yonexus.Client` 接入 `vitest` 测试基础设施(`package.json` + `vitest.config.ts`) - 已新增 `tests/state-and-rules.test.ts` - 已覆盖 client state 文件缺失初始化、状态保存/回读 @@ -1039,7 +1047,8 @@ - 已覆盖 client rule registry 的 dispatch、保留字拒绝、重复注册拒绝 - 已新增 `tests/state-auth-heartbeat.test.ts` - 已覆盖 auth_request signing input、nonce/timestamp 校验、状态机迁移与 heartbeat scheduler 行为 -- **待补**:runtime/transport 层真实重连/心跳联动测试 +- 已新增 `tests/runtime-flow.test.ts` +- 已覆盖启动时加载 state + 自动补 keypair、`hello_ack`/`pair_request`/`pair_success`/`auth_success` 协作链路、`auth_failed`/`re_pair_required` 的 trust reset,以及认证后 heartbeat 发送门禁 ### YNX-1104 编写 Server-Client 集成测试 **目标** diff --git a/Yonexus.Client b/Yonexus.Client index df14022..65c1f92 160000 --- a/Yonexus.Client +++ b/Yonexus.Client @@ -1 +1 @@ -Subproject commit df14022c9a681af5a462487f71b9216681dec8c2 +Subproject commit 65c1f92cc13a45f8cd3c03abd46a9d35ec83add0 diff --git a/Yonexus.Server b/Yonexus.Server index 35d787b..4f4c6bf 160000 --- a/Yonexus.Server +++ b/Yonexus.Server @@ -1 +1 @@ -Subproject commit 35d787be040ce5ca07726e7c10478cc3157e67b3 +Subproject commit 4f4c6bf993f76d2eab1c05668ad696110f8c6cb1