fix: stabilize rpg publish and launch

This commit is contained in:
kdletters
2026-05-21 20:20:06 +08:00
parent 224a26d318
commit a9d23a8a44
14 changed files with 614 additions and 82 deletions

View File

@@ -48,12 +48,16 @@ RPG 是历史既有链路例外:当前仍使用对话式 Agent 共创工作台
RPG API 仍沿用历史命名空间:`/api/runtime/custom-world*``/api/story/*``/api/runtime/chat/*`。这些路由在 `api-server` 入口熔断中统一映射到 `rpg`,只按 `open` 判断是否允许调用;`visible` 只控制创作页入口展示和作品架可见性。
RPG Agent 结果页发布动作前端契约只保证提交 `{ action: 'publish_world' }`;后端发布时以当前 `custom_world_agent_session.draft_profile_json` 为草稿真相,从 `settingText``creatorIntent.rawSettingText``creatorIntent.worldHook``worldHook``anchorContent.worldPromise(.hook)``summary``name/title` 依次派生正式 `setting_text`,最后才回退 `seed_text`。不要把 `seed_text` 当作唯一设定来源,旧会话可能为空。
RPG Agent 结果页点击发布或发布并进入世界时,必须先把结果页当前 profile 通过 `sync_result_profile` 保存回 `custom_world_agent_session.draft_profile_json`,再发送发布动作;发布动作前端契约只允许提交 `{ action: 'publish_world' }``api-server` 只补作者公开信息,不转发 `profile``draftProfile``legacyResultProfile``settingText``spacetime-module` 发布时只读取当前 session`draft_profile_json` 为草稿真相,从 `settingText``creatorIntent.rawSettingText``creatorIntent.worldHook``worldHook``anchorContent.worldPromise(.hook)``summary``name/title` 依次派生正式 `setting_text`,最后才回退 `seed_text`。不要把 `seed_text` 当作唯一设定来源,旧会话可能为空。
`legacyResultProfile` 只作为历史结果页 profile 兼容兜底;`publish_world` 请求缺省或显式为 `null` 时等价于未提供,编译正式 profile 时不得因此报 `custom_world.compile.legacy_result_profile_json 不是合法 JSON object`。真正的数组、字符串、数字等非 object legacy 载荷仍应拒绝。
Agent session 已进入 `published` 后,结果页按钮只能执行“进入世界”:前端需先通过 `result-view` 回读已发布 profile 并启动运行态,不得再次调用 `sync_result_profile` 或发送 `{ action: 'publish_world' }``publish_world` 只允许在 `object_refining``visual_refining``long_tail_review``ready_to_publish` 等发布前阶段触发;否则会被后端阶段门槛拒绝。
`legacyResultProfile` 只作为历史结果页 profile 兼容兜底;编译正式 profile 时session 草稿内已保存字段优先于 legacy 字段legacy 只能补缺失字段。`publish_world` 不再接受前端临时传入的 legacy 载荷;历史兼容路径中 legacy 缺省或显式为 `null` 时等价于未提供,不得因此报 `custom_world.compile.legacy_result_profile_json 不是合法 JSON object`。真正的数组、字符串、数字等非 object legacy 载荷仍应拒绝。
RPG 结果页开局 CG 是 `profile.openingCg` 资产槽位:`api-server` 负责 VectorEngine / OSS 副作用并返回故事板和视频引用,前端只把结果写回当前 profile`sync_result_profile`、作品库保存和 `normalizeCustomWorldProfileRecord` 都必须保留该槽位。若生成成功后画面短暂显示又变回空白,优先检查父层重新同步或 profile 归一化是否把 `openingCg` 丢掉,而不是先怀疑已生成资源本身失效。
RPG 从作品架、广场详情或作品号搜索点击“启动”前,入口 client 必须把后端返回的完整 `profile` 先经过 `normalizeCustomWorldProfileRecord`,并用作品条目的 `profileId/worldName/subtitle/summaryText` 补齐旧数据缺失字段;运行态和详情页不得直接消费未归一化的旧 profile。角色选择页还需要在角色数组异常或为空时回退默认角色并显示可返回的轻量空态不能 `return null` 造成黑屏。运行态懒加载 fallback 必须可见,不能用纯 `null` 让用户误判为黑屏。
## 拼图
当前拼图链路: