对齐主线图集契约与窗口同步测试要求

补齐图集切分声明与工具目录字段边界断言

更新原生HTTP权限守卫及稳定空快照发布次数期望

修正末尾空行并记录CI排查证据,保留待远程验证状态
This commit is contained in:
2026-09-17 21:01:26 +08:00
parent db5edc948c
commit efce7b102f
6 changed files with 38 additions and 10 deletions
@@ -806,7 +806,11 @@ async fn background_agent_runtime_can_generate_platform_art_asset() {
"imageSize": "1K",
"assetKind": "art-spritesheet",
"assetLabel": "游戏首版核心美术素材",
"replaceExisting": false
"replaceExisting": false,
// 图集切分没有默认值:必须显式声明,且与平台回显的 sliceMode/gridX/gridY 一致。
"sliceMode": "grid",
"gridX": 2,
"gridY": 2
}
}
],
@@ -6916,9 +6916,29 @@ fn agent_native_function_catalog_exposes_each_runtime_tool_with_core_schemas() {
"imageSize",
"assetKind",
"assetLabel",
"replaceExisting"
"replaceExisting",
"sliceMode",
"gridX",
"gridY",
"sliceCount"
])
);
let canvas_properties = &canvas_asset.parameters["properties"]["input"]["properties"];
assert_eq!(
canvas_properties["sliceMode"]["enum"],
serde_json::json!(["connected-components", "grid", null])
);
for field in ["gridX", "gridY", "sliceCount"] {
assert_eq!(
canvas_properties[field]["type"],
serde_json::json!(["integer", "null"])
);
assert_eq!(canvas_properties[field]["minimum"], 1);
assert_eq!(
canvas_properties[field]["maximum"],
if field == "sliceCount" { 256 } else { 32 }
);
}
assert_eq!(
canvas_asset.parameters["properties"]["input"]["properties"]["aspectRatio"]["enum"],
serde_json::json!(["1:1", "2:3", "3:2", "9:16", "16:9", null])
@@ -502,5 +502,3 @@ describe('音频生成身份', () => {
);
}, 20_000);
});
@@ -84,8 +84,12 @@ it('真实窗口与工作台状态同步收敛,回调读取最新处理器且
await act(async () => {
await Promise.resolve();
});
// 无原生 invoke 时 active-turn Hook 会把初始快照归一为空数组一次。
expect(publications).toHaveLength(2);
/*
* 无原生 invoke 时 active-turn Hook 只有「空态」这一种状态:空快照引用保持稳定
* (不再 `setActiveTurns([])` 换新数组),`snapshotReadFailed` 也保持 false。
* 依赖项一个都没变,工作台只应发布一次。
*/
expect(publications).toHaveLength(1);
expect(cleanups).toBe(0);
expect(new Set(publications.map((item) => item.onOpenProject)).size).toBe(
1,
@@ -94,13 +98,15 @@ it('真实窗口与工作台状态同步收敛,回调读取最新处理器且
const latestOpen = vi.fn(async () => undefined);
homeProjectOverride.openProject = latestOpen;
rendered.rerender(view('更改显示名'));
expect(publications).toHaveLength(2);
// 非依赖变化的重渲染不能让窗口面板重新发布。
expect(publications).toHaveLength(1);
act(() => openProject('/tmp/window-latest-project'));
expect(latestOpen).toHaveBeenCalledWith(
'/tmp/window-latest-project',
'open',
);
expect(publications).toHaveLength(2);
// 回调执行只换 ref 里的实现,发布次数与清理次数都不能变。
expect(publications).toHaveLength(1);
expect(cleanups).toBe(0);
rendered.unmount();
expect(cleanups).toBe(1);