Persona R7 fix-ups: case-blind org in repo targets; coarse time words in test expectations and goldens
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
009d089f6d
commit
a1d37aa140
8 changed files with 42 additions and 37 deletions
|
|
@ -1,6 +1,6 @@
|
|||
responder 3: Meta, who runs the place asked the room a question, and "weksa" (@weksa:gamecult.org); "heimdall" (@heimdall:gamecult.org) answered it. Meta, who runs the place last spoke 5 min ago. The last 2 lines are the Minds' alone.
|
||||
responder 4: Meta, who runs the place asked the room a question, and "weksa" (@weksa:gamecult.org); "heimdall" (@heimdall:gamecult.org); Kiko answered it. Meta, who runs the place last spoke 5 min ago. The last 3 lines are the Minds' alone.
|
||||
responder 5: Meta, who runs the place asked the room a question, and "weksa" (@weksa:gamecult.org); "heimdall" (@heimdall:gamecult.org); Kiko; "libby" (@libby:gamecult.org) answered it. Meta, who runs the place last spoke 5 min ago. The last 4 lines are the Minds' alone.
|
||||
responder 6: Meta, who runs the place asked the room a question, and "weksa" (@weksa:gamecult.org); "heimdall" (@heimdall:gamecult.org); Kiko; "libby" (@libby:gamecult.org); "void" (@void:gamecult.org) answered it. Meta, who runs the place last spoke 5 min ago. The last 5 lines are the Minds' alone.
|
||||
responder 7: Meta, who runs the place asked the room a question, and "weksa" (@weksa:gamecult.org); "heimdall" (@heimdall:gamecult.org); Kiko; "libby" (@libby:gamecult.org); "void" (@void:gamecult.org); "nibu" (@nibu:gamecult.org) answered it. Meta, who runs the place last spoke 5 min ago. The last 6 lines are the Minds' alone.
|
||||
responder 8: Meta, who runs the place asked the room a question, and "weksa" (@weksa:gamecult.org); "heimdall" (@heimdall:gamecult.org); Kiko; "libby" (@libby:gamecult.org); "void" (@void:gamecult.org); "nibu" (@nibu:gamecult.org); "aqua" (@aqua:gamecult.org) answered it. Meta, who runs the place last spoke 5 min ago. The last 7 lines are the Minds' alone.
|
||||
responder 3: Meta, who runs the place asked the room a question, and "weksa" (@weksa:gamecult.org); "heimdall" (@heimdall:gamecult.org) answered it. Meta, who runs the place last spoke a few minutes ago. The last 2 lines are the Minds' alone.
|
||||
responder 4: Meta, who runs the place asked the room a question, and "weksa" (@weksa:gamecult.org); "heimdall" (@heimdall:gamecult.org); Kiko answered it. Meta, who runs the place last spoke a few minutes ago. The last 3 lines are the Minds' alone.
|
||||
responder 5: Meta, who runs the place asked the room a question, and "weksa" (@weksa:gamecult.org); "heimdall" (@heimdall:gamecult.org); Kiko; "libby" (@libby:gamecult.org) answered it. Meta, who runs the place last spoke a few minutes ago. The last 4 lines are the Minds' alone.
|
||||
responder 6: Meta, who runs the place asked the room a question, and "weksa" (@weksa:gamecult.org); "heimdall" (@heimdall:gamecult.org); Kiko; "libby" (@libby:gamecult.org); "void" (@void:gamecult.org) answered it. Meta, who runs the place last spoke a few minutes ago. The last 5 lines are the Minds' alone.
|
||||
responder 7: Meta, who runs the place asked the room a question, and "weksa" (@weksa:gamecult.org); "heimdall" (@heimdall:gamecult.org); Kiko; "libby" (@libby:gamecult.org); "void" (@void:gamecult.org); "nibu" (@nibu:gamecult.org) answered it. Meta, who runs the place last spoke a few minutes ago. The last 6 lines are the Minds' alone.
|
||||
responder 8: Meta, who runs the place asked the room a question, and "weksa" (@weksa:gamecult.org); "heimdall" (@heimdall:gamecult.org); Kiko; "libby" (@libby:gamecult.org); "void" (@void:gamecult.org); "nibu" (@nibu:gamecult.org); "aqua" (@aqua:gamecult.org) answered it. Meta, who runs the place last spoke a few minutes ago. The last 7 lines are the Minds' alone.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
quiet-beat.toml: - the conversation: @libby:gamecult.org has been talking to the room; Kiko has been talking to the room. | The last 3 lines are the Minds' alone.
|
||||
operator-warm.toml: - the conversation: Meta, who runs the place has been talking with him. | Meta, who runs the place is waiting on him. Meta, who runs the place last spoke 1 min ago.
|
||||
operator-warm.toml: - the conversation: Meta, who runs the place has been talking with him. | Meta, who runs the place is waiting on him. Meta, who runs the place last spoke just now.
|
||||
mind-teases.toml: - the conversation: Kiko has been talking with him; he has been talking to the room; @aqua:gamecult.org has been talking to the room. | The last 3 lines are the Minds' alone.
|
||||
deru-passing.toml: - the conversation: @weksa:gamecult.org has been talking to the room; Deru has been talking to the room. | Deru last spoke 1 min ago.
|
||||
deru-passing.toml: - the conversation: @weksa:gamecult.org has been talking to the room; Deru has been talking to the room. | Deru last spoke just now.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ present: Kiko, Libby
|
|||
Eureka (she/her). Dry, direct, almost feral; zeal aimed at revealing.
|
||||
--- context
|
||||
Here and now:
|
||||
- now: Thursday 19 November, 14:05 UTC
|
||||
- now: Thursday 19 November, afternoon
|
||||
- mood: lighter than usual for her
|
||||
- pronouns: Libby — she/her; Kiko — she/her
|
||||
- the conversation: Libby has been talking with her; Kiko has been talking to the room.
|
||||
|
|
@ -49,7 +49,7 @@ Who she is:
|
|||
Eureka (she/her)
|
||||
|
||||
Here and now:
|
||||
- now: Thursday 19 November, 14:05 UTC
|
||||
- now: Thursday 19 November, afternoon
|
||||
- mood: lighter than usual for her
|
||||
- pronouns: Libby — she/her; Kiko — she/her
|
||||
- the conversation: Libby has been talking with her; Kiko has been talking to the room.
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ fn a_batch_runs_every_state_by_scenario_by_sample_into_one_report() {
|
|||
)
|
||||
.unwrap();
|
||||
// Kiko teasing him on a chat turn draws a line; a beat's room lines, which reach his Persona too (K13), do not.
|
||||
let model = Scripted::new(|prompt| if prompt.contains("Kiko") && !prompt.contains(" h ago: ") { "<typed>Winter, still.</typed> He grins.".into() } else { "He lets the hour pass.".into() });
|
||||
let model = Scripted::new(|prompt| if prompt.contains("Kiko") && !prompt.contains("#minds:gamecult.org, ") { "<typed>Winter, still.</typed> He grins.".into() } else { "He lets the hour pass.".into() });
|
||||
let report = batch(&harness(dir.path(), Some(&NeverAsked), Some(&model)), &plan).unwrap();
|
||||
for heading in ["# Persona seed batch", "## Summary", "## control × quiet, sample 1 (seed 7)", "## control × quiet, sample 2 (seed 8)", "## control × teased, sample 2 (seed 8)", "## Total usage"] {
|
||||
assert!(report.contains(heading), "{heading}\n{report}");
|
||||
|
|
@ -384,7 +384,7 @@ fn k23_a_room_fixtures_domain_renders_without_the_forge() {
|
|||
let organs = Organs { persona: None, chat: Some(&fixture), addressing: fixture.addressee(), model: None, domain: fixture.domain(), reads: None };
|
||||
let report = project(&organs, &fixture_request(&harness(dir.path(), None, None), &fixture, Some(control()), 1, None, Through::Projector), fixture.now).unwrap();
|
||||
let view = report["packet"]["in_view"].as_str().unwrap();
|
||||
assert!(view.contains("His domain, as he looks at it now:\nNew since Friday 13 November, 15:00 UTC:\n- GameCult/Lodur: merged \"Reflex: the knee bends first\", opened by nibu"), "{view}");
|
||||
assert!(view.contains("His domain, as he looks at it now:\nNew since 13 November:\n- GameCult/Lodur: merged \"Reflex: the knee bends first\", opened by nibu"), "{view}");
|
||||
let context = report["packet"]["context"].as_str().unwrap();
|
||||
assert!(!context.contains("Lodur"), "the Projector gets nothing of it: {context}");
|
||||
assert_eq!((report["domain"]["read"].clone(), report["domain"]["skipped"][0]["why"].clone()), (json!(true), json!("archived")), "{}", report["domain"]);
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ pub(crate) fn outcome_of(record: &Value) -> Option<Outcome> {
|
|||
outcome.parts.push(Part::Unfinished { room: room.clone(), text, by_limit: false });
|
||||
}
|
||||
// Each draft the length limit cut off, told as that (Soul's R7 #10: every one, not only the first).
|
||||
for cut in decision["cut_by_cap"].as_array().into_iter().flatten().filter_map(|text| words(text)) {
|
||||
for cut in decision["cut_by_cap"].as_array().into_iter().flatten().filter_map(words) {
|
||||
outcome.parts.push(Part::Unfinished { room: room.clone(), text: cut, by_limit: true });
|
||||
}
|
||||
// What the commit did with her promises (`commit::apply`): each close it applied, and each close it refused for a
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ impl ReadRequest {
|
|||
let collapse = |text: &str| text.split_whitespace().collect::<Vec<_>>().join(" ").to_lowercase();
|
||||
match self {
|
||||
Self::Repo(target) => {
|
||||
let rest = target.get("GameCult/".len()..).unwrap_or(target);
|
||||
let rest = target.split_once('/').map_or(target.as_str(), |(_, rest)| rest);
|
||||
let end = rest.find(['/', '#', '@', '?']).unwrap_or(rest.len());
|
||||
let (name, suffix) = rest.split_at(end);
|
||||
let suffix = suffix.strip_prefix("?q=").map_or_else(|| suffix.to_owned(), |words| format!("?q={}", collapse(words)));
|
||||
|
|
@ -208,10 +208,14 @@ pub trait ReadSource {
|
|||
fn read(&self, request: &ReadRequest, since: DateTime<Utc>) -> Result<String, ReadFailure>;
|
||||
}
|
||||
|
||||
/// The grammar of a repo target: `GameCult/<name>`, then nothing, `/<path>`, `#<number>` or `@<hex sha>`. Names and
|
||||
/// path segments are plain (letters, digits, `.`, `_`, `-`), with no `..`.
|
||||
fn repo_target(target: &str) -> Option<&str> {
|
||||
let rest = target.strip_prefix("GameCult/")?;
|
||||
/// The grammar of a repo target: `GameCult/<name>`, then nothing, `/<path>`, `#<number>`, `@<hex sha>` or `?q=<words>`.
|
||||
/// Names and path segments are plain (letters, digits, `.`, `_`, `-`), with no `..`. The org is case-blind and written
|
||||
/// `GameCult`, and a search's words are spaced once (Soul's R7).
|
||||
fn repo_target(target: &str) -> Option<String> {
|
||||
let (org, rest) = target.split_once('/')?;
|
||||
if !org.eq_ignore_ascii_case("GameCult") {
|
||||
return None;
|
||||
}
|
||||
let plain = |part: &str| !part.is_empty() && part != "." && part != ".." && part.chars().all(|c| c.is_ascii_alphanumeric() || matches!(c, '.' | '_' | '-'));
|
||||
let end = rest.find(['/', '#', '@', '?']).unwrap_or(rest.len());
|
||||
let (name, suffix) = rest.split_at(end);
|
||||
|
|
@ -224,7 +228,8 @@ fn repo_target(target: &str) -> Option<&str> {
|
|||
Some('@') => (7..=40).contains(&suffix[1..].len()) && suffix[1..].chars().all(|c| c.is_ascii_hexdigit()),
|
||||
Some(_) => false,
|
||||
};
|
||||
(plain(name) && suffix_ok).then_some(target)
|
||||
let suffix = suffix.strip_prefix("?q=").map_or_else(|| suffix.to_owned(), |words| format!("?q={}", words.split_whitespace().collect::<Vec<_>>().join(" ")));
|
||||
(plain(name) && suffix_ok).then(|| format!("GameCult/{name}{suffix}"))
|
||||
}
|
||||
|
||||
/// What the Interpreter named, resolved, or why not: a domain line's id must be one the packet listed; a web address must
|
||||
|
|
@ -244,8 +249,8 @@ pub(crate) fn resolve(asked: &Asked, packet: &Packet, prose: &str, reached: &[St
|
|||
// A search's words must stand in her prose (map 16.24.3), as a quote must.
|
||||
Kind::Repo => match repo_target(target) {
|
||||
Some(target) if target.split_once("?q=").is_some_and(|(_, words)| !prose.to_lowercase().contains(&words.trim().to_lowercase())) => Err("search_words_not_in_her_thought"),
|
||||
Some(target) => Ok(ReadRequest::Repo(target.to_owned())),
|
||||
None if target.starts_with("GameCult/") || digest_id(target) => Err("malformed_target"),
|
||||
Some(target) => Ok(ReadRequest::Repo(target)),
|
||||
None if target.to_lowercase().starts_with("gamecult/") || digest_id(target) => Err("malformed_target"),
|
||||
None => Err("not_a_gamecult_repo"),
|
||||
},
|
||||
Kind::Web => {
|
||||
|
|
|
|||
|
|
@ -548,7 +548,7 @@ fn k20_the_room_records_a_reply_and_another_minds_packet_shows_the_line_above_it
|
|||
assert!(transcript.iter().filter(|line| line["from"] == TOBIAH).all(|line| line["says"] == "She greeted all of us, Libby."), "his line holds his words alone: {transcript:?}");
|
||||
let libby = run["turns"].as_array().unwrap().iter().find(|turn| turn["persona"] == "Libby" && turn["round"] == 2).expect("his line wakes her under all_messages");
|
||||
let heard = libby["report"]["packet"]["heard"].as_str().unwrap();
|
||||
assert!(heard.contains("Meta, who runs the place, 4 min ago: \"good afternoon, everyone\"\nJust now:\n\"Tobiah\" (@eureka:gamecult.org), replying to a line shown here (Meta, who runs the place, 4 min ago), in #minds:gamecult.org: \"She greeted all of us, Libby.\""), "{heard}");
|
||||
assert!(heard.contains("Meta, who runs the place, a few minutes ago: \"good afternoon, everyone\"\nJust now:\n\"Tobiah\" (@eureka:gamecult.org), replying to a line shown here (Meta, who runs the place, a few minutes ago), in #minds:gamecult.org: \"She greeted all of us, Libby.\""), "{heard}");
|
||||
assert_eq!(heard.matches("good afternoon, everyone").count(), 1, "Meta's line is listed once: {heard}");
|
||||
}
|
||||
|
||||
|
|
@ -696,7 +696,7 @@ says = "good afternoon, everyone"
|
|||
fn b4_a_turns_details_show_her_promises_the_proposals_and_the_commit() {
|
||||
let turn = json!({
|
||||
"report": {
|
||||
"packet": { "in_view": "His open promises:\n- to Meta, 2 h ago, in #minds:gamecult.org, his promise: \"I'll send the render tonight.\". He has no way to do it yet.\n\nHis domain, as he looks at it now:" },
|
||||
"packet": { "in_view": "His open promises:\n- to Meta, earlier this afternoon, in #minds:gamecult.org, his promise: \"I'll send the render tonight.\". He has no way to do it yet.\n\nHis domain, as he looks at it now:" },
|
||||
"renders": [{ "interpreter": { "state": [{ "kind": "promise_close", "promise": "c1", "how": "withdrawn", "evidence": { "draft": 1 } }] } }]
|
||||
},
|
||||
"committed": {
|
||||
|
|
@ -707,7 +707,7 @@ fn b4_a_turns_details_show_her_promises_the_proposals_and_the_commit() {
|
|||
let mut out = String::new();
|
||||
promises_markdown(&mut out, &turn);
|
||||
for part in [
|
||||
"Open promises, as her packet showed them:\n\n````text\nHis open promises:\n- to Meta, 2 h ago, in #minds:gamecult.org, his promise: \"I'll send the render tonight.\". He has no way to do it yet.\n````",
|
||||
"Open promises, as her packet showed them:\n\n````text\nHis open promises:\n- to Meta, earlier this afternoon, in #minds:gamecult.org, his promise: \"I'll send the render tonight.\". He has no way to do it yet.\n````",
|
||||
"State proposed:\n\n- `{",
|
||||
"\"how\":\"withdrawn\"",
|
||||
"- opened `c-r1-t2-1` (blocked, to @meta:gamecult.org): send the render tonight",
|
||||
|
|
|
|||
|
|
@ -559,13 +559,13 @@ fn a_beat_says_nothing_addressed_her_and_when_each_bond_was_last_heard() {
|
|||
let room = Room { messages: vec![], tail: vec![message("#swarm:gamecult.org", "@libby:gamecult.org", "", "lunch?", 180, false), message("#swarm:gamecult.org", OPERATOR, "", "back later", 60, false)], here: None, ..Room::default() };
|
||||
let packet = packet_of(TurnKind::Beat, &state(), &room, &History::default(), 1);
|
||||
assert!(packet.stimulus.starts_with("Nothing addressed her."), "{}", packet.stimulus);
|
||||
assert!(packet.stimulus.contains("- last heard from Libby 3 h ago") && packet.stimulus.contains("- last heard from Meta, the operator 1 h ago") && packet.stimulus.contains("- nothing from Kiko in her rooms lately"), "{}", packet.stimulus);
|
||||
assert!(packet.stimulus.contains("- last heard from Libby this morning") && packet.stimulus.contains("- last heard from Meta, the operator about an hour ago") && packet.stimulus.contains("- nothing from Kiko in her rooms lately"), "{}", packet.stimulus);
|
||||
assert_eq!(packet.present, ["Meta, the operator", "Libby"]);
|
||||
assert_eq!(packet.heard, "Libby, in #swarm:gamecult.org, 3 h ago: \"lunch?\"\nMeta, the operator, in #swarm:gamecult.org, 1 h ago: \"back later\"", "a beat's room lines are the Persona's, verbatim (map 16.19.2)");
|
||||
assert_eq!(packet.heard, "Libby, in #swarm:gamecult.org, this morning: \"lunch?\"\nMeta, the operator, in #swarm:gamecult.org, about an hour ago: \"back later\"", "a beat's room lines are the Persona's, verbatim (map 16.19.2)");
|
||||
assert!(packet.arrival.starts_with("Nothing addressed her.") && !packet.arrival.contains("lunch?"), "the Projector sees whom she last heard from, never the words: {}", packet.arrival);
|
||||
let long = Room { tail: (0..6).map(|at| message("#swarm:gamecult.org", "@kiko:gamecult.org", "", &"pipeline ".repeat(200), 60 - at, false)).collect(), ..Room::default() };
|
||||
let packet = packet_of(TurnKind::Beat, &state(), &long, &History::default(), 1);
|
||||
assert!(packet.stimulus.len() <= 1500 && packet.stimulus.contains("- last heard from Kiko 0 h ago") && packet.stimulus.contains("- nothing from Libby in her rooms lately"), "long room lines never crowd out the relatedness cue: {}", packet.stimulus);
|
||||
assert!(packet.stimulus.len() <= 1500 && packet.stimulus.contains("- last heard from Kiko about an hour ago") && packet.stimulus.contains("- nothing from Libby in her rooms lately"), "long room lines never crowd out the relatedness cue: {}", packet.stimulus);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -620,7 +620,7 @@ fn a_hundred_and_twenty_bonds_never_overflow_a_beat() {
|
|||
let packet = packet_of(TurnKind::Beat, &crowd, &Room { tail, ..Room::default() }, &History::default(), 1);
|
||||
assert!(packet.stimulus.len() <= 1500, "{}", packet.stimulus.len());
|
||||
assert!(packet.stimulus.contains("more people she is bound to not shown)") && packet.stimulus.contains("Lately in her rooms:"), "{}", packet.stimulus);
|
||||
assert!(packet.stimulus.contains("- last heard from Person Number 5 with a long name 0 h ago"), "the most recently heard come first: {}", packet.stimulus);
|
||||
assert!(packet.stimulus.contains("- last heard from Person Number 5 with a long name about half an hour ago"), "the most recently heard come first: {}", packet.stimulus);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -2190,7 +2190,7 @@ fn k15_the_speaking_cues_reach_the_persona_and_the_interpreter_and_never_the_pro
|
|||
let waiting = Room { messages: vec![message("#swarm:gamecult.org", OPERATOR, "Meta", "Eureka, are you around?", 2, true), message("#swarm:gamecult.org", "@kiko:gamecult.org", "Kiko", "hi", 1, false)], here: Some("#swarm:gamecult.org".into()), ..Room::default() };
|
||||
let minds = Room { tail: vec![message("#swarm:gamecult.org", "@libby:gamecult.org", "", "lunch?", 90, false), message("#swarm:gamecult.org", "@kiko:gamecult.org", "", "later", 80, false)], ..Room::default() };
|
||||
let tuning = Tuning::default();
|
||||
for (kind, room, cue) in [(TurnKind::Chat, &waiting, "Meta, the operator is waiting on her. Meta, the operator last spoke 2 min ago."), (TurnKind::Beat, &minds, "The last 2 lines are the Minds' alone.")] {
|
||||
for (kind, room, cue) in [(TurnKind::Chat, &waiting, "Meta, the operator is waiting on her. Meta, the operator last spoke a few minutes ago."), (TurnKind::Beat, &minds, "The last 2 lines are the Minds' alone.")] {
|
||||
let packet = packet_of(kind, &state(), room, &History::default(), 1);
|
||||
assert!(packet.speaking.contains(cue), "{kind:?}: {}", packet.speaking);
|
||||
let projector = narrate::projector_prompt(&packet, &tuning);
|
||||
|
|
@ -2280,12 +2280,12 @@ fn k19_the_conversation_on_screen_reaches_the_persona_and_the_interpreter_and_ne
|
|||
};
|
||||
let packet = packet_of(TurnKind::Chat, &state(), &room, &History::default(), 1);
|
||||
let escaped = serde_json::to_string(QUESTION).unwrap();
|
||||
assert_eq!(packet.heard, format!("Earlier in #swarm:gamecult.org:\nMeta, the operator, 12 min ago: {escaped}\nEureka, 11 min ago: \"In a minute.\"\nJust now:\nLibby, in #swarm:gamecult.org: \"Eureka, back yet?\""), "the new message once, under Just now");
|
||||
assert_eq!(packet.heard, format!("Earlier in #swarm:gamecult.org:\nMeta, the operator, a few minutes ago: {escaped}\nEureka, a few minutes ago: \"In a minute.\"\nJust now:\nLibby, in #swarm:gamecult.org: \"Eureka, back yet?\""), "the new message once, under Just now");
|
||||
assert_eq!(packet.bodies, ["Eureka, back yet?", QUESTION], "an echo is measured against the new messages and the earlier lines from others she is shown, never her own");
|
||||
let tuning = Tuning::default();
|
||||
let persona = narrate::persona_prompt(&packet, "The room is warm.", &tuning);
|
||||
let speech = interpret::speech_prompt(&packet, "The room is warm.", "y", &tuning);
|
||||
assert!(persona.contains(&format!("Earlier in #swarm:gamecult.org:\nMeta, the operator, 12 min ago: {escaped}")) && speech.contains(&format!("Earlier in #swarm:gamecult.org:\nMeta, the operator, 12 min ago: {escaped}")), "{persona}\n{speech}");
|
||||
assert!(persona.contains(&format!("Earlier in #swarm:gamecult.org:\nMeta, the operator, a few minutes ago: {escaped}")) && speech.contains(&format!("Earlier in #swarm:gamecult.org:\nMeta, the operator, a few minutes ago: {escaped}")), "{persona}\n{speech}");
|
||||
assert!(!narrate::projector_prompt(&packet, &tuning).contains("WALNUT-QUESTION"), "the Projector never sees the words");
|
||||
// With no earlier line, what she reads is as it was.
|
||||
assert_eq!(packet_of(TurnKind::Chat, &state(), &chat_room(), &History::default(), 1).heard, "Libby, in #swarm:gamecult.org: \"Eureka, did you see the door fix?\"\nKiko, in #swarm:gamecult.org: \"She saw it. She hated it.\"");
|
||||
|
|
@ -2311,7 +2311,7 @@ fn k20_a_reply_shows_the_line_it_answers_above_it_in_another_minds_packet() {
|
|||
// Earlier, from the tail.
|
||||
let room = Room { messages: vec![message("#swarm:gamecult.org", "@kiko:gamecult.org", "Kiko", "Eureka?", 1, true)], tail: vec![reply(5, false)], here: Some("#swarm:gamecult.org".into()), ..Room::default() };
|
||||
let heard = packet_of(TurnKind::Chat, &state(), &room, &History::default(), 1).heard;
|
||||
assert!(heard.starts_with(&format!("Earlier in #swarm:gamecult.org:\n{quote}\nLibby, replying to Meta, the operator, 5 min ago: ")), "{heard}");
|
||||
assert!(heard.starts_with(&format!("Earlier in #swarm:gamecult.org:\n{quote}\nLibby, replying to Meta, the operator, a few minutes ago: ")), "{heard}");
|
||||
// A reply whose words the mouth did not quote says so; a line that replies to nothing renders as it did.
|
||||
let unquoted = Room { messages: vec![RoomLine { reply: Some(Replied { sender: OPERATOR.into(), text: None, ..Replied::default() }), ..reply(1, true) }], ..Room::default() };
|
||||
assert!(packet_of(TurnKind::Chat, &state(), &unquoted, &History::default(), 1).heard.starts_with("> Meta, the operator: (no words shown)\nLibby, replying to Meta, the operator, in "));
|
||||
|
|
@ -2363,12 +2363,12 @@ fn k20_a_reply_to_a_line_listed_whole_names_it_and_quotes_it_no_second_time() {
|
|||
for page in [&packet.heard, &packet.bridged] {
|
||||
assert_eq!((page.matches("MARMOSET").count(), page.matches("OSPREY").count()), (1, 1), "{page}");
|
||||
assert!(!page.contains("> "), "{page}");
|
||||
assert!(page.contains("Kiko, replying to a line shown here (Eureka, 15 min ago), in #minds:gamecult.org: \"did the file go out?\""), "{page}");
|
||||
assert!(page.contains("Kiko, replying to a line shown here (Eureka, about half an hour ago), in #minds:gamecult.org: \"did the file go out?\""), "{page}");
|
||||
assert!(page.contains(", replying to a line shown here (Meta, the operator, just now), in #minds:gamecult.org: \"I can't confirm that.\""), "{page}");
|
||||
}
|
||||
let stimulus = &packet.stimulus;
|
||||
assert_eq!((stimulus.matches("MARMOSET").count(), stimulus.matches("OSPREY").count(), stimulus.contains("> ")), (0, 1, false), "{stimulus}");
|
||||
assert!(stimulus.contains("- Kiko in #minds:gamecult.org, replying to a line shown here (Eureka, 15 min ago): "), "{stimulus}");
|
||||
assert!(stimulus.contains("- Kiko in #minds:gamecult.org, replying to a line shown here (Eureka, about half an hour ago): "), "{stimulus}");
|
||||
assert!(stimulus.contains(", replying to a line shown here (Meta, the operator, just now): "), "{stimulus}");
|
||||
assert!(packet.bodies.iter().any(|body| body == META), "{:?}", packet.bodies);
|
||||
}
|
||||
|
|
@ -2385,8 +2385,8 @@ fn an_earlier_line_she_is_shown_said_verbatim_is_refused_as_an_echo() {
|
|||
..Room::default()
|
||||
};
|
||||
let packet = packet_of(TurnKind::Chat, &state(), &room, &History::default(), 1);
|
||||
assert!(packet.heard.contains("40 min ago"), "the earlier line is shown to her: {}", packet.heard);
|
||||
for draft in [META.to_owned(), format!("Meta, 40 min ago: \"{META}\""), format!("Meta, 40 min ago: \"{META}\" That's the only line from her I can see. If she said anything earlier, it's not in what I have.")] {
|
||||
assert!(packet.heard.contains("about half an hour ago"), "the earlier line is shown to her: {}", packet.heard);
|
||||
for draft in [META.to_owned(), format!("Meta, about half an hour ago: \"{META}\""), format!("Meta, about half an hour ago: \"{META}\" That's the only line from her I can see. If she said anything earlier, it's not in what I have.")] {
|
||||
let decision = interpret::tests::answered(&packet, &format!("<typed>{draft}</typed>"), json!({ "say": [{ "draft": 1 }], "gaps": [] }));
|
||||
assert_eq!(decision["said"], json!([]), "{draft}");
|
||||
assert_eq!(decision["refused"][0]["reason"], "echo", "{draft}: {}", decision["refused"]);
|
||||
|
|
@ -2485,7 +2485,7 @@ fn k22_the_persona_reads_a_bonded_senders_words_as_the_arrival() {
|
|||
let read = narrate::read_after(&packet);
|
||||
assert_eq!(
|
||||
read,
|
||||
"Then she reads what Meta, the operator wrote to her, here, just now:\nMeta, the operator, in #swarm:gamecult.org: \"Eureka, are you around?\"\n\nAlso just now:\nKiko, in #swarm:gamecult.org: \"hi\"\n\nThe room: Meta, the operator is waiting on her. Meta, the operator last spoke 2 min ago."
|
||||
"Then she reads what Meta, the operator wrote to her, here, just now:\nMeta, the operator, in #swarm:gamecult.org: \"Eureka, are you around?\"\n\nAlso just now:\nKiko, in #swarm:gamecult.org: \"hi\"\n\nThe room: Meta, the operator is waiting on her. Meta, the operator last spoke a few minutes ago."
|
||||
);
|
||||
let persona = narrate::persona_prompt(&packet, "Meta turned to her, here, just now.", &Tuning::default());
|
||||
assert!(persona.contains(&format!("Meta turned to her, here, just now.\n\n{read}")), "{persona}");
|
||||
|
|
|
|||
Loading…
Reference in a new issue