Persona schema: a hold's releasedBy.act is heard alone (K39 cleanup)

K39 deleted the release by her prose; commit::hold_release writes only
{act: "heard"}, and no stored variant state carries "prose" (checked under
/var/tmp/persona-variants). The enum's "prose" let an outside put record a
release no code path can make. Pinned by a_hold_is_released_only_by_a_
heard_line in huginn-mind's persona schema tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-22 09:00:24 +01:00
commit 184076f3c2
2 changed files with 18 additions and 2 deletions

View file

@ -344,6 +344,23 @@ mod tests {
assert!(!validator.is_valid(&unknown), "a status the record does not name is refused");
}
/// Map 16.29.3 (K39): only the asker's line releases a hold, so `releasedBy.act` is `heard` alone; a release by her
/// prose, which no writer makes, is refused at the door.
#[test]
fn a_hold_is_released_only_by_a_heard_line() {
let schema = schema_file();
let validator = jsonschema::draft7::new(&schema).unwrap();
let hold = |act: &str| json!({
"id": "h1", "from": "@meta:gamecult.org", "room": "#minds:gamecult.org", "event": "$q3", "madeAt": T1, "words": null,
"status": "released", "releasedAt": T1, "releasedBy": { "act": act, "event": "$q9" }
});
let mut with = persona(INSTANCE, T1);
with["holds"] = json!([hold("heard")]);
assert!(validator.is_valid(&with), "{:?}", validator.iter_errors(&with).map(|error| error.to_string()).collect::<Vec<_>>());
with["holds"] = json!([hold("prose")]);
assert!(!validator.is_valid(&with), "a release by her prose has no writer and is refused");
}
#[test]
fn declared_names_are_every_property_name_at_any_depth() {
let schema = json!({

View file

@ -1159,8 +1159,7 @@
"act": {
"type": "string",
"enum": [
"heard",
"prose"
"heard"
]
},
"event": {