style(simulation): cargo fmt + fix clippy doc-nested-refdefs warning

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 23:57:48 +02:00
co-authored by Claude Opus 4.6
parent cf21904a0f
commit 309c05d441
9 changed files with 39 additions and 54 deletions
+4 -12
View File
@@ -223,19 +223,12 @@ impl Plugin for BridgePlugin {
.init_resource::<DebugEnabled>()
.init_resource::<crate::perception::query::ActivePerceptionMode>()
// Bridge I/O — PreInput (receive) and PostSnapshot (send)
.add_systems(
Update,
receive_bridge_inputs.in_set(TickPhase::PreInput),
)
.add_systems(
Update,
send_bridge_snapshot.in_set(TickPhase::PostSnapshot),
)
.add_systems(Update, receive_bridge_inputs.in_set(TickPhase::PreInput))
.add_systems(Update, send_bridge_snapshot.in_set(TickPhase::PostSnapshot))
// Debug commands — Snapshot phase
.add_systems(
Update,
debug::handle_debug_commands
.in_set(TickPhase::Snapshot),
debug::handle_debug_commands.in_set(TickPhase::Snapshot),
)
// Monologue chain — Simulation phase, strict intra-phase sequence.
// trigger_event_monologue must run after conversations + sound (also Simulation).
@@ -270,8 +263,7 @@ impl Plugin for BridgePlugin {
// Observer snapshot assembly — Snapshot phase
.add_systems(
Update,
crate::perception::observer::compute_observer_snapshot
.in_set(TickPhase::Snapshot),
crate::perception::observer::compute_observer_snapshot.in_set(TickPhase::Snapshot),
)
// Post-snapshot: emit observation events
.add_systems(
+1 -1
View File
@@ -2,7 +2,6 @@
// Rust/bevy_ecs simulation server for D-010 client-server architecture
pub mod bridge;
pub mod tick_phases;
pub mod cause_chain;
pub mod knowledge;
pub mod npc;
@@ -10,6 +9,7 @@ pub mod perception;
pub mod settings;
pub mod simulation;
pub mod storyteller;
pub mod tick_phases;
pub mod voice;
// test_world::reset is always compiled (used by simulation::input).
// Room definitions, constants, and setup_gauntlet are gated behind
+6 -12
View File
@@ -67,17 +67,14 @@ impl Plugin for NpcPlugin {
Update,
(
vision::compute_npc_vision,
vision::emit_npc_vision_events
.after(vision::compute_npc_vision),
awareness::detect_player_awareness
.after(vision::compute_npc_vision),
vision::emit_npc_vision_events.after(vision::compute_npc_vision),
awareness::detect_player_awareness.after(vision::compute_npc_vision),
mood::update_mood,
tolerance::check_tolerance_threshold
.after(mood::update_mood)
.after(awareness::detect_player_awareness),
routine::enter_activity,
routine::detect_routine_deviation
.after(routine::enter_activity),
routine::detect_routine_deviation.after(routine::enter_activity),
background::background_tick,
disclosure::derive_disclosure_candidates,
disclosure::process_unprompted_disclosure
@@ -88,18 +85,15 @@ impl Plugin for NpcPlugin {
// Storyteller: tell state derivation (reads mood + routine deviation)
.add_systems(
Update,
tell_state::derive_tell_state
.in_set(TickPhase::Storyteller),
tell_state::derive_tell_state.in_set(TickPhase::Storyteller),
)
// Knowledge: relationships (trust, propagation, dynamics), vision degradation
.add_systems(
Update,
(
relationships::update_trust,
relationships::propagate_social_actions
.after(relationships::update_trust),
relationships::update_relationship_dynamics
.after(relationships::update_trust),
relationships::propagate_social_actions.after(relationships::update_trust),
relationships::update_relationship_dynamics.after(relationships::update_trust),
vision::degrade_npc_inferences,
)
.in_set(TickPhase::Knowledge),
+1 -2
View File
@@ -30,8 +30,7 @@ impl Plugin for PerceptionPlugin {
Update,
(
anomaly::clear_anomaly_markers,
anomaly::detect_anomalies
.after(anomaly::clear_anomaly_markers),
anomaly::detect_anomalies.after(anomaly::clear_anomaly_markers),
)
.in_set(TickPhase::Simulation),
)
+5 -5
View File
@@ -6,19 +6,16 @@ use bevy_ecs::schedule::IntoScheduleConfigs;
pub mod chunk_streaming;
// Phase sub-plugins (#843)
pub mod economy_plugin;
pub mod input_plugin;
pub mod movement_plugin;
pub mod social_plugin;
pub mod time_plugin;
pub mod contraband;
pub mod conversation;
pub mod dialogue;
pub mod economy;
pub mod economy_plugin;
pub mod examine;
pub mod follow;
pub mod generator;
pub mod input;
pub mod input_plugin;
pub mod interaction;
pub mod inventory;
pub mod knowledge_grant;
@@ -27,6 +24,7 @@ pub mod listening;
pub mod modification;
pub mod monologue;
pub mod movement;
pub mod movement_plugin;
pub mod npc_knowledge_transfer;
pub mod path_follow;
pub mod pathfinding;
@@ -36,12 +34,14 @@ pub mod pressure;
pub mod rng;
pub mod save_io;
pub mod save_state;
pub mod social_plugin;
pub mod sound;
pub mod spatial;
pub mod stance;
pub mod ticker;
pub mod tier;
pub mod time;
pub mod time_plugin;
pub mod triangle;
pub mod zone;
+4 -8
View File
@@ -21,19 +21,15 @@ impl Plugin for MovementPlugin {
(
// Core movement chain (strict sequence)
super::pathfinding::compute_paths,
super::path_follow::follow_paths
.after(super::pathfinding::compute_paths),
super::movement::validate_movement
.after(super::path_follow::follow_paths),
super::path_follow::follow_paths.after(super::pathfinding::compute_paths),
super::movement::validate_movement.after(super::path_follow::follow_paths),
super::path_follow::cleanup_path_blocked
.after(super::movement::validate_movement),
// Post-movement indexing (all after validate_movement, parallel with each other)
super::spatial::sync_spatial_index
.after(super::movement::validate_movement),
super::spatial::sync_spatial_index.after(super::movement::validate_movement),
super::listening::update_listening_focus
.after(super::movement::validate_movement),
super::zone::detect_zone_crossings
.after(super::movement::validate_movement),
super::zone::detect_zone_crossings.after(super::movement::validate_movement),
)
.in_set(TickPhase::Movement),
);
+7 -10
View File
@@ -1,9 +1,9 @@
//! Time and streaming plugin — tick advancement, chunk streaming, news ticker.
//!
//! Systems span two phases:
//! - [`TickPhase::PreInput`]: chunk_streaming (loads chunks before input processing)
//! - [`TickPhase::TickAdvance`]: advance_tick (must be last in the pipeline)
//! - [`TickPhase::Snapshot`]: tick_news_ticker (assembles display content)
//! Systems span three phases:
//! - PreInput: chunk_streaming (loads chunks before input processing)
//! - Snapshot: tick_news_ticker (assembles display content)
//! - TickAdvance: advance_tick (must be last in the pipeline)
use bevy_app::prelude::*;
use bevy_ecs::schedule::IntoScheduleConfigs;
@@ -20,18 +20,15 @@ impl Plugin for TimePlugin {
.init_resource::<super::ticker::TickerPool>()
.add_systems(
Update,
super::chunk_streaming::chunk_streaming
.in_set(TickPhase::PreInput),
super::chunk_streaming::chunk_streaming.in_set(TickPhase::PreInput),
)
.add_systems(
Update,
super::ticker::tick_news_ticker
.in_set(TickPhase::Snapshot),
super::ticker::tick_news_ticker.in_set(TickPhase::Snapshot),
)
.add_systems(
Update,
super::time::advance_tick
.in_set(TickPhase::TickAdvance),
super::time::advance_tick.in_set(TickPhase::TickAdvance),
);
}
}
+1 -2
View File
@@ -371,8 +371,7 @@ impl Plugin for StorytellerPlugin {
activation_pass
.after(append_player_history)
.after(tick_contamination_activation),
escalate_tells_on_activation
.after(activation_pass),
escalate_tells_on_activation.after(activation_pass),
expire_routine_deviations,
)
.in_set(TickPhase::Storyteller),
+10 -2
View File
@@ -62,8 +62,16 @@ impl TickPhase {
app.configure_sets(
Update,
(
PreInput, Input, Movement, Simulation, Economy, Storyteller, Snapshot,
PostSnapshot, Knowledge, TickAdvance,
PreInput,
Input,
Movement,
Simulation,
Economy,
Storyteller,
Snapshot,
PostSnapshot,
Knowledge,
TickAdvance,
)
.chain(),
);