chore(simulation): address review suggestions — comments and minor fixes
- monologue.rs: tracing::warn on unrecognized trigger in fallback arm - disclosure.rs: borrow-sequencing comment, first() simplification note - trait_modifiers.rs: delegate parse_confidence to KnowledgeConfidence::try_from - npc_knowledge_transfer.rs: fix misleading "draw randomly" comment, document one-directional transfer behavior - graph.rs: document intentional no-retrigger after contradiction - dialogue.rs: explain entity grant guardrail asymmetry (D-079) - knowledge/mod.rs: document one-tick monologue lag from system ordering - poi_discovery.rs: document D-079 carve-out for direct KG write Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -197,6 +197,10 @@ pub fn transfer_npc_knowledge(
|
||||
}
|
||||
|
||||
// --- Dual-mutable KG access ---
|
||||
// Transfer is one-directional per conversation tick: speaker → partner.
|
||||
// If both participants are Active NPCs, each fires as "speaker" in
|
||||
// separate conversation pairs (run_npc_conversations creates symmetric
|
||||
// pairs), so both directions are covered across two iterations.
|
||||
|
||||
let Ok([speaker_kg, mut partner_kg]) =
|
||||
kg_query.get_many_mut([speaker_entity, partner_entity])
|
||||
@@ -265,7 +269,8 @@ pub fn transfer_npc_knowledge(
|
||||
// Sort by most recently updated (deterministic: descending tick, stable by BTreeMap key order)
|
||||
candidates.sort_by(|a, b| b.sort_key().cmp(&a.sort_key()));
|
||||
|
||||
// Draw 1–3 entries
|
||||
// Take top 1–3 entries by recency (random count, deterministic selection).
|
||||
// The random element is HOW MANY facts transfer, not WHICH ones.
|
||||
let count = rng.rng.random_range(1u32..=3u32) as usize;
|
||||
let count = count.min(candidates.len());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user