From 2adb09eff8aa80858ac0b0ffbe2ebf532754d414 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 20 Nov 2026 21:05:08 +0100 Subject: [PATCH] K20 fix-ups from the first Yggdrasil run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The Interpreter's frame keeps "as {poss} to pass on" and the pronoun-only wording; passing on is "replying to the line that carries them". - The turn line names no speech for the Projector (k21): "any of which can reply to one of the room's lines, which the room then shows above it with who wrote it". - The stimulus puts the reply after the room ("- Libby in #room, replying to Meta: …"), so a label's comma cannot run into it. - Tests: the packet's own labels; string escapes in place of raw newlines. Co-Authored-By: Claude Opus 5.5 --- .../src/projection/fixtures/golden-chat.txt | 4 ++-- crates/mind-body/src/projection/interpret.rs | 2 +- .../src/projection/interpret/tests.rs | 6 ++--- crates/mind-body/src/projection/select.rs | 4 ++-- .../src/projection/simulate/tests.rs | 2 +- crates/mind-body/src/projection/tests.rs | 24 +++++++------------ 6 files changed, 18 insertions(+), 24 deletions(-) diff --git a/crates/mind-body/src/projection/fixtures/golden-chat.txt b/crates/mind-body/src/projection/fixtures/golden-chat.txt index 0099ac3..085124c 100644 --- a/crates/mind-body/src/projection/fixtures/golden-chat.txt +++ b/crates/mind-body/src/projection/fixtures/golden-chat.txt @@ -10,7 +10,7 @@ Here and now: - pronouns: Libby — she/her; Kiko — she/her - the conversation: Lately Libby with her; Kiko to the room. Her body: -- this turn the room reaches her as typed lines, and she can answer in the turn's room by typing lines of her own, any of which can reply to a line in the room, shown above it with who said it; nothing she does here builds, changes or ships anything. +- this turn the room reaches her as typed lines, and she can answer in the turn's room by typing lines of her own, any of which can reply to one of the room's lines, which the room then shows above it with who wrote it; nothing she does here builds, changes or ships anything. People here, as she holds them: - bond [bond-libby] Libby — collaborator: fair trust, a little friction. Libby holds the sounds and teases her about the pipeline. Just now Libby turned to her, here. - bond [bond-kiko] Kiko — sparring partner: fair trust, heavy friction. Kiko pokes her to stop massaging the pipeline. @@ -54,7 +54,7 @@ Here and now: - pronouns: Libby — she/her; Kiko — she/her - the conversation: Lately Libby with her; Kiko to the room. Her body: -- this turn the room reaches her as typed lines, and she can answer in the turn's room by typing lines of her own, any of which can reply to a line in the room, shown above it with who said it; nothing she does here builds, changes or ships anything. +- this turn the room reaches her as typed lines, and she can answer in the turn's room by typing lines of her own, any of which can reply to one of the room's lines, which the room then shows above it with who wrote it; nothing she does here builds, changes or ships anything. People here, as she holds them: - bond [bond-libby] Libby — collaborator: fair trust, a little friction. Libby holds the sounds and teases her about the pipeline. Just now Libby turned to her, here. - bond [bond-kiko] Kiko — sparring partner: fair trust, heavy friction. Kiko pokes her to stop massaging the pipeline. diff --git a/crates/mind-body/src/projection/interpret.rs b/crates/mind-body/src/projection/interpret.rs index 4a3e0d3..94f9a4e 100644 --- a/crates/mind-body/src/projection/interpret.rs +++ b/crates/mind-body/src/projection/interpret.rs @@ -73,7 +73,7 @@ fn speech_frame_head(her: Forms) -> String { format!( "{SPEECH_OPENING}, from {poss} own prose. You never write {poss} words: you choose among {poss} drafts. -Below are who {subj} {be}, what {subj} can do here, the room and who is in it, what reached {obj}, {poss} lived moment, {poss} prose, and {poss} drafts. When {subj} write{s} words {subj} would type, {subj} set{s} them between {DRAFT_OPEN} and {DRAFT_CLOSE}: each is a draft, numbered below. Decide which of {poss} drafts {subj} choose{s} to send now, in this room. Only {poss} drafts can be said. Someone else's words in {poss} thought are never {poss} speech. A draft that carries someone else's words is said only when {poss} thought shows {subj} mean{s} to pass them on, and then as a reply to their line, which the room shows, with who said it, above {poss} own words." +Below are who {subj} {be}, what {subj} can do here, the room and who is in it, what reached {obj}, {poss} lived moment, {poss} prose, and {poss} drafts. When {subj} write{s} words {subj} would type, {subj} set{s} them between {DRAFT_OPEN} and {DRAFT_CLOSE}: each is a draft, numbered below. Decide which of {poss} drafts {subj} choose{s} to send now, in this room. Only {poss} drafts can be said. Someone else's words in {poss} thought are never {poss} speech. A draft that carries someone else's words is said only when {poss} thought shows {subj} mean{s} to pass them on, and then as {poss} to pass on, replying to the line that carries them, which the room shows, with who said it, above {poss} own words." ) } diff --git a/crates/mind-body/src/projection/interpret/tests.rs b/crates/mind-body/src/projection/interpret/tests.rs index 23d8194..7f9da6c 100644 --- a/crates/mind-body/src/projection/interpret/tests.rs +++ b/crates/mind-body/src/projection/interpret/tests.rs @@ -366,7 +366,7 @@ fn an_unknown_gap_kind_is_kept_as_unresolved() { #[test] fn the_interpreter_is_told_what_he_can_do_here_from_the_packets_affordances() { let prompt = speech_prompt(&packet(), "x", "y", &Tuning::default()); - assert!(prompt.contains("What he can do here:\nThis turn the room reaches him as typed lines, and he can answer in the turn's room by typing lines of his own, any of which can reply to a line in the room, shown above it with who said it; nothing he does here builds, changes or ships anything.\n\nThe room:"), "{prompt}"); + assert!(prompt.contains("What he can do here:\nThis turn the room reaches him as typed lines, and he can answer in the turn's room by typing lines of his own, any of which can reply to one of the room's lines, which the room then shows above it with who wrote it; nothing he does here builds, changes or ships anything.\n\nThe room:"), "{prompt}"); assert!(prompt.contains("missing_affordance when he means to do something, now or later, that his body cannot do (what he can do here is listed below)"), "{prompt}"); let mut listening = packet(); listening.affordances = vec![Affordance::Perceive]; @@ -422,12 +422,12 @@ fn k20_a_line_replies_only_to_a_listed_line_and_the_echo_check_still_holds() { let passing = pass_on_packet(); assert_eq!(passing.quotable.iter().map(|line| (line.id.as_str(), line.event.as_str())).collect::>(), [("q1", "$m1"), ("q2", "$k1")], "earlier lines first, then the new"); let prompt = speech_prompt(&passing, "x", "y", &Tuning::default()); - assert!(prompt.contains("Lines in this room he may reply to, as id \u{2014} who: line:\n- q1 \u{2014} Meta (@meta:gamecult.org): \"Nobody touches the release branch until I'm back. I mean it, all of you.\"\n- q2 \u{2014} Kiko (@kiko:gamecult.org): "), "{prompt}"); + assert!(prompt.contains("Lines in this room he may reply to, as id \u{2014} who: line:\n- q1 \u{2014} Meta, who runs the place: \"Nobody touches the release branch until I'm back. I mean it, all of you.\"\n- q2 \u{2014} Kiko: "), "{prompt}"); assert!(!prompt.contains("$m1") && !prompt.contains("$k1"), "the actuator's handle is never shown to a model"); assert!(prompt.contains("(`in_reply_to`, or null: the room shows that line, with who said it, above his own words)"), "{prompt}"); let prose = "This is what she said before she left."; let said = decided_in(&passing, prose, json!([{ "draft": 1, "in_reply_to": "q1" }])); - assert_eq!(said["said"][0]["in_reply_to"], json!({ "id": "q1", "event": "$m1", "who": "Meta (@meta:gamecult.org)", "text": "Nobody touches the release branch until I'm back. I mean it, all of you." }), "{said}"); + assert_eq!(said["said"][0]["in_reply_to"], json!({ "id": "q1", "event": "$m1", "who": "Meta, who runs the place", "text": "Nobody touches the release branch until I'm back. I mean it, all of you." }), "{said}"); assert_eq!(said["said"][0]["text"], "This is what she said before she left.", "his own words, and nothing code wrote"); for off in ["q9", "$m1"] { let refused = answered(&passing, prose, json!({ "say": [{ "draft": 1, "in_reply_to": off }], "gaps": [], "suggest": [{ "kind": "idea", "draft": 1, "about": null, "private": false }] })); diff --git a/crates/mind-body/src/projection/select.rs b/crates/mind-body/src/projection/select.rs index 0965e27..fcbfe49 100644 --- a/crates/mind-body/src/projection/select.rs +++ b/crates/mind-body/src/projection/select.rs @@ -904,7 +904,7 @@ fn chat_stimulus<'a>(inputs: &'a Inputs, tuning: &Tuning, present: &[(String, St let (to_her, others): (Vec<&RoomLine>, Vec<&RoomLine>) = messages.into_iter().partition(|line| line.to_her); let typed = |line: &RoomLine, body: &str| { let (above, replying) = reply_parts(line, inputs); - format!("{above}- {}{replying} in {}: {body}", name_of(line, inputs), line.room) + format!("{above}- {} in {}{replying}: {body}", name_of(line, inputs), line.room) }; // Heard lines are prose for the Persona: the speaker and the room from the mouth, then the escaped words; a reply with // the line it answers above it. @@ -1545,7 +1545,7 @@ pub(crate) fn turn_words(can: &[Affordance], her: Forms) -> String { let has = |affordance: Affordance| can.contains(&affordance); let clauses = [ if has(Affordance::Perceive) { format!("the room reaches {} as typed lines", her.obj) } else { format!("no room reaches {}", her.obj) }, - if has(Affordance::Speak) { format!("{} can answer in the turn's room by typing lines of {} own, any of which can reply to a line in the room, shown above it with who said it", her.subj, her.poss) } else { format!("{} can say nothing", her.subj) }, + if has(Affordance::Speak) { format!("{} can answer in the turn's room by typing lines of {} own, any of which can reply to one of the room's lines, which the room then shows above it with who wrote it", her.subj, her.poss) } else { format!("{} can say nothing", her.subj) }, ]; let clauses: Vec = clauses.into_iter().chain(has(Affordance::Suggest).then(|| format!("{} can leave Self a note", her.subj))).collect(); #[cfg(test)] diff --git a/crates/mind-body/src/projection/simulate/tests.rs b/crates/mind-body/src/projection/simulate/tests.rs index d577d44..3fa7b0c 100644 --- a/crates/mind-body/src/projection/simulate/tests.rs +++ b/crates/mind-body/src/projection/simulate/tests.rs @@ -547,7 +547,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 (@meta:gamecult.org): \"good afternoon, everyone\"\nTobiah (@eureka:gamecult.org), replying to Meta (@meta:gamecult.org), "), "{heard}"); + assert!(heard.contains("Just now:\n> Meta, who runs the place: \"good afternoon, everyone\"\n\"Tobiah\" (@eureka:gamecult.org), replying to Meta, who runs the place, in #minds:gamecult.org: \"She greeted all of us, Libby.\""), "{heard}"); } #[test] diff --git a/crates/mind-body/src/projection/tests.rs b/crates/mind-body/src/projection/tests.rs index af85c11..95a53eb 100644 --- a/crates/mind-body/src/projection/tests.rs +++ b/crates/mind-body/src/projection/tests.rs @@ -263,7 +263,7 @@ fn a_state_with_one_sense_renders_it_and_a_state_with_none_only_the_turn_line() let body = body_section(&packet); assert_eq!( body, - "Her body:\n- sense [sense-spectrogram] spectrogram hearing: Aqua hears by rendering a sound as a spectrogram and looking at it: she can feel its shape, where its weight sits, how long it rings. Not a human ear; a picture of a sound, not the sound.\n- this turn the room reaches her as typed lines, and she can answer in the turn's room by typing lines of her own, any of which can reply to a line in the room, shown above it with who said it; nothing she does here builds, changes or ships anything.\n", + "Her body:\n- sense [sense-spectrogram] spectrogram hearing: Aqua hears by rendering a sound as a spectrogram and looking at it: she can feel its shape, where its weight sits, how long it rings. Not a human ear; a picture of a sound, not the sound.\n- this turn the room reaches her as typed lines, and she can answer in the turn's room by typing lines of her own, any of which can reply to one of the room's lines, which the room then shows above it with who wrote it; nothing she does here builds, changes or ships anything.\n", "{}", packet.context ); @@ -285,9 +285,9 @@ fn a_state_with_one_sense_renders_it_and_a_state_with_none_only_the_turn_line() #[test] fn the_turn_line_is_derived_from_the_affordances_alone() { let her = select::forms(&state()); - assert_eq!(select::turn_words(&[Affordance::Perceive, Affordance::Speak], her), "this turn the room reaches her as typed lines, and she can answer in the turn's room by typing lines of her own, any of which can reply to a line in the room, shown above it with who said it; nothing she does here builds, changes or ships anything"); + assert_eq!(select::turn_words(&[Affordance::Perceive, Affordance::Speak], her), "this turn the room reaches her as typed lines, and she can answer in the turn's room by typing lines of her own, any of which can reply to one of the room's lines, which the room then shows above it with who wrote it; nothing she does here builds, changes or ships anything"); assert_eq!(select::turn_words(&[Affordance::Perceive], her), "this turn the room reaches her as typed lines, and she can say nothing; nothing she does here builds, changes or ships anything"); - assert_eq!(select::turn_words(&[Affordance::Speak], her), "this turn no room reaches her, and she can answer in the turn's room by typing lines of her own, any of which can reply to a line in the room, shown above it with who said it; nothing she does here builds, changes or ships anything"); + assert_eq!(select::turn_words(&[Affordance::Speak], her), "this turn no room reaches her, and she can answer in the turn's room by typing lines of her own, any of which can reply to one of the room's lines, which the room then shows above it with who wrote it; nothing she does here builds, changes or ships anything"); assert_eq!(select::turn_words(&[], her), "this turn no room reaches her, and she can say nothing; nothing she does here builds, changes or ships anything"); let them = select::forms(&json!({ "presentation": { "pronouns": "any" } })); assert!(select::turn_words(&[Affordance::Speak], them).ends_with("nothing they do here builds, changes or ships anything")); @@ -296,7 +296,7 @@ fn the_turn_line_is_derived_from_the_affordances_alone() { assert!(writes.ends_with(", and she can write") && !writes.contains("builds, changes or ships"), "{writes}"); // A note to Self is no write (map 16.19.6): the sentence stays with {perceive, speak, suggest}. let every = [Affordance::Perceive, Affordance::Speak, Affordance::Suggest]; - assert_eq!(select::turn_words(&every, her), "this turn the room reaches her as typed lines, and she can answer in the turn's room by typing lines of her own, any of which can reply to a line in the room, shown above it with who said it, and she can leave Self a note; nothing she does here builds, changes or ships anything"); + assert_eq!(select::turn_words(&every, her), "this turn the room reaches her as typed lines, and she can answer in the turn's room by typing lines of her own, any of which can reply to one of the room's lines, which the room then shows above it with who wrote it, and she can leave Self a note; nothing she does here builds, changes or ships anything"); assert!(!Affordance::Suggest.writes()); // The longest turn line and the heading fit the least body guard the tuning allows. for forms in [her, them, select::forms(&json!({ "presentation": { "pronouns": "he/him" } }))] { @@ -339,7 +339,7 @@ fn what_the_turn_can_do_comes_from_what_it_holds() { assert_eq!(can, json!(["suggest"])); let deaf = Deaf; let (body, can) = context(&Organs { chat: Some(&deaf), ..with }, Through::Interpreter); - assert!(body.contains("Her body:\n- this turn no room reaches her, and she can answer in the turn's room by typing lines of her own, any of which can reply to a line in the room, shown above it with who said it, and she can leave Self a note;"), "{body}"); + assert!(body.contains("Her body:\n- this turn no room reaches her, and she can answer in the turn's room by typing lines of her own, any of which can reply to one of the room's lines, which the room then shows above it with who wrote it, and she can leave Self a note;"), "{body}"); assert_eq!(can, json!(["speak", "suggest"])); let (body, can) = context(&with, Through::Persona); assert!(body.contains("Her body:\n- this turn the room reaches her as typed lines, and she can say nothing;"), "{body}"); @@ -2225,23 +2225,17 @@ fn k20_a_reply_shows_the_line_it_answers_above_it_in_another_minds_packet() { // Just now, and in the Interpreter's stimulus. let room = Room { messages: vec![reply(1, true)], tail: vec![message("#swarm:gamecult.org", OPERATOR, "Meta", META, 40, false)], here: Some("#swarm:gamecult.org".into()), ..Room::default() }; let packet = packet_of(TurnKind::Chat, &state(), &room, &History::default(), 1); - assert!(packet.heard.ends_with(&format!("Just now: -{quote} -Libby, replying to Meta, the operator, in #swarm:gamecult.org: \"This is what she said before she left.\"")), "{}", packet.heard); - assert!(packet.stimulus.contains(&format!("{quote} -- Libby, replying to Meta, the operator, in #swarm:gamecult.org: ")), "{}", packet.stimulus); + assert!(packet.heard.ends_with(&format!("Just now:\n{quote}\nLibby, replying to Meta, the operator, in #swarm:gamecult.org: \"This is what she said before she left.\"")), "{}", packet.heard); + assert!(packet.stimulus.contains(&format!("{quote}\n- Libby in #swarm:gamecult.org, replying to Meta, the operator: ")), "{}", packet.stimulus); assert!(packet.bodies.iter().any(|body| body == META), "the quoted words are words she was shown: {:?}", packet.bodies); assert!(!narrate::projector_prompt(&packet, &Tuning::default()).contains("SEALION"), "the Projector never sees the words"); // 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: -{quote} -Libby, 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, 5 min 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 }), ..reply(1, true) }], ..Room::default() }; - assert!(packet_of(TurnKind::Chat, &state(), &unquoted, &History::default(), 1).heard.starts_with("> Meta, the operator: (no words shown) -Libby, replying to Meta, the operator, in ")); + 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 ")); assert!(!packet_of(TurnKind::Chat, &state(), &chat_room(), &History::default(), 1).heard.contains("replying")); }