Commit Graph

4 Commits

Author SHA1 Message Date
Agent Zero
a7a070024a feat(truth): add scoring pipeline module (#34)
Implement truth scoring orchestrator that ties PLN + ECAN together:

New types:
- TruthCategory: verified/plausible/unverified/contradicted enum
- ScorerConfig: pipeline configuration (thresholds, ECAN params)
- RelatedMemory: cross-reference result with similarity + existing scores
- ScoringResult: complete scoring output with TV, confidence, category, ECAN

Core functions:
- score_memory(): orchestrates evidence classification, PLN scoring,
  ECAN computation, and categorization
- is_contradiction(): heuristic negation-asymmetry detection
- categorize(): rule-based category assignment

Scoring pipeline:
1. Classify related memories as confirmations or contradictions
2. Scale confidence by cosine similarity (closer = stronger evidence)
3. Apply PLN score_with_evidence for truth value computation
4. Run ECAN cycle (re-score) or initialize (first score)
5. Categorize based on TV, confirmations, and contradictions

13 unit tests covering all scoring paths, categories, contradiction
detection, ECAN initialization/cycling, and output bounds.

Part of #29
2026-04-04 03:15:17 +00:00
Agent Zero
b6ce2fdeda merge: resolve conflict with main — combine PLN and ECAN in truth/mod.rs 2026-04-04 03:09:48 +00:00
Agent Zero
1672d5a145 feat(truth): add PLN deduction engine (#32)
Implement Probabilistic Logic Networks (PLN) inference rules:
- TruthValue struct with clamped strength/confidence
- deduction(): chain two implications A->B and B->C
- revision(): merge two independent truth estimates
- negation(): logical NOT (inverts strength, preserves confidence)
- conjunction(): logical AND (multiply strength, min confidence)
- score_with_evidence(): combine base score with confirmations and contradictions

10 unit tests covering basic operations, boundary cases,
symmetry, zero-confidence handling, and output bounds.

Part of #29
2026-04-04 02:14:01 +00:00
Agent Zero
5e746e4425 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
2026-04-04 02:12:47 +00:00