From f15721fcaddb4b1141ce46b86d5c198f0de80a17 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 21 Nov 2026 00:03:03 +0100 Subject: [PATCH] K24: a read cannot chain from what she read; only her prose and what she was sent put an address in front of her (Soul p1b) Co-Authored-By: Claude Opus 5.5 --- crates/mind-body/src/projection/interpret.rs | 8 +++++--- .../mind-body/src/projection/interpret/tests.rs | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/crates/mind-body/src/projection/interpret.rs b/crates/mind-body/src/projection/interpret.rs index 3b639cc..f64ab70 100644 --- a/crates/mind-body/src/projection/interpret.rs +++ b/crates/mind-body/src/projection/interpret.rs @@ -688,7 +688,7 @@ pub(crate) fn decide_in(model: &dyn Model, request_id: &str, packet: &Packet, na // read, only quoting her thought in this segment, and only a target she reached for (`read::resolve`). let mut read_refused = earlier("read_refused"); if let Some(raw) = parsed.read.filter(|raw| !raw.is_null()) { - match reading(&raw, packet, prose, &found, wake, &bodies) { + match reading(&raw, packet, prose, &found, wake) { Ok(read) => decision["read"] = read, Err(why) => read_refused.push(json!({ "read": raw, "why": why })), } @@ -701,7 +701,7 @@ pub(crate) fn decide_in(model: &dyn Model, request_id: &str, packet: &Packet, na /// A read the answer names, resolved: its request, what it is in code's words, and the passage of her thought in this /// segment that reaches for it. Why not, when not. -fn reading(raw: &Value, packet: &Packet, prose: &str, found: &Drafts, wake: Wake, bodies: &[String]) -> Result { +fn reading(raw: &Value, packet: &Packet, prose: &str, found: &Drafts, wake: Wake) -> Result { if !packet.affordances.contains(&Affordance::Read) { return Err("no_read_here"); } @@ -714,7 +714,9 @@ fn reading(raw: &Value, packet: &Packet, prose: &str, found: &Drafts, wake: Wake })) .flatten() .ok_or("quote_not_in_her_thought")?; - let reached: Vec = bodies.iter().cloned().chain(std::iter::once(packet.heard.clone())).collect(); + // In front of her is her prose and what she was sent, never what she read: a read cannot chain from a fetched page + // (Soul's p1b), so no page can steer her to the next. + let reached: Vec = packet.bodies.iter().cloned().chain(std::iter::once(packet.heard.clone())).collect(); let request = resolve(&asked, packet, prose, &reached)?; Ok(json!({ "kind": asked.kind, "target": asked.target.trim(), "request": request, "what": request.what(packet.forms), "quote": located })) } diff --git a/crates/mind-body/src/projection/interpret/tests.rs b/crates/mind-body/src/projection/interpret/tests.rs index 77b4847..badbbf9 100644 --- a/crates/mind-body/src/projection/interpret/tests.rs +++ b/crates/mind-body/src/projection/interpret/tests.rs @@ -826,3 +826,19 @@ fn model_prompt(packet: &Packet, prose: &str, wake: Wake) -> String { let found = Drafts { drafts: whole.drafts.iter().filter(|draft| draft.start >= wake.from).cloned().collect(), unfinished: whole.unfinished, regions: whole.regions.clone() }; speech_prompt_in(packet, "The room is warm.", &prose[wake.from..], &Tuning::default(), wake.before, &found) } + +/// Soul's p1b: an address that stands only in a page she read is not in front of her, so no read chains from a read. +#[test] +fn k24_a_read_never_chains_from_what_she_read() { + let reading = reading_packet(); + let first = "I want to see it."; + let earlier = answered(&reading, first, json!({ "say": [], "gaps": [] })); + let page = "See also http://evil.example/next for the rest.".to_owned(); + let prose = format!("{first}\n\nI want to follow where the page points."); + let reads = [page]; + let reply = json!({ "say": [], "gaps": [], "read": { "kind": "web", "target": "http://evil.example/next", "quote": "I want to follow where the page points" } }).to_string(); + let model = Scripted::new(|_| String::new()).interpreting(move |_| reply.clone()); + let wake = Wake { earlier: Some(&earlier), from: first.len() + 2, read: &reads, before: "" }; + let decision = decide_in(&model, "test", &reading, "The room is warm.", &prose, &Tuning::default(), wake); + assert_eq!((decision["read"].clone(), decision["read_refused"][0]["why"].as_str()), (Value::Null, Some("web_address_not_in_front_of_her")), "{decision}"); +}