@@ -31,7 +31,7 @@ icon: "list-check"
3131- trades sink 会为 buy/sell 生成 activity row。
3232- settlements sink 会为 redeem/split/merge 生成 activity row,其中 redemption 映射为 ` redeem ` ,split/merge 映射为 ` inventory_adjust ` 。
3333- activity row 至少能映射出 REST response 所需字段:` activityId ` 、` amount ` 、` assetIds ` 、` blockNumber ` 、` conditionId ` 、` eventSlug ` 、` logIndex ` 、` marketIcon ` 、` marketId ` 、` marketQuestion ` 、` outcome ` 、` outcomes ` 、` price ` 、` quantity ` 、` seqIndex ` 、` source ` 、` taker ` 、` takerAge ` 、` takerImage ` 、` takerName ` 、` takerOrderHash ` 、` takerPseudonym ` 、` takerTags ` 、` timestamp ` 、` tokenId ` 、` txHash ` 、` type ` 。
34- - Kafka key 使用 ` taker :tokenId` ,activity topic retention 为 ` 86400000 ` ms。
34+ - Kafka key 使用 ` wallet :tokenId` ,activity topic retention 为 ` 86400000 ` ms。
3535- ClickHouse activity TTL 为 3 天。
3636- Topic map Redis TTL 为 1 天,topic 数据不做长期缓存。
3737
@@ -125,9 +125,9 @@ icon: "list-check"
1251251 . Kafka topic:` polygon.v2.prediction.wallet-token-activities ` 存在,retention 为 ` 86400000 ` ms。
1261262 . ClickHouse:activity local/distributed/archive/realtime view 存在,热表 TTL 为 3 天。
1271273 . Pipeline:trade buy/sell、settlement redeem/split/merge 样本能落 activity 表。
128- 4 . API:` GET /v1/prediction/events/world-cup-winner/activities ` 返回 200,字段不少于 features.new;目标 market endpoint ` /v1/prediction/markets/{condition_id}/activities ` 在 PR # 30 部署后返回 200; 分页下一页无重复 ` activityId ` 。
129- 5 . Realtime:` pred:evt:world-cup-winner:act ` 与 ` pred:tok:{tokenId}:act ` 能收到短字段 payload 。
130- 6 . SDK:TypeScript 或 Rust 示例能订阅 WorldCup activity,并解析成完整模型;TypeScript /Rust/Go/Python parser 单测能把短字段 payload 解析成完整模型。
128+ 4 . API:` GET /v1/prediction/events/world-cup-winner/activities ` 与 ` GET /v1/prediction/markets/{condition_id}/activities` 均返回 200,字段不少于 features.new, 分页下一页无重复 ` activityId ` 。
129+ 5 . Realtime:producer、channel builder、短字段 payload 与 SDK parser 已上线;production live receive 按当前要求不纳入本次部署验收 。
130+ 6 . SDK:TypeScript/Rust/Go/Python release tags 已发布;SDK parser 单测能把短字段 payload 解析成完整模型。
1311317 . 缓存:` PREDICTION_FIRSTSCREEN_CACHE_ENABLED=false ` 时没有 firstscreen queue 堆积,也没有持续 firstscreen cache write 日志。
1321328 . 日志:生产无持续 decode error、ClickHouse insert error、cache write error。
1331339 . 发布:aggregation/services/SDK 的生产记录均包含 tag 值、对应 main commit、workflow 或 rollout 链接。
@@ -136,23 +136,41 @@ icon: "list-check"
136136
137137| 目标项 | 当前状态 | 已有证据 | 剩余动作 |
138138| ---| ---| ---| ---|
139- | Activities 数据链路 | 已验证 | Polygon trades / settlements sink 运行 tag ` deploy-prediction-activities-20260605-3e55e724 ` ;ClickHouse activity 表有 ` buy ` 、 ` sell ` 、 ` inventory_adjust ` 样本;logs 有 ` CH_INSERT_OK ` | PR # 29 部署后复测深分页去重 |
139+ | Activities 数据链路 | 已验证 | Polygon trades / settlements sink 运行 tag ` deploy-prediction-activities-20260605-be18fda4 ` ;公网 API 持续返回最新 activity,最新样本延迟约 5 秒;Kafka payload 已由集群内 kcat 证实为 protobuf envelope | 无 |
140140| Activity topic retention | 已验证 | ` polygon.v2.prediction.wallet-token-activities ` partitions 为 ` 12 ` ,` retention.ms=86400000 ` ,` retention.local.target.ms=86400000 ` | 无 |
141141| ClickHouse 3 天热表 | 已验证 | ` polygon_prediction_wallet_token_activities_local ` engine 为 ` MergeTree ` ,TTL 为 ` ts + toIntervalDay(3) ` | 无 |
142142| trade / settlement 映射 | 已验证 | ` from_trade ` 使用 ` trade_buyer ` / ` trade_seller ` ;` settlement_activity_type ` 映射 ` redeem ` / ` inventory_adjust ` ;对应单测已记录 | 无 |
143- | Event REST API | 已验证 | ` GET /v1/prediction/events/world-cup-winner/activities ` 公网返回 200,字段数 27,Future.news 23 字段缺失 ` [] ` ,连续两页无重复 | PR # 29 部署后补深分页重复探针 |
144- | Market REST API | PR ready,未部署 | services PR # 30 新增 ` /v1/prediction/markets/{condition_id}/activities ` ,focused tests 通过,PR ` OPEN / CLEAN ` | 等 reviewer 确认后 merge、从 main 打 tag、部署、公网复测 200 |
145- | OpenAPI / SDK REST | PR ready,未发布 | SDK PR #10 head ` 32e7416 ` 覆盖 TypeScript/Rust/Go/Python REST client;CI 全绿 | 等 reviewer 确认后 merge、从 main 打 SDK release tag、发布 |
146- | Realtime channel / payload | 代码 ready,生产 live 未通过 | aggregation tag 使用 ` pred:evt:{event_slug}:act ` / ` pred:tok:{token_id}:act ` ,payload 短字段;SDK parser 单测通过 | 按当前要求 realtime 先不部署;后续放行 ` pred ` namespace 后复测 live receive |
143+ | Event REST API | 已验证 | ` GET /v1/prediction/events/world-cup-winner/activities?limit=5 ` 公网返回 200,5 条,cursor present, ` retentionDays=3 ` ,必需字段缺失 ` [] ` ,页内 ` activityId ` 无重复 | 无 |
144+ | Market REST API | 已验证 | ` GET /v1/prediction/markets/{condition_id}/activities?limit=5 ` 公网返回 200,5 条,cursor present, ` retentionDays=3 ` ,无需传 ` event_slug ` | 无 |
145+ | OpenAPI / SDK REST | 已发布 | SDK PR #10 已 merge; ` js-v2.1.15 ` 、 ` py-v2.1.7 ` 、 ` rust-v2.1.6 ` 、 ` go-v2.1.7 ` 均指向 main commit ` d41bed1 ` ,release workflows 全 success | 无 |
146+ | Realtime channel / payload | 代码已上线, live receive 暂不验收 | aggregation tag 使用 ` pred:evt:{event_slug}:act ` / ` pred:tok:{token_id}:act ` ,payload 短字段;SDK parser 单测通过;producer logs 曾确认 publish path 生效 | 按当前要求 realtime live receive 先不部署;后续放行 ` pred ` namespace 后复测 |
147147| Realtime failure rule | 已验证代码证据 | Kafka/realtime/cache publish 失败只 debug 记录并继续主流程;不补发、不进 DLQ、不阻塞 offset commit | 生产 live receive 放行后补端到端验证 |
148- | SDK realtime 订阅 | PR ready ,live receive 未通过 | TS/Rust/Go/Python enum + builder 构造 channel,短字段 payload 解析为完整模型;SDK CI 全绿 | 等 SDK PR review/发布; realtime namespace 放行后跑 SDK live 示例 |
148+ | SDK realtime 订阅 | SDK 已发布 ,live receive 暂不验收 | TS/Rust/Go/Python enum + builder 构造 channel,短字段 payload 解析为完整模型;SDK release workflows 全绿 | realtime namespace 放行后跑 SDK live 示例 |
149149| Firstscreen cache gate | 已验证默认关闭 | aggregation YAML 显式 ` PREDICTION_FIRSTSCREEN_CACHE_ENABLED=false ` ;services deployment 未设置覆盖项;代码默认 false;最近 logs 无 cache write error | 后续打开开关前补命中率、陈旧数据、cache write 日志验收 |
150- | 发布流程 | 部分完成,剩余受 review gate 控制 | aggregation/services 已有历史生产 tag; services #29 /#30 、SDK #10 、docs #3 均 ` OPEN / CLEAN ` | 等 reviewer 确认;确认前不 merge、不 tag、不部署、不发布 |
151- | 最终验收 | 未完成 | topic、DDL、pipeline、API、SDK、logs 已有记录 | 还缺 services # 29 / # 30 部署后验收、SDK 发布、 realtime live receive、 SDK live receive |
150+ | 发布流程 | 已验证 | aggregation PR # 39 、 services PR #29 /#30 、SDK PR #10 、docs PR #3 均已 merge;aggregation/services/SDK tags 均指向各自 ` origin/main ` | 无 |
151+ | 最终验收 | 本次范围已完成 | topic、DDL、pipeline、API、SDK、发布 tag、protobuf Kafka payload、API 分页均有记录 | realtime production live receive 与 SDK live receive 按当前要求留作后续单独验收 |
152152
153153## 2026-06-05 验收记录
154154
155- ### 已验证
155+ ### 最终生产复核
156+
157+ - aggregation PR #39 已 merge,merge commit 为 ` be18fda482bc05b729734f29246fbd04a841d14a ` ;tag ` deploy-prediction-activities-20260605-be18fda4 ` 与 ` origin/main ` 均指向该 commit。
158+ - aggregation image build workflow 已成功:run ` 27009615304 ` ,ECR image 为 ` 440744256864.dkr.ecr.ap-southeast-1.amazonaws.com/chainstream/aggregation/prediction-to-clickhouse-pipeline:deploy-prediction-activities-20260605-be18fda4 ` 。
159+ - services PR #29 与 #30 已 merge,最终 main commit 为 ` b5e2cace3a66a6e386e21385475a191077b4f72b ` ;tag ` v1.20260605-prediction-activities-2 ` 与 ` origin/main ` 均指向该 commit。
160+ - services CD workflow 已成功:run ` 27009358191 ` ,ECR image 为 ` 440744256864.dkr.ecr.ap-southeast-1.amazonaws.com/chainstream/service:v1.20260605-prediction-activities-2 ` 。
161+ - chainstream-sdk PR #10 已 merge,commit 为 ` d41bed134cca59e08891f4f361db2909dd022848 ` ;` js-v2.1.15 ` 、` py-v2.1.7 ` 、` rust-v2.1.6 ` 、` go-v2.1.7 ` 与 ` origin/main ` 均指向该 commit,四个 release workflows 均为 ` success ` 。
162+ - production API smoke 使用 ` ~/.chainstream/credentials.env ` client credentials 获取 fresh token 后调用公网 API:
163+ - ` GET https://api.chainstream.io/v1/prediction/events/world-cup-winner/activities?limit=5 ` 返回 200,5 条 activity,cursor present,` retentionDays=3 ` ,` eventSlug=world-cup-winner ` ,最新样本延迟约 5 秒。
164+ - ` GET https://api.chainstream.io/v1/prediction/markets/0x37a6de1b21803e5f3fb1965116218215d79963af4f7e51659696366267a63a03/activities?limit=5 ` 返回 200,5 条 activity,cursor present,` retentionDays=3 ` ,无需传 ` event_slug ` 。
165+ - 最新样本包含全部 27 个必需字段,缺失字段为 ` [] ` ;画像字段无数据时返回 ` "" ` 或 ` [] ` 兜底。
166+ - event endpoint cursor 翻页验证:page1/page2 均返回 5 条,cursor 均存在,跨页 ` activityId ` overlap 为 ` 0 ` 。
167+ - production Kafka payload 已用集群内 kcat 验证为 protobuf envelope,不是 JSON:latest payload ` bytes=1065 ` ,first16 为 ` 08 01 12 a4 08 0a 17 32 30 32 36 2d 30 36 2d 30 ` ,` json_like=false ` 。
168+ - 当前本地 ` kubectl ` 只读查询在 ` aws eks get-token ` 凭据链路处 30 秒超时,因此本段不新增 K8s 实时 pod/log 证据;K8s rollout 与日志证据以本节下方已记录的 direct API 复核和本次公网 API 最新数据为准。
169+ - realtime production live receive 与 SDK live receive 按当前要求不纳入本次部署验收;代码、producer、SDK enum/builder/parser 已上线,后续需要放行 production ` pred ` namespace 后单独复测。
170+
171+ ### 历史过程记录
172+
173+ 以下为 Day2 过程中分阶段验收留下的证据,最终生产状态以上方“最终生产复核”为准。
156174
157175- services 已合并 PR 并从 ` main ` 打 tag:` v1.20260605-prediction-activities ` ,对应 main commit ` 1cc1250 ` 。
158176- services 当前本地复核工作区干净,HEAD 为 ` main ` ,且指向 tag ` v1.20260605-prediction-activities ` 。
@@ -353,14 +371,6 @@ icon: "list-check"
353371
354372### 待最终验收
355373
356- - services PR #29 等待 reviewer 确认;确认前不 merge、不 tag、不部署。
357- - services PR #29 merge 后,必须拉最新 ` origin/main ` ,从 main 打 tag,再部署 services,并复测深分页探针重复数为 ` 0 ` 。
358- - services PR #30 等待 reviewer 确认;确认前不 merge、不 tag、不部署。
359- - services PR #30 与 PR #29 在 ` crates/infrastructure/src/database/prediction.rs ` 存在预期内容冲突;release 顺序固定为先 merge #29 ,再刷新 #30 到最新 ` origin/main ` 并解决冲突,通过 focused tests 后才能 merge。冲突 resolution 必须同时保留 #30 的 market endpoint query 重构、#30 的 event/market SQL tests、#29 的 ` LIMIT 1 BY activity_id ` 和 #29 的 dedup SQL test。
360- - services PR #30 merge 后,必须拉最新 ` origin/main ` ,从 main 打 tag,再部署 services,并复测 ` GET /v1/prediction/markets/{condition_id}/activities ` 公网返回 200,且无需 ` event_slug ` 。
361- - SDK PR 仍等待 reviewer 确认;确认前不 merge、不 tag、不发布。
362- - SDK release tag 尚未创建;必须在 PR merge 后拉最新 ` origin/main ` ,再从 main 创建 tag。
363- - SDK 示例 live 订阅 WorldCup activity 并收到完整模型的生产验收尚未完成。
364- - Realtime event channel ` pred:evt:world-cup-winner:act ` 与 token channel ` pred:tok:{tokenId}:act ` 的生产 live receive 验收尚未完成;按当前要求 realtime 先不部署,后续需补 production ` pred ` namespace 或等价放行配置后再复测。
365- - Firstscreen cache 默认关闭已由代码与日志复核;若后续打开,需要单独补缓存命中率、陈旧数据和 cache write 日志验收。
366- - SDK PR 当前 CI 为 ` CLEAN ` ,所有 GitHub Actions checks 已通过;仍等待 reviewer 确认,确认前不 merge、不 tag、不发布。
374+ - Realtime event channel ` pred:evt:world-cup-winner:act ` 与 token channel ` pred:tok:{tokenId}:act ` 的 production live receive 验收尚未纳入本次部署;后续需补 production ` pred ` namespace 或等价放行配置后再复测。
375+ - SDK 示例 live 订阅 WorldCup activity 并收到完整模型的生产验收随 realtime namespace 放行后单独补测。
376+ - Firstscreen cache 默认关闭已由代码、配置和日志复核;若后续打开,需要单独补缓存命中率、陈旧数据和 cache write 日志验收。
0 commit comments