feat: dailyLimit 50→5000 + VPropagator 激活 + 竞争性架构连接

- distill: dailyLimit 提升到 5000(原 50),允许大量 LLM 蒸馏
- cost_control: DefaultCostConfig.DailyLimit 同步改为 5000
- server: 添加 VPropagator 实例化,蒸馏完成时记录 V 值决策
- server: OnDistillComplete 回调中连接 Dash.RecordUseful() 仪表盘
- plugins: Hermes+OpenClaw 插件源码纳入仓库
This commit is contained in:
xiaowei
2026-05-30 04:48:51 +08:00
parent 2464689c32
commit 2731e111dd
3 changed files with 24 additions and 3 deletions
+21
View File
@@ -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")
+2 -2
View File
@@ -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,
}
}
+1 -1
View File
@@ -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},
}
}