K9: what came of her last turn opens her packet (map 16.16, 16.19.1, 16.19.10)

outcome::outcome_of derives it from one turn's record: the Interpreter's
decision under `interpreter`, the actuator's receipts under `posted`, or
`failed`. What she is told is outcome.rs's table, keyed by typed reasons
(interpret::Refusal, GapKind), in the packet's one person through her Forms;
a draft is shown as what she wrote, a located passage as her thought, and
an unlocated gap, an unnamed kind or a line without a receipt is omitted and
reported. No model text is told; outcome.rs writes nothing.

Select renders it first under its own guard (outcome_bytes 800, floor 256,
a fifth section); a line past the guard keeps its sentence with its quote
clipped, each later line keeping room. The Said pool loses her last turn's
lines. The Projector frame says once what the section is.

Request.last_outcome carries the record; the simulator keeps each persona's
last record (decision plus the lines its room appended, or the failure) and
passes it to her next turn; `mind-persona project --last-outcome <file>`
takes a fixture's. Four outcome fixtures under fixtures/harness/outcomes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-20 15:57:01 +01:00
commit 5958ab81cc
20 changed files with 619 additions and 52 deletions

View file

@ -0,0 +1,9 @@
{
"interpreter": {
"room": "!dm-meta:gamecult.org",
"said": [],
"refused": [],
"gaps": [{ "kind": "conditional", "from": "draft", "draft": 1, "words": "Honestly? Tired. Good tired, mostly.", "detail": "only if she asks again" }]
},
"posted": []
}

View file

@ -0,0 +1,9 @@
{
"interpreter": {
"room": "!dm-meta:gamecult.org",
"said": [],
"refused": [],
"gaps": [{ "kind": "missing_affordance", "from": "thought", "words": "I want to show her the render, not describe it.", "start_byte": 0, "end_byte": 48, "detail": "no way to attach a file" }]
},
"posted": []
}

View file

@ -0,0 +1,9 @@
{
"interpreter": {
"room": "!dm-meta:gamecult.org",
"said": [{ "room": "!dm-meta:gamecult.org", "text": "Missed you too. I'll send the render tonight.", "mentions": [], "reply_to": null, "rests_on": { "draft": 1, "start_byte": 9, "end_byte": 54 } }],
"refused": [],
"gaps": []
},
"posted": [{ "event": "$posted-1", "room": "!dm-meta:gamecult.org", "text": "Missed you too. I'll send the render tonight." }]
}

View file

@ -0,0 +1,9 @@
{
"interpreter": {
"room": "!dm-meta:gamecult.org",
"said": [],
"refused": [{ "draft": 1, "text": "I know where you live, and busy doesn't count as an answer.", "reason": "echo", "why": "mostly words she heard: an echo, not her speech" }],
"gaps": []
},
"posted": []
}

View file

@ -14,11 +14,12 @@
//! to it.
//!
//! `mind-persona project --instance <slug> [--endpoint rudp://<ip>:<port>] [--kind chat|beat|reflection] [--in <room>]
//! [--room <fixture.toml>] [--seed N] [--state <file>] [--select-only | --renders K [--through projector|persona|interpreter]
//! [--judge <state-file>]]` is the experiment tool over the Projector and the Persona stage
//! (`mind_body::projection::project`): it prints, as JSON, the packet the Select stage builds from her stored state (or
//! `--state`, checked as a put checks its content, rules P1 to P3; P4 and P5 compare it with the stored document and are
//! not checked), and with `--renders` the Projector's narrations of K successive turns;
//! [--room <fixture.toml>] [--seed N] [--state <file>] [--last-outcome <record.json>] [--select-only | --renders K
//! [--through projector|persona|interpreter] [--judge <state-file>]]` is the experiment tool over the Projector and the
//! Persona stage (`mind_body::projection::project`): it prints, as JSON, the packet the Select stage builds from her stored
//! state (or `--state`, checked as a put checks its content, rules P1 to P3; P4 and P5 compare it with the stored document
//! and are not checked), opened by what came of the turn `--last-outcome` records, and with `--renders` the Projector's
//! narrations of K successive turns;
//! `--through persona` adds her prose and `--through interpreter` what the Interpreter decides she says; `--judge` renders a second state too and asks
//! the model which narration came from which. It writes nothing and reads no brake.
//!
@ -53,7 +54,7 @@ use mind_body::projection::harness::{Fixture, Harness, batch, fixture_request, s
use mind_body::projection::{HuginnPersonaSource, KitModel, Model, MouthReader, Organs as ProjectOrgans, PersonaSource, Request as ProjectRequest, TUNING_FILE, TUNING_ROOT, Through, TurnKind, connector_key, project};
const USAGE: &str = "usage: mind-persona --instance <slug> [--endpoint rudp://<ip>:<port>] [--rooms a,b] [--operator id[,id]] [--minds id[,id]] [--self-sender id]";
const PROJECT_USAGE: &str = "usage: mind-persona project --instance <slug> [--endpoint rudp://<ip>:<port>] [--kind chat|beat|reflection] [--in <room>] [--room <fixture.toml>] [--seed N] [--state <file>] [--select-only | --renders K [--through projector|persona|interpreter] [--judge <state-file>]] | (--batch <plan> | --simulate <plan>) --out <report.md>";
const PROJECT_USAGE: &str = "usage: mind-persona project --instance <slug> [--endpoint rudp://<ip>:<port>] [--kind chat|beat|reflection] [--in <room>] [--room <fixture.toml>] [--seed N] [--state <file>] [--last-outcome <record.json>] [--select-only | --renders K [--through projector|persona|interpreter] [--judge <state-file>]] | (--batch <plan> | --simulate <plan>) --out <report.md>";
/// How long one call to the mind may take.
const TIMEOUT: Duration = Duration::from_secs(15);
/// How long the mouth may take to answer one read.
@ -87,6 +88,12 @@ fn credential(name: &str) -> Result<String> {
std::fs::read_to_string(required(name)?).with_context(|| format!("the file named by {name} could not be read"))
}
/// A turn record from a file (`--last-outcome`): JSON, the shape `project` reads what came of her last turn from.
fn record_file(path: &Path) -> Result<serde_json::Value> {
let text = std::fs::read_to_string(path).with_context(|| format!("{} could not be read", path.display()))?;
serde_json::from_str(&text).with_context(|| format!("{} is not JSON", path.display()))
}
/// The credentials directory systemd hands the unit; its absence names the variable.
#[allow(clippy::disallowed_methods, reason = "the binary reads its own environment, and hands it to the library")]
fn credentials_directory() -> Result<PathBuf> {
@ -95,7 +102,7 @@ fn credentials_directory() -> Result<PathBuf> {
fn run_project(args: &[String]) -> Result<String> {
let (mut kind, mut here, mut fixture, mut seed, mut state, mut renders, mut select_only, mut judge, mut through) = (None, None, None, None, None, None, false, None, Through::Projector);
let (mut batch_plan, mut simulate_plan, mut out, mut rest) = (None, None, None, Vec::new());
let (mut batch_plan, mut simulate_plan, mut out, mut last_outcome, mut rest) = (None, None, None, None, Vec::new());
let mut given = args.iter();
while let Some(flag) = given.next() {
let mut value = || given.next().cloned().ok_or_else(|| anyhow!("{PROJECT_USAGE}"));
@ -112,6 +119,7 @@ fn run_project(args: &[String]) -> Result<String> {
"--room" => fixture = Some(Fixture::load(Path::new(&value()?))?),
"--seed" => seed = Some(value()?.parse::<u64>().map_err(|_| anyhow!("{PROJECT_USAGE}"))?),
"--state" => state = Some(value()?),
"--last-outcome" => last_outcome = Some(value()?),
"--renders" => renders = Some(value()?.parse::<usize>().ok().filter(|k| *k > 0).ok_or_else(|| anyhow!("{PROJECT_USAGE}"))?),
"--judge" => judge = Some(value()?),
"--through" => {
@ -134,7 +142,7 @@ fn run_project(args: &[String]) -> Result<String> {
// A plan carries its own states, rooms, seeds and stage; a fixture carries its own kind and room.
if (select_only && (renders.is_some() || judge.is_some() || through != Through::Projector))
|| (batch_plan.is_some() && simulate_plan.is_some())
|| (planned && (out.is_none() || fixture.is_some() || state.is_some() || kind.is_some() || here.is_some() || seed.is_some() || renders.is_some() || judge.is_some() || select_only || through != Through::Projector))
|| (planned && (out.is_none() || fixture.is_some() || state.is_some() || last_outcome.is_some() || kind.is_some() || here.is_some() || seed.is_some() || renders.is_some() || judge.is_some() || select_only || through != Through::Projector))
|| (!planned && out.is_some())
|| (fixture.is_some() && (kind.is_some() || here.is_some()))
{
@ -163,11 +171,12 @@ fn run_project(args: &[String]) -> Result<String> {
}
let state = state.map(|path| state_file(Path::new(&path), &instance.0)).transpose()?;
let judge = judge.map(|path| state_file(Path::new(&path), &instance.0)).transpose()?;
let last_outcome = last_outcome.map(|path| record_file(Path::new(&path))).transpose()?;
let seed_now = u64::try_from(chrono::Utc::now().timestamp_millis()).unwrap_or_default();
if let Some(fixture) = &fixture {
// The fixture is the room, the clock and who is who: no mouth, no heartbeat table, no persona.env.
let organs = ProjectOrgans { persona: harness.persona, chat: Some(fixture), addressing: fixture.addressee(), model: harness.model };
let request = ProjectRequest { judge_against: judge, ..fixture_request(&harness, fixture, state, seed.unwrap_or(seed_now), renders, through) };
let request = ProjectRequest { judge_against: judge, last_outcome, ..fixture_request(&harness, fixture, state, seed.unwrap_or(seed_now), renders, through) };
return Ok(serde_json::to_string_pretty(&project(&organs, &request, fixture.now)?)?);
}
let chat = match (setting("BIFROST_CHAT_ENDPOINT"), setting("BIFROST_CHAT_KEY_FILE")) {
@ -200,6 +209,7 @@ fn run_project(args: &[String]) -> Result<String> {
last_heard: vec![],
recent: vec![],
own_rooms: vec![],
last_outcome,
};
let report = project(&organs, &request, chrono::Utc::now())?;
let addressing = &report["addressing"];

View file

@ -20,6 +20,7 @@
pub mod harness;
mod interpret;
mod narrate;
mod outcome;
mod select;
mod simulate;
mod tuning;
@ -191,6 +192,11 @@ pub struct Request {
pub recent: Vec<Vec<String>>,
/// The rooms that are hers, by the key the lines carry: a simulation's plan. The live body records none yet.
pub own_rooms: Vec<String>,
/// The record of her last turn, which her packet opens with what came of (`outcome::outcome_of`): the Interpreter's
/// decision under `interpreter` and the receipts of the lines that went out under `posted`, or `failed`. A
/// simulation carries each turn's to her next; a harness run takes a fixture's (`--last-outcome`). None live until
/// the commit's trace (C3c) carries it.
pub last_outcome: Option<Value>,
}
/// Her addressee: the heartbeat's row for her when its table holds one, else her own names (handle and public name).
@ -271,7 +277,7 @@ fn packet_json(packet: &Packet) -> Value {
"present": packet.present,
"selected": packet.selected,
// Each section's bytes under its own guard, and the sum the Projector is shown of her (map 16.19.4).
"bytes": { "identity": packet.identity().len(), "here": packet.sections.here, "body": packet.sections.body, "people": packet.sections.people, "notes": packet.sections.notes, "total": packet.identity().len() + packet.context.len(), "stimulus": packet.stimulus.len(), "heard": packet.heard.len() },
"bytes": { "identity": packet.identity().len(), "outcome": packet.sections.outcome, "here": packet.sections.here, "body": packet.sections.body, "people": packet.sections.people, "notes": packet.sections.notes, "total": packet.identity().len() + packet.context.len(), "stimulus": packet.stimulus.len(), "heard": packet.heard.len() },
"bound": packet.sections.bound,
"overflow": packet.overflow,
"clipped": packet.clipped,
@ -366,9 +372,9 @@ pub fn project(organs: &Organs, request: &Request, now: DateTime<Utc>) -> Result
Some(chat) => read_room(chat, request, &own),
None => (Room { here: request.room.clone(), last_heard: request.last_heard.clone(), own: request.own_rooms.clone(), ..Room::default() }, json!({ "read": false, "why": "no mouth is configured" })),
};
// Freshness and her own recent words come from trace v2, which the commit writes (C3c); until then only what the
// caller carried from earlier turns of its own.
let history = History { recent: request.recent.clone(), ..History::default() };
// Freshness, her own recent words and what came of her last turn come from trace v2, which the commit writes (C3c);
// until then only what the caller carried from earlier turns of its own.
let history = History { recent: request.recent.clone(), last: request.last_outcome.as_ref().and_then(outcome::outcome_of), ..History::default() };
let people = People { operators: &request.operators, minds: &request.minds, own_sender: &request.own_sender };
let inputs = Inputs { kind: request.kind, state: &state, room: &room, history: &history, observation: None, people, now, seed: request.seed, affordances: &[] };
let can = affordances(organs, room_report["read"] == true, turn_room(&inputs), request.through);
@ -382,6 +388,8 @@ pub fn project(organs: &Organs, request: &Request, now: DateTime<Utc>) -> Result
"room": room_report,
"addressing": addressing,
"history": if request.recent.is_empty() { json!("none: freshness and her own recent words come from trace v2, which the commit writes (C3c)") } else { json!({ "recent_projections": request.recent.len() }) },
// What she is told of her last turn, whole, and what of its record she is not told, and why.
"last_outcome": history.last.as_ref().map_or_else(|| json!("none"), |last| json!({ "told": last.lines(select::forms(&state)), "omitted": last.omitted })),
});
let Some(renders) = request.renders else {
report["packet"] = packet_json(&select(&inputs, tuning));

View file

@ -31,7 +31,7 @@ Kiko, in #swarm:gamecult.org: "She saw it. She hated it."
--- projector prompt
You are a private Projector. Write one person's present moment from inside it, in the first person and the present tense: the lived stream she will go on to continue in her own thought. Her interior is the point: what she feels, wants, fears and remembers, and how the people here sit with her, rendered as lived, not listed.
Render only what is established below: who she is, her present under its headings, and what reaches her. Anything absent from these is unavailable: render suspicion or speculation as uncertainty, never as remembered or perceived fact, and say plainly what is unknown rather than filling it. Furnish no place, object or event these do not give: no act or event of her own (nothing she did, drafted, sent or decided) and no line anyone said that is not below. Each heading says what its lines are. Here and now is the hour, how her mood leans when it does, and the room as it stands. Her body is how the moment reaches her and how she can answer it: it is not news to her, and a lack in it is felt only when the moment reaches for something it cannot do. The people here are as she holds them, not as those people are. The notes about her were set down at another time, by others and by her own past self: all of it is material for the stream and never its wording. How her words run is the stream's idiom, never its material: it shows in how the stream moves, and nothing in the stream remarks on it.
Render only what is established below: who she is, her present under its headings, and what reaches her. Anything absent from these is unavailable: render suspicion or speculation as uncertainty, never as remembered or perceived fact, and say plainly what is unknown rather than filling it. Furnish no place, object or event these do not give: no act or event of her own (nothing she did, drafted, sent or decided) and no line anyone said that is not below. Each heading says what its lines are. What came of her last turn is what came of what she last meant to do, which she is only now finding out: whenever something she meant did not happen, the stream begins from it, as she notices it, never as a list; when all of it happened, it may pass in a clause or not at all. Here and now is the hour, how her mood leans when it does, and the room as it stands. Her body is how the moment reaches her and how she can answer it: it is not news to her, and a lack in it is felt only when the moment reaches for something it cannot do. The people here are as she holds them, not as those people are. The notes about her were set down at another time, by others and by her own past self: all of it is material for the stream and never its wording. How her words run is the stream's idiom, never its material: it shows in how the stream moves, and nothing in the stream remarks on it.
Render the two or three notes this moment touches and leave the rest. Do not recap the notes or what reaches her. Do not weigh options, list what she might say or do, or steer toward a decision: end where the moment is, not on a resolution. Do not choose actions, emit schemas, expose field names or ids, or claim world effects.

View file

@ -334,6 +334,7 @@ pub fn fixture_request(harness: &Harness, fixture: &Fixture, state: Option<Value
last_heard: fixture.last_heard.clone(),
recent: vec![],
own_rooms: vec![],
last_outcome: None,
}
}

View file

@ -299,3 +299,24 @@ fn the_third_to_eighth_responder_sees_a_covered_question_and_no_duty() {
let golden = include_str!("../../../fixtures/harness/golden-chorus.txt").replace("\r\n", "\n");
assert_eq!(rendered, golden, "the chorus's group state moved; if deliberately, the new golden file is:\n{rendered}");
}
#[test]
fn soul_k9_each_outcome_fixture_opens_the_packet_with_his_words_verbatim() {
let dir = tempfile::tempdir().unwrap();
let fixture = room("operator-warm.toml");
for (file, told) in [
("posted.json", "- He said in !dm-meta:gamecult.org: \"Missed you too. I'll send the render tonight.\""),
("refused.json", "so they did not go out as his own. He wrote: \"I know where you live, and busy doesn't count as an answer.\""),
("conditional.json", "- He wrote words for !dm-meta:gamecult.org and did not say them. He wrote: \"Honestly? Tired. Good tired, mostly.\""),
("missing-affordance.json", "it is recorded as a request. In his thought: \"I want to show her the render, not describe it.\""),
] {
let record: Value = serde_json::from_str(&std::fs::read_to_string(fixtures().join("outcomes").join(file)).unwrap()).unwrap();
let organs = Organs { persona: None, chat: Some(&fixture), addressing: fixture.addressee(), model: None };
let request = Request { last_outcome: Some(record), ..fixture_request(&harness(dir.path(), None, None), &fixture, Some(control()), 1, None, Through::Projector) };
let report = project(&organs, &request, fixture.now).unwrap();
let context = report["packet"]["context"].as_str().unwrap();
let first = context.split("\nHere and now:\n").next().unwrap();
assert!(first.starts_with("What came of his last turn:\n") && first.contains(told), "{file}: {context}");
assert_eq!(report["last_outcome"]["omitted"], json!([]), "{file}");
}
}

View file

@ -141,9 +141,43 @@ pub(crate) fn drafts(prose: &str) -> Drafts {
found
}
/// Why code held back a draft she had cited, typed: what she is told next turn (`outcome`) is keyed by it, never by text
/// (map 16.16). `why` is its words for the report.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub(crate) enum Refusal {
/// The turn has no room, so nothing is said in one.
NoRoom,
/// The number names no draft she set down: the Interpreter's error, nothing of hers.
NoDraft,
/// The draft already went somewhere this turn.
Used,
/// Mostly the words she had just heard.
Echo,
/// Past the lines one turn may say.
OverLines,
}
impl Refusal {
fn why(self) -> &'static str {
match self {
Self::NoRoom => "the turn has no room to speak in",
Self::NoDraft => "it names no draft she set down",
Self::Used => "one draft goes one place: it was already used",
Self::Echo => "mostly words she heard: an echo, not her speech",
Self::OverLines => "past the lines one turn may say",
}
}
}
/// A refused act in the report: the draft, its words when it names one, and the typed reason with its words.
fn refused(draft: Option<&Draft>, cited: Option<i64>, reason: Refusal) -> Value {
json!({ "draft": draft.map_or_else(|| json!(cited), |draft| json!(draft.n)), "text": draft.map(|draft| draft.text.as_str()), "reason": reason, "why": reason.why() })
}
/// What a gap is (map 16.16, 16.19): words she meant and did not send now, and why. Typed by code from the model's
/// `kind`; a kind the contract does not name is kept as `Unresolved` and reported, never dropped.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub(crate) enum GapKind {
/// She drafted something she might say, and has not chosen to.
@ -298,30 +332,30 @@ pub(crate) fn decide(model: &dyn Model, request_id: &str, packet: &Packet, narra
decision["unfinished"] = json!(prose[open + DRAFT_OPEN.len()..].trim());
}
let Some(room) = packet.room.clone() else {
decision["refused"] = json!([{ "why": "the turn has no room to speak in" }]);
decision["refused"] = json!([{ "reason": Refusal::NoRoom, "why": Refusal::NoRoom.why() }]);
return decision;
};
let shown = |id: &str| packet.people.iter().any(|(_, person)| person == id);
let mut said: Vec<Value> = Vec::new();
let mut refused = Vec::new();
let mut refusals = Vec::new();
let mut used: Vec<usize> = Vec::new();
for line in parsed.say {
let Some(draft) = line.draft.and_then(|n| found.numbered(n)) else {
refused.push(json!({ "draft": line.draft, "why": "it names no draft she set down" }));
refusals.push(refused(None, line.draft, Refusal::NoDraft));
continue;
};
let why = if used.contains(&draft.n) {
Some("one draft goes one place: it was already used")
let reason = if used.contains(&draft.n) {
Some(Refusal::Used)
} else if echo(&draft.text, &packet.bodies) {
Some("mostly words she heard: an echo, not her speech")
Some(Refusal::Echo)
} else if said.len() >= MAX_LINES {
Some("past the lines one turn may say")
Some(Refusal::OverLines)
} else {
None
};
used.push(draft.n);
if let Some(why) = why {
refused.push(json!({ "draft": draft.n, "text": draft.text, "why": why }));
if let Some(reason) = reason {
refusals.push(refused(Some(draft), None, reason));
continue;
}
let (mentions, unknown): (Vec<String>, Vec<String>) = line.mentions.into_iter().partition(|id| shown(id));
@ -335,9 +369,9 @@ pub(crate) fn decide(model: &dyn Model, request_id: &str, packet: &Packet, narra
decision["room"] = json!(room);
decision["room_kind"] = json!(packet.room_kind);
decision["said"] = json!(said);
decision["refused"] = json!(refused);
decision["refused"] = json!(refusals);
decision
}
#[cfg(test)]
mod tests;
pub(crate) mod tests;

View file

@ -38,7 +38,7 @@ fn heimdall() -> Value {
/// Soul's round: Nibu said the economy is the least built part, and Meta greeted Nibu; this is Heimdall's turn. Void is
/// a Mind of the swarm who said nothing.
fn packet() -> Packet {
pub(crate) fn packet() -> Packet {
let room = Room {
messages: vec![
line(MINDS, NIBU, "Nibu", "v0.2.0 is tagged and the economy is still the least built part. I think this looks okay to ship.", false),
@ -51,7 +51,7 @@ fn packet() -> Packet {
}
/// The decision when the recorded Interpreter answers exactly `answer`.
fn answered(packet: &Packet, prose: &str, answer: Value) -> Value {
pub(crate) fn answered(packet: &Packet, prose: &str, answer: Value) -> Value {
let reply = answer.to_string();
let model = Scripted::new(|_| String::new()).interpreting(move |_| reply.clone());
decide(&model, "test", packet, "The room is warm.", prose, &Tuning::default())

View file

@ -147,7 +147,8 @@ pub(crate) fn word_budget(kind: TurnKind, tuning: &Tuning) -> usize {
/// unknown rather than filling it, no recap, never choose actions, emit schemas, expose field names or claim world
/// effects, and the word budget. Dropped: its ban on temperament, mood and inner voice, "no metaphor, no atmosphere",
/// "say only what changes the decision" and "a thin moment gets a thin stream". Added: the first person and the present
/// tense; what the packet's headings mean (map 16.5, I16.4); that the notes are material,
/// tense; what the packet's headings mean (map 16.5, I16.4); that what came of her last turn is news she is only now
/// finding out, rendered as noticed and never as a list (map 16.16); that the notes are material,
/// never wording, and how her words run (under its own heading, map 16.19.3) is idiom, never material; that her body is how the
/// moment is perceived, not news, and a lack in it is felt only when the moment reaches for it (map 16.6); no invented act, event or
/// line of hers or anyone's; focus on two or three notes (map 16.8: the frame owns focus, the byte caps are guards); and
@ -159,7 +160,7 @@ pub(crate) fn projector_frame(her: Forms) -> String {
format!(
"{PROJECTOR_OPENING} Write one person's present moment from inside it, in the first person and the present tense: the lived stream {subj} will go on to continue in {poss} own thought. {cap_poss} interior is the point: what {subj} feel{s}, want{s}, fear{s} and remember{s}, and how the people here sit with {obj}, rendered as lived, not listed.
Render only what is established below: who {subj} {be}, {poss} present under its headings, and what reaches {obj}. Anything absent from these is unavailable: render suspicion or speculation as uncertainty, never as remembered or perceived fact, and say plainly what is unknown rather than filling it. Furnish no place, object or event these do not give: no act or event of {poss} own (nothing {subj} did, drafted, sent or decided) and no line anyone said that is not below. Each heading says what its lines are. Here and now is the hour, how {poss} mood leans when it does, and the room as it stands. {cap_poss} body is how the moment reaches {obj} and how {subj} can answer it: it is not news to {obj}, and a lack in it is felt only when the moment reaches for something it cannot do. The people here are as {subj} hold{s} them, not as those people are. The notes about {obj} were set down at another time, by others and by {poss} own past self: all of it is material for the stream and never its wording. How {poss} words run is the stream's idiom, never its material: it shows in how the stream moves, and nothing in the stream remarks on it.
Render only what is established below: who {subj} {be}, {poss} present under its headings, and what reaches {obj}. Anything absent from these is unavailable: render suspicion or speculation as uncertainty, never as remembered or perceived fact, and say plainly what is unknown rather than filling it. Furnish no place, object or event these do not give: no act or event of {poss} own (nothing {subj} did, drafted, sent or decided) and no line anyone said that is not below. Each heading says what its lines are. What came of {poss} last turn is what came of what {subj} last meant to do, which {subj} {be} only now finding out: whenever something {subj} meant did not happen, the stream begins from it, as {subj} notice{s} it, never as a list; when all of it happened, it may pass in a clause or not at all. Here and now is the hour, how {poss} mood leans when it does, and the room as it stands. {cap_poss} body is how the moment reaches {obj} and how {subj} can answer it: it is not news to {obj}, and a lack in it is felt only when the moment reaches for something it cannot do. The people here are as {subj} hold{s} them, not as those people are. The notes about {obj} were set down at another time, by others and by {poss} own past self: all of it is material for the stream and never its wording. How {poss} words run is the stream's idiom, never its material: it shows in how the stream moves, and nothing in the stream remarks on it.
Render the two or three notes this moment touches and leave the rest. Do not recap the notes or what reaches {obj}. Do not weigh options, list what {subj} might say or do, or steer toward a decision: end where the moment is, not on a resolution. Do not choose actions, emit schemas, expose field names or ids, or claim world effects."
)

View file

@ -0,0 +1,158 @@
//! What came of her last turn (map 16.16, as amended by 16.19): what she meant to do, and what happened, which she finds
//! out only now. She acts only by intent in her prose; the Interpreter and the actuator turn it into effects she never
//! sees, so her next packet opens with them, first and under its own guard (`select`).
//!
//! `outcome_of` derives it from one turn's record, and nothing else writes it: no persona-state field, no file. The
//! record is the Interpreter's decision unchanged under `interpreter`, with the actuator's receipts beside it under
//! `posted` (each line that went out: `{event, room, text}`), or `failed` when the turn broke off. The simulator builds
//! it from a turn's report and the lines its room appended; live, it is the C3c commit's trace record, which must carry
//! that shape.
//!
//! What she is told is this module's table, keyed by typed reasons (`Refusal`, `GapKind`), in the packet's one person
//! (her `Forms`). Model text is never what she is told: a gap's `detail` is not read. Her words are shown only as what
//! they are: a draft (she wrote it) or a located passage of her thought. What she cannot be told truly is omitted and
//! reported: an unlocated gap, a kind the contract does not name, a line the record holds no receipt for.
use serde_json::Value;
use super::interpret::{GapKind, Refusal};
use super::select::{Forms, clip, spoken};
/// A line of hers that went out, as the actuator's receipt names it.
#[derive(Clone, Debug, PartialEq, Eq)]
pub(crate) struct Posted {
/// The actuator's handle on the line: the mouth's event id live, the line's index in the simulated room.
pub event: String,
pub room: String,
pub text: String,
}
/// Her words as she is shown them: a draft she wrote, or a passage of her thought.
#[derive(Clone, Debug, PartialEq, Eq)]
enum Quote {
Wrote(String),
Thought(String),
}
/// One thing that came of her last turn, by its typed reason.
#[derive(Clone, Debug, PartialEq, Eq)]
enum Part {
Said { room: String, text: String },
Refused(Refusal, String),
Gap { kind: GapKind, room: Option<String>, quote: Quote },
Unfinished(String),
Failed,
}
/// What came of her last turn: what she is told, what she is not and why, and the lines that went out.
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub(crate) struct Outcome {
parts: Vec<Part>,
/// What the record held that she is not told, and why: reported, never shown to her.
pub omitted: Vec<String>,
pub posted: Vec<Posted>,
}
fn words(value: &Value) -> Option<String> {
value.as_str().map(str::trim).filter(|text| !text.is_empty()).map(str::to_owned)
}
/// What came of the turn `record` records; None when there is no record. A record with nothing to tell (a chosen silence,
/// nothing drafted, nothing reached for) is an empty outcome, and no section is rendered from it.
pub(crate) fn outcome_of(record: &Value) -> Option<Outcome> {
if !record.is_object() {
return None;
}
let mut outcome = Outcome::default();
let decision = &record["interpreter"];
if record.get("failed").is_some() || decision.get("failed").is_some() {
outcome.parts.push(Part::Failed);
return Some(outcome);
}
let room = words(&decision["room"]);
for receipt in record["posted"].as_array().into_iter().flatten() {
let (Some(event), Some(room), Some(text)) = (words(&receipt["event"]), words(&receipt["room"]), words(&receipt["text"])) else {
outcome.omitted.push(format!("a receipt without its event, room or text: {receipt}"));
continue;
};
outcome.parts.push(Part::Said { room: room.clone(), text: text.clone() });
outcome.posted.push(Posted { event, room, text });
}
for line in decision["said"].as_array().into_iter().flatten() {
let went = outcome.posted.iter().any(|posted| Some(posted.room.as_str()) == line["room"].as_str() && Some(posted.text.as_str()) == line["text"].as_str());
if !went {
outcome.omitted.push(format!("a line said with no receipt that it went out: {}", line["text"]));
}
}
for refusal in decision["refused"].as_array().into_iter().flatten() {
match (serde_json::from_value::<Refusal>(refusal["reason"].clone()), words(&refusal["text"])) {
(Ok(reason @ (Refusal::Echo | Refusal::OverLines)), Some(text)) => outcome.parts.push(Part::Refused(reason, text)),
_ => outcome.omitted.push(format!("a refusal that is no act of hers: {}", refusal["why"])),
}
}
for gap in decision["gaps"].as_array().into_iter().flatten() {
let kind = serde_json::from_value::<GapKind>(gap["kind"].clone()).unwrap_or(GapKind::Unresolved);
let quote = match (gap["from"].as_str(), words(&gap["words"])) {
(Some("draft"), Some(text)) => Some(Quote::Wrote(text)),
(Some("thought"), Some(text)) => Some(Quote::Thought(text)),
_ => None,
};
match quote {
Some(quote) if kind != GapKind::Unresolved => outcome.parts.push(Part::Gap { kind, room: room.clone(), quote }),
_ => outcome.omitted.push(format!("a gap she cannot be shown truly (kind {}, from {}): {}", gap["kind"], gap["from"], gap["quote"])),
}
}
if let Some(text) = words(&decision["unfinished"]) {
outcome.parts.push(Part::Unfinished(text));
}
Some(outcome)
}
impl Part {
/// The line she is told: the table's sentence, in her pronouns, then her words, held to `quote_max` bytes.
fn line(&self, her: Forms, quote_max: usize) -> String {
let Forms { subj, cap_subj, poss, .. } = her;
let quoted = |text: &str| spoken(&clip(text, quote_max));
let shown = |quote: &Quote| match quote {
Quote::Wrote(text) => format!("{cap_subj} wrote: {}", quoted(text)),
Quote::Thought(text) => format!("In {poss} thought: {}", quoted(text)),
};
match self {
Self::Said { room, text } => format!("- {cap_subj} said in {room}: {}", quoted(text)),
Self::Refused(Refusal::Echo, text) => format!("- These were mostly the words {subj} had just heard, so they did not go out as {poss} own. {}", shown(&Quote::Wrote(text.clone()))),
Self::Refused(_, text) => format!("- {cap_subj} had already said enough that turn; this did not go out. {}", shown(&Quote::Wrote(text.clone()))),
Self::Gap { kind, room, quote } => {
let sentence = match kind {
GapKind::Conditional => format!("{cap_subj} wrote words for {} and did not say them.", room.as_deref().unwrap_or("the room")),
GapKind::Addressee => format!("{cap_subj} meant this for someone, and it was unclear whom; nothing reached them."),
GapKind::Elsewhere => format!("{cap_subj} meant this for another room or another time; nothing reached anyone."),
GapKind::MissingAffordance => format!("{cap_subj} reached for this; there is no way to do it from a chat turn yet; it is recorded as a request."),
GapKind::Unwritten | GapKind::Unresolved => format!("{cap_subj} meant to say something and did not write the words {subj} would type, so nothing went out."),
};
format!("- {sentence} {}", shown(quote))
}
Self::Unfinished(text) => format!("- The turn ended before {subj} finished writing it; it did not go out. {}", shown(&Quote::Wrote(text.clone()))),
Self::Failed => format!("- Nothing came of {poss} last moment: it broke off before anything happened, not by {poss} choice."),
}
}
}
impl Outcome {
/// How many lines she is told: none for a chosen silence.
pub(crate) fn len(&self) -> usize {
self.parts.len()
}
/// The `at`th line she is told, its quotes held to `quote_max` bytes.
pub(crate) fn line(&self, at: usize, her: Forms, quote_max: usize) -> String {
self.parts[at].line(her, quote_max)
}
/// Every line she is told, whole.
pub(crate) fn lines(&self, her: Forms) -> Vec<String> {
(0..self.len()).map(|at| self.line(at, her, usize::MAX)).collect()
}
}
#[cfg(test)]
mod tests;

View file

@ -0,0 +1,109 @@
use serde_json::{Value, json};
use super::*;
use crate::projection::interpret::tests::{answered, packet};
const MINDS: &str = "#minds:gamecult.org";
/// Heimdall's record of a turn whose Interpreter answered `answer` over `prose`, with the room's receipts for `posted`.
fn record(prose: &str, answer: Value, posted: &[&str]) -> Value {
let decision = answered(&packet(), prose, answer);
let posted: Vec<Value> = posted.iter().enumerate().map(|(at, text)| json!({ "event": format!("{}", 40 + at), "room": MINDS, "text": text })).collect();
json!({ "interpreter": decision, "posted": posted })
}
/// What Heimdall (he/him) is told of `record`, and what is omitted.
fn told(record: &Value) -> (Vec<String>, Vec<String>) {
let outcome = outcome_of(record).expect("a record");
(outcome.lines(packet().forms), outcome.omitted)
}
#[test]
fn a_line_that_went_out_is_told_verbatim_where_it_went() {
let (lines, omitted) = told(&record("I nod. <typed>Hi Nibu.\n\nGood tag.</typed>", json!({ "say": [{ "draft": 1 }], "gaps": [] }), &["Hi Nibu.\n\nGood tag."]));
assert_eq!(lines, ["- He said in #minds:gamecult.org: \"Hi Nibu.\\n\\nGood tag.\""], "escaped as every packet line is");
assert!(omitted.is_empty(), "{omitted:?}");
}
#[test]
fn a_refused_echo_and_a_line_past_the_turns_lines_are_told_with_her_draft() {
let (echo, _) = told(&record("<typed>The economy is still the least-built part!</typed> I say it back.", json!({ "say": [{ "draft": 1 }], "gaps": [] }), &[]));
assert_eq!(echo, ["- These were mostly the words he had just heard, so they did not go out as his own. He wrote: \"The economy is still the least-built part!\""]);
let (over, _) = told(&record("<typed>One.</typed> <typed>Two.</typed> <typed>Three.</typed>", json!({ "say": [{ "draft": 1 }, { "draft": 2 }, { "draft": 3 }], "gaps": [] }), &["One.", "Two."]));
assert_eq!(over[2], "- He had already said enough that turn; this did not go out. He wrote: \"Three.\"", "{over:?}");
}
#[test]
fn a_gap_is_told_by_its_kind_with_a_draft_as_written_and_a_thought_as_thought() {
let prose = "If Kiko asks again: <typed>Fine, you win.</typed> I want to see the shape of that sound. I'll tell Meta I'm fine, more or less.";
let gaps = json!([
{ "kind": "conditional", "draft": 1, "quote": null, "detail": "only if asked" },
{ "kind": "missing_affordance", "draft": null, "quote": "I want to see the shape of that sound.", "detail": "MODEL-DETAIL he has no spectrogram" },
{ "kind": "unwritten", "draft": null, "quote": "I'll tell Meta I'm fine, more or less.", "detail": "" },
{ "kind": "elsewhere", "draft": null, "quote": "tell", "detail": "" },
]);
let (lines, omitted) = told(&record(prose, json!({ "say": [], "gaps": gaps }), &[]));
assert_eq!(
lines,
[
"- He wrote words for #minds:gamecult.org and did not say them. He wrote: \"Fine, you win.\"",
"- He reached for this; there is no way to do it from a chat turn yet; it is recorded as a request. In his thought: \"I want to see the shape of that sound.\"",
"- He meant to say something and did not write the words he would type, so nothing went out. In his thought: \"I'll tell Meta I'm fine, more or less.\"",
]
);
assert!(lines.iter().all(|line| !line.contains("MODEL-DETAIL")), "the model's detail is never what he is told");
assert_eq!(omitted.len(), 1, "the unlocated gap is omitted and reported: {omitted:?}");
assert!(omitted[0].contains("\"tell\""), "{omitted:?}");
}
#[test]
fn an_unfinished_draft_and_a_failed_turn_are_told_as_what_they_were() {
let (lines, _) = told(&record("<typed>I was about to tell you that", json!({ "say": [], "gaps": [] }), &[]));
assert_eq!(lines, ["- The turn ended before he finished writing it; it did not go out. He wrote: \"I was about to tell you that\""]);
let failed = "- Nothing came of his last moment: it broke off before anything happened, not by his choice.";
assert_eq!(told(&json!({ "failed": "the provider failed the call: Overloaded" })).0, [failed]);
assert_eq!(told(&json!({ "interpreter": { "failed": "the answer is not the speech contract" }, "posted": [] })).0, [failed]);
}
#[test]
fn a_chosen_silence_tells_her_nothing_and_no_record_is_no_outcome() {
let silent = outcome_of(&record("The quiet is fine. I let it be.", json!({ "say": [], "gaps": [] }), &[])).unwrap();
assert_eq!((silent.len(), silent.omitted.len()), (0, 0));
assert_eq!(outcome_of(&Value::Null), None);
}
#[test]
fn a_line_said_with_no_receipt_is_not_told_as_said() {
let (lines, omitted) = told(&record("<typed>Hi.</typed>", json!({ "say": [{ "draft": 1 }], "gaps": [] }), &[]));
assert!(lines.is_empty(), "nothing says it went out: {lines:?}");
assert!(omitted[0].contains("no receipt"), "{omitted:?}");
}
#[test]
fn the_table_speaks_of_her_in_her_own_pronouns() {
let outcome = outcome_of(&record("<typed>Hi.</typed> <typed>There.</typed> <typed>Again.</typed>", json!({ "say": [{ "draft": 1 }, { "draft": 2 }, { "draft": 3 }], "gaps": [] }), &["Hi.", "There."])).unwrap();
for (pronouns, line) in [("she/her", "- She had already said enough that turn"), ("any", "- They had already said enough that turn")] {
let her = crate::projection::select::forms(&json!({ "presentation": { "pronouns": pronouns } }));
assert!(outcome.lines(her)[2].starts_with(line), "{pronouns}: {:?}", outcome.lines(her));
}
}
#[test]
fn no_other_source_builds_her_outcome_and_this_one_writes_nothing() {
let own = include_str!("../outcome.rs");
for write in ["PersonaPut", "persona_put", "Admit", "admit("] {
assert!(!own.contains(write), "outcome.rs reaches a write: {write}");
}
for (name, source) in [
("select.rs", include_str!("../select.rs")),
("narrate.rs", include_str!("../narrate.rs")),
("interpret.rs", include_str!("../interpret.rs")),
("simulate.rs", include_str!("../simulate.rs")),
("harness.rs", include_str!("../harness.rs")),
("projection.rs", include_str!("../../projection.rs")),
] {
for told in ["recorded as a request", "broke off before anything happened", "did not go out"] {
assert!(!source.contains(told), "{name} builds outcome text: {told}");
}
}
}

View file

@ -4,7 +4,8 @@
//! The Projector shows her self and her room: her persona state and what the mouth showed. Her Mind is not read
//! here; reaching into it is the Interpreter's, through its read tools, when wondering leads to reading.
//!
//! Every packet carries its fixed slots: identity, the hour, her mood when it leans, her body (`body_lines`: her senses
//! Every packet carries its fixed slots: what came of her last turn when there is one (`outcome`, first), identity, the
//! hour, her mood when it leans, her body (`body_lines`: her senses
//! and actuators from `embodiment`, and what this turn can do from `Affordance`), a bond line for each person
//! present, the group state (who has been talking to whom, `group_line`), and the stimulus. The rest comes from her
//! state's pools. The context is rendered in headed sections (`Section`), each saying what kind of text its lines are,
@ -33,6 +34,7 @@ use serde_json::Value;
use unicode_segmentation::UnicodeSegmentation;
use super::Affordance;
use super::outcome::Outcome;
use super::tuning::{LensWeights, Tuning};
use crate::address::localpart;
@ -52,6 +54,8 @@ const NAME_BYTES: usize = 80;
const ALSO_HERE_BYTES: usize = 300;
/// A body entry the guard would cut to this many bytes or fewer says nothing, and is left out.
const BODY_ENTRY_MIN: usize = 40;
/// The fewest bytes of her words an outcome line past its guard keeps: less says nothing, and the line is left out.
const OUTCOME_QUOTE_MIN: usize = 40;
/// Her pronouns as the packet speaks of her (from `presentation.pronouns`: he, she, or they for anything else, "any"
/// included), with the verb forms that agree with them.
@ -149,14 +153,17 @@ pub(crate) struct Said {
pub at: DateTime<Utc>,
}
/// What earlier turns left: the ids each of the last projections selected, oldest first, what she said, and her state
/// at her last turn (movement is measured against it). The commit's trace v2 (C3c) is its source; until then it is
/// empty.
/// What earlier turns left: the ids each of the last projections selected, oldest first, what she said, her state at her
/// last turn (movement is measured against it), and what came of her last turn (`outcome`, from its record). The commit's
/// trace v2 (C3c) is its source; until then only what a caller carried: the simulation's earlier turns, a harness
/// fixture's record.
#[derive(Clone, Debug, Default, PartialEq)]
pub(crate) struct History {
pub recent: Vec<Vec<String>>,
/// Each line's `id` is the event its receipt named, the one the outcome's `posted` carries.
pub said: Vec<Said>,
pub previous: Option<Value>,
pub last: Option<Outcome>,
}
/// Who the people of a room are to her.
@ -613,7 +620,9 @@ fn candidates(inputs: &Inputs, tuning: &Tuning, present: &BTreeSet<String>, touc
push(id, Pool::Value, Scope::Plain, &one_line(text(value, &["summary"])), &line, number(value, &["priority"]).unwrap_or(SALIENCE_UNSTATED), relevance, TOUCH_ELSE, 1.0);
}
for said in &inputs.history.said {
// Her last turn's lines are the outcome's to show, not this pool's.
let last_posted = |said: &&Said| inputs.history.last.as_ref().is_none_or(|last| !last.posted.iter().any(|posted| posted.event == said.id));
for said in inputs.history.said.iter().filter(last_posted) {
let touch = if Some(said.room.as_str()) == here { TOUCH_ROOM } else { TOUCH_ELSE };
// What she said in a direct message is private about its partner: shown only there, still only the two of them.
let partner = direct(inputs, &said.room).then(|| Concerns::Partner(said.room.clone()));
@ -1332,6 +1341,8 @@ fn body_lines(state: &Value, can: &[Affordance], her: Forms, body_bytes: usize)
/// text its lines are; the Projector's frame says once what the headings mean.
#[derive(Clone, Copy)]
enum Section {
/// What came of her last turn (`outcome`, map 16.16): first, so she meets it before anything else.
Outcome,
/// The hour, her mood, the room as it stands.
Here,
/// Her senses and actuators, and what this turn can do: how the moment reaches her and how she can answer.
@ -1345,6 +1356,7 @@ enum Section {
impl Section {
fn heading(self, her: Forms) -> String {
match self {
Self::Outcome => format!("What came of {} last turn:", her.poss),
Self::Here => "Here and now:".into(),
Self::Body => format!("{} body:", capitalized(her.poss)),
Self::People => format!("People here, as {} hold{} them:", her.subj, her.s),
@ -1359,15 +1371,18 @@ const BOND_HEAD_BYTES: usize = 80;
/// The guard of each section, in `Section` order (map 16.19.4, I16.8): the tuning's, and the people's derived from the
/// bonds a packet shows in full. No section's guard is another's, so no section's content can displace another's.
fn guards(tuning: &Tuning) -> [usize; 4] {
fn guards(tuning: &Tuning) -> [usize; SECTIONS] {
let select = &tuning.select;
[select.here_bytes, select.body_bytes, select.people_full.saturating_mul(select.bond_summary_bytes.saturating_add(BOND_HEAD_BYTES)), select.notes_bytes]
[select.outcome_bytes, select.here_bytes, select.body_bytes, select.people_full.saturating_mul(select.bond_summary_bytes.saturating_add(BOND_HEAD_BYTES)), select.notes_bytes]
}
const SECTIONS: usize = 5;
/// The bytes each section of the context took as rendered, its heading included, and the sections whose guard refused a
/// line: what `--select-only` reports.
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize)]
pub(crate) struct Sections {
pub outcome: usize,
pub here: usize,
pub body: usize,
pub people: usize,
@ -1378,17 +1393,17 @@ pub(crate) struct Sections {
/// The context in headed sections, each under its own guard, which counts its heading with its lines. A heading with no
/// lines is left out.
struct Context {
sections: [(String, Vec<String>); 4],
guards: [usize; 4],
sections: [(String, Vec<String>); SECTIONS],
guards: [usize; SECTIONS],
/// Each section's rendered bytes plus one: its heading and each line count their newlines.
used: [usize; 4],
used: [usize; SECTIONS],
/// Whether a section's guard refused a line.
bound: [bool; 4],
bound: [bool; SECTIONS],
}
impl Context {
fn new(guards: [usize; 4], her: Forms) -> Self {
Self { sections: [Section::Here, Section::Body, Section::People, Section::Notes].map(|section| (section.heading(her), Vec::new())), guards, used: [0; 4], bound: [false; 4] }
fn new(guards: [usize; SECTIONS], her: Forms) -> Self {
Self { sections: [Section::Outcome, Section::Here, Section::Body, Section::People, Section::Notes].map(|section| (section.heading(her), Vec::new())), guards, used: [0; SECTIONS], bound: [false; SECTIONS] }
}
fn cost(&self, section: Section, line: &str) -> usize {
@ -1396,6 +1411,16 @@ impl Context {
line.len() + 1 + if lines.is_empty() { heading.len() + 1 } else { 0 }
}
/// The bytes a section's guard has left.
fn room(&self, section: Section) -> usize {
(self.guards[section as usize] + 1).saturating_sub(self.used[section as usize])
}
/// How far a line is past its section's guard: 0 when it fits.
fn over(&self, section: Section, line: &str) -> usize {
self.cost(section, line).saturating_sub(self.room(section))
}
/// Adds a line whether or not it fits: only the hour and the mood, which the floor of `here_bytes` leaves room for,
/// and the body's lines, which `body_lines` held to `body_bytes` itself.
fn force(&mut self, section: Section, line: String) {
@ -1405,7 +1430,7 @@ impl Context {
/// Adds a line if it fits its section's guard; a line that would pass it is refused whole, and the section is bound.
fn push(&mut self, section: Section, line: String) -> bool {
let fits = self.used[section as usize] + self.cost(section, &line) <= self.guards[section as usize] + 1;
let fits = self.over(section, &line) == 0;
if fits {
self.force(section, line);
} else {
@ -1420,8 +1445,8 @@ impl Context {
fn sizes(&self) -> Sections {
let bytes = |section: Section| self.used[section as usize].saturating_sub(1);
let names = ["here", "body", "people", "notes"];
Sections { here: bytes(Section::Here), body: bytes(Section::Body), people: bytes(Section::People), notes: bytes(Section::Notes), bound: names.into_iter().zip(self.bound).filter_map(|(name, bound)| bound.then_some(name)).collect() }
let names = ["outcome", "here", "body", "people", "notes"];
Sections { outcome: bytes(Section::Outcome), here: bytes(Section::Here), body: bytes(Section::Body), people: bytes(Section::People), notes: bytes(Section::Notes), bound: names.into_iter().zip(self.bound).filter_map(|(name, bound)| bound.then_some(name)).collect() }
}
}
@ -1441,6 +1466,27 @@ pub(crate) fn select(inputs: &Inputs, tuning: &Tuning) -> Packet {
// the notes.
let her = forms(inputs.state);
let mut context = Context::new(guards(tuning), her);
// What came of her last turn, first and under its own guard, so nothing else can crowd it out. A line past the guard
// keeps its sentence and has its quote clipped, leaving each later line room for its sentence and the least quote:
// she is told every part, shortened when it must be.
if let Some(outcome) = &inputs.history.last {
let least: Vec<usize> = (0..outcome.len()).map(|at| outcome.line(at, her, OUTCOME_QUOTE_MIN).len() + 1).collect();
for at in 0..outcome.len() {
let reserve: usize = least[at + 1..].iter().sum();
let past = |context: &Context, line: &str| (context.cost(Section::Outcome, line) + reserve).saturating_sub(context.room(Section::Outcome));
let mut line = outcome.line(at, her, usize::MAX);
let mut quote_max = line.len();
while past(&context, &line) > 0 && quote_max > OUTCOME_QUOTE_MIN {
quote_max = quote_max.saturating_sub(past(&context, &line)).max(OUTCOME_QUOTE_MIN);
line = outcome.line(at, her, quote_max);
context.bound[Section::Outcome as usize] = true;
if !clipped.iter().any(|id| id == "(outcome)") {
clipped.push("(outcome)".to_owned());
}
}
context.push(Section::Outcome, line);
}
}
let present = present_people(inputs, tuning);
let present_ids: BTreeSet<String> = present.iter().map(|(id, _)| id.clone()).collect();
let bonds = items(inputs.state, &["affect", "socialBonds"]);

View file

@ -12,6 +12,10 @@
//! her again next round: no line is seen without a turn that read it. The turns of a round go in an order drawn from
//! the seed, each against the room as it stands at that turn.
//!
//! What came of each of her turns opens her next packet (map 16.16): the simulator keeps each turn's record as the commit's
//! trace will (the Interpreter's decision and the lines the room appended for her), and passes it as her next turn's
//! `last_outcome`; a failed turn's record is a failure.
//!
//! Her state does not move during a run: the Interpreter (C3b) and the commit (C3c) are not built. `state_after_turn`
//! is the seam where they will. An explicit addressee (the Interpreter naming whom she speaks to) cannot be simulated
//! until then either: a spoken line addresses another persona only by the names in its text.
@ -344,6 +348,8 @@ fn run(harness: &Harness, plan: &SimFile, members: &mut [Member], repeat: usize)
let mut last_turn: Vec<Option<DateTime<Utc>>> = vec![None; members.len()];
let mut last_beat = plan.start;
let mut recent: Vec<Vec<Vec<String>>> = vec![Vec::new(); members.len()];
// Each persona's last turn's record, as the commit's trace will hold it: what came of it opens her next packet.
let mut last: Vec<Option<Value>> = vec![None; members.len()];
let mut turns = Vec::new();
let mut counter = 0u64;
for round in 1..=plan.rounds {
@ -399,6 +405,7 @@ fn run(harness: &Harness, plan: &SimFile, members: &mut [Member], repeat: usize)
last_heard: vec![],
recent: recent[at].clone(),
own_rooms: member.entry.own_rooms.clone(),
last_outcome: last[at].take(),
};
let view = View { lines: &lines, viewer: &id, rooms: &member.rooms, seen: &seen[at] };
let names = Names(&member.addressee);
@ -417,6 +424,8 @@ fn run(harness: &Harness, plan: &SimFile, members: &mut [Member], repeat: usize)
let said: Vec<Value> = if failed.is_some() { vec![] } else { render["interpreter"]["said"].as_array().cloned().unwrap_or_default() };
let cause = cause_word(why.as_ref().map(|why| why.cause));
let mut spoken: Vec<String> = Vec::new();
// The room's receipts: each line it appended, by its index, which serves as its event.
let mut posted: Vec<Value> = Vec::new();
for (offset, decided) in said.iter().enumerate() {
let room = decided["room"].as_str().unwrap_or(&here).to_owned();
let says = decided["text"].as_str().unwrap_or_default().to_owned();
@ -424,11 +433,16 @@ fn run(harness: &Harness, plan: &SimFile, members: &mut [Member], repeat: usize)
let reply_to = decided["reply_to"].as_str().and_then(|person| lines.iter().rposition(|line| line.from == person && line.room == room));
let at_ms = u64::try_from(now.timestamp_millis()).unwrap_or_default() + offset as u64;
let to = if room == here { dm_to.clone() } else { None };
posted.push(json!({ "event": lines.len().to_string(), "room": room, "text": says }));
lines.push(Line { from: id.clone(), name: member.entry.name.clone(), room, at_ms, says: says.clone(), mentions, dm_to: to, follow_up: false, reply_to, new: false });
rounds_of.push(round);
causes.push(Some(cause));
spoken.push(says);
}
last[at] = Some(match &failed {
Some(failed) => json!({ "failed": failed }),
None => json!({ "interpreter": render["interpreter"], "posted": posted }),
});
let line = (!spoken.is_empty()).then(|| spoken.join(" / "));
let outcome = if failed.is_some() { "failed" } else if line.is_some() { "spoke" } else { "silent" };
let (how, by) = why.map_or((None, vec![]), |why| (why.how, why.by));
@ -613,6 +627,7 @@ fn markdown(plan_path: &Path, plan: &SimFile, members: &[Member], group_state: O
let mut out = String::new();
let _ = writeln!(out, "# Swarm simulation\n");
let _ = writeln!(out, "> **State does not evolve during a run.** The Interpreter (C3b) and the commit (C3c) are not built, so every persona starts each turn from the state the plan gave her. `state_after_turn` in `projection/simulate.rs` is the seam where they will move it between rounds. Freshness carries over: each persona's earlier packets in the run count against repeating an item.\n");
let _ = writeln!(out, "> **What came of her last turn opens her next packet.** Each persona's turn record (the Interpreter's decision and the lines the room appended for her) is carried to her next turn, as the commit's trace will carry it live; a turn's details show what she was told of it.\n");
let _ = writeln!(out, "> **Speech is the Interpreter's.** What she says is decided from her prose by the Interpreter's speech step (C3b, one tool-less structured call), held by code to her prose: each line rests on a verbatim span of it, in a room she may speak in, and is never someone else's words. Its structured mentions and reply target are the only explicit addressees; an `@` in the text tags no one.\n");
let _ = writeln!(out, "- plan: `{}`", plan_path.display());
let _ = writeln!(out, "- cast: {}", members.iter().map(|member| format!("{} (`{}`, `{}`, names from {})", member.entry.name, member.entry.id, member.entry.state.display(), member.names_from)).collect::<Vec<_>>().join(", "));
@ -685,6 +700,9 @@ fn markdown(plan_path: &Path, plan: &SimFile, members: &[Member], group_state: O
if let Some(error) = report.get("error") {
let _ = writeln!(out, "**failed:** {}\n", error.as_str().unwrap_or_default());
} else {
if let Some(told) = report["last_outcome"]["told"].as_array().filter(|told| !told.is_empty()) {
let _ = writeln!(out, "What came of her last turn:\n\n````text\n{}\n````\n", told.iter().filter_map(Value::as_str).collect::<Vec<_>>().join("\n"));
}
let _ = writeln!(out, "Stimulus:\n\n````text\n{}\n````\n", report["packet"]["stimulus"].as_str().unwrap_or_default());
turn_markdown(&mut out, &report["renders"][0]);
}

View file

@ -415,3 +415,54 @@ fn soul_f5_three_rooms_open_at_once_take_three_rounds_not_one() {
}
}
}
/// Tobiah speaks a numbered line each turn and reaches, in his thought, for a numbered shape his body cannot render;
/// the recorded Interpreter sends the line and records the reach as a gap. Libby answers each time.
fn reaching() -> Scripted {
let turn = std::cell::Cell::new(0usize);
Scripted::new(move |prompt| {
if !is_tobiah(prompt) {
return "<typed>mm</typed>".into();
}
turn.set(turn.get() + 1);
format!("<typed>line {}</typed> I want to see shape number {} right now.", turn.get(), turn.get())
})
.interpreting(|prompt| {
if !prompt.contains("Who he is:\nTobiah") {
return crate::projection::harness::tests::drafted_lines(prompt);
}
let start = prompt.rfind("I want to see shape number").unwrap();
let quote = &prompt[start..=start + prompt[start..].find('.').unwrap()];
json!({ "say": [{ "draft": 1, "mentions": [], "reply_to": null }], "gaps": [{ "kind": "missing_affordance", "draft": null, "quote": quote, "detail": "" }] }).to_string()
})
}
#[test]
fn soul_k9_each_turn_opens_with_what_came_of_her_last_and_only_her_last() {
let dir = tempfile::tempdir().unwrap();
let model = reaching();
let (_, run) = run_plan(&plan(dir.path(), "\"all_messages\"", 6, ""), &model);
let projected: Vec<String> = model.calls.borrow().iter().map(|(_, prompt)| prompt.clone()).filter(|prompt| prompt.starts_with(PROJECTOR_OPENING) && prompt.contains("Who he is:\nTobiah")).take(3).collect();
assert_eq!(projected.len(), 3, "{}", run["turns"]);
assert!(!projected[0].contains("What came of his last turn:"), "a first turn has no last: {}", projected[0]);
for (at, prompt) in projected.iter().enumerate().skip(1) {
let (last, other) = (at, if at == 1 { 2 } else { 1 });
assert!(prompt.contains(&format!("What came of his last turn:\n- He said in #minds:gamecult.org: \"line {last}\"\n- He reached for this;")), "turn {}: {prompt}", at + 1);
assert!(prompt.contains(&format!("In his thought: \"I want to see shape number {last} right now.\"")), "turn {}: {prompt}", at + 1);
assert!(!prompt.contains(&format!("shape number {other}")), "turn {} carries only his last turn's: {prompt}", at + 1);
}
// The run's report shows what he was told.
let tobiah: Vec<&Value> = run["turns"].as_array().unwrap().iter().filter(|turn| turn["persona"] == "Tobiah").collect();
assert_eq!(tobiah[1]["report"]["last_outcome"]["told"].as_array().unwrap().len(), 2, "{}", tobiah[1]["report"]["last_outcome"]);
}
#[test]
fn soul_k9_a_failed_turn_is_told_as_a_failure_next_turn() {
let dir = tempfile::tempdir().unwrap();
let (_, run) = run_plan(&plan(dir.path(), "\"ruled\"", 3, "beat_s = 120"), &FailingPersona);
let later: Vec<&Value> = run["turns"].as_array().unwrap().iter().filter(|turn| turn["round"].as_u64() > Some(1)).collect();
assert!(!later.is_empty(), "{}", run["turns"]);
for turn in later {
assert_eq!(turn["report"]["last_outcome"]["told"], json!(["- Nothing came of his last moment: it broke off before anything happened, not by his choice."]), "{turn}");
}
}

View file

@ -119,10 +119,10 @@ fn within_guards(packet: &Packet, tuning: &Tuning) {
let select = &tuning.select;
let sections = &packet.sections;
assert!(packet.identity().len() <= select.identity_bytes, "identity {}", packet.identity().len());
for (name, bytes, guard) in [("here", sections.here, select.here_bytes), ("body", sections.body, select.body_bytes), ("people", sections.people, select.people_full * (select.bond_summary_bytes + 80)), ("notes", sections.notes, select.notes_bytes)] {
for (name, bytes, guard) in [("outcome", sections.outcome, select.outcome_bytes), ("here", sections.here, select.here_bytes), ("body", sections.body, select.body_bytes), ("people", sections.people, select.people_full * (select.bond_summary_bytes + 80)), ("notes", sections.notes, select.notes_bytes)] {
assert!(bytes <= guard, "{name}: {bytes} bytes over its guard of {guard}:\n{}", packet.context);
}
let shown: Vec<usize> = [sections.here, sections.body, sections.people, sections.notes].into_iter().filter(|bytes| *bytes > 0).collect();
let shown: Vec<usize> = [sections.outcome, sections.here, sections.body, sections.people, sections.notes].into_iter().filter(|bytes| *bytes > 0).collect();
assert_eq!(shown.iter().sum::<usize>() + shown.len().saturating_sub(1), packet.context.len(), "the reported bytes are the rendered ones");
}
@ -936,7 +936,7 @@ impl PersonaSource for Stored {
}
fn request(dir: &std::path::Path, renders: Option<usize>, judge_against: Option<Value>) -> Request {
Request { instance: INSTANCE.into(), kind: TurnKind::Chat, state: None, room: Some("#swarm:gamecult.org".into()), seed: 5, renders, judge_against, operators: operators(), minds: minds(), own_sender: OWN.into(), tuning: dir.join(TUNING_FILE), through: Through::Projector, last_heard: vec![], recent: vec![], own_rooms: vec![] }
Request { instance: INSTANCE.into(), kind: TurnKind::Chat, state: None, room: Some("#swarm:gamecult.org".into()), seed: 5, renders, judge_against, operators: operators(), minds: minds(), own_sender: OWN.into(), tuning: dir.join(TUNING_FILE), through: Through::Projector, last_heard: vec![], recent: vec![], own_rooms: vec![], last_outcome: None }
}
#[test]
@ -1360,7 +1360,7 @@ fn select_only_reports_each_sections_bytes_the_total_and_what_bound() {
let report = project(&Organs { persona: Some(&stored), chat: Some(&chat), addressing: None, model: None }, &request(dir.path(), None, None), now()).unwrap();
let bytes = &report["packet"]["bytes"];
let context = report["packet"]["context"].as_str().unwrap();
for section in ["identity", "here", "body", "people", "notes", "total", "stimulus", "heard"] {
for section in ["identity", "outcome", "here", "body", "people", "notes", "total", "stimulus", "heard"] {
assert!(bytes[section].is_u64(), "{section}: {bytes}");
}
assert_eq!(bytes["total"].as_u64().unwrap() as usize, bytes["identity"].as_u64().unwrap() as usize + context.len(), "{bytes}");
@ -1420,6 +1420,7 @@ fn every_range_is_validated_on_its_own() {
refused(&|t| t.select.memory_tau_h = f64::NAN, "select.memory_tau_h");
refused(&|t| t.select.here_bytes = tuning::HERE_ROOM_MIN - 1, "select.here_bytes");
refused(&|t| t.select.body_bytes = tuning::BODY_ROOM_MIN - 1, "select.body_bytes");
refused(&|t| t.select.outcome_bytes = tuning::OUTCOME_ROOM_MIN - 1, "select.outcome_bytes");
refused(&|t| t.select.identity_bytes = usize::MAX, "select.identity_bytes");
refused(&|t| t.select.notes_bytes = 32 * 1024 + 1, "select.notes_bytes");
refused(&|t| t.lens.wondering = -1.0, "lens");
@ -1435,6 +1436,7 @@ fn every_range_is_validated_on_its_own() {
// Each guard at its floor, and no guard measured against another's: a large identity beside small sections is fine.
edge.select.body_bytes = tuning::BODY_ROOM_MIN;
edge.select.here_bytes = tuning::HERE_ROOM_MIN;
edge.select.outcome_bytes = tuning::OUTCOME_ROOM_MIN;
edge.select.identity_bytes = 32 * 1024;
edge.select.notes_bytes = 1;
edge.select.temperature = 0.01;
@ -1915,6 +1917,66 @@ fn what_she_said_in_a_direct_message_stays_in_it() {
assert!((1..=60).any(|seed| packet_of(TurnKind::Chat, &state(), &chat_room(), &public, seed).context.contains("SAIDDM")), "a public line is shared");
}
/// A record of her last turn: one line that went out in #swarm, and a reach for what her body cannot do.
fn last_turn(said: &str) -> Value {
json!({
"interpreter": { "room": "#swarm:gamecult.org", "said": [{ "room": "#swarm:gamecult.org", "text": said }], "refused": [], "gaps": [{ "kind": "missing_affordance", "from": "thought", "words": "I want to hear the kettle for myself." }] },
"posted": [{ "event": "said-last", "room": "#swarm:gamecult.org", "text": said }],
})
}
fn with_last(record: &Value) -> History {
History { last: outcome::outcome_of(record), ..History::default() }
}
#[test]
fn what_came_of_her_last_turn_opens_the_packet_under_its_own_guard() {
let packet = packet_of(TurnKind::Chat, &state(), &chat_room(), &with_last(&last_turn("Sending the file now.")), 1);
assert!(
packet.context.starts_with("What came of her last turn:\n- She said in #swarm:gamecult.org: \"Sending the file now.\"\n- She reached for this; there is no way to do it from a chat turn yet; it is recorded as a request. In her thought: \"I want to hear the kettle for myself.\"\nHere and now:\n"),
"{}",
packet.context
);
within_guards(&packet, &Tuning::default());
// Every other section at its floor, the notes at one byte: what came of her last turn is not crowded out.
let mut tight = Tuning::default();
(tight.select.here_bytes, tight.select.body_bytes, tight.select.notes_bytes, tight.select.bond_summary_bytes) = (tuning::HERE_ROOM_MIN, tuning::BODY_ROOM_MIN, 1, 1);
let tight_packet = packet_tuned(TurnKind::Chat, &state(), &chat_room(), &with_last(&last_turn("Sending the file now.")), 1, &tight);
assert!(tight_packet.context.starts_with(&packet.context[..packet.context.find("Here and now:").unwrap()]), "{}", tight_packet.context);
// A line past its guard keeps its sentence, its quote clipped to the room left, and is reported.
let long = packet_of(TurnKind::Chat, &state(), &chat_room(), &with_last(&last_turn(&"word ".repeat(400))), 1);
let first = long.context.lines().nth(1).unwrap();
assert!(first.starts_with("- She said in #swarm:gamecult.org: \"word word") && first.ends_with("…\""), "{first}");
assert!(long.context.lines().nth(2).unwrap().starts_with("- She reached for this;"), "the long line leaves the next its room: {}", long.context);
assert!(long.clipped.contains(&"(outcome)".to_owned()) && long.sections.bound.contains(&"outcome"), "{:?} {:?}", long.clipped, long.sections.bound);
within_guards(&long, &Tuning::default());
}
#[test]
fn a_chosen_silence_opens_no_section_and_no_record_none() {
let silence = json!({ "interpreter": { "room": "#swarm:gamecult.org", "said": [], "refused": [], "gaps": [] }, "posted": [] });
for history in [with_last(&silence), History::default()] {
let packet = packet_of(TurnKind::Chat, &state(), &chat_room(), &history, 1);
assert!(packet.context.starts_with("Here and now:\n"), "{}", packet.context);
}
}
#[test]
fn her_last_turns_line_is_the_outcomes_and_not_the_said_pools() {
let said = super::select::Said { id: "said-last".into(), room: "#swarm:gamecult.org".into(), text: "SAIDLAST the file is coming.".into(), at: now() - chrono::Duration::minutes(5) };
let pooled = |history: &History| (1..=60).any(|seed| packet_of(TurnKind::Chat, &state(), &chat_room(), history, seed).selected.iter().any(|pick| pick.id == "said-last"));
assert!(pooled(&History { said: vec![said.clone()], ..History::default() }), "a line of hers is in the pool");
assert!(!pooled(&History { said: vec![said], ..with_last(&last_turn("SAIDLAST the file is coming.")) }), "her last turn's line is the outcome's to show");
}
#[test]
fn the_frame_says_once_what_the_outcome_is_in_her_own_pronouns() {
for (pronouns, sentence) in [("she/her", "What came of her last turn is what came of what she last meant to do, which she is only now finding out"), ("he/him", "What came of his last turn is what came of what he last meant to do, which he is only now finding out"), ("any", "which they are only now finding out: whenever something they meant did not happen, the stream begins from it, as they notice it, never as a list")] {
let frame = narrate::projector_frame(select::forms(&json!({ "presentation": { "pronouns": pronouns } })));
assert_eq!(frame.matches(sentence).count(), 1, "{pronouns}: {frame}");
}
}
#[test]
fn soul_f6_a_mind_is_one_person_by_her_handle_or_her_full_matrix_id() {
let kiko_here = Room { messages: vec![message("#minds:gamecult.org", "@kiko:gamecult.org", "Kiko", "hi all", 2, false)], here: Some("#minds:gamecult.org".into()), ..Room::default() };

View file

@ -30,6 +30,8 @@ const GUIDANCE: &str = "This person is a Mind of the GameCult swarm. {cap_subj}
/// The least `here_bytes` may be: the heading, the hour and the longest mood line always fit.
pub(crate) const HERE_ROOM_MIN: usize = 256;
/// The least `outcome_bytes` may be: the heading and the longest line without her words (a failed turn's) always fit.
pub(crate) const OUTCOME_ROOM_MIN: usize = 256;
/// The least `body_bytes` may be: the body heading, the longest turn line (`select::turn_words`) and one entry at the
/// standard's upper target always fit.
pub(crate) const BODY_ROOM_MIN: usize = 768;
@ -126,6 +128,8 @@ pub struct SelectTuning {
/// Here and now, in bytes, heading included: the hour and the mood always; then, while they fit, the pronouns, the
/// conversation (`group_bytes`) and the names of the people present without a bond line.
pub here_bytes: usize,
/// What came of her last turn, in bytes, heading included: taken first, under its own guard (map 16.16).
pub outcome_bytes: usize,
pub stimulus_bytes: usize,
/// What was said to her, verbatim, for the Persona stage.
pub heard_bytes: usize,
@ -221,6 +225,7 @@ impl Default for SelectTuning {
inclusion_score: 0.5,
notes_bytes: 5120,
here_bytes: 768,
outcome_bytes: 800,
stimulus_bytes: 1500,
heard_bytes: 1500,
addressed_bytes: 8 * 1024,
@ -302,6 +307,7 @@ impl Tuning {
for (name, bytes) in [
("select.notes_bytes", select.notes_bytes),
("select.here_bytes", select.here_bytes),
("select.outcome_bytes", select.outcome_bytes),
("select.stimulus_bytes", select.stimulus_bytes),
("select.heard_bytes", select.heard_bytes),
("select.identity_bytes", select.identity_bytes),
@ -332,6 +338,9 @@ impl Tuning {
if select.here_bytes < HERE_ROOM_MIN {
bail!("select.here_bytes must be at least {HERE_ROOM_MIN}, not {}: the hour and the mood always fit", select.here_bytes);
}
if select.outcome_bytes < OUTCOME_ROOM_MIN {
bail!("select.outcome_bytes must be at least {OUTCOME_ROOM_MIN}, not {}: what came of her last turn always has room", select.outcome_bytes);
}
let lens = &self.lens;
let weights = [lens.body_and_hour, lens.person_present, lens.unresolved_want, lens.memory_surfacing, lens.wondering];
if weights.iter().any(|weight| !weight.is_finite() || *weight < 0.0) || lens.body_and_hour <= 0.0 {

View file

@ -250,7 +250,7 @@ mind_body::projection: pub use select :: TurnKind ;
mind_body::projection: pub use tuning :: { TUNING_FILE , TUNING_ROOT } ;
mind_body::projection: struct HuginnPersonaSource pub-fields[]
mind_body::projection: struct Organs< 'a > pub-fields[persona: Option < & 'a dyn PersonaSource >, chat: Option < & 'a dyn MouthReader >, addressing: Option < & 'a dyn HeartbeatView >, model: Option < & 'a dyn Model >]
mind_body::projection: struct Request pub-fields[instance: String, kind: TurnKind, state: Option < Value >, room: Option < String >, seed: u64, renders: Option < usize >, judge_against: Option < Value >, operators: Vec < String >, minds: Vec < String >, own_sender: String, tuning: PathBuf, through: Through, last_heard: Vec < (String , u64) >, recent: Vec < Vec < String > >, own_rooms: Vec < String >]
mind_body::projection: struct Request pub-fields[instance: String, kind: TurnKind, state: Option < Value >, room: Option < String >, seed: u64, renders: Option < usize >, judge_against: Option < Value >, operators: Vec < String >, minds: Vec < String >, own_sender: String, tuning: PathBuf, through: Through, last_heard: Vec < (String , u64) >, recent: Vec < Vec < String > >, own_rooms: Vec < String >, last_outcome: Option < Value >]
mind_body::projection::harness: fn batch (harness : & Harness , plan_path : & Path) -> Result < String >
mind_body::projection::harness: fn fixture_request (harness : & Harness , fixture : & Fixture , state : Option < Value > , seed : u64 , renders : Option < usize > , through : Through) -> Request
mind_body::projection::harness: fn state_file (path : & Path , instance : & str) -> Result < Value >
@ -267,6 +267,7 @@ mind_body::projection::harness: struct Harness< 'a > pub-fields[instance: Strin
mind_body::projection::harness: struct Message # [derive (Clone , Debug , Deserialize)] pub-fields[from: String, name: String, room: String, ago: Option < String >, round: Option < usize >, says: String, new: bool, tag: bool, mentions: Vec < String >, dm: bool, to: Option < String >, follow_up: bool, reply_to: Option < usize >]
mind_body::projection::interpret: impl Drafts
mind_body::projection::interpret: impl GapKind
mind_body::projection::interpret: impl Refusal
mind_body::projection::narrate: fn connector_key (credentials : & Path) -> Result < String >
mind_body::projection::narrate: impl Failed
mind_body::projection::narrate: impl KitModel
@ -278,6 +279,8 @@ mind_body::projection::narrate: struct Answer # [derive (Clone , Debug , Partial
mind_body::projection::narrate: struct Failed # [derive (Clone , Debug , PartialEq , Eq)] pub-fields[reason: String, usage: Option < Spent >]
mind_body::projection::narrate: struct KitModel pub-fields[]
mind_body::projection::narrate: struct Spent # [derive (Clone , Debug , PartialEq , Eq , Serialize)] pub-fields[model: String, input_tokens: u64, output_tokens: u64, cache_read_tokens: u64, cache_write_tokens: u64, reasoning_tokens: Option < u64 >]
mind_body::projection::outcome: impl Outcome
mind_body::projection::outcome: impl Part
mind_body::projection::select: # [derive (Clone , Copy , Debug , PartialEq , Eq , Serialize , serde :: Deserialize)] # [serde (rename_all = "snake_case")] pub enum TurnKind { Chat , Beat , FollowUp , Reflection , }
mind_body::projection::select: impl Addressed < '_ >
mind_body::projection::select: impl Context
@ -308,7 +311,7 @@ mind_body::projection::tuning: struct Loaded # [derive (Clone , Debug , PartialE
mind_body::projection::tuning: struct PersonaTuning # [derive (Clone , Debug , PartialEq , Serialize , Deserialize)] pub-fields[model: String, guidance: String, words: usize]
mind_body::projection::tuning: struct PoolCaps # [derive (Clone , Debug , PartialEq , Eq , Serialize , Deserialize)] pub-fields[memories_about_present: usize, other_memories: usize, needs: usize, incubation: usize, stance: usize, value: usize, said: usize]
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, stimulus_bytes: usize, heard_bytes: usize, addressed_bytes: usize, identity_bytes: usize, bond_summary_bytes: usize, item_bytes: usize, body_bytes: usize, memory_tau_h: f64, 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 SelectTuning # [derive (Clone , Debug , PartialEq , Serialize , Deserialize)] pub-fields[temperature: f64, inclusion_score: f64, notes_bytes: usize, here_bytes: usize, outcome_bytes: usize, stimulus_bytes: usize, heard_bytes: usize, addressed_bytes: usize, identity_bytes: usize, bond_summary_bytes: usize, item_bytes: usize, body_bytes: usize, memory_tau_h: f64, 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::queue: fn on_hold (mind : & dyn MindPort) -> Result < Held >
mind_body::queue: impl Held