feat: wire yonexus pairing request flow

This commit is contained in:
nav
2026-04-08 21:38:43 +00:00
parent 3891eab488
commit 02d158eacd
3 changed files with 21 additions and 2 deletions

View File

@@ -548,6 +548,9 @@
---
### YNX-0604 实现 pair_request / pair_confirm / pair_success
**状态**
- [x] 已完成2026-04-08
**目标**
- 打通完整配对流程
@@ -564,9 +567,19 @@
- 正确 code 可完成配对
- 错误 code / 过期 code 会失败
**已完成内容**
- Server runtime 已在 `hello_ack` 后发送 `pair_request`,并复用已有 pending pairing 的 TTL/状态元数据
- Client runtime 已接收 `pair_request`,记录 pending pairing 元数据并切换到 `waiting_pair_confirm`
- Client runtime 已新增 `submitPairingCode()`,用于发送 `pair_confirm`
- Server runtime 已实现 `pair_confirm` 校验、`pair_success` 下发,并在成功后把 secret/publicKey 持久化到服务端记录
- Client runtime 已在收到 `pair_success` 后保存 secret/pairedAt 到本地 state
---
### YNX-0605 实现配对失败路径
**状态**
- [x] 已完成2026-04-08
**目标**
- 补齐 pairing 相关失败逻辑
@@ -581,6 +594,12 @@
**验收标准**
- 失败后不会留下脏状态导致后续无法重试
**已完成内容**
- Server runtime 已为 `pair_confirm` 补齐 `identifier_not_allowed``invalid_code``expired``internal_error``pair_failed` 返回
- Server runtime 已在配对通知失败时下发 `pair_failed(admin_notification_failed)` 并清理 pending pairing 状态,避免留下脏状态
- Client runtime 已记录最近一次 pairing failure并根据 `expired` / `admin_notification_failed` 自动回退到 `pair_required`
- 其他失败原因会保留 `waiting_pair_confirm`,允许客户端在同一 pairing 会话内重试输入 code
---
## Phase 7 — Authentication 主流程