agents: extract run_and_apply, eliminate dead split-plan.md

- Add run_and_apply() — combines run_one_agent + action application
  into one call. Used by daemon job_consolidation_agent and
  consolidate_full, which had identical run+apply loops.

- Port split_plan_prompt() to use split.agent via defs::resolve_placeholders
  instead of loading the separate split-plan.md template. Make
  resolve_placeholders public for this.

- Delete prompts/split-plan.md — superseded by agents/split.agent
  which was already the canonical definition.
This commit is contained in:
ProofOfConcept 2026-03-10 17:51:32 -04:00
parent abab85d249
commit 945865f594
6 changed files with 35 additions and 127 deletions

View file

@ -332,6 +332,26 @@ pub struct AgentResult {
pub node_keys: Vec<String>,
}
/// Run a single agent and apply its actions (no depth tracking).
///
/// Returns (total_actions, applied_count) or an error.
pub fn run_and_apply(
store: &mut Store,
agent_name: &str,
batch_size: usize,
llm_tag: &str,
) -> Result<(usize, usize), String> {
let result = run_one_agent(store, agent_name, batch_size, llm_tag)?;
let ts = store::compact_timestamp();
let mut applied = 0;
for action in &result.actions {
if apply_action(store, action, agent_name, &ts, 0) {
applied += 1;
}
}
Ok((result.actions.len(), applied))
}
/// Run a single agent: build prompt → call LLM → store output → parse actions → record visits.
///
/// This is the common pipeline shared by the knowledge loop, consolidation pipeline,