agents: deduplicate timestamps, plan expansion, rename agent
- Add compact_timestamp() to store — replaces 5 copies of format_datetime(now_epoch()).replace([':', '-', 'T'], "") Also fixes missing seconds (format_datetime only had HH:MM). - Add ConsolidationPlan::to_agent_runs() — replaces identical plan-to-runs-list expansion in consolidate.rs and daemon.rs. - Port job_rename_agent to use run_one_agent — eliminates manual prompt building, LLM call, report storage, and visit recording that duplicated the shared pipeline. - Rename Confidence::weight()/value() to delta_weight()/gate_value() to clarify the distinction (delta metrics vs depth gating).
This commit is contained in:
parent
fe7f636ad3
commit
abab85d249
6 changed files with 49 additions and 82 deletions
|
|
@ -174,6 +174,30 @@ pub struct ConsolidationPlan {
|
|||
pub rationale: Vec<String>,
|
||||
}
|
||||
|
||||
impl ConsolidationPlan {
|
||||
/// Expand the plan into a flat list of (agent_name, batch_size) runs.
|
||||
pub fn to_agent_runs(&self, batch_size: usize) -> Vec<(&'static str, usize)> {
|
||||
let mut runs = Vec::new();
|
||||
if self.run_health {
|
||||
runs.push(("health", 0));
|
||||
}
|
||||
for (name, count) in [
|
||||
("replay", self.replay_count),
|
||||
("linker", self.linker_count),
|
||||
("separator", self.separator_count),
|
||||
("transfer", self.transfer_count),
|
||||
] {
|
||||
let mut remaining = count;
|
||||
while remaining > 0 {
|
||||
let batch = remaining.min(batch_size);
|
||||
runs.push((name, batch));
|
||||
remaining -= batch;
|
||||
}
|
||||
}
|
||||
runs
|
||||
}
|
||||
}
|
||||
|
||||
/// Analyze metrics and decide how much each agent needs to run.
|
||||
///
|
||||
/// This is the control loop: metrics → error signal → agent allocation.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue