diff --git a/TASKLIST.md b/TASKLIST.md index dbe981d..6ed7abb 100644 --- a/TASKLIST.md +++ b/TASKLIST.md @@ -110,6 +110,9 @@ --- ### YNX-0103 定义协议错误码与错误对象 +**状态** +- [x] 已完成(2026-04-08) + **目标** - 统一错误语义,避免 Server / Client 各自发明错误格式 @@ -122,6 +125,11 @@ - 所有失败路径都能落到有限集合的错误码 - 文档与代码错误码一致 +**已完成内容** +- 已在 `Yonexus.Protocol/src/types.ts` 固化 `ProtocolErrorCode` 与 `ErrorPayload` +- 已新增 `Yonexus.Protocol/src/errors.ts`,提供 `YonexusProtocolError`、错误分类映射、payload/envelope 转换辅助函数 +- 已更新 `Yonexus.Protocol/src/index.ts` 导出错误模块,方便 Server / Client 统一复用 + --- ### YNX-0104 编写协议级测试样例 @@ -296,6 +304,9 @@ --- ### YNX-0402 实现 Server 状态存储 +**状态** +- [x] 已完成(2026-04-08) + **目标** - 让信任状态在重启后仍可恢复 @@ -309,9 +320,19 @@ - 重启后 paired client 不丢失 - 损坏文件时有可恢复行为 +**已完成内容** +- 已新增 `Yonexus.Server/plugin/core/store.ts`,采用 JSON 文件作为 v1 持久化载体 +- 已实现 `loadServerStore()` / `saveServerStore()` 与 `createYonexusServerStore()` +- 已使用 `*.tmp` + rename 的原子写入策略 +- 已在加载阶段校验文件结构,并在损坏/版本不匹配时抛出明确 corruption error +- 已明确 rolling security windows 通过 `deserializeClientRecord()` 在重启后清空 + --- ### YNX-0403 实现 Client 本地信任材料存储 +**状态** +- [x] 已完成(2026-04-08) + **目标** - 持久化 Client 的 `identifier`、私钥、secret @@ -324,6 +345,13 @@ **验收标准** - Client 重启后可恢复身份与 secret +**已完成内容** +- 已新增 `Yonexus.Client/plugin/core/state.ts` +- 已定义 `YonexusClientState` / `YonexusClientStateFile`,覆盖 `identifier`、`privateKey`、`publicKey`、`secret` 与关键时间戳 +- 已实现 `loadYonexusClientState()` / `saveYonexusClientState()` / `createYonexusClientStateStore()` +- 已支持 state 文件缺失时自动创建最小初始状态 +- 已补充 `hasClientSecret()` 与 `hasClientKeyPair()`,方便后续 handshake wiring 判断本地信任材料是否齐备 + --- ## Phase 5 — Transport 最小闭环 diff --git a/Yonexus.Client b/Yonexus.Client index 1d751b7..2148027 160000 --- a/Yonexus.Client +++ b/Yonexus.Client @@ -1 +1 @@ -Subproject commit 1d751b7c55c83fbe4a667b0d4d68b95f14d88fff +Subproject commit 2148027a411a6545aa0b36b9d15494af7bb750a1 diff --git a/Yonexus.Protocol b/Yonexus.Protocol index fb4cd6e..4d8c787 160000 --- a/Yonexus.Protocol +++ b/Yonexus.Protocol @@ -1 +1 @@ -Subproject commit fb4cd6e45bdf30516292481ffd721021450ff0b8 +Subproject commit 4d8c787dbc7900eaaa0d11349e2c88f607c6fe9b diff --git a/Yonexus.Server b/Yonexus.Server index bc1a002..c5287fa 160000 --- a/Yonexus.Server +++ b/Yonexus.Server @@ -1 +1 @@ -Subproject commit bc1a002a8cf84df0273e4bd691913e460ed100db +Subproject commit c5287fa474644cec72d1e863e36a34b50977d929