Files
one_divine_lot/docs/04-迭代记录/19-指示灯状态自适应探测/验收标准.md
T

30 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 验收标准:19-指示灯状态自适应探测
## 验收标准线
| # | 标准 | 判定 |
|---|---|---|
| 1 | QMT 健康:异常/未知态按 retryMs(默认 10s)快速重试 | test-health-monitor [2]:≥2 次快速重试且缓存 healthy=false |
| 2 | QMT 健康:Bridge 恢复后 ≤ 一个重试周期缓存回 healthy=true(灯回绿),无需等 5 分钟 | 同脚本 [2] |
| 3 | QMT 健康:健康态维持稳态间隔(默认 5 分钟)不空转 | 同脚本 [3] |
| 4 | QMT 健康:stop() 后停止自动调度 | 同脚本 [4] |
| 5 | MCP:无激活连接置 disabled 且不调度(真实 probe 早退不触 SDK | test-mcp-status [1] |
| 6 | MCP:异常态按 retryMs 快速重试;MCP 服务恢复后自动探测到 connected(灯回绿) | 同脚本 [2] |
| 7 | MCP:已连接态按 intervalMs 稳态不空转;dispose() 后停止调度;_nextDelay 节奏正确 | 同脚本 [3][4][5] |
| 8 | 启动即探测 + 读缓存秒回语义不变(QMT 健康 / MCP 状态) | 两脚本 [1]sync-status/qmt-health/mcp-status 端点零改动 |
| 9 | 构建产物(lib/)含两处自适应逻辑;typecheck 0 错;存量不回归 | pnpm typecheck + pnpm buildtest-quote-sync / test-position-sync 通过 |
## 验收方法
- 自动化:node scripts/test-health-monitor.mjs10/10+ node scripts/test-mcp-status.mjs12/12)全绿;
pnpm typecheckpnpm build;存量回归脚本 0 退出。
- 人工(老师真实环境):重启插件后四灯状态秒回;停 QMT Bridge → QMT 灯 ≤10s 转红、MCP 灯 ≤10s 转红、
持仓/行情灯按 30s/15s 阈值转黄;**重新启动 QMT Bridge → QMT 灯与 MCP 灯 ≤20s 自动回绿**(本次修复核心);
点击 QMT 灯 /「检测 MCP」仍即时探测并刷新悬停详情。
## 验收目标
修复确认:QMT Bridge 及其 MCP 服务启动/恢复后,会话头部 QMT连接灯与 MCP 灯自动回绿(≤20s),
与其余两盏数据灯恢复节奏一致;健康/已连接稳态无额外探测开销;前端与 API 行为不变。
验收通过后 R-022 / R-023 定稿并归档(老师确认)。