feat(truth): add ECAN attention economy module (#33)

Implement Economic Attention Network (ECAN) for memory importance management:
- EcanParams: decay_rate, beta, spread_factor, threshold
- decay_sti(): STI decay toward zero over time
- update_lti(): LTI accumulation weighted by STI, penalized below threshold
- spread(): boost STI for confirmed memories
- cycle(): full decay + LTI update weighted by truth value
- initialize(): compute initial STI/LTI from truth value and confidence

14 unit tests covering decay convergence, LTI growth/penalty,
spread clamping, cycle behavior, initialization, and bounds.

Part of #29
This commit is contained in:
Agent Zero
2026-04-04 02:12:47 +00:00
parent b19f65dc0b
commit 5e746e4425
3 changed files with 289 additions and 0 deletions

14
src/truth/mod.rs Normal file
View File

@@ -0,0 +1,14 @@
//! Truth scoring engine — PLN deduction, ECAN attention, and memory scoring.
//!
//! This module implements neuro-symbolic reasoning for evaluating the
//! truthfulness of stored memories. Based on the Bushidai Truth Simulator
//! by Thijs Smits (TS87).
//!
//! ## Components
//!
//! - **PLN** (Probabilistic Logic Networks): Deduction rules for computing
//! truth values from evidence chains.
//! - **ECAN** (Economic Attention Network): Manages short-term and long-term
//! importance of memories, enabling natural prioritization of verified knowledge.
pub mod ecan;