Enforce Genarrative play-type SOP and update docs

Rewrite Genarrative play-type integration guidance across .codex and .hermes to define a platform-level SOP: default to form/image workbench, unify single-image asset slots (CreativeImageInputPanel), standardize series-material sheet->cut->transparent->OSS pipeline, and forbid copying legacy chat/agent workflows as the default. Add decision-log entry freezing the SOP and a pitfalls note warning against direct reuse of old play tools. Update CONTEXT.md and docs/README.md, add a new PRD file, and apply related small server-side changes (module-auth, spacetime-client mappers and runtime) to align back-end code with the new contracts and flows.
This commit is contained in:
2026-05-20 12:12:00 +08:00
parent f370539a6f
commit 3931442249
123 changed files with 15514 additions and 3419 deletions

View File

@@ -22,6 +22,14 @@
- 验证:拼图入口测试仍可通过,且新组件可通过不同页面复用而不需要复制上传卡实现。
- 关联:`src/components/common/CreativeImageInputPanel.tsx``src/components/puzzle-agent/PuzzleAgentWorkspace.tsx`
## 通用图片面板的展示图不能自动等于 AI 重绘参考图
- 现象:结果页关卡详情把正式关卡图传给 `CreativeImageInputPanel` 后,面板会按“有图”默认显示 AI 重绘开关,容易让用户误以为正式图也能直接作为重绘参考图。
- 原因:展示图和 AI 重绘参考图是两种不同语义;前者只是预览当前图片,后者决定是否向后端提交可编辑参考图和重绘动作。
- 处理:给通用面板补独立控制位,只有外层明确允许时才显示 AI 重绘开关;结果页关卡详情在存在独立 `pictureReference` 时才开启重绘控制UI 背景预览始终只走展示模式。
- 验证:结果页测试能区分“只有正式图”与“有独立参考图”两种情况,入口页的上传/历史图/AI 重绘行为不受影响。
- 关联:`src/components/common/CreativeImageInputPanel.tsx``src/components/puzzle-result/PuzzleResultView.tsx`
## 新增玩法不要直接复制旧玩法创作工具
- 现象:新玩法一开始就复制既有玩法的聊天式 Agent、轻输入 Agent、专属素材 DTO 或生成流程,后续在结果页、作品架和 runtime 上不断补兼容层。
@@ -115,6 +123,14 @@
- 验证:执行 `npm run check:spacetime-runtime-access``npm run check:server-rs-ddd`,涉及绑定变化时先执行 `npm run spacetime:generate``npm run check:spacetime-schema`
- 关联:`docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md``scripts/check-spacetime-runtime-access.mjs``server-rs/crates/spacetime-module/src/*``server-rs/crates/spacetime-client/src/mapper.rs`
## SpacetimeDB schema guard 还要同步 migration.rs 和表目录
- 现象:`npm run check:spacetime-schema` 报 schema 已变化,但只指出 `server-rs/crates/spacetime-module/src/migration.rs` 和后端架构文档没有同步。
- 原因:新增 table / view / row shape 后,代码生成绑定可以先通过,但 migration 白名单和文档中的机器可读表目录仍然落后schema guard 会把它判定为不完整变更。
- 处理:新增 `spacetime-module` table 时同步把表名加入 `migration.rs` 的迁移表宏和 `docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md` 的表目录;如果新增 view还要补长期订阅列表和 view 描述。
- 验证:重新运行 `npm run check:spacetime-schema` 应通过;再跑相关 `cargo check``npm run check:encoding`
- 关联:`server-rs/crates/spacetime-module/src/migration.rs``docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md``docs/README.md`
## 拼图广场列表不要每次 HTTP 请求调用 SpacetimeDB procedure
- 现象:`/api/runtime/puzzle/gallery` 每个请求都走 `spacetime-client.list_puzzle_gallery()` 调用 SpacetimeDB procedure导致 SpacetimeDB WASM 侧重复组装全量列表,客户端再映射一遍;历史实现还出现过 procedure JSON 字符串往返。
@@ -1039,3 +1055,11 @@
- 处理:打开草稿时把持久化 `generationStatus=generating` 等同于生成中 notice恢复对应玩法生成进度页恢复计时使用作品摘要 `updatedAt` 推导 `startedAtMs`
- 验证:`npm test -- src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx -t "persisted generating"`
- 关联:`src/components/platform-entry/PlatformEntryFlowShellImpl.tsx``src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx``docs/【玩法创作】平台入口与玩法链路-2026-05-15.md`
## 跳一跳公开作品排障先查 sourceType 与后端运行态
- 现象:平台推荐、公开详情、试玩或运行态里跳一跳作品打不开、走错玩法、详情缺字段,或 `JH-*` 作品号搜索不到对应作品。
- 原因:跳一跳已是独立玩法链路,公开入口必须按 `sourceType='jump-hop'``JH-*` public code 分发;如果前端把它当作拼图/旧公开作品兼容分支,或在页面层自行补作品状态、权限、运行规则,就会和后端业务真相漂移。
- 处理:排查时先确认公开卡片、推荐项、详情页和试玩启动都保留 `sourceType='jump-hop'``publicCode` 使用 `JH-*`;运行态只消费后端返回的 profile / run / scoring / path 数据,前端只做展示和交互。后端 smoke 统一用 `npm run dev:api-server` 拉起,再检查 `/healthz`,不要回到旧的本地后端启动口径。
- 验证:从推荐或公开详情启动跳一跳试玩能进入跳一跳运行态;搜索 `JH-*` 能打开公开详情;`npm run dev:api-server` 启动后 `/healthz` 返回健康。
- 关联:`src/components/platform-entry/PlatformEntryFlowShellImpl.tsx``src/services/jump-hop/jumpHopClient.ts``docs/【玩法创作】平台入口与玩法链路-2026-05-15.md``docs/【开发运维】本地开发验证与生产运维-2026-05-15.md`