diff --git a/crates/ghostlight-dungeon/src/bin/ghostlight-gestalt-dynamics-smoke.rs b/crates/ghostlight-dungeon/src/bin/ghostlight-gestalt-dynamics-smoke.rs index 52c263e..08bdd54 100644 --- a/crates/ghostlight-dungeon/src/bin/ghostlight-gestalt-dynamics-smoke.rs +++ b/crates/ghostlight-dungeon/src/bin/ghostlight-gestalt-dynamics-smoke.rs @@ -648,7 +648,7 @@ async fn main() -> anyhow::Result<()> { model: model.clone(), model_name: "deepseek-v4-flash".into(), }; - let (presence_plan, presence_receipt) = presence_planner.plan(&advanced, return_event).await?; + let (presence_plan, presence_receipts) = presence_planner.plan(&advanced, return_event).await?; std::fs::write( root.join("presence-preflight.json"), serde_json::to_vec_pretty(&serde_json::json!({ @@ -656,7 +656,7 @@ async fn main() -> anyhow::Result<()> { "campaign_revision":advanced.revision, "return_event":return_event, "plan":presence_plan, - "receipt":presence_receipt, + "receipts":presence_receipts, }))?, )?; if presence_plan.individuations.len() != 0 @@ -670,12 +670,14 @@ async fn main() -> anyhow::Result<()> { serde_json::to_string(&presence_plan)? ) } - store.insert( - "persona_stage_receipt.v1", - "ghostlight.persona_stage_receipt.v1", - presence_receipt.storage_key(), - &presence_receipt, - )?; + for receipt in &presence_receipts { + store.insert( + "persona_stage_receipt.v1", + "ghostlight.persona_stage_receipt.v1", + receipt.storage_key(), + receipt, + )?; + } let materialized = kernel .command(WorldCommand::ReconcileGestaltPresence { expected_revision: advanced.revision, @@ -744,7 +746,7 @@ async fn main() -> anyhow::Result<()> { "commit":committed, "materialization":materialized, "automatic_presence_plan":presence_plan, - "automatic_presence_receipt":presence_receipt, + "automatic_presence_receipts":presence_receipts, "identity_preserved":true, "member_delta_changes_bound_to_outcomes":true, "player_unchanged":true, diff --git a/crates/ghostlight-dungeon/src/gestalt.rs b/crates/ghostlight-dungeon/src/gestalt.rs index 8d8014a..7324f36 100644 --- a/crates/ghostlight-dungeon/src/gestalt.rs +++ b/crates/ghostlight-dungeon/src/gestalt.rs @@ -17,7 +17,7 @@ impl GestaltPresencePlanner { &self, campaign: &Campaign, event_summary: &str, - ) -> Result<(GestaltPresencePlan, ModelStageReceipt)> { + ) -> Result<(GestaltPresencePlan, Vec)> { let player_location = &campaign.actors[&campaign.player_actor_id].location_id; let nearby_gestalts = campaign .gestalts @@ -33,14 +33,14 @@ impl GestaltPresencePlanner { .collect::>(); let nearby_gestalt_ids = nearby_gestalts .iter() - .map(|gestalt| gestalt.id.as_str()) + .map(|gestalt| gestalt.id.clone()) .collect::>(); let player = &campaign.actors[&campaign.player_actor_id]; let nearby_dormant_members = campaign .gestalt_members .values() .filter(|member| { - nearby_gestalt_ids.contains(member.gestalt_id.as_str()) + nearby_gestalt_ids.contains(&member.gestalt_id) && crate::resolution::dormant_member_location(campaign, &member.id) .is_ok_and(|location| location == *player_location) }) @@ -53,6 +53,16 @@ impl GestaltPresencePlanner { }) }) .collect::>(); + let nearby_dormant_member_ids = campaign + .gestalt_members + .values() + .filter(|member| { + nearby_gestalt_ids.contains(&member.gestalt_id) + && crate::resolution::dormant_member_location(campaign, &member.id) + .is_ok_and(|location| location == *player_location) + }) + .map(|member| member.id.clone()) + .collect::>(); let materialized_members = campaign .gestalt_members .values() @@ -68,40 +78,151 @@ impl GestaltPresencePlanner { })) }) .collect::>(); + let materialized_actor_ids = campaign + .gestalt_members + .values() + .filter_map(|member| member.materialized_actor_id.clone()) + .collect::>(); let candidates = serde_json::json!({ "player_location_id": player_location, "nearby_active_leaf_gestalts": nearby_gestalts, "nearby_dormant_members": nearby_dormant_members, "materialized_members": materialized_members, }); - let schema = serde_json::to_value(schema_for!(GestaltPresencePlan))?; - let output = run_validated_stage( - self.model.as_ref(), - &ModelStageRequest { - stage: "gestalt_presence_planner".into(), - model: self.model_name.clone(), - snapshot_binding: format!("campaign:{}:revision:{}", campaign.id, campaign.revision), - lived_stream: format!( - "Cast reversible Persona population presence for the next scene after this event. The purpose is to make causal continuity visible without crowding the scene or inventing coincidence. Promote an existing member when their exact durable history makes them individually relevant. When a nearby dormant member has a reciprocal player relationship and an unresolved callback signal such as an obligation, memory, or goal, promote the single strongest earned callback unless the event makes their presence implausible or dramatically harmful. An ordinary shared-location event is enough opportunity for an earned callback; do not require the player to ask for that person. Prefer an existing person over anonymous individuation whenever their exact delta supports the scene. Return no promotion when there is no earned callback or the current event conflicts with it. If the event makes an anonymous population member individually relevant and no supplied member fits, individuate exactly one durable member delta from the gestalt baseline; use a new stable lowercase id, version 0, the exact gestalt id/version, no materialized actor id, and record only personal departures from the shared baseline. Demote a materialized member when they are no longer scene-relevant. Never place a promoted or individuated member outside the player location. Aggregate deltas must remain empty; population learning requires separate review. Emit the exact JSON schema.\nSCHEMA:\n{}\nCANDIDATES:\n{}\nEVENT:\n{}", - serde_json::to_string_pretty(&schema)?, candidates, event_summary - ), - output_schema: Some(schema), - source_receipt_ids: campaign.branch_origin.evidence_receipt_ids.clone(), - temperature: Some(0.0), - max_output_tokens: Some(1_500), - }, - ) - .await?; - let plan: GestaltPresencePlan = serde_json::from_value( - output - .structured - .ok_or_else(|| anyhow!("presence planner produced no plan"))?, + let mut schema = serde_json::to_value(schema_for!(GestaltPresencePlan))?; + constrain_presence_schema( + &mut schema, + &nearby_gestalt_ids, + &nearby_dormant_member_ids, + &materialized_actor_ids, + player_location, )?; - validate_plan(campaign, &plan, player_location)?; - Ok((plan, output.receipt)) + let base_prompt = format!( + "Cast reversible Persona population presence for the next scene after this event. The purpose is to make causal continuity visible without crowding the scene or inventing coincidence. Promote an existing member when their exact durable history makes them individually relevant. When a nearby dormant member has a reciprocal player relationship and an unresolved callback signal such as an obligation, memory, or goal, promote the single strongest earned callback unless the event makes their presence implausible or dramatically harmful. An ordinary shared-location event is enough opportunity for an earned callback; do not require the player to ask for that person. Prefer an existing person over anonymous individuation whenever their exact delta supports the scene. Return no promotion when there is no earned callback or the current event conflicts with it. If the event makes an anonymous population member individually relevant and no supplied member fits, individuate exactly one durable member delta from the gestalt baseline; use a new stable lowercase id, version 0, the exact gestalt id/version, no materialized actor id, and record only personal departures from the shared baseline. Demote a materialized member when they are no longer scene-relevant. Never place a promoted or individuated member outside the player location. Aggregate deltas must remain empty; population learning requires separate review. Emit the exact JSON schema.\nSCHEMA:\n{}\nCANDIDATES:\n{}\nEVENT:\n{}", + serde_json::to_string_pretty(&schema)?, + candidates, + event_summary + ); + let snapshot_binding = format!("campaign:{}:revision:{}", campaign.id, campaign.revision); + let mut correction = String::new(); + let mut receipts = Vec::new(); + loop { + let mut output = run_validated_stage( + self.model.as_ref(), + &ModelStageRequest { + stage: "gestalt_presence_planner".into(), + model: self.model_name.clone(), + snapshot_binding: snapshot_binding.clone(), + lived_stream: format!("{base_prompt}{correction}"), + output_schema: Some(schema.clone()), + source_receipt_ids: campaign.branch_origin.evidence_receipt_ids.clone(), + temperature: Some(0.0), + max_output_tokens: Some(1_500), + }, + ) + .await?; + let candidate = output + .structured + .clone() + .ok_or_else(|| anyhow!("presence planner produced no plan")) + .and_then(|value| serde_json::from_value(value).map_err(Into::into)) + .and_then(|plan| { + validate_plan(campaign, &plan, player_location)?; + Ok(plan) + }); + match candidate { + Ok(plan) => { + receipts.push(output.receipt); + return Ok((plan, receipts)); + } + Err(error) if receipts.is_empty() => { + output.receipt.validation_result = "semantic_invalid".into(); + output.receipt.local_validation_error = + Some(error.to_string().chars().take(1_000).collect()); + let rejected = output + .structured + .as_ref() + .and_then(|value| serde_json::to_string(value).ok()) + .unwrap_or_else(|| "unavailable".into()); + receipts.push(output.receipt); + correction = format!( + "\n\nLOCAL VALIDATOR REJECTED THE PREVIOUS PRESENCE PLAN: {error}\nPREVIOUS PLAN:\n{rejected}\nReturn one corrected complete plan against the same snapshot. Promote only exact nearby_dormant_members, demote only exact materialized_members, and copy every gestalt, member, actor, location, and version from the supplied candidates." + ); + } + Err(error) => { + return Err(anyhow!( + "presence planner failed semantic validation after one correction: {error}" + )); + } + } + } } } +fn constrain_presence_schema( + schema: &mut serde_json::Value, + nearby_gestalt_ids: &BTreeSet, + dormant_member_ids: &BTreeSet, + materialized_actor_ids: &BTreeSet, + player_location: &str, +) -> Result<()> { + constrain_candidate_array( + schema, + "promotions", + "GestaltPromotion", + "member_id", + dormant_member_ids, + )?; + constrain_candidate_array( + schema, + "demotions", + "GestaltDemotion", + "actor_id", + materialized_actor_ids, + )?; + constrain_candidate_array( + schema, + "individuations", + "GestaltIndividuation", + "gestalt_id", + nearby_gestalt_ids, + )?; + for definition in ["GestaltPromotion", "GestaltIndividuation"] { + if !nearby_gestalt_ids.is_empty() { + schema["$defs"][definition]["properties"]["gestalt_id"] = + serde_json::json!({"type":"string","enum":nearby_gestalt_ids}); + } + schema["$defs"][definition]["properties"]["location_id"] = + serde_json::json!({"type":"string","enum":[player_location]}); + } + if !nearby_gestalt_ids.is_empty() { + schema["$defs"]["GestaltMemberDelta"]["properties"]["gestalt_id"] = + serde_json::json!({"type":"string","enum":nearby_gestalt_ids}); + } + Ok(()) +} + +fn constrain_candidate_array( + schema: &mut serde_json::Value, + field: &str, + definition: &str, + id_field: &str, + allowed_ids: &BTreeSet, +) -> Result<()> { + let array = schema + .pointer_mut(&format!("/properties/{field}")) + .and_then(serde_json::Value::as_object_mut) + .ok_or_else(|| anyhow!("presence schema omitted {field}"))?; + if allowed_ids.is_empty() { + array.insert("maxItems".into(), serde_json::json!(0)); + } else { + array.insert("maxItems".into(), serde_json::json!(allowed_ids.len())); + schema["$defs"][definition]["properties"][id_field] = + serde_json::json!({"type":"string","enum":allowed_ids}); + } + Ok(()) +} + fn validate_plan( campaign: &Campaign, plan: &GestaltPresencePlan, @@ -203,13 +324,21 @@ mod tests { use async_trait::async_trait; use std::{ collections::{BTreeMap, BTreeSet}, - sync::Mutex, + sync::{ + Mutex, + atomic::{AtomicBool, AtomicUsize, Ordering}, + }, }; struct CapturePresenceModel { prompt: Arc>, } + struct CorrectingPresenceModel { + calls: AtomicUsize, + saw_semantic_correction: AtomicBool, + } + #[async_trait] impl ModelPort for CapturePresenceModel { async fn run(&self, request: &ModelStageRequest) -> Result { @@ -227,6 +356,157 @@ mod tests { } } + #[async_trait] + impl ModelPort for CorrectingPresenceModel { + async fn run(&self, request: &ModelStageRequest) -> Result { + let call = self.calls.fetch_add(1, Ordering::SeqCst); + if call == 0 { + return Ok(serde_json::json!({ + "individuations":[], + "promotions":[{ + "gestalt_id":"nearby-leaf", + "expected_gestalt_version":0, + "member_id":"mira", + "expected_member_version":99, + "location_id":"center" + }], + "demotions":[] + }) + .to_string()); + } + self.saw_semantic_correction.store( + request + .lived_stream + .contains("LOCAL VALIDATOR REJECTED THE PREVIOUS PRESENCE PLAN") + && request.lived_stream.contains("expected_member_version"), + Ordering::SeqCst, + ); + Ok(serde_json::json!({ + "individuations":[], + "promotions":[], + "demotions":[] + }) + .to_string()) + } + + fn provider(&self) -> &'static str { + "presence-correction" + } + } + + #[test] + fn presence_schema_binds_each_transition_to_exact_candidate_ids() { + let mut schema = serde_json::to_value(schema_for!(GestaltPresencePlan)).unwrap(); + constrain_presence_schema( + &mut schema, + &BTreeSet::from(["nearby-leaf".into()]), + &BTreeSet::from(["mira".into()]), + &BTreeSet::from(["member:already-here".into()]), + "center", + ) + .unwrap(); + + assert_eq!( + schema["$defs"]["GestaltPromotion"]["properties"]["member_id"]["enum"], + serde_json::json!(["mira"]) + ); + assert_eq!( + schema["$defs"]["GestaltDemotion"]["properties"]["actor_id"]["enum"], + serde_json::json!(["member:already-here"]) + ); + assert_eq!( + schema["$defs"]["GestaltIndividuation"]["properties"]["gestalt_id"]["enum"], + serde_json::json!(["nearby-leaf"]) + ); + assert_eq!( + schema["$defs"]["GestaltPromotion"]["properties"]["location_id"]["enum"], + serde_json::json!(["center"]) + ); + } + + #[test] + fn presence_schema_makes_empty_candidate_lanes_structurally_empty() { + let mut schema = serde_json::to_value(schema_for!(GestaltPresencePlan)).unwrap(); + constrain_presence_schema( + &mut schema, + &BTreeSet::new(), + &BTreeSet::new(), + &BTreeSet::new(), + "center", + ) + .unwrap(); + + for field in ["promotions", "demotions", "individuations"] { + assert_eq!(schema["properties"][field]["maxItems"], 0); + } + jsonschema::validator_for(&schema).unwrap(); + } + + #[tokio::test] + async fn presence_planner_corrects_one_semantic_failure_against_the_same_snapshot() { + let mut campaign = crate::resolution::tests::campaign(0, 8); + campaign.gestalts.insert( + "nearby-leaf".into(), + GestaltPersonaState { + schema: "ghostlight.gestalt_persona_state.v1".into(), + id: "nearby-leaf".into(), + name: "Nearby leaf".into(), + version: 0, + home_location_id: "center".into(), + shared_capabilities: BTreeSet::new(), + shared_knowledge: BTreeSet::new(), + resources: BTreeSet::new(), + goals: vec![], + pressures: vec![], + }, + ); + campaign.gestalt_members.insert( + "mira".into(), + GestaltMemberDelta { + schema: "ghostlight.gestalt_member_delta.v1".into(), + id: "mira".into(), + gestalt_id: "nearby-leaf".into(), + version: 0, + name: "Mira".into(), + capability_additions: BTreeSet::new(), + capability_removals: BTreeSet::new(), + knowledge_additions: BTreeSet::new(), + knowledge_removals: BTreeSet::new(), + equipment: BTreeSet::new(), + conditions: BTreeSet::new(), + obligations: BTreeSet::new(), + relationships: BTreeMap::new(), + goals: vec![], + memories: vec![], + last_location_id: Some("center".into()), + materialized_actor_id: None, + last_relevant_revision: 0, + relevance_lease_until_revision: 0, + }, + ); + crate::resolution::ensure_agency_profiles(&mut campaign); + let model = Arc::new(CorrectingPresenceModel { + calls: AtomicUsize::new(0), + saw_semantic_correction: AtomicBool::new(false), + }); + + let (plan, receipts) = GestaltPresencePlanner { + model: model.clone(), + model_name: "fixture".into(), + } + .plan(&campaign, "The player enters the square.") + .await + .unwrap(); + + assert!(plan.promotions.is_empty()); + assert_eq!(model.calls.load(Ordering::SeqCst), 2); + assert!(model.saw_semantic_correction.load(Ordering::SeqCst)); + assert_eq!(receipts.len(), 2); + assert_eq!(receipts[0].validation_result, "semantic_invalid"); + assert_eq!(receipts[0].snapshot_binding, receipts[1].snapshot_binding); + assert!(receipts[1].local_validation_error.is_none()); + } + #[tokio::test] async fn presence_projection_contains_only_nearby_active_leaves_and_relevant_members() { let mut campaign = crate::resolution::tests::campaign(0, 8); diff --git a/crates/ghostlight-dungeon/src/main.rs b/crates/ghostlight-dungeon/src/main.rs index fc72dc0..0937e38 100644 --- a/crates/ghostlight-dungeon/src/main.rs +++ b/crates/ghostlight-dungeon/src/main.rs @@ -3863,6 +3863,47 @@ async fn publish_latest_narration( Ok(Some(projection)) } +async fn committed_after_failure( + state: &AppState, + runtime: &CampaignRuntime, + result: &CommandResult, + stage: &str, + reason: String, +) -> Response { + tracing::warn!(stage, %reason, "post-commit aftermath stopped"); + if let Ok(campaign) = load_campaign(&runtime.store) { + let receipt = RejectedProposalReceipt { + schema: "ghostlight.rejected_proposal_receipt.v1".into(), + id: uuid::Uuid::new_v4().to_string(), + campaign_id: campaign.id, + revision: campaign.revision, + command_kind: stage.into(), + reason: reason.clone(), + rejected_at: chrono::Utc::now(), + }; + let _ = runtime.store.insert( + "rejected_proposal_receipt.v1", + "ghostlight.rejected_proposal_receipt.v1", + &receipt.id, + &receipt, + ); + } + let narration = publish_latest_narration(state, runtime) + .await + .ok() + .flatten(); + if let Err(error) = refresh_mesh(state).await { + tracing::warn!(%error, "post-commit CultMesh publication failed"); + } + let message = format!( + "The player action committed, but {stage} stopped: {reason}. Every world change remains separately receipted." + ); + Json(player_command_projection_with_message( + result, narration, &message, + )) + .into_response() +} + async fn propose_time_advance( headers: HeaderMap, State(state): State, @@ -4292,13 +4333,15 @@ async fn command( model_name: MODEL_FAST.into(), }; match planner.plan(campaign, &summary).await { - Ok((plan, receipt)) => { - let _ = runtime.store.insert( - "persona_stage_receipt.v1", - "ghostlight.persona_stage_receipt.v1", - receipt.storage_key(), - &receipt, - ); + Ok((plan, receipts)) => { + for receipt in receipts { + let _ = runtime.store.insert( + "persona_stage_receipt.v1", + "ghostlight.persona_stage_receipt.v1", + receipt.storage_key(), + &receipt, + ); + } if !plan.individuations.is_empty() || !plan.promotions.is_empty() || !plan.demotions.is_empty() @@ -4315,18 +4358,28 @@ async fn command( presence_result = Some(committed); } Ok(_) => unreachable!(), - Err(error) => return (StatusCode::CONFLICT, Json(ErrorBody { error: error.to_string() })).into_response(), + Err(error) => { + return committed_after_failure( + &state, + &runtime, + &result, + &format!("{command_kind}.gestalt_presence"), + error.to_string(), + ) + .await; + } } } } Err(error) => { - return ( - StatusCode::BAD_GATEWAY, - Json(ErrorBody { - error: error.to_string(), - }), + return committed_after_failure( + &state, + &runtime, + &result, + &format!("{command_kind}.gestalt_presence_planner"), + error.to_string(), ) - .into_response(); + .await; } } } @@ -4369,13 +4422,14 @@ async fn command( { Ok(value) => value, Err(error) => { - return ( - StatusCode::BAD_GATEWAY, - Json(ErrorBody { - error: error.to_string(), - }), + return committed_after_failure( + &state, + &runtime, + &result, + &format!("{command_kind}.npc_initiative"), + error.to_string(), ) - .into_response(); + .await; } }; let narration = @@ -4392,25 +4446,27 @@ async fn command( .into_response(); } Err(error) => { - return ( - StatusCode::CONFLICT, - Json(ErrorBody { - error: error.to_string(), - }), + return committed_after_failure( + &state, + &runtime, + &result, + &format!("{command_kind}.reaction_commit"), + error.to_string(), ) - .into_response(); + .await; } } } Ok(_) => {} Err(error) => { - return ( - StatusCode::BAD_GATEWAY, - Json(ErrorBody { - error: error.to_string(), - }), + return committed_after_failure( + &state, + &runtime, + &result, + &format!("{command_kind}.reaction_appraisal"), + error.to_string(), ) - .into_response(); + .await; } } } @@ -4728,6 +4784,18 @@ fn player_command_projection( } } +fn player_command_projection_with_message( + result: &CommandResult, + narration: Option, + message: &str, +) -> serde_json::Value { + let mut projection = player_command_projection(result, narration); + if let Some(object) = projection.as_object_mut() { + object.insert("message".into(), message.into()); + } + projection +} + fn player_http_command_allowed(command: &WorldCommand, player_actor_id: &str) -> bool { match command { WorldCommand::Speak { actor_id, .. } => actor_id == player_actor_id, @@ -6199,6 +6267,43 @@ mod tests { assert_eq!(created, serde_json::json!({"kind":"created"})); } + #[test] + fn post_commit_failure_remains_an_accepted_committed_projection() { + let campaign = seed("Private state"); + let result = CommandResult::Committed { + receipt: ghostlight_dungeon::domain::WorldCommitReceipt { + schema: "ghostlight.world_commit_receipt.v1".into(), + campaign_id: campaign.id, + previous_revision: 4, + revision: 5, + command_kind: "speak".into(), + committed_at: chrono::Utc::now(), + roll: None, + }, + campaign, + }; + + let projection = player_command_projection_with_message( + &result, + None, + "The player action committed, but reaction appraisal stopped.", + ); + + assert_eq!(projection["kind"], "committed"); + assert_eq!(projection["revision"], 5); + assert!( + projection["message"] + .as_str() + .unwrap() + .contains("committed") + ); + assert!( + !serde_json::to_string(&projection) + .unwrap() + .contains("Private state") + ); + } + #[test] fn assessment_command_result_is_a_complete_eve_surface() { let projection = transient_result_projection( diff --git a/docs/architecture/ghostlight-dungeon-mvp.md b/docs/architecture/ghostlight-dungeon-mvp.md index 3bf16d3..8296695 100644 --- a/docs/architecture/ghostlight-dungeon-mvp.md +++ b/docs/architecture/ghostlight-dungeon-mvp.md @@ -682,6 +682,12 @@ to their own snapshot versions. Initiative selects compatible reactions for a later `WorldCommand`; it does not suppress perception for actors outside the current conversational focus. +The primary player event commits before optional presence casting, reaction +appraisal, initiative, and narration. A failure in those later stages is stored +as a rejected-proposal receipt and returned as an accepted committed result +with a visible warning. It cannot be reported as rejection of the already +persisted player action, and a browser retry cannot duplicate that action. + ### Away-time agency The service pulses every five minutes. After fifteen minutes without player diff --git a/docs/architecture/ghostlight-multiresolution-agency.md b/docs/architecture/ghostlight-multiresolution-agency.md index 822e0d2..d8538b4 100644 --- a/docs/architecture/ghostlight-multiresolution-agency.md +++ b/docs/architecture/ghostlight-multiresolution-agency.md @@ -132,6 +132,14 @@ cast; `WorldKernel` validates exact member, gestalt, location, and versions before materialization. Live harnesses persist the private presence preflight even when their acceptance assertion fails. +The presence-planner schema enumerates promotion IDs only from the supplied +nearby dormant roster, demotion IDs only from supplied materialized actors, and +gestalt and location IDs only from the exact scene candidates. A structurally +valid plan that mismatches member, gestalt, location, or version receives one +same-snapshot semantic correction. When that correction succeeds, both the +rejected and accepted stage receipts remain durable; the rejected receipt is +marked `semantic_invalid` with the bounded local reason. + ## Canonical population migration Population fission and population movement are separate decisions. Fission