link-audit: walk every link through Sonnet for quality review
Batch all non-deleted links (~3,800) into char-budgeted groups, send each batch to Sonnet with full content of both endpoints, and apply KEEP/DELETE/RETARGET/WEAKEN/STRENGTHEN decisions. One-time cleanup for links created before refine_target existed. Co-Authored-By: ProofOfConcept <poc@bcachefs.org>
This commit is contained in:
parent
3e883b7ba7
commit
7264bdc39c
2 changed files with 322 additions and 0 deletions
14
src/main.rs
14
src/main.rs
|
|
@ -93,6 +93,7 @@ fn main() {
|
|||
"journal-enrich" => cmd_journal_enrich(&args[2..]),
|
||||
"apply-consolidation" => cmd_apply_consolidation(&args[2..]),
|
||||
"differentiate" => cmd_differentiate(&args[2..]),
|
||||
"link-audit" => cmd_link_audit(&args[2..]),
|
||||
"trace" => cmd_trace(&args[2..]),
|
||||
"list-keys" => cmd_list_keys(),
|
||||
"list-edges" => cmd_list_edges(),
|
||||
|
|
@ -157,6 +158,7 @@ Commands:
|
|||
Extract and apply actions from consolidation reports
|
||||
differentiate [KEY] [--apply]
|
||||
Redistribute hub links to section-level children
|
||||
link-audit [--apply] Walk every link, send to Sonnet for quality review
|
||||
trace KEY Walk temporal links: semantic ↔ episodic ↔ conversation
|
||||
list-keys List all node keys (one per line)
|
||||
list-edges List all edges (tsv: source target strength type)
|
||||
|
|
@ -783,6 +785,18 @@ fn cmd_differentiate(args: &[String]) -> Result<(), String> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn cmd_link_audit(args: &[String]) -> Result<(), String> {
|
||||
let apply = args.iter().any(|a| a == "--apply");
|
||||
let mut store = capnp_store::Store::load()?;
|
||||
let stats = digest::link_audit(&mut store, apply)?;
|
||||
println!("\n{}", "=".repeat(60));
|
||||
println!("Link audit complete:");
|
||||
println!(" Kept: {} Deleted: {} Retargeted: {} Weakened: {} Strengthened: {} Errors: {}",
|
||||
stats.kept, stats.deleted, stats.retargeted, stats.weakened, stats.strengthened, stats.errors);
|
||||
println!("{}", "=".repeat(60));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn cmd_trace(args: &[String]) -> Result<(), String> {
|
||||
if args.is_empty() {
|
||||
return Err("Usage: poc-memory trace KEY".into());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue