Memento v1.2.1 — Enterprise DB Self-Healing
Makes Memento resilient to the recurring binary-corruption class of failures (bytes rewritten through a text decode) instead of crashing with a cryptic database disk image is malformed.
- New
memento/db_guard.py: detects SQLite corruption (PRAGMA integrity_check), backs the corrupted file up to a timestamped.corrupted-<ts>copy (db +-wal/-shm), and lets the next connection recreate a fresh store while preserving the original forsqlite3 "<file>" ".recover". - Wired into
provider.initialize(memory + KG DBs) andknowledge_graph._conn()so corruption is detected and self-healed on startup. memento doctorreports Memory/KG DB integrity and gains a--repairflag (backs up corrupted DBs for recreation on next start)..gitattributesmarks binary assets (.so/.db/.sqlite/.whl/…) as binary so git never text-mangles them.- Tests:
tests/test_db_guard.py(6 pass); full suite green (431).