docs(t216): freeze device command delivery contract

This commit is contained in:
QiuSW
2026-07-28 12:53:45 +08:00
parent 827afc7257
commit 75fdc63db2
8 changed files with 200 additions and 6 deletions
+19
View File
@@ -589,6 +589,25 @@ Admin task detail
追加新版本并把旧记录标记为 `SUPERSEDED`,设备领取后必须走显式停止/撤销协议。
浏览器不持有设备 claim token,授权表也不保存拼多多登录、支付或收货凭证。
### 设备命令投递(T-216)
Roubao 复用前台服务的 30 秒 heartbeat 主动 pull,不依赖 Android 后台推送:
```text
flush candidate outbox
-> task heartbeat keeps lease
-> POST commands/next
-> backend validates claim + execution + active authorization
-> PENDING_DELIVERY -> DELIVERED and returns canonical command
-> App validates and saves encrypted PendingOrderCommand
-> POST commands/{id}/ack with same hash/idempotency key
-> DELIVERED -> ACKNOWLEDGED
```
HTTP 响应不确定时,服务端对 `DELIVERED/ACKNOWLEDGED` 重放相同 command 和 hash;
App 只有在加密状态提交成功后才 ACK。投递/确认与真正页面执行分离,T-216 收到命令
后仍不打开拼多多。App 本地旧候选选择不再作为后台任务完成条件。
人工理由使用版本化 allowlist。接受或拒绝至少有一个理由且指定主要理由;
`OTHER` 才要求 4-200 字备注。拒绝推荐后改选必须同时产生一条原推荐项负标签和一条
替代项正标签;全部无匹配时每个曝光候选都有负标签。人工修正追加新 review 并引用