From 14e1a08984a21d9c53451136455dabcb23041240 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 18 Aug 2026 01:50:47 +0200 Subject: [PATCH] Admit targetless local communication --- crates/ghostlight-dungeon/src/domain.rs | 6 ++ crates/ghostlight-dungeon/src/kernel.rs | 71 ++++++++++++++++--- crates/ghostlight-dungeon/src/persona.rs | 33 ++++++--- crates/ghostlight-dungeon/src/resolution.rs | 20 +++--- .../ghostlight-multiresolution-agency.md | 7 ++ notes/fresh-workspace-handoff.md | 9 +++ notes/ghostlight-current-system-map.md | 8 ++- 7 files changed, 123 insertions(+), 31 deletions(-) diff --git a/crates/ghostlight-dungeon/src/domain.rs b/crates/ghostlight-dungeon/src/domain.rs index 3f3d58e..3cc062b 100644 --- a/crates/ghostlight-dungeon/src/domain.rs +++ b/crates/ghostlight-dungeon/src/domain.rs @@ -472,6 +472,12 @@ pub enum StrategicActivityKind { Communicate, } +impl StrategicActivityKind { + pub fn allows_targetless_local_attempt(&self) -> bool { + matches!(self, Self::Prepare | Self::Investigate | Self::Communicate) + } +} + #[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] pub struct CellActionProposal { pub subject_id: String, diff --git a/crates/ghostlight-dungeon/src/kernel.rs b/crates/ghostlight-dungeon/src/kernel.rs index 3118f10..53af352 100644 --- a/crates/ghostlight-dungeon/src/kernel.rs +++ b/crates/ghostlight-dungeon/src/kernel.rs @@ -1437,11 +1437,7 @@ fn apply_strategic_tick_plan( crate::resolution::strategic_activity_targets(campaign, &action.gestalt_id); let unique_targets = action.target_subject_ids.iter().collect::>(); let unique_locations = action.location_ids.iter().collect::>(); - let needs_target = !matches!( - action.activity, - crate::domain::StrategicActivityKind::Prepare - | crate::domain::StrategicActivityKind::Investigate - ); + let needs_target = !action.activity.allows_targetless_local_attempt(); if action.target_subject_ids.len() > 4 || unique_targets.len() != action.target_subject_ids.len() || action @@ -1593,10 +1589,7 @@ fn apply_strategic_tick_plan( crate::resolution::dormant_member_location(campaign, &action.member_id) .map_err(|error| KernelError::Invalid(error.to_string()))?; let unique_targets = action.target_subject_ids.iter().collect::>(); - let needs_target = !matches!( - action.activity, - StrategicActivityKind::Prepare | StrategicActivityKind::Investigate - ); + let needs_target = !action.activity.allows_targetless_local_attempt(); if action.target_subject_ids.len() > 4 || unique_targets.len() != action.target_subject_ids.len() || action @@ -1733,6 +1726,9 @@ fn strategic_activity_summary( (StrategicActivityKind::Trade, false) => { format!("{source_name} offers a trade to {targets}.") } + (StrategicActivityKind::Communicate, true) => { + format!("{source_name} attempts a local communication.") + } (StrategicActivityKind::Communicate, false) => { format!("{source_name} sends a communication to {targets}.") } @@ -2560,6 +2556,63 @@ mod tests { assert!(events[0].institution_ids.is_empty()); } + #[test] + fn local_communication_records_the_source_without_inventing_a_listener() { + let mut value = hierarchical_refugee_campaign(); + let before = value.clone(); + let events = apply_strategic_tick_plan( + &mut value, + StrategicTickPlan { + gestalt_activities: vec![StrategicGestaltActivity { + gestalt_id: "refugees-east".into(), + activity: StrategicActivityKind::Communicate, + target_subject_ids: vec![], + location_ids: vec!["camp".into()], + public_channels: vec![], + }], + ..Default::default() + }, + ) + .unwrap(); + assert_eq!(value, before); + assert_eq!( + events[0].summary, + "Eastern transit refugees attempts a local communication." + ); + assert!(events[0].actor_ids.is_empty()); + assert!(events[0].institution_ids.is_empty()); + assert_eq!(events[0].gestalt_ids, vec!["refugees-east"]); + } + + #[test] + fn dormant_member_can_speak_locally_without_inventing_a_listener() { + let mut value = hierarchical_refugee_campaign(); + let before = value.clone(); + let events = apply_strategic_tick_plan( + &mut value, + StrategicTickPlan { + member_activities: vec![StrategicMemberActivity { + member_id: "mira".into(), + source_gestalt_id: "refugees-east".into(), + activity: StrategicActivityKind::Communicate, + target_subject_ids: vec![], + location_ids: vec!["camp".into()], + public_channels: vec![], + }], + ..Default::default() + }, + ) + .unwrap(); + assert_eq!(value, before); + assert_eq!( + events[0].summary, + "Mira Venn attempts a local communication." + ); + assert_eq!(events[0].actor_ids, vec!["member:mira"]); + assert!(events[0].institution_ids.is_empty()); + assert_eq!(events[0].gestalt_ids, vec!["refugees-east"]); + } + #[test] fn colocated_gestalt_can_address_a_dormant_member_without_absorbing_their_agency() { let mut value = hierarchical_refugee_campaign(); diff --git a/crates/ghostlight-dungeon/src/persona.rs b/crates/ghostlight-dungeon/src/persona.rs index 93302dd..322dcff 100644 --- a/crates/ghostlight-dungeon/src/persona.rs +++ b/crates/ghostlight-dungeon/src/persona.rs @@ -819,7 +819,7 @@ impl CellProjectionEngine { "Emit at most {} exact constituent- or named-member-attributed attempts. Priority is an urgency score from 0 to 100 where higher numbers resolve first. ", "Copy each subject's allowed_effect_type: institution -> institution, gestalt -> gestalt pressure transition, gestalt_activity, or gestalt_migration, actor -> actor_move, named member -> member_migration or member_activity. ", "Use gestalt_activity or member_activity for a concrete attempt that does not itself change pressure. Map attempts narrowly: communicate means speak, send, offer, ask, or notify; coordinate means arrange a joint attempt; prepare means the subject's own concrete work; investigate means seek information; recruit means invite; trade means offer an exchange; obstruct means attempt interference. ", - "target_subject_ids and location_ids must come from that exact subject's permissions. A member_activity uses exactly the member's source_location_id. Internal work is prepare with no targets. A local investigate may have no target and use the exact current location to seek information from the environment or an unnamed ordinary role; asking an unnamed clerk or dock master about schedules maps here and records only the inquiry, never a reply or discovery. Communication requires the exact canonical subject actually addressed. Never substitute a containing population, related institution, or merely permitted ID for an unnamed role. ", + "target_subject_ids and location_ids must come from that exact subject's permissions. A member_activity uses exactly the member's source_location_id. Internal work is prepare with no targets. A local investigate may have no target and use the exact current location to seek information from the environment or an unnamed ordinary role; asking an unnamed clerk or dock master for facts maps here and records only the inquiry, never a reply or discovery. A local communicate may likewise have no target at the exact current location when the Persona speaks, sends, offers, asks permission, or notifies an unnamed ordinary role; it records only the source's outgoing attempt, never a listener, reply, acceptance, or outcome. Communication with a canonical subject requires that exact target ID. Never substitute a containing population, related institution, or merely permitted ID for an unnamed role. ", "Write intended_effect as the attempted act, never its hoped-for outcome or target response. Institution posture must be a specific new commitment or withholding. Gestalt pressure_resolutions copy exact current_pressures; additions are new unresolved constraints, never completed actions. Use only permitted state references and public channels. ", "A population that chooses to board, depart, or relocate together to one supplied migration_destinations key emits gestalt_migration; do not reduce it to prepare. It relocates only that exact population leaf and never implies a named member traveled. A named member who chooses to board, depart, travel, or join a supplied destination emits member_migration; use prepare only while departure remains unchosen. ", "A population or arena cannot migrate a person. Runtime binds identity and effect owner IDs from subject_id. Do not emit institution_id, gestalt_id, actor_id, or member_id inside effect. Use an empty actions array plus a concrete inaction_reason when nobody acts." @@ -868,6 +868,7 @@ impl CellProjectionEngine { ) .await?; let verifier_context = serde_json::json!({ + "local_attempt_contract":"A targetless local communicate at the source's exact current location faithfully records speech, an offer, a permission request, or a notice directed to an unnamed ordinary role. It records no listener, reply, acceptance, or outcome and must not be rejected merely because target_subject_ids is empty.", "lived_stream":lived.text, "persona_turn":persona.narrative, "candidate_actions":appraisal.actions.iter().enumerate().map(|(index, action)| serde_json::json!({ @@ -1252,11 +1253,7 @@ fn validate_cell_appraisal( location_ids, } => { let unique_targets = target_subject_ids.iter().collect::>(); - let needs_target = !matches!( - activity, - crate::domain::StrategicActivityKind::Prepare - | crate::domain::StrategicActivityKind::Investigate - ); + let needs_target = !activity.allows_targetless_local_attempt(); if needs_target && target_subject_ids.is_empty() { return Err(anyhow!( "named member {} activity {:?} requires one or more exact target IDs; no anonymous or unsupplied target can be encoded. Remove the action unless the Persona explicitly attempted one of {:?}", @@ -1391,11 +1388,7 @@ fn validate_constituent_effect( } => { let unique_targets = target_subject_ids.iter().collect::>(); let unique_locations = location_ids.iter().collect::>(); - let needs_target = !matches!( - activity, - crate::domain::StrategicActivityKind::Prepare - | crate::domain::StrategicActivityKind::Investigate - ); + let needs_target = !activity.allows_targetless_local_attempt(); if needs_target && target_subject_ids.is_empty() { return Err(anyhow!( "gestalt {} activity {:?} requires one or more exact target IDs; no anonymous or unsupplied target can be encoded. Remove the action unless the Persona explicitly attempted one of {:?}", @@ -1622,6 +1615,11 @@ mod tests { } "cell_interpreter" => { let call = self.interpreter_calls.fetch_add(1, Ordering::SeqCst); + assert!( + request + .lived_stream + .contains("local communicate may likewise have no target") + ); assert!( request .lived_stream @@ -1668,6 +1666,11 @@ mod tests { } "cell_effect_verifier" => { assert!(request.lived_stream.contains("JSON object")); + assert!( + request + .lived_stream + .contains("targetless local communicate") + ); assert!( request .lived_stream @@ -2067,6 +2070,14 @@ mod tests { location_ids: vec!["forum".into()], }; validate_constituent_effect(subject, &local_investigation).unwrap(); + + let local_communication = StrategicCellEffect::GestaltActivity { + gestalt_id: "refugees".into(), + activity: crate::domain::StrategicActivityKind::Communicate, + target_subject_ids: vec![], + location_ids: vec!["forum".into()], + }; + validate_constituent_effect(subject, &local_communication).unwrap(); } #[test] diff --git a/crates/ghostlight-dungeon/src/resolution.rs b/crates/ghostlight-dungeon/src/resolution.rs index 3d9c1cc..ed12e30 100644 --- a/crates/ghostlight-dungeon/src/resolution.rs +++ b/crates/ghostlight-dungeon/src/resolution.rs @@ -1813,10 +1813,7 @@ fn validate_cell_proposal( let allowed_targets = strategic_activity_targets(campaign, gestalt_id); let unique_targets = target_subject_ids.iter().collect::>(); let unique_locations = location_ids.iter().collect::>(); - let needs_target = !matches!( - activity, - StrategicActivityKind::Prepare | StrategicActivityKind::Investigate - ); + let needs_target = !activity.allows_targetless_local_attempt(); if gestalt_id != &proposal.subject_id || !campaign.gestalts.contains_key(gestalt_id) || target_subject_ids.len() > 4 @@ -1975,10 +1972,7 @@ fn validate_member_cell_proposal( let allowed_targets = member_activity_targets(campaign, member_id)?; let unique_targets = target_subject_ids.iter().collect::>(); let exact_location = dormant_member_location(campaign, member_id)?; - let needs_target = !matches!( - activity, - StrategicActivityKind::Prepare | StrategicActivityKind::Investigate - ); + let needs_target = !activity.allows_targetless_local_attempt(); if effect_member_id != member_id || target_subject_ids.len() > 4 || unique_targets.len() != target_subject_ids.len() @@ -3150,6 +3144,16 @@ pub(crate) mod tests { assert_eq!(activity_plan.member_activities.len(), 1); assert!(activity_plan.member_migrations.is_empty()); + let mut local_member_communication = member_activity.clone(); + let StrategicCellEffect::MemberActivity { + target_subject_ids, .. + } = &mut local_member_communication.effect + else { + unreachable!() + }; + target_subject_ids.clear(); + assert!(validate_and_resolve_wave(&value, &make_wave(local_member_communication)).is_ok()); + let same_member_wave = ResolutionWaveCommit { schema: "ghostlight.resolution_wave_commit.v1".into(), world_revision: value.revision, diff --git a/docs/architecture/ghostlight-multiresolution-agency.md b/docs/architecture/ghostlight-multiresolution-agency.md index 5a3bca7..cdab2c2 100644 --- a/docs/architecture/ghostlight-multiresolution-agency.md +++ b/docs/architecture/ghostlight-multiresolution-agency.md @@ -385,6 +385,13 @@ gestalt participant IDs so later demand and perception can attribute the attempt without treating an arena as an actor. A later resolved outcome needs its own admitted effect. +Two local attempts may omit a canonical target while retaining the source's +exact current location. Targetless `investigate` seeks facts from the +environment or an unnamed ordinary role. Targetless `communicate` records the +source speaking, offering, requesting permission, or notifying such a role. +Neither form creates a listener, reply, acceptance, discovery, or target +agency. All other target-bearing activity uses exact canonical subject IDs. + The shared validators run in the Interpreter membrane, wave resolver, and kernel. One gestalt can contribute at most one selected pressure transition or activity per tick; deterministic priority resolution cannot let two effect diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index a0447eb..6fa46c3 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -170,6 +170,15 @@ mismatch class. Supported actions carry no explanatory prose. Runtime rejects missing, reordered, or incoherent discriminators before they can authorize a wave. +The next strict attempt exposed a coherent `target_substitution`: Mira asked +an unnamed camp coordinator for permission, the Interpreter first emitted an +empty communication target, and duplicated validators rejected that shape; +the correction then stole `refugees-east` as the listener. Empty-target local +communication is now a first-class source-attributed attempt at the exact +current location. It never creates the ordinary role, a reply, acceptance, or +an outcome. One domain method owns which activity kinds allow this shape, and +the Interpreter membrane, wave resolver, and kernel all use it. + The multiresolution body is deployed on Starfire. Typed health matched the immutable release, DeepSeek was ready, and the disposable live strategic-cell smoke committed three offscreen events plus three accessible news items without diff --git a/notes/ghostlight-current-system-map.md b/notes/ghostlight-current-system-map.md index ef07a94..d614bdd 100644 --- a/notes/ghostlight-current-system-map.md +++ b/notes/ghostlight-current-system-map.md @@ -116,9 +116,11 @@ destination population remains a separate canonical subject, and named member deltas are not carried by implication. Approval-gated fission creates destination/stayer cohorts; the same migration primitive moves any resulting leaf regardless of lineage depth. A local `investigate` activity may omit a -target when it examines the exact current environment; this admits ordinary -roles such as an unnamed clerk without inventing an actor or claiming an -answer. +target when it examines the exact current environment. A local `communicate` +may likewise omit a target when its exact source speaks, offers, requests +permission, or notifies an unnamed ordinary role. Both admit ordinary texture +without inventing a listener, response, acceptance, discovered fact, or target +agency. Salient dormant members have their own `member_activity` path for ordinary local attempts. It uses the same bounded verbs, the member's exact location,