Persona turn: Taken keeps no second copy of what the commit did

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-27 19:26:02 +01:00
commit e8cba0e2fe
4 changed files with 4 additions and 6 deletions

View file

@ -19,7 +19,6 @@ use anyhow::{Result, anyhow, bail};
use chrono::{DateTime, Utc};
use cultcache_rs::{CultCache, DatabaseEntry, SingleFileMessagePackBackingStore};
use eureka_pipeline::{MemoryOrigin, Slug};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use crate::address::{Addressee, addresses, is_for, localpart};

View file

@ -40,7 +40,7 @@ use super::harness::{Harness, Line, Message, OVERLAP_FLAG, cosine, pending_for,
use super::select::Draw;
use super::tuning;
use super::turn::{self, Actuator, Edited, Sent, history, last_wake};
use super::{DomainFacts, DomainSource, MouthReader, Organs, ReadFixture, ReadSource, Request, Through, TurnKind, project};
use super::{DomainFacts, DomainSource, MouthReader, Organs, ReadFixture, ReadSource, Request, Through, TurnKind};
use crate::address::{Addressee, is_for, localpart};
use crate::chat_client::ChatPending;
use crate::heartbeat::{Addressing, DEFAULT_BEAT_S, FileStore, HeartbeatView, LineFacts, Speaker, WakeCause, WakePolicy, addressed_by_member, wakes};

View file

@ -66,12 +66,11 @@ impl Actuator for Mouth<'_> {
}
}
/// One turn taken: what `project` reported, her record of it, her state after the commit and what the commit did.
/// One turn taken: what `project` reported, her record of it (the commit's work under `committed`) and her state after it.
pub(crate) struct Taken {
pub report: Value,
pub record: Value,
pub state: Value,
pub applied: Applied,
}
impl Taken {
@ -125,7 +124,7 @@ pub(crate) fn take(organs: &Organs, request: &Request, actuator: &dyn Actuator,
record["selected"] = render["selected"].clone();
}
record["at"] = json!(now.to_rfc3339());
Taken { report, record, state, applied }
Taken { report, record, state }
}
/// What her records say of her: her last turn's record, the ids her last projections selected, her last records and

View file

@ -121,7 +121,7 @@ fn t_l1_failed_turn_record() {
keys.retain(|key| !matches!(*key, "selected" | "at" | "committed"));
assert_eq!(keys, ["failed"], "the record holds the failure alone beside what every record carries");
assert_eq!(taken.state, state, "a failed turn applies nothing");
assert_eq!(taken.applied, Applied::default());
assert_eq!(taken.record["committed"], json!(Applied::default()));
}
#[test]