# M5:custom world / gallery / agent 任务清单 ## 0. 当前执行基线 本阶段与当前仓库里的创作链重构直接对应,统一以以下文档为准: 1. [../docs/technical/CREATION_FLOW_CHAIN_REFACTOR_EXECUTION_PLAN_2026-04-21.md](../docs/technical/CREATION_FLOW_CHAIN_REFACTOR_EXECUTION_PLAN_2026-04-21.md) 2. [../docs/technical/CURRENT_AGENT_CREATION_FLOW_STAGE4_CLEANUP_CHECK_2026-04-21.md](../docs/technical/CURRENT_AGENT_CREATION_FLOW_STAGE4_CLEANUP_CHECK_2026-04-21.md) 当前逻辑层命名和职责边界应优先使用 `rpgCreation / rpgAgent / rpgWorld` 口径;本任务清单继续保留 `custom world` 文件名,只是为了和后端重写阶段文档编号保持一致。 本轮首批可编码表设计见: 3. [../docs/technical/SPACETIMEDB_CUSTOM_WORLD_AGENT_STAGE1_TABLE_DESIGN_2026-04-21.md](../docs/technical/SPACETIMEDB_CUSTOM_WORLD_AGENT_STAGE1_TABLE_DESIGN_2026-04-21.md) 4. [../docs/technical/SPACETIMEDB_CUSTOM_WORLD_PUBLISH_WORLD_STAGE4_DESIGN_2026-04-21.md](../docs/technical/SPACETIMEDB_CUSTOM_WORLD_PUBLISH_WORLD_STAGE4_DESIGN_2026-04-21.md) 5. [../docs/technical/SPACETIMEDB_CUSTOM_WORLD_AXUM_FACADE_STAGE5_DESIGN_2026-04-22.md](../docs/technical/SPACETIMEDB_CUSTOM_WORLD_AXUM_FACADE_STAGE5_DESIGN_2026-04-22.md) 6. [../docs/technical/SPACETIMEDB_CUSTOM_WORLD_AGENT_SESSION_STAGE6_DESIGN_2026-04-22.md](../docs/technical/SPACETIMEDB_CUSTOM_WORLD_AGENT_SESSION_STAGE6_DESIGN_2026-04-22.md) 7. [../docs/technical/SPACETIMEDB_CUSTOM_WORLD_WORKS_AND_AGENT_EXTENSION_STAGE9_DESIGN_2026-04-22.md](../docs/technical/SPACETIMEDB_CUSTOM_WORLD_WORKS_AND_AGENT_EXTENSION_STAGE9_DESIGN_2026-04-22.md) ## 1. SpacetimeDB custom world 表 - [x] 设计 `custom_world_profile` - [x] 设计 `custom_world_session` - [x] 设计 `custom_world_agent_session` - [x] 设计 `custom_world_agent_message` - [x] 设计 `custom_world_agent_operation` - [x] 设计 `custom_world_draft_card` - [x] 设计 `custom_world_asset_link`(已在 Stage 1 文档中明确冻结为 `M6 assets / OSS` 继续落地,不阻塞 `M5` 验收) - [x] 设计 `custom_world_gallery_entry` ## 2. 当前 RPG 创作主链 - [x] 迁移 result preview compiler(Stage 9 按冻结口径落最小 preview compiler,不再搬 Node 全量 compiler) - [x] 迁移 published profile compile(Stage 3 已落地) - [x] 迁移 works 聚合读模型(Stage 9 Rust procedure + Axum facade 已接通) - [x] 迁移 library 存储与删除(Stage 2 设计已冻结,待继续接 Axum 兼容) - [x] 迁移 publish / unpublish(Stage 2 设计已冻结,待继续接 Agent publish gate) - [x] 迁移 publish_world 串联主链(Stage 4 设计已冻结,待继续接 Axum action / publish gate) - [x] 迁移 publish gate / enter-world gate(session snapshot / works / action 共用 gate 已接通) - [x] 迁移 gallery 列表与详情(Stage 2 设计已冻结,待继续接 Axum 兼容) ## 3. RPG 创作 Agent 主链 - [x] 迁移 session create(Stage 6 首批 Agent session skeleton) - [x] 迁移 session snapshot(Stage 6 首批 Agent session skeleton) - [x] 迁移 message submit(Stage 7 deterministic message / operation 最小闭环) - [x] 迁移 message stream(Stage 8 SSE facade 已落地) - [x] 迁移 operation query(Stage 7 deterministic message / operation 最小闭环) - [x] 迁移 card detail(Stage 9 Rust procedure + Axum facade 已接通) - [x] 迁移 card update(统一走 `/actions` 的 `update_draft_card`) - [x] 迁移 action registry / supportedActions(session 真相态 `supportedActions` 已接通) - [x] 迁移 draft foundation(统一走 `/actions` 的 `draft_foundation`) - [x] 迁移 result preview 生成(session 最小 `resultPreview` 已接通) - [x] 迁移 entity generation(Axum 兼容 `/api/custom-world/entity` 与 `/api/runtime/custom-world/entity` 已接通) - [x] 迁移 role / scene asset sync(最小 action 占位闭环与兼容图片入口已接通) - [x] 迁移 checkpoint / blocker / quality findings 主链(session / works / preview / publish gate 已接通) ## 4. Axum 编排层 - [x] 接入 LLM 编排(entity / scene-npc 兼容入口优先接 LLM + fallback) - [x] 接入世界草稿编译(`draft_foundation / update_draft_card / sync_result_profile` 已形成最小草稿编译闭环) - [x] 接入服务端 result preview 编译(最小 preview contract 已接入 session 快照) - [x] 接入角色 / 地点 / 场景 NPC 生成(最小兼容入口已接通) - [x] 接入封面图生成(最小兼容入口已接通) - [x] 接入场景图生成(最小兼容入口已接通) - [x] 接入 OSS 对象写入与绑定(`M5` 兼容图片入口已闭环为本地可消费资产;正式 `asset_object / asset_entity_binding / OSS` 主链顺延 `M6`) - [x] 接入 SSE 事件分发(Stage 8 SSE facade 已接通) ## 5. 当前正式接口与历史兼容台账 ### 5.1 当前正式接口 - [x] 兼容 `/api/runtime/custom-world-library`(Stage 5 首批 Axum facade) - [x] 兼容 `/api/runtime/custom-world-library/:profileId`(owner-only detail 查询已补齐) - [x] 兼容 `/api/runtime/custom-world-library/:profileId/publish`(Stage 5 首批 Axum facade) - [x] 兼容 `/api/runtime/custom-world-library/:profileId/unpublish`(Stage 5 首批 Axum facade) - [x] 兼容 `/api/runtime/custom-world-gallery`(Stage 5 首批 Axum facade) - [x] 兼容 `/api/runtime/custom-world-gallery/:ownerUserId/:profileId`(Stage 5 首批 Axum facade) - [x] 兼容 `/api/runtime/custom-world/works` - [x] 兼容 `/api/runtime/custom-world/agent/sessions`(Stage 6 首批 Axum facade) - [x] 兼容 `/api/runtime/custom-world/agent/sessions/:sessionId`(Stage 6 首批 Axum facade) - [x] 兼容 `/api/runtime/custom-world/agent/sessions/:sessionId/messages`(Stage 7 deterministic message submit) - [x] 兼容 `/api/runtime/custom-world/agent/sessions/:sessionId/messages/stream`(Stage 8 SSE facade) - [x] 兼容 `/api/runtime/custom-world/agent/sessions/:sessionId/actions`(Stage 9 全量 action procedure 已接通) - [x] 兼容 `/api/runtime/custom-world/agent/sessions/:sessionId/operations/:operationId`(Stage 7 deterministic operation query) - [x] 兼容 `/api/runtime/custom-world/agent/sessions/:sessionId/cards/:cardId` - [x] 兼容 `/api/custom-world/entity` - [x] 兼容 `/api/runtime/custom-world/entity` - [x] 兼容 `/api/custom-world/scene-npc` - [x] 兼容 `/api/runtime/custom-world/scene-npc` - [x] 兼容 `/api/custom-world/scene-image` - [x] 兼容 `/api/custom-world/cover-image` - [x] 兼容 `/api/custom-world/cover-upload` ### 5.2 历史兼容台账(非当前主链) - [x] 评估 `/api/runtime/custom-world/sessions` 是否仍需保留历史兼容映射(确认无需保留,旧链已物理删除) - [x] 评估 `/api/runtime/custom-world/sessions/:sessionId` 是否仍需保留历史兼容映射(确认无需保留,旧链已物理删除) - [x] 评估 `/api/runtime/custom-world/sessions/:sessionId/answers` 是否仍需保留历史兼容映射(确认无需保留,旧链已物理删除) - [x] 评估 `/api/runtime/custom-world/sessions/:sessionId/generate/stream` 是否仍需保留历史兼容映射(确认无需保留,旧链已物理删除) ## 6. 阶段验收 - [x] RPG 创作主链可用:`agent session -> result preview -> published profile` - [x] works / library / gallery / publish / enter-world 主链可用 - [x] RPG 创作 Agent 主链可用 - [x] agent 会话、消息、卡片、操作不再依赖单大 JSON 会话体 - [x] 旧 `custom-world/sessions` 问答流不再作为当前主链扩展目标 ## 7. 本轮执行结果 - [x] Stage 9 文档、任务清单、Rust module、spacetime-client、api-server 已对齐 - [x] `cargo check -p spacetime-client` - [x] `cargo check -p api-server` - [x] `CARGO_TARGET_DIR=D:\\Genarrative\\server-rs\\target-codex-m5-check cargo check -p api-server` - [x] `node scripts/check-encoding.mjs ...` 编码检查通过