fix(growth): Evolution Engine 穷尽审计 3CRITICAL + 3HIGH 全部修复
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
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
C-01: ExperienceExtractor 接入 ExperienceStore - GrowthIntegration.new() 创建 ExperienceExtractor 时注入 ExperienceStore - 经验持久化路径打通:extract_combined → persist_experiences → ExperienceStore C-02+C-03: 进化触发链路全链路接通 - create_middleware_chain() 注册 EvolutionMiddleware (priority 78) - MemoryMiddleware 持有 Arc<EvolutionMiddleware> 共享引用 - after_completion 中调用 check_evolution() → 推送 PendingEvolution - EvolutionMiddleware 在下次对话前注入进化建议到 system prompt H-01: FeedbackCollector loaded 标志修复 - load() 失败时保留 loaded=false,下次 save 重试 - 日志级别 debug → warn H-03: FeedbackCollector 内部可变性 - EvolutionEngine.feedback 改为 Arc<Mutex<FeedbackCollector>> - submit_feedback() 从 &mut self → &self,支持中间件 &self 调用路径 - GrowthIntegration.initialize() 从 &mut self → &self H-05: 删除空测试 test_parse_empty_response (无 assert) H-06: infer_experiences_from_memories() fallback - Outcome::Success → Outcome::Partial (反映推断不确定性)
This commit is contained in:
@@ -137,13 +137,18 @@ impl FeedbackCollector {
|
||||
pub async fn save(&mut self) -> Result<usize, String> {
|
||||
// 首次保存前自动加载已有记录,防止丢失历史数据
|
||||
if !self.loaded {
|
||||
if let Err(e) = self.load().await {
|
||||
tracing::debug!(
|
||||
"[FeedbackCollector] Auto-load before save failed (non-fatal): {}",
|
||||
e
|
||||
);
|
||||
match self.load().await {
|
||||
Ok(_) => {
|
||||
self.loaded = true;
|
||||
}
|
||||
Err(e) => {
|
||||
// 加载失败时保留 loaded=false,下次 save 会重试
|
||||
tracing::warn!(
|
||||
"[FeedbackCollector] Auto-load before save failed, will retry next save: {}",
|
||||
e
|
||||
);
|
||||
}
|
||||
}
|
||||
self.loaded = true;
|
||||
}
|
||||
|
||||
let viking = match &self.viking {
|
||||
|
||||
Reference in New Issue
Block a user