Compare commits

..

312 Commits

Author SHA1 Message Date
suzmii 2292ae1fc1 Merge branch 'master' into fix/agc-canvas-acceptance-batch
Project CI / Frontend tests (pull_request) Waiting to run
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Waiting to run
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Waiting to run
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Waiting to run
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Waiting to run
Project CI / AI game creator shell Rust smoke (pull_request) Waiting to run
Project CI / AI game creator shell Rust crates (pull_request) Waiting to run
Project CI / Backend tests (pull_request) Waiting to run
Project CI / Native shell tests (pull_request) Waiting to run
Project CI / Repository checks (pull_request) Waiting to run
Project CI / AI game creator shell web tests (pull_request) Waiting to run
2026-09-14 19:59:44 +08:00
suzmii b077cb5277 更正 decision-log:「整理画布」最终位置固定在「生成素材」之后、「管理未完成编辑」之前(不在行尾)
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Has been cancelled
2026-09-14 19:30:02 +08:00
suzmii 8ad0487b8d 合并 fix/agc-resource-layout-manual:「整理画布」移入资源动作簇(离开行尾)
- 冲突解在 index.tsx 工具条动作区:两侧都要在同一位置插入按钮(WS1 的「生成任务」入口 +
  WS2 把「整理画布」从行尾移到「生成素材」之后),按「两侧语义都保住」解——
  「整理画布」在前(紧邻「生成素材」,满足其 previousElementSibling 断言与「不是行尾」断言),
  「生成任务」紧随其后,共用同一个闭合标签;行尾那份旧「整理画布」由 WS2 的删除 hunk 干净应用
- 已核对:ria-label="整理画布" 与 ria-label="生成任务" 在文件中各恰好一处
- 合并后实测:gc:typecheck 通过;resourceCanvasManualLayout 9 + appSurface 439 = 448 passed
2026-09-14 19:29:51 +08:00
suzmii 417b5ec630 「整理画布」移入资源动作簇:排在「生成素材」之后,不再挂在这一行行尾
- index.tsx:把「整理画布」从 game-workbench-view-actions 行尾(排序 tab 之后)
  移到「生成素材」之后、「管理未完成编辑」之前,与其它资源动作同类相邻,
  标签仍为 aria-label=\"整理画布\",零 CSS 改动
- index.tsx:语义与行为一字未改——disabled={!resourceLayoutReady}、
  aria-busy={resourceLayoutSaving}、onClick 仍调 activeResourceLayout.rederiveNow(),
  反馈仍走既有 resourceLayoutNotice / resourceLayoutSaving,changed 门保留
- resourceCanvasManualLayout.test.tsx:位置断言改为钉新位置——该行最后一个按钮不是它、
  它在「生成素材」之后(previousElementSibling)、在排序组左侧;
  继续保留「资源排列方式」组内只有「按依赖 / 按类型」与本按钮不在该组 /
  不在 .game-resource-sort-tabs 内的断言
2026-09-14 19:25:21 +08:00
suzmii 5adc16fbda Merge branch 'feat/agc-generation-task-progress' into fix/agc-canvas-acceptance-batch 2026-09-14 19:16:16 +08:00
suzmii 6c98c19c12 更正 decision-log:「整理画布」是资源工具条动作区里的独立动作按钮,不在「资源排列方式」分组内 2026-09-14 19:11:33 +08:00
lhk229 a7c40da6cf 修复自动切分问题节点恢复与临时文件清理
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 5m3s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 4m46s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 4m46s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 4m4s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m33s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m3s
Project CI / Frontend tests (pull_request) Successful in 4m13s
Project CI / Repository checks (pull_request) Successful in 3m26s
Project CI / Native shell tests (pull_request) Successful in 6m30s
Project CI / Backend tests (pull_request) Successful in 7m27s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m14s
Project CI / AI game creator shell Rust shard 1/4 (push) Has been cancelled
Project CI / AI game creator shell Rust shard 2/4 (push) Has been cancelled
Project CI / AI game creator shell Rust shard 3/4 (push) Has been cancelled
Project CI / AI game creator shell Rust shard 4/4 (push) Has been cancelled
Project CI / AI game creator shell Rust smoke (push) Has been cancelled
Project CI / AI game creator shell Rust crates (push) Has been cancelled
Project CI / Backend tests (push) Has been cancelled
Project CI / Native shell tests (push) Has been cancelled
Project CI / Frontend tests (push) Has been cancelled
Project CI / Repository checks (push) Has been cancelled
Project CI / AI game creator shell web tests (push) Has been cancelled
将 problematic_nodes 纳入失败判定并保留恢复状态
清理完成或放弃流程产生的 processed 和 binding 临时文件
2026-09-14 19:11:27 +08:00
suzmii 41c59a37a0 style(agc): 「生成任务」侧栏做视觉与信息层级收口(行为与语义一个不动)
- 新增 `resourceCanvasAssetGenerationTasksSidebar.css`:侧栏样式独立成文件,取值全部走平台设计 token
  (`--platform-subpanel-fill/-border`、`--platform-panel-shadow`、`--platform-text-muted`、`--platform-line-soft`、
  `--platform-neutral-*`、`--platform-accent`、`--platform-success-*`、`--platform-button-danger-*`、
  `--platform-input-focus-ring`),不硬编码任何颜色,也不新增第二套色板
- 条目卡片化:素材名为主信息(加粗、单行省略)、阶段文案为次要信息(muted、小一号)、
  已耗时 `font-variant-numeric: tabular-nums` + 右对齐(秒数跳动不抖)、失败原因 `overflow-wrap: anywhere`
  折行不截断、「定位到素材」轻量下划线按钮 + hover 换色
- 状态徽标成体系:`data-tone` 四档——排队中 `--platform-neutral-*`(中性)、生成中 `--platform-accent`
  (品牌色 + 呼吸感圆点,**不做百分比**)、已完成 `--platform-success-*`、失败 `--platform-button-danger-*`;
  tone 映射提到模型层 `resourceCanvasAssetGenerationTaskTone`(组件只导出组件与常量,保住 react-refresh 边界)
- 分栏标题小字 + 条数胶囊,两栏之间用 `--platform-line-soft` 分隔;空态只给一句简短文案
- 侧栏容器圆角 + 边框 + `--platform-panel-shadow` + `backdrop-filter: blur(10px)`;展开/折叠各有进场动画
  (位移 + 淡入,不做宽度 reflow 抖动);折叠把手是竖向标签 + 在途数量胶囊;列表滚动条细样式
- 无障碍与降级:`:focus-visible` 用 `--platform-accent` 焦点环 + `--platform-input-focus-ring`;
  `@media (prefers-reduced-motion: reduce)` 关掉全部 animation / transition 与 hover 位移;
  `@media (max-width: 480px)` 下侧栏撑满可用宽度、把手收窄,不挡画布操作
- 测试:新增 `resourceCanvasAssetGenerationTasksSidebarStyle.test.ts`(用仓库既有 `tests/styleCascade.ts`
  按真实层叠断言:四档 tone 互不相同且只引平台 token、tabular-nums + 右对齐、卡片圆角与 hover、
  过渡与把手、细滚动条、360px 降级、reduced-motion 关动效、焦点环);
  侧栏行为用例补「四种状态各自输出对应 data-tone」,并把原先断言 Tailwind 类名的部分交还给样式用例
- 未改任何行为:分栏、条数、已完成封顶 20、折叠不清列表、提交后自动展开、入口在途计数、
  定位终局化、非模态(无遮罩 / 无焦点陷阱 / 不进模态遮挡判据)全部保持原样
2026-09-14 19:11:21 +08:00
suzmii a6de1b5570 Merge remote-tracking branch 'origin/master' into fix/agc-canvas-acceptance-batch 2026-09-14 19:07:46 +08:00
suzmii 444bf9bc24 Merge branch 'fix/agc-resource-layout-manual' into fix/agc-canvas-acceptance-batch 2026-09-14 19:07:45 +08:00
suzmii 21c85c4dd1 「整理画布」移出「资源排列方式」分组,成为独立动作按钮
- index.tsx:把「整理画布」从 aria-label=\"资源排列方式\" 的 role=group 里搬出来,
  紧跟排序 tab 之后、作为 game-workbench-view-actions 动作区里的独立按钮,
  外观直接复用该容器既有动作按钮样式(有边圆角 + secondary 填充),不新增 CSS
- index.tsx:语义与行为一字未改——aria-label=\"整理画布\"、disabled={!resourceLayoutReady}、
  aria-busy={resourceLayoutSaving}、onClick 仍调 activeResourceLayout.rederiveNow(),
  成功/失败反馈仍复用既有 resourceLayoutNotice / resourceLayoutSaving,changed 门保留
- resourceCanvasManualLayout.test.tsx:新增结构断言——「资源排列方式」分组里只有
  「按依赖 / 按类型」两枚按钮、「整理画布」不在该容器内也不在 .game-resource-sort-tabs 里,
  同时仍是动作区内可用按钮(布局就绪后不再 disabled)
