You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# .backup is safe on a live WAL DB (consistent snapshot).
46
+
sqlite3 "$DB"".backup '$BACKUP'"
47
+
echo"==> Backup created."
48
+
49
+
echo
50
+
echo"==> BEFORE:"
51
+
sqlite3 "$DB"<<'SQL'
52
+
.mode column
53
+
.headers on
54
+
SELECT 'memories.pending-review' AS metric, COUNT(*) AS n FROM memories WHERE status='pending-review'
55
+
UNION ALL SELECT 'memories.active.ssv>=15', COUNT(*) FROM memories WHERE status='active' AND sessions_since_validation>=15
56
+
UNION ALL SELECT 'decaying(real: conf<4 & ssv>=5)', COUNT(*) FROM memories WHERE status='active' AND confidence<4 AND sessions_since_validation>=5 AND id NOT LIKE 'M-_system_%'
57
+
UNION ALL SELECT 'skill_proposals.pending', COUNT(*) FROM skill_proposals WHERE status='pending'
58
+
UNION ALL SELECT 'design_system_scans.pending', COUNT(*) FROM design_system_scans WHERE status='pending';
-- 2. Clean slate for the kept auto-enqueue mechanism: reset the staleness clock on
77
+
-- every active memory that had already aged, so the 15-cycle countdown restarts
78
+
-- fresh after the fix instead of immediately re-queuing a wave of old memories.
79
+
UPDATE memories
80
+
SET sessions_since_validation = 0,
81
+
updated_at = strftime('%Y-%m-%dT%H:%M:%fZ','now')
82
+
WHERE status = 'active'
83
+
AND sessions_since_validation >= 5
84
+
AND id NOT LIKE 'M-_system_%';
85
+
86
+
-- 3. Dismiss the auto-generated proposal/scan nudges (content is untouched; they
87
+
-- re-propose only when genuinely warranted now that dedup indexes exist).
88
+
UPDATE skill_proposals SET status = 'dismissed', reviewed_at = strftime('%Y-%m-%dT%H:%M:%fZ','now') WHERE status = 'pending';
89
+
UPDATE design_system_scans SET status = 'dismissed' WHERE status = 'pending';
90
+
91
+
-- 4. Reset the decay clock so the next scheduler tick starts a fresh 24h window.
92
+
UPDATE memories SET updated_at = strftime('%Y-%m-%dT%H:%M:%fZ','now') WHERE id = 'M-_system_decay_last_run';
93
+
94
+
COMMIT;
95
+
SQL
96
+
97
+
echo"==> Done."
98
+
echo
99
+
echo"==> AFTER:"
100
+
sqlite3 "$DB"<<'SQL'
101
+
.mode column
102
+
.headers on
103
+
SELECT 'memories.pending-review' AS metric, COUNT(*) AS n FROM memories WHERE status='pending-review'
104
+
UNION ALL SELECT 'memories.active.ssv>=15', COUNT(*) FROM memories WHERE status='active' AND sessions_since_validation>=15
105
+
UNION ALL SELECT 'decaying(real: conf<4 & ssv>=5)', COUNT(*) FROM memories WHERE status='active' AND confidence<4 AND sessions_since_validation>=5 AND id NOT LIKE 'M-_system_%'
106
+
UNION ALL SELECT 'skill_proposals.pending', COUNT(*) FROM skill_proposals WHERE status='pending'
107
+
UNION ALL SELECT 'design_system_scans.pending', COUNT(*) FROM design_system_scans WHERE status='pending';
108
+
SQL
109
+
110
+
echo
111
+
echo"All five counters should now read 0. If anything looks wrong, restore with:"
112
+
echo" cp '$BACKUP' '$DB' # (stop the server first)"
0 commit comments