Persona live organ: one-turn, drain, wake-humans-pace, turn memory (squash of hands/persona-live-drain) #83

Merged
eureka merged 287 commits from hands/persona-live-drain into main 2026-11-28 07:05:45 +00:00
Showing only changes of commit 05dffd6327 - Show all commits

Persona harness fix-up: the fixture search is a free function, so the public surface is unchanged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Meta Vens 2026-11-21 02:39:36 +01:00

View file

@ -347,31 +347,28 @@ impl ReadSource for ReadFixture {
Some(ReadEntry { refused: Some(why), .. }) => Err(*why),
Some(ReadEntry { text: Some(text), .. }) => Ok(text.clone()),
Some(_) => Err(ReadFailure::NotFound),
None => self.search(request).ok_or(ReadFailure::NotFound),
None => fixture_search(&self.0, request).ok_or(ReadFailure::NotFound),
}
}
}
impl ReadFixture {
/// A search of a repo by the titles of its recorded pull requests and issues: each whose title holds every word, as
/// `- #n title`; none, and nothing was found.
fn search(&self, request: &ReadRequest) -> Option<String> {
let ReadRequest::Repo(target) = request else { return None };
let (repo, words) = target.split_once("?q=")?;
let (repo, words) = (repo.to_lowercase(), word_tokens(words));
let listed: Vec<String> = self
.0
.iter()
.filter(|entry| entry.kind == "repo")
.filter_map(|entry| {
let (of, number) = entry.target.split_once('#')?;
let title = entry.text.as_deref()?.lines().next()?.trim();
let held = word_tokens(title);
(of.to_lowercase() == repo && words.iter().all(|word| held.contains(word))).then(|| format!("- #{number} {title}"))
})
.collect();
(!listed.is_empty()).then(|| listed.join("\n"))
}
/// A search of a repo by the titles of its recorded pull requests and issues: each whose title holds every word, as
/// `- #n title`; none, and nothing was found.
fn fixture_search(entries: &[ReadEntry], request: &ReadRequest) -> Option<String> {
let ReadRequest::Repo(target) = request else { return None };
let (repo, words) = target.split_once("?q=")?;
let (repo, words) = (repo.to_lowercase(), word_tokens(words));
let listed: Vec<String> = entries
.iter()
.filter(|entry| entry.kind == "repo")
.filter_map(|entry| {
let (of, number) = entry.target.split_once('#')?;
let title = entry.text.as_deref()?.lines().next()?.trim();
let held = word_tokens(title);
(of.to_lowercase() == repo && words.iter().all(|word| held.contains(word))).then(|| format!("- #{number} {title}"))
})
.collect();
(!listed.is_empty()).then(|| listed.join("\n"))
}
// ---------------------------------------------------------------------------------------------