From 18b7fd05353adb866411d932f3023974b78dd18c Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Thu, 16 Apr 2026 16:08:20 -0400 Subject: [PATCH] scoring: drop dead Elo/agent_budget block in consolidation_plan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The graph-health logic in consolidation_plan_inner computed reasonable agent counts based on graph metrics (α, Gini, hub dominance), then immediately overwrote them with an Elo-weighted flat-budget distribution, or — if no agent-elo.json existed — with a simple budget/N per type. Nothing in the codebase writes agent-elo.json; it's external state that never gets maintained. So the effective behavior was always the "No Elo ratings — equal distribution" branch, which just bucketed agent_budget evenly across active agent types and discarded everything the graph analysis had just decided. Keep the graph-health allocation (α → linker count, Gini → distill bump, organize/distill/split proportional). Drop: - The entire Elo / agent_budget block at the end of consolidation_plan_inner - Config.agent_budget field and its default (1000) - agent_budget: 40 from Kent's config.json5 - The local agent_types binding inside the function — it was only used by the now-deleted block. Config.agent_types stays; it has other consumers. Co-Authored-By: Proof of Concept --- src/config.rs | 2 -- src/hippocampus/neuro/scoring.rs | 46 -------------------------------- 2 files changed, 48 deletions(-) diff --git a/src/config.rs b/src/config.rs index 5b1726b..07c07a3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -58,7 +58,6 @@ pub struct Config { #[serde(default)] pub agent_nodes: Vec, pub llm_concurrency: usize, - pub agent_budget: usize, /// Stream chunk timeout in seconds (no data = timeout). #[serde(default = "default_stream_timeout")] pub api_stream_timeout_secs: u64, @@ -101,7 +100,6 @@ impl Default for Config { personality_nodes: vec!["identity".into(), "core-practices".into()], agent_nodes: vec!["identity".into(), "core-practices".into()], llm_concurrency: 1, - agent_budget: 1000, api_stream_timeout_secs: default_stream_timeout(), scoring_interval_secs: default_scoring_interval_secs(), scoring_response_window: default_scoring_response_window(), diff --git a/src/hippocampus/neuro/scoring.rs b/src/hippocampus/neuro/scoring.rs index 5828fd0..c9cbb40 100644 --- a/src/hippocampus/neuro/scoring.rs +++ b/src/hippocampus/neuro/scoring.rs @@ -230,10 +230,6 @@ fn consolidation_plan_inner(store: &Store, _detect_interf: bool) -> Consolidatio rationale: Vec::new(), }; - // Active agent types from config - let config = crate::config::get(); - let agent_types: Vec<&str> = config.agent_types.iter().map(|s| s.as_str()).collect(); - // Target: α ≥ 2.5 (healthy scale-free) if alpha < 2.0 { plan.add("linker", 100); @@ -274,48 +270,6 @@ fn consolidation_plan_inner(store: &Store, _detect_interf: bool) -> Consolidatio // Split: handle oversized nodes plan.set("split", 5); - // Distribute agent budget using Elo ratings - let budget = crate::config::get().agent_budget; - let elo_path = crate::config::get().data_dir.join("agent-elo.json"); - if let Ok(elo_json) = std::fs::read_to_string(&elo_path) { - if let Ok(ratings) = serde_json::from_str::>(&elo_json) { - let elos: Vec = agent_types.iter() - .map(|t| ratings.get(*t).copied().unwrap_or(1000.0)) - .collect(); - let min_elo = elos.iter().copied().fold(f64::MAX, f64::min); - - let weights: Vec = elos.iter() - .map(|e| { - let shifted = e - min_elo + 50.0; - shifted * shifted - }) - .collect(); - let total_weight: f64 = weights.iter().sum(); - - let allocate = |w: f64| -> usize { - ((w / total_weight * budget as f64).round() as usize).max(2) - }; - - for (i, agent) in agent_types.iter().enumerate() { - plan.set(agent, allocate(weights[i])); - } - - let summary: Vec = agent_types.iter() - .map(|a| format!("{}={}", a, plan.count(a))) - .collect(); - plan.rationale.push(format!( - "Elo allocation (budget={}): {}", budget, summary.join(" "))); - } - } else { - // No Elo file — use budget with equal distribution - let per_type = budget / agent_types.len(); - for agent in &agent_types { - plan.set(agent, per_type); - } - plan.rationale.push(format!( - "No Elo ratings — equal distribution ({} each, budget={})", per_type, budget)); - } - plan }