修复: BUG-260620-05 工程内路径弹窗 + G1 多目标累积 + 测试编译债

- BUG-260620-05: reload_allowed_dirs 无条件插入 workspace_root,工程内路径免授权
- G1: pinned_goal → pinned_goals Vec<String>,多目标追加去重 + MAX_GOALS=5
- tool_registry.rs 测试 4 处补 data_dir 形参
- 更新 todo.md / docs/todo.md 状态
This commit is contained in:
2026-06-27 22:02:19 +08:00
parent 9c3f27f4ca
commit 6e1485e4f9
8 changed files with 120 additions and 105 deletions

View File

@@ -2963,7 +2963,7 @@ mod tests {
// F-260619-03 Phase A: build_ai_tool_registry 新增 allowed_dirs 形参,
// 测试用 default_with_root(仅 workspace_root),零回归(白名单含 workspace_root)。
let allowed_dirs = Arc::new(RwLock::new(AllowedDirs::default_with_root()));
let registry = build_ai_tool_registry(&db, &allowed_dirs);
let registry = build_ai_tool_registry(&db, &allowed_dirs, PathBuf::from(""));
// 总量基线:41(27 data + 13 file + 1 http)。拆分前后必须一致。
// F-260621: file 层 10→11(新增 grep 跨文件内容搜索工具)。
@@ -3210,7 +3210,7 @@ mod tests {
let db = Database::open_in_memory().await.expect("in-memory db 初始化失败");
let db = Arc::new(db);
let registry = build_ai_tool_registry(&db, &allowed_dirs);
let registry = build_ai_tool_registry(&db, &allowed_dirs, PathBuf::from(""));
let canon_file = file.canonicalize().unwrap().to_string_lossy().to_string();
let args = serde_json::json!({ "path": canon_file, "limit": 15 });
let res = registry.execute("read_file", args).await.expect("read_file 执行失败");
@@ -3237,7 +3237,7 @@ mod tests {
let db = Database::open_in_memory().await.expect("in-memory db 初始化失败");
let db = Arc::new(db);
let registry = build_ai_tool_registry(&db, &allowed_dirs);
let registry = build_ai_tool_registry(&db, &allowed_dirs, PathBuf::from(""));
let canon_file = file.canonicalize().unwrap().to_string_lossy().to_string();
let args = serde_json::json!({ "path": canon_file });
let res = registry.execute("read_file", args).await.expect("read_file 执行失败");
@@ -3719,7 +3719,7 @@ mod tests {
.await
.unwrap();
let allowed_dirs = Arc::new(RwLock::new(AllowedDirs::default_with_root()));
let registry = build_ai_tool_registry(&db, &allowed_dirs);
let registry = build_ai_tool_registry(&db, &allowed_dirs, PathBuf::from(""));
(db, registry)
}