digest: split into focused modules, externalize prompts
digest.rs was 2328 lines containing 6 distinct subsystems. Split into:
- llm.rs: shared LLM utilities (call_sonnet, parse_json_response, semantic_keys)
- audit.rs: link quality audit with parallel Sonnet batching
- enrich.rs: journal enrichment + experience mining
- consolidate.rs: consolidation pipeline + apply
Externalized all inline prompts to prompts/*.md templates using
neuro::load_prompt with {{PLACEHOLDER}} syntax:
- daily-digest.md, weekly-digest.md, monthly-digest.md
- experience.md, journal-enrich.md, consolidation.md
digest.rs retains temporal digest generation (daily/weekly/monthly/auto)
and date helpers. ~940 lines, down from 2328.
Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
3f644609e1
commit
50da0b7b26
13 changed files with 1642 additions and 1582 deletions
14
src/main.rs
14
src/main.rs
|
|
@ -14,7 +14,11 @@
|
|||
// interference detection, schema assimilation, reconsolidation.
|
||||
|
||||
mod store;
|
||||
mod llm;
|
||||
mod digest;
|
||||
mod audit;
|
||||
mod enrich;
|
||||
mod consolidate;
|
||||
mod graph;
|
||||
mod search;
|
||||
mod similarity;
|
||||
|
|
@ -516,7 +520,7 @@ fn cmd_consolidate_session() -> Result<(), String> {
|
|||
|
||||
fn cmd_consolidate_full() -> Result<(), String> {
|
||||
let mut store = store::Store::load()?;
|
||||
digest::consolidate_full(&mut store)
|
||||
consolidate::consolidate_full(&mut store)
|
||||
}
|
||||
|
||||
fn cmd_triangle_close(args: &[String]) -> Result<(), String> {
|
||||
|
|
@ -824,7 +828,7 @@ fn cmd_journal_enrich(args: &[String]) -> Result<(), String> {
|
|||
}
|
||||
|
||||
let mut store = store::Store::load()?;
|
||||
digest::journal_enrich(&mut store, jsonl_path, entry_text, grep_line)
|
||||
enrich::journal_enrich(&mut store, jsonl_path, entry_text, grep_line)
|
||||
}
|
||||
|
||||
fn cmd_experience_mine(args: &[String]) -> Result<(), String> {
|
||||
|
|
@ -840,7 +844,7 @@ fn cmd_experience_mine(args: &[String]) -> Result<(), String> {
|
|||
}
|
||||
|
||||
let mut store = store::Store::load()?;
|
||||
let count = digest::experience_mine(&mut store, &jsonl_path)?;
|
||||
let count = enrich::experience_mine(&mut store, &jsonl_path)?;
|
||||
println!("Done: {} new entries mined.", count);
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -852,7 +856,7 @@ fn cmd_apply_consolidation(args: &[String]) -> Result<(), String> {
|
|||
.map(|w| w[1].as_str());
|
||||
|
||||
let mut store = store::Store::load()?;
|
||||
digest::apply_consolidation(&mut store, do_apply, report_file)
|
||||
consolidate::apply_consolidation(&mut store, do_apply, report_file)
|
||||
}
|
||||
|
||||
fn cmd_differentiate(args: &[String]) -> Result<(), String> {
|
||||
|
|
@ -919,7 +923,7 @@ fn cmd_differentiate(args: &[String]) -> Result<(), String> {
|
|||
fn cmd_link_audit(args: &[String]) -> Result<(), String> {
|
||||
let apply = args.iter().any(|a| a == "--apply");
|
||||
let mut store = store::Store::load()?;
|
||||
let stats = digest::link_audit(&mut store, apply)?;
|
||||
let stats = audit::link_audit(&mut store, apply)?;
|
||||
println!("\n{}", "=".repeat(60));
|
||||
println!("Link audit complete:");
|
||||
println!(" Kept: {} Deleted: {} Retargeted: {} Weakened: {} Strengthened: {} Errors: {}",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue