From b042bee00b0453efe9548bea04011f859f970e63 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 27 Nov 2026 20:56:24 +0100 Subject: [PATCH] Persona T7 fix: the live repo root and recall titles-only lines are pinned by tests (Soul s2 N5) Co-Authored-By: Claude Opus 5.5 --- crates/mind-body/src/projection/read.rs | 11 +++++---- crates/mind-body/src/projection/read/tests.rs | 24 +++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/crates/mind-body/src/projection/read.rs b/crates/mind-body/src/projection/read.rs index 5025fea..57d027d 100644 --- a/crates/mind-body/src/projection/read.rs +++ b/crates/mind-body/src/projection/read.rs @@ -515,10 +515,7 @@ impl LiveReads { fn recall(&self, words: &str) -> Result { let PipelinePageItems::Headers(items) = self.ask(Selection::default(), Some(SemanticQuery { text: Line(words.to_owned()), top_k: RECALL_TOP_K }))? else { return Err(ReadFailure::Failed) }; - if items.is_empty() { - return Err(ReadFailure::NotFound); - } - Ok(format!("{}\n{TITLES_ONLY}", items.iter().map(|item| format!("- {}", facts_words(&item.facts))).collect::>().join("\n"))) + recall_text(items.iter().map(|item| &item.facts)) } fn rulings(&self, slug: &str, since: DateTime) -> Result { @@ -647,6 +644,12 @@ fn search(forge: &dyn ForgeGet, name: &str, words: &str) -> Result(facts: impl IntoIterator) -> Result { + let listed: Vec = facts.into_iter().map(|facts| format!("- {}", facts_words(facts))).collect(); + if listed.is_empty() { Err(ReadFailure::NotFound) } else { Ok(format!("{}\n{TITLES_ONLY}", listed.join("\n"))) } +} + /// A document of her mind as a recall shows it: its id and the words its kind is known by. fn facts_words(facts: &PipelineFacts) -> String { match facts { diff --git a/crates/mind-body/src/projection/read/tests.rs b/crates/mind-body/src/projection/read/tests.rs index 66588a7..39a51f5 100644 --- a/crates/mind-body/src/projection/read/tests.rs +++ b/crates/mind-body/src/projection/read/tests.rs @@ -221,3 +221,27 @@ fn a_read_that_returns_only_titles_says_the_contents_were_not_read() { let named = rulings_text([("Ruling one", None), ("Ruling two", Some("The text."))]).unwrap(); assert_eq!(named, "- Ruling one (title only: the ruling was not read)\n- Ruling two: The text."); } + +/// Soul s2 (live-titles-only-unpinned; m10, m11): the live repo root and the live recall end with the titles-only line, and +/// the live opening of one pull request does not. +#[test] +fn the_live_root_listing_and_recall_say_titles_only() { + struct Forge; + impl ForgeGet for Forge { + fn get(&self, path: &str) -> anyhow::Result<(u16, String)> { + let body = if path.contains("/pulls/") { + serde_json::json!({ "number": 3, "title": "A title", "state": "closed", "merged": true, "user": { "login": "nibu" }, "body": "The whole body." }) + } else if path.contains("/pulls") { + serde_json::json!([{ "number": 3, "title": "A title", "state": "closed", "merged": true, "user": { "login": "nibu" } }]) + } else { + serde_json::json!({ "description": "A repo." }) + }; + Ok((200, body.to_string())) + } + } + assert!(repo_read(&Forge, "GameCult/Lodur").unwrap().ends_with(TITLES_ONLY)); + assert!(!repo_read(&Forge, "GameCult/Lodur#3").unwrap().contains(TITLES_ONLY)); + let facts = PipelineFacts::Target { revision: 1, invariants: Vec::new() }; + assert!(recall_text([&facts]).unwrap().ends_with(TITLES_ONLY)); + assert_eq!(recall_text([]), Err(ReadFailure::NotFound)); +}