Clean up unused imports, dead code, and compiler warnings
Remove unused StoreView imports, unused store imports, dead install_default_file, dead make_report_slug, dead fact-mine/ experience-mine spawning loops in daemon. Fix mut warnings. Zero compiler warnings now.
This commit is contained in:
parent
6932e05b38
commit
7a24d84ce3
11 changed files with 11 additions and 82 deletions
|
|
@ -626,7 +626,7 @@ pub fn run_daemon() -> Result<(), String> {
|
|||
// already mined, check task registry for what's in-flight, spawn the diff.
|
||||
// No persistent tracking state — the store is the source of truth.
|
||||
let choir_sw = Arc::clone(&choir);
|
||||
let llm_sw = Arc::clone(&llm);
|
||||
let _llm_sw = Arc::clone(&llm); // kept for future use
|
||||
let last_daily_sw = Arc::clone(&last_daily);
|
||||
let graph_health_sw = Arc::clone(&graph_health);
|
||||
choir.spawn("session-watcher").init(move |ctx| {
|
||||
|
|
@ -703,9 +703,9 @@ pub fn run_daemon() -> Result<(), String> {
|
|||
}).unwrap_or_default()
|
||||
};
|
||||
|
||||
let mut extract_queued = 0;
|
||||
let mut extract_remaining = 0;
|
||||
let mut fact_remaining = 0;
|
||||
let _extract_queued = 0usize;
|
||||
let mut _extract_remaining = 0usize;
|
||||
let mut _fact_remaining = 0usize;
|
||||
let mut already_mined = 0;
|
||||
let mut still_open = 0;
|
||||
let mut backed_off = 0;
|
||||
|
|
@ -856,44 +856,12 @@ pub fn run_daemon() -> Result<(), String> {
|
|||
}
|
||||
}
|
||||
|
||||
// Spawn experience-mine jobs (priority)
|
||||
for (task_label, path_str, segment) in &needs_extract {
|
||||
if extract_queued >= MAX_NEW_PER_TICK {
|
||||
extract_remaining += 1;
|
||||
continue;
|
||||
}
|
||||
let task_name = format!("extract:{}", task_label);
|
||||
log_event("extract", "queued", &task_name);
|
||||
let path = path_str.clone();
|
||||
let seg = *segment;
|
||||
// experience_mine killed — observation.agent handles transcript mining
|
||||
extract_queued += 1;
|
||||
}
|
||||
// experience_mine and fact_mine killed — observation.agent handles transcript mining
|
||||
_extract_remaining = needs_extract.len();
|
||||
_fact_remaining = needs_fact.len();
|
||||
|
||||
// Only queue fact-mine when experience backlog is clear
|
||||
needs_fact.sort_by_key(|(_, path_str)| {
|
||||
fs::metadata(path_str).map(|m| m.len()).unwrap_or(u64::MAX)
|
||||
});
|
||||
let mut fact_queued = 0;
|
||||
if needs_extract.len() == extract_queued {
|
||||
let fact_budget = MAX_NEW_PER_TICK.saturating_sub(extract_queued);
|
||||
for (filename, path_str) in &needs_fact {
|
||||
if fact_queued >= fact_budget {
|
||||
fact_remaining += 1;
|
||||
continue;
|
||||
}
|
||||
let task_name = format!("fact-mine:{}", filename);
|
||||
log_event("fact-mine", "queued", path_str);
|
||||
let path = path_str.clone();
|
||||
// fact_mine killed — observation.agent handles transcript mining
|
||||
fact_queued += 1;
|
||||
}
|
||||
} else {
|
||||
fact_remaining = needs_fact.len();
|
||||
}
|
||||
|
||||
let extract_pending = extract_queued + extract_remaining;
|
||||
let fact_pending = fact_queued + fact_remaining;
|
||||
let extract_pending = _extract_queued + _extract_remaining;
|
||||
let fact_pending = _fact_remaining;
|
||||
if extract_pending > 0 || fact_pending > 0 || still_open > 0 || backed_off > 0 {
|
||||
log_event("session-watcher", "tick",
|
||||
&format!("{} stale, {} mined, {} extract, {} fact, {} open, {} backoff",
|
||||
|
|
|
|||
|
|
@ -18,24 +18,6 @@ use std::path::PathBuf;
|
|||
// Agent execution
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/// Extract a short slug from agent output for human-readable report keys.
|
||||
fn make_report_slug(output: &str) -> String {
|
||||
let line = output.lines()
|
||||
.map(|l| l.trim())
|
||||
.find(|l| !l.is_empty() && !l.starts_with('#') && !l.starts_with("```") && !l.starts_with("---"))
|
||||
.unwrap_or("");
|
||||
let clean: String = line.replace("**", "").replace('*', "");
|
||||
let filtered: String = clean.chars()
|
||||
.map(|c| if c.is_alphanumeric() || c == ' ' || c == '-' { c } else { ' ' })
|
||||
.collect();
|
||||
let slug: String = filtered.split_whitespace()
|
||||
.take(6)
|
||||
.collect::<Vec<_>>()
|
||||
.join("-")
|
||||
.to_lowercase();
|
||||
if slug.len() > 60 { slug[..60].to_string() } else { slug }
|
||||
}
|
||||
|
||||
/// Result of running a single agent.
|
||||
pub struct AgentResult {
|
||||
pub output: String,
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ fn call_model_with_tools(agent: &str, model: &str, prompt: &str,
|
|||
|
||||
let start = std::time::Instant::now();
|
||||
|
||||
let mut child = unsafe {
|
||||
let child = unsafe {
|
||||
cmd.pre_exec(|| {
|
||||
libc::prctl(libc::PR_SET_PDEATHSIG, libc::SIGTERM);
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue