games-development-ai/contracts/events.schema.json
zizi 096020fa0a feat(wave3-phaseA): project 侧跨主线收口(publish 唯一化+ProjectApi seam+GAP-4+治理+V6V7 G0)
Phase A 串行收口(主 agent 独占改黄金模块,11 单测绿),为 Phase B 并行建模块铺底:
- R1 publish 唯一化:submitPublish void→ProjectPublishRespVO{admitted,gates};门禁收集不抛、
  block→admitted=false 不改状态机;compliance gate 留 Phase C 接入 seam(TODO,不 import)
- R2 ProjectApi seam 单点定稿:+getCurrentVersionId(GAP-3)/+createProject(写类RPC 显式 creatorUserId)
- GAP-4:events.schema.json 信封 envelope/user 由 snake→camelCase(与 telemetry/前端 SDK 对齐,破坏性窗口收敛)
- R4 治理:登记 studio=112/Flyway V8(README §4/§1/§2 + CLAUDE.md;与前端仓 game-studio 区分)
- R6 G0:V6/V7 集中复制到 yudao-server/db/migration(diff-identical)
- project.yaml publish 响应同步结构化;D2 锚点 reviewProject/game_review_record 未动

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-09 01:37:06 +00:00

72 lines
5.1 KiB
JSON
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.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://wanxiang.ai/contracts/events.schema.json",
"title": "TelemetryEvents",
"description": "造梦AI 遥测事件契约 v1契约 #5owner=WS5。前端批量上报 / SDK 上报 → /app-api/telemetry/events/batch → MQ 异步入库 → qualityScore → feed 排序(数据回路闭环)。每事件带 schemaVersion新增字段给默认值、老消费者忽略未知字段不兼容变更用新事件名。【Wave3 GAP-4 评审记录】利用无生产数据 + MQ 未实现窗口,一次性把信封 envelope/user 由 snake_case 统一为 camelCase与 telemetry.yaml 及前端 SDK 对齐),保持 additionalProperties:false豁免本文件 README §2『不兼容变更用新事件名并行』规则本次改的是信封字段命名而非事件名已确认仓外无 snake_case 消费者telemetry.yaml/sdk-interface.d.ts/game-studio 均为 camelCase。",
"type": "object",
"required": ["envelope", "eventRegistry"],
"additionalProperties": false,
"properties": {
"envelope": {
"description": "事件信封(所有事件共用)。批量上报时为 { batch: Envelope[] }。",
"type": "object",
"required": ["event", "schemaVersion", "ts", "traceId"],
"additionalProperties": false,
"properties": {
"event": { "description": "事件名(见 eventRegistry 键)", "type": "string" },
"schemaVersion": { "description": "事件 Schema 版本,如 v1 / v2", "type": "string", "pattern": "^v[0-9]+$" },
"ts": { "description": "事件发生时间戳(毫秒)", "type": "integer" },
"traceId": { "description": "全链路追踪 ID贯穿生成→编译→加载→运行→上报", "type": "string" },
"sessionId": { "description": "会话 ID一次游戏流消费/一次创作会话)", "type": "string" },
"user": {
"description": "用户标识。匿名玩家用 anonId登录后带 userId。",
"type": "object",
"additionalProperties": false,
"properties": {
"userId": { "type": "string" },
"anonId": { "description": "匿名 token 派生的稳定匿名 ID", "type": "string" }
}
},
"context": {
"description": "上下文",
"type": "object",
"additionalProperties": true,
"properties": {
"gameId": { "type": "string" },
"versionId": { "type": "string" },
"channel": { "description": "渠道归因utm/channel 解析)", "type": "string" },
"deviceType": { "type": "string", "enum": ["mobile", "desktop", "miniapp"] }
}
},
"props": { "description": "事件私有字段(结构见对应 eventRegistry 项)", "type": "object" }
}
},
"eventRegistry": {
"description": "v1 核心事件登记表。值为该事件 props 的字段说明。覆盖:创作漏斗 / 消费漏斗 / 互动 / 广告 / 变现 / 性能。",
"type": "object",
"additionalProperties": false,
"properties": {
"create_start": { "description": "创作会话开始", "type": "object" },
"generate_submit": { "description": "提交生成。props: template_id, prompt_hash", "type": "object" },
"generate_succeeded": { "description": "生成成功。props: task_id, duration_ms用于 ≥80% 成功率统计)", "type": "object" },
"generate_failed": { "description": "生成失败。props: task_id, reason_code失败原因分类", "type": "object" },
"preview_play": { "description": "预览试玩", "type": "object" },
"publish_submit": { "description": "提交发布审核", "type": "object" },
"feed_view": { "description": "进入游戏流", "type": "object" },
"game_impression": { "description": "游戏卡片曝光首屏封面。feed 排序信号", "type": "object" },
"game_load_failed": { "description": "加载失败超时5s跳过触发。props: reason。降权信号", "type": "object" },
"game_play_start": { "description": "试玩开始", "type": "object" },
"game_play_end": { "description": "试玩结束。props: duration_ms, completed完玩。quality_score 输入", "type": "object" },
"like": { "description": "点赞", "type": "object" },
"favorite": { "description": "收藏", "type": "object" },
"share": { "description": "分享", "type": "object" },
"report": { "description": "举报。props: reason。举报阈值降权信号", "type": "object" },
"ad_impression": { "description": "广告展示上报。props: slot_id, provider", "type": "object" },
"ad_reward": { "description": "激励视频完成。props: slot_id", "type": "object" },
"income_settled": { "description": "收益归集T+1。props: amount, source", "type": "object" },
"perf_first_screen": { "description": "首屏加载耗时埋点P75<3s 验收。props: ms", "type": "object" }
}
}
}
}