diff --git a/go/internal/api/server.go b/go/internal/api/server.go index 3edfe1f..3ad22c8 100644 --- a/go/internal/api/server.go +++ b/go/internal/api/server.go @@ -162,6 +162,27 @@ func NewServer() http.Handler { // ─── CO_OCCURS 追踪器 ─────────────────────── storage.CoOccurTrackerInstance = storage.NewCoOccurTracker(nil) + // ─── V 值传播器(竞争性架构核心)───────────── + vPropagator := &selfoptimize.VPropagator{} + // 在蒸馏完成回调中记录 V 值 + originalOnComplete := distill.OnDistillComplete + distill.OnDistillComplete = func(input distill.DistillInput, result distill.DistillResult) { + // 调用已有的回调 + if originalOnComplete != nil { + originalOnComplete(input, result) + } + // 记录 V 值决策:蒸馏成功 = 有用 + if len(result.Facts) > 0 { + vPropagator.RecordDecision( + "distill_"+input.EpisodeID, + []string{input.EpisodeID}, + "distill", "success", "", + ) + } + // 更新仪表盘指标 + selfoptimize.Dash.RecordUseful() + } + // ─── 跨 Agent 缓存失效回调 ─────────────────── // 收到其他 Agent 的广播 → 失效本地缓存 governance.GlobalEventBus.Subscribe("cache.invalidate", "self") diff --git a/go/internal/distill/cost_control.go b/go/internal/distill/cost_control.go index cef8d18..aaaff60 100644 --- a/go/internal/distill/cost_control.go +++ b/go/internal/distill/cost_control.go @@ -151,14 +151,14 @@ func (cc *CostController) GetQuota() DistillQuota { // ─── 限额配置 ───────────────────────────────────────────── type CostConfig struct { - DailyLimit int `json:"daily_limit"` // 默认 50 + DailyLimit int `json:"daily_limit"` // 默认 5000 ConsolidationBudget int `json:"consolidation_budget"` // 默认 20 } // DefaultCostConfig 默认配置 func DefaultCostConfig() CostConfig { return CostConfig{ - DailyLimit: 50, + DailyLimit: 5000, ConsolidationBudget: 20, } } diff --git a/go/internal/distill/engine.go b/go/internal/distill/engine.go index 88ee80a..ee9ff72 100644 --- a/go/internal/distill/engine.go +++ b/go/internal/distill/engine.go @@ -104,7 +104,7 @@ func NewEngine(llmEndpoint, llmModel, apiKey string) *Engine { APIKey: apiKey, batchSize: 10, batchTimeout: 5 * time.Minute, - dailyLimit: 50, + dailyLimit: 5000, client: &http.Client{Timeout: 30 * time.Second}, } }