surface: tag recent nodes as (new) instead of hiding them

Links to nodes created after the conversation window start are
tagged with (new) in memory_render output. The surface prompt
tells the agent not to surface these — they're its own recent
output, not prior memories. Observe can still see and update them.

POC_MEMORIES_OLDER_THAN env var set from the oldest message
timestamp in the conversation window.

Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
ProofOfConcept 2026-03-26 21:19:19 -04:00
parent 7fc1d60113
commit 27861a44e5
5 changed files with 75 additions and 23 deletions

View file

@ -107,8 +107,9 @@ pub fn dispatch(name: &str, args: &serde_json::Value, provenance: Option<&str>)
let node = MemoryNode::load(key)
.ok_or_else(|| anyhow::anyhow!("node not found: {}", key))?;
let mut out = format!("Neighbors of '{}':\n", key);
for (target, strength) in &node.links {
out.push_str(&format!(" ({:.2}) {}\n", strength, target));
for (target, strength, is_new) in &node.links {
let tag = if *is_new { " (new)" } else { "" };
out.push_str(&format!(" ({:.2}) {}{}\n", strength, target, tag));
}
Ok(out)
}