refactor(server): decompose observer pipeline and fix interaction boundary

Extract visibility geometry into a separate system behind a
PerceptionQuery trait, enabling D-017 perception mode swapping.
Two-stage pipeline: compute_visibility_geometry writes to
VisibilityGeometry resource, compute_observer_snapshot reads it.

Remove KnowledgeGraph from compute_nearby_interactions (simulation
phase boundary violation). Verb availability stays in simulation;
POI-based priority adjustment moves to observer via
apply_poi_verb_priority helper.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-12 23:32:41 +01:00
co-authored by Claude Opus 4.6
parent e6bd577a5a
commit 18d8253bfe
9 changed files with 380 additions and 262 deletions
+11 -4
View File
@@ -145,18 +145,25 @@ impl Plugin for BridgePlugin {
fn build(&self, app: &mut App) {
app.init_resource::<SnapshotBuffer>()
.init_resource::<ServerRunning>()
.init_resource::<crate::perception::query::VisibilityGeometry>()
.init_resource::<crate::perception::query::ActivePerceptionMode>()
.add_systems(
Update,
(
receive_bridge_inputs.before(crate::simulation::input::process_player_input),
receive_bridge_inputs
.before(crate::simulation::input::process_player_input),
crate::perception::observer::compute_visibility_geometry
.after(crate::simulation::movement::validate_movement),
crate::simulation::interaction::compute_nearby_interactions
.after(crate::simulation::movement::validate_movement),
crate::perception::observer::compute_observer_snapshot
.after(crate::simulation::movement::validate_movement)
.after(crate::perception::observer::compute_visibility_geometry)
.after(crate::simulation::interaction::compute_nearby_interactions)
.before(crate::simulation::time::advance_tick),
crate::perception::observation::emit_observation_events
.after(crate::perception::observer::compute_observer_snapshot),
send_bridge_snapshot
.after(crate::perception::observer::compute_observer_snapshot)
.after(crate::simulation::interaction::compute_nearby_interactions),
.after(crate::perception::observer::compute_observer_snapshot),
),
);
tracing::debug!("BridgePlugin initialized");