重构: 后端编排拆解与DRY债收敛及命名纠偏

阶段1拆解: stream 系外移 stream_relay.rs,mod.rs 3048→2607,loop_body 502→83
技能收尾: regenerate/edit 回溯补技能,新增 read_skill 工具,项目级技能扫描
DRY: emit 双写 46 处收敛 event_bus 正典,KV 引号归一收口,LOCK-SLOW 33 处单行化
警示骨架 4→1 与压缩兜底 2→1,噪音目录档位收敛,truncate 同名陷阱消除
工具元数据落 ToolMeta 八维,7 张 match 表改查 registry,parity 测试锁等价
命名: is_noise_entry/teardown_round/probe_missed_terminal_event 等 6 项纠偏
This commit is contained in:
lxy
2026-10-01 19:35:19 +08:00
parent 3861e13b32
commit 75c5e23523
40 changed files with 2988 additions and 1964 deletions
+3 -5
View File
@@ -127,7 +127,7 @@ pub async fn set_plan_execution(enabled: bool) -> Result<(), String> {
/// 读取多 ReAct Plan 执行开关状态。
#[tauri::command]
pub async fn get_plan_execution() -> Result<bool, String> {
pub async fn is_plan_execution_enabled() -> Result<bool, String> {
Ok(df_ai::plan_executor::plan_execution_enabled())
}
@@ -234,7 +234,6 @@ pub async fn resolve_conflict(
resolved_by: String,
conversation_id: Option<String>,
) -> Result<(), String> {
use tauri::Emitter;
let repo = df_storage::crud::ConflictRepo::new(&state.db);
let now = df_types::now_millis().to_string();
let ok = repo.resolve(&conflict_id, &resolution, &resolved_by, &now)
@@ -249,7 +248,7 @@ pub async fn resolve_conflict(
resolved_by = %resolved_by,
"[CONFLICT] 冲突已解决"
);
// emit AiConflictResolved 事件
// emit AiConflictResolved 事件(双写收敛经 emit_ai_chat_event)
let ev = crate::commands::ai::AiChatEvent::AiConflictResolved {
conflict_id,
plan_id,
@@ -257,7 +256,6 @@ pub async fn resolve_conflict(
resolved_by,
conversation_id,
};
let _ = app_handle.emit("ai-chat-event", ev.clone());
let _ = state.ai_event_bus.publish_event(ev);
crate::commands::ai::event_bus::emit_ai_chat_event(&app_handle, ev);
Ok(())
}