feat(intelligence): persist pain points and proposals to SQLite

PainAggregator and SolutionGenerator were in-memory only, losing all
data on restart. Add PainStorage module with SQLite backend (4 tables),
dual-write strategy (hot cache + durable), and startup cache warming.

- New: pain_storage.rs — SQLite CRUD for pain_points, pain_evidence,
  proposals, proposal_steps with schema initialization
- Modified: pain_aggregator.rs — global PAIN_STORAGE singleton,
  init_pain_storage() for startup, dual-write in merge_or_create/update
- Modified: solution_generator.rs — same dual-write pattern via
  global PAIN_STORAGE
- 20 tests passing (10 storage + 10 aggregator)
This commit is contained in:
iven
2026-04-09 09:15:15 +08:00
parent 2247edc362
commit a4c89ec6f1
4 changed files with 899 additions and 11 deletions

View File

@@ -35,6 +35,7 @@ pub mod extraction_adapter;
pub mod pain_aggregator;
pub mod solution_generator;
pub mod personality_detector;
pub mod pain_storage;
// Re-export main types for convenience
pub use heartbeat::HeartbeatEngineState;