2026-09-14 19:07:22 +08:00
k88936 411f49a65d Merge pull request 'UI编辑器自动分图层切图标' (#304) from feat/ui-editor-auto-seperation into master
Project CI / AI game creator shell Rust shard 1/4 (push) Successful in 5m9s
Project CI / AI game creator shell Rust shard 2/4 (push) Successful in 4m33s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m31s
Project CI / AI game creator shell Rust shard 3/4 (push) Successful in 4m27s
Project CI / AI game creator shell Rust shard 4/4 (push) Successful in 4m26s
Project CI / AI game creator shell Rust crates (push) Successful in 2m0s
Project CI / Frontend tests (push) Successful in 4m14s
Project CI / Repository checks (push) Successful in 3m25s
Project CI / Backend tests (push) Failing after 5m18s
Project CI / Native shell tests (push) Successful in 6m55s
Project CI / AI game creator shell web tests (push) Successful in 3m17s
Reviewed-on: #304
2026-09-14 18:59:00 +08:00
suzmii a45172e055 同步文档:生成进度面收敛为常驻可折叠侧栏、提交即关面板、定位终局化、类型选项纵向列表
- PRD §3.10:进度面由「非模态浮层」改为「常驻画布的可折叠任务侧栏」(折叠把手带在途计数、两个分栏、已完成封顶 20、左侧覆盖式、提交后自动展开);定位动作终局化(跨栏目先切栏目 / 不在投影给结论 / 3 秒有界兜底)
- PRD §3.10 面板形态:改为「点「生成」即同步关闭面板、面板内不出现阶段文案;只有点击瞬间失败才带草稿重开;受理后失败只在侧栏收口」
- 栏目画布入口矩阵 §4/§4a:同步上述两条,并把 4a 标题由「「生成任务」面板」改为「「生成任务」侧栏」
- decision-log:新增 2026-09-14 条目(进度面收敛为常驻可折叠侧栏 + 提交即关面板 + 定位终局化,含位置取舍与覆盖式理由、五条变异证据);并在「素材类型」条目补记选项形态修订(纵向单选列表、radio 语义、方向键只移焦点、行列与滚动口径、建议后续抽 PlatformRadioList)
2026-09-14 18:50:48 +08:00
suzmii e6d92b2d98 Merge branch 'feat/agc-generation-task-progress' into fix/agc-canvas-acceptance-batch 2026-09-14 18:50:00 +08:00
suzmii ec02c39a5d feat(agc): 「生成任务」改造成常驻画布的可折叠侧栏(分栏 / 计数 / 自动展开 / 折叠不影响任务)
- ResourceCanvasAssetGenerationTasksPanelView 由非模态浮层改造成任务侧栏:展开时是贴边
  `<aside>`(`role="region"`、`aria-label="生成任务"`、不铺遮罩、不做焦点陷阱、不进模态遮挡判据),
  折叠时只留一个可点的贴边把手(`aria-label="展开生成任务"`)并带在途数量角标
- 位置取舍:右侧是「智能创作」对话面板、底部是栏目工具栏、顶部是栏目标题栏,所以挂在**左侧、标题栏
  之下、工具栏之上**(`top-16 / bottom-24 / left-3 / w-[300px]`)且是**覆盖式**而不是把画布挤窄——
  画布视口数学与资源卡排布都不被 reflow 动到,收起即完全让出画布;不再保留原来的浮层形态,没有平行入口
- 两个分栏:「排队/生成中」与「已完成」各带条数,只做客户端分组;「已完成」条数封顶 20 条(超出给出
  还剩多少条的说明),列表自身 `overflow-y-auto`,侧栏高度有界
- 入口按钮常驻可见并显示在途数量(`生成任务 · N`,无在途时仍是「生成任务」,`aria-label="生成任务"` 保留),
  把手上的角标同步;提交受理后侧栏自动展开(对齐网页端排队提交后主动弹任务栏)
- index.tsx:新增在途数量派生;侧栏常驻渲染并受同一个开合开关控制,折叠只影响这个视图,
  任务本身仍活在账本与本地队列里
- 测试:任务侧栏用例改为侧栏形态并补「两个分栏 + 条数」「高度有界 + 列表滚动 + 已完成封顶 20」
  「折叠后把手带上在途计数(0 / 2)」;AppSurface 补「提交后自动展开」「折叠期间任务照常推进、
  在途计数归零、再展开仍能看到结果」
2026-09-14 18:49:22 +08:00
kdletters e8403e547b 补齐游戏从策划到成品的完整生产流程
Project CI / AI game creator shell Rust shard 1/4 (push) Successful in 5m15s
Project CI / AI game creator shell Rust shard 2/4 (push) Successful in 4m33s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m33s
Project CI / AI game creator shell Rust shard 3/4 (push) Successful in 4m29s
Project CI / AI game creator shell Rust shard 4/4 (push) Successful in 4m19s
Project CI / AI game creator shell Rust crates (push) Successful in 1m53s
Project CI / Frontend tests (push) Successful in 4m10s
Project CI / Repository checks (push) Successful in 3m19s
Project CI / Native shell tests (push) Successful in 6m39s
Project CI / Backend tests (push) Successful in 7m27s
Project CI / AI game creator shell web tests (push) Successful in 3m6s
新增 AGC 完整游戏生产 workflow Skill,定义策划、资源、实现、构建、试玩和交付阶段。

将真实美术生成、处理、登记和接入从可选提示改为新游戏交付链路要求。

同步 Skill Pack 清单、系统提示、测试契约和实施计划文档。
2026-09-14 18:43:12 +08:00
kdletters 90d216e241 Merge remote-tracking branch 'origin/master'
Project CI / AI game creator shell Rust shard 1/4 (push) Successful in 4m58s
Project CI / AI game creator shell Rust shard 2/4 (push) Successful in 4m38s
Project CI / AI game creator shell Rust shard 3/4 (push) Successful in 4m27s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m41s
Project CI / AI game creator shell Rust shard 4/4 (push) Successful in 4m21s
Project CI / AI game creator shell Rust crates (push) Successful in 1m55s
Project CI / Frontend tests (push) Successful in 4m32s
Project CI / Repository checks (push) Successful in 3m34s
Project CI / Native shell tests (push) Successful in 7m1s
Project CI / Backend tests (push) Successful in 7m36s
Project CI / AI game creator shell web tests (push) Successful in 3m15s
2026-09-14 18:35:22 +08:00
suzmii 14a0286f70 fix(agc): 生成面板点击即关闭、面板内不再出现阶段文案,只有即时失败才把草稿带回来
- ResourceCanvasAssetGenerationPanelView:删掉 `phaseDetail` 通道与整套在途状态(`submitting` /
  禁用输入 / 「后台运行并关闭」),主按钮文案恒为动作名;提交时**同步**调用 onSubmit 并 onClose,
  面板不等 IPC、不等排队、不等生成。新增 `draft` / `error` 两个入参:只有「后端从未受理」的即时
  失败重开时,宿主才把草稿与原因带回来(`role="alert"` 可见、改完即可重试)
- index.tsx:`submitResourceAssetGeneration` 改为同步返回(不再 await 终局),记录本次提交上下文
  (taskId / action / 草稿 / 是否本来就该立刻派发),提交后自动开任务面板并给一次提示条;
  收尾回调里区分两类失败:`record === null` 且本来就该立刻派发 → 重开提交面板并带回草稿;
  受理之后才失败 → 不重开面板,只在任务面板收口为失败 + 提示条
- index.tsx:删掉只为旧「在途阶段文案」服务的 `resourceAssetGenerationPanelTaskIdRef` 与成功后的
  自动收面板逻辑(面板此时已关闭)
- 测试:`resourceCanvasAssetGenerationBackgroundClose.test.tsx` 的图片类用例改写为「点击即关闭 +
  面板 DOM 里从不出现 排队中。/正在生成。/提交中…」+「即时失败重开带回草稿与原因」;音频面板用例不变
- 测试:`resourceCanvasBottomToolbar.test.tsx` 的失败重试用例按新语义改写(点击即关闭、重开时显示原因)
- 测试:AppSurface 新增三条(同步关闭且面板无阶段文案、后端未受理时重开并保留草稿、受理后失败不重开
  只在任务面板收口),并把既有生成任务 e2e 的提交步骤改为「点击即关闭」
- 顺带按仓库规范修正以上文件的 eslint import sort 与 prettier 格式(未触碰无关文件)
2026-09-14 18:35:11 +08:00
kdletters c799d00a93 记录分支保护现状:不把 Project CI 配成合并必需检查
复核后确认本仓库不把 Project CI 的 context 配成 master 分支保护的合并必需检查,合并前由人工
确认最近一次结果。据此把文档里"必须设为合并必需检查 / 需补 6 个新 context"的强制口径改成
与现状一致,避免下次有人照着一个不执行的待办去逐个勾选 context:

- 开发运维文档:说明当前不配 required context(代价是门禁红了不会自动阻止合并),把 11 个
  context 清单降级为"将来若要启用时的清单",并保留"不能残留已不再上报的旧 job 名,否则 PR
  会永远停在等待该检查"这一条;master 交付口径里"当前 head 的七个 required context 全绿"
  改为"最近一次 Project CI 全绿"。
- shared-memory/decision-log:AGC 壳分片那条的"影响范围"不再把它列为待补 context 的待办。
- shared-memory/pitfalls:置顶条目新增"分支保护口径",并把旧条目里"要补齐两个新 AGC
  context"改成"确认没有残留旧 job 名"。
- .craft 的 gitea-ci-triage 技能同步为"改 job 集合或 job 名不需要同步分支保护"。

验证:prettier、check:encoding、check:doc-index 通过。

Co-authored-by: DotCraft <273930855+dotcraft-ai@users.noreply.github.com>
2026-09-14 18:35:00 +08:00
lhk229 2b5ce24a97 Merge branch 'master' into feat/ui-editor-auto-seperation
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 4m48s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 4m21s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 4m16s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m33s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 3m55s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m52s
Project CI / Frontend tests (pull_request) Successful in 4m10s
Project CI / Repository checks (pull_request) Successful in 3m14s
Project CI / Native shell tests (pull_request) Successful in 6m35s
Project CI / Backend tests (pull_request) Successful in 7m32s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m58s
2026-09-14 18:31:38 +08:00
suzmii 2f47540eeb fix(agc): 「定位到素材」每次点击都终局化,不再卡在「正在定位生成的素材…」
- index.tsx 新增 `resourceAssetGenerationFocusRequest` 序号并加进聚焦 effect 的依赖:手动点定位不改画布
  任何状态,原依赖一个都不变 → effect 不重跑、intent 永远没人消费,这正是「点了没反应 + 提示条永久
  停在中转文案」的根因
- index.tsx `focusResourceAssetGenerationTask` 重写:先按当前投影与清单判一次目标——不在投影里就当场给
  结论(素材已不在项目里 / 已登记但尚未同步),不挂 intent 也不留中转提示;在别的栏目先切栏目再定位;
  挂 intent 后推进聚焦请求序号,并起一个 3 秒有界兜底:仍停在中转文案就收口成可执行提示,intent 被判
  invalid 被静默清掉时也给一条「定位请求已失效」的结论,绝不留下悬而未决的状态
- index.tsx 聚焦 effect 的 `focusedCommitIdsRef` 提前返回分支补 `setResourceWorkbenchNotice('')`:
  已聚焦过时把中转提示一并收掉,不再永久留在提示条上(自动落卡那条链同源问题)
- index.tsx `resourceAssetGenerationContextRef` 扩到带 `manifest` / `resources` / `activePageCategory`
  并在每次渲染刷新:定位回调据此取权威目标与栏目,不再依赖可能过期的闭包值
- 新增 4 条 AppSurface 用例(同栏目直点定位并选中卡片、素材在另一个栏目先切栏目再定位、被搜索挡住时给出
  既有「清除搜索并定位」、素材不在项目里时给明确结论且清掉中转提示)
2026-09-14 18:20:50 +08:00
suzmii a2b016bb9b Merge branch 'feat/agc-generation-task-progress' into fix/agc-canvas-acceptance-batch 2026-09-14 18:18:45 +08:00
suzmii b898590c7d 合并 feat/agc-resource-type-entry:类型选项改纵向单选列表
- 合并 WS4 追加修复(928a0ea13:类型选项由横排 PlatformSegmentedTabs 改为 role=radiogroup 纵向单选列表,
  复用共享 PlatformNavigableListItem,列表有界独立滚动,rogiving tabindex + 方向键移焦点、Enter 落盘)
- 同时并入 origin/master a70ef2d6e(PR #354 Windows sccache / CI 分片改「一片一 job」)
- decision-log.md / pitfalls.md 冲突按「上游改写优先、我方新增保留」解:
  保留我方新增的「放开手工图片生成本地并发」「素材类型独立入口」「退役同步命令」三条与
  「严格 IPC 桩缺登记新命令」一条;AGC 壳 Rust 套件条目采用上游改写后的新标题(「一片一 job」),
  删掉被它取代的旧标题(旧正文早已被上游替换),不留自相矛盾的两条
2026-09-14 18:18:30 +08:00
suzmii 4e277798b8 Merge remote-tracking branch 'origin/master' into feat/agc-resource-type-entry 2026-09-14 18:17:10 +08:00
suzmii 928a0ea13e 素材类型选项改成纵向单选列表,不再横排成一条
- ResourceTypePanel:选项区从 PlatformSegmentedTabs(3~6 列网格,6 项正好挤成一行)换成纵向单选列表,复用共享的 PlatformNavigableListItem 作行骨架
- ResourceTypePanel:容器改为 role="radiogroup" + aria-label,每项 role="radio" + aria-checked,选中态与读屏读的是同一个属性
- ResourceTypePanel:roving tabindex(只有选中项 tabIndex=0)与方向键在选项间移动焦点,走到头不越界;方向键不顺手选中,Enter/Space 才落盘(选中=一次 CAS 写盘,浏览选项不该连环写盘)
- ResourceTypePanel:选中行额外渲染勾选图标作为第二视觉线索,图标 aria-hidden 不污染可读名字
- resourceTypePanel.css:选项容器改成单列网格(grid-template-columns: minmax(0, 1fr) + grid-auto-flow: row + align-content: start),一行一个选项
- resourceTypePanel.css:选项行补 width/min-width/min-height: 44px 与 overflow-wrap,移动端热区与窄屏换行都不依赖共享件的工具类
- resourceTypePanel.css:选中态由 [aria-checked='true'] 驱动并显式提权到 (0,3,0) 以上(含覆盖 :hover:not(:disabled)),避免被共享列表行的悬停底色顶掉
- resourceTypePanel.css:滚动从 body 挪到选项列表(列表现有 max-height: min(320px, 40dvh) + overflow-y: auto),body 改为 auto/minmax(0,1fr)/auto 三段,标题、素材名与错误提示不跟着滚
- 测试:新增「选项区是纵向单列列表」用例,按 styleCascade 解析真实生效声明(360/390/1440 三档宽度都是单列、行满宽、热区 44px),并断言 6 项都是 radiogroup 的直接子元素
- 测试:新增「单选语义与键盘」用例(radiogroup/radio + aria-checked + roving tabindex,方向键只移焦点不落盘,Enter 才写盘)
- 测试:新增「选中态由 aria-checked 驱动并压过共享列表行悬停底色」用例
- 测试:把「面板有高度上界且中间行可滚动」改成「选项区有上界并独立滚动,标题与错误提示不滚」
- 测试:集成用例的类型选项查询从 button/aria-pressed 改为 radio/aria-checked
2026-09-14 18:16:56 +08:00
lhk229 a70ef2d6e1 Merge pull request 'Opt/win ssache' (#354) from opt/win-ssache into master
Project CI / AI game creator shell Rust shard 2/4 (push) Successful in 5m21s
Project CI / AI game creator shell Rust shard 3/4 (push) Successful in 5m27s
Project CI / AI game creator shell Rust shard 4/4 (push) Successful in 5m30s
Project CI / AI game creator shell Rust shard 1/4 (push) Successful in 5m37s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m32s
Project CI / AI game creator shell Rust crates (push) Successful in 2m19s
Project CI / Repository checks (push) Successful in 3m6s
Project CI / Frontend tests (push) Successful in 4m18s
Project CI / Native shell tests (push) Successful in 6m25s
Project CI / Backend tests (push) Successful in 7m18s
Project CI / AI game creator shell web tests (push) Successful in 2m58s
Reviewed-on: https://git.genarrative.world/git/GenarrativeAI/Genarrative/pulls/354
2026-09-14 18:15:12 +08:00
lhk229 0fea75952a 保留显式 sccache wrapper 路径
探测成功后将用户配置的 wrapper 原样交给 Cargo
2026-09-14 18:15:12 +08:00
lhk229 25769ad5e8 更新 AGC 构建版本
同步 AI Game Creator Shell 的包、Tauri 和锁文件版本
2026-09-14 18:15:12 +08:00
lhk229 b7100c7188 使用用户配置路径探测 sccache
Windows wrapper 探测改用显式配置的可执行路径

将 wrapper 路径纳入探测缓存键
2026-09-14 18:15:12 +08:00
lhk229 cf4a275d26 缓存 sccache 探测结果避免重复阻塞
在当前 dev 编排进程内复用 sccache wrapper 探测结果

避免 API 与 worker 重启重复同步等待

同步更新排障文档
2026-09-14 18:15:12 +08:00
lhk229 fed9960684 修正 POSIX sccache 绕过日志
明确记录 Linux 和 macOS 本地开发实际绕过 sccache

补充 POSIX 日志回归测试并更新排障文档
2026-09-14 18:15:12 +08:00
lhk229 a3918c89f0 按显式配置控制 Windows sccache
未配置 wrapper 时默认回退到直接 rustc

处理 sccache 探测失败与 wrapper 配置冲突

同步更新开发运维和排障文档
2026-09-14 18:15:12 +08:00
lhk229 f955661146 增强 Windows sccache wrapper 探测回退
使用限时真实 rustc wrapper 探测替代版本检查

探测失败或超时时回退到直接 rustc

同步更新 sccache 故障排障记录
2026-09-14 18:15:12 +08:00
lhk229 5cf5b541af 修正 sccache 测试的平台隔离
为启用 sccache 的用例补充 Windows platform mock

确保 POSIX 环境下测试不会误走 env wrapper 分支
2026-09-14 18:15:12 +08:00
lhk229 dcaa1a2dd5 支持 Windows 本地 sccache 自动回退
Windows 本地开发检测可用的 sccache 并启用缓存

未安装或不可执行时清空 Rust wrapper 并回退到 rustc

补充测试并更新开发运维文档
2026-09-14 18:15:12 +08:00
suzmii cdc0e3d163 fix(agc): 生成任务读门禁用合法 command id、中断任务按清单核对不谎报未完成,并同步注释事实
- asset_generation_tasks.rs:`list_local_project_asset_generations` 的读门禁 command id 由 `asset.read`
  改为契约里真实存在的 `asset.list`(`asset.read` 不在命令表里,写进 `denied_commands` 也不可能命中
  → 原门禁恒不生效);补用例把 `asset.list` 放进项目策略 `denied_commands` 后读账本必须被拒
- asset_generation_tasks.rs:中断任务收口改为与 manifest 交叉核对(新增账本字段 `output_path`,serde 默认值
  兼容旧账本):能找到本次请求的精确落点 → 按事实收口为已完成并带上 assetId;落点存在但清单里没有
  → 报「目标素材未登记,生成未完成」;没有精确落点或清单读不到 → 只报「状态未知(可能已完成)」,不再
  对「素材已登记、账本还停在 running」的窗口谎报「生成未完成」
- asset_generation_tasks.rs:补四条用例(已登记→已完成、未登记→未完成、无落点→状态未知、读门禁可拒绝),
  并把既有的两条中断用例按新语义改为断言「状态未知」
- resourceCanvasBottomToolbarModel.ts:两处注释的入口命令名改为 `start_local_project_asset_generation`
- check-config.mjs:`generate_local_project_asset` 白名单注释改为「没有生产调用方,只有 Rust 集成测试与
  commands.rs 单测在调,待后续批次删除或改为转调 start_local_project_asset_generation」
- resourceCanvasAssetGenerationTaskModel.ts / resourceCanvasAssetGenerationQueue.ts:把「远端 single-flight
  输出槽会拒绝并发」这个已不成立的排队理由改为当前事实——本地 durable 输出槽已按精确动作指纹分槽,
  本批仍按「同一时刻只派发一条」排队是**提交节流**,真并行派发需要并发收口设计,留待下一批
2026-09-14 18:13:12 +08:00
suzmii 8ac77cb090 同步共享记忆与专题文档:并发槽身份、素材类型入口、退役同步命令
- PRD §3.10 本地排队一条:删掉已失效的「共用 single-flight 输出槽」理由,改为「本地槽已按精确动作指纹分槽(具备并行能力),本批前端仍按单条在途排队,真并行派发留待下一批」
- 栏目画布底部工具栏入口矩阵 §4a:同上更正,并写明槽身份材料的 8 个字段与旧槽懒迁移
- decision-log:追加三条 2026-09-14 条目(放开手工图片生成本地并发 / 素材类型拆成独立入口 / 同步命令 generate_local_project_asset 退役为仅测试调用)
- decision-log:更正同日「图片类生成后台化」条目里已被同批次推翻的两处表述(槽身份、本地排队的理由),并给 2026-09-11 的类型选择器入口决策加「已被取代」标记
- decision-log/pitfalls:把「严格 IPC 桩缺登记新命令」的排障经验记入共享记忆(unhandled rejection 与不相干提示断言的组合症状、桩必须返回数组、形状错会「看着绿」)
- 端到端验收用例 S12:更正「用户手动设置 category 已移除」与「面板内删除资源是唯一入口」两处与当前实现不符的描述
2026-09-14 17:52:27 +08:00
suzmii 7240b3793f Merge branch 'feat/agc-generation-task-progress' into fix/agc-canvas-acceptance-batch 2026-09-14 17:50:40 +08:00
suzmii 4fff733516 fix(agc): 生成任务账本读不到时不再抛未处理拒绝,改为保留本地状态并给出提示
- resourceCanvasAssetGenerationTaskModel.applyLocalProjectAssetGenerationRecords:入参在函数入口归一化,
  非数组(undefined / null / 字符串 / 数字 / 对象)一律按「没有后端记录」处理,数组内的垃圾条目
  (null / 数字 / 缺 taskId)逐条丢弃;类型放宽为 `readonly …[] | null | undefined`
- resourceCanvasAssetGenerationQueue:轮询 `list_local_project_asset_generations` 的 IPC 拒绝与非数组
  返回值都在本地接住,按「本轮读不到」计数;到上限后按「账本不可用」与「账本里没有这条」两种原因分别收口;
  派发循环再补两道兜底(dispatch 意外抛出、宿主 onSettled 抛出),保证 `void (async …)()` 不产生未处理拒绝、
  也不会把任务永远卡在「已派发但未终态」
- index.tsx 恢复任务账本的 effect:IPC 拒绝与返回非数组都落到既有提示条
  「生成任务列表读取失败,暂时无法恢复历史任务」,本地任务列表保持原样不清空
- 测试:模型层补「undefined / 非数组 / 垃圾条目不抛错且列表不变」,驱动器层补
  「轮询返回 undefined」「轮询 IPC reject」两条(收口原因、不产生未处理拒绝、后续排队任务照常补发)
- AppSurface 补两条:账本返回 undefined / 读取被拒绝时视图照常渲染、生成入口还在、提示可见
- AppSurface 既有的「布局读时提示」用例显式登记 `list_local_project_asset_generations` 返回空账本:
  该命令是只读的独立链路,严格桩把它判成 unexpected invoke 会让新提示混进「没有任何提示」的断言
2026-09-14 17:47:03 +08:00
k88936 b082addc34 Merge remote-tracking branch 'origin/master' into feat/ui-editor-auto-seperation
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 5m1s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 4m35s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m31s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 4m42s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 4m38s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m49s
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
2026-09-14 17:41:36 +08:00
suzmii 5d336bf147 Merge branch 'fix/agc-resource-layout-manual' into fix/agc-canvas-acceptance-batch 2026-09-14 17:40:50 +08:00
suzmii 3d6d51737c 测试 harness 登记 WS1 新增的后台生成任务账本 IPC
- resourceCanvasManualLayout.test.tsx:installLayoutTauri 登记
  list_local_project_asset_generations(工作台打开 / 切项目时由 WS1 的生成任务面板读取),
  回空账本,形状按 src-tauri/src/asset_generation_tasks.rs 的
  list_local_project_asset_generations 返回值核对为数组(Vec<AssetGenerationTaskRecord>),
  与前端 invoke<LocalProjectAssetGenerationTaskRecord[]> 一致,不是 { tasks: [] }
- 保留 unexpectedCommands 断言不放宽,也不删除:这条门禁继续拦截意外 IPC
2026-09-14 17:38:21 +08:00
kdletters 2566ae705f AGC 壳 Rust 套件改为「一片一个 job」,客户端 Rust 关键路径压到 7 分钟以内
Project CI / AI game creator shell Rust shard 2/4 (push) Successful in 3m53s
Project CI / AI game creator shell Rust shard 1/4 (push) Successful in 4m11s
Project CI / AI game creator shell Rust shard 3/4 (push) Successful in 4m6s
Project CI / AI game creator shell Rust shard 4/4 (push) Successful in 4m2s
Project CI / AI game creator shell Rust smoke (push) Successful in 1m26s
Project CI / AI game creator shell Rust crates (push) Successful in 2m21s
Project CI / Backend tests (push) Successful in 6m22s
Project CI / Native shell tests (push) Successful in 5m25s
Project CI / Repository checks (push) Successful in 2m17s
Project CI / Frontend tests (push) Successful in 2m58s
Project CI / AI game creator shell web tests (push) Successful in 2m6s
上一轮把 2466 条 bin target 单测切成 4 片放在同一个 job 内多进程并行,run 2102 证明这条路
不通:门禁步骤跑满 18 分钟仍未结束,比整套串行的 507 秒还慢——同一容器内这几片共享
HOME、target 目录与固定临时路径,会互相拖慢。这一轮改成按 job 拆分。

- run-rust-shell-test-shards.mjs 新增 --shard-index=<i>:只跑第 i 片,供 CI 的每个分片 job
  使用;覆盖自校验(片并集等于 --list 全集且互斥)仍针对全集执行,所以每个 job 都会
  发现分片规则改动,不会被"只跑一片"绕过。负例 --shard-index 超出 --shards 立即失败。
  不传 --shard-index 时行为不变(一条命令把 N 片放进程里并行),留给本地全量自测。
- project-ci.yml 由 7 个 job 变 11 个:原 AGC Rust job 拆成 AI game creator shell Rust
  shard 1/4 ~ 4/4 与 AI game creator shell Rust smoke,加上已有的 Rust crates,AGC 相关
  门禁共 6 个 job。4 个片 job 只预热 AGC 壳自己那份锁定依赖,且与 smoke、crates 一样都是
  纯 cargo 门禁,因此这 6 个 job 都不再执行 npm ci(每个省 1~3 分钟)。
- check-native-shells.mjs 分组由五个变十个:agc-rust-shard-1 ~ agc-rust-shard-4 与
  agc-rust-smoke 取代 agc-rust-shell;每个分片分组的命令是
  `npm run ai-game-creator-shell:check:rust:shell -- --shard-index=<i>`。
- project-ci-workflow.test.ts 相应更新:11 个 job、6 个 job 免 npm ci、10 个分组各被一个
  job 恰好调用一次,并新增「每个分片 job 都落到 --shard-index」「4 个 index 各一次」
  「分片运行器保留覆盖自校验」等断言。
- 同步运维文档、development-workflow、decision-log、pitfalls 与 gitea-ci-triage 技能到
  job 级分片口径,并记录 run 2102 的反面实验,避免以后又改回单 job 内并行。

验证:npx vitest run scripts/project-ci-workflow.test.ts(12 passed)、eslint、prettier、
check:encoding(13330 文件)、check:doc-index、--groups=contract、mobile check-config 全绿;
分片运行器本地以 agent-runtime-core(7 条 → 2/2/2/1)验证 --shard-index 四个 index 各自
只跑一片、片 TMPDIR 隔离、无 index 时全量模式不变。Gitea master 分支保护需补 6 个新
context(共十一个),其中含 4 个分片 job、smoke job 与 crates job。

Co-authored-by: DotCraft <273930855+dotcraft-ai@users.noreply.github.com>
2026-09-14 17:32:06 +08:00
suzmii 1de661df10 Merge branch 'feat/agc-generation-concurrency' into fix/agc-canvas-acceptance-batch 2026-09-14 17:31:40 +08:00
suzmii 6b5f67d207 Merge branch 'feat/agc-generation-task-progress' into fix/agc-canvas-acceptance-batch 2026-09-14 17:31:32 +08:00
suzmii 74b3760d0f docs(prd): 同步功能画布生成入口的后台化事实
- 头部更新时间改为 2026-09-14 并说明本次同步内容,2026-09-13 的原口径与其余合同保持不变的声明保留
- §3.10 实现状态补 2026-09-14 后台化口径(提交即返回 + 项目内任务账本 + 本地排队 + 非模态「生成任务」面板)
- §3.10 接线:图片类入口由 `generate_local_project_asset` 改写为 `start_local_project_asset_generation` + `list_local_project_asset_generations`
  + 项目内账本 `.agent/runtime/asset-generation-tasks/tasks.json`;音频 / 上传两条接线不变
- §3.10 新增「本地排队与进度可见」一条:第二条停在本地队列不调用提交 IPC、阶段文案由后端账本提供、
  非模态「生成任务」浮层与按素材卡定位
- §3.10 面板形态:补「提交期间面板不锁关闭」(×/遮罩/Esc/「后台运行并关闭」),并明确关闭不等于取消请求
- §3.10 前置规范图:命令名同步,并明确「后台化没有改这条前置判据」(`ui-prototype` / `art-spritesheet` 判据不变)
- §7.9 第 3 条:改写为 `start_local_project_asset_generation` 的载荷与「提交即返回」事实,
  保留「原载荷字段名与取值口径逐字不变」的说明,并补 `projectId` / `taskId` 两个新增字段
- §7.9 第 6 条:配对读改为「发生在该任务收口之后(提交命令不再等待生成)」,音频入口描述不变
- §7.9 新增第 8 条:生成期间可退出、面板关闭后进度可见、第二条本地排队(IPC 次数 1→2)、
  两条各自完成后各走一次「配对读 + 落卡」且 revision 单调
2026-09-14 17:30:08 +08:00
suzmii 53026fe8f3 放开 AGC 手工图片生成的 durable 输出槽并发生成限制
- canvas_generation.rs:standalone 图片生成的 durable 输出槽身份改为由精确动作身份派生(run_id = slot-<actionFingerprint>),同一项目里不同 prompt/素材名/参数的生成各自独立成槽,可以同时在途
- canvas_generation.rs:动作指纹材料逐字节保持升级前取值,新增 legacy_standalone_platform_art_generation_run_id 复现升级前 {outputPath, requireSlices} 槽公式,只用于定位升级前遗留账本
- canvas_generation.rs:在取得 durable guard 之后、任何远端 POST 之前调用旧槽账本一次性迁移
- external_generation_state.rs:新增 adopt_legacy_standalone_platform_art_generation_runtime_state_at,在项目写锁内把仍属于本次精确动作的旧 slot- 账本迁移到新身份路径并保留原 idempotencyKey 与 operationId;属于其他动作的旧账本原样保留,不迁移、不删除、不阻塞
- external_generation_state.rs:新增三个 #[cfg(test)] 只读访问器,供跨模块用例断言账本身份
- canvas_generation.rs:新增两条不同动作并发都成功且远端各 POST 一次、不同动作的 durable 槽互不阻塞、旧槽账本仅被同一精确动作迁移三组用例;同动作并发冲突用例改用同一精确动作以钉住幂等语义
2026-09-14 17:30:00 +08:00
suzmii bb7cbae118 feat(agc): 图片类生成后台化,生成面板可随时关闭并新增「生成任务」进度面板
- Rust 新增 asset_generation_tasks.rs:图片类生成拆成「提交即返回任务记录 + 后台 spawn 生成」,
  生成本身仍转调既有 generate_platform_art_asset_with_options_at(不复制生成 / 幂等 / 登记逻辑)
- 任务账本落项目内 .agent/runtime/asset-generation-tasks/tasks.json(复用 agent runtime sidecar 原语),
  阶段文案 phaseDetail 由后端拥有,读取时把上次运行留下的非终态记录收口为「中断失败」,账本上限 50 条
- Rust 新增 IPC start_local_project_asset_generation / list_local_project_asset_generations 并在 main.rs 注册;
  同步命令 generate_local_project_asset 保留不动
- 新增前端纯模型 resourceCanvasAssetGenerationTaskModel.ts:任务状态机、在途判据、账本恢复、耗时文案
- 新增 resourceCanvasAssetGenerationQueue.ts:本地排队驱动器,第二条不发提交 IPC、前一条终态后自动补发,
  状态与阶段一律以后端账本为准,账本查不到该任务时按上限停止等待
- 两块生成浮层在提交期间放开 × / 遮罩 / Esc,次按钮在途时改为「后台运行并关闭」(关闭不等于取消请求),
  图片类面板的在途文案改为渲染后端 phaseDetail
- 新增非模态「生成任务」面板(不铺遮罩 / 不做焦点陷阱 / 不进模态遮挡判据),显示状态、后端阶段、
  已耗时与素材名,已完成条目复用 pendingResourceFocusRef 聚焦链定位素材卡
- index.tsx 宿主接线:任务列表状态与 ref、提交回调不再读面板状态、按项目恢复任务账本、
  工具栏「生成任务」入口按钮与面板渲染点
- check-config.mjs:把已无前端调用方的同步命令 generate_local_project_asset 登记进 native-only 白名单
- 测试:新增「生成面板提交期间可关闭」「本地排队驱动器」「生成任务面板」三组用例;
  appSurface 生成载荷断言改为 start_local_project_asset_generation + list 轮询桩
- 文档:入口矩阵补 §4a 与验证命令、V3 验收 S11a 判据、decision-log 记录本次决策
2026-09-14 17:26:36 +08:00
suzmii 0b3bf3e52d 合并 fix/agc-resource-layout-manual:资源画布改为手动整理口径
- 合并 WS2 分支(新素材不再自动重排 + 显式「整理画布」+ 生成后自动聚焦)
- index.tsx 与 useProjectResourceCanvasLayout.ts 自动合并成功,无需手工介入
- decision-log.md / pitfalls.md 冲突按「两侧语义都保住」解:保留 origin/master 新增的
  「AGC 壳 Rust 套件分片并行」与「根门禁 label 字面量契约」两条,同时保留 WS2 新增的
  「AGC 资源画布改为手动整理」与「不要恢复无条件重派生」两条,只删除冲突标记行
- 新增 tests/resourceCanvasManualLayout.test.tsx
2026-09-14 17:16:58 +08:00
suzmii 6d5cd51649 Merge branch 'fix/agc-preview-alpha-background' into fix/agc-canvas-acceptance-batch 2026-09-14 17:16:30 +08:00
suzmii 181e364d80 AGC 资源卡棋盘格底改按图像真实 alpha 判定
- 原生预览新增头部级 alpha 判据:`LocalProjectImagePreview.hasAlpha`(PNG colorType 4/6 或 tRNS、WebP VP8X/VP8L alpha 标志;JPEG 恒 false),只读签名与 chunk 头、不做像素解码。
- 前端预览 payload 增加可选 `hasAlpha`,并在 `materializeProjectResourceCardPreview` 的两条分支里透传。
- 资源卡根节点新增排障属性 `data-preview-has-alpha`:只有预览已加载且判据为真才写 `'true'`,其余一律不写(缺属性与不透明同档)。
- 棋盘格底选择器加 `[data-preview-has-alpha='true']` 条件;无 alpha 时退回卡片既有纯色底,不引入第二套底色。
- 新增 TS 用例(真渲染资源卡 + styles.css 声明级层叠求值)与 Rust 用例(PNG/WebP/JPEG 头部判据、tRNS、坏文件失败关闭、非解码证明、IPC 字段序列化契约)。
- 验收文档补记 `data-preview-has-alpha` 判据与「真假棋盘格」取证脚本,便于现场区分真透明底与 AI 画出的假棋盘格。
2026-09-14 17:13:43 +08:00
suzmii 3b8ecb02d4 记录 AGC 资源画布「手动整理」口径变更
- decision-log:追加 2026-09-14 条目,记录默认 preserve、显式「整理画布」、
  依赖侧关系图首次就绪的一次性重派生、新素材按 manifest 新增 id 聚焦四条决策与变异验证
- pitfalls:追加「不要恢复无条件重派生」条目,含 changed 门、ready 时序、
  项目作用域 flag 与新素材基线四个易错点
2026-09-14 17:08:00 +08:00
suzmii d02d0ed7a4 AGC 资源画布:新素材不再自动重排,改为显式「整理画布」并在生成后自动聚焦新素材
- useProjectResourceCanvasLayout:资源写意图新增 rederive 标记,显式整理那一笔按 rederive
  策略重算自动坐标(手动坐标原样保留),自动同步仍是 preserve 只补新卡
- useProjectResourceCanvasLayout:新增 rederiveNow(),复用既有写队列 / sidecar 写回链路,
  只在坐标确有变化时落盘,成功复用既有「布局已保存」提示
- index.tsx:两个排序模式的 rederiveAutomaticPositions 都固定 false,画布不再因为资源
  协调签名变化(新增素材、改标签、改分类、拓扑重建)整体重排
- index.tsx:依赖侧「关系图首次就绪」改为按项目作用域的一次性 flag,等该侧 sidecar ready
  后调用一次 rederiveNow(),之后一律只补新卡(切排序 tab 不重新武装)
- index.tsx:依赖/类型 tab 组新增「整理画布」按钮,作为整张画布重排的唯一显式入口
- index.tsx:新增 manifest.assets 新增 id 检测(seenManifestAssetIdsRef),把新卡交给既有
  pendingResourceFocusRef + advanceFocusGeneration() 裁决链聚焦;首次打开 / 切项目只登记
  基线不聚焦,重命名不改 id 天然不触发,已有同目标意图时不重复挂
- 新增 tests/resourceCanvasManualLayout.test.tsx(8 条):新素材入库后既有自动坐标逐值不变、
  依赖侧首次就绪后不再重排、新素材自动聚焦、被搜索挡住走既有「清除搜索并定位」、
  「整理画布」重算并保留手动坐标、已经整齐时再按一次不写盘、首次打开与切项目不聚焦
2026-09-14 17:07:55 +08:00
suzmii ef3e783ab1 Merge remote-tracking branch 'origin/master' into feat/agc-resource-type-entry 2026-09-14 17:07:36 +08:00
suzmii 7ce4a3a9c6 把素材类型从「编辑素材标签」面板拆成独立入口
- 新增 ResourceTypePanel(src/view/project-development/ResourceTypePanel.tsx):类型选一项即落盘,category 传用户选中值、tags 逐字回传落盘原值,保存在飞时沿用 closeOnBackdrop/closeOnEscape = !saving
- 新增 resourceAssetDisplayName.ts:两块面板共用同一个素材名副标题口径(localPath basename),不再各写一份
- 新增 resourceTypePanel.css:类型面板的弹窗骨架与信息浮层「分类」行入口样式,按 AGC 内独立文件约定,不动 packages/** 与 styles.css
- ResourceClassificationPanel 删掉类型 chip 与 categoryChoice:保存时恒回传 gameCreationAppAssetPersistedCategory(asset),「只改标签不动分类」由结构保证
- index.tsx 新增 resourceTypeAssetId 与 resourceTypeAsset;工具条在「编辑标签」旁新增「素材类型」按钮(Shapes 图标)
- index.tsx 用合并后的 resourceClassificationOverlayOpen 纳入点外部/Esc 浮层遮挡判据,并同步 useEffect 依赖项
- index.tsx 渲染新面板:保存成功后由宿主收起面板并沿用 manifest 重载路径,让卡片立刻落到新栏目
- 信息浮层「分类」行接出第二入口:按钮渲染在 dd 之外,不污染 dt/dd 字段读取口径;非 manifest 资产不给入口
- resourceCanvasInfoModel 导出 RESOURCE_INFO_CATEGORY_FIELD_LABEL,模型与入口共用同一行标识
- 新增 tests/resourceTypePanel.test.tsx:选中即落盘、tags 逐字回传、没碰过不写盘、显式待归类、失败回退、saving 锁、Esc/遮罩、面板骨架共 11 条
- 迁移「没碰过分类就回传落盘原值」对照用例并保留两条(标签面板侧),chip 用例搬到新面板文件
- 集成用例改走新入口:选中即落盘并自动关窗,另补 Esc/点外部不串台、只改标签后 manifest category 逐字不变两条宿主级用例
- appSurface 工具条清单补上「素材类型」
2026-09-14 17:07:15 +08:00
kdletters 86b830cf2d AGC 壳 Rust 套件分片并行,客户端 Rust 关键路径压到 7 分钟以内
Project CI / AI game creator shell Rust crates (push) Successful in 3m17s
Project CI / Native shell tests (push) Successful in 6m1s
Project CI / Backend tests (push) Successful in 6m39s
Project CI / Frontend tests (push) Successful in 3m59s
Project CI / Repository checks (push) Successful in 2m37s
Project CI / AI game creator shell web tests (push) Successful in 2m37s
Project CI / AI game creator shell Rust tests (push) Has been cancelled
run 2097 显示 AI game creator shell Rust tests 是客户端 CI 的关键路径(15 分 27 秒):
前置 5 分 30 秒(checkout + npm ci + Cargo fetch)、编译 1 分 39 秒、AGC 壳 bin target
的 2466 条单测一条命令串行 507 秒、agent-run smoke 51 秒。

- 新增 apps/ai-game-creator-shell/scripts/run-rust-shell-test-shards.mjs:cargo test
  --no-run 编译一次拿到测试可执行文件,用 --list 取全部用例名,排序后按 index % shards
  切 4 片,每片作为独立进程执行 <bin> --exact <名单> --test-threads=1,并给每片独立
  TMPDIR。片并集必须等于 --list 全集且互斥(assertShardsCoverEveryTest),改分片规则
  不会静默漏跑。串行口径只从「整套串行」放宽到「片内串行」:当年 libtest 线程并行会
  互相干扰的是进程内后台锁与异步终态,进程分片不共享这些状态,因此不必放宽断言。
- package.json:ai-game-creator-shell:check:rust 拆成 :rust:crates(agent-runtime-core /
  orchestration / platform-llm / shared-contracts)与 :rust:shell(分片运行器),聚合
  脚本保持同序,ai-game-creator-shell:check 与本地全量入口语义不变。
- check-native-shells.mjs:分组由五个变六个(新增 agc-rust-crates、agc-rust-shell,
  移除 agc-rust);smoke 与壳测试同组以共享 AGC 壳的依赖预热。
- project-ci.yml:新增第 7 个 job AI game creator shell Rust crates(预热 server-rs 与
  两个无锁独立 crate 后跑四条 crate 测试);AI game creator shell Rust tests 只保留壳
  分片与 agent-run smoke,并只预热 AGC 壳自己那份 manifest(其 Cargo.lock 的 path 依赖
  已覆盖 platform-llm / platform-agent / agent-runtime-core / shared-contracts)。
  这两个 job 只用 cargo 与 node 内建模块,因此都不再执行 npm ci(各省 1~3 分钟)。
- project-ci-workflow.test.ts:新增纯 cargo job 免 npm ci、分片运行器覆盖校验、crate 级
  job 预热顺序等断言;同步运维文档、development-workflow、decision-log、pitfalls。

验证:分片运行器本地以 agent-runtime-core(7 条 → 2/2/2/1)与 platform-llm(146 条 →
49/49/48)验证分片、--exact 与片 TMPDIR 隔离,参数负例 exit 1;vitest
scripts/project-ci-workflow.test.ts 12 passed;contract 分组、AGC 与 mobile 壳
check-config、eslint、prettier、check:encoding(13400 文件)、check:doc-index 全绿。
Gitea master 分支保护需补 Project CI / AI game creator shell Rust crates (pull_request)。

Co-authored-by: DotCraft <273930855+dotcraft-ai@users.noreply.github.com>
2026-09-14 17:02:34 +08:00
kdletters f9bd0adae1 补齐客户端 CI 拆分的共享记忆:label 字面量契约与实测耗时
Project CI / Frontend tests (push) Successful in 5m6s
Project CI / Native shell tests (push) Successful in 7m1s
Project CI / Backend tests (push) Successful in 7m45s
Project CI / Repository checks (push) Successful in 2m58s
Project CI / AI game creator shell web tests (push) Successful in 2m10s
Project CI / AI game creator shell Rust tests (push) Successful in 14m39s
- pitfalls:新增「根门禁的 [check:native-shells] <label> 是别处按字面量校验的契约」,
  记录 run 2095 里 desktop-shell typecheck 的失败根因(label 被抽进公共打印函数后,
  check-config 的字面量断言落空)、处置与本地验证方式。
- decision-log:把「预计收敛到约 13 分钟量级」换成 run 2097 实测——六个 job 全绿、
  wall-clock 15 分 27 秒(拆分前 run 2094 为 22 分 15 秒),关键路径转移到
  AI game creator shell Rust tests,壳体串行套件 507 秒是硬底。

Co-authored-by: DotCraft <273930855+dotcraft-ai@users.noreply.github.com>
2026-09-14 16:47:35 +08:00
kdletters 11beb65c36 修复桌面壳对根门禁 label 字面量的断言
Project CI / Frontend tests (push) Successful in 4m24s
Project CI / Native shell tests (push) Successful in 7m34s
Project CI / Backend tests (push) Successful in 7m36s
Project CI / Repository checks (push) Successful in 2m45s
Project CI / AI game creator shell web tests (push) Successful in 2m15s
Project CI / AI game creator shell Rust tests (push) Successful in 15m27s
run 2095 的 Native shell tests 红了,失败点是 desktop-shell 的 typecheck:
apps/desktop-shell/scripts/check-config.mjs 断言根门禁脚本必须包含
`console.log('[check:native-shells] desktop-release-binary-artifact')` 字面量,
而拆分时我把 label 挪进了公共打印函数 runNativeShellGate(group, label, gate),
源码里不再有这个字面量,断言随即报
「root native shell gate must keep desktop release artifact check」。

- runNativeShellGate 收窄为 (group, gate):label 改回各门禁执行体里的字面量打印,
  分组能力、日志格式与 `--groups=` 语义都不变,外部按字面量做的快照断言继续有效。
- 在该函数旁注明不要把 label 抽成变量:apps/desktop-shell 与 apps/mobile-shell 的
  check-config 都会读取根脚本源码做字面量断言。

验证:node --check 通过;contract 分组通过(groups=contract + OK);mobile-shell
check-config exit 0;desktop-shell check-config 已越过第 740-777 行的根脚本断言
(本机只卡在本机不存在的 Tauri 生成产物目录,Linux CI 不受影响);
vitest scripts/project-ci-workflow.test.ts 11 passed;eslint 通过。

Co-authored-by: DotCraft <273930855+dotcraft-ai@users.noreply.github.com>
2026-09-14 16:26:10 +08:00
kdletters 20f109027a 按门禁组拆分客户端 CI,AGC 的 web / rust 两段并行
Project CI / Native shell tests (push) Failing after 3m36s
Project CI / Frontend tests (push) Successful in 4m13s
Project CI / Repository checks (push) Successful in 3m3s
Project CI / AI game creator shell web tests (push) Successful in 2m31s
Project CI / Backend tests (push) Successful in 7m49s
Project CI / AI game creator shell Rust tests (push) Successful in 14m10s
原生壳门禁原本挤在同一个 job 里串行执行,跑一遍 18 分 37 秒,其中 AI 游戏创作
壳独占约 15 分钟(壳内 Rust 套件 2451 条用例串行 441 秒),而微信 / 移动 / 桌面 /
H5 的全部门禁加起来不到 50 秒。长尾拖住短门禁,runner 也无法并行。

- scripts/check-native-shells.mjs 支持 `--groups=`(contract / shells / agc-web /
  agc-rust / release):每个步骤与静态断言归属且只归属一个分组,不带参数时仍按
  原顺序串行跑全部分组,本地 `npm run check:native-shells` 语义不变。
- 顺带修掉 H5 HostBridge 调用链扫描在 Windows 上恒红的缺陷:collectFiles 返回
  反斜杠路径而期望清单是 POSIX 写法,scannedFiles.has() 永远为假。新增
  normalizeScannedFilePath 只统一分隔符(不能复用会去后缀的 normalizeModulePath),
  在 Linux 上是恒等变换。
- package.json 增加 5 个分组脚本,并把 ai-game-creator-shell:check 拆成
  :check:web 与 :check:rust;聚合脚本保持 web && rust && agent-run:smoke 同序。
  agent-run smoke 会 spawn cargo,因此归入 agc-rust。
- .gitea/workflows/project-ci.yml 拆成 6 个 job:新增 native-shell-tests(contract +
  shells + release)、ai-game-creator-shell-web-tests、ai-game-creator-shell-rust-tests
  三个门禁 job,与 backend-tests / frontend-tests / repository-checks 并列。
- scripts/project-ci-workflow.test.ts 增加 3 条结构测试:分组恰好被一个 job 调用且
  与脚本内声明一致、CI 不再调用全量入口、AGC web/rust 拆分与聚合脚本等价、独立
  crate 预热必须发生在 AGC Rust 门禁之前。
- 同步运维文档、development-workflow、decision-log、pitfalls。

验证:`--groups=contract` 本地通过;vitest 11 passed;eslint 与 prettier 通过;
check:encoding 13329 文件通过;check:doc-index 103 份通过。shells / agc-web /
agc-rust / release 分组只能由 Linux CI 执行(Windows 上 spawnSync npm.cmd 报
EINVAL,属既有平台限制,非本次引入)。分支保护需补两个新 required context:
`Project CI / AI game creator shell web tests (pull_request)` 与
`Project CI / AI game creator shell Rust tests (pull_request)`。

Co-authored-by: DotCraft <273930855+dotcraft-ai@users.noreply.github.com>
2026-09-14 16:13:11 +08:00
kdletters 4e553bb15d 收窄项目写锁同进程复用判据为同线程重入
Project CI / Repository checks (push) Successful in 3m21s
Project CI / Frontend tests (push) Successful in 4m15s
Project CI / Backend tests (push) Successful in 6m13s
Project CI / Native shell tests (push) Successful in 18m37s
- 修复 write_lock.rs:advisory 复用判据从「本进程持锁」收窄为「同一线程重入或自主流水线」,新增按锁路径登记真实持锁线程的 PROJECT_WRITE_LOCK_THREAD_OWNERS,登记在 create_new 成功处、在 guard Drop 里按路径注销(guard 会被移到别的线程再 Drop)
- 恢复本进程其它线程写通道的串行化:一致快照读、project.diff / action_history、command.output_read、steer 序号分配、项目 revision 侧车、pending sidecar 复核与恢复安装重新等待并保持终态占用
- 调整 tests/project_tools.rs 的 agent_runtime_file_write_lock_failure_redacts_project_path:改为在另一条线程持锁,保持「别的写者持锁时 file.write 失败关闭且脱敏」的断言语义
- 调整 ui_editor/persistence.rs 的 recovery_install_respects_the_project_write_lock:同样改为在另一条线程持锁,保持占用失败断言
- 同步技术方案「2026-09-14 项目客户端占用锁收敛」段落,以及里程碑和实施计划的目标、验收标准、修改顺序、验证命令与未决事项
- 在 decision-log 记录复用判据收窄为同线程重入,并在 pitfalls 记录「同进程复用判据不能只看 pid」的现场、原因、处理与易错点
- 回答 AGC 生命周期文档「同 PID advisory guard 是否放过并行写」的未决项:确认会放过并行写,已收窄

Co-authored-by: DotCraft <273930855+dotcraft-ai@users.noreply.github.com>
2026-09-14 15:41:17 +08:00
k88936 ad8f42a68f 回写自动切分问题节点状态
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
扩展 problematic DTO 携带完整返工历史

分离流程回写 NeedReview 并清理成功节点旧状态

补充概览计数定位与状态覆盖测试

同步 UI workflow 规范文档
2026-09-14 14:34:33 +08:00
k88936 a0325d653e 补充图片编辑代理与素材切分工作流技术文档链接
Project CI / Repository checks (pull_request) Successful in 3m13s
Project CI / Frontend tests (pull_request) Successful in 3m24s
Project CI / Backend tests (pull_request) Successful in 6m18s
Project CI / Native shell tests (pull_request) Successful in 19m37s
2026-09-14 11:58:53 +08:00
k88936 b617873f46 调整模块引用顺序及精简测试断言格式 2026-09-14 11:58:42 +08:00
k88936 513c25898c Merge remote-tracking branch 'origin/master' into feat/ui-editor-auto-seperation
Project CI / Repository checks (pull_request) Failing after 2m16s
Project CI / Frontend tests (pull_request) Successful in 4m44s
Project CI / Backend tests (pull_request) Successful in 7m39s
Project CI / Native shell tests (pull_request) Successful in 18m52s
# Conflicts:
#	apps/ai-game-creator-shell/src/view/project-development/index.tsx
2026-09-14 11:32:17 +08:00
k88936 9856bb7057 补充 UI 工作流安全边界说明
Project CI / Backend tests (pull_request) Failing after 15s
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / Frontend tests (pull_request) Successful in 2m58s
Project CI / Native shell tests (pull_request) Successful in 18m31s
记录提示清洗、图片解码限制、上传超时和 sidecar 产物恢复约束。
2026-09-12 21:44:12 +08:00
k88936 16db7ae8aa 为识别根节点补充名称兜底
LLM 返回空根名称时使用页面根节点默认名称,避免空标题进入 UI 树。
2026-09-12 21:40:20 +08:00
k88936 0ea7c7745c 保留分离结果的必要类型断言
TypeScript 对闭包赋值结果无法完成控制流收窄,恢复断言以通过类型检查。
2026-09-12 21:37:04 +08:00
k88936 6baf358bc7 完善素材分离恢复与步骤映射
回填部分失败时重新读取恢复状态;移除冗余类型断言并改用显式步骤映射。
2026-09-12 21:34:45 +08:00
k88936 462fc856aa 为原始图片上传解析增加超时
从请求入口开始计算准备截止时间,并限制 multipart 上传解析阶段的最长等待。
2026-09-12 21:33:48 +08:00
k88936 274bb1a3d2 兼容带参数的 PNG 内容类型
解析 multipart Content-Type 的媒体类型部分,接受合法的 image/png 参数。
2026-09-12 21:33:06 +08:00
k88936 8a96190db8 限制素材分离图片的 Base64 解码大小
对源图和服务端处理图在解码前后统一执行 64 MiB 上限检查,避免无界内存分配。
2026-09-12 21:32:20 +08:00
k88936 584da5b76b 限制视觉绑定处理图的解码规模
在解码前限制 base64 字节数并校验图像宽高,避免异常响应造成过量内存分配。
2026-09-12 21:31:13 +08:00
k88936 d1a03aec0e 统一预览画布适配与缩放滑杆计算
自动适配复用 fitToCanvas,避免重复计算;滑杆直接从原始缩放比例计算步进值。
2026-09-12 21:29:04 +08:00
k88936 b90d12c5fb 补充 Windows 原子替换安全说明
记录 MoveFileExW 路径缓冲区的所有权、终止符和调用生命周期不变量。
2026-09-12 21:27:57 +08:00
k88936 8135b4c374 避免 LLM 重试循环生产环境崩溃
将理论不可达分支改为显式错误返回,防止重试边界变化触发 panic。
2026-09-12 21:27:34 +08:00
k88936 124d94de93 保证素材批次补丁失败时状态原子
在修改状态前预检所有成功绑定节点的裁剪路径,避免中途错误留下部分更新。
2026-09-12 21:27:05 +08:00
k88936 103fe6fcd6 移除无效的裁剪路径伪校验
裁剪路径由 UUID 文件名和 sidecar 目录构造,直接依靠项目相对路径校验。
2026-09-12 21:26:33 +08:00
k88936 1370094c52 为素材处理产物生成唯一文件名
处理图 sidecar 文件名改用 UUID,避免全批次返工时覆盖前一批产物。
2026-09-12 21:25:58 +08:00
k88936 be8155c4a8 保留素材切分原始失败原因
检查点写入失败时仅记录日志,继续返回图像处理、绑定或裁剪的原始错误。
2026-09-12 21:25:21 +08:00
k88936 9052ff14f8 区分素材提取的完成与问题节点
仅将已绑定节点标记为 DONE,达到返工上限的节点继续作为上下文提供给提取模型。
2026-09-12 21:24:25 +08:00
k88936 9d9f1b8164 清理素材提取提示中的备注内容
对 YAML 提示中的描述和返工备注做有界清洗,避免代码围栏破坏提示结构。
2026-09-12 21:23:44 +08:00
k88936 8629a228a1 限制并清理视觉绑定提示备注
为节点描述和返工备注增加长度上限并移除控制字符、代码围栏字符。
2026-09-12 21:23:35 +08:00
k88936 a92121e09d 校准素材切分概览的资源绑定统计
图片与字体槽位仅在引用的项目资源存在时计为已绑定。

概览组件接入字体资源表并保留无资源参数时的旧调用语义。
2026-09-12 21:22:21 +08:00
k88936 e49d6741ca 修正组件移除失败弹窗处理
移除操作失败时关闭确认弹窗以展示错误;未执行时保留弹窗。
2026-09-12 21:19:36 +08:00
k88936 f7666339fe 修正组件替换失败弹窗处理
替换操作失败时关闭确认弹窗以展示错误;未执行时保留弹窗。
2026-09-12 21:19:14 +08:00
k88936 891cf50c0e 按节点重置组件检查面板
为 ComponentPanel 绑定节点 key,切换节点时清理折叠与确认状态。
2026-09-12 21:18:30 +08:00
k88936 b15a95e774 扩大 UI 节点随机标识空间
将节点 ID 从 8 位十六进制扩展到 16 位,降低批量识别中的碰撞概率。
2026-09-12 21:18:00 +08:00
k88936 e0f743b608 修复组件计数的布尔值转换
将布尔值显式转换为 usize,恢复 Rust 工作流模块编译。
2026-09-12 21:17:41 +08:00
k88936 a19684a5f5 Merge remote-tracking branch 'origin/master' into feat/ui-editor-auto-seperation
Project CI / Repository checks (pull_request) Failing after 1m7s
Project CI / Frontend tests (pull_request) Successful in 3m10s
Project CI / Backend tests (pull_request) Successful in 6m0s
Project CI / Native shell tests (pull_request) Successful in 18m41s
2026-09-12 19:46:41 +08:00
k88936 46b0871e6d 补充背景节点规则说明
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / Backend tests (pull_request) Failing after 15s
Project CI / Frontend tests (pull_request) Successful in 2m48s
Project CI / Native shell tests (pull_request) Successful in 19m57s
2026-09-12 18:56:31 +08:00
k88936 5c40abce47 识别树根节点改为模型根节点
识别协议改用 trees[].root 并保留根节点非几何字段
同步根节点解析校验、提示词与 UI 树转换
2026-09-12 18:10:45 +08:00
k88936 47d09d51ef 简化并集中化随机 NodeId 生成逻辑 2026-09-12 17:57:48 +08:00
k88936 f05f6e49ab 复用原始图片编辑 HTTP 客户端
Project CI / Repository checks (pull_request) Failing after 12s
Project CI / Backend tests (pull_request) Failing after 13s
Project CI / Frontend tests (pull_request) Successful in 3m12s
Project CI / Native shell tests (pull_request) Failing after 4m20s
让 raw edit 接收 api-server 构造的 VectorEngine reqwest 客户端。

通过 request builder 保留有效请求超时,不修改现有连接池策略。

移除不再使用的客户端构造错误分支并同步技术方案。
2026-09-12 16:33:33 +08:00
k88936 c7fe531b16 恢复预览百分比按钮适配画布
将缩放百分比显示改为可点击的适配画布按钮
复用工具栏按钮的鼠标焦点处理并按当前容器重新计算视口
补充预览缩放组件回归测试并同步交互设计文档
2026-09-12 16:31:55 +08:00
k88936 d44c6ab62c 补充背景节点规则示例说明 2026-09-12 16:28:31 +08:00
k88936 6764950aec 限制原始图片上传字节
将 image 和 mask multipart 字段改为分块读取并限制单字段大小。

新增图片总字节上限、413 错误和字段/总量边界测试。

同步 Raw GPT Image 2 代理技术方案的资源防护合同。
2026-09-12 16:27:23 +08:00
k88936 0944667c37 限制原始图片解码并发
为 raw image PNG 预处理增加 AppState 专用 semaphore。

按请求截止时间限制槽位等待和 blocking 解码等待,并让 permit 持有到任务结束。
2026-09-12 16:22:06 +08:00
k88936 bb2f080d3b 分离产物使用 UUID 文件名
切分图片文件名改用 UUID,避免把 NodeId 当作物理路径。

继续通过 cut_paths 写入 BoundNode.cut_image_path,保留逻辑节点 ID 与产物路径的独立性。
2026-09-12 16:18:13 +08:00
k88936 413707da33 提前拒绝高位深 PNG 解码
通过 image crate 的 ImageReader decoder 元数据在像素缓冲分配前拒绝 16-bit PNG。

继续使用同一外部 decoder 执行受限像素读取校验,不手写 PNG 解析器。
2026-09-12 15:40:26 +08:00
k88936 6235fa3298 修复分离状态跨平台原子替换
使用唯一临时文件并同步写入,避免 checkpoint 临时文件互相覆盖。

Unix 使用 rename,Windows 使用 MoveFileExW 原子覆盖已有 state.json。

拒绝符号链接和非普通文件目标,并增加覆盖已有目标回归测试。
2026-09-12 15:40:12 +08:00
k88936 8a9d37d5ad 移除分离提示词的破坏性清洗
保留描述、返工意见和 NodeId 原文,删除重复截断与字符改写。

返工意见仍由 validate_binding_response 统一执行 MAX_REWORK_NOTE_CHARS 校验。
2026-09-12 15:19:24 +08:00
k88936 9bbfc56cd7 修正分离期间保存选项的闭包判断
由调用方明确传入的 allowDuringSeparation 直接生效,避免依赖点击时捕获的过期状态。
2026-09-12 15:02:56 +08:00
k88936 e9d0180054 集中管理 GPT Image 2 尺寸限制
将请求尺寸压缩与原始编辑校验共用同一组像素、边长和对齐常量。
2026-09-12 15:00:55 +08:00
k88936 664bdd6877 避免伪造原始图片供应商请求编号
原始图片响应未提供供应商 request id 时不再写入操作名作为关联编号。
2026-09-12 14:58:21 +08:00
k88936 39a64a864a 声明图片平台使用 reqwest 流式特性
为 Part::stream 补齐 platform-image 的直接依赖特性,支持独立构建。
2026-09-12 14:56:54 +08:00
k88936 f055961714 修正分离源图 MIME 识别回退
缺失或未知 MIME 时强制走 PNG 规范化,避免非 PNG 数据被误标为 image/png。
2026-09-12 14:55:35 +08:00
k88936 3bcabe36fa 清理字体校验中的冗余空值判断
按 FontSource 的实际联合类型保留运行时字体资源校验。
2026-09-12 14:54:49 +08:00
k88936 2bfc870854 复用分离流程已选批次节点
让批次校验和应用使用同一份已选节点,避免重复选择造成目标漂移。
2026-09-12 14:54:05 +08:00
k88936 b0e9741e81 在预览区尺寸变化时重新适配画布
将画布尺寸纳入适配视口 effect 依赖,恢复面板调整后的自动 fit。
2026-09-12 14:49:30 +08:00
k88936 b52a33cc28 明确提示词清洗的字符映射意图
使用 map 替代始终返回 Some 的 filter_map,保持清洗行为不变。
2026-09-12 14:48:42 +08:00
k88936 398edd6e86 将分离状态序列化移入阻塞任务
避免在异步执行器线程同步格式化大型 separation state。
2026-09-12 14:48:00 +08:00
k88936 9788087271 修复组件操作失败时确认弹窗卡住
当组件更新返回 undefined 时关闭替换或移除确认弹窗,避免操作无反馈地停留。
2026-09-12 14:47:01 +08:00
k88936 329de5fce9 修复组件面板展开状态重置
仅在组件存在性发生变化时同步展开状态,避免深拷贝更新意外重新展开。
2026-09-12 14:46:08 +08:00
k88936 e4d70fbe1b 移除 Raw 编辑无效恢复审计字段
Project CI / Repository checks (pull_request) Successful in 2m59s
Project CI / Frontend tests (pull_request) Successful in 3m18s
Project CI / Backend tests (pull_request) Successful in 7m7s
Project CI / Native shell tests (pull_request) Successful in 19m53s
RawImageEditResult 仅保留实际透传的 b64_images

删除 raw-edit 不会产生的恢复审计转发与文档描述

补充 PreparedRawImageEdit 的 Debug 派生以通过现有测试
2026-09-12 13:50:25 +08:00
k88936 aaa9d3fb6f 补齐 Raw 编辑恢复审计语义
保留 recovered_failure_audits 公共字段并注明当前同步无回退不变量

让 raw handler 记录未来恢复审计并写入成功摘要计数

同步 Raw GPT Image 2 技术方案文档
2026-09-12 13:44:17 +08:00
k88936 bd127846f7 允许分离流程在忙碌态保存结果
保留 isSeparating 属于 isAiRunning 的全局语义

为内部分离保存增加受控 allowDuringSeparation 选项
2026-09-12 13:36:30 +08:00
k88936 b1751784ba 修正切分状态写入日志格式
移除状态写入完成日志中多余的格式参数
2026-09-12 13:26:36 +08:00
k88936 379611d552 避免渲染阶段写入画布尺寸引用
在 ResizeObserver 尺寸更新回调中同步 canvasSizeRef
2026-09-12 13:20:30 +08:00
k88936 ef04a19d5a 抽取组件确认弹窗公共结构
统一替换与移除操作的确认弹窗布局

保留各操作独立文案与按钮样式
2026-09-12 13:19:59 +08:00
k88936 206b4830a1 复用原图编辑错误摘要
解析失败分支只计算一次截断响应并同时用于审计与错误返回
2026-09-12 13:19:10 +08:00
k88936 4b8e268816 统一重启切分失败通知
restartSeparation 失败时复用工作流完成上报并清理完成提示
2026-09-12 13:18:30 +08:00
k88936 7e7d6f1563 避免忙碌时继续切分隐藏恢复提示
在清理恢复对话框前检查分离与工作流忙碌状态
2026-09-12 13:18:13 +08:00
k88936 a4b1d81123 避免忙碌时重启切分丢失恢复状态
restartSeparation 在清理 sidecar 前复用并发工作流守卫
2026-09-12 13:17:52 +08:00
k88936 983b15c3a7 允许恢复流程识别已完成的素材回填
同一 Sprite 已绑定的节点直接跳过

仅对缺失 Image 或绑定其他素材报告错误
2026-09-12 13:17:38 +08:00
k88936 cdb6fcfe97 切换组件时重置检查面板展开状态
按组件身份变化同步展开状态,避免沿用上一个节点的折叠状态
2026-09-12 13:17:01 +08:00
k88936 d8a4e35232 减少切分状态写入的重复克隆
让状态写入接口借用状态并在阻塞任务中写入序列化字节

保留 schema 与大小校验,避免每批次复制完整状态树
2026-09-12 13:16:25 +08:00
k88936 0726106818 为图片分离请求设置超时
将原图编辑 HTTP 请求限制为 120 秒,避免工作流永久阻塞
2026-09-12 13:14:22 +08:00
k88936 8beade5b4d 为业务校验重试增加退避
校验失败重试复用请求错误的递增等待并记录日志
2026-09-12 13:13:56 +08:00
k88936 46984a4945 净化切分提示中的节点标识
复用提示文本清洗逻辑,阻断控制字符与反引号注入
2026-09-12 13:13:25 +08:00
k88936 a8a30ecbc8 修正切分恢复命令映射
finalize_separation 调用 finalize helper

discard_separation_recovery 调用 discard helper
2026-09-12 13:13:06 +08:00
k88936 48e669d167 合并主线并解决界面编辑器冲突
Project CI / Repository checks (pull_request) Successful in 2m44s
Project CI / Frontend tests (pull_request) Successful in 3m25s
Project CI / Backend tests (pull_request) Failing after 4m23s
Project CI / Native shell tests (pull_request) Successful in 17m48s
合并主线的 AGC Runtime、UI 工作流与开发脚本变更

保留现行 Prompt Runtime 结构并整合设计基础提示词契约断言

适配 CanvasWorld 逆缩放渲染并修正预览缩放回归测试

同步项目文档、共享契约与已退役策划资源清理
2026-09-12 11:38:50 +08:00
k88936 23fdc005fe 整理 Raw 编辑方案文档格式
Project CI / Repository checks (pull_request) Failing after 10s
Project CI / Backend tests (pull_request) Failing after 10s
Project CI / Frontend tests (pull_request) Successful in 3m10s
Project CI / Native shell tests (pull_request) Failing after 14m49s
分隔字节边界说明与代码拆分列表
2026-09-12 11:22:50 +08:00
k88936 b8a4523a4f 补充 Raw 编辑字节边界说明
记录 raw_edit 使用 Bytes streaming multipart 的零拷贝约束

明确既有图片链路继续保持 Vec 字节契约
2026-09-12 11:20:53 +08:00
k88936 9c04561419 明确 Raw 编辑零拷贝上传约束
补充 Bytes 所有权与 streaming multipart 注释

增加共享字节缓冲不转换的回归测试
2026-09-12 11:18:14 +08:00
k88936 551fb6609a 为 Raw 编辑建立独立字节类型
恢复旧图片链路的 Vec 字节契约

让新增 raw_edit 输入和结果类型独立于既有 ReferenceImage
2026-09-12 11:15:15 +08:00
k88936 d05440dcca 为 Raw 编辑建立独立字节类型
恢复旧图片链路的 Vec 字节契约

让新增 raw_edit 输入和结果类型独立于既有 ReferenceImage
2026-09-12 11:13:27 +08:00
k88936 7edf4a8f8b 恢复旧图片链路字节类型
Project CI / Repository checks (pull_request) Failing after 13s
Project CI / Backend tests (pull_request) Failing after 10s
Project CI / Frontend tests (pull_request) Successful in 2m43s
Project CI / Native shell tests (pull_request) Failing after 14m6s
撤回非 raw_edit 的全局 Bytes 迁移

保留既有 VectorEngine 与编辑器路径的 Vec 字节契约
2026-09-12 11:06:05 +08:00
k88936 afc9ecbd51 补充 WebP 源图转码测试
验证 WebP 输入可转换为 PNG 上传格式
2026-09-12 10:42:15 +08:00
k88936 fc2f4b71ce 支持分离流程转换非 PNG 源图
在上传图片编辑请求前将 JPEG 和 WebP 转码为 PNG

新增 JPEG 转 PNG 单元测试并将转码放入阻塞任务
2026-09-12 10:38:00 +08:00
k88936 545f64cf9e 补齐原图编辑失败追踪事件
provider 失败时记录 external_generation_run 失败状态

保留现有外部 API 失败审计与错误映射
2026-09-12 10:37:04 +08:00
k88936 2a50614c11 将分离恢复阻塞 I/O 移出异步线程
新增 spawn_blocking 状态读取封装

sidecar 目录创建改用阻塞任务执行
2026-09-12 10:23:32 +08:00
k88936 915006c98f 适配绑定区域类型错误调用方
在区域归一化边界转换 typed error 为展示文案
2026-09-12 10:23:21 +08:00
k88936 69ce232a74 为绑定区域校验引入类型错误
用 ZeroDimension 和 OutOfBounds 区分边界校验失败

补充 typed error 单元测试并保留展示层中文文案
2026-09-12 10:20:17 +08:00
k88936 319aa69d6e 统一分离树根节点坐标空间
子节点收集复用根节点实际解析矩形
2026-09-12 02:24:01 +08:00
k88936 bec468bdc9 统一分离终止节点判定
批次选择与提取提示复用同一终止节点集合
2026-09-12 02:23:02 +08:00
k88936 eada20c199 恢复自动切分前重新校验状态
继续分离前确认 sidecar 存在并检查前置条件

恢复入口异常统一写入工作流失败通知
2026-09-12 02:20:52 +08:00
k88936 e8cf773aac 统一自动切分失败完成提示
分离入口异常时写入工作流完成失败通知
2026-09-12 02:19:48 +08:00
k88936 12fbb61fad 限制分离恢复状态写入大小
写盘前校验与读取一致的八兆字节上限

超限时记录原因并拒绝不可恢复检查点
2026-09-12 02:17:55 +08:00
k88936 478e08fb92 将 PNG 依赖限定为测试环境
从生产依赖移除仅测试使用的 png crate

在 dev-dependencies 中声明 PNG 测试依赖
2026-09-12 02:13:52 +08:00
k88936 0e67fbf80a 停止对最终工作流步骤重复预检
资产分离作为最后步骤不再校验不存在的下一步
2026-09-12 02:12:15 +08:00
k88936 ed2cfbad36 避免预览容器变化重置缩放
自动适配仅在图片或逻辑尺寸变化时执行

通过尺寸引用保留初始视口兜底值
2026-09-12 02:11:22 +08:00
k88936 560422286b 稳定组件面板展开与移除交互
仅在组件存在性变化时自动展开面板

为移除组件增加确认并保留失败弹窗
2026-09-12 02:08:56 +08:00
k88936 e04075fd95 为分离模型请求增加重试退避
瞬时请求失败时按递增毫秒延迟后重试

将重试循环末尾改为不可达断言
2026-09-12 02:07:02 +08:00
k88936 d7776f2a17 修正文生绑定提示语法
改进分离要求和返工建议英文表述
2026-09-12 02:05:18 +08:00
k88936 4d9e69841e 加固分离提示词生成
绑定提示改用切片参数避免多余复制

清理提取提示中的描述与返工备注文本
2026-09-12 02:04:32 +08:00
k88936 49e88bbd9f 统一分离提示备注长度限制
复用模型层的重做备注字符上限

导出提示文本清理函数供投影复用
2026-09-11 21:55:15 +08:00
k88936 86c268eca3 分离恢复使用独立丢弃操作
新增独立的恢复状态丢弃入口

完成与 finalize 的共享状态删除逻辑
2026-09-11 21:54:17 +08:00
k88936 c86221e3da 添加 TODO 注释以提示恢复字符限制错误信息
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / Backend tests (pull_request) Failing after 15s
Project CI / Frontend tests (pull_request) Successful in 3m3s
Project CI / Native shell tests (pull_request) Failing after 14m57s
2026-09-11 20:12:16 +08:00
k88936 e7af7cf4e4 校验处理图区域并明确 multipart 字节上传
将处理图真实尺寸传入视觉绑定校验,提前拒绝零尺寸和越界区域。

保持非法区域直接失败,不转换为 NeedRework。

将 image 和 mask multipart 部分改为 Part::bytes。
2026-09-11 20:11:11 +08:00
k88936 e7cd008d7c 调整文本组件的识别规则
简化多行文本节点逻辑,明确文字与图片组件的绑定要求。
2026-09-11 20:06:09 +08:00
k88936 c743ca146e 复用图像下载的共享字节缓冲
将 DownloadedImage.bytes 改为 bytes::Bytes。

让远程下载和图标切片下游避免不必要的完整复制。

同步更新图像处理实现与测试 fixture。
2026-09-11 19:53:14 +08:00
k88936 8c8b6cc75a 将自动切分状态写盘移出 Tokio worker
用 spawn_blocking 承载 JSON 序列化和文件写入,并在工作流中等待结果。
2026-09-11 19:44:01 +08:00
k88936 4cf3642b53 说明视觉绑定解析错误的有限重试策略
记录严格工具 schema 和响应损坏重试边界。
2026-09-11 19:41:48 +08:00
k88936 f933db169e 说明结构化重试的有限上下文边界
记录现役调用方的小重试次数和保留完整反馈的设计依据。
2026-09-11 19:41:21 +08:00
k88936 a5e936dd27 清理已退役的前端绑定模块
删除无现役导入的 binding.ts 及其 BindingDTO、BindingChange 类型。
2026-09-11 19:39:59 +08:00
k88936 53008959c5 修正自动切分结果的类型收窄
在异步闭包赋值后明确已完成结果的非空类型。
2026-09-11 19:09:22 +08:00
k88936 57dbb3de52 替换已有组件前增加确认
使用独立确认弹窗避免一次点击覆盖已配置组件。
2026-09-11 19:07:12 +08:00
k88936 e189aff485 更新设计基础提示词契约测试
将测试断言同步到当前按需图片生成与动态产物合同。
2026-09-11 19:05:57 +08:00
k88936 248c094da9 清理合并命令测试中的无用导入
移除组件类型未再使用的测试模块导入。
2026-09-11 19:05:03 +08:00
k88936 e66eb2fb55 切换预览图片时自动适配画布
在活动图片变化后重新按完整画布边界计算视口。
2026-09-11 19:04:33 +08:00
k88936 d455dc18a9 按实际保存快照更新脏状态签名
保存成功后直接记录持久化快照签名,避免闭包中的旧编辑器状态阻止清脏。
2026-09-11 19:03:51 +08:00
k88936 04a0d21351 避免原始 PNG 的重复解析
使用解码后的颜色类型校验位深,将读取限制统一留在 image 解码器。
2026-09-11 19:03:03 +08:00
k88936 a9358bf3ce 防止字体前置校验访问空值
对外部状态中的空字体引用返回正常校验结果而不是抛出异常。
2026-09-11 19:00:49 +08:00
k88936 c3de2ce958 为自动切分命令增加项目写权限校验
在启动分离工作流前复用 asset.register 权限门禁。
2026-09-11 19:00:19 +08:00
k88936 287d2f94da 限制自动切分恢复状态读取大小
在解析 sidecar state 前检查文件大小,避免异常分配。
2026-09-11 18:59:51 +08:00
k88936 1343f487d0 为自动切分工作流增加忙碌保护
统一直接调用入口的并发防护,避免状态锁冲突。
2026-09-11 18:59:10 +08:00
k88936 73fb89a8f4 阻止本地素材登记结果错位回填
资源导入返回数量与请求路径不一致时立即中止位置映射。
2026-09-11 18:58:35 +08:00
k88936 bf2ffd2bf9 拒绝保存无可见像素的切分区域
透明裁切区域直接返回可恢复错误,避免登记空素材。
2026-09-11 18:58:13 +08:00
k88936 3f55f043a1 拒绝切分产物路径中的非法节点标识
在写入 cut 图片前限制节点 ID 字符并确认路径仍位于 sidecar 内。
2026-09-11 18:57:19 +08:00
k88936 26677b193c 复用界面树组件计数值
在同一行中复用组件数量,避免重复计算。
2026-09-11 18:56:13 +08:00
k88936 b8691add3a 移除区域归一化日志路径中的恐慌
直接记录归一化结果,避免诊断日志调用 expect。
2026-09-11 18:55:28 +08:00
k88936 bfe010a192 让视觉绑定调试预览写入失败可降级
调试 PNG 写入失败时记录警告并继续绑定流程。
2026-09-11 18:55:06 +08:00
k88936 6db6de5b99 同步检查器组件面板展开状态
切换节点或组件时重置展开状态,避免复用旧节点的折叠状态。
2026-09-11 18:54:39 +08:00
k88936 87a7294a04 细化组件绑定载荷形状校验
在反序列化前拒绝空值和无效的节点组件外部枚举。
2026-09-11 18:54:21 +08:00
k88936 3774d7c1e1 移除修复重试流程中的隐式恐慌
在循环意外结束时返回可恢复错误而不是触发 unreachable。
2026-09-11 18:53:34 +08:00
k88936 8d15125f12 限制切分提示词中的节点备注
对用户备注清理控制字符和围栏符号并限制长度。
2026-09-11 18:52:59 +08:00
k88936 cf68b8212d 让提取提示词序列化错误可恢复
将提取提示词生成改为返回带上下文的错误。
2026-09-11 18:52:10 +08:00
k88936 8d7ccc0d75 简化工作流操作卡状态映射
使用步骤映射替代嵌套三元表达式。
2026-09-11 18:51:30 +08:00
k88936 2af3d9a965 修正结构识别步骤的前置校验
将结构识别活动步骤改为校验素材切分前置条件。
2026-09-11 18:50:59 +08:00
k88936 4749339bad 补齐图片字节类型导出与转换
Project CI / Repository checks (pull_request) Failing after 31s
Project CI / Backend tests (pull_request) Failing after 13s
Project CI / Frontend tests (pull_request) Successful in 3m56s
Project CI / Native shell tests (pull_request) Failing after 3m33s
导出共享 GPT 图片尺寸阈值常量。

修复编辑器参考图 Bytes 与 Vec 边界转换。
2026-09-11 18:02:04 +08:00
k88936 3e85c71060 整理图片代理代码格式
按 Rust 格式化规范整理 multipart 与响应解析代码。
2026-09-11 17:55:50 +08:00
k88936 da19bde99a 同步八位 PNG 与 b64 契约
记录八位 PNG 校验规则与稳定错误文案。

说明 GPT-Image-2 原生 b64_json,不发送 response_format。
2026-09-11 17:52:26 +08:00
k88936 4a32ee37c4 修复 Bytes 迁移后的图片类型边界
统一使用 Bytes 的只读引用并在旧 Vec 接口处显式转换。

修复编辑器参考图对齐与 Raw PNG 解码编译错误。
2026-09-11 17:52:00 +08:00
k88936 31fd1da495 修正 GPT 图片响应契约说明
仅保留 GPT-Image-2 原生 b64_json 行为的行内注释。

不发送 response_format 参数,也不引入 URL 兼容下载。
2026-09-11 17:48:55 +08:00
k88936 4c88e5e924 限制 Raw 图片仅接收八位 PNG
使用 png 解码器读取位深并在 image 解码前拒绝非八位输入。

统一返回稳定的 8-bit PNG 客户端错误并补充十六位 PNG 测试。
2026-09-11 17:48:01 +08:00
k88936 99f4961c5f 统一 GPT 图片尺寸计费阈值
提取共享的 1536 长边 tier 常量并复用到 raw 与编辑器计费。

同步 Raw 图片代理技术合同中的阈值来源。
2026-09-11 17:47:31 +08:00
k88936 0cebc39b6a 同步 Raw 图片代理契约
记录文本字段 16KiB 流式限制。

记录 GPT-Image-2 固定 b64_json 响应格式。
2026-09-11 17:37:58 +08:00
k88936 842d080a75 锁定图片缓冲依赖
将 platform-image 使用的 bytes 依赖写入 Cargo.lock。
2026-09-11 17:37:32 +08:00
k88936 8cd6e34af0 调整图片切分批次请求尺寸计算逻辑
基于批次源矩形总面积动态计算 image-edit 请求尺寸,新增面积对齐和最小/最大值限制,扩展相关模块和测试以支持调整后的工作流。
2026-09-11 17:33:26 +08:00
k88936 b357d36262 明确 GPT 图片编辑响应格式
原始图片编辑请求固定声明 response_format=b64_json。

补充 GPT-Image-2 仅返回 b64_json 的契约行内注释。
2026-09-11 17:29:11 +08:00
k88936 48c5638893 扩大原始图片文本字段上限
multipart 文本字段改为 chunk 流式读取并限制 16KB。

统一 UTF-8 校验和超限错误,避免先完整分配超长 prompt。
2026-09-11 17:28:13 +08:00
k88936 46df12c086 收敛原始图片 multipart 错误
服务端记录解析原始错误,客户端仅返回稳定分类文案。
2026-09-11 17:26:33 +08:00
k88936 4bdbab29c0 优化原始图片请求缓冲
将 ReferenceImage 与 multipart 输入改用 bytes::Bytes。

通过流式 multipart part 避免 reqwest 路径的额外整图复制。
2026-09-11 17:25:25 +08:00
k88936 9acc23b848 抽离 DFS 批次逻辑至独立模块,并优化节点面积计算与终端过滤流程
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / Backend tests (pull_request) Failing after 15s
Project CI / Frontend tests (pull_request) Successful in 8m16s
Project CI / Native shell tests (pull_request) Failing after 11m7s
2026-09-11 15:34:30 +08:00
k88936 b9b4ebd38e 重命名图片编辑为提取模块并更新相关调用绘制流程
Project CI / Repository checks (pull_request) Failing after 16s
Project CI / Backend tests (pull_request) Failing after 15s
Project CI / Native shell tests (pull_request) Failing after 4m22s
Project CI / Frontend tests (pull_request) Successful in 11m36s
2026-09-11 15:18:05 +08:00
k88936 8f680ef376 视觉绑定增加透明标记预处理
新增视觉绑定 RGBA 预处理与阈值复用

在请求前生成不透明洋红标记图并记录耗时

更新英文提示词说明标记色语义
2026-09-11 15:09:44 +08:00
k88936 7c7d55dcab 重构提取提示词生成逻辑,移除文本拼接方式,新增 YAML 序列化结构与测试 2026-09-11 14:54:00 +08:00
k88936 1303592a86 重构UI编辑器素材切分工作流模块
Project CI / Repository checks (pull_request) Failing after 14s
Project CI / Backend tests (pull_request) Failing after 15s
Project CI / Frontend tests (pull_request) Successful in 5m17s
Project CI / Native shell tests (pull_request) Failing after 6m41s
拆分提取与绑定提示词模块

拆分图片编辑、视觉绑定、裁切和批次 patch 实现

同步技术方案实现组织说明并更新提示词测试
2026-09-11 13:54:33 +08:00
k88936 1db7597141 重构UI素材切分树与批次选择
移除文本遮罩和标记图生成流程,图片编辑直接读取原始界面图

引入节点类型并保留文字移除上下文,按前序DFS与面积预算选择图片批次

补充根节点、重叠节点、文字过滤和超面积推进测试并同步TypeScript类型
2026-09-11 12:55:53 +08:00
k88936 13701d0144 澄清UI自动切分的原图输入与调试产物
明确图片编辑直接使用原始界面图,不再生成辅助输入图

明确处理图与裁切图使用随机文件名并保留用于调试
2026-09-11 11:56:33 +08:00
k88936 5c83142fec 更新UI编辑器自动切分素材工作流方案
将多轮整图分层与DFS面积批次写入权威专题

明确TextRemovalOnly、视觉绑定和atlas输出合同

删除平行专题文档并保留后续TODO

补充UI编辑器自动分离多轮分层方案

新增整图语义分层与多轮 image-edit 方案

明确 DFS 批次、TextRemovalOnly 和视觉绑定合同

记录面积预算、恢复边界与后续 TODO
2026-09-11 11:10:51 +08:00
k88936 95ed49f264 调整素材切分边界像素上限
将视觉绑定区域每条边的调整上限改为固定 32px。

同步 UI 编辑器自动切分技术方案与项目决策记录。

更新边界测试以覆盖绝对像素限制。
2026-09-11 10:28:32 +08:00
k88936 b8d8072267 完善识别命令说明,新增禁止冗余背景节点的指引
Project CI / Repository checks (pull_request) Failing after 9s
Project CI / Backend tests (pull_request) Failing after 10s
Project CI / Frontend tests (pull_request) Successful in 2m44s
Project CI / Native shell tests (pull_request) Failing after 3m5s
2026-09-10 19:54:46 +08:00
k88936 462caa33c5 修复工作流完成弹窗的多行错误展示
让完成通知中的换行字符按实际换行渲染,避免多项回填错误挤成一行。

保持通知内容和弹窗交互不变。
2026-09-10 19:06:20 +08:00
k88936 4e1064266f 移除自动切分结果的冗余类型断言
依赖空值检查后的 TypeScript 类型收窄直接使用 SeparationDTO。

不改变自动切分流程或运行时行为。
2026-09-10 19:05:48 +08:00
k88936 a50cbfb6c8 过滤图片编辑响应中的空图像数据
忽略上游返回的空 b64_json 条目,避免把空字符串转发为图像结果。

新增空条目与有效条目混合响应的回归测试。
2026-09-10 19:04:40 +08:00
k88936 1eb4bd5ec0 明确拒绝无效的处理图数据地址
处理图缺少 data URL 分隔符时直接返回格式错误。

避免先写入空文件再在后续裁切阶段暴露误导性错误。
2026-09-10 19:03:29 +08:00
k88936 5b441d389c 忽略完全位于图片外的切分标记矩形
矩形起点超出图片边界时直接返回 None,避免在边缘绘制伪影。

新增越界矩形回归测试。
2026-09-10 19:02:40 +08:00
k88936 f200cb4d3c 避免标记图编码重复复制像素缓冲
复用同一个 DynamicImage 完成文件保存和返回数据编码。

保持标记图内容和错误处理不变。
2026-09-10 19:02:09 +08:00
k88936 ae2f5fc80b 记录 UI 编辑器重试中的请求错误
在结构化 LLM 请求的中间重试失败时写入尝试次数和错误日志。

保留原有重试次数、历史消息和最终错误语义。
2026-09-10 19:01:32 +08:00
k88936 b69bd88e5e 修正 UI 编辑器校验器命名
将 run_with_repair_history 的 Validater/validater 更正为 Validator/validator。

不改变重试流程和运行时行为。
2026-09-10 19:01:18 +08:00
k88936 c5c7339c4a 重命名分离模块 problem_descriptionadvice 并同步更新相关校验逻辑与测试
Project CI / Repository checks (pull_request) Failing after 13s
Project CI / Backend tests (pull_request) Failing after 9s
Project CI / Frontend tests (pull_request) Successful in 2m28s
Project CI / Native shell tests (pull_request) Failing after 14m32s
2026-09-10 18:54:10 +08:00
k88936 4bbc77fc32 增加UI自动切分耗时日志
补充 marker、area、LLM、图片编辑及 batch 阶段耗时观测
记录成功与失败路径的性能字段
同步自动切分工作流技术方案中的日志约定
2026-09-10 18:51:53 +08:00
k88936 8c521ca891 移除 UI 预览适配与缩放输入
删除预览工具栏适配按钮、适配回调与对应快捷键
将缩放百分比改为只读显示并移除输入组件及测试
2026-09-10 18:48:56 +08:00
k88936 69a0804c03 调整切分区域边界扩展上限
将像素边界每边调整上限常量设为百分之百

同步更新受影响的区域归一化测试

技术方案仅引用上限常量,不重复写死数值
2026-09-10 18:46:39 +08:00
k88936 74f726e65d 修正自动切分素材检查条件
移除自动切分对预先导入独立素材的错误要求。
统一自动切分前置与结果检查,并补齐图片和字体引用校验。
在新建和重新开始自动切分时执行前置检查,恢复流程继续尽力完成。
2026-09-10 18:43:31 +08:00
k88936 1509235c1b 统一自动切分素材工作流命名
将 UI 编辑器第三步和内部流程 ID 统一为自动切分素材。
重命名前端切分概览模块并更新完成、恢复和导航文案。
同步 Runtime 最终编辑器路由、测试与相关技术文档。
2026-09-10 15:11:29 +08:00
k88936 1c992c69fe 完善分离与识别命令说明,调整嵌套格式与结构化指引 2026-09-10 14:05:37 +08:00
k88936 d9b153ed78 完善分离命令说明,新增禁止未请求文本的指引 2026-09-10 13:15:42 +08:00
k88936 30c469e9a1 规范分离模块格式化写法 2026-09-10 13:15:34 +08:00
k88936 51f629b2f9 UI编辑器节点改为单组件模型
Project CI / Repository checks (pull_request) Failing after 14s
Project CI / Backend tests (pull_request) Failing after 14s
Project CI / Frontend tests (pull_request) Successful in 2m43s
Project CI / Native shell tests (pull_request) Failing after 14m29s
修改 Node、Binding DTO、识别与分离链路为 component 单字段

为识别和绑定 LLM 工具引入 PureNode/WithComponent 显式载荷

移除前端组件索引、排序和组件栈操作

同步生成 ts-rs TypeScript 类型、状态校验、测试与专题文档
2026-09-10 13:08:29 +08:00
k88936 d6c720ecdd 纠正分离模块导出提交边界
撤销误入的组件字段重命名测试改动

仅保留裁切工作流对面积归一化模块的直接依赖
2026-09-10 12:26:39 +08:00
k88936 086aa91d70 收窄分离区域模块导出
让裁切工作流直接依赖面积归一化模块

移除未使用的公共重导出,保持分离模块边界清晰
2026-09-10 12:24:18 +08:00
k88936 3733e86272 补充分离区域像素归一化约定
记录透明像素边界扫描、方向锁定与四边同步推进规则

明确 50% 与图像边界约束、透明图处理、日志字段和性能 TODO
2026-09-10 12:13:21 +08:00
k88936 5d0f3e6be6 UI编辑器分离区域像素边界归一化
新增独立 BindingArea 像素边界归一化模块与回归测试

在 cut 裁切前按透明像素收缩或扩展四条边并记录约束结果

接入分离工作流并保留原始与归一化区域日志
2026-09-10 12:13:04 +08:00
k88936 989440173f 完善绑定区域值类型约束
为 BindingArea 增加 Eq 以支持分离区域比较
2026-09-10 11:52:46 +08:00
k88936 22d9958d18 在分离标记图中遮罩普通文字
绘制文字紫色区域并保持绿色元素框在最上层

增加文字遮罩图层顺序测试
2026-09-10 10:57:50 +08:00
k88936 56f8c9a6a1 构造自动分离文字遮罩
按最近未绑定图片祖先收集 Text 布局像素矩形

补充嵌套图片与根图片遮罩构造测试
2026-09-10 10:49:45 +08:00
k88936 c84df3d88f 补充文字遮罩状态字段契约
明确 text_mask_areas 为当前 separation state 必选字段

保持开发阶段 v1 且不提供旧 sidecar 迁移回退
2026-09-10 10:49:07 +08:00
k88936 761d32cebf 拆分自动分离模型并增加文字遮罩区域
将 separation model 拆为 note、node、binding、result 模块

为 SeparationNode 增加 text_mask_areas 字段并同步 TypeScript 类型
2026-09-10 10:43:00 +08:00
k88936 b3d6543d73 补充自动分离文字遮罩方案
记录普通文字归属、遮罩字段与标记图绘制规则

明确不进入分离树、绑定结果和视觉模型契约
2026-09-10 10:32:34 +08:00
k88936 8cd7c43b9e 更新自动分离接入文档状态
将前端接入 TODO 更新为联调与失败注入测试待办。
2026-09-09 21:02:09 +08:00
k88936 7fb7d246c0 将视觉步骤切换为自动分离
前端仅调用一次 separate_ui,并完成 cut 图片登记、SpriteAsset 回填和 State 保存。

增加 sidecar 恢复选择面板,旧 bind_components 标记为未调用遗留命令。
2026-09-09 21:00:53 +08:00
k88936 5844afa14d 抽取自动分离素材状态变换
复用 SpriteAsset 校验并支持锁内构造下一份 State。

保留公开 addSpriteAssets 的锁保护与历史提交行为。
2026-09-09 20:17:11 +08:00
k88936 615d1a28cd 补齐自动分离恢复状态胶水
新增 separation 恢复探测、完成清理命令与 DTO。

持久化项目相对 cut 图片路径并保留 state sidecar 到最终提交。
2026-09-09 20:16:09 +08:00
k88936 3e1e172f9c 补充自动分离前端接入合同
明确 UI 编辑器单次调用 separation 与 sidecar 恢复弹窗

补充资源登记、State 回填、保存和 finalize 顺序

划定旧 binding 与 Runtime workflow 的本次不改范围
2026-09-09 20:03:27 +08:00
k88936 53a919e39b 优化 UI 分离工作流程的提示生成与历史处理
Project CI / Repository checks (pull_request) Failing after 14s
Project CI / Backend tests (pull_request) Failing after 14s
Project CI / Frontend tests (pull_request) Successful in 2m50s
Project CI / Native shell tests (pull_request) Failing after 3m4s
- 调整 initial_history 构建逻辑,增强系统与用户消息的一致性。
- 简化 SeparationNode 提示生成逻辑,仅保留节点 ID 与注释。
- 明确 extracted_area 的权威性为 processed 图像,并更新生成提示的规则。
2026-09-09 19:04:56 +08:00
k88936 d4b5f9fc14 重构 UI Editor LLM repair history
将 request_with_feedback 改为 run_with_repair_history 并统一 max_retries 与 validater 命名。

让 requester 接收 append-only LlmMessage history,业务校验失败追加序列化响应和错误反馈。

迁移 visual_binding 调用方并补充 retry-only 与业务反馈 history 测试。

同步 UI Editor 结构化请求 repair history 决策文档。
2026-09-09 16:46:29 +08:00
k88936 6e4f9a6f1f 完善 UI 自动分离返工意见链路
记录视觉模型 NeedRework 意见并注入后续提取提示

同步返工次数、problematic 终态和 512 字符校验

补充 separation DTO 类型、回归测试与技术方案
2026-09-09 16:29:54 +08:00
k88936 8a0dcf8be7 增强分离标记框的可视辨识度
Project CI / Backend tests (pull_request) Failing after 15s
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / Frontend tests (pull_request) Successful in 3m4s
Project CI / Native shell tests (pull_request) Failing after 4m38s
为分离标记框增加两条绿色角到角交叉线。

新增 MARKER_LINE_WIDTH 常量统一配置标记线宽,并确保绘制结果裁剪在矩形内。

补充标记框像素级回归测试并同步更新自动分离专题文档。
2026-09-09 16:24:11 +08:00
k88936 aa2a78f7e0 重命名 separated_image_area 为 extracted_area,优化命名一致性并明确区域含义 2026-09-09 15:48:32 +08:00
k88936 7aa96e8438 统一分离标记图中文注释
说明紫色重建与绿色框绘制层级
2026-09-09 15:16:39 +08:00
k88936 feb6bc0ad4 修正分离失败恢复边界
图片编辑、写入和裁切失败保留状态并返回错误
仅视觉模型返工结果进入 problematic
2026-09-09 15:07:49 +08:00
k88936 f349350d60 同步分离状态 TypeScript 类型
加入 root_extractable 并将树字段统一为 trees
2026-09-09 15:03:48 +08:00
k88936 df3a172bc9 补充 Raw GPT Image 2 multipart 合同
明确分离图片编辑请求字段与旧协议边界
2026-09-09 14:57:55 +08:00
k88936 9b4924c73e 补充分离批次重叠筛选测试
验证 DFS 顺序下贪心跳过重叠叶节点
2026-09-09 14:54:37 +08:00
k88936 d30bc462c5 格式化自动分离 Rust 模块
统一树选择、标记图和批次流程代码风格
2026-09-09 14:50:19 +08:00
k88936 26b9ad7fad 重构分离树与非重叠批次选择
保留真实根节点并记录 root_extractable
按终态反查和 DFS 贪心筛选逻辑叶
拆出父子区域标记图生成模块
2026-09-09 14:48:18 +08:00
k88936 bc5398894e 补充分离树与批次算法约定
明确真实根节点、逻辑叶和非重叠贪心选择
补充父节点紫色重建与错误恢复边界
2026-09-09 14:29:38 +08:00
k88936 11d4d3d930 适配 UI 分离图片编辑 multipart 接口
Project CI / Frontend tests (pull_request) Successful in 4m57s
Project CI / Repository checks (pull_request) Failing after 10s
Project CI / Backend tests (pull_request) Failing after 11s
Project CI / Native shell tests (pull_request) Failing after 5m40s
将标记图 data URL 解码为 PNG 文件部件。

按 Raw GPT Image 2 新合同发送 prompt、尺寸和输出参数。

保留响应 data[].b64_json 解析与 separation 流程不变。
2026-09-09 13:17:36 +08:00
k88936 418d5732de 调整UI识别指令,细化粒度要求并优化组件返回规则 2026-09-09 13:12:51 +08:00
k88936 592b6b4ee7 简化识别树验证测试中的断言格式 2026-09-09 13:12:51 +08:00
k88936 99c19e3ed9 补充分离流程排障日志
记录 separation sidecar 状态读写与恢复阶段

记录树构造、批次选择、视觉绑定、裁切和 patch 结果

避免输出 base64、完整提示词和敏感凭据
2026-09-09 13:12:51 +08:00
k88936 15e30acb0f 调整UI识别指令细节,明确文字组件识别规则与粒度标准 2026-09-09 13:12:51 +08:00
k88936 56fff8325b 将自动分离图像处理移出异步执行器
在 spawn_blocking 中构建标记图并编码写入处理图

在 spawn_blocking 中完成处理图裁切与文件输出

保留 image-edit 和视觉绑定网络请求的 async 调度边界
2026-09-09 13:12:51 +08:00
k88936 884c5ec5ee 补充自动分离 sidecar 并发边界约束
记录前端单次运行与 runWithStateLocked 的并发前提

明确 sidecar 不参与正式资产写入和项目 revision

补充未来多窗口多进程场景的进程级锁 TODO

记录图像本地处理使用 spawn_blocking 的执行边界
2026-09-09 13:12:51 +08:00
k88936 207b0820dd 统一分离树文件格式
按仓库 rustfmt 规范整理 synthetic root 实现
2026-09-09 13:12:51 +08:00
k88936 19f3d62d78 隔离非法分离区域导致的批次失败
将裁切错误记录为 problematic 并继续流程
避免单个模型区域终止整页分离
2026-09-09 13:12:51 +08:00
k88936 3c1e7bd599 保留分离问题节点的真实重做次数
避免基础设施失败伪造达到上限
保持 problematic 节点诊断信息准确
2026-09-09 13:12:51 +08:00
k88936 dda6b3946a 阻止识别结果引用未授权字体素材
补齐识别阶段字体引用校验
增加伪造字体绑定回归测试
2026-09-09 13:12:51 +08:00
k88936 aff40f794d 修复分离树合成根节点 ID 冲突
避免单图根节点重复进入重做计数
补充根图片构造回归测试
2026-09-09 13:12:50 +08:00
k88936 187faa607d 保留原始分离提示并拆分模块
按模型、树、持久化、提示词和工作流拆分 separation

提取支持 more_turn 的反馈重试 harness

删除旧 separation.rs 文件
2026-09-09 13:12:50 +08:00
k88936 109cc81740 拆分UI自动分离命令模块
保留原始图片分离与绑定提示词

提取模型、树、持久化和工作流子模块

新增可配置 more_turn 反馈重试 harness
2026-09-09 13:12:50 +08:00
k88936 f796aef7e2 完善UI自动分离批次处理
复用资源ID安全路径并修正像素坐标

加入标记图、Raw编辑、视觉绑定修复与问题节点继续处理
2026-09-09 13:12:50 +08:00
k88936 4cc7f4dd64 实现UI自动分离命令
新增分离树、批次处理与sidecar状态

接入Raw GPT Image 2与视觉绑定重试

注册Tauri命令并补充识别组件草稿
2026-09-09 13:12:50 +08:00
k88936 b2d4690f94 补充UI编辑器自动分离工作流合同
新增自动分离、临时 sidecar 与视觉绑定设计合同

明确前端资产登记职责与恢复 TODO
2026-09-09 13:12:50 +08:00
k88936 0400103a19 将 Raw 图片编辑入站改为 multipart
移除 JSON/base64 入站兼容,仅接受 multipart 图片与参数字段

复用扣费前 PNG、尺寸、mask 和 prompt 校验并补充 multipart 测试

优化上游图片字节转发,避免再次克隆 image bytes

同步 Raw 图片编辑技术方案与 Axum multipart 依赖
2026-09-09 13:06:22 +08:00
k88936 c049d68b8e 收紧 Raw 成功响应字段类型
要求 data 与 b64_json 必填并移除无用 provider id

prompt 上限调整为 4 KiB 原始字节并同步文档
2026-09-09 12:03:03 +08:00
k88936 acfcf0c158 同步 platform-image 的 serde 锁定依赖
为 Raw typed 响应记录 serde workspace 依赖
2026-09-09 11:51:25 +08:00
k88936 5bbedd9a5c 限制 Raw prompt 原始字节大小
将 prompt UTF-8 原始字节限制为 16 KiB

补充超限回归测试并同步请求合同
2026-09-09 11:50:30 +08:00
k88936 40316d82c4 在扣费前校验 Raw mask 尺寸
解码时保留 image 与 mask 宽高并拒绝不一致输入

同步 Raw 图片编辑请求合同与回归测试
2026-09-09 11:45:44 +08:00
k88936 6c77de4a36 为 Raw 成功响应收紧类型透传
使用 typed JSON DTO 提取并原样转发 b64_json

不解码图片内容且忽略 output_format 回显
2026-09-09 11:44:31 +08:00
k88936 b3693765ef 透传 Raw 图片结果避免解码回显字段
仅转发上游 data.b64_json 并忽略 output_format

同步 Raw 技术方案并补充不解码回归测试
2026-09-09 11:34:41 +08:00
k88936 f7edc9d0ee 区分 Raw 图片 PNG 资源限制错误
Project CI / Frontend tests (pull_request) Successful in 4m43s
Project CI / Repository checks (pull_request) Failing after 11s
Project CI / Backend tests (pull_request) Failing after 10s
Project CI / Native shell tests (pull_request) Failing after 5m14s
将有效但超出解码限制的 PNG 映射为明确的 400 提示

补充超大合法 PNG 的回归测试
2026-09-09 11:04:44 +08:00
k88936 f60771dd00 提前检查 Raw 图片请求预算
在构造 multipart 表单前校验请求 deadline

避免预算耗尽时复制输入图片并缩短耗时统计范围
2026-09-09 10:58:48 +08:00
k88936 f7cccd8592 补充 Raw 图片客户端错误上下文
为 HTTP 客户端构造失败统一保留操作上下文

补充配置错误文案回归测试
2026-09-09 10:57:04 +08:00
k88936 5ee2d940c1 修正 Raw 图片尺寸校验错误语义
尺寸校验失败改用请求参数无效语义

补充错误文案回归测试
2026-09-09 10:55:36 +08:00
k88936 c75a7725ce Merge remote-tracking branch 'origin/master' into feat/expose-image2edit
Project CI / Repository checks (pull_request) Successful in 2m51s
Project CI / Native shell tests (pull_request) Failing after 4m9s
Project CI / Backend tests (pull_request) Failing after 4m58s
Project CI / Frontend tests (pull_request) Successful in 3m46s
2026-09-09 10:42:22 +08:00
k88936 3a95715990 同步 Raw 图片编辑技术方案
Project CI / Native shell tests (pull_request) Failing after 6m36s
Project CI / Backend tests (pull_request) Failing after 14s
Project CI / Repository checks (pull_request) Failing after 15s
Project CI / Frontend tests (pull_request) Successful in 4m22s
记录解码资源上限和阻塞线程策略
补充输出格式回退与成功追踪约定
2026-09-08 23:41:27 +08:00
k88936 ed86963de2 修正 Raw 图片追踪结果类型
明确输出数据集合类型
保持 API 编译检查通过
2026-09-08 23:38:25 +08:00
k88936 65e73eee02 补充 Raw 图片生成成功追踪
记录成功任务与输出数量
完善上游响应和失败阶段日志
2026-09-08 23:25:47 +08:00
k88936 6068eeda83 补充 Raw 图片编辑请求日志
记录上游响应状态与耗时
记录传输失败阶段和结构化上下文
2026-09-08 23:22:56 +08:00
k88936 0e244c64ea 统一 GPT Image 2 尺寸常量
集中维护像素边界和对齐规则
供生成与编辑路径共同引用
2026-09-08 22:11:35 +08:00
k88936 ad7c059603 遵守 Raw 图片请求截止时间
发送前裁剪有效超时预算
预算耗尽时提前返回结构化错误
2026-09-08 21:54:22 +08:00
k88936 55d2a393d1 完善 Raw 图片尺寸错误类型
为公开错误实现 Error trait
支持通用错误链处理
2026-09-08 21:52:15 +08:00
k88936 e7f66ce950 修正 Raw 图片传输失败阶段标记
区分请求发送和响应读取失败
让错误详情准确反映故障阶段
2026-09-08 20:03:13 +08:00
k88936 35dcfea3ef 修正 Raw 图片输出格式回退
忽略空值后再使用载荷级格式
补充空字符串和 null 回归测试
2026-09-08 19:56:41 +08:00
k88936 cea8bf77fa 减少 Raw 图片编辑请求拷贝
移动 multipart 选项字段而非克隆
降低掩码和字符串的峰值内存
2026-09-08 19:52:13 +08:00
k88936 0136bfe564 移出 Raw 图片同步解码
将请求预校验放入阻塞线程
避免占用 Tokio 异步工作线程
2026-09-08 19:48:58 +08:00
k88936 22785b4d7b 限制 Raw 图片解码资源
为 PNG 解码设置边长和分配上限
避免压缩图片膨胀导致内存耗尽
2026-09-08 19:45:02 +08:00
k88936 a86a2ee4d2 简化 Raw 图片编辑响应类型
移除无必要的 JSON Value 转换
保持响应结构由类型系统校验
2026-09-08 19:32:55 +08:00
k88936 b22eae2726 收紧 Raw 图片编辑输入契约
Project CI / Frontend tests (pull_request) Successful in 3m51s
Project CI / Native shell tests (pull_request) Successful in 20m20s
Project CI / Repository checks (pull_request) Failing after 14s
Project CI / Backend tests (pull_request) Failing after 14s
新增 3840 边长、16 像素对齐、3:1 比例和总像素范围校验

要求 image 与 mask 为可完整解码的 PNG 并在扣费前拒绝非法输入

将 Raw 路由 JSON body limit 提升至 64 MiB

同步 Raw 图片编辑技术方案和边界测试
2026-09-08 18:18:58 +08:00
k88936 35d0db6377 修复 Raw 图片失败审计与响应格式
Project CI / Frontend tests (pull_request) Successful in 6m7s
Project CI / Native shell tests (pull_request) Successful in 19m41s
Project CI / Repository checks (pull_request) Failing after 11s
Project CI / Backend tests (pull_request) Failing after 9s
为 Raw provider 失败分支补齐结构化 failure audit 并接入 api-server 记录链

使用 VectorEngine 响应 output_format 生成返回图片 MIME 与扩展名

补充响应格式和审计字段定向测试并同步技术方案
2026-09-08 16:19:29 +08:00
k88936 f087ba3e2b 隔离 Raw 图片代理实现
Project CI / Repository checks (pull_request) Failing after 14s
Project CI / Backend tests (pull_request) Failing after 14s
Project CI / Frontend tests (pull_request) Successful in 36m40s
Project CI / Native shell tests (pull_request) Successful in 54m1s
移除对现有图片编辑 client 与 curl transport 的复用

将 Raw GPT Image 2 请求、multipart 构造和响应解析收敛到独立文件

保持现有 editor 图片链路代码不变
2026-09-08 13:54:31 +08:00
k88936 7fc1b841be 收口 Raw 图片 base64 校验错误
客户端仅返回稳定的 base64 格式错误提示

补充测试避免泄露解码器内部诊断细节
2026-09-08 12:30:55 +08:00
k88936 a576fdcc37 移除未使用的 multipart 请求包装函数
无选项测试直接调用统一传输入口

避免生产构建保留未使用函数告警
2026-09-08 12:29:59 +08:00
k88936 4dcf38715b 补充图片编辑选项 multipart 测试
覆盖质量、背景、输出格式与 mask 文件字段

断言文件名、MIME 类型和字节内容均正确发送
2026-09-08 12:21:11 +08:00
k88936 d1f9f4e1ef 减少图片编辑 multipart 字节复制
将已克隆的选项按值传入阻塞传输函数

构造 mask 与参考图表单时直接移动字节缓冲
2026-09-08 12:16:00 +08:00
k88936 5836aaec26 简化图片编辑 multipart 请求分支
统一通过带选项的 multipart 传输函数发送请求

移除冗余包装函数调用与未使用导入
2026-09-08 12:10:56 +08:00
k88936 18d60feb04 补充 Raw 图片参数预检查
在计费前校验质量、背景和输出格式

规范化可选参数并保持单图请求契约
2026-09-08 10:40:09 +08:00
k88936 4e1316e272 实现 Raw GPT Image 2 图片编辑代理
新增受 Bearer 保护的 /api/raw/v1/images/edit JSON 路由

按单图 image 与可选 mask 转发 GPT Image 2 参数

固定 model 与 n 并返回仅含 data[].b64_json 的响应

复用钱包计费与退款边界并补充单元测试
2026-09-08 10:36:48 +08:00
k88936 302b4addae 补充 Raw GPT Image 2 代理方案
Project CI / Native shell tests (pull_request) Successful in 55m40s
Project CI / Backend tests (pull_request) Failing after 14s
Project CI / Repository checks (pull_request) Failing after 14s
Project CI / Frontend tests (pull_request) Successful in 23m43s
明确 JSON 请求与 data 数组响应

记录预检查和钱包事务边界

拆分 api-server 与 platform-image 文件职责
2026-09-07 16:33:34 +08:00
197 changed files with 23882 additions and 2169 deletions
+335 -84
View File
@@ -27,9 +27,28 @@ env:
RUSTC_WRAPPER: ''
CARGO_BUILD_RUSTC_WRAPPER: ''
# job 声明顺序就是 runner 领取顺序,因此把最长尾的客户端 Rust 门禁排在前面,
# 让它在最少的等待下占用并发槽位;其余 job 按时长递减排列。
#
# 客户端(微信壳 / Expo 移动壳 / Tauri 桌面壳 / AI 游戏创作壳)门禁原先全部串在
# `Native shell tests` 一个 job 里,实测 18 分 37 秒。现在按门禁组拆成一个分组一个 job:
# `Native shell tests`(契约 + H5 / 微信 / 移动 / 桌面壳门禁 + 发布构建 smoke)、
# `AI game creator shell web tests`typecheck + 壳内测试)、`AI game creator shell
# Rust shard 1/4` 到 `4/4`AGC 壳 bin 单测按名单分 4 片)、`AI game creator shell
# Rust smoke`agent-run smoke)与 `AI game creator shell Rust crates`AGC 壳依赖的
# 共享 / 平台 crate 测试)。各自的命令与拆分前逐一对应,本地
# `npm run check:native-shells` 仍是同一条串行序列。
#
# AGC 壳的 bin 单测(2466 条)按名单分 4 片、一片一个 job:片内保持 `--test-threads=1`
# (当年线程并行会互相干扰的是进程内后台锁与异步终态),片与片之间靠 job 级并发摊开。
# 不要改回「一个 job 里多进程并行这几片」:同一容器内它们会争抢共享 HOME、target 与固定
# 临时路径,实测比整套串行还慢。每个分片 job 都会自校验「片并集等于全集且互斥」。
jobs:
repository-checks:
name: Repository checks
# AGC 壳自身的 Rust bin 单测分片,4 片各自独立 job 并发执行、片内仍保持
# `--test-threads=1`。这里不装 npm 依赖:壳 Rust 门禁只用 cargo 与 node 内建模块,
# 也只需要 AGC 壳自己那份锁定依赖。
ai-game-creator-shell-rust-shard-1:
name: AI game creator shell Rust shard 1/4
runs-on: genarrative-ci
steps:
- name: Checkout full history from Gitea
@@ -41,76 +60,228 @@ jobs:
- name: Validate preinstalled CI job image and sandbox
run: GENARRATIVE_GITEA_CI_CHECK_RUNTIME=1 bash scripts/check-gitea-ci-job-image.sh
- name: Resolve comparison base
- name: Prepare AI game creator shell Rust dependencies
shell: bash
run: |
set -euo pipefail
base_ref="$(node -e '
const fs = require("node:fs");
const event = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8"));
process.stdout.write(event.pull_request?.base?.sha ?? event.before ?? "");
')"
if [[ -n "${base_ref}" && ! "${base_ref}" =~ ^0+$ ]]; then
git cat-file -e "${base_ref}^{commit}" 2>/dev/null || {
echo "comparison base commit is unavailable: ${base_ref}" >&2
# AGC 壳有独立 Cargo.lock,其 path 依赖已含 platform-llm、platform-agent、
# agent-runtime-core 与 shared-contracts,因此只锁这一份 manifest 就能覆盖壳测试
# 与 smoke 的全部第三方依赖;server-rs 那次预热归 crate 级 job,不在这里重复。
for attempt in $(seq 1 5); do
if cargo fetch --locked \
--target x86_64-unknown-linux-gnu \
--manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml; then
break
fi
if [[ "${attempt}" -eq 5 ]]; then
echo 'AI game creator shell Cargo dependency fetch failed after 5 attempts.' >&2
exit 1
}
else
base_ref="$(git merge-base HEAD origin/master 2>/dev/null || git rev-parse HEAD)"
fi
resolved_base_ref="$(git rev-parse --verify "${base_ref}^{commit}" 2>/dev/null || true)"
head_ref="$(git rev-parse HEAD)"
if [[ "${resolved_base_ref}" == "${head_ref}" ]]; then
resolved_base_ref="$(git rev-parse --verify HEAD^ 2>/dev/null || true)"
fi
if [[ -z "${resolved_base_ref}" ]]; then
echo 'comparison base must resolve to a commit distinct from HEAD.' >&2
exit 1
fi
base_ref="${resolved_base_ref}"
if [[ "${GITHUB_EVENT_NAME:-}" == 'pull_request' ]] \
&& ! git merge-base --is-ancestor "${base_ref}" HEAD; then
echo 'pull request head does not contain the latest base commit; update the branch and rerun CI.' >&2
exit 1
fi
echo "SPACETIME_SCHEMA_BASE_REF=${base_ref}" >> "${GITHUB_ENV}"
fi
sleep $((attempt * 2))
done
- name: Install npm dependencies
run: bash scripts/ci-npm-ci-with-retry.sh
- name: Run AI game creator shell Rust shard 1/4
run: npm run check:native-shells:agc-rust-shard-1
- name: Run repository checks
run: npm run check:repository-ci
frontend-tests:
name: Frontend tests
ai-game-creator-shell-rust-shard-2:
name: AI game creator shell Rust shard 2/4
runs-on: genarrative-ci
steps:
- name: Checkout source from Gitea
- name: Checkout full history from Gitea
env:
GENARRATIVE_GITEA_FETCH_DEPTH: '1'
GENARRATIVE_GITEA_FETCH_DEPTH: '0'
GENARRATIVE_GITEA_TOKEN: ${{ github.token }}
run: genarrative-gitea-checkout
- name: Validate preinstalled CI job image and sandbox
run: GENARRATIVE_GITEA_CI_CHECK_RUNTIME=1 bash scripts/check-gitea-ci-job-image.sh
- name: Install npm dependencies
run: bash scripts/ci-npm-ci-with-retry.sh
- name: Prepare AI game creator shell Rust dependencies
shell: bash
run: |
set -euo pipefail
for attempt in $(seq 1 5); do
if cargo fetch --locked \
--target x86_64-unknown-linux-gnu \
--manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml; then
break
fi
if [[ "${attempt}" -eq 5 ]]; then
echo 'AI game creator shell Cargo dependency fetch failed after 5 attempts.' >&2
exit 1
fi
sleep $((attempt * 2))
done
- name: Run frontend and script tests
run: npm run test
- name: Run AI game creator shell Rust shard 2/4
run: npm run check:native-shells:agc-rust-shard-2
- name: Run BgFilter worker smoke harness tests
run: npm run bgfilter-worker:smoke-test
ai-game-creator-shell-rust-shard-3:
name: AI game creator shell Rust shard 3/4
runs-on: genarrative-ci
steps:
- name: Checkout full history from Gitea
env:
GENARRATIVE_GITEA_FETCH_DEPTH: '0'
GENARRATIVE_GITEA_TOKEN: ${{ github.token }}
run: genarrative-gitea-checkout
- name: Validate production health patrol behavior
run: npm run check:production-health-patrol
- name: Validate preinstalled CI job image and sandbox
run: GENARRATIVE_GITEA_CI_CHECK_RUNTIME=1 bash scripts/check-gitea-ci-job-image.sh
- name: Validate production API release behavior
run: npm run check:production-api-release
- name: Prepare AI game creator shell Rust dependencies
shell: bash
run: |
set -euo pipefail
for attempt in $(seq 1 5); do
if cargo fetch --locked \
--target x86_64-unknown-linux-gnu \
--manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml; then
break
fi
if [[ "${attempt}" -eq 5 ]]; then
echo 'AI game creator shell Cargo dependency fetch failed after 5 attempts.' >&2
exit 1
fi
sleep $((attempt * 2))
done
- name: Validate production API deploy behavior
run: npm run check:production-api-deploy
- name: Run AI game creator shell Rust shard 3/4
run: npm run check:native-shells:agc-rust-shard-3
ai-game-creator-shell-rust-shard-4:
name: AI game creator shell Rust shard 4/4
runs-on: genarrative-ci
steps:
- name: Checkout full history from Gitea
env:
GENARRATIVE_GITEA_FETCH_DEPTH: '0'
GENARRATIVE_GITEA_TOKEN: ${{ github.token }}
run: genarrative-gitea-checkout
- name: Validate preinstalled CI job image and sandbox
run: GENARRATIVE_GITEA_CI_CHECK_RUNTIME=1 bash scripts/check-gitea-ci-job-image.sh
- name: Prepare AI game creator shell Rust dependencies
shell: bash
run: |
set -euo pipefail
for attempt in $(seq 1 5); do
if cargo fetch --locked \
--target x86_64-unknown-linux-gnu \
--manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml; then
break
fi
if [[ "${attempt}" -eq 5 ]]; then
echo 'AI game creator shell Cargo dependency fetch failed after 5 attempts.' >&2
exit 1
fi
sleep $((attempt * 2))
done
- name: Run AI game creator shell Rust shard 4/4
run: npm run check:native-shells:agc-rust-shard-4
# agent-run smoke 会 spawn `cargo run`(走壳自己的 manifest),同样不装 npm 依赖,
# 单独一个 job,免得把已经压到 4 分钟级的片 job 拖长。
ai-game-creator-shell-rust-smoke:
name: AI game creator shell Rust smoke
runs-on: genarrative-ci
steps:
- name: Checkout full history from Gitea
env:
GENARRATIVE_GITEA_FETCH_DEPTH: '0'
GENARRATIVE_GITEA_TOKEN: ${{ github.token }}
run: genarrative-gitea-checkout
- name: Validate preinstalled CI job image and sandbox
run: GENARRATIVE_GITEA_CI_CHECK_RUNTIME=1 bash scripts/check-gitea-ci-job-image.sh
- name: Prepare AI game creator shell Rust dependencies
shell: bash
run: |
set -euo pipefail
for attempt in $(seq 1 5); do
if cargo fetch --locked \
--target x86_64-unknown-linux-gnu \
--manifest-path apps/ai-game-creator-shell/src-tauri/Cargo.toml; then
break
fi
if [[ "${attempt}" -eq 5 ]]; then
echo 'AI game creator shell Cargo dependency fetch failed after 5 attempts.' >&2
exit 1
fi
sleep $((attempt * 2))
done
- name: Run AI game creator shell agent-run smoke
run: npm run check:native-shells:agc-rust-smoke
# AGC 壳依赖的共享 / 平台 crate 测试用的是 server-rs workspace 与两个无锁独立 crate
# 的 manifest,属另一套依赖图,因此单独一个 job 预热、单独跑。
ai-game-creator-shell-rust-crates:
name: AI game creator shell Rust crates
runs-on: genarrative-ci
steps:
- name: Checkout full history from Gitea
env:
GENARRATIVE_GITEA_FETCH_DEPTH: '0'
GENARRATIVE_GITEA_TOKEN: ${{ github.token }}
run: genarrative-gitea-checkout
- name: Validate preinstalled CI job image and sandbox
run: GENARRATIVE_GITEA_CI_CHECK_RUNTIME=1 bash scripts/check-gitea-ci-job-image.sh
- name: Prepare server-rs Rust dependencies
shell: bash
run: |
set -euo pipefail
for attempt in $(seq 1 5); do
if cargo fetch --locked \
--target x86_64-unknown-linux-gnu \
--manifest-path server-rs/Cargo.toml; then
break
fi
if [[ "${attempt}" -eq 5 ]]; then
echo 'server-rs Cargo dependency fetch failed after 5 attempts.' >&2
exit 1
fi
sleep $((attempt * 2))
done
- name: Prepare standalone Rust crate dependencies
shell: bash
run: |
set -euo pipefail
# agent-runtime-core / agent-runtime-orchestration 被 server-rs/Cargo.toml 的
# exclude 排除,不参与上面的 workspace 锁文件,因此上面那次锁定 fetch 覆盖不到它们;
# 而 `npm run ai-game-creator-shell:check:rust:crates` 会用
# `cargo test --manifest-path` 单独跑这两个 crate。不在这里预热的话,这两条测试
# 会在测试阶段自己 `Updating crates.io index`crates.io 一抖动整条 job 就红
# (见 #327 / PR #316 run 1950)。
# 两个 crate 都没有提交 Cargo.lock,所以这里只能做不带锁标志的 fetch:
# 加锁标志会因为缺少锁文件直接失败。生成的 Cargo.lock 落在两个 crate 目录内,
# 已被各自的 .gitignore 忽略,只留在容器里;随后的测试阶段因此能用锁定版本
# 解析,不再触碰 registry index。
for manifest_path in \
server-rs/crates/agent-runtime-core/Cargo.toml \
server-rs/crates/agent-runtime-orchestration/Cargo.toml; do
for attempt in $(seq 1 5); do
if cargo fetch \
--target x86_64-unknown-linux-gnu \
--manifest-path "${manifest_path}"; then
break
fi
if [[ "${attempt}" -eq 5 ]]; then
echo "standalone crate dependency fetch failed after 5 attempts: ${manifest_path}" >&2
exit 1
fi
sleep $((attempt * 2))
done
done
- name: Run AI game creator shell shared crate gates
run: npm run check:native-shells:agc-rust-crates
backend-tests:
name: Backend tests
@@ -194,6 +365,8 @@ jobs:
- name: Check SpacetimeDB module
run: cargo check --locked -p spacetime-module --manifest-path server-rs/Cargo.toml
# 客户端的壳级与契约门禁:静态契约断言、H5 / 微信 / 移动 / 桌面壳运行时门禁,
# 以及依赖发布产物的构建 smoke。
native-shell-tests:
name: Native shell tests
runs-on: genarrative-ci
@@ -215,7 +388,6 @@ jobs:
run: |
set -euo pipefail
for manifest_path in \
server-rs/Cargo.toml \
apps/desktop-shell/src-tauri/Cargo.toml \
apps/ai-game-creator-shell/src-tauri/Cargo.toml; do
for attempt in $(seq 1 5); do
@@ -232,39 +404,118 @@ jobs:
done
done
- name: Prepare standalone Rust crate dependencies
shell: bash
run: |
set -euo pipefail
# agent-runtime-core / agent-runtime-orchestration 被 server-rs/Cargo.toml 的
# exclude 排除,不参与上面的 workspace 锁文件,因此上面那次锁定 fetch 覆盖不到它们;
# 而 check:native-shells 会经 agent-runtime-*:check 用 `cargo test --manifest-path`
# 单独跑这两个 crate。不在这里预热的话,这两条测试会在测试阶段自己
# `Updating crates.io index`crates.io 一抖动整条 native shell 作业就红
# (见 #327 / PR #316 run 1950)。
# 两个 crate 都没有提交 Cargo.lock,所以这里只能做不带锁标志的 fetch:
# 加锁标志会因为缺少锁文件直接失败。生成的 Cargo.lock 落在两个 crate 目录内,
# 已被各自的 .gitignore 忽略,只留在容器里;随后的测试阶段因此能用锁定版本
# 解析,不再触碰 registry index。
for manifest_path in \
server-rs/crates/agent-runtime-core/Cargo.toml \
server-rs/crates/agent-runtime-orchestration/Cargo.toml; do
for attempt in $(seq 1 5); do
if cargo fetch \
--target x86_64-unknown-linux-gnu \
--manifest-path "${manifest_path}"; then
break
fi
if [[ "${attempt}" -eq 5 ]]; then
echo "standalone crate dependency fetch failed after 5 attempts: ${manifest_path}" >&2
exit 1
fi
sleep $((attempt * 2))
done
done
- name: Run native shell contract gates
run: npm run check:native-shells:contract
- name: Run native shell gates
run: npm run check:native-shells
run: npm run check:native-shells:shells
- name: Run native shell release build smoke
run: npm run check:native-shells:release
- name: Ensure native lockfiles are unchanged
run: git diff --exit-code -- apps/desktop-shell/src-tauri/Cargo.lock apps/ai-game-creator-shell/src-tauri/Cargo.lock
frontend-tests:
name: Frontend tests
runs-on: genarrative-ci
steps:
- name: Checkout source from Gitea
env:
GENARRATIVE_GITEA_FETCH_DEPTH: '1'
GENARRATIVE_GITEA_TOKEN: ${{ github.token }}
run: genarrative-gitea-checkout
- name: Validate preinstalled CI job image and sandbox
run: GENARRATIVE_GITEA_CI_CHECK_RUNTIME=1 bash scripts/check-gitea-ci-job-image.sh
- name: Install npm dependencies
run: bash scripts/ci-npm-ci-with-retry.sh
- name: Run frontend and script tests
run: npm run test
- name: Run BgFilter worker smoke harness tests
run: npm run bgfilter-worker:smoke-test
- name: Validate production health patrol behavior
run: npm run check:production-health-patrol
- name: Validate production API release behavior
run: npm run check:production-api-release
- name: Validate production API deploy behavior
run: npm run check:production-api-deploy
repository-checks:
name: Repository checks
runs-on: genarrative-ci
steps:
- name: Checkout full history from Gitea
env:
GENARRATIVE_GITEA_FETCH_DEPTH: '0'
GENARRATIVE_GITEA_TOKEN: ${{ github.token }}
run: genarrative-gitea-checkout
- name: Validate preinstalled CI job image and sandbox
run: GENARRATIVE_GITEA_CI_CHECK_RUNTIME=1 bash scripts/check-gitea-ci-job-image.sh
- name: Resolve comparison base
shell: bash
run: |
set -euo pipefail
base_ref="$(node -e '
const fs = require("node:fs");
const event = JSON.parse(fs.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8"));
process.stdout.write(event.pull_request?.base?.sha ?? event.before ?? "");
')"
if [[ -n "${base_ref}" && ! "${base_ref}" =~ ^0+$ ]]; then
git cat-file -e "${base_ref}^{commit}" 2>/dev/null || {
echo "comparison base commit is unavailable: ${base_ref}" >&2
exit 1
}
else
base_ref="$(git merge-base HEAD origin/master 2>/dev/null || git rev-parse HEAD)"
fi
resolved_base_ref="$(git rev-parse --verify "${base_ref}^{commit}" 2>/dev/null || true)"
head_ref="$(git rev-parse HEAD)"
if [[ "${resolved_base_ref}" == "${head_ref}" ]]; then
resolved_base_ref="$(git rev-parse --verify HEAD^ 2>/dev/null || true)"
fi
if [[ -z "${resolved_base_ref}" ]]; then
echo 'comparison base must resolve to a commit distinct from HEAD.' >&2
exit 1
fi
base_ref="${resolved_base_ref}"
if [[ "${GITHUB_EVENT_NAME:-}" == 'pull_request' ]] \
&& ! git merge-base --is-ancestor "${base_ref}" HEAD; then
echo 'pull request head does not contain the latest base commit; update the branch and rerun CI.' >&2
exit 1
fi
echo "SPACETIME_SCHEMA_BASE_REF=${base_ref}" >> "${GITHUB_ENV}"
- name: Install npm dependencies
run: bash scripts/ci-npm-ci-with-retry.sh
- name: Run repository checks
run: npm run check:repository-ci
# 客户端的 AI 游戏创作壳前端门禁:typecheck 与壳内测试,不触碰 Cargo。
ai-game-creator-shell-web-tests:
name: AI game creator shell web tests
runs-on: genarrative-ci
steps:
- name: Checkout full history from Gitea
env:
GENARRATIVE_GITEA_FETCH_DEPTH: '0'
GENARRATIVE_GITEA_TOKEN: ${{ github.token }}
run: genarrative-gitea-checkout
- name: Validate preinstalled CI job image and sandbox
run: GENARRATIVE_GITEA_CI_CHECK_RUNTIME=1 bash scripts/check-gitea-ci-job-image.sh
- name: Install npm dependencies
run: bash scripts/ci-npm-ci-with-retry.sh
- name: Run AI game creator shell web gates
run: npm run check:native-shells:agc-web
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@genarrative/ai-game-creator-shell",
"private": true,
"version": "0.1.27",
"version": "0.1.29",
"type": "module",
"scripts": {
"dev": "node scripts/start-tauri-dev.mjs",
@@ -957,6 +957,9 @@ async function runInteractiveCargo(cliArguments, setActiveChild) {
return result;
}
// 立项策划跑 standard 档,`agent.delegate` 这类动作按项目权限策略必须逐个确认,
// 而确认和问询都只从 CLI 的 stdin 读。自主构建档没有这一步,所以只有 --plan 需要
// 一个把「人坐在终端前敲 approve」自动化掉的应答器;判据本身仍然走后端确认命令。
const swarmConfirmationPromptPattern = /输入 approve 或 reject$/u;
const swarmUserInputPromptPattern = /请选择 1-\d+,或直接输入其他答案:$/u;
@@ -108,9 +108,16 @@ const rustSharedContractSource = fs.readFileSync(
);
const allowedUncalledTauriCommands = [
'append_direct_project_conversation_message',
// TODO: Remove the retired binding command after the legacy runtime path is removed.
'bind_components',
'chat_with_game_creator_agent',
'check_ui_editor_font_glyph_coverage',
'create_ui_design_resource',
// 图片类生成的同步变体:GUI 已改为 `start_local_project_asset_generation` + 项目内任务账本
// (提交即返回、后台生成)。这条命令**没有生产调用方**,只有 Rust 集成测试
// `src/tests/project.rs`)与 `commands.rs` 单测在调;待后续批次删除,或改为转调
// `start_local_project_asset_generation`。
'generate_local_project_asset',
'open_game_creator_launcher_window',
'open_game_creator_workspace_window',
'read_direct_project_conversation',
@@ -0,0 +1,461 @@
#!/usr/bin/env node
// AGC 壳 Rust 套件的分片运行器。
//
// 背景:AGC 壳的 Rust 单测集中在 src/main.rs 的 bin target(实测 2466 条),仓库口径用
// `--test-threads=1` 跑,理由是并行调度会让共享 Agent Runtime 后台锁与异步终态的用例在
// **同一进程内**互相干扰(见 development-workflow 的 Tauri suite 单线程口径)。代价是
// 整套用例串行跑满 507 秒,占掉 CI 上 `AI game creator shell Rust tests` job 的大头。
//
// 这里保留「片内串行」的既有口径,只把用例集合切成 N 片:
// - CI 用 `--shard-index=<i>` 让**每个 job 只跑一片**,靠多个 job 并发把整套用例摊开;
// - 本地不传 `--shard-index` 时把 N 片放进 N 个**独立进程**并行(--concurrency 可调),
// 保留一条命令跑全量的入口。
// 片并集必须等于全集、且不得重复,数量不符即失败,防止分片规则改动后静默漏跑;该校验
// 与「只跑一片」无关,因此在每个 job 上都会执行。
//
// 注意:同一容器内多进程并行这套用例(共享 HOME、target、固定临时路径)实测会互相拖慢,
// 比串行还慢,所以 CI 走「一个 job 一片」而不是单 job 内并行。
//
// 用法:
// node scripts/run-rust-shell-test-shards.mjs --shards=4 --shard-index=2 # CI:只跑第 2 片
// node scripts/run-rust-shell-test-shards.mjs [--shards=4] [--concurrency=4] # 本地:全量
// node scripts/run-rust-shell-test-shards.mjs --manifest=<Cargo.toml> --target-kind=lib --no-locked
//
// 参数:
// --shards=<n> 分片数,默认 4
// --shard-index=<i> 只跑第 i 片(1..shards);不传则跑全部分片
// --concurrency=<n> 同时运行的片数,默认等于分片数;--shard-index 时恒为 1
// --manifest=<path> Cargo.toml,默认 ../src-tauri/Cargo.toml(相对本脚本)
// --target-kind=<k> bin | lib,默认 bin(本地自测小 crate 时用 lib
// --bin=<name> bin target 名,默认 genarrative-ai-game-creator-shell
// --package=<name> target-kind=lib 时要跑的包名(配合 lib 目标使用)
// --no-locked 传给 cargo 时不带 --locked(只对没有提交 Cargo.lock 的 crate 需要)
// --shard-tmp-root=<path> 片专属 TMPDIR 的父目录,默认 <系统临时目录>/agc-rust-shards
import { spawn } from 'node:child_process';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const scriptDirectory = path.dirname(fileURLToPath(import.meta.url));
const shellRoot = path.resolve(scriptDirectory, '..');
function fail(message) {
console.error(`[rust-shards] ${message}`);
process.exit(1);
}
function parsePositiveInteger(name, rawValue) {
if (!/^[1-9][0-9]*$/.test(rawValue)) {
fail(`${name} must be a positive integer, received: ${rawValue}`);
}
return Number(rawValue);
}
const options = {
shards: 4,
shardIndex: undefined,
concurrency: undefined,
manifestPath: path.join(shellRoot, 'src-tauri', 'Cargo.toml'),
targetKind: 'bin',
binName: 'genarrative-ai-game-creator-shell',
packageName: undefined,
locked: true,
shardTmpRoot: path.join(os.tmpdir(), 'agc-rust-shards'),
};
for (const rawArgument of process.argv.slice(2)) {
if (rawArgument === '--no-locked') {
options.locked = false;
continue;
}
const separatorIndex = rawArgument.indexOf('=');
if (!rawArgument.startsWith('--') || separatorIndex === -1) {
fail(`unexpected argument: ${rawArgument}`);
}
const name = rawArgument.slice(2, separatorIndex);
const value = rawArgument.slice(separatorIndex + 1);
switch (name) {
case 'shards':
options.shards = parsePositiveInteger('--shards', value);
break;
case 'shard-index':
options.shardIndex = parsePositiveInteger('--shard-index', value);
break;
case 'concurrency':
options.concurrency = parsePositiveInteger('--concurrency', value);
break;
case 'manifest':
options.manifestPath = path.resolve(process.cwd(), value);
break;
case 'target-kind':
if (value !== 'bin' && value !== 'lib') {
fail(`--target-kind must be bin or lib, received: ${value}`);
}
options.targetKind = value;
break;
case 'bin':
options.binName = value;
break;
case 'package':
options.packageName = value;
break;
case 'shard-tmp-root':
options.shardTmpRoot = path.resolve(process.cwd(), value);
break;
default:
fail(`unexpected argument: ${rawArgument}`);
}
}
if (!fs.existsSync(options.manifestPath)) {
fail(`manifest does not exist: ${options.manifestPath}`);
}
if (options.shardIndex !== undefined && options.shardIndex > options.shards) {
fail(
`--shard-index (${options.shardIndex}) must be within --shards (${options.shards})`,
);
}
const concurrency = options.concurrency ?? options.shards;
const crateRoot = path.dirname(options.manifestPath);
function buildCargoArguments(target) {
const cargoArguments = ['test'];
if (options.locked) {
cargoArguments.push('--locked');
}
cargoArguments.push('--manifest-path', options.manifestPath);
if (target.kind === 'lib') {
if (options.packageName !== undefined) {
cargoArguments.push('-p', options.packageName);
}
cargoArguments.push('--lib');
return cargoArguments;
}
cargoArguments.push('--bin', target.name);
return cargoArguments;
}
function formatDuration(milliseconds) {
return `${(milliseconds / 1000).toFixed(1)}s`;
}
// 编译一次,直接拿到测试可执行文件:后续每片都运行同一个二进制,不再各自调用 cargo,
// 免得 N 个 cargo 去争 package cache 与 target 目录锁。
function resolveTestExecutable() {
return new Promise((resolve, reject) => {
const cargoArguments = buildCargoArguments({
kind: options.targetKind,
name: options.binName,
});
cargoArguments.push('--no-run', '--message-format=json');
console.log(`[rust-shards] cargo ${cargoArguments.join(' ')}`);
const child = spawn('cargo', cargoArguments, {
cwd: crateRoot,
env: process.env,
stdio: ['ignore', 'pipe', 'inherit'],
});
let buffered = '';
const executables = [];
child.stdout.setEncoding('utf8');
child.stdout.on('data', (chunk) => {
buffered += chunk;
const lines = buffered.split('\n');
buffered = lines.pop() ?? '';
for (const line of lines) {
if (!line.startsWith('{')) {
continue;
}
let message;
try {
message = JSON.parse(line);
} catch {
continue;
}
if (
message.reason === 'compiler-artifact' &&
typeof message.executable === 'string'
) {
executables.push(message.executable);
}
}
});
child.on('error', (error) => {
reject(new Error(`unable to start cargo: ${error.message}`));
});
child.on('close', (code) => {
if (code !== 0) {
reject(
new Error(
`cargo ${cargoArguments.join(' ')} failed with exit code ${code}`,
),
);
return;
}
const uniqueExecutables = [...new Set(executables)];
if (uniqueExecutables.length !== 1) {
reject(
new Error(
`expected exactly one test executable for the ${options.targetKind} target, found ${uniqueExecutables.length}: ${uniqueExecutables.join(', ')}`,
),
);
return;
}
resolve(uniqueExecutables[0]);
});
});
}
function listTestNames(executable) {
return new Promise((resolve, reject) => {
const child = spawn(executable, ['--list'], {
cwd: crateRoot,
env: process.env,
stdio: ['ignore', 'pipe', 'pipe'],
});
let stdout = '';
let stderr = '';
child.stdout.setEncoding('utf8');
child.stderr.setEncoding('utf8');
child.stdout.on('data', (chunk) => {
stdout += chunk;
});
child.stderr.on('data', (chunk) => {
stderr += chunk;
});
child.on('error', (error) => {
reject(new Error(`unable to list tests: ${error.message}`));
});
child.on('close', (code) => {
if (code !== 0) {
reject(
new Error(
`listing tests failed with exit code ${code}: ${stderr.trim()}`,
),
);
return;
}
const names = [];
for (const line of stdout.split('\n')) {
const match = /^(.*): test$/.exec(line.trim());
if (match !== null && match[1].length > 0) {
names.push(match[1]);
}
}
resolve(names);
});
});
}
function splitTestNames(testNames, shardCount) {
const sortedNames = [...testNames].sort();
const shards = Array.from({ length: shardCount }, () => []);
sortedNames.forEach((testName, index) => {
shards[index % shardCount].push(testName);
});
return shards;
}
function assertShardsCoverEveryTest(testNames, shards) {
const flattened = shards.flat();
if (flattened.length !== testNames.length) {
fail(
`shard split covered ${flattened.length} of ${testNames.length} tests; the split rule must be exhaustive`,
);
}
if (new Set(flattened).size !== flattened.length) {
fail(
'shard split selected the same test more than once; the split rule must be disjoint',
);
}
const missing = testNames.filter((testName) => !flattened.includes(testName));
if (missing.length > 0) {
fail(
`shard split is missing tests, for example: ${missing.slice(0, 5).join(', ')}`,
);
}
}
function runShard(executable, shardIndex, shardCount, shardTestNames) {
const label = `shard ${shardIndex + 1}/${shardCount}`;
const shardTmpDirectory = path.join(
options.shardTmpRoot,
`shard-${shardIndex + 1}`,
);
fs.rmSync(shardTmpDirectory, { recursive: true, force: true });
fs.mkdirSync(shardTmpDirectory, { recursive: true });
const startedAt = Date.now();
return new Promise((resolve) => {
const child = spawn(
executable,
['--exact', ...shardTestNames, '--test-threads=1'],
{
cwd: crateRoot,
env: {
...process.env,
TMPDIR: shardTmpDirectory,
TMP: shardTmpDirectory,
TEMP: shardTmpDirectory,
},
stdio: ['ignore', 'pipe', 'pipe'],
},
);
const failureLines = [];
let inFailureList = false;
let stderr = '';
const consumeLine = (rawLine) => {
const line = rawLine.replace(/\r$/, '');
if (line.includes('failures:')) {
inFailureList = true;
return;
}
if (inFailureList) {
if (line.trim().length === 0) {
inFailureList = false;
return;
}
failureLines.push(line.trim());
}
};
child.stdout.setEncoding('utf8');
child.stderr.setEncoding('utf8');
let stdoutBuffer = '';
child.stdout.on('data', (chunk) => {
stdoutBuffer += chunk;
const lines = stdoutBuffer.split('\n');
stdoutBuffer = lines.pop() ?? '';
for (const line of lines) {
consumeLine(line);
}
});
child.stderr.on('data', (chunk) => {
stderr += chunk;
});
child.on('error', (error) => {
resolve({
label,
ok: false,
durationMs: Date.now() - startedAt,
testCount: shardTestNames.length,
failures: [`unable to start test binary: ${error.message}`],
stderr,
});
});
child.on('close', (code) => {
resolve({
label,
ok: code === 0,
durationMs: Date.now() - startedAt,
testCount: shardTestNames.length,
failures: failureLines,
stderr,
});
});
});
}
async function runWithConcurrency(shards, runner) {
const results = new Array(shards.length);
let nextIndex = 0;
const workers = Array.from(
{ length: Math.min(concurrency, shards.length) },
async () => {
while (nextIndex < shards.length) {
const index = nextIndex;
nextIndex += 1;
results[index] = await runner(shards[index], index);
}
},
);
await Promise.all(workers);
return results;
}
async function main() {
const executable = await resolveTestExecutable();
const testNames = await listTestNames(executable);
if (testNames.length === 0) {
fail(
`no tests discovered in ${options.manifestPath} (${options.targetKind})`,
);
}
const shards = splitTestNames(testNames, options.shards);
assertShardsCoverEveryTest(testNames, shards);
const selectedShards =
options.shardIndex === undefined
? shards.map((shardTestNames, index) => ({ index, shardTestNames }))
: [
{
index: options.shardIndex - 1,
shardTestNames: shards[options.shardIndex - 1],
},
];
if (options.shardIndex === undefined) {
console.log(
`[rust-shards] ${testNames.length} tests, ${shards.length} shard(s), concurrency ${Math.min(concurrency, shards.length)}`,
);
for (const { index, shardTestNames } of selectedShards) {
console.log(
`[rust-shards] shard ${index + 1}/${shards.length}: ${shardTestNames.length} test(s)`,
);
}
} else {
console.log(
`[rust-shards] ${testNames.length} tests, ${shards.length} shard(s), running shard ${options.shardIndex}/${shards.length} (${selectedShards[0].shardTestNames.length} test(s))`,
);
}
const results = await runWithConcurrency(
selectedShards,
({ index, shardTestNames }) =>
runShard(executable, index, shards.length, shardTestNames),
);
let failed = false;
for (const result of results) {
if (result.ok) {
console.log(
`[rust-shards] ${result.label} ok: ${result.testCount} test(s) in ${formatDuration(result.durationMs)}`,
);
continue;
}
failed = true;
console.error(
`[rust-shards] ${result.label} FAILED: ${result.testCount} test(s) in ${formatDuration(result.durationMs)}`,
);
for (const failure of result.failures) {
console.error(`[rust-shards] ${failure}`);
}
if (result.stderr.trim().length > 0) {
console.error(
`[rust-shards] stderr: ${result.stderr.trim().split('\n').slice(-20).join('\n[rust-shards] ')}`,
);
}
}
if (failed) {
process.exit(1);
}
console.log('[rust-shards] OK');
}
main().catch((error) => {
fail(error instanceof Error ? error.message : String(error));
});
@@ -8,6 +8,7 @@ export const SKILL_PACK_SCHEMA_VERSION = 'agc-skill-pack.v1';
export const EXPECTED_SKILL_NAMES = Object.freeze([
'agc-browser-playtest',
'agc-client-projection',
'agc-game-production-workflow',
'agc-project-structure',
'agc-web-game-development',
'taonier-art-assets',
+1 -1
View File
@@ -1725,7 +1725,7 @@ dependencies = [
[[package]]
name = "genarrative-ai-game-creator-shell"
version = "0.1.27"
version = "0.1.29"
dependencies = [
"agent-runtime-core",
"axum",
@@ -1,6 +1,6 @@
[package]
name = "genarrative-ai-game-creator-shell"
version = "0.1.27"
version = "0.1.29"
edition = "2021"
publish = false
@@ -0,0 +1,26 @@
---
name: agc-game-production-workflow
description: Orchestrate a complete AGC game delivery from an approved brief to a playable, art-integrated, browser-validated product. Use when creating a new game, implementing a substantial game brief, or turning a planning document into a finished game.
---
# AGC Game Production Workflow
Use this Skill as the top-level SOP for a new game or a substantial game brief. The tools are stages in one delivery chain, not independent suggestions. Do not stop after producing a plan, after writing code, or after generating an image.
## Stage flow
1. **Brief and scope** — Read the current planning output and project instructions. Extract the game loop, player actions, entities, visual requirements, target viewports, and the completion evidence. If the brief is incomplete, ask focused questions before side effects.
2. **Project and asset inventory** — Inspect the existing project structure and call `agc_list_registered_assets` (and `agc_list_project_files` when needed). Record which requested visuals already have usable registered identities and which are missing. Do not invent asset identities from filenames.
3. **Visual production** — For missing or unsuitable visuals, call the reviewed `agc_tools` workflow: use `taonier_prepare_game_art` for a complete package, or `agc_generate_image` / `agc_edit_image` for focused assets. Read returned paths, identities, and warnings. A warning or partial package requires a narrower retry or independent assets before continuing.
4. **Game implementation** — Implement the complete playable loop and wire the returned project-relative asset paths into the actual runtime. Every required character, object, background, effect, and UI visual must have a real source or an explicit brief-level decision to remain code-native. Generated assets that are unused, documentation-only, or replaced by emoji/CSS placeholders do not satisfy this stage.
5. **Build and local verification** — Run the projects bootstrap/install and verify/build commands. Confirm the actual playable entry under `dist` (or the editor runtime for a supported editor project) and fix build or asset-loading failures before preview.
6. **Browser playtest** — Call `agc_browser_playtest` for desktop and mobile evidence after meaningful changes. Check the game loop, input, layout, asset loading, and visible use of the generated art. Fix findings and repeat stages 46 until the evidence is clean.
7. **Delivery** — Report the implemented behavior, real asset paths and identities used, build result, playtest evidence, warnings, and any explicit remaining gap. Do not claim complete while a required stage is failed, skipped without the briefs justification, or missing evidence.
## Stage transitions
Advance only when the current stage has its output: brief → inventory; inventory → art decision; art decision → usable registered assets or an explicit no-art decision; implementation → source references to those assets; build → playable entry; playtest → evidence; delivery → truthful report. If a tool fails, preserve its error and stop or repair at that stage instead of silently substituting a later-stage placeholder.
For a small edit to an existing game where the brief and suitable assets are unchanged, use the focused edit path and do not regenerate art. This exception does not apply to a new game or a substantial planning brief.
Read the referenced specialist Skills for their detailed contracts: `agc-project-structure`, `taonier-art-assets`, `agc-web-game-development`, `agc-client-projection`, and `agc-browser-playtest`.
@@ -0,0 +1,4 @@
interface:
display_name: "完整游戏生产流程"
short_description: "从策划案到真实美术接入和试玩验收的连续交付"
default_prompt: "Use $agc-game-production-workflow to take the current game brief through inventory, art, implementation, build, playtest, and delivery."
@@ -0,0 +1,5 @@
# Workflow contract
The production Skill owns sequencing and transition evidence. Specialist Skills own the detailed safety and data rules for each tool family. A specialist tool result is never a delivery result by itself: image generation must be followed by registered identity inspection and runtime integration; code writing must be followed by build verification; a successful preview launch must be followed by desktop and mobile playtest evidence when the brief targets both.
The no-art exception is valid only when the brief explicitly requests a code-native visual treatment or the inventory proves that all required visuals are already registered and suitable. Emoji, CSS primitives, random local files, and generated files that are not referenced by the runtime are not evidence of an integrated art package.
@@ -14,7 +14,7 @@ Implement the user's actual game request in the current project as an npm-manage
3. Build with the project's npm script before previewing. The playable entry is the package directory's `dist/index.html`; never report an unbuilt bare-module page as playable. Import assets or configure public assets so all runtime media is included in dist; preview and exports cannot read outside it.
4. Build a complete playable loop: visible objective, responsive input, meaningful state changes, success or failure feedback, and a reliable restart path where the game needs one.
5. Fit the active game scene to desktop and mobile viewports without accidental page scrollbars. Reserve deliberate safe space for HUD elements instead of covering interactive content.
6. Reuse registered Taonier art when available through `agc_tools`. Load media defensively and keep gameplay usable when an optional derivative is absent; never relabel a local placeholder as platform art.
6. Invoke `taonier-art-assets` for every new game brief that needs visual assets. First reuse suitable registered Taonier art; when the brief's required visual elements are missing or unsuitable, call the reviewed `agc_tools` generation/edit workflow in the same task. After the tool returns, wire its relative paths into the game and verify the rendered result. A game with unused generated assets or placeholder emoji/CSS where requested art should appear is not complete. Load media defensively only for genuinely optional effects, and never relabel a local placeholder as platform art.
7. Let Phaser own the render loop and input dispatch. Avoid duplicate scenes, stale event listeners, and state that survives restart unintentionally.
8. After a meaningful game change, use the browser playtest Skill and fix issues shown by real evidence before reporting completion.
@@ -1,7 +1,29 @@
{
"schemaVersion": "agc-skill-pack.v1",
"version": "2026-08-26.12",
"version": "2026-08-26.13",
"skills": [
{
"name": "agc-game-production-workflow",
"purpose": "把完整游戏从策划案按阶段推进到真实素材接入、构建、试玩和交付",
"triggers": [
"从策划案创建完整游戏",
"实现完整游戏交付",
"需要衔接策划、素材、代码、构建和试玩"
],
"requiredTools": [
"agc_tools.agc_list_registered_assets",
"agc_tools.agc_generate_image",
"agc_tools.agc_edit_image",
"agc_tools.taonier_prepare_game_art",
"agc_tools.agc_browser_playtest"
],
"files": [
"SKILL.md",
"agents/openai.yaml",
"references/workflow-contract.md"
],
"sha256": "91082fdff4123f1e1fcf930af433cbea51a8c9d26991678b19028b344ea49f39"
},
{
"name": "agc-project-structure",
"purpose": "约束当前项目根、游戏代码、美术素材与客户端状态的职责边界",
@@ -31,6 +53,7 @@
"已有陶泥儿素材需要接入玩法"
],
"requiredTools": [
"agc_tools.agc_list_registered_assets",
"agc_tools.agc_generate_image",
"agc_tools.agc_edit_image",
"agc_tools.taonier_prepare_game_art"
@@ -40,7 +63,7 @@
"agents/openai.yaml",
"references/platform-art-contract.md"
],
"sha256": "82e4b2ee8ca8147b51ca206b0565b3cc244dc5d3cddb8343875001c0beb4711f"
"sha256": "bd1e415aac0cd0f97090296f34c67898dd731d1e177ec91a56027f9b68a88b37"
},
{
"name": "agc-web-game-development",
@@ -57,7 +80,7 @@
"agents/openai.yaml",
"references/game-quality-checklist.md"
],
"sha256": "0649c72dd53e05ad7c87b28def1397c2badf61b0c308091196c40f7c48a8b36a"
"sha256": "05b5cfbf7a40fd303717491f5cea84ff339a73359c9678b283fd54d2b5c45efd"
},
{
"name": "agc-browser-playtest",
@@ -5,7 +5,15 @@ description: Prepare, recover, inspect, and integrate real Taonier platform game
# Taonier Art Assets
Use real platform assets only through the reviewed `agc_tools` MCP server. Use
Use real platform assets only through the reviewed `agc_tools` MCP server. When
building a new game from a brief that names characters, objects, backgrounds,
effects, or other visual elements, this Skill is an execution step: inspect
existing assets, generate or reuse suitable art, process it when needed, and
integrate the returned paths into the playable game before reporting the game
complete. Do not treat the art step as optional merely because the user did
not repeat “生图” in the latest message.
Use
`agc_generate_image` for a single ordinary image, character image, visual-spec
image, UI design image, or publication material; use `agc_edit_image` for an
edit of an existing registered image; use `taonier_prepare_game_art` only for
@@ -17,11 +25,11 @@ the complete game-art package and its canonical slices.
## Workflow
1. Inspect existing `assets/` and registered project evidence before requesting new art. Reuse suitable assets when the user did not ask to regenerate them.
1. Inspect existing `assets/` and registered project evidence before requesting new art. Reuse suitable assets when they satisfy the current brief. If the brief requires visual elements that are absent or unsuitable, call the appropriate generation tool during the same game implementation task; do not continue with placeholder art and silently defer generation.
2. For one new image, call `agc_generate_image` with `kind="image"` (or `character`, `icon-spec`, `ui-prototype`, or `publication-material` when that is the explicit intent). For changes to an existing registered image, call `agc_edit_image` with its `sourceLocalAssetId`; do not fake an edit with a new-image request. For a complete game-art package, call `taonier_prepare_game_art` only when the current intent requires new or recoverable platform art. Use `mode="regenerate"` only after the latest User message is a standalone reviewed immediate-confirmation command such as `请重新生成美术`; punctuation may end it, but no brief, condition, negation, alternative, cost qualifier, deferral, or other text may accompany it. Describe the desired style and gameplay constraints in an earlier non-billable turn, then obtain the standalone confirmation turn; otherwise use `mode="reuse-or-create"`. Quoted UI copy or examples, explanations, questions, historical wording, model/MCP arguments do not authorize regeneration. Pass a concise game-specific visual brief that names the required gameplay entities, background exclusions, tiling needs, and viewport constraints. Do not call either generation tool for greetings, date questions, or text-only code fixes.
3. Treat the tool result as authoritative. Read `mode`, `assetPaths`, `slicePaths`, `resources`, and every entry in both `warnings` and `sliceWarnings`. `resources` is the client's safe projection of registered Canvas identities; use only its returned relative paths and identities. Never invent a resource, slice, platform identity, warning-free result, or successful regeneration.
4. A newly created or explicitly regenerated standard package is complete only when `slicePaths` contains the four canonical independent slices. An empty or partial `slicePaths` result never satisfies an independent-asset requirement; stop and report the warning instead of guessing atlas coordinates or fabricating derivatives. A trusted legacy complete sheet may still be used without slices only when the current request does not require independent assets.
5. Inspect the returned background, complete sheet, and available slice previews before integrating them. Then use suitable returned runtime assets in the game's actual visible experience and confirm their visible use in desktop and mobile playtest evidence. `art-spec.png` is a reference specification, not a runtime background, character, prop, or effect. Background exclusions, seamless tiling, entity semantics, and final draw dimensions are visual/runtime acceptance checks; a prompt alone does not prove them. A hidden or side-panel preview does not count as gameplay use.
4. A newly created or explicitly regenerated standard package is complete only when `slicePaths` contains the four canonical independent slices. An empty or partial `slicePaths` result never satisfies an independent-asset requirement: if a `sliceWarning` reports too many or unusable elements, narrow the edit/generation brief or generate the needed independent images and continue the integration; do not guess atlas coordinates, fabricate derivatives, or silently fall back to placeholders. A trusted legacy complete sheet may still be used without slices only when the current request does not require independent assets.
5. Inspect the returned background, complete sheet, and available slice previews before integrating them. Then use suitable returned runtime assets in the game's actual visible experience and confirm their visible use in desktop and mobile playtest evidence. The implementation is incomplete while generated assets remain unused, are referenced only by documentation, or are replaced by emoji, CSS shapes, or other placeholders where the brief requires the generated art. `art-spec.png` is a reference specification, not a runtime background, character, prop, or effect. Background exclusions, seamless tiling, entity semantics, and final draw dimensions are visual/runtime acceptance checks; a prompt alone does not prove them. A hidden or side-panel preview does not count as gameplay use.
6. Preserve warning details in the final report. If the tool reports missing credentials, uncertain operation state, invalid provenance, download failure, or decode failure, stop and report the actionable reason; do not substitute generated CSS shapes and call the platform step complete.
Before interpreting async recovery, source-preserved warnings, or slice warnings, read `references/platform-art-contract.md`.
@@ -4999,7 +4999,7 @@ case "$extra_roots" in *'"method":"skills/extraRoots/set"'*) ;; *) exit 87 ;; es
printf '%s\n' '{"id":2,"result":{}}'
IFS= read -r skills_list
case "$skills_list" in *'"method":"skills/list"'*) ;; *) exit 88 ;; esac
printf '%s\n' '{"id":3,"result":{"data":[{"skills":[{"name":"agc-browser-playtest"},{"name":"agc-client-projection"},{"name":"agc-project-structure"},{"name":"agc-web-game-development"},{"name":"taonier-art-assets"}],"errors":[]}]}}'
printf '%s\n' '{"id":3,"result":{"data":[{"skills":[{"name":"agc-browser-playtest"},{"name":"agc-client-projection"},{"name":"agc-game-production-workflow"},{"name":"agc-project-structure"},{"name":"agc-web-game-development"},{"name":"taonier-art-assets"}],"errors":[]}]}}'
while IFS= read -r line; do :; done
"#,
)
@@ -795,10 +795,15 @@ pub(crate) async fn continue_design_agent_at(
.ok_or("策划 Agent 当前正在工作")?;
let mut session = match read_design_session(root)? {
Some(session) => session,
None => new_design_session(
&project_id,
&load_game_creator_app_config()?.selected_model_id,
),
None => {
if read_planning_session_v2(root)?.is_some() {
return Err("此项目包含旧策划会话,请查看原有记录或在新项目开始五阶段策划".into());
}
new_design_session(
&project_id,
&load_game_creator_app_config()?.selected_model_id,
)
}
};
if session.project_id != project_id {
return Err("策划会话与当前项目不匹配".into());
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -1074,6 +1074,102 @@ pub(in crate::agent) fn remove_platform_art_generation_runtime_state_at(
}
}
/// 一次性兼容:升级前 standalone 槽身份只由 `{outputPath, requireSlices}` 派生,
/// 同一项目所有图片类生成共用一个槽;升级后槽身份按精确动作派生,路径随之变化。
///
/// 若旧槽路径上的账本仍然属于本次精确动作(`agentId` 与 `actionFingerprint` 都与
/// 当前上下文一致),就在项目写锁内把它迁移到新身份路径:保留原 `idempotencyKey`
/// 与 `operationId`,避免同一精确动作在升级后二次 POST 计费。旧账本属于其他动作时
/// 原样保留(不迁移、不删除、不阻塞),由对应动作自己的请求迁移。
///
/// 返回 `Ok(false)` 表示没有需要迁移的旧账本。任何身份无法安全解释的情形都失败关闭。
pub(super) fn adopt_legacy_standalone_platform_art_generation_runtime_state_at(
root: &Path,
context: &PlatformArtGenerationRuntimeContext,
legacy_run_id: &str,
) -> Result<bool, String> {
if !is_standalone_platform_art_generation_runtime_context(context)
|| legacy_run_id == context.run_id
|| !is_lowercase_sha256(legacy_run_id.strip_prefix("slot-").unwrap_or_default())
{
return Ok(false);
}
// 与账本创建互斥:迁移必须在同一把项目写锁内完成,否则两个调用可能同时把同一份
// 旧账本迁移到新路径,或与新建账本互相覆盖。
let _claim_lock = acquire_game_creator_agent_runtime_project_write_lock_with_wait(
root,
"canvas.asset_generate.runtime.claim",
)?;
if game_creator_agent_runtime_external_generation_exists(
root,
&context.agent_id,
&context.run_id,
) {
// 新身份账本已经存在:旧账本不属于本次动作的权威状态,保持两边各自的身份。
return Ok(false);
}
let legacy_relative_path =
platform_art_generation_runtime_relative_path(&context.agent_id, legacy_run_id);
let Some(legacy_state) =
read_agent_runtime_json_sidecar_with_max_bytes::<PlatformArtGenerationRuntimeState>(
root,
&legacy_relative_path,
"External Editor 生成账本",
PLATFORM_ART_GENERATION_RUNTIME_MAX_BYTES,
)?
else {
return Ok(false);
};
if legacy_state.agent_id != context.agent_id
|| legacy_state.run_id != legacy_run_id
|| legacy_state.action_fingerprint != context.action_fingerprint
{
// 旧槽里是另一个精确动作的账本:它仍归那个动作所有,本次调用不得消费、改写或删除它。
return Ok(false);
}
let legacy_identity = format!("{}:{legacy_run_id}", context.agent_id);
let legacy_context = PlatformArtGenerationRuntimeContext {
task_id: legacy_identity.clone(),
session_id: legacy_identity.clone(),
run_id: legacy_run_id.to_string(),
action_id: legacy_identity,
..context.clone()
};
let Some(mut migrated) = read_platform_art_generation_runtime_state(root, &legacy_context)?
else {
return Ok(false);
};
migrated.run_id = context.run_id.clone();
migrated.task_id = context.task_id.clone();
migrated.session_id = context.session_id.clone();
migrated.action_id = context.action_id.clone();
migrated.updated_at = unix_timestamp();
write_platform_art_generation_runtime_state(root, &migrated)?;
remove_platform_art_generation_runtime_state_at(root, &context.agent_id, legacy_run_id)?;
Ok(true)
}
#[cfg(test)]
pub(super) fn platform_art_generation_runtime_operation_id_for_test(
state: &PlatformArtGenerationRuntimeState,
) -> Option<&str> {
state.operation_id.as_deref()
}
#[cfg(test)]
pub(super) fn platform_art_generation_runtime_run_id_for_test(
state: &PlatformArtGenerationRuntimeState,
) -> &str {
&state.run_id
}
#[cfg(test)]
pub(super) fn platform_art_generation_runtime_action_fingerprint_for_test(
state: &PlatformArtGenerationRuntimeState,
) -> &str {
&state.action_fingerprint
}
#[cfg(test)]
pub(crate) fn write_platform_art_generation_runtime_accepted_for_test(
root: &Path,
@@ -1156,6 +1156,10 @@ mod tests {
assert!(with_canvas.contains("根据当前玩法需求编写规格和界面建议"));
assert!(with_canvas.contains("用途、数量、输出路径、尺寸、参考资源和是否需要 spritesheet"));
assert!(with_canvas.contains("再调用 canvas.asset_generate"));
assert!(with_canvas.contains("调用 canvas.asset_generate"));
assert!(with_canvas.contains("不要使用固定图片合同"));
assert!(with_canvas.contains("不修改 game/index.html"));
assert!(!with_canvas.contains("不调用 canvas.asset_generate"));
}
#[test]
@@ -801,7 +801,7 @@ fn agent_runtime_action_receipt_safe_detail_with_owner(
let initial_step = route.get("initialStep")?.as_str()?;
let render_mode = route.get("renderMode")?.as_str()?;
if resource_id.is_empty()
|| initial_step != "visual-binding"
|| initial_step != "asset-separation"
|| render_mode != "final-preview"
{
return None;
@@ -78,6 +78,12 @@ pub(super) fn game_creator_agent_final_reply_error_allows_fallback(error: &str)
matches!(kind.as_str(), "empty-response" | "deserialize")
}
/// 这些错误只描述本次 Provider input 或候选 GDD;真正的 session CAS 冲突不在
/// 此列——那说明 durable session 已被推进或损坏,必须 reconcile。
fn plan_submit_error_is_business_rejection(error: &PlanningStorageError) -> bool {
matches!(error.code(), "PLAN_INVALID_REQUEST" | "PLAN_SIZE_LIMIT")
}
const AGENT_RUNTIME_PLAN_UPDATE_IDLE_LIMIT: u32 = 4;
/// 最终回复被收束门禁拦下后 run 会原地续跑重试。多数 blocker 是模型自己能解的
@@ -7,6 +7,9 @@ mod design_session;
mod finalization;
mod json_sidecar;
mod models;
mod planning_gdd_model;
mod planning_policy_v2;
mod planning_session_v2;
mod provider_control;
mod provider_retry;
mod real_e2e_checkpoint;
@@ -21,6 +24,9 @@ pub(crate) use design_session::*;
pub(in crate::agent) use finalization::*;
pub(in crate::agent) use json_sidecar::*;
pub(in crate::agent) use models::*;
pub(crate) use planning_gdd_model::*;
pub(crate) use planning_policy_v2::*;
pub(crate) use planning_session_v2::*;
pub(in crate::agent) use provider_control::*;
pub(in crate::agent) use provider_retry::*;
pub(in crate::agent) use real_e2e_checkpoint::*;

Some files were not shown because too many files have changed in this diff Show More