iai-personal-memory-engine icon indicating copy to clipboard operation
iai-personal-memory-engine copied to clipboard

`migrate-to-lilli --prune-telemetry-before` is silently ignored - 3.2.1

Open aphroditecircus opened this issue 2 months ago • 2 comments

Summary

The flag has no effect and gives no warning: every event row is copied regardless of the cut-off.

Reproduction

iai-mcp migrate-to-lilli --src <store>/hippo/brain.sqlite3 --swap \
        --prune-telemetry-before 2026-08-11T00:00:00Z --apply --yes
#   rows copied: ... events=790939 ...      (the source had 790939; nothing was filtered)

Tried twice, with a 30-day and a 3-day cut-off, on a store whose oldest events were well before both. Same result each time, no message.

Likely cause

events.ts holds plain text of the form 2026-09-10 02:19:30.501079+00:00 (space separator, no Z). The flag's documented argument is "a UTC datetime string", and ISO input with T and Z sorts above every stored value under a plain string comparison, so a WHERE ts >= ? predicate would keep everything and look like it worked.

Impact

Beyond the missing size reduction: the silence is the problem. Someone could reasonably use this flag for retention hygiene and believe old telemetry was dropped when all of it was carried into the new store. Either accept the stored format, or reject an argument that does not parse, rather than continuing quietly.

Workaround

Delete the rows with plain SQL on a stopped daemon before migrating — DELETE FROM events WHERE ts < '<cut-off>', then PRAGMA wal_checkpoint(TRUNCATE); VACUUM;. That worked (824 584 → 187 738 events, 1.5 GB → 913 MB) and PRAGMA integrity_check stayed ok.

Related

Found while investigating a daemon that OOM-loops on a migrated native store — filed separately.

aphroditecircus avatar Sep 11 '26 21:09 aphroditecircus

#173

aphroditecircus avatar Sep 11 '26 21:09 aphroditecircus

Fixed in v3.2.2 (live on PyPI as iai-pme 3.2.2). Developed/tested on macOS; Linux/Windows paths welcome from contributors.

CodeAbra avatar Sep 14 '26 01:09 CodeAbra