Remove dead action pipeline: parsing, depth tracking, knowledge loop, fact miner
Agents now apply changes via tool calls (poc-memory write/link-add/etc) during the LLM call. The old pipeline — where agents output WRITE_NODE/ LINK/REFINE text, which was parsed and applied separately — is dead code. Removed: - Action/ActionKind/Confidence types and all parse_* functions - DepthDb, depth tracking, confidence gating - apply_action, stamp_content, has_edge - NamingResolution, resolve_naming and related naming agent code - KnowledgeLoopConfig, CycleResult, GraphMetrics, convergence checking - run_knowledge_loop, run_cycle, check_convergence - apply_consolidation (old report re-processing) - fact_mine.rs (folded into observation agent) - resolve_action_names Simplified: - AgentResult no longer carries actions/no_ops - run_and_apply_with_log just runs the agent - consolidate_full simplified action tracking -1364 lines.
This commit is contained in:
parent
b709d58a4f
commit
6932e05b38
7 changed files with 43 additions and 1364 deletions
|
|
@ -97,73 +97,20 @@ pub fn cmd_journal_enrich(jsonl_path: &str, entry_text: &str, grep_line: usize)
|
|||
crate::enrich::journal_enrich(&mut store, jsonl_path, entry_text, grep_line)
|
||||
}
|
||||
|
||||
pub fn cmd_apply_consolidation(do_apply: bool, report_file: Option<&str>) -> Result<(), String> {
|
||||
let mut store = store::Store::load()?;
|
||||
crate::consolidate::apply_consolidation(&mut store, do_apply, report_file)
|
||||
pub fn cmd_apply_consolidation(_do_apply: bool, _report_file: Option<&str>) -> Result<(), String> {
|
||||
Err("apply-consolidation has been removed — agents now apply changes via tool calls directly.".into())
|
||||
}
|
||||
|
||||
pub fn cmd_knowledge_loop(max_cycles: usize, batch_size: usize, window: usize, max_depth: i32) -> Result<(), String> {
|
||||
let config = crate::knowledge::KnowledgeLoopConfig {
|
||||
max_cycles,
|
||||
batch_size,
|
||||
window,
|
||||
max_depth,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let results = crate::knowledge::run_knowledge_loop(&config)?;
|
||||
eprintln!("\nCompleted {} cycles, {} total actions applied",
|
||||
results.len(),
|
||||
results.iter().map(|r| r.total_applied).sum::<usize>());
|
||||
Ok(())
|
||||
pub fn cmd_knowledge_loop(_max_cycles: usize, _batch_size: usize, _window: usize, _max_depth: i32) -> Result<(), String> {
|
||||
Err("knowledge-loop has been removed — agents now use tool calls directly. Use `poc-memory agent run` instead.".into())
|
||||
}
|
||||
|
||||
pub fn cmd_fact_mine(path: &str, batch: bool, dry_run: bool, output_file: Option<&str>, min_messages: usize) -> Result<(), String> {
|
||||
let p = std::path::Path::new(path);
|
||||
|
||||
let paths: Vec<std::path::PathBuf> = if batch {
|
||||
if !p.is_dir() {
|
||||
return Err(format!("Not a directory: {}", path));
|
||||
}
|
||||
let mut files: Vec<_> = std::fs::read_dir(p)
|
||||
.map_err(|e| format!("read dir: {}", e))?
|
||||
.filter_map(|e| e.ok())
|
||||
.map(|e| e.path())
|
||||
.filter(|p| p.extension().map(|x| x == "jsonl").unwrap_or(false))
|
||||
.collect();
|
||||
files.sort();
|
||||
eprintln!("Found {} transcripts", files.len());
|
||||
files
|
||||
} else {
|
||||
vec![p.to_path_buf()]
|
||||
};
|
||||
|
||||
let path_refs: Vec<&std::path::Path> = paths.iter().map(|p| p.as_path()).collect();
|
||||
let facts = crate::fact_mine::mine_batch(&path_refs, min_messages, dry_run)?;
|
||||
|
||||
if !dry_run {
|
||||
let json = serde_json::to_string_pretty(&facts)
|
||||
.map_err(|e| format!("serialize: {}", e))?;
|
||||
if let Some(out) = output_file {
|
||||
std::fs::write(out, &json).map_err(|e| format!("write: {}", e))?;
|
||||
eprintln!("\nWrote {} facts to {}", facts.len(), out);
|
||||
} else {
|
||||
println!("{}", json);
|
||||
}
|
||||
}
|
||||
|
||||
eprintln!("\nTotal: {} facts from {} transcripts", facts.len(), paths.len());
|
||||
Ok(())
|
||||
pub fn cmd_fact_mine(_path: &str, _batch: bool, _dry_run: bool, _output_file: Option<&str>, _min_messages: usize) -> Result<(), String> {
|
||||
Err("fact-mine has been removed — use the observation agent instead.".into())
|
||||
}
|
||||
|
||||
pub fn cmd_fact_mine_store(path: &str) -> Result<(), String> {
|
||||
let path = std::path::Path::new(path);
|
||||
if !path.exists() {
|
||||
return Err(format!("File not found: {}", path.display()));
|
||||
}
|
||||
let count = crate::fact_mine::mine_and_store(path, None)?;
|
||||
eprintln!("Stored {} facts", count);
|
||||
Ok(())
|
||||
pub fn cmd_fact_mine_store(_path: &str) -> Result<(), String> {
|
||||
Err("fact-mine-store has been removed — use the observation agent instead.".into())
|
||||
}
|
||||
|
||||
/// Sample recent actions from each agent type, sort by quality using
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue