From ec2320443a06b230e451000b15eb3a56af0e6299 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 31 Oct 2026 09:54:51 +0100 Subject: [PATCH] persona: the reply schema tells the model that omitting the vote leaves it and null only withdraws (null-vote-habit-withdraws) Co-Authored-By: Claude Sonnet 5.5 --- crates/mind-body/src/persona.rs | 2 +- crates/mind-body/src/persona/tests.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/mind-body/src/persona.rs b/crates/mind-body/src/persona.rs index 20737ad..2e8305b 100644 --- a/crates/mind-body/src/persona.rs +++ b/crates/mind-body/src/persona.rs @@ -285,7 +285,7 @@ pub fn reply_schema(rooms: &[String], campaigns: &[String]) -> String { } }, "start_self_run": start, - "tempo_vote_beat_s": { "anyOf": [{ "type": "null" }, { "type": "integer", "minimum": TEMPO_VOTE_MIN_S, "maximum": TEMPO_VOTE_MAX_S }] }, + "tempo_vote_beat_s": { "description": "Omit this key to leave your standing vote unchanged. A number votes that many seconds per beat. null only withdraws your vote, so you count as silent again.", "anyOf": [{ "type": "null" }, { "type": "integer", "minimum": TEMPO_VOTE_MIN_S, "maximum": TEMPO_VOTE_MAX_S }] }, "urgency_permille": { "anyOf": [{ "type": "null" }, { "type": "integer", "minimum": 0, "maximum": URGENCY_MAX_PERMILLE }] } } }) diff --git a/crates/mind-body/src/persona/tests.rs b/crates/mind-body/src/persona/tests.rs index d093e8f..38fea55 100644 --- a/crates/mind-body/src/persona/tests.rs +++ b/crates/mind-body/src/persona/tests.rs @@ -925,6 +925,11 @@ fn the_reply_schema_bounds_the_vote_and_the_urgency_to_the_pulse_kind() { let schema: serde_json::Value = serde_json::from_str(&reply_schema(&["operator".to_string()], &[])).unwrap(); assert_eq!(schema["required"], json!(["say", "start_self_run", "urgency_permille"])); assert_eq!(schema["properties"]["tempo_vote_beat_s"]["anyOf"][1], json!({ "type": "integer", "minimum": 60, "maximum": 86_400 })); + let described = schema["properties"]["tempo_vote_beat_s"]["description"].as_str().expect("the vote key is described to the model"); + assert!( + described.contains("Omit") && described.contains("unchanged") && described.contains("null only withdraws"), + "omit leaves the vote, a number votes, null only withdraws: {described}" + ); assert_eq!(schema["properties"]["urgency_permille"]["anyOf"][1], json!({ "type": "integer", "minimum": 0, "maximum": 1000 })); }