fix: consolidate trigger uses full mode instead of cluster_only

Problem: server.go 30s ticker loop called consolPipe.Run() which
defaults to cluster_only mode. The 'consolidation' and 'backtrack'
actions never executed prune/decay/quality steps.

Fix:
- Separate 'distill' action (keeps cluster_only for fast frequent runs)
- 'consolidation' and 'backtrack' now call RunWithMode(full)
- selfoptimize.Flow.Register('consolidate') also uses RunWithMode('full')
- Proper case indentation (4 tabs for labels, 5 for bodies)

Result: prune + decay + quality steps now run when t_consolidation
or t_backtrack fires (48h cooldown protects against over-firing)
This commit is contained in:
xiaowei 2026-06-09 12:45:33 +08:00
parent ffee97032e
commit 2c96f805f4
1 changed files with 11 additions and 7 deletions

View File

@ -797,7 +797,7 @@ func NewServer() http.Handler {
selfoptimize.RegisterConsolidateFlow(selfoptimize.Flow)
// 注册真正的 consolidate 处理器:调用 ConsolidationPipeline
selfoptimize.Flow.Register("consolidate", func(task *selfoptimize.PipelineTask) error {
report, err := consolPipe.Run()
report, err := consolPipe.RunWithMode("full")
if err == nil && report != nil {
// 注入 consolidate 报告 → Dashboard
if report.Merged > 0 {
@ -920,12 +920,16 @@ func NewServer() http.Handler {
go func(triggerID, action string) {
var err error
switch action {
case "distill", "consolidation", "backtrack":
// 深度整合含蒸馏质量回溯Step 4
_, err = consolPipe.Run()
case "merge":
_, err = consolPipe.RunMerge()
case "prune":
case "distill":
// distill 保持 cluster_only高频触发只做快速聚类
_, err = consolPipe.Run()
case "consolidation", "backtrack":
// full 模式:含 prune + decay + 质量回溯Step 4
// 48h cooldown 保护,不会真正每分钟跑 fullcooldown 内 CanFire 仍返回 false
_, err = consolPipe.RunWithMode("full")
case "merge":
_, err = consolPipe.RunMerge()
case "prune":
graphStore.Prune(0.15)
case "decay":
// 扫描所有记忆,按衰减率计算 freshness