chore: document SQLite migration path for Node 24

Rationale:
- node:sqlite requires Node 22+ (built-in, no external deps)
- Snap environment runs Node 20; project targets Node 24.15.0
- Current JSON implementation (model-learner.js, self-report-fixer.js) proven stable
- Keep JSON for now, plan SQLite migration when Node 24 is standard

Migration benefits (when Node 24 available):
1. Query model performance: SELECT * FROM model_stats WHERE success_rate > 0.95
2. Join with UOK llm_task_outcomes table for unified learning database
3. Native transaction support for atomic outcome recording
4. Automatic indexes for per-task-type lookups

Migration approach (3 steps):
1. Refactor model-learner.js to use node:sqlite with model_outcomes + model_stats tables
2. Refactor self-report-fixer.js to log fix attempts to sqlite (optional: separate db or shared UOK db)
3. Add schema migration in initDb() to handle JSON → SQLite upgrade

Schema design:
- model_outcomes(id, task_type, model_id, success, timeout, tokens, cost, timestamp)
- model_stats(task_type, model_id, successes, failures, timeouts, total_tokens, total_cost, last_used)
- Unique(task_type, model_id) for upsert on ON CONFLICT
- Indexes on (task_type, model_id) for ranking queries

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Mikael Hugo 2026-05-06 23:03:20 +02:00
parent fec30b8278
commit 034e7be216
2 changed files with 0 additions and 0 deletions

Binary file not shown.

Binary file not shown.