delete 20 dead public functions across 12 files
Removed functions with zero callers: parse_timestamp_to_epoch, hash_key, search_weighted_debug, extract_query_terms, format_results, move_to_neighbor, adjust_edge_strength, update_graph_metrics, nearest_to_seeds, nystrom_project, chat_completion_stream, cmd_read, context_message, split_candidates, split_plan_prompt, split_extract_prompt, log_event_pub, log_verbose, rpc_record_hits, memory_definitions. -245 lines. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
b0e852a05f
commit
91eb9c95cc
12 changed files with 0 additions and 245 deletions
|
|
@ -97,16 +97,6 @@ fn log_event(job: &str, event: &str, detail: &str) {
|
|||
jobkit::daemon::event_log::log(&logs_dir(), job, event, detail);
|
||||
}
|
||||
|
||||
/// Public wrapper for logging from other agent modules.
|
||||
pub fn log_event_pub(job: &str, event: &str, detail: &str) {
|
||||
log_event(job, event, detail);
|
||||
}
|
||||
|
||||
/// Verbose log — only written if verbose logging is enabled.
|
||||
pub fn log_verbose(job: &str, event: &str, detail: &str) {
|
||||
jobkit::daemon::event_log::verbose(&crate::config::get().data_dir, job, event, detail);
|
||||
}
|
||||
|
||||
// --- Job functions (direct, no subprocess) ---
|
||||
|
||||
static DAEMON_POOL: std::sync::OnceLock<Arc<jobkit::ResourcePool>> = std::sync::OnceLock::new();
|
||||
|
|
@ -1164,16 +1154,6 @@ pub fn rpc_consolidate() -> Result<(), String> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Record search hits for the given keys (fire-and-forget from memory-search).
|
||||
pub fn rpc_record_hits(keys: &[&str]) -> Result<(), String> {
|
||||
if keys.is_empty() { return Ok(()); }
|
||||
let cmd = format!("record-hits {}", keys.join("\t"));
|
||||
match send_rpc(&cmd) {
|
||||
Some(_) => Ok(()),
|
||||
None => Err("Daemon not running.".into()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn rpc_run_agent(agent: &str, count: usize) -> Result<(), String> {
|
||||
let cmd = format!("run-agent {} {}", agent, count);
|
||||
match send_rpc(&cmd) {
|
||||
|
|
|
|||
|
|
@ -335,20 +335,6 @@ pub fn format_rename_targets(store: &Store, keys: &[String]) -> String {
|
|||
out
|
||||
}
|
||||
|
||||
/// Get split candidates sorted by size (largest first)
|
||||
pub fn split_candidates(store: &Store) -> Vec<String> {
|
||||
let mut candidates: Vec<(&str, usize)> = store.nodes.iter()
|
||||
.filter(|(key, node)| {
|
||||
!key.starts_with('_')
|
||||
&& !node.deleted
|
||||
&& matches!(node.node_type, crate::store::NodeType::Semantic)
|
||||
})
|
||||
.map(|(k, n)| (k.as_str(), n.content.len()))
|
||||
.collect();
|
||||
candidates.sort_by(|a, b| b.1.cmp(&a.1));
|
||||
candidates.into_iter().map(|(k, _)| k.to_string()).collect()
|
||||
}
|
||||
|
||||
/// Format a single node for split-plan prompt (phase 1)
|
||||
pub fn format_split_plan_node(store: &Store, graph: &Graph, key: &str) -> String {
|
||||
let communities = graph.communities();
|
||||
|
|
@ -393,32 +379,6 @@ pub fn format_split_plan_node(store: &Store, graph: &Graph, key: &str) -> String
|
|||
out
|
||||
}
|
||||
|
||||
/// Build split-plan prompt for a single node (phase 1).
|
||||
/// Uses the split.agent template with placeholders resolved for the given key.
|
||||
pub fn split_plan_prompt(store: &Store, key: &str) -> Result<String, String> {
|
||||
let def = super::defs::get_def("split")
|
||||
.ok_or_else(|| "no split.agent file".to_string())?;
|
||||
let graph = store.build_graph();
|
||||
// Override the query — we have a specific key to split
|
||||
let keys = vec![key.to_string()];
|
||||
let template = def.steps.first().map(|s| &s.prompt).ok_or_else(|| "split.agent has no steps".to_string())?;
|
||||
let (prompt, _) = super::defs::resolve_placeholders(template, store, &graph, &keys, 1);
|
||||
Ok(prompt)
|
||||
}
|
||||
|
||||
/// Build split-extract prompt for one child (phase 2)
|
||||
pub fn split_extract_prompt(store: &Store, parent_key: &str, child_key: &str, child_desc: &str, child_sections: &str) -> Result<String, String> {
|
||||
let parent_content = store.nodes.get(parent_key)
|
||||
.map(|n| n.content.as_str())
|
||||
.ok_or_else(|| format!("No node '{}'", parent_key))?;
|
||||
load_prompt("split-extract", &[
|
||||
("{{CHILD_KEY}}", child_key),
|
||||
("{{CHILD_DESC}}", child_desc),
|
||||
("{{CHILD_SECTIONS}}", child_sections),
|
||||
("{{PARENT_CONTENT}}", parent_content),
|
||||
])
|
||||
}
|
||||
|
||||
/// Show consolidation batch status or generate an agent prompt.
|
||||
pub fn consolidation_batch(store: &Store, count: usize, auto: bool) -> Result<(), String> {
|
||||
if auto {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue