策划工作区改名为design_artifacts
更新策划文件工具和阶段产物检查路径 同步测试夹具与生产迁移方案文档
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -90,13 +90,13 @@
|
||||
│ ├─ session.json
|
||||
│ ├─ conversation.jsonl
|
||||
│ └─ 待交互请求与恢复记录
|
||||
├─ .workspace/
|
||||
├─ design_artifacts/
|
||||
│ └─ Agent 和用户共同查看的策划工作区
|
||||
└─ .debug/
|
||||
└─ 只写诊断资料
|
||||
```
|
||||
|
||||
以上为职责布局;恢复记录和审计沿用生产已有存储载体,不因目录示意另建平行账本。原型代码和固定资源包放在应用安装资源中,不放入 `.workspace`,也不为每个项目或回合复制一份。
|
||||
以上为职责布局;恢复记录和审计沿用生产已有存储载体,不因目录示意另建平行账本。原型代码和固定资源包放在应用安装资源中,不放入 `design_artifacts`,也不为每个项目或回合复制一份。
|
||||
|
||||
设计会话至少保存:
|
||||
|
||||
@@ -239,7 +239,7 @@ UI 使用“批准”和“继续修改”两个文字按钮,分别配 Lucide
|
||||
|
||||
## 8. 用户工作区浏览
|
||||
|
||||
`.workspace` 同时是 Agent 工作区和用户查看策划资料的文件区。用户不需要通过聊天请求 Agent 才能看到文件。
|
||||
`design_artifacts` 同时是 Agent 工作区和用户查看策划资料的文件区。用户不需要通过聊天请求 Agent 才能看到文件。
|
||||
|
||||
第一版提供只读浏览:
|
||||
|
||||
@@ -295,10 +295,10 @@ UI 使用“批准”和“继续修改”两个文字按钮,分别配 Lucide
|
||||
1. 核对原型行为基线,选择生产 Provider、恢复、审计、文件和事件通信的可复用函数;仅拆分实际阻碍复用的局部业务耦合。
|
||||
2. 新增独立的设计会话状态结构和持久化路径。
|
||||
3. 新增自由策划 Agent Provider 回合循环。
|
||||
4. 将文件工具绑定到 `.workspace`,移除旧 Planning V2 的业务产物门禁。
|
||||
4. 将文件工具绑定到 `design_artifacts`,移除旧 Planning V2 的业务产物门禁。
|
||||
5. 接入阶段提示、必读资源注入和 `get_workflow_status`。
|
||||
6. 接入 `submit_phase_for_approval` 和 ✅/❌ 审批事件。
|
||||
7. 复用 Game Agent 文件浏览实现,让用户查看 `.workspace` 文件。
|
||||
7. 复用 Game Agent 文件浏览实现,让用户查看 `design_artifacts` 文件。
|
||||
8. 用假 Provider 验证五阶段、恢复、审批拒绝、资源读取失败和工具失败。已由 `design_runtime` 脚本化假 Provider 定向测试覆盖。
|
||||
9. 在生产入口切换到新设计 Agent。
|
||||
10. 确认没有现役调用方后,再清理旧 Planning V2 入口和专用展示逻辑。
|
||||
|
||||
Reference in New Issue
Block a user