scoring: drop dead Elo/agent_budget block in consolidation_plan
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 <poc@bcachefs.org>
This commit is contained in:
parent
60de579305
commit
18b7fd0535
2 changed files with 0 additions and 48 deletions
|
|
@ -58,7 +58,6 @@ pub struct Config {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub agent_nodes: Vec<String>,
|
pub agent_nodes: Vec<String>,
|
||||||
pub llm_concurrency: usize,
|
pub llm_concurrency: usize,
|
||||||
pub agent_budget: usize,
|
|
||||||
/// Stream chunk timeout in seconds (no data = timeout).
|
/// Stream chunk timeout in seconds (no data = timeout).
|
||||||
#[serde(default = "default_stream_timeout")]
|
#[serde(default = "default_stream_timeout")]
|
||||||
pub api_stream_timeout_secs: u64,
|
pub api_stream_timeout_secs: u64,
|
||||||
|
|
@ -101,7 +100,6 @@ impl Default for Config {
|
||||||
personality_nodes: vec!["identity".into(), "core-practices".into()],
|
personality_nodes: vec!["identity".into(), "core-practices".into()],
|
||||||
agent_nodes: vec!["identity".into(), "core-practices".into()],
|
agent_nodes: vec!["identity".into(), "core-practices".into()],
|
||||||
llm_concurrency: 1,
|
llm_concurrency: 1,
|
||||||
agent_budget: 1000,
|
|
||||||
api_stream_timeout_secs: default_stream_timeout(),
|
api_stream_timeout_secs: default_stream_timeout(),
|
||||||
scoring_interval_secs: default_scoring_interval_secs(),
|
scoring_interval_secs: default_scoring_interval_secs(),
|
||||||
scoring_response_window: default_scoring_response_window(),
|
scoring_response_window: default_scoring_response_window(),
|
||||||
|
|
|
||||||
|
|
@ -230,10 +230,6 @@ fn consolidation_plan_inner(store: &Store, _detect_interf: bool) -> Consolidatio
|
||||||
rationale: Vec::new(),
|
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)
|
// Target: α ≥ 2.5 (healthy scale-free)
|
||||||
if alpha < 2.0 {
|
if alpha < 2.0 {
|
||||||
plan.add("linker", 100);
|
plan.add("linker", 100);
|
||||||
|
|
@ -274,48 +270,6 @@ fn consolidation_plan_inner(store: &Store, _detect_interf: bool) -> Consolidatio
|
||||||
// Split: handle oversized nodes
|
// Split: handle oversized nodes
|
||||||
plan.set("split", 5);
|
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::<std::collections::HashMap<String, f64>>(&elo_json) {
|
|
||||||
let elos: Vec<f64> = 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<f64> = 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<String> = 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
|
plan
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue