From 9d02af224042179814779dafa1040eea1acaffc5 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 27 Nov 2026 18:47:08 +0100 Subject: [PATCH] Persona T7: a note retry skips what the first pass already settled; tests follow the titles-only line Co-Authored-By: Claude Opus 5.5 --- crates/mind-body/src/projection/interpret.rs | 7 +++++++ crates/mind-body/src/projection/read/tests.rs | 2 +- crates/mind-body/src/projection/simulate/tests.rs | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/crates/mind-body/src/projection/interpret.rs b/crates/mind-body/src/projection/interpret.rs index 4f6daec..b177228 100644 --- a/crates/mind-body/src/projection/interpret.rs +++ b/crates/mind-body/src/projection/interpret.rs @@ -766,10 +766,15 @@ pub(crate) fn decide_in(model: &dyn Model, segment_id: &str, packet: &Packet, na let note_bodies = without_drafts(&bodies, &found); let mut batch = parsed.remember; let mut retried = false; + // What the first pass settled without sending back: a second answer that says it again is the model restating its answer, not a rephrasing. + let mut settled_texts: Vec = Vec::new(); loop { let mut again: Vec<(String, MemoryRefusal)> = Vec::new(); for proposed in batch { let text = proposed.text.trim(); + if retried && settled_texts.iter().any(|seen| seen == text) { + continue; + } let reason = if text.is_empty() { Some(MemoryRefusal::MemoryEmpty) } else if text.len() > MEMORY_BYTES { @@ -785,11 +790,13 @@ pub(crate) fn decide_in(model: &dyn Model, segment_id: &str, packet: &Packet, na if reason.retryable() && !retried { again.push((text.to_owned(), reason)); } else { + settled_texts.push(text.to_owned()); memory_refused.push(json!({ "act": "remember", "text": text, "reason": reason })); } continue; } remembered += 1; + settled_texts.push(text.to_owned()); let (about, unknown): (Vec, Vec) = proposed.about.into_iter().partition(|id| shown(id)); about_dropped.extend(unknown); proposals.push(json!({ "kind": "remember", "text": text, "about": about, "importance": proposed.importance.clamp(0.0, 1.0), "private": proposed.private, "room": room })); diff --git a/crates/mind-body/src/projection/read/tests.rs b/crates/mind-body/src/projection/read/tests.rs index 9509ebb..d6f47c9 100644 --- a/crates/mind-body/src/projection/read/tests.rs +++ b/crates/mind-body/src/projection/read/tests.rs @@ -144,7 +144,7 @@ fn r7_a_live_search_keeps_only_results_that_hold_her_words() { } } let kept = repo_read(&Recorded, "GameCult/Bifrost?q=consent").unwrap(); - assert!(kept.starts_with("- #87 ") && kept.lines().count() == 2 && kept.lines().nth(1).is_some_and(|line| line.starts_with("- #71 ")), "{kept}"); + assert!(kept.starts_with("- #87 ") && kept.lines().count() == 3 && kept.ends_with(TITLES_ONLY) && kept.lines().nth(1).is_some_and(|line| line.starts_with("- #71 ")), "{kept}"); assert!(repo_read(&Recorded, "GameCult/Bifrost?q=CONSENT receipt").unwrap().starts_with("- #71 ")); assert_eq!(repo_read(&Recorded, "GameCult/Bifrost?q=consent signature"), Err(ReadFailure::NotFound)); assert_eq!(repo_read(&Recorded, "GameCult/Bifrost?q=sealion"), Err(ReadFailure::NotFound)); diff --git a/crates/mind-body/src/projection/simulate/tests.rs b/crates/mind-body/src/projection/simulate/tests.rs index 75034db..fbe42e0 100644 --- a/crates/mind-body/src/projection/simulate/tests.rs +++ b/crates/mind-body/src/projection/simulate/tests.rs @@ -8,6 +8,7 @@ use crate::projection::harness::tests::{Replaying, Scripted, control}; use serde_json::json; use crate::projection::narrate::PROJECTOR_OPENING; use crate::projection::{Answer, Failed, Model, Spent}; +use crate::projection::read::TITLES_ONLY; const TOBIAH: &str = "@eureka:gamecult.org"; const LIBBY: &str = "@libby:gamecult.org"; @@ -800,7 +801,8 @@ who = "her" let since = DateTime::parse_from_rfc3339("2026-11-19T15:00:00Z").unwrap().with_timezone(&Utc); let reads = CastReads { recorded: &recorded, domain: Some(&domain) }; let read = |slug: &str| reads.read(&ReadRequest::Campaign(slug.into()), since); - assert_eq!(read("heimdall-body"), Ok("- Account merge ships dark by default: notices and the merge pages stay off until the operator turns them on".to_owned())); + assert_eq!(read("heimdall-body"), Ok(format!("- Account merge ships dark by default: notices and the merge pages stay off until the operator turns them on +{TITLES_ONLY}"))); assert_eq!(read("nowhere"), Err(ReadFailure::NotFound)); let mut worded = domain.clone(); worded.campaigns[0].rulings[0].ruling = Some("dark until the operator sets AccountMerge__Enabled".into());