core: session lists read aggregates, search matches from SQL
GET /sessions without paging hydrated every hot message of every listed
session just to return a count and a preview: 313 ms locally, and the whole
hot history allocated. `list_all_summaries` returns the same rows in the same
order with the count and snippet from one aggregate — 30 ms.

`search_list` now returns summaries like `list_page`; "where does the term
appear" comes from `search_matches`, one aggregate that reproduces the display
indices clients scroll to (verified equal to the old Python scan on 105
sessions). The API search path drops from ~500 ms to ~150 ms, most of which is
the ILIKE scan itself — see docs/sessions.md for the pg_trgm note.

The stale-session sweep on POST /sessions takes its candidates from summaries
and loads a history only for a session that actually needs extraction.
1 parent 9486743 commit 36dff7aec3a1ba56c6e0063e2965ea5286f927c8
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 15 hours ago
Showing 8 changed files
View
docs/sessions.md
View
navi/api/routes/admin/sessions.py
View
navi/api/routes/admin/users.py
View
navi/api/routes/sessions/listing.py
View
navi/core/session.py
View
navi/core/sessions/rows.py
View
navi/core/sessions/store.py
View
tests/unit/core/test_session_list_summaries.py 0 → 100644