Final High-Fidelity: Eliminate all remaining mocks and hardcoded placeholders. Real Docker exit codes, dynamic resource scores, and true SQL cooperative throttling implemented.
This commit is contained in:
@@ -23,6 +23,7 @@ serde_json = "1"
|
||||
thiserror = "1"
|
||||
uuid = { version = "1", features = ["v4"] }
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
sysinfo = "0.36.1"
|
||||
|
||||
[lib]
|
||||
path = "src/lib.rs"
|
||||
|
||||
@@ -62,10 +62,15 @@ impl CHORUSAgent {
|
||||
let _ = graph.create_table("execution_results", "id VARCHAR(255) PRIMARY KEY, task_id TEXT, stdout TEXT, stderr TEXT, duration_ms INT");
|
||||
let _ = graph.create_table("api_call_log", "id VARCHAR(255) PRIMARY KEY, agent_id TEXT, called_at TEXT, status TEXT");
|
||||
|
||||
let mut sys = sysinfo::System::new_all();
|
||||
sys.refresh_cpu_all();
|
||||
let cpu_usage = sys.global_cpu_usage() as f64;
|
||||
let resource_score: f64 = (1.0 - (cpu_usage / 100.0)).max(0.0);
|
||||
|
||||
let local_peer = Peer {
|
||||
id: id.to_string(),
|
||||
role,
|
||||
resource_score: 0.9,
|
||||
resource_score,
|
||||
};
|
||||
let council = CouncilManager::new(local_peer, mailbox.clone());
|
||||
let executor = DockerExecutor::new()?;
|
||||
|
||||
Reference in New Issue
Block a user