fix(simulation): address PR #26 review comments (13 items)

Warnings fixed:
- Add WalkAway to all_player_action_variants_roundtrip test
- Warn and skip on unresolvable speaker_entity_id (was silent 0)
- Change MonologueState.shown_ids from Vec to HashSet (O(1) lookup)
- Add cross-plugin ordering: trigger_recognition_monologue after
  detect_anomalies (latent determinism bug)
- Add TODO for unreachable Secret trust tier

Suggestions addressed:
- Server-side range check for Talk verb in handle_talk (CLOSE_RANGE)
- Emit IncompleteInteraction before overwriting ActiveDialogue
- Add different_seed_produces_different_replay determinism test
- Replace panic with assert for unknown fixture naming convention
- Fix duplicate "Observe" label: ExamineNpc now uses "Examine NPC"
- Change DialogueCooldownTracker.used from Vec to BTreeMap (D-041)
- Add .after(process_talk_interaction) to process_walk_away ordering
- Collapse dead conditional in main.rs (both branches identical)

468 tests pass, 0 failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 18:12:45 +01:00
co-authored by Claude Opus 4.6
parent a5ab8238e1
commit 12d1fd505e
8 changed files with 223 additions and 34 deletions
+6 -4
View File
@@ -8,6 +8,8 @@
// When sprinting past a Contradicted entity, a delayed "double-take" monologue
// fires retroactively. Detection in observer pipeline, processing here.
use std::collections::HashSet;
use bevy_ecs::prelude::*;
use rand::Rng;
@@ -81,7 +83,7 @@ pub struct MonologueState {
/// Whether the enter_location monologue has fired this session.
pub entered: bool,
/// IDs of lines already shown (dedup within session).
pub shown_ids: Vec<String>,
pub shown_ids: HashSet<String>,
/// Character type for pool filtering. v0.1: always "detective".
pub character: String,
}
@@ -93,7 +95,7 @@ impl Default for MonologueState {
last_position: None,
idle_ticks: 0,
entered: false,
shown_ids: Vec::new(),
shown_ids: HashSet::new(),
// v0.1: default to detective; character selection sets this
character: "detective".to_string(),
}
@@ -337,7 +339,7 @@ pub fn trigger_recognition_monologue(
duration_seconds: DISPLAY_DURATION,
});
state.shown_ids.push(id.clone());
state.shown_ids.insert(id.clone());
state.last_fired_tick = time.tick;
// Mark this pending recognition as having fired its monologue
@@ -453,7 +455,7 @@ pub fn trigger_monologue(
duration_seconds: DISPLAY_DURATION,
});
state.shown_ids.push(id.to_string());
state.shown_ids.insert(id.to_string());
state.last_fired_tick = time.tick;
// Reset idle counter so time_idle doesn't fire again immediately
state.idle_ticks = 0;