Files
settled-reach/server/src/knowledge/mod.rs
T
jpmschweitzerandClaude Sonnet 4.6 e86e53ec06 feat(engine): retire D-078 overheard conversation system (#848)
Per R-012: delete conversation.rs, both overheard content files, and
remove all 6 wire-up points (social_plugin, bridge/types, monologue,
voice/integration). Protocol version 22 → 23. Scope confirmed by
#842 audit — npc/ and content/global/ untouched. Surviving NPC
components (NpcName, NpcColorIndex, NpcConversation) migrated to
simulation/npc_components.rs for use by D-080 knowledge propagation.
Also applies pre-existing cargo fmt debt (names.rs and 4 others).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 14:08:26 +02:00

57 lines
1.9 KiB
Rust

//! Knowledge graph module (D-041).
//!
//! Implements information boundaries (D-010 principle 2): every piece of
//! state is tagged with who knows it. Per-entity KnowledgeGraph component
//! tracks what each entity knows about others and the world.
use bevy_app::prelude::*;
use bevy_ecs::prelude::*;
pub mod content_registry;
pub mod culture;
pub mod events;
pub mod graph;
pub mod registry;
pub mod types;
pub use content_registry::ContentEntityRegistry;
pub use culture::{
resolve_culture, CultureError, CultureResolver, CultureResolverResource, CultureTag,
};
pub use events::{
ContradictionDetectedEvent, ContradictionDetectedQueue, InteractionType, KnowledgeEvent,
KnowledgeEventQueue, KnowledgeEventType, ProcessedEntityGrant, ProcessedFactGrant,
ProcessedKnowledgeGrant,
};
pub use graph::KnowledgeGraph;
pub use registry::{EntityRegistry, StableEntityId};
pub use types::*;
/// Knowledge system plugin.
/// Registers resources and systems for knowledge graph processing.
pub struct KnowledgePlugin;
impl Plugin for KnowledgePlugin {
fn build(&self, app: &mut App) {
use crate::tick_phases::TickPhase;
app.init_resource::<KnowledgeEventQueue>()
.init_resource::<ContradictionDetectedQueue>()
.init_resource::<EntityRegistry>()
.init_resource::<ContentEntityRegistry>()
.init_resource::<DecayThresholds>()
// Knowledge phase: process events and decay.
// One-tick lag from snapshot is intentional — contradiction monologue
// and relationship shifts read as natural reaction delay (~0.1s).
.add_systems(
Update,
(
events::process_knowledge_events,
events::decay_knowledge.after(events::process_knowledge_events),
)
.in_set(TickPhase::Knowledge),
);
tracing::debug!("KnowledgePlugin initialized");
}
}