feat(simulation): add NPC name masking with role labels and color index

Server-side infrastructure for information asymmetry in dialogue.
NPCs display role labels (Worker, Supervisor, Patron) instead of
real names until the player explicitly learns them via KG lookup.
NpcColorIndex (stable_id % 8) persists across name reveal.

ConversationEvent and DialogueResponseEvent carry display names +
color indices on the wire with serde(default) for compat.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-21 13:42:59 +01:00
co-authored by Claude Opus 4.6
parent 82e58559ba
commit 28e7e6d9ad
12 changed files with 446 additions and 63 deletions
+22 -1
View File
@@ -2,7 +2,7 @@
// Timestamped player input events for deterministic simulation (D-010 principle 4)
// PlayerInput: semantic actions (MoveNorth, Interact, UsePerceptionMode, ToggleStance)
use crate::bridge::types::{PlayerAction, PlayerInput};
use crate::bridge::types::{FacingDirection, PlayerAction, PlayerInput};
use crate::knowledge::{EntityRegistry, StableId};
use crate::perception::vision_cone::{facing_from_delta, Facing};
use crate::simulation::inventory::{
@@ -237,6 +237,27 @@ pub fn process_player_input(
tracing::debug!("WalkAway: marker set on player");
}
}
PlayerAction::SetFacing { ref facing } => {
let dir = match facing.as_str() {
"North" => Some(FacingDirection::North),
"Northeast" => Some(FacingDirection::Northeast),
"East" => Some(FacingDirection::East),
"Southeast" => Some(FacingDirection::Southeast),
"South" => Some(FacingDirection::South),
"Southwest" => Some(FacingDirection::Southwest),
"West" => Some(FacingDirection::West),
"Northwest" => Some(FacingDirection::Northwest),
_ => {
tracing::warn!("SetFacing: unknown direction {:?}", facing);
None
}
};
if let Some(dir) = dir {
if let Ok((entity, _, _, _)) = player_query.single_mut() {
commands.entity(entity).insert(Facing(dir));
}
}
}
PlayerAction::TeleportToHub => {
handle_teleport_to_hub(&mut player_query, &mut commands);
}