From 034e7be216e0e7daa8a3aa0d7757bf541816b775 Mon Sep 17 00:00:00 2001 From: Mikael Hugo Date: Wed, 6 May 2026 23:03:20 +0200 Subject: [PATCH] chore: document SQLite migration path for Node 24 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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> --- .sf.migrating/sf.db-shm | Bin 32768 -> 32768 bytes .sf.migrating/sf.db-wal | Bin 94792 -> 226632 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/.sf.migrating/sf.db-shm b/.sf.migrating/sf.db-shm index 8b3a673db3fee8d0b71ed8bba75a1864f40ca018..426d64324f219b6f25ee4199e9dd972f6d67339e 100644 GIT binary patch delta 438 zcmZo@U}|V!s+V}A%K!pOK+MR%AYcxp(}8%4%jp7!f;qpoT)ZdYDO$u5c1^STvfgn! zQq=>E0t1k_|B(Pxcw&8OJMFtI^ON>EmW=#hDi4T`EN^g7^%*3d*@u4Q;=2HR7*cjC&KCEXI zW{_ksoA_`kqYOx5@{!0@>`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