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:
ProofOfConcept 2026-03-10 17:48:00 -04:00
parent fe7f636ad3
commit abab85d249
6 changed files with 49 additions and 82 deletions

View file

@ -35,8 +35,7 @@ pub fn consolidate_full_with_progress(
on_progress: &dyn Fn(&str),
) -> Result<(), String> {
let start = std::time::Instant::now();
let log_key = format!("_consolidate-log-{}",
store::format_datetime(store::now_epoch()).replace([':', '-', 'T'], ""));
let log_key = format!("_consolidate-log-{}", store::compact_timestamp());
let mut log_buf = String::new();
log_line(&mut log_buf, "=== CONSOLIDATE FULL ===");
@ -64,25 +63,8 @@ pub fn consolidate_full_with_progress(
let mut total_applied = 0usize;
let mut total_actions = 0usize;
// Build the list of (agent_type, batch_size) runs
let mut runs: Vec<(&str, usize)> = Vec::new();
if plan.run_health {
runs.push(("health", 0));
}
let batch_size = 5;
for (name, count) in [
("replay", plan.replay_count),
("linker", plan.linker_count),
("separator", plan.separator_count),
("transfer", plan.transfer_count),
] {
let mut remaining = count;
while remaining > 0 {
let batch = remaining.min(batch_size);
runs.push((name, batch));
remaining -= batch;
}
}
let runs = plan.to_agent_runs(batch_size);
for (agent_type, count) in &runs {
agent_num += 1;
@ -112,8 +94,7 @@ pub fn consolidate_full_with_progress(
}
};
let ts = store::format_datetime(store::now_epoch())
.replace([':', '-', 'T'], "");
let ts = store::compact_timestamp();
let mut applied = 0;
for action in &result.actions {
if knowledge::apply_action(store, action, agent_type, &ts, 0) {