Huginn/crates/mind-body/src/projection/simulate.rs

698 lines
41 KiB
Rust
Raw Normal View History

mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
//! The swarm in one simulated room (`mind-persona project --simulate <plan>`): up to eight personas take turns, each turn
//! one `project` through the Persona stage, and each one's quoted lines join the room as from her Matrix id, so the
//! next one hears them.
//!
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
//! Who wakes is the heartbeat's: `heartbeat::wakes` under the plan's `WakePolicy`, over each persona's addressee as the
//! heartbeat's addressing table holds it (her stewarded projects' names included) when the plan names the table. The
//! beat is the heartbeat's too: when it falls, one Persona wakes, the winner of `tempo::pick`. A persona woken in several
//! rooms in one round takes one turn in each. The turns of a round go in an order drawn from the seed, each against the
//! room as it stands at that turn.
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
//!
//! Her state does not move during a run: the Interpreter (C3b) and the commit (C3c) are not built. `state_after_turn`
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
//! 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.
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
use std::collections::BTreeMap;
use std::fmt::Write as _;
use std::path::{Path, PathBuf};
use anyhow::{Context, Result, bail};
use chrono::{DateTime, Duration, Utc};
use serde::Deserialize;
use serde_json::{Value, json};
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
use super::harness::{Harness, Line, Message, OVERLAP_FLAG, cosine, pending_for, state_file, turn_markdown, usage_markdown, usage_total};
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
use super::select::Draw;
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
use super::tuning;
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
use super::{MouthReader, Organs, Request, Through, TurnKind, project};
use crate::address::{Addressee, is_for, localpart};
use crate::chat_client::ChatPending;
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
use crate::heartbeat::{Addressing, DEFAULT_BEAT_S, FileStore, HeartbeatView, LineFacts, Speaker, WakeCause, WakePolicy, addressed_by_member, wakes};
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
use crate::tempo::{Standing, pick};
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
/// The most personas a simulation holds: the swarm.
const CAST_MAX: usize = 8;
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
/// How many transcript lines the report quotes as representative.
const REPRESENTATIVE_LINES: usize = 18;
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
#[derive(Deserialize)]
#[serde(deny_unknown_fields)]
struct SimFile {
rounds: usize,
#[serde(default = "one")]
repeats: usize,
#[serde(default)]
seed: u64,
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
#[serde(default = "ruled")]
wake: WakePolicy,
/// The heartbeat's beat, in seconds of simulated time; 0 is no beat.
#[serde(default = "beat_s")]
beat_s: u32,
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
#[serde(default = "two")]
round_minutes: i64,
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
/// She is in a room's exchange when she has spoken there within this many minutes before the line (`humans_pace`):
/// others talking on does not keep her in it.
#[serde(default = "exchange_minutes")]
exchange_minutes: i64,
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
start: DateTime<Utc>,
rooms: Vec<String>,
#[serde(default)]
operators: Vec<String>,
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
/// The heartbeat's store (`heartbeat.cc`), read without a lock or a write, for its addressing table: each persona's
/// names and her stewarded projects' names. None addresses each by her own names.
#[serde(default)]
addressing: Option<PathBuf>,
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
cast: Vec<CastEntry>,
#[serde(default, rename = "message")]
script: Vec<Message>,
}
fn one() -> usize {
1
}
fn two() -> i64 {
2
}
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
fn exchange_minutes() -> i64 {
30
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
}
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
fn ruled() -> WakePolicy {
WakePolicy::Ruled
}
fn beat_s() -> u32 {
DEFAULT_BEAT_S
}
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
#[derive(Clone, Deserialize)]
#[serde(deny_unknown_fields)]
struct CastEntry {
id: String,
name: String,
/// Her persona state, relative to the plan; its `personaId` is her id's localpart.
state: PathBuf,
/// Her rooms; none is every room of the plan.
#[serde(default)]
rooms: Vec<String>,
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
/// The rooms that are hers, where any human line wakes her under `humans_pace`. Neither the heartbeat's table nor
/// `persona.env` records which rooms a Mind owns, so the plan says; a direct message is always hers.
#[serde(default)]
own_rooms: Vec<String>,
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
}
struct Member {
entry: CastEntry,
state: Value,
addressee: Addressee,
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
/// Where her addressee came from: the heartbeat's table, or her own names.
names_from: &'static str,
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
rooms: Vec<String>,
}
/// One persona's view of the room at her turn: the lines since her last turn are new.
struct View<'a> {
lines: &'a [Line],
viewer: &'a str,
rooms: &'a [String],
seen: usize,
}
impl MouthReader for View<'_> {
fn pending(&self) -> Result<ChatPending> {
Ok(pending_for(self.lines, self.viewer, self.rooms, |at| at >= self.seen))
}
}
struct Names<'a>(&'a Addressee);
impl HeartbeatView for Names<'_> {
fn addressing(&self) -> Result<Option<Addressing>> {
Ok(Some(Addressing { minds: vec![self.0.clone()] }))
}
}
/// The seam where the Interpreter (C3b) will turn her prose into proposals and the commit (C3c) will apply them, so her
/// next turn starts from the state this one left. Until they exist it returns her state unchanged.
fn state_after_turn(state: Value, _turn: &Value) -> Value {
state
}
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
fn speaker(line: &Line, member: &Member, operators: &[String], cast: &[String]) -> Speaker {
if line.from == member.entry.id {
Speaker::Her
} else if operators.contains(&line.from) {
Speaker::Operator
} else if cast.contains(&line.from) {
Speaker::Mind
} else {
Speaker::Member
}
}
Speech binds to her words: a spoken line is her prose verbatim; Huginn's chat Interpreter prompt; she speaks only in the turn's room Soul's hold on #81 and Self's privacy decision. - F1: a spoken line is exactly the spans of her prose the Interpreter cites, located in order by Ghostlight's SourceSpan::locate and joined with one space. The model never writes the words; `text` is gone from the contract. The Persona writes the words she would type, never a description of them. Given up: indirect speech and any paraphrase by the Interpreter. - F3: Huginn owns a short chat Interpreter prompt (what, where, to whom; gaps conditional, addressee, elsewhere); Ghostlight's membrane and the INTERPRETER_GUIDANCE patch are gone. `[interpreter]` keeps only the model. - F2: an echo is a line of four words or more whose word trigrams are mostly the heard message bodies (heard_overlap); short answers are never echoes. - F4: mentions and reply targets only for people this packet showed her. - F5: a line said once; at most two lines a turn. - F6: stale docs on the Mind run, the exchange and the policies. - F7: a human's line ends a Mind's run only in a room the run has lines in. - Privacy: she speaks only in the turn's room; the Interpreter is told the room, its kind (public, her own, a direct message) and who is in it, and not to say in a room what she knows privately; the packet frames bond summaries and memories about a person as known privately everywhere but a direct message with that person. - The simulation's turn is in the room of the line that woke her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 05:30:00 +01:00
/// For each line, how many Mind lines in a row came before it in her current Mind-only run: one run across every room
/// she sees, which a human's line ends only when it is in a room the run has lines in. Meta chatting in #eureka does not
/// end a loop in #minds.
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
fn mind_runs(lines: &[Line], cast: &[String], member: &Member) -> Vec<usize> {
let mut run = 0usize;
Speech binds to her words: a spoken line is her prose verbatim; Huginn's chat Interpreter prompt; she speaks only in the turn's room Soul's hold on #81 and Self's privacy decision. - F1: a spoken line is exactly the spans of her prose the Interpreter cites, located in order by Ghostlight's SourceSpan::locate and joined with one space. The model never writes the words; `text` is gone from the contract. The Persona writes the words she would type, never a description of them. Given up: indirect speech and any paraphrase by the Interpreter. - F3: Huginn owns a short chat Interpreter prompt (what, where, to whom; gaps conditional, addressee, elsewhere); Ghostlight's membrane and the INTERPRETER_GUIDANCE patch are gone. `[interpreter]` keeps only the model. - F2: an echo is a line of four words or more whose word trigrams are mostly the heard message bodies (heard_overlap); short answers are never echoes. - F4: mentions and reply targets only for people this packet showed her. - F5: a line said once; at most two lines a turn. - F6: stale docs on the Mind run, the exchange and the policies. - F7: a human's line ends a Mind's run only in a room the run has lines in. - Privacy: she speaks only in the turn's room; the Interpreter is told the room, its kind (public, her own, a direct message) and who is in it, and not to say in a room what she knows privately; the packet frames bond summaries and memories about a person as known privately everywhere but a direct message with that person. - The simulation's turn is in the room of the line that woke her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 05:30:00 +01:00
let mut run_rooms: Vec<&str> = Vec::new();
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
lines
.iter()
.map(|line| {
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
let before = run;
if line.visible_to(&member.entry.id, &member.rooms) {
Speech binds to her words: a spoken line is her prose verbatim; Huginn's chat Interpreter prompt; she speaks only in the turn's room Soul's hold on #81 and Self's privacy decision. - F1: a spoken line is exactly the spans of her prose the Interpreter cites, located in order by Ghostlight's SourceSpan::locate and joined with one space. The model never writes the words; `text` is gone from the contract. The Persona writes the words she would type, never a description of them. Given up: indirect speech and any paraphrase by the Interpreter. - F3: Huginn owns a short chat Interpreter prompt (what, where, to whom; gaps conditional, addressee, elsewhere); Ghostlight's membrane and the INTERPRETER_GUIDANCE patch are gone. `[interpreter]` keeps only the model. - F2: an echo is a line of four words or more whose word trigrams are mostly the heard message bodies (heard_overlap); short answers are never echoes. - F4: mentions and reply targets only for people this packet showed her. - F5: a line said once; at most two lines a turn. - F6: stale docs on the Mind run, the exchange and the policies. - F7: a human's line ends a Mind's run only in a room the run has lines in. - Privacy: she speaks only in the turn's room; the Interpreter is told the room, its kind (public, her own, a direct message) and who is in it, and not to say in a room what she knows privately; the packet frames bond summaries and memories about a person as known privately everywhere but a direct message with that person. - The simulation's turn is in the room of the line that woke her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 05:30:00 +01:00
if cast.contains(&line.from) {
run += 1;
run_rooms.push(&line.room);
} else if run_rooms.contains(&line.room.as_str()) {
run = 0;
run_rooms.clear();
}
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
}
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
before
})
.collect()
}
/// How a Mind's line addressed her, by the evidence `is_for` had, strongest first: a Matrix tag or a reply to her, her
/// Matrix id written as plain text, or one of her names in the text.
fn how_addressed(line: &Line, at: usize, member: &Member, lines: &[Line]) -> &'static str {
let delivery = line.delivery(at, &member.entry.id, lines);
if delivery.mentions.contains(&member.entry.id) || delivery.basis.is_some() {
"mention or reply"
} else if line.says.to_lowercase().contains(&member.entry.id.to_lowercase()) {
"id as text"
} else {
"name in text"
}
}
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
/// One wake: why (the strongest cause among her new lines, under the plan's policy) and, when only Minds' lines caused
/// it, the strongest evidence that addressed her and the lines that did.
struct Woken {
cause: WakeCause,
Speech binds to her words: a spoken line is her prose verbatim; Huginn's chat Interpreter prompt; she speaks only in the turn's room Soul's hold on #81 and Self's privacy decision. - F1: a spoken line is exactly the spans of her prose the Interpreter cites, located in order by Ghostlight's SourceSpan::locate and joined with one space. The model never writes the words; `text` is gone from the contract. The Persona writes the words she would type, never a description of them. Given up: indirect speech and any paraphrase by the Interpreter. - F3: Huginn owns a short chat Interpreter prompt (what, where, to whom; gaps conditional, addressee, elsewhere); Ghostlight's membrane and the INTERPRETER_GUIDANCE patch are gone. `[interpreter]` keeps only the model. - F2: an echo is a line of four words or more whose word trigrams are mostly the heard message bodies (heard_overlap); short answers are never echoes. - F4: mentions and reply targets only for people this packet showed her. - F5: a line said once; at most two lines a turn. - F6: stale docs on the Mind run, the exchange and the policies. - F7: a human's line ends a Mind's run only in a room the run has lines in. - Privacy: she speaks only in the turn's room; the Interpreter is told the room, its kind (public, her own, a direct message) and who is in it, and not to say in a room what she knows privately; the packet frames bond summaries and memories about a person as known privately everywhere but a direct message with that person. - The simulation's turn is in the room of the line that woke her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 05:30:00 +01:00
/// The newest line with that cause: its room is the turn's room.
line: usize,
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
how: Option<&'static str>,
by: Vec<Value>,
}
Speech binds to her words: a spoken line is her prose verbatim; Huginn's chat Interpreter prompt; she speaks only in the turn's room Soul's hold on #81 and Self's privacy decision. - F1: a spoken line is exactly the spans of her prose the Interpreter cites, located in order by Ghostlight's SourceSpan::locate and joined with one space. The model never writes the words; `text` is gone from the contract. The Persona writes the words she would type, never a description of them. Given up: indirect speech and any paraphrase by the Interpreter. - F3: Huginn owns a short chat Interpreter prompt (what, where, to whom; gaps conditional, addressee, elsewhere); Ghostlight's membrane and the INTERPRETER_GUIDANCE patch are gone. `[interpreter]` keeps only the model. - F2: an echo is a line of four words or more whose word trigrams are mostly the heard message bodies (heard_overlap); short answers are never echoes. - F4: mentions and reply targets only for people this packet showed her. - F5: a line said once; at most two lines a turn. - F6: stale docs on the Mind run, the exchange and the policies. - F7: a human's line ends a Mind's run only in a room the run has lines in. - Privacy: she speaks only in the turn's room; the Interpreter is told the room, its kind (public, her own, a direct message) and who is in it, and not to say in a room what she knows privately; the packet frames bond summaries and memories about a person as known privately everywhere but a direct message with that person. - The simulation's turn is in the room of the line that woke her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 05:30:00 +01:00
/// Whether she is in the exchange a line belongs to: she spoke in its room within `window` before it.
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
fn in_exchange(lines: &[Line], at: usize, her: &str, window: Duration) -> bool {
let line = &lines[at];
let since = line.at_ms.saturating_sub(u64::try_from(window.num_milliseconds()).unwrap_or(0));
lines[..at].iter().any(|earlier| earlier.room == line.room && earlier.from == her && earlier.at_ms >= since)
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
}
/// Her wakes: one per room a new line woke her in, in the order of each room's first waking line. A room's turn takes
/// the strongest cause among its lines, so no room that woke her, a direct message least of all, is passed over.
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
#[allow(clippy::too_many_arguments, reason = "one wake decision's inputs, each a plan or room fact")]
fn woken(lines: &[Line], runs: &[usize], seen: usize, member: &Member, operators: &[String], cast: &[String], policy: WakePolicy, gap: Duration) -> Vec<Woken> {
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let mut found: Vec<(usize, WakeCause)> = Vec::new();
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
for (at, line) in lines.iter().enumerate().skip(seen) {
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
if !line.visible_to(&member.entry.id, &member.rooms) {
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
continue;
}
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let delivery = line.delivery(at, &member.entry.id, lines);
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
let facts = LineFacts { mind_run: runs[at], own_room: member.entry.own_rooms.contains(&line.room), in_exchange: in_exchange(lines, at, &member.entry.id, gap) };
if let Some(cause) = wakes(policy, &member.addressee, &delivery, speaker(line, member, operators, cast), facts) {
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
found.push((at, cause));
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
}
}
let mut rooms: Vec<&str> = Vec::new();
for (at, _) in &found {
if !rooms.contains(&lines[*at].room.as_str()) {
rooms.push(&lines[*at].room);
}
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
}
rooms
.into_iter()
.filter_map(|room| {
let found: Vec<(usize, WakeCause)> = found.iter().copied().filter(|(at, _)| lines[*at].room == room).collect();
let cause = found.iter().map(|(_, cause)| *cause).min()?;
let line = found.iter().rev().find(|(_, found)| *found == cause).map_or(0, |(at, _)| *at);
if cause != WakeCause::AddressedByMind {
return Some(Woken { cause, line, how: None, by: vec![] });
}
let addressing: Vec<usize> = found.iter().filter(|(_, cause)| *cause == WakeCause::AddressedByMind).map(|(at, _)| *at).collect();
let rank = |how: &str| ["mention or reply", "id as text", "name in text"].iter().position(|one| *one == how).unwrap_or(3);
let how = addressing.iter().map(|at| how_addressed(&lines[*at], *at, member, lines)).min_by_key(|how| rank(how));
let by = addressing.iter().map(|at| json!({ "from": lines[*at].from, "how": how_addressed(&lines[*at], *at, member, lines), "says": lines[*at].says })).collect();
Some(Woken { cause, line, how, by })
})
.collect()
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
}
/// The wire spelling of a cause, and of the beat.
fn cause_word(cause: Option<WakeCause>) -> &'static str {
match cause {
Some(WakeCause::AddressedByHuman) => "addressed_by_human",
Some(WakeCause::Human) => "human",
Some(WakeCause::AddressedByMind) => "addressed_by_mind",
Some(WakeCause::Mind) => "mind",
None => "beat",
}
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
}
/// A seeded shuffle, so the order of those woken together is drawn, and replays.
fn shuffled<T>(mut items: Vec<T>, seed: u64) -> Vec<T> {
let mut draw = Draw(seed);
for at in (1..items.len()).rev() {
let pick = (draw.next() % (at as u64 + 1)) as usize;
items.swap(at, pick);
}
items
}
/// Runs the plan: every repeat one simulation, all of them in one Markdown report.
pub fn simulate(harness: &Harness, plan_path: &Path) -> Result<String> {
let text = std::fs::read_to_string(plan_path).with_context(|| format!("the plan {} could not be read", plan_path.display()))?;
let plan: SimFile = toml::from_str(&text).with_context(|| format!("the plan {} is not a simulation plan", plan_path.display()))?;
if plan.cast.is_empty() || plan.cast.len() > CAST_MAX {
bail!("a simulation holds 1 to {CAST_MAX} personas, not {}", plan.cast.len());
}
if plan.rounds == 0 || plan.repeats == 0 || plan.rooms.is_empty() || plan.round_minutes <= 0 {
bail!("a simulation needs rounds, repeats, a room and a positive round_minutes");
}
let base = plan_path.parent().unwrap_or(Path::new("."));
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let mut members = cast_of(&plan, base)?;
let group_state = tuning::load(&harness.tuning).map(|loaded| loaded.tuning.select.group_state).ok();
let runs: Vec<Value> = (0..plan.repeats).map(|repeat| run(harness, &plan, &mut members, repeat)).collect::<Result<_>>()?;
Ok(markdown(plan_path, &plan, &members, group_state, &runs))
}
/// The plan's cast: each persona's state, checked as a put would check it, and her addressee, from the heartbeat's
/// table when the plan names it and the table holds her; and the script checked against the rooms.
fn cast_of(plan: &SimFile, base: &Path) -> Result<Vec<Member>> {
let table = match &plan.addressing {
Some(path) => FileStore::new(base.join(path)).addressing().with_context(|| format!("the heartbeat store {} could not be read", path.display()))?.unwrap_or_default(),
None => Addressing::default(),
};
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let mut members = Vec::new();
for entry in &plan.cast {
let state = state_file(&base.join(&entry.state), localpart(&entry.id))?;
let rooms = if entry.rooms.is_empty() { plan.rooms.clone() } else { entry.rooms.clone() };
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let (addressee, names_from) = match table.minds.iter().find(|row| row.matrix_id() == entry.id) {
Some(row) => (row.clone(), "the heartbeat's table"),
None => {
let public = state["publicName"].as_str().unwrap_or_default().to_owned();
let names = [localpart(&entry.id), entry.name.as_str(), public.as_str()].into_iter().filter(|name| !name.is_empty()).map(str::to_owned).collect::<Vec<_>>();
(Addressee::new(&entry.id, names.iter().map(String::as_str)), "her own names")
}
};
members.push(Member { addressee, names_from, entry: entry.clone(), state, rooms });
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
}
for (at, message) in plan.script.iter().enumerate() {
if message.ago.is_some() || message.new || message.tag {
bail!("script message {} uses a room fixture's ago, new or tag: a script names its round and its mentions", at + 1);
}
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
if !message.dm && !plan.rooms.contains(&message.room) {
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
bail!("script message {} is in {}, which is not one of the rooms", at + 1, message.room);
}
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
if message.dm && message.to.as_ref().is_none_or(|to| !plan.cast.iter().any(|entry| entry.id == *to)) {
bail!("script message {} is a direct message: name its recipient, a cast member, in `to`", at + 1);
}
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
if message.dm && plan.rooms.contains(&message.room) {
bail!("script message {} is a direct message in {}, one of the plan's rooms: a direct message has its own room", at + 1, message.room);
}
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
}
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
Ok(members)
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
}
fn run(harness: &Harness, plan: &SimFile, members: &mut [Member], repeat: usize) -> Result<Value> {
let seed = plan.seed.wrapping_add(repeat as u64);
let cast: Vec<String> = members.iter().map(|member| member.entry.id.clone()).collect();
let at_round = |round: usize| plan.start + Duration::minutes(plan.round_minutes * round as i64);
let mut lines: Vec<Line> = Vec::new();
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
// Per line: the round, and the cause of the turn that spoke it (none for a script line).
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let mut rounds_of: Vec<usize> = Vec::new();
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let mut causes: Vec<Option<&'static str>> = Vec::new();
let scripted = |round: usize, lines: &mut Vec<Line>, rounds_of: &mut Vec<usize>, causes: &mut Vec<Option<&'static str>>| -> Result<()> {
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
for (at, message) in plan.script.iter().enumerate().filter(|(_, message)| message.round.unwrap_or(0) == round) {
lines.push(Line::of(message, at_round(round) + Duration::seconds(at as i64), None, at)?);
rounds_of.push(round);
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
causes.push(None);
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
}
Ok(())
};
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
scripted(0, &mut lines, &mut rounds_of, &mut causes)?;
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let opening = lines.len();
let mut seen = vec![0usize; members.len()];
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let mut last_turn: Vec<Option<DateTime<Utc>>> = vec![None; members.len()];
let mut last_beat = plan.start;
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let mut recent: Vec<Vec<Vec<String>>> = vec![Vec::new(); members.len()];
let mut turns = Vec::new();
let mut counter = 0u64;
for round in 1..=plan.rounds {
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
scripted(round, &mut lines, &mut rounds_of, &mut causes)?;
let round_at = at_round(round);
// One turn per room that woke her, each in its room; all of hers this round read from where the round found her.
let round_seen = seen.clone();
let mut woke: Vec<(usize, Option<Woken>)> = members.iter().enumerate().flat_map(|(at, member)| woken(&lines, &mind_runs(&lines, &cast, member), seen[at], member, &plan.operators, &cast, plan.wake, Duration::minutes(plan.exchange_minutes)).into_iter().map(move |why| (at, Some(why)))).collect();
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
// The beat, as the heartbeat's: when it has fallen, one more wake for the winner of `tempo::pick` among those
// not already woken.
if plan.beat_s > 0 && (round_at - last_beat).num_seconds() >= i64::from(plan.beat_s) {
let standings: Vec<Standing> = members
.iter()
.enumerate()
.map(|(at, member)| Standing {
slug: localpart(&member.entry.id).to_owned(),
eligible: !woke.iter().any(|(woken, _)| *woken == at),
waited_s: last_turn[at].map(|turn| u64::try_from((round_at - turn).num_seconds()).unwrap_or(0)),
last_turn_ms: last_turn[at].map(|turn| turn.timestamp_millis()),
topic_permille: 0,
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
addressed_by_member: addressed_by_member(&plan.operators, &member.addressee, &pending_for(&lines, &member.entry.id, &member.rooms, |index| index >= seen[at]).deliveries),
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
})
.collect();
if let Some(winner) = pick(&standings, plan.beat_s) {
woke.push((winner, None));
last_beat = round_at;
}
}
for (at, why) in shuffled(woke, seed ^ (round as u64).wrapping_mul(0x9E37_79B9)) {
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
counter += 1;
let member = &members[at];
let id = member.entry.id.clone();
let fresh: Vec<&Line> = lines[round_seen[at]..].iter().filter(|line| line.from != id && line.visible_to(&id, &member.rooms)).collect();
Speech binds to her words: a spoken line is her prose verbatim; Huginn's chat Interpreter prompt; she speaks only in the turn's room Soul's hold on #81 and Self's privacy decision. - F1: a spoken line is exactly the spans of her prose the Interpreter cites, located in order by Ghostlight's SourceSpan::locate and joined with one space. The model never writes the words; `text` is gone from the contract. The Persona writes the words she would type, never a description of them. Given up: indirect speech and any paraphrase by the Interpreter. - F3: Huginn owns a short chat Interpreter prompt (what, where, to whom; gaps conditional, addressee, elsewhere); Ghostlight's membrane and the INTERPRETER_GUIDANCE patch are gone. `[interpreter]` keeps only the model. - F2: an echo is a line of four words or more whose word trigrams are mostly the heard message bodies (heard_overlap); short answers are never echoes. - F4: mentions and reply targets only for people this packet showed her. - F5: a line said once; at most two lines a turn. - F6: stale docs on the Mind run, the exchange and the policies. - F7: a human's line ends a Mind's run only in a room the run has lines in. - Privacy: she speaks only in the turn's room; the Interpreter is told the room, its kind (public, her own, a direct message) and who is in it, and not to say in a room what she knows privately; the packet frames bond summaries and memories about a person as known privately everywhere but a direct message with that person. - The simulation's turn is in the room of the line that woke her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 05:30:00 +01:00
// The turn is in the room of the line that woke her; a beat's, in the room of the newest line she has not seen.
let woke_on = why.as_ref().map(|why| &lines[why.line]).or(fresh.last().copied());
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
let here = woke_on.map_or_else(|| member.rooms[0].clone(), |line| line.room.clone());
// Woken by a direct message, she answers in it: to its sender alone.
let dm_to = woke_on.filter(|line| line.dm_to.as_deref() == Some(id.as_str())).map(|line| line.from.clone());
let kind = if fresh.iter().any(|line| line.room == here) { TurnKind::Chat } else { TurnKind::Beat };
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let now = round_at + Duration::seconds(30 + counter as i64);
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let request = Request {
instance: localpart(&id).to_owned(),
kind,
state: Some(member.state.clone()),
room: Some(here.clone()),
seed: seed.wrapping_mul(1_000_003).wrapping_add(counter),
renders: Some(1),
judge_against: None,
operators: plan.operators.clone(),
minds: cast.clone(),
own_sender: id.clone(),
tuning: harness.tuning.clone(),
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
through: Through::Interpreter,
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
last_heard: vec![],
recent: recent[at].clone(),
Speech binds to her words: a spoken line is her prose verbatim; Huginn's chat Interpreter prompt; she speaks only in the turn's room Soul's hold on #81 and Self's privacy decision. - F1: a spoken line is exactly the spans of her prose the Interpreter cites, located in order by Ghostlight's SourceSpan::locate and joined with one space. The model never writes the words; `text` is gone from the contract. The Persona writes the words she would type, never a description of them. Given up: indirect speech and any paraphrase by the Interpreter. - F3: Huginn owns a short chat Interpreter prompt (what, where, to whom; gaps conditional, addressee, elsewhere); Ghostlight's membrane and the INTERPRETER_GUIDANCE patch are gone. `[interpreter]` keeps only the model. - F2: an echo is a line of four words or more whose word trigrams are mostly the heard message bodies (heard_overlap); short answers are never echoes. - F4: mentions and reply targets only for people this packet showed her. - F5: a line said once; at most two lines a turn. - F6: stale docs on the Mind run, the exchange and the policies. - F7: a human's line ends a Mind's run only in a room the run has lines in. - Privacy: she speaks only in the turn's room; the Interpreter is told the room, its kind (public, her own, a direct message) and who is in it, and not to say in a room what she knows privately; the packet frames bond summaries and memories about a person as known privately everywhere but a direct message with that person. - The simulation's turn is in the room of the line that woke her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 05:30:00 +01:00
own_rooms: member.entry.own_rooms.clone(),
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
};
let view = View { lines: &lines, viewer: &id, rooms: &member.rooms, seen: round_seen[at] };
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let names = Names(&member.addressee);
let organs = Organs { persona: None, chat: Some(&view), addressing: Some(&names), model: harness.model };
let report = project(&organs, &request, now).unwrap_or_else(|fault| json!({ "error": format!("{fault:#}") }));
seen[at] = lines.len();
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
last_turn[at] = Some(now);
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let render = &report["renders"][0];
if let Some(selected) = render["selected"].as_array() {
recent[at].push(selected.iter().filter_map(Value::as_str).map(str::to_owned).collect());
}
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
// A failed call is a failure, never a silence.
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
let failed = report.get("error").or_else(|| render.get("failed")).or_else(|| render["persona"].get("failed")).or_else(|| render["interpreter"].get("failed")).map(|fault| fault.as_str().unwrap_or_default().to_owned());
// What she says is the Interpreter's decision alone; who it wakes is its structured mentions and reply target.
let said: Vec<Value> = if failed.is_some() { vec![] } else { render["interpreter"]["said"].as_array().cloned().unwrap_or_default() };
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let cause = cause_word(why.as_ref().map(|why| why.cause));
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
let mut spoken: Vec<String> = 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();
let mentions: Vec<String> = decided["mentions"].as_array().map(|ids| ids.iter().filter_map(Value::as_str).filter(|id| cast.contains(&(*id).to_owned()) || plan.operators.contains(&(*id).to_owned())).map(str::to_owned).collect()).unwrap_or_default();
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 };
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 });
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
rounds_of.push(round);
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
causes.push(Some(cause));
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
spoken.push(says);
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
}
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
let line = (!spoken.is_empty()).then(|| spoken.join(" / "));
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
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));
let turn = json!({ "round": round, "persona": member.entry.name, "id": id, "woke": cause, "how": how, "addressed_by": by, "kind": kind, "room": here, "outcome": outcome, "failed": failed, "said": line, "report": report });
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let member = &mut members[at];
member.state = state_after_turn(std::mem::take(&mut member.state), &turn);
turns.push(turn);
}
}
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let metrics = metrics(members, &lines, &rounds_of, &causes, opening, &turns, plan.rounds);
let transcript: Vec<Value> = lines.iter().zip(&rounds_of).zip(&causes).map(|((line, round), cause)| json!({ "round": round, "room": line.room, "from": line.from, "name": line.name, "says": line.says, "mind": cast.contains(&line.from), "woke": cause })).collect();
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
Ok(json!({ "repeat": repeat + 1, "seed": seed, "transcript": transcript, "turns": turns, "metrics": metrics }))
}
/// Words that mark talk about the work. A cheap lexical heuristic for the work-talk share, not a classifier: it counts
/// a line as work talk when any of these appears as a word in it.
const WORK_WORDS: [&str; 26] = [
"repo", "repos", "pr", "commit", "merge", "deploy", "build", "test", "tests", "bug", "branch", "code", "release", "issue", "pipeline", "crate", "schema", "spec", "cargo", "clippy", "daemon", "patch", "refactor", "migration", "server", "ticket",
];
fn work_talk(text: &str) -> bool {
text.split(|c: char| !c.is_alphanumeric()).any(|word| WORK_WORDS.contains(&word.to_lowercase().as_str()))
}
/// Mean pairwise cosine between the speakers' texts; speakers with no text are left out.
fn mean_pairwise(texts: &BTreeMap<String, String>) -> Option<f64> {
let spoken: Vec<&String> = texts.values().filter(|text| !text.trim().is_empty()).collect();
let mut sum = 0.0;
let mut pairs = 0usize;
for (at, a) in spoken.iter().enumerate() {
for b in &spoken[at + 1..] {
sum += cosine(a, b);
pairs += 1;
}
}
(pairs > 0).then(|| sum / pairs as f64)
}
/// Which rounds a measure keeps.
type Keep<'a> = &'a dyn Fn(usize) -> bool;
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
/// A Mind-to-Mind reply: a Mind's line spoken in a turn another Mind's line woke.
fn mind_reply(cause: Option<&str>) -> bool {
matches!(cause, Some("addressed_by_mind" | "mind"))
}
/// Per room: Mind-to-Mind replies in a row with no human line and no human-woken answer between them.
fn reply_chains(lines: &[Line], causes: &[Option<&str>], opening: usize, cast: &[&str]) -> Value {
let mut rooms: BTreeMap<String, (usize, usize, usize, usize)> = BTreeMap::new();
for (line, cause) in lines.iter().zip(causes).skip(opening) {
let (longest, chains, total, run) = rooms.entry(line.room.clone()).or_default();
if cast.contains(&line.from.as_str()) && mind_reply(*cause) {
*run += 1;
*total += 1;
*longest = (*longest).max(*run);
} else {
*chains += usize::from(*run >= 3);
*run = 0;
}
}
let out: BTreeMap<String, Value> = rooms
.into_iter()
.map(|(room, (longest, chains, total, run))| (room, json!({ "longest": longest, "chains_of_3_or_more": chains + usize::from(run >= 3), "mind_to_mind_replies": total })))
.collect();
json!(out)
}
fn metrics(members: &[Member], lines: &[Line], rounds_of: &[usize], causes: &[Option<&str>], opening: usize, turns: &[Value], rounds: usize) -> Value {
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let cast: Vec<&str> = members.iter().map(|member| member.entry.id.as_str()).collect();
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let outcome = |turn: &&Value, what: &str| turn["outcome"] == what;
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let mut per = BTreeMap::new();
for member in members {
let mine: Vec<&Value> = turns.iter().filter(|turn| turn["id"] == member.entry.id.as_str()).collect();
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let (spoke, silent, failed) = (mine.iter().filter(|turn| outcome(turn, "spoke")).count(), mine.iter().filter(|turn| outcome(turn, "silent")).count(), mine.iter().filter(|turn| outcome(turn, "failed")).count());
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let mut addressed = BTreeMap::new();
for (at, line) in lines.iter().enumerate().skip(opening).filter(|(_, line)| line.from == member.entry.id) {
for other in members.iter().filter(|other| other.entry.id != member.entry.id) {
if is_for(&other.addressee, &line.delivery(at, &other.entry.id, lines)) {
*addressed.entry(other.entry.name.clone()).or_insert(0u64) += 1;
}
}
}
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let answered = spoke + silent;
per.insert(member.entry.name.clone(), json!({ "turns": mine.len(), "messages": spoke, "failed": failed, "silence_rate": if answered == 0 { Value::Null } else { json!(silent as f64 / answered as f64) }, "addressed": addressed }));
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
}
let half = rounds.div_ceil(2);
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let spoken_by = |keep: Keep| -> BTreeMap<String, String> {
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let mut texts = BTreeMap::new();
for (line, _) in lines.iter().zip(rounds_of).skip(opening).filter(|(line, round)| cast.contains(&line.from.as_str()) && keep(**round)) {
let text: &mut String = texts.entry(line.from.clone()).or_default();
text.push(' ');
text.push_str(&line.says);
}
texts
};
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let prose_by = |keep: Keep| -> BTreeMap<String, String> {
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let mut texts = BTreeMap::new();
for turn in turns.iter().filter(|turn| turn["round"].as_u64().is_some_and(|round| keep(round as usize))) {
let text: &mut String = texts.entry(turn["id"].as_str().unwrap_or_default().to_owned()).or_default();
text.push(' ');
text.push_str(turn["report"]["renders"][0]["persona"]["prose"].as_str().unwrap_or_default());
}
texts
};
let (all, early, late): (Keep, Keep, Keep) = (&|_| true, &|round| round <= half, &|round| round > half);
let mind_lines: Vec<&Line> = lines[opening..].iter().filter(|line| cast.contains(&line.from.as_str())).collect();
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
const CAUSES: [&str; 5] = ["addressed_by_human", "human", "addressed_by_mind", "mind", "beat"];
let count_causes = |these: &[&Value]| -> BTreeMap<&str, usize> { CAUSES.iter().map(|cause| (*cause, these.iter().filter(|turn| turn["woke"] == *cause).count())).collect() };
let wakes_by_round: Vec<Value> = (1..=rounds)
.map(|round| {
let these: Vec<&Value> = turns.iter().filter(|turn| turn["round"] == round).collect();
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
json!({ "round": round, "causes": count_causes(&these) })
})
.collect();
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let every: Vec<&Value> = turns.iter().collect();
let mind_woken: Vec<&Value> = turns.iter().filter(|turn| turn["woke"] == "addressed_by_mind").collect();
let by_how = |how: &str| mind_woken.iter().filter(|turn| turn["how"] == how).count();
let id_as_text: Vec<Value> = mind_woken.iter().filter(|turn| turn["how"] == "id as text").map(|turn| json!({ "round": turn["round"], "persona": turn["persona"], "by": turn["addressed_by"] })).collect();
let (silent, failed) = (turns.iter().filter(|turn| turn["outcome"] == "silent").count(), turns.iter().filter(|turn| turn["outcome"] == "failed").count());
let answered = turns.len() - failed;
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let work = mind_lines.iter().filter(|line| work_talk(&line.says)).count();
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
let overlaps: Vec<f64> = turns.iter().filter_map(|turn| turn["report"]["renders"][0]["heard_overlap"].as_f64()).collect();
let narration = json!({
"mean_heard_overlap": if overlaps.is_empty() { Value::Null } else { json!(overlaps.iter().sum::<f64>() / overlaps.len() as f64) },
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
"high_overlap": overlaps.iter().filter(|overlap| **overlap > OVERLAP_FLAG).count(),
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
"offers_options": turns.iter().filter(|turn| turn["report"]["renders"][0]["offers_options"] == true).count(),
"narrations": overlaps.len(),
});
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
json!({
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
"narration": narration,
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
"personas": per,
"turns": turns.len(),
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
"wakes": count_causes(&every),
"failed": failed,
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
"mind_messages": mind_lines.len(),
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
"silence_rate": if answered == 0 { Value::Null } else { json!(silent as f64 / answered as f64) },
"reply_chains": reply_chains(lines, causes, opening, &cast),
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
"convergence_lines": { "all": mean_pairwise(&spoken_by(all)), "first_half": mean_pairwise(&spoken_by(early)), "second_half": mean_pairwise(&spoken_by(late)) },
"convergence_prose": { "all": mean_pairwise(&prose_by(all)), "first_half": mean_pairwise(&prose_by(early)), "second_half": mean_pairwise(&prose_by(late)) },
"work_talk_share": if mind_lines.is_empty() { Value::Null } else { json!(work as f64 / mind_lines.len() as f64) },
"wakes_by_round": wakes_by_round,
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
"mind_addressed_wakes": { "total": mind_woken.len(), "mention_or_reply": by_how("mention or reply"), "id_as_text": by_how("id as text"), "name_in_text": by_how("name in text"), "id_as_text_wakes": id_as_text },
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
})
}
/// A line's text on one Markdown line: its paragraph breaks shown as ` / `.
fn one_line(text: &str) -> String {
text.lines().map(str::trim).filter(|line| !line.is_empty()).collect::<Vec<_>>().join(" / ")
}
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
fn number(value: &Value) -> String {
value.as_f64().map_or_else(|| "n/a".into(), |number| format!("{number:.3}"))
}
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
fn policy_words(policy: WakePolicy) -> String {
match policy {
WakePolicy::Live => "live: the operator or another Mind addressing her (the heartbeat's rule today)".into(),
WakePolicy::Ruled => "ruled: a line addressing her, from anyone, and any human line in her rooms".into(),
Speech binds to her words: a spoken line is her prose verbatim; Huginn's chat Interpreter prompt; she speaks only in the turn's room Soul's hold on #81 and Self's privacy decision. - F1: a spoken line is exactly the spans of her prose the Interpreter cites, located in order by Ghostlight's SourceSpan::locate and joined with one space. The model never writes the words; `text` is gone from the contract. The Persona writes the words she would type, never a description of them. Given up: indirect speech and any paraphrase by the Interpreter. - F3: Huginn owns a short chat Interpreter prompt (what, where, to whom; gaps conditional, addressee, elsewhere); Ghostlight's membrane and the INTERPRETER_GUIDANCE patch are gone. `[interpreter]` keeps only the model. - F2: an echo is a line of four words or more whose word trigrams are mostly the heard message bodies (heard_overlap); short answers are never echoes. - F4: mentions and reply targets only for people this packet showed her. - F5: a line said once; at most two lines a turn. - F6: stale docs on the Mind run, the exchange and the policies. - F7: a human's line ends a Mind's run only in a room the run has lines in. - Privacy: she speaks only in the turn's room; the Interpreter is told the room, its kind (public, her own, a direct message) and who is in it, and not to say in a room what she knows privately; the packet frames bond summaries and memories about a person as known privately everywhere but a direct message with that person. - The simulation's turn is in the room of the line that woke her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 05:30:00 +01:00
WakePolicy::HumansPace(cap) => format!("humans_pace (cap {cap}): a human's line wakes a Mind in her own room always, and in a public room when it addresses her or continues an exchange she is in; a Mind's line wakes another only by an explicit mention or a reply, while her current Mind-only run, across her rooms, is under {cap} lines, never by a name in prose"),
WakePolicy::NamesWithCap(cap) => format!("names_with_cap {cap}: ruled, but a Mind's line wakes no one once her current Mind-only run, across her rooms, has {cap} lines, until a human speaks where it runs"),
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
WakePolicy::AllMessages => "all_messages: any line in her rooms, a Mind's too (the old loop, the control)".into(),
}
}
/// `count` lines spread evenly over the transcript, the first and the last included.
fn representative(transcript: &[Value], count: usize) -> Vec<&Value> {
if transcript.len() <= count {
return transcript.iter().collect();
}
let mut at: Vec<usize> = (0..count).map(|index| index * (transcript.len() - 1) / (count - 1)).collect();
at.dedup();
at.into_iter().map(|index| &transcript[index]).collect()
}
fn transcript_line(line: &Value) -> String {
let who = if line["mind"] == true { line["name"].as_str().unwrap_or_default().to_owned() } else { format!("{} (human)", line["name"].as_str().unwrap_or_default()) };
let woke = line["woke"].as_str().map_or_else(String::new, |cause| format!(" _(woke: {cause})_"));
format!("- r{} {} **{who}**{woke}: {}", line["round"], line["room"].as_str().unwrap_or_default(), one_line(line["says"].as_str().unwrap_or_default()))
}
fn markdown(plan_path: &Path, plan: &SimFile, members: &[Member], group_state: Option<bool>, runs: &[Value]) -> String {
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
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");
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
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");
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let _ = writeln!(out, "- plan: `{}`", plan_path.display());
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
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(", "));
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
let _ = writeln!(out, "- rooms: {}; rounds: {}; repeats: {}; seed: {}; minutes a round: {}; she is in a room's exchange when she spoke there within {} min", plan.rooms.join(", "), plan.rounds, plan.repeats, plan.seed, plan.round_minutes, plan.exchange_minutes);
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
let owners: Vec<String> = members.iter().filter(|member| !member.entry.own_rooms.is_empty()).map(|member| format!("{}: {}", member.entry.name, member.entry.own_rooms.join(", "))).collect();
let _ = writeln!(out, "- own rooms (from the plan: neither the heartbeat's table nor `persona.env` records room ownership): {}", if owners.is_empty() { "none".to_owned() } else { owners.join("; ") });
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let _ = writeln!(out, "- wake: {}; beat: {}", policy_words(plan.wake), if plan.beat_s == 0 { "off".to_owned() } else { format!("every {} s of simulated time, one Persona by `tempo::pick`", plan.beat_s) });
let _ = writeln!(out, "- group state in the Projector's packet: {}", match group_state { Some(true) => "on", Some(false) => "off", None => "unknown (the tuning did not load)" });
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
let _ = writeln!(out, "- speech: the Interpreter's lines, each posted to its room; none is silence");
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let _ = writeln!(out, "- wakes are counted per wake, by its strongest cause: addressed by a human, a human line, addressed by a Mind, a Mind's line (control only), the beat. A Mind-addressed wake's evidence is its strongest: a Matrix mention or reply, her id written as text, a name in the text");
let _ = writeln!(out, "- silence rate is per woken turn that did not fail; a failed call is counted apart. Reply chains are per room: Mind lines spoken in turns another Mind's line woke, in a row");
let _ = writeln!(out, "- convergence is the mean pairwise cosine of speakers' word counts (lexical, cheap); work-talk share is a lexical heuristic over a fixed word list, not a classifier");
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let _ = writeln!(out, "- read-only: nothing is posted, no state is put, no Mind is asked\n");
for run in runs {
let metrics = &run["metrics"];
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let wakes = &metrics["wakes"];
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let _ = writeln!(out, "## Repeat {} (seed {})\n", run["repeat"], run["seed"]);
let _ = writeln!(out, "### Metrics\n");
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let _ = writeln!(
out,
"- wakes: {} (addressed by a human {}, a human line {}, addressed by a Mind {}, a Mind's line {}, the beat {}); failed {}",
metrics["turns"], wakes["addressed_by_human"], wakes["human"], wakes["addressed_by_mind"], wakes["mind"], wakes["beat"], metrics["failed"]
);
let _ = writeln!(out, "- Mind messages: {}; silence rate per woken turn: {}", metrics["mind_messages"], number(&metrics["silence_rate"]));
if let Some(rooms) = metrics["reply_chains"].as_object() {
for (room, chain) in rooms {
let _ = writeln!(out, "- reply chains in {room}: longest {}, chains of 3 or more {}, Mind-to-Mind replies {}", chain["longest"], chain["chains_of_3_or_more"], chain["mind_to_mind_replies"]);
}
}
let addressed = &metrics["mind_addressed_wakes"];
let _ = writeln!(out, "- Mind-addressed wakes: {} (Matrix mention or reply {}, her id written as text {}, a name in the text {})", addressed["total"], addressed["mention_or_reply"], addressed["id_as_text"], addressed["name_in_text"]);
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let _ = writeln!(out, "- convergence of spoken lines: all {}, first half {}, second half {}", number(&metrics["convergence_lines"]["all"]), number(&metrics["convergence_lines"]["first_half"]), number(&metrics["convergence_lines"]["second_half"]));
let _ = writeln!(out, "- convergence of prose: all {}, first half {}, second half {}", number(&metrics["convergence_prose"]["all"]), number(&metrics["convergence_prose"]["first_half"]), number(&metrics["convergence_prose"]["second_half"]));
Projector and Persona after the operator's reading; humans_pace per ruling; Soul's hold on #80 Projector (the operator: "Sounds like a Projector issue"): - The group state is the conversation as it stands, in one room: who is talking with whom, a human's question to the room that others answered as covered (one nobody answered goes unmentioned), when a human last spoke, Mind lines in a row, and a human waiting on her by name. Never what she owes. Every count covers the window the line describes (S4); never several rooms folded together, never a direct message into a public room (S3). Default group_lines 12. - Absent state is left out: no "mood: none recorded"; a bond, need, memory, stance, wondering or value without content is not rendered, and a bond without trust or tension says neither. - Guidance: never retell what she heard (it reaches her verbatim), render what it stirs; never a debt; no options; leave out what the context does not carry; use pronouns as given. Metrics, not filters: heard_overlap (word trigrams shared with the heard lines) and offers_options (a narrow lexical flag), per render and per run. - Pronouns: `[pronouns]` in the tuning by Matrix id, the swarm's people as the default, they/them for anyone else; the persona schema has no pronoun field for another person. A pronoun line names everyone the packet shows from the room. The packet speaks of her in her own pronouns throughout ("Said to him:") (S5). - Bond lines put the kind after a dash and lists use semicolons: a label may hold a comma ("Meta, the operator"). Persona stage: continues her inner stream in the first person; speech only where her thought moves her to it, in double quotes; others' words she recalls in single quotes; @handle tags someone. The report shows her inner prose apart from what she would say. humans_pace (ruling persona-only-humans-pace; the operator's words that Minds' explicit mentions wake too): `HumansPace(cap)`: a human's line wakes her in her own room or a direct message always, and in a public room when it addresses her or continues an exchange she is in (an exchange ends at a gap over exchange_gap_minutes, default 20); a Mind's line wakes her only by a Matrix mention or a reply, in any room, while fewer than `cap` Mind lines in a row came before it. Own rooms come from the plan: neither the heartbeat's table nor persona.env records ownership. Live is unchanged. In the simulation a said line's @handle of a cast member stands in for a Matrix mention. Soul's hold: - S1: Config::new refuses an operator id that is also a persona's. - S2: the simulator's beat asks heartbeat::addressed_by_member over the deliveries the mouth would give her. - S3: --in given as a room id is read by its alias. - S6: a scripted direct message names its recipient (`to`), is seen by sender and recipient alone, and wakes only her. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:23:06 +01:00
let _ = writeln!(out, "- work-talk share of Mind lines (heuristic): {}", number(&metrics["work_talk_share"]));
let narration = &metrics["narration"];
The Interpreter's speech (C3b): what she says is decided from her prose, not parsed from quotes; Soul's F2 to F9 Speech (Soul F1): `projection::interpret` is the Interpreter's speech step, one tool-less structured call through the connector under Ghostlight's Interpreter membrane, over her prose, her lived stream, the stimulus, the rooms she may speak in and the people she may address by Matrix id. It proposes lines, each with a room, structured mentions and a reply target, and the verbatim span of her prose it rests on. Code keeps a line only when the span locates in her prose (Ghostlight's SourceSpan::locate, map 4.3), the room is hers this turn, and its words are not what she heard; it drops mentions or a reply target naming anyone not shown, and records every refusal and drop. An answer that is not the contract is a failure, never a silence. `--through interpreter`; the batch and the simulation run through it, and in the simulation the only explicit addressees are its structured fields. `would_say`, `inner` and the quote parsing are gone; the Persona stage writes her thought with no speech convention. Tuning gains `[interpreter]`. - F2: she is in a room's exchange when she spoke there within `exchange_minutes` (default 30). - F3: the Projector guidance names no duty, not even to deny one; "X is waiting on her" only when true. - F4: the narration metric is a lexical overlap, labeled so. - F5: a scripted direct message in one of the plan's rooms is refused. - F6: the Mind-run cap counts one run per Mind across her rooms; LineFacts::default() is at the cap (fail-safe). - F7: an unbonded sender is labeled by display name and full id, or the id: never a bare handle. - F8: a room is named by the key the tail carries (alias, or a direct message's id); a public room's id is reported, not mapped, since no table in her body maps it. - F9: group-state parts are sentences, the person waiting on her first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 04:54:37 +01:00
let _ = writeln!(out, "- narrations: {}; mean lexical overlap with what she heard {}; over {OVERLAP_FLAG}: {}; offering her options {}\n", narration["narrations"], number(&narration["mean_heard_overlap"]), narration["high_overlap"], narration["offers_options"]);
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let _ = writeln!(out, "| persona | wakes | messages | failed | silence rate | addressed |\n|---|---|---|---|---|---|");
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
if let Some(personas) = metrics["personas"].as_object() {
for (name, row) in personas {
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let named = row["addressed"].as_object().map(|map| map.iter().map(|(who, count)| format!("{who} {count}")).collect::<Vec<_>>().join(", ")).unwrap_or_default();
let _ = writeln!(out, "| {name} | {} | {} | {} | {} | {named} |", row["turns"], row["messages"], row["failed"], number(&row["silence_rate"]));
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
}
}
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let _ = writeln!(out, "\n### Wakes by round\n\n| round | addressed by a human | a human line | addressed by a Mind | a Mind's line | beat |\n|---|---|---|---|---|---|");
for row in metrics["wakes_by_round"].as_array().into_iter().flatten() {
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let causes = &row["causes"];
let _ = writeln!(out, "| {} | {} | {} | {} | {} | {} |", row["round"], causes["addressed_by_human"], causes["human"], causes["addressed_by_mind"], causes["mind"], causes["beat"]);
}
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let as_text = addressed["id_as_text_wakes"].as_array().cloned().unwrap_or_default();
if !as_text.is_empty() {
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let _ = writeln!(out, "\nWakes whose only address was an id written as text (no mention, no reply):\n");
for one in as_text {
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let by = one["by"].as_array().into_iter().flatten().map(|by| format!("{}: {}", by["from"].as_str().unwrap_or_default(), one_line(by["says"].as_str().unwrap_or_default()))).collect::<Vec<_>>().join("; ");
let _ = writeln!(out, "- r{} {}: {by}", one["round"], one["persona"].as_str().unwrap_or_default());
}
}
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let transcript = run["transcript"].as_array().cloned().unwrap_or_default();
let _ = writeln!(out, "\n### Representative lines\n");
for line in representative(&transcript, REPRESENTATIVE_LINES) {
let _ = writeln!(out, "{}", transcript_line(line));
}
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let _ = writeln!(out, "\n### Transcript\n");
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
for line in &transcript {
let _ = writeln!(out, "{}", transcript_line(line));
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
}
let _ = writeln!(out, "\n### Turns\n");
for turn in run["turns"].as_array().into_iter().flatten() {
Harness fixes after Soul's hold on #79: one owner of the wake rule, the heartbeat's beat, group state in the Projector - F1: `heartbeat::wakes(policy, addressee, delivery, speaker, mind_run)` is the one wake rule. The poll asks it with `WakePolicy::Live` (behaviour unchanged until `po-mind-wakes-mind` is answered); the simulator asks it with the plan's policy: `ruled`, `humans_pace`, `names_with_cap = N`, `all_messages`. The simulator reads each persona's addressee from the heartbeat's addressing table (stewarded project names included) when the plan names `heartbeat.cc`. - F2: the beat falls on `beat_s` of simulated time and wakes one Persona, the winner of `tempo::pick`. - F5: Mind-addressed evidence is counted per wake (its strongest evidence), not per line. - F6: reply chains are per room and count Mind lines spoken in turns another Mind's line woke. - F7: a failed call is a failure, apart from silence; silence rate is per woken turn that did not fail. - F8: a test that another seed changes the order. - F9: `--state` docs say P4 and P5 are not checked. - Group state (`select.group_state`, default on): one packet line over the room's last `group_lines` lines: who spoke to whom, when a human last spoke, how many Mind lines in a row, lines to her, an open question to everyone. Inside the context budget, narrated by the Projector like every other line; golden fixtures for the four scenario rooms. - Reports: wakes by cause and by round, per-room chains, failures, 18 representative lines, the explicit-addressee gap. - Tuning: `persona.words` and `persona.guidance` get the upper bounds the Projector's knobs have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 03:40:38 +01:00
let _ = writeln!(out, "<details><summary>round {}, {} (woke: {}, {} turn, {}): {}</summary>\n", turn["round"], turn["persona"].as_str().unwrap_or_default(), turn["woke"].as_str().unwrap_or_default(), turn["kind"].as_str().unwrap_or_default(), turn["room"].as_str().unwrap_or_default(), turn["outcome"].as_str().unwrap_or_default());
mind-persona project: the persona seed harness (--room, --through persona, --batch, --simulate) The harness judges candidate persona states before any Mind holds them, through the same `project` the live turn will use: every case is one `project` call. - `--room <fixture.toml>`: a mocked room in place of the mouth and the room tail: her id, rooms, messages (sender, display name, room, ago, body; new, tag, mentions, dm, follow_up, reply_to), a mocked now and a "last heard from" table. The fixture is a MouthReader, so addressing is still `address::is_for`. The live room filter that `--room` used to name is now `--in`. - `--state` is checked as a put checks content: huginn-mind's P1 to P3 now live in one owner, `persona::validate_document`, which the put calls. - `--through persona`: the Persona stage (C3b's first piece). One tool-less connector call under Ghostlight's persona membrane over identity, narration and the heard lines; prose capped at 180 words; would-say lines are the double-quoted spans; usage per call. Tuning gains `[persona]` (model, guidance, words). - `--batch <plan> --out <md>`: states x scenarios x samples, one Markdown report with packets, narration, prose, would-say lines, word counts, distinct-2 and cross-state word similarity, and a total-usage footer. - `--simulate <plan> --out <md>`: up to eight personas taking turns in one room. Wake is is_for plus the ruled set (addressed, any human in her rooms, the beat); `wake = "all_messages"` is the old loop as a control. Woken personas run in a seeded order; quoted lines join the room as from her id. State does not evolve (`state_after_turn` is the seam for C3b/C3c). Metrics: messages, silence, who addresses whom, Mind-to-Mind chains, lexical convergence, a work-talk heuristic, usage. - With a state file and a fixture no daemon and no mouth is needed (bin test). - Request ids take the wall clock, so a fixture's fixed now cannot replay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 00:33:13 +01:00
let report = &turn["report"];
if let Some(error) = report.get("error") {
let _ = writeln!(out, "**failed:** {}\n", error.as_str().unwrap_or_default());
} else {
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]);
}
let _ = writeln!(out, "</details>\n");
}
}
let _ = writeln!(out, "## Total usage\n\n{}", usage_markdown(&usage_total(runs)));
out
}
#[cfg(test)]
mod tests;