Include identity nodes in memory scoring

Identity memory nodes now participate in importance scoring alongside
conversation memories. Score loading/saving handles both sections, and
the conscious screen uses node.label() consistently for memory display.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-15 05:59:58 -04:00
parent ba4e01b6f3
commit 7046e63b9d
3 changed files with 66 additions and 31 deletions

View file

@ -37,17 +37,14 @@ impl ConsciousScreen {
let mut unscored = 0usize;
for node in ctx.conversation() {
if let AstNode::Leaf(leaf) = node {
if let NodeBody::Memory { key, score, text } = leaf.body() {
let status = match score {
Some(s) => { scored += 1; format!("{:.2}", s) }
None => { unscored += 1; String::new() }
};
if let NodeBody::Memory { score, text, .. } = leaf.body() {
if score.is_some() { scored += 1; } else { unscored += 1; }
mem_children.push(SectionView {
name: key.clone(),
name: node.label(),
tokens: node.tokens(),
content: text.clone(),
children: Vec::new(),
status,
status: String::new(),
});
}
}