diff --git a/crates/mind-body/src/persona.rs b/crates/mind-body/src/persona.rs index 6d64699..d691d87 100644 --- a/crates/mind-body/src/persona.rs +++ b/crates/mind-body/src/persona.rs @@ -867,8 +867,7 @@ fn ruling_ids_in(text: &str) -> Vec { /// bound drops is counted in the text. fn render_responsibilities(mind: &dyn MindPort, instance: &Slug) -> Result { let claimed: Vec = live_claims(mind, instance, &[])?; - let mut out = String::from("What you are responsible for (from your own mind; `huginn view ` reads a record): -"); + let mut out = String::from("What you are responsible for (from your own mind; `huginn view ` reads a record):\n"); let mut cited: Vec = Vec::new(); let mut cite = |ids: Vec| { for id in ids { @@ -880,15 +879,13 @@ fn render_responsibilities(mind: &dyn MindPort, instance: &Slug) -> Result Result GOALS_MAX_BYTES - GOALS_RULINGS_RESERVE { dropped += 1; continue; } if !heading { - out.push_str("Open follow-ups, newest first: -"); + out.push_str("Open follow-ups, newest first:\n"); heading = true; } if source.kind == PipelineKind::Ruling { @@ -919,18 +913,15 @@ fn render_responsibilities(mind: &dyn MindPort, instance: &Slug) -> Result 0 { - out.push_str(&format!("({dropped} older open follow-ups not shown: `huginn query` lists them all.) -")); + out.push_str(&format!("({dropped} older open follow-ups not shown: `huginn query` lists them all.)\n")); } let mut dropped_rulings = cited.len().saturating_sub(GOALS_RULINGS_MAX); cited.truncate(GOALS_RULINGS_MAX); if !cited.is_empty() { - out.push_str("Rulings these cite: -"); + out.push_str("Rulings these cite:\n"); } for id in &cited { let keys = Selection { keys: Some(vec![id.clone()]), ..of_kind(PipelineKind::Ruling) }; @@ -941,8 +932,7 @@ fn render_responsibilities(mind: &dyn MindPort, instance: &Slug) -> Result None, }); - let line = format!("- {id}: {} -", title.as_deref().unwrap_or("not in your mind")); + let line = format!("- {id}: {}\n", title.as_deref().unwrap_or("not in your mind")); if out.len() + line.len() > GOALS_MAX_BYTES { dropped_rulings += 1; } else { @@ -950,8 +940,7 @@ fn render_responsibilities(mind: &dyn MindPort, instance: &Slug) -> Result 0 { - out.push_str(&format!("({dropped_rulings} more cited rulings not shown.) -")); + out.push_str(&format!("({dropped_rulings} more cited rulings not shown.)\n")); } Ok(out) } @@ -1051,6 +1040,8 @@ fn render_input(config: &Config, deliveries: &[ChatDelivery], history: &[String] out.push_str(&format!("- {line}\n")); } out.push('\n'); + out.push_str(goals); + out.push('\n'); if deliveries.is_empty() { out.push_str("No new messages. This is a scheduled wake: decide whether to speak or to start work.\n"); } diff --git a/crates/mind-body/src/persona/tests.rs b/crates/mind-body/src/persona/tests.rs index 055d49c..fa540b5 100644 --- a/crates/mind-body/src/persona/tests.rs +++ b/crates/mind-body/src/persona/tests.rs @@ -865,8 +865,7 @@ fn a_turn_shows_her_stewardships_follow_ups_and_the_rulings_they_cite() { rig.mind.committed(vec![ruling("client-first", None)]); rig.mind.committed(vec![steward_of("GameCult/cinny", "the chat client; design law in eureka-body:ruling:client-first.")]); rig.mind.committed(vec![open_follow_up("older", &ruling_ref, "Wire the thing.")]); - rig.mind.committed(vec![open_follow_up("newer", &spec_ref("x"), "Ship the other thing. -Second line.")]); + rig.mind.committed(vec![open_follow_up("newer", &ruling_ref, "Ship the other thing.\nSecond line.")]); let input = first_input(&rig); assert!(input.contains("What you are responsible for"), "{input}"); assert!(input.contains("- steward of GameCult/cinny: the chat client; design law in eureka-body:ruling:client-first."), "{input}"); @@ -887,7 +886,8 @@ fn a_mind_with_nothing_to_answer_for_says_so() { #[test] fn the_responsibilities_hold_their_bound_and_mark_what_they_drop() { let rig = Rig::new(vec![], &[]); - let source = spec_ref("x"); + rig.mind.committed(vec![ruling("src", None)]); + let source = reference(K::Ruling, &id("ruling", "src")); let long = "w".repeat(400); for n in 0..30 { rig.mind.committed(vec![open_follow_up(&format!("fu-{n:02}"), &source, &long)]);