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": {