fix(server): add error logging, protocol version, and architecture docs
- Replace silent Entity::to_bits() fallbacks with tracing::error in observer.rs and interaction.rs (makes unregistered entities loud) - Add PROTOCOL_VERSION constant to types.rs, use in observer snapshot - Document single-observer assumption on NearbyInteractionBuffer - Document proximity-only (no LOS) limitation on compute_nearby_interactions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,15 @@ use serde::{Deserialize, Serialize};
|
||||
pub use crate::knowledge::types::{EntityVisibility, KnowledgeConfidence, RelationshipState};
|
||||
pub use crate::simulation::time::{DayPhase, TickRate};
|
||||
|
||||
/// Wire protocol version for ObserverSnapshot.
|
||||
///
|
||||
/// Versioning strategy: flat struct + serde defaults for field evolution.
|
||||
/// Client and server are co-versioned (subprocess IPC per D-020), so protocol
|
||||
/// negotiation is unnecessary. Client should reject snapshots with version !=
|
||||
/// PROTOCOL_VERSION. New fields use #[serde(default)] only during the migration
|
||||
/// period, then the default is removed once both sides are updated.
|
||||
pub const PROTOCOL_VERSION: u8 = 4;
|
||||
|
||||
/// The ONLY data structure crossing the client-server boundary (D-020)
|
||||
/// Contains all information visible to the observer at a given tick.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user