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 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-31 09:54:51 +01:00
commit ec2320443a
2 changed files with 6 additions and 1 deletions

View file

@ -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 }] }
}
})

View file

@ -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 }));
}