From 184076f3c27b825ee02aab5f74ba30bbd4020264 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 22 Nov 2026 09:00:24 +0100 Subject: [PATCH] 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 --- crates/huginn-mind/src/persona.rs | 17 +++++++++++++++++ .../gamecult.persona_state.v0.schema.json | 3 +-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/crates/huginn-mind/src/persona.rs b/crates/huginn-mind/src/persona.rs index 5dfe510..c513c92 100644 --- a/crates/huginn-mind/src/persona.rs +++ b/crates/huginn-mind/src/persona.rs @@ -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::>()); + 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!({ diff --git a/schemas/cultnet/gamecult.persona_state.v0.schema.json b/schemas/cultnet/gamecult.persona_state.v0.schema.json index 1eb5ed8..4a5a320 100644 --- a/schemas/cultnet/gamecult.persona_state.v0.schema.json +++ b/schemas/cultnet/gamecult.persona_state.v0.schema.json @@ -1159,8 +1159,7 @@ "act": { "type": "string", "enum": [ - "heard", - "prose" + "heard" ] }, "event": {