memoryd: index ToolSummary as kind summary

Co-Authored-By: ornith-1.5-35b-a3b <agent@wntrmute.dev>
This commit is contained in:
2026-10-03 17:26:14 -07:00
co-authored by ornith-1.5-35b-a3b
parent 57d9aad2d6
commit 0386c343f2
3 changed files with 211 additions and 1 deletions
+19 -1
View File
@@ -1,6 +1,7 @@
//! The index: SQLite FTS5 over the session logs and `notes.md` (M5a spec, section 6). Disposable:
//! it is rebuilt from those files. What is indexed: the owner's messages, the assistant's
//! replies, and each tool call by name and arguments; never a tool's result.
//! replies, and each tool call by name and arguments; the summary of an opted-in tool result,
//! but never the tool's result itself.
use std::os::unix::fs::PermissionsExt;
use std::path::{Path, PathBuf};
@@ -257,6 +258,23 @@ impl Index {
}
}
}
LogRecord::ToolSummary {
time,
content,
class,
untrusted,
..
} if !content.trim().is_empty() && *class <= self.max_class => {
let src = Source {
kind: "summary".to_string(),
time: time.to_rfc3339(),
role: "summary".to_string(),
class: *class,
untrusted: *untrusted,
..base.clone()
};
self.add(content, &src)?;
}
_ => {}
}
Ok(())