diff --git a/crates/mind-body/src/projection/simulate.rs b/crates/mind-body/src/projection/simulate.rs index 804525c..d49e977 100644 --- a/crates/mind-body/src/projection/simulate.rs +++ b/crates/mind-body/src/projection/simulate.rs @@ -504,7 +504,7 @@ fn run(harness: &Harness, plan: &SimFile, members: &mut [Member], repeat: usize) rounds_of.resize(lines.len(), round); causes.resize(lines.len(), Some(cause)); held_to_schema(&member.entry.name, &id, &taken.state, &key)?; - let failed = taken.failed().map(str::to_owned); + let failed = taken.record["failed"].as_str().map(str::to_owned); // A line is seen by her only through a wake whose record carries a decision (K65, map 16.34.3): a failed wake // sees nothing, so its lines wake her again and show again, as the live mouth hands out a delivery until it is // acked. Only the room she read is seen. A later step that broke (`broke_after`) still sees: a decision stands. diff --git a/crates/mind-body/src/projection/turn.rs b/crates/mind-body/src/projection/turn.rs index 70b472f..5938c65 100644 --- a/crates/mind-body/src/projection/turn.rs +++ b/crates/mind-body/src/projection/turn.rs @@ -8,7 +8,7 @@ use std::cell::Cell; use chrono::{DateTime, Utc}; use serde_json::{Value, json}; -use super::commit::{self, Applied}; +use super::commit; use super::{Organs, Request, project}; use crate::chat_client::{Chat, ChatSendRequest, SendBasis}; @@ -73,13 +73,6 @@ pub(crate) struct Taken { pub state: Value, } -impl Taken { - /// The reason the turn failed, when it did: a failed call is a failure, never a silence. - pub(crate) fn failed(&self) -> Option<&str> { - self.record["failed"].as_str() - } -} - /// One turn: `project` through the Interpreter, each said line through `actuator.send`, each amendment through /// `actuator.edit`, the record of what happened, and the commit's application of her proposals to her state. `key` names /// the turn (`-t`). A failed turn sends nothing, amends nothing and applies nothing. diff --git a/crates/mind-body/src/projection/turn/tests.rs b/crates/mind-body/src/projection/turn/tests.rs index beafbe3..b47e0db 100644 --- a/crates/mind-body/src/projection/turn/tests.rs +++ b/crates/mind-body/src/projection/turn/tests.rs @@ -6,6 +6,7 @@ use serde_json::json; use super::*; use crate::chat_client::{ChatFetchReceipt, ChatFetchRequest, ChatOpenDirectReceipt, ChatOpenDirectRequest, ChatPending, ChatRead, ChatSendReceipt, Refusal}; +use crate::projection::commit::Applied; use crate::projection::harness::fixture_request; use crate::projection::harness::tests::{Scripted, control, harness, room}; use crate::projection::narrate::PROJECTOR_OPENING; @@ -116,7 +117,7 @@ fn t_l1_failed_turn_record() { let request = fixture_request(&harness, &fixture, Some(state.clone()), 3, Some(1), Through::Interpreter); let taken = take(&organs, &request, &mouth(&chat), "run-t1", fixture.now); assert!(chat.sent.borrow().is_empty(), "a failed turn sends nothing"); - assert_eq!(taken.failed(), Some("the provider failed the call: Overloaded")); + assert_eq!(taken.record["failed"].as_str(), Some("the provider failed the call: Overloaded")); let mut keys: Vec<&str> = taken.record.as_object().unwrap().keys().map(String::as_str).collect(); keys.retain(|key| !matches!(*key, "selected" | "at" | "committed")); assert_eq!(keys, ["failed"], "the record holds the failure alone beside what every record carries"); diff --git a/crates/mind-body/tests/public_surface.txt b/crates/mind-body/tests/public_surface.txt index 75baa66..3d85d43 100644 --- a/crates/mind-body/tests/public_surface.txt +++ b/crates/mind-body/tests/public_surface.txt @@ -331,6 +331,7 @@ mind_body::projection::select: impl Section mind_body::projection::select: impl std :: fmt :: Display for Who mind_body::projection::select: impl< 'a > Inputs < 'a > mind_body::projection::simulate: fn simulate (harness : & Harness , plan_path : & Path) -> Result < String > +mind_body::projection::simulate: impl Actuator for SimRoom < '_ > mind_body::projection::simulate: impl HeartbeatView for Names < '_ > mind_body::projection::simulate: impl MouthReader for View < '_ > mind_body::projection::simulate: impl ReadSource for CastReads < '_ > @@ -353,6 +354,7 @@ mind_body::projection::tuning: struct PoolCaps # [derive (Clone , Debug , Partia mind_body::projection::tuning: struct ProjectorTuning # [derive (Clone , Debug , PartialEq , Serialize , Deserialize)] pub-fields[model: String, guidance: String, words: usize, beat_words: usize] mind_body::projection::tuning: struct SelectTuning # [derive (Clone , Debug , PartialEq , Serialize , Deserialize)] pub-fields[temperature: f64, inclusion_score: f64, notes_bytes: usize, here_bytes: usize, outcome_bytes: usize, domain_bytes: usize, exchange_bytes: usize, stimulus_bytes: usize, heard_bytes: usize, addressed_bytes: usize, identity_bytes: usize, bond_summary_bytes: usize, item_bytes: usize, body_bytes: usize, freshness_base: f64, freshness_window: usize, people_full: usize, beat_tail_lines: usize, group_state: bool, group_lines: usize, group_bytes: usize, caps: PoolCaps] mind_body::projection::tuning: struct Tuning # [derive (Clone , Debug , PartialEq , Serialize , Deserialize)] pub-fields[projector: ProjectorTuning, persona: PersonaTuning, interpreter: InterpreterTuning, select: SelectTuning, lens: LensWeights, pronouns: BTreeMap < String , String >] +mind_body::projection::turn: impl Actuator for Mouth < '_ > mind_body::queue: fn on_hold (mind : & dyn MindPort) -> Result < Held > mind_body::queue: impl Held mind_body::queue: impl Held: fn contains (& self , item : & PipelineRef) -> bool