fix(audit): P0 反思引擎 LLM 接入 + P1 hand run_id/skill triggers/pipeline v2
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

审计修复 Batch 1 (M4-02/M3-01/M5-01/M6-02):

P0 M4-02: reflection_reflect 从 KernelState 获取 LLM driver
  - 新增 kernel_state 参数,从 kernel.driver() 获取驱动
  - 自动路径(post_conversation_hook)已正常,手动 Tauri 命令路径已修复

P1 M3-01: hand_execute 返回 run_id 给前端
  - HandResult 新增 run_id 字段
  - execute_hand 结果包含 run_id.to_string()

P1 M5-01: skill-discovery 使用后端 triggers 字段
  - BackendSkillInfo 新增 triggers 字段
  - convertFromBackend 优先使用 triggers,fallback tags

P1 M6-02: pipeline_list 支持 v2 YAML 格式
  - scan_pipelines_with_paths 增加 v2 fallback 解析
  - 新增 pipeline_v2_to_info 转换函数
  - discovery.rs 导入 parse_pipeline_v2_yaml

注: M4-01 双数据库问题已在之前批次修复
     M6-01 route_intent 已确认注册,审计结论过时
This commit is contained in:
iven
2026-04-04 18:11:21 +08:00
parent 442ec0eeef
commit 05762261be
5 changed files with 85 additions and 8 deletions

View File

@@ -93,6 +93,7 @@ pub struct HandResult {
pub output: serde_json::Value,
pub error: Option<String>,
pub duration_ms: Option<u64>,
pub run_id: Option<String>,
}
impl From<zclaw_hands::HandResult> for HandResult {
@@ -102,6 +103,7 @@ impl From<zclaw_hands::HandResult> for HandResult {
output: result.output,
error: result.error,
duration_ms: result.duration_ms,
run_id: None,
}
}
}
@@ -155,6 +157,7 @@ pub async fn hand_execute(
}),
error: None,
duration_ms: None,
run_id: None,
});
}
@@ -175,16 +178,19 @@ pub async fn hand_execute(
}),
error: None,
duration_ms: None,
run_id: None,
});
}
}
}
// Execute hand directly (returns result + run_id for tracking)
let (result, _run_id) = kernel.execute_hand(&id, input).await
let (result, run_id) = kernel.execute_hand(&id, input).await
.map_err(|e| format!("Failed to execute hand: {}", e))?;
Ok(HandResult::from(result))
let mut hand_result = HandResult::from(result);
hand_result.run_id = Some(run_id.to_string());
Ok(hand_result)
}
/// Approve a hand execution