superlocalmemory icon indicating copy to clipboard operation
superlocalmemory copied to clipboard

4.2.13: `slm ops repair-saves` leaves 2,231 failed saves "for review" (blanked `[REDACTED:ENTROPY:…]` copies), but the one-time store repair it points to already completed on 2026-10-09 and never runs again

Open raorthopro-cpu opened this issue 1 month ago • 3 comments

Environment

  • macOS (Apple Silicon), superlocalmemory 4.2.13 installed globally via npm, daemon run by launchd (unified_daemon --start --port=8768), SLM_DATA_DIR set to a custom data dir.
  • Mode B (local Ollama gemma3:4b). Store: ~37,500 facts, 6,600 entities, 9,400 memories.
  • Store history: created on 4.1.1x in September, upgraded through 4.1.19 → 4.1.24 → (4.2.11, rolled back, see #304) → 4.2.13.

What happens slm ops status reports DEGRADED, dead-letter entries: 2493. The dry run of slm ops repair-saves says:

Saves to re-file: 262 {'repoint': 2, 'add_memory_and_fact': 260}
Left alone for review: 2231
  <op>: its text was changed after saving          (5 of them)
  <op>: blanked copy: the store repair restores it  (the other 2,226)
Dead-letter entries of saves that later completed: 759

--apply worked as documented (262 re-filed, 759 stale dead letters cleared, backup written). Thanks for that tool.

The 2,231 left for review are stuck, though:

  • All are source_type = http, state = failed, attempt_count = 10, last_error = "queryable ingestion memory content mismatch", created 2026-10-04 … 2026-10-07 (on 4.1.1x), last updated 2026-10-11. The matching dead_letter_operations rows carry the same error (2,231 rows).
  • Their memories (2,230 rows in memories) still contain redaction markers. Example (raw_content is 200 chars, the stored memory is 114 chars): [Dokument · mail-anhang] [REDACTED:ENTROPY:.pdf] (geändert 2026-10-04 18:46) (Teil 1/5)\n\n# [REDACTED:ENTROPY:port] i.e. the file name and the first heading were replaced by markers when the save was written.
  • upgrade-repair.json:
    repair_id store-repair-4.1.19, status complete, completed_at 2026-10-09T00:51:01+00:00,
    planned: memories_to_restore 766, result: memories_restored 759, memories_skipped 7
    
    and the daemon logs one-time store repair: {... 'status': 'already_done'} on every start.

So repair-saves defers these saves to the store repair ("blanked copy: the store repair restores it"), the store repair already ran (it restored 759 other memories; these 2,230 were apparently not in its plan or were skipped), and because it is one-time it will not look at them again. Result: 2,231 saves that can neither be enriched nor cleaned up with the shipped tools. slm ops list shows them as failed forever.

What I expected Either repair-saves restores the blanked copy itself from the operation's raw_content (the operation is "the authority for it", as the module docstring says) and requeues the save, or a documented way to re-run the store repair for the remaining blanked memories, or an slm ops resolve action that cancels them cleanly (removing the failed op + dead-letter rows and leaving the blanked memory marked as such).

Questions

  1. Is there a supported way in 4.2.13 to get these 2,231 saves enriched (or cancelled) without hand-editing memory.db?
  2. Would you accept a change so that repair-saves handles blanked copies when upgrade-repair.json is already complete?

Happy to run any diagnostic you want against this store, or to send a few anonymised rows (operation_id, raw_content, memory content).

raorthopro-cpu avatar Nov 02 '26 00:11 raorthopro-cpu

Thank you for the careful analysis. You found the exact cause, and the row-level detail made the fix straightforward. Fixed in 4.2.14, released today (pip install -U superlocalmemory or npm install -g [email protected]).

Your reading was right: the one-time store repair only saw saves that had already failed when it ran, and yours failed two days later, so no shipped tool could reach them. slm ops repair-saves now restores a blanked copy itself, from the save's own original text, and re-files it. It uses the same guarded writes the store repair used, so a row that changed in the meantime is skipped, never overwritten.

slm ops repair-saves            # dry run: shows restore_then_add_fact / restore_then_repoint counts
slm ops repair-saves --apply    # backs up memory.db first, then repairs

Two kinds are deliberately left for you, each listed with its reason. The first is an original that looks like it holds a secret, since the old redactor may have been right about that one. The second is an original the ingest gate rejects. The one-time store repair also no longer restores a secret.

About the 5 marked "its text was changed after saving": that label was wrong. No SLM path rewrites a memory's text after a save; an edit adds a correction instead. 4.2.14 now says the stored text differs from the save by more than redaction markers. If you can share, for one of them, how the memory's text differs from the save's raw_content (a diff with the content anonymised is enough), we can tell whether it is a redaction form we do not recognise yet. If you do not want those saves, slm ops resolve <operation id> --action cancel clears them cleanly.

varun369 avatar Nov 09 '26 10:11 varun369

Reopening: the fix shipped in 4.2.14, and this stays open until we hear back on the question above. Thank you.

varun369 avatar Nov 09 '26 10:11 varun369

Update: on 4.2.14, slm ops repair-saves --apply re-filed 2,225 of the failed saves; 6 remain listed as "text was changed after saving". We have since retired this instance, so I will not be able to provide the stored-text vs raw_content comparison. Feel free to close this issue. Thanks for your help.

raorthopro-cpu avatar Nov 13 '26 13:11 raorthopro-cpu