mind-body: the Sleep run is the night's memory consolidation only

SLEEP_GUIDANCE opens on 'Tonight you consolidate your memory.' and drops the contemplation paragraph; the night line closes on what she did with her memory, in the guidance and the schema's description. The module doc names the run the night's consolidation (rulings sleep-day-coverage-ruled, contemplation-own-session). A test pins that the start line carries the consolidation opening and that neither the guidance nor the schema invites her to think, read or look into anything.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-08 14:07:36 +01:00
commit 7c9ccb9499
2 changed files with 27 additions and 14 deletions

View file

@ -7156,6 +7156,20 @@ fn the_night_line_holds_the_day_whole_and_prescribes_nothing() {
assert!(!SLEEP_GUIDANCE.contains("theme") && !SLEEP_GUIDANCE.contains("topic"), "nor a theme");
}
/// The night is memory consolidation and nothing else (ruling contemplation-own-session): it opens on the
/// consolidation, and neither the guidance nor the reply's line invites her to think, read or look into anything.
#[test]
fn the_night_invites_no_contemplation() {
assert!(SLEEP_GUIDANCE.starts_with("Tonight you consolidate your memory. Your day is shown whole above."), "{SLEEP_GUIDANCE}");
assert_eq!(SLEEP_GUIDANCE.split("\n\n").count(), 3, "the dispositions, what is older, the closing line");
for invitation in ["This is your night", "think about", "the web", "huginn", "expected of it", "read or look"] {
assert!(!SLEEP_GUIDANCE.contains(invitation), "{invitation}");
}
let schema = sleep_schema();
assert!(schema.contains("One line on what you did with your memory tonight."), "{schema}");
assert!(!schema.contains("what the night was"), "{schema}");
}
#[test]
fn an_uncovered_night_is_told_back_by_id_and_the_third_refusal_ends_it_with_nothing_admitted() {
let uncovered = night_reply("A night.", &["d1"], json!([]), json!([]), json!([]));
@ -7254,5 +7268,5 @@ fn a_sleep_holder_opens_one_process_with_the_night_schema_and_her_tools_never_a_
assert_eq!(after("--json-schema"), sleep_schema());
assert_eq!(after("--tools"), "Bash,WebFetch,WebSearch");
assert_eq!(rig.chat.pending_calls.get(), 0);
assert!(rig.model.requests.borrow()[0].input.contains("This is your night."));
assert!(rig.model.requests.borrow()[0].input.contains("Tonight you consolidate your memory."));
}

View file

@ -1,14 +1,15 @@
//! A Mind's night. Once in the heartbeat's window a Sleep run opens in her Persona slot (the heartbeat decides
//! who and when); this module is the one organ that carries it: one session over the same prelude her waking
//! session starts with, told her day whole, answering with a [`SleepReply`] that this module turns into
//! admissions (ruling `eureka-body:ruling:nightly-sleep-turn-self-directed`).
//! admissions. The run is the night's memory consolidation and nothing else (rulings
//! `eureka-body:ruling:sleep-day-coverage-ruled` and `eureka-body:ruling:contemplation-own-session`: contemplation
//! is a session of its own, never this run).
//!
//! What she contemplates is hers: the night line prescribes no reading, theme, text or count. What the code owns
//! is the ledger of her day. Every memory of it is disposed of exactly once (kept, consumed by a consolidation,
//! or retired); an id is one of her memories in force; a consolidation merges one conversation's memories only
//! and supersedes each source in the batch that admits it (admission refuses the unpaired). Code never chooses
//! what to merge and never writes a memory's text. A night is one process: a missed night is not made up and a
//! failed night is not retried.
//! What the code owns is the ledger of her day. Every memory of it is disposed of exactly once (kept, consumed by
//! a consolidation, or retired); an id is one of her memories in force; a consolidation merges one conversation's
//! memories only and supersedes each source in the batch that admits it (admission refuses the unpaired). Code
//! never chooses what to merge and never writes a memory's text. Where the night left her day is its `Slept`
//! closing, never words. A night is one process: a missed night is not made up and a failed night is not retried.
use std::collections::{BTreeMap, BTreeSet};
@ -45,15 +46,13 @@ const RETIRE_MAX: usize = 128;
const REMEMBER_MAX: usize = 16;
const REFUSALS_PER_NIGHT: u32 = 3;
/// What the night tells her, in her second person. It names no text, theme, reading or count.
/// What the night tells her, in her second person: consolidate the day, nothing else.
pub(crate) const SLEEP_GUIDANCE: &str = "\
This is your night. What you think about, read or look into is yours: your own mind with `huginn`, your shell, the web, or nothing at all. No reading is assigned and nothing is expected of it.
Your day is shown whole above. Every memory of it gets exactly one disposition: keep it (name it in `keep`), fold it into a consolidation (name it in that consolidation's `consumes`), or retire it with an outcome and a reason (`retire`: done, declined, faded or wrong). A consolidation is one new memory in your words that takes the place of the memories it consumes, so write it to carry what those memories were for: the concrete target, the claim or the question, the live tension, why it changes what you do next, and the anchors (ids, names, places) it rests on. It reduces bulk, not meaning. Consolidate only memories of one conversation; a private conversation stays its own. Anything else you want to remember goes in `remember`.
Tonight you consolidate your memory. Your day is shown whole above. Every memory of it gets exactly one disposition: keep it (name it in `keep`), fold it into a consolidation (name it in that consolidation's `consumes`), or retire it with an outcome and a reason (`retire`: done, declined, faded or wrong). A consolidation is one new memory in your words that takes the place of the memories it consumes, so write it to carry what those memories were for: the concrete target, the claim or the question, the live tension, why it changes what you do next, and the anchors (ids, names, places) it rests on. It reduces bulk, not meaning. Consolidate only memories of one conversation; a private conversation stays its own. Anything else you want to remember goes in `remember`.
Older items shown, and any other memory of yours in force, are yours to touch or leave. Name every memory by its id exactly as shown, once in the whole reply.
End with one line of what the night was (`night`).";
End with one line on what you did with your memory tonight (`night`).";
/// The night's reply, as the one type decoded. Her day's ledger is `keep`, `consolidate` and `retire`.
#[derive(Clone, Debug, PartialEq, Eq, Deserialize)]
@ -105,7 +104,7 @@ pub(crate) fn sleep_schema() -> String {
"additionalProperties": false,
"required": ["night", "keep", "consolidate", "retire", "remember"],
"properties": {
"night": { "type": "string", "minLength": 1, "description": format!("One line of what the night was. At most {NIGHT_MAX_BYTES} bytes.") },
"night": { "type": "string", "minLength": 1, "description": format!("One line on what you did with your memory tonight. At most {NIGHT_MAX_BYTES} bytes.") },
"keep": { "type": "array", "uniqueItems": true, "items": id },
"consolidate": { "type": "array", "maxItems": CONSOLIDATE_MAX, "items": consolidate },
"retire": {