v0.2.4cerebra2026-06-11

Phase 5 Step 5 — Truth Tower T1+T2 core (two-tier evidence stack)

TruthTower class with T1 auto-promotion from retrieval results, T2 manual promotion citing a T1 anchor, staleness cascade on T1 eviction, chronological render, and full inspector event suite.

v0.2.42026-06-11
  • ·TowerItem dataclass + TruthTower class (promote_to_t1, promote_to_t2, evict, mark_stale_from_t1_eviction, render_chronological, to_tower_field)
  • ·Lattice sibling dedup in T1: _get_active_t1_chunk_ids() JOINs truth_tower_items → memory_records before the loop; seen_chunk_ids set blocks subsequent siblings per chunk_id
  • ·Born-stale rejection (Amendment 4): promote_to_t2() raises TowerPromotionError if cited T1 has evicted_at IS NOT NULL — prevents backdating T2 evidence
  • ·Staleness cascade: T1 eviction marks all active T2 items citing it is_stale=1; stale T2s remain visible in render with [stale] suffix; mark_stale_from_t1_eviction() is idempotent
  • ·TowerInitialized emitted exactly once per session (COUNT(*) includes evicted rows — survives eviction rounds)
  • ·WAL safety: all event writes after conn.close(); mark_stale_from_t1_eviction() always called after main conn.close(), opens its own short-lived connection
  • ·39 unit + 5 vault integration tests; truth_tower.py 96% coverage