Fix memory system bugs: deterministic summary id, skip legacy extraction
- _summary.py: replace non-deterministic hash() with zlib.crc32 so
  summary id stays stable across server restarts, preventing duplicate
  summary rows.
- extractor.py: skip memory extraction for legacy sessions (user_id=None)
  — ON CONFLICT(user_id, category, key) does not catch NULL duplicates
  in PostgreSQL (NULL != NULL).
- sessions.py: _process_stale_sessions skips legacy sessions.
- _facts.py: remove dead code (user_clause/user_param variables).
- test_extractor.py: add user_id to test sessions + new test for
  legacy session skip.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 27adfc9 commit bd8fb8107e9fb8f0586452064c1af3ae030389ce
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 8 May
Showing 5 changed files
View
navi/api/routes/sessions.py
View
navi/memory/_facts.py
View
navi/memory/_summary.py
View
navi/memory/extractor.py
View
tests/unit/memory/test_extractor.py