From c7d950c9ae4f734caa7b8e1ab8e3e5e22826117e Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 18 Aug 2026 19:51:38 +0200 Subject: [PATCH] Advance quiet campaigns without fake agency --- crates/ghostlight-dungeon/src/main.rs | 75 +++++++++++++++++++++++++ notes/ghostlight-current-system-map.md | 8 +++ notes/ghostlight-implementation-plan.md | 6 ++ state/map.yaml | 2 +- 4 files changed, 90 insertions(+), 1 deletion(-) diff --git a/crates/ghostlight-dungeon/src/main.rs b/crates/ghostlight-dungeon/src/main.rs index ce9cd9e..428a3c6 100644 --- a/crates/ghostlight-dungeon/src/main.rs +++ b/crates/ghostlight-dungeon/src/main.rs @@ -1871,6 +1871,37 @@ async fn process_due_ticks( if campaign.away_ticks_processed >= target { return Ok(()); } + let has_simulatable_agency = campaign + .agency_profiles + .values() + .any(|profile| profile.active_leaf && profile.simulation_eligible); + if !has_simulatable_agency { + if yield_to_live_turns && state.live_turns.load(Ordering::SeqCst) > 0 { + return Ok(()); + } + let _background_commit = if yield_to_live_turns { + match state.live_commit_gate.clone().try_write_owned() { + Ok(guard) => Some(guard), + Err(_) => return Ok(()), + } + } else { + None + }; + if yield_to_live_turns && state.live_turns.load(Ordering::SeqCst) > 0 { + return Ok(()); + } + runtime + .kernel + .command(WorldCommand::AdvanceStrategicTick { + expected_revision: campaign.revision, + source: source.clone(), + plan: None, + model_receipt_hash: None, + resolution_wave: None, + }) + .await?; + continue; + } let Some(model) = &state.model else { return Ok(()); }; @@ -2216,6 +2247,50 @@ mod tests { assert!(state.live_commit_gate.clone().try_write_owned().is_ok()); } + #[tokio::test] + async fn due_ticks_without_simulatable_agency_advance_deterministically_without_a_model() { + let dir = tempfile::tempdir().unwrap(); + let state = empty_app_state(dir.path()); + let mut campaign = seed("Quiet world"); + let original_player = campaign.actors["player"].clone(); + let original_time = campaign.world_time; + campaign.last_player_activity = chrono::Utc::now() - chrono::Duration::hours(2); + campaign.clocks.insert( + "tide".into(), + ghostlight_dungeon::domain::WorldClock { + id: "tide".into(), + label: "Tide turns".into(), + progress: 0, + threshold: 4, + consequence: "the channel narrows".into(), + }, + ); + let runtime = state + .registry + .create(campaign.clone(), vec![], vec![]) + .await + .unwrap(); + + process_due_ticks( + &state, + &runtime, + ghostlight_dungeon::domain::TickSource::Scheduler, + true, + ) + .await + .unwrap(); + + let advanced = load_campaign(&runtime.store).unwrap(); + assert_eq!(advanced.away_ticks_processed, 2); + assert_eq!(advanced.strategic_tick_count, 2); + assert_eq!(advanced.clocks["tide"].progress, 2); + assert_eq!( + advanced.world_time, + original_time + chrono::Duration::hours(12) + ); + assert_eq!(advanced.actors["player"], original_player); + } + #[tokio::test] async fn sessions_resolve_only_their_selected_campaign_runtime() { let dir = tempfile::tempdir().unwrap(); diff --git a/notes/ghostlight-current-system-map.md b/notes/ghostlight-current-system-map.md index c4a6b9b..88a3171 100644 --- a/notes/ghostlight-current-system-map.md +++ b/notes/ghostlight-current-system-map.md @@ -164,6 +164,14 @@ the deployment boundary: it replaces the protected token set and clears the persisted auth authority together while the daemon is stopped. Campaign stores survive; old sessions deliberately do not. +Away time does not require invented agency. When a campaign has no active, +simulation-eligible agency profiles, the scheduler enters the same +`AdvanceStrategicTick` kernel command with no model plan or resolution wave. +World time, clocks, pending-tick accounting, and deterministic obligations +advance atomically while the player remains untouched. The scheduler does not +call the partitioner merely to discover an empty graph, and it retains the same +live-turn commit exclusion as model-backed waves. + `gestalt_migration` records a collective decision by one exact active leaf to move along an explicit migration relation and reachable route. WorldKernel changes the leaf's home location and agency-profile location together. The diff --git a/notes/ghostlight-implementation-plan.md b/notes/ghostlight-implementation-plan.md index f96067b..4153e1c 100644 --- a/notes/ghostlight-implementation-plan.md +++ b/notes/ghostlight-implementation-plan.md @@ -101,6 +101,12 @@ provider retry by making the `resource_recipient_ids` input to `other_subject_id` output mapping explicit. The remaining release gate is the authenticated browser journey after rebuilding and deploying this exact commit. +The live scheduler audit also removed an empty-agency failure loop. A campaign +with clocks but no simulatable NPC, institution, or population now advances +through a deterministic kernel tick without a model call or fabricated Persona +cell. A regression proves two missed ticks advance time and the clock while +leaving the player byte-identical. + Multiplayer remains outside the current paid-alpha gate but is now an explicit architectural intention. Do not fork the simulation into a multiplayer room model. After the solo product and Gestalt agency are proven, extend campaign diff --git a/state/map.yaml b/state/map.yaml index 109f99d..cda3e87 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -271,5 +271,5 @@ data_flow: current_status: summary: Starfire serves immutable release 0e4b8f4617840d45daec8a6451001192193ca5e0 with matching typed health, manifest, executable hash, active junction, persisted campaign, and DeepSeek readiness. A forced live high-risk outcome moved one exact population-owned resource through an independent causal verifier without mutating the input snapshot. The exact deployed auth rehearsal accepted a fresh invite once, rejected replay, served the compiler surface and campaign list, returned three pairwise-distinct grounded openings, preserved the session across restart, and then rotated cleanly back to two unused tester invitations. Invite rotation now clears old auth authority atomically; opening distinctness gets one same-evidence semantic correction. - next_action: With explicit approval to transmit one temporary invite credential to the local in-app browser, complete the visual authenticated journey and inspect rendered opening controls. Then begin supervised human playtesting and treat confusion, composite consequences, or low dramatic yield as live evidence without weakening state admission. + next_action: Deploy the deterministic empty-agency scheduler cut. With explicit approval to transmit one temporary invite credential to the local in-app browser, complete the visual authenticated journey and inspect rendered opening controls. Then begin supervised human playtesting and treat confusion, composite consequences, or low dramatic yield as live evidence without weakening state admission. gestalt_population: Gestalt Personas own shared population baselines; persistent member deltas own named individuality; WorldKernel materialization and approval-gated fission preserve lineage and identity. Presence projection is limited to nearby active leaves and exact-location dormant members, includes reciprocal player relationship evidence, and may propose an earned cast without committing it. Simulation cells are derived covers only.