Feat/游戏场景需求v1.0 #139
Reference in New Issue
Block a user
Delete Branch "feat/scene_v1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
实现游戏场景需求v1.0。
基于最新 master
6f181b36a与当前 head04c8da648复审。当前 4 项 CI 均通过,但合并树仍有 6 个内容冲突;非冲突合并结果另有 2 个阻断项和 3 个一般问题,详见 inline comments。请 rebase 最新 master,修复后确保保留 master 的生成幂等、参考图上限与权威持久化契约,再请求复审。@@ -2035,0 +2056,4 @@}),onWalletBalanceMayHaveChanged,);if ([P2] inline 场景生成会漏掉生成告警。
applyQueuedEditorGenerationProject只覆盖队列终态;inline 响应里的尺寸恢复降级等generated.warning在这里没有像普通生图分支那样先调用notifyEditorGenerationWarning,用户将看不到结果已降级。请在队列处理前转发该 warning,并补 inline 场景告警测试。@@ -2035,0 +2078,4 @@}return;}addGeneratedResultLayer(generated, {[P1] 项目写回未完成时不能追加本地图层。最新 master 的普通生图分支在
canvasDialog && projectId且响应没有权威project时会直接返回;场景分支缺少该保护。若生成期间占位被另一端删除等原因导致后端未应用 canvasCompletion,这里仍会把场景结果加入本地并标记完成,造成客户端画布与后端项目分叉。请在本地追加前复用普通生图的保护分支。@@ -900,0 +902,4 @@export type EditorSceneGenerationInput = EditorSceneGenerationRequest;export async function generateEditorScene(input: EditorSceneGenerationInput) {assertStableEditorMediaReferences(input.referenceImageSrcs, '场景参考图');[P2] 补齐场景参考图上限校验。最新 master 的普通生图客户端会在发请求前调用
assertEditorReferenceLimit(..., 5, ...),这里目前只校验引用是否稳定;历史恢复状态或直接调用可携带超过 5 张参考图,仍会发出注定被后端拒绝的请求。请复用同一上限校验,并补“超限时不发送 HTTP 请求”的测试。@@ -900,0 +928,4 @@'生成游戏场景失败',{timeoutMs: 1_200_000,retry: EDITOR_REQUEST_RETRY_OPTIONS,[P1] 场景生成必须使用生成专用重试策略。最新 master 已把生成类 POST 切到
EDITOR_GENERATION_REQUEST_RETRY_OPTIONS:自动合并后本文件只导入新符号,而这里仍引用旧符号,会直接导致 typecheck 失败;若重新导入旧策略,inline 模式下响应丢失又会自动重试 Provider 调用,造成重复生成和持久化。请改用生成专用策略,并补场景请求不重试的测试。基于最新 master
281c84b7b与当前 head8034c8249复审。上轮 5 项代码问题均已修复,当前 4 项 CI 仍为绿色;本轮确认 1 个 External v1 场景合同旁路,以及 master 前进后产生的 8 个内容冲突,核心冲突位于场景与 BGM 共用提交链路。当前版本不可合并,具体修复点见 inline comments。@@ -1681,6 +1824,22 @@ pub async fn generate_editor_image(payload: Result<Json<EditorImageGenerationRequest>, JsonRejection>,) -> Result<Json<Value>, AppError> {let Json(payload) = parse_editor_generation_json_payload(payload)?;if payload[P1] External v1 仍可绕过场景专用合同
这里的拒绝只位于主站 generate_editor_image handler;/api/external/v1/editor/images/generations 在 external_editor_api.rs 中会直接调用 enqueue_editor_image_generation_for_owner,EditorImageGenerationRequest 的 kind 又只是普通字符串,OpenAPI enum 不会形成运行时校验。当前 PR 已让 worker、计费、存储 profile 和画布白名单正式识别 scene,所以持有 editor:image:generate scope 的 API Key 仍可提交 kind=scene、assetKind=scene 和任意 prompt,绕过 sceneContent/stylePreset/customStyle 校验与后端场景 Prompt 组装,最终落成正式场景资产。请在 External handler 或共享的不可信入口边界同步拒绝 scene,并补带有效 scope 与 Idempotency-Key 的 External 路由 400 回归测试。
@@ -231,3 +265,2 @@}: ImageGenerationSubmissionOptions): ImageGenerationSubmissionPlan {const normalizedPrompt =dialog.prompt.trim() || getDialogDefaultPrompt(dialog.mode);const normalizedPrompt = resolveImageGenerationDialogPrompt(dialog);[P1] 合并最新 BGM 主线时同时保留两套提交契约
最新 master
281c84b7b在同一函数新增了 canonicalBackgroundMusicPrompt 的前置分支,而当前行引入了场景必填 Prompt 的统一解析;三方合并已在这里形成内容冲突。只取 PR 侧会丢掉 BGM 已确认 Prompt 与专用 generationInputs,只取 master 侧会丢掉 scene plan、空场景必填语义和专用请求。请先合并最新 master:BGM 继续前置消费 canonicalBackgroundMusicPrompt,其他模式再走 resolveImageGenerationDialogPrompt,并同时保留 scene union/plan;补跑场景与 BGM submission model 回归。@@ -1783,3 +1781,1 @@: dialog.mode === 'audio-background-music'? '游戏背景音乐': 'AI 生成图片');const normalizedPrompt = resolveImageGenerationDialogPrompt(dialog);[P1] 工作流冲突不能丢 BGM claim 或场景校验
master 已在这里接入 backgroundMusicPromptAssist.beginSubmission、scope version 和提交所有权,当前 PR 则提前计算场景 normalizedPrompt;合并树在该位置冲突。正确整合需要先保留 BGM claim/ownership,再用 backgroundMusicSubmission?.prompt 与 resolveImageGenerationDialogPrompt(dialog) 分流,并继续向 buildImageGenerationSubmissionPlan 传 canonicalBackgroundMusicPrompt,同时保留后面的 scene 队列回读、warning 和权威项目写回。简单选择任一侧都会回退另一条现役生成链路。
@@ -16796,3 +16844,211 @@ button {background: #f8fafc;box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);}.image-canvas-editor__scene-custom-style {[P2] CSS 冲突必须保留并分别闭合两套面板样式
最新 master 在文件尾新增完整 BGM composer 样式和 max-width:640px 媒体查询,当前 PR 从这里新增场景画风样式与 max-width:760px 查询;合并冲突横跨两个区块。若只删除冲突标记而不重排闭合括号,场景样式会被错误嵌进 BGM 的移动端媒体查询;若选择一侧则另一面板直接丢样式。请保留完整 BGM 区块并先闭合其媒体查询,再接完整场景区块,分别验证桌面与移动布局。
New commits pushed, approval review dismissed automatically according to repository settings