策划工作区改名为design_artifacts
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 3m20s
Project CI / Native shell tests (pull_request) Successful in 17m35s

更新策划文件工具和阶段产物检查路径

同步测试夹具与生产迁移方案文档
This commit is contained in:
2026-09-11 10:16:15 +00:00
parent d6a72c895c
commit 712f28e207
4 changed files with 28 additions and 21 deletions
@@ -938,9 +938,13 @@ mod tests {
}
fn concept_artifacts(root: &Path) {
fs::create_dir_all(root.join(".workspace/project/00_concept")).expect("mkdir");
fs::write(root.join(".workspace/project/00_concept/design.md"), "概念").expect("write");
fs::write(root.join(".workspace/project/速览卡.md"), "速览").expect("write");
fs::create_dir_all(root.join("design_artifacts/project/00_concept")).expect("mkdir");
fs::write(
root.join("design_artifacts/project/00_concept/design.md"),
"概念",
)
.expect("write");
fs::write(root.join("design_artifacts/project/速览卡.md"), "速览").expect("write");
}
#[test]
@@ -1285,7 +1289,7 @@ mod tests {
.iter()
.any(|message| message.text.contains("失败") && message.text.contains("路径")));
assert!(root
.join(".workspace/project/00_concept/design.md")
.join("design_artifacts/project/00_concept/design.md")
.is_file());
assert!(!root.join("secret.md").exists());
@@ -7,7 +7,7 @@ use std::fs;
use std::path::{Path, PathBuf};
use tauri::Manager;
const DESIGN_WORKSPACE_ROOT: &str = ".workspace";
const DESIGN_WORKSPACE_ROOT: &str = "design_artifacts";
const SEARCH_HIT_LIMIT: usize = 200;
#[derive(Clone, Debug, Serialize)]
@@ -621,7 +621,7 @@ mod tests {
)
.expect("write");
assert_eq!(
fs::read_to_string(root.join(".workspace/notes/design.md")).expect("read disk"),
fs::read_to_string(root.join("design_artifacts/notes/design.md")).expect("read disk"),
"游戏设计"
);
let listing = execute_design_file_tool(root, "list_dir", &json!({"path":"."}))
@@ -647,7 +647,7 @@ mod tests {
assert!(patched.as_str().unwrap().contains("已局部修改"));
execute_design_file_tool(root, "delete_path", &json!({"path":"notes"}))
.expect("delete dir");
assert!(!root.join(".workspace/notes").exists());
assert!(!root.join("design_artifacts/notes").exists());
}
#[test]
@@ -247,7 +247,7 @@ pub(crate) fn check_design_phase_artifacts(
.into_iter()
.flatten()
{
let path = resolve_local_project_path(root, &format!(".workspace/{relative}"))?;
let path = resolve_local_project_path(root, &format!("design_artifacts/{relative}"))?;
if !path.is_file() {
missing.push(relative.clone());
}
@@ -329,17 +329,19 @@ mod tests {
fn phase_artifact_check_includes_previous_phases() {
let root = tempfile::tempdir().expect("tempdir");
let mut session = new_design_session("project", "quality");
fs::create_dir_all(root.path().join(".workspace/project/00_concept")).expect("mkdir");
fs::create_dir_all(root.path().join("design_artifacts/project/00_concept")).expect("mkdir");
fs::write(
root.path().join(".workspace/project/00_concept/design.md"),
root.path()
.join("design_artifacts/project/00_concept/design.md"),
"x",
)
.expect("write");
fs::write(root.path().join(".workspace/project/速览卡.md"), "x").expect("write");
fs::create_dir_all(root.path().join(".workspace/project/01_top_design")).expect("mkdir");
fs::write(root.path().join("design_artifacts/project/速览卡.md"), "x").expect("write");
fs::create_dir_all(root.path().join("design_artifacts/project/01_top_design"))
.expect("mkdir");
fs::write(
root.path()
.join(".workspace/project/01_top_design/design.md"),
.join("design_artifacts/project/01_top_design/design.md"),
"x",
)
.expect("write");
@@ -355,13 +357,14 @@ mod tests {
fn rejecting_approval_keeps_phase_and_clears_request() {
let root = tempfile::tempdir().expect("tempdir");
let mut session = new_design_session("project", "quality");
fs::create_dir_all(root.path().join(".workspace/project/00_concept")).expect("mkdir");
fs::create_dir_all(root.path().join("design_artifacts/project/00_concept")).expect("mkdir");
fs::write(
root.path().join(".workspace/project/00_concept/design.md"),
root.path()
.join("design_artifacts/project/00_concept/design.md"),
"x",
)
.expect("write");
fs::write(root.path().join(".workspace/project/速览卡.md"), "x").expect("write");
fs::write(root.path().join("design_artifacts/project/速览卡.md"), "x").expect("write");
let request = submit_design_phase_for_approval(root.path(), &mut session).expect("submit");
reject_design_phase(&mut session, &request.request_id).expect("reject");
assert_eq!(session.current_phase, "concept");