diff --git a/go/internal/api/routes/core.go b/go/internal/api/routes/core.go index 334069e..5f70258 100644 --- a/go/internal/api/routes/core.go +++ b/go/internal/api/routes/core.go @@ -165,10 +165,16 @@ func (a *API) Commit(w http.ResponseWriter, r *http.Request) { } if len(conflicts) > 0 { respData["conflicts"] = conflicts + // 冲突保护(2026-09-03 记忆治理):检出矛盾的内容不进自动蒸馏, + // 避免污染 distilled/memories。episodes 已保留(原始日志可追溯)。 + // 处理路径:①写错→Hermes feedback not_useful;②旧记忆错→feedback 降权; + // ③确认为修正/新事实→客户端显式 resolve_conflict=true 重 commit。 + respData["distill_skipped"] = "conflict" + respData["distill_note"] = "conflict detected; auto-distill skipped to prevent memory pollution. Resolve via feedback, or re-commit with resolve_conflict=true if this is a verified correction" + } else { + go AutoDistillTrigger(epID, req.Content, req.Category, req.Namespace, req.AgentID) } respond(w, 201, respData) - - go AutoDistillTrigger(epID, req.Content, req.Category, req.Namespace, req.AgentID) } // mergeMemory 合并重复记忆:升版本、提重要性、更新时间戳