feat: ingest mainland detect result events

This commit is contained in:
Your Name
2026-04-19 02:53:43 +08:00
parent 3a55db94f8
commit 4dcbf8ecb3
7 changed files with 600 additions and 71 deletions

View File

@@ -1,6 +1,6 @@
# TASK_BOARD
更新时间2026-04-19 02:43 CST
更新时间2026-04-19 02:51 CST
## 当前主批次
@@ -11,35 +11,30 @@
- 不进入新页面
- 不扩展控制面
- 只解决 item 级统一前的唯一前置缺口:
- 大陆节点当前没有把逐条检测结果同步回中央
- 大陆节点逐条检测事件进入中央
## 本轮已完成
本轮完成的是结论确认,不是新功能扩展
本轮完成的是最小输入通道补齐
-核查 `detect_result_projection`
-核查 `detect_run_events`
-确认当前 item 级回写为什么做不了
- `detect_result_projection` 开始携带 `recent_domain_events`
-让中央 `detect_result_ingest` 在接收时尝试落库 `detect_run_events`
-补幂等去重,避免重复投影重复写事件
- 已完成最小单测与中央 API 重启
## 关键证据
### 证据 1`detect_result_projection` 只有聚合数据
### 证据 1中央接收能力已经补上
最新 `detect_result_projection` 当前只包含
当前代码状态
- `job`
- `latest_event`
- `queue`
- `phase`
- 大陆侧 `detect_result_projection` 将开始带:
- `recent_domain_events`
- 中央视角在 ingest `detect_result_projection` 时会:
- 提取 `domain_started/domain_completed/domain_failed/domain_blacklisted`
- 以幂等方式写入中央 `detect_run_events`
不包含:
- `domain_id`
- `job_item_id`
- `domain`
- `status` 的逐条结果列表
### 证据 2中央 `detect_run_events` 的逐条事件只有海外
### 证据 2当前真实库里大陆逐条事件仍未出现
当前中央库里可见:
@@ -47,31 +42,27 @@
- `domain_started`
- `domain_completed`
当前不可见:
当前不可见:
- `mainland-controller-01`
- 无逐条 `domain_*` 事件
- `mainland-worker-01`
- 无逐条 `domain_*` 事件
### 证据 3大陆当前只同步了“聚合参与态”,没有同步“逐条结果
### 证据 3当前剩余阻塞已经收缩为“大陆节点尚未跑到这版代码
所以当前能做到
所以现在的状态是
- 主统计统一
- 节点参与统一
当前还做不到:
- 把大陆执行结果逐条映射回 `detect_job_items`
- 中央接收与落库逻辑已具备
- 但大陆节点必须拉到最新代码并继续推投影
- 拉新前,中央库里当然还看不到新的 mainland `domain_*`
## 当前结论
`I1-检测结果逐条回写设计批` 的结论已经明确
`J1-大陆逐条结果同步前置批` 已进入实现态,不再只是结论确认
- 现在还不能直接做 item 级回写
- 不是逻辑没写
- 是中央当前缺少大陆逐条结果输入
- 中央缺口已补
- 现在转入“大陆节点拉新并验证贯通”
## 下一步唯一主批次
@@ -84,12 +75,8 @@
本批次唯一目标:
- 让大陆节点把至少这些字段同步回来:
- `job_code`
- `cycle_token`
- `domain_id` 或可稳定映射的 `domain`
- `result_status`
- `finished_at`
- 让大陆节点把 `recent_domain_events` 真正同步到中央
- 并在中央确认出现 mainland `domain_*` 事件
## 候选批次
@@ -137,4 +124,6 @@
下一轮唯一应该继续做的事情:
- 设计并落地“大陆逐条检测结果 -> 中央可消费事件/投影”的最小同步通道
- 在大陆节点拉最新代码后,验证:
- `detect_result_projection` 已含 `recent_domain_events`
- 中央 `detect_run_events` 已出现 mainland `domain_*`