B2: her own posted lines are never what she was sent; the quote guard and the echo check compare others' words only

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-20 22:53:38 +01:00
commit f6030974c0
2 changed files with 23 additions and 4 deletions

View file

@ -322,8 +322,9 @@ pub(crate) struct Packet {
/// The one room she may speak in this turn, and its kind.
pub room: Option<String>,
pub room_kind: RoomKind,
/// The bodies of the lines she was shown this turn, without speakers or rooms: a chat turn's messages and the earlier
/// lines from others its `heard` shows her (map 16.20.3), a beat's tail lines. What an echo is measured against.
/// The bodies of the lines others wrote that she was shown this turn, without speakers or rooms: a chat turn's messages
/// and the earlier lines from others its `heard` shows her (map 16.20.3), a beat's tail lines. Never a line of her own:
/// her posted words are not what she was sent (B2). What an echo and the quote guard are measured against.
pub bodies: Vec<String>,
/// The words of each private item this packet shows her as known privately: none of them may be said in this room.
pub private: Vec<String>,
@ -1956,9 +1957,11 @@ pub(crate) fn select(inputs: &Inputs, tuning: &Tuning) -> Packet {
// the notes.
let her = forms(inputs.state);
let mut context = Context::new(guards(tuning, her), her);
// Her own posted lines are never what she was sent: the quote guard and the echo check compare against others' words only.
let others = |line: &&RoomLine| line.sender != inputs.people.own_sender;
let bodies: Vec<String> = match inputs.kind {
TurnKind::Chat => inputs.room.messages.iter().chain(earlier_shown.iter().copied()).flat_map(|line| shown_words(line, inputs.people.own_sender)).collect(),
TurnKind::Beat => beat_tail(inputs, tuning).iter().flat_map(|line| shown_words(line, inputs.people.own_sender)).collect(),
TurnKind::Chat => inputs.room.messages.iter().chain(earlier_shown.iter().copied()).filter(others).flat_map(|line| shown_words(line, inputs.people.own_sender)).collect(),
TurnKind::Beat => beat_tail(inputs, tuning).iter().filter(others).flat_map(|line| shown_words(line, inputs.people.own_sender)).collect(),
TurnKind::FollowUp | TurnKind::Reflection => Vec::new(),
};
// What she may reply to (map 16.20.8 (D), K20): the lines of others in the turn's room whose words this packet shows

View file

@ -2629,3 +2629,19 @@ fn k23_her_domain_is_a_section_under_its_own_guard_with_ids_for_the_interpreter_
let quiet = packet_with_domain(&[], &tuning);
assert!(!quiet.context.contains("domain lately") && !interpret::speech_prompt(&quiet, "x", "y", &tuning).contains("domain lately"), "{}", quiet.context);
}
/// B2: her own posted lines are never what she was sent. A promise of hers whose words stand in the room as her own line
/// is shown, not withheld; someone else's words in the room still withhold a quote that repeats them (I16.7).
#[test]
fn b2_her_own_lines_never_withhold_her_promise_words() {
let mut room = chat_room();
room.messages.push(message("#swarm:gamecult.org", OWN, "Eureka", "Meta, I'll send the render tonight, part 0.", 30, false));
let packet = packet_of(TurnKind::Chat, &promising(1), &room, &History::default(), 1);
assert!(packet.context.contains("her promise: \"I'll send the render tonight, part 0.\"."), "{}", packet.context);
assert!(!packet.bodies.iter().any(|body| body.contains("part 0")), "{:?}", packet.bodies);
// Kiko saying the same words withholds them: others' words stay guarded.
let mut echoed = chat_room();
echoed.messages.push(message("#swarm:gamecult.org", "@kiko:gamecult.org", "Kiko", "she said she'll send the render tonight, part 0.", 1, false));
let packet = packet_of(TurnKind::Chat, &promising(1), &echoed, &History::default(), 1);
assert!(packet.context.contains("her promise: (her words, not shown here)."), "{}", packet.context);
}