diff --git a/crates/weksa/src/validate.rs b/crates/weksa/src/validate.rs index 49c670f..71c92d5 100644 --- a/crates/weksa/src/validate.rs +++ b/crates/weksa/src/validate.rs @@ -4,7 +4,7 @@ //! lowerer sees, comes from `PacketStore::admit` alone, which builds it from //! the admitted packet and its corpus item through the crate-private //! `LoweringInput::of`. The stance is checked like every feature -//! list, in slot `Stance`. The rules are V1..V8, V10..V12 and V14..V17: the +//! list, in slot `Stance`. The rules are V1..V8, V10..V12 and V14..V18: the //! shape of an id or a grade is its type's parse, not a rule, so V9 is retired //! and not renumbered; V13 is retired too. [`LoweringInput::with_scene`] reads the //! scene of the view's own item group from the speaker-state store, and @@ -120,6 +120,12 @@ pub enum Refusal { V17AddresseeNotAReferent { id: NodeId, }, + /// V18: a predication whose frame is the inventory's `request_intervention`, + /// with no `addressee_consent` naming it. It says what the addressee did, so + /// only the packet's own record may license it. + V18RequestWithoutConsent { + predication: NodeId, + }, } impl Refusal { @@ -144,6 +150,7 @@ impl Refusal { Refusal::V15ConsentSource { .. } => "V15", Refusal::V16SpeakerNotInScene => "V16", Refusal::V17AddresseeNotAReferent { .. } => "V17", + Refusal::V18RequestWithoutConsent { .. } => "V18", } } } @@ -173,6 +180,9 @@ impl fmt::Display for Refusal { "the scene does not cover the speaker of every live item of its group" } Refusal::V17AddresseeNotAReferent { .. } => "the addressee names no referent", + Refusal::V18RequestWithoutConsent { .. } => { + "a request frame needs the addressee's consent naming it" + } }; write!(f, "{}: {what}", self.rule()) } @@ -221,6 +231,7 @@ pub fn validate(packet: &Packet, inventory: &Inventory) -> Result<(), Vec, out: &mut Vec) { + for p in &packet.predications { + if inventory + .resolve(&p.frame, packet.inventory_rev) + .is_some_and(|e| e.gloss == REQUEST_FRAME_GLOSS) + && packet.discourse.addressee_consent.as_ref() != Some(&p.id) + { + out.push(Refusal::V18RequestWithoutConsent { + predication: p.id.clone(), + }); + } + } +} + fn node_lists(packet: &Packet) -> [(&Vec, &'static str); 3] { [ (&packet.context.participants, "participant"), diff --git a/crates/weksa/tests/display.rs b/crates/weksa/tests/display.rs index e82b5fb..de4369c 100644 --- a/crates/weksa/tests/display.rs +++ b/crates/weksa/tests/display.rs @@ -104,6 +104,7 @@ fn refusal_display_names_the_rule_and_no_identifier() { }, Refusal::V16SpeakerNotInScene, Refusal::V17AddresseeNotAReferent { id: node() }, + Refusal::V18RequestWithoutConsent { predication: node() }, ]; assert_eq!( Refusal::V16SpeakerNotInScene.to_string(), diff --git a/docs/interlingua-standard.md b/docs/interlingua-standard.md index cfed562..80e6faa 100644 --- a/docs/interlingua-standard.md +++ b/docs/interlingua-standard.md @@ -164,6 +164,7 @@ names the rule. `GameTelemetry`; a decomposition of text or imported corpus text cannot mint it. - V17: an `addressee` names a referent, not a predication. +- V18: a predication whose frame is the inventory's `request_intervention` is named by `addressee_consent`. V9 is retired and not renumbered: the form of a key or a grade is its type, and an extension key's family is V6. `PacketStore::admit` returns the lowering view of a