修复资源编辑分支持续集成门禁
同步全类型资源投影与工具栏测试断言 补齐 HTML 文本资源预览回归 消除委派回执测试的异步唤醒竞态 更新资源编辑验证约定
This commit is contained in:
@@ -690,13 +690,6 @@ fn game_chat_art_receipt_wakes_the_same_code_prototype_run() {
|
||||
let root = temporary.path().join("project");
|
||||
let (mut main, mut child, delegation_id) =
|
||||
game_chat_main_art_child_fixture(&root, "art-asset-plan", &["core-spritesheet"]);
|
||||
main.status = "running".to_string();
|
||||
main.phase = "waiting-for-delegate-receipts".to_string();
|
||||
main.current_action = "等待临时美术 Agent 回执".to_string();
|
||||
main.waiting_on = "art-asset-plan 完成并回执".to_string();
|
||||
append_game_creator_agent_runtime_task(&root, &main).expect("persist waiting main task");
|
||||
write_game_creator_agent_runtime_state(&root, &main).expect("persist waiting main runtime");
|
||||
|
||||
child.status = "completed".to_string();
|
||||
child.phase = "completed".to_string();
|
||||
child.current_action = "已写入临时美术资产".to_string();
|
||||
@@ -763,6 +756,12 @@ fn game_chat_art_receipt_wakes_the_same_code_prototype_run() {
|
||||
assert_eq!(duplicate.status, "failed", "{duplicate:?}");
|
||||
assert!(duplicate.summary.contains("最多委派一次"));
|
||||
|
||||
main.status = "running".to_string();
|
||||
main.phase = "waiting-for-delegate-receipts".to_string();
|
||||
main.current_action = "等待临时美术 Agent 回执".to_string();
|
||||
main.waiting_on = "art-asset-plan 完成并回执".to_string();
|
||||
append_game_creator_agent_runtime_task(&root, &main).expect("persist waiting main task");
|
||||
write_game_creator_agent_runtime_state(&root, &main).expect("persist waiting main runtime");
|
||||
let waiting = read_latest_game_creator_agent_runtime_task_by_run_id(
|
||||
&root,
|
||||
"code-prototype",
|
||||
|
||||
@@ -125,7 +125,7 @@ pub(crate) fn load_local_project_text_preview(
|
||||
let normalized = normalize_relative_path(relative_path.trim())?;
|
||||
reject_sensitive_project_file_read(&normalized)?;
|
||||
let media_type = project_text_media_type(&normalized)
|
||||
.ok_or_else(|| "文档预览只支持 Markdown、文本、JSON、YAML 和 TOML".to_string())?;
|
||||
.ok_or_else(|| "文档预览只支持现役文本与代码扩展名".to_string())?;
|
||||
let bytes = read_stable_project_resource(
|
||||
root,
|
||||
&normalized,
|
||||
@@ -430,13 +430,19 @@ mod tests {
|
||||
fs::write(root.path().join("docs/design.md"), "# 设计\n\n正文").expect("markdown");
|
||||
fs::write(root.path().join("docs/legacy.txt"), [0xff, 0xfe]).expect("legacy text");
|
||||
fs::write(root.path().join("docs/page.html"), "<h1>unsafe</h1>").expect("html");
|
||||
fs::write(root.path().join("docs/archive.bin"), "not a text resource")
|
||||
.expect("unsupported extension");
|
||||
|
||||
let preview =
|
||||
load_local_project_text_preview(root.path(), "docs/design.md").expect("load markdown");
|
||||
assert_eq!(preview.media_type, "text/markdown");
|
||||
assert!(preview.content.contains("正文"));
|
||||
assert!(load_local_project_text_preview(root.path(), "docs/legacy.txt").is_err());
|
||||
assert!(load_local_project_text_preview(root.path(), "docs/page.html").is_err());
|
||||
let html_preview =
|
||||
load_local_project_text_preview(root.path(), "docs/page.html").expect("load HTML");
|
||||
assert_eq!(html_preview.media_type, "text/html");
|
||||
assert_eq!(html_preview.content, "<h1>unsafe</h1>");
|
||||
assert!(load_local_project_text_preview(root.path(), "docs/archive.bin").is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -309,9 +309,6 @@ export function registerClientHomeTests() {
|
||||
),
|
||||
).toHaveLength(2);
|
||||
});
|
||||
const manifestReadsBeforeEvent = invoke.mock.calls.filter(
|
||||
([command]) => command === 'get_local_game_manifest',
|
||||
).length;
|
||||
const inspectionsBeforeEvent = invoke.mock.calls.filter(
|
||||
([command]) => command === 'inspect_local_project_directory',
|
||||
).length;
|
||||
|
||||
@@ -114,6 +114,10 @@ describe('项目资源投影', () => {
|
||||
id: 'agent-result:design-foundation:final-run',
|
||||
category: 'document',
|
||||
},
|
||||
{
|
||||
id: 'task:audio-asset-plan:audio/unregistered-bgm.wav',
|
||||
category: 'audio',
|
||||
},
|
||||
{ id: 'version:version-1', category: 'version' },
|
||||
]),
|
||||
);
|
||||
@@ -121,7 +125,6 @@ describe('项目资源投影', () => {
|
||||
resources.some(({ id }) =>
|
||||
[
|
||||
'task:design-foundation:build/game.bundle',
|
||||
'task:audio-asset-plan:audio/unregistered-bgm.wav',
|
||||
'asset:unknown-binary',
|
||||
'attachment:imports/archive.zip',
|
||||
].includes(id),
|
||||
|
||||
Reference in New Issue
Block a user