Spaces:
Running
Running
Commit History
20 days ago
-
feat(search): keep each search's stage times, so a cold one shows up for days
siddhm11 +1: Claude Opus 5.5/healthz/runtime keeps the last 200 searches in memory and loses them on every restart, and search_log stored only the total. So whether real readers still meet cold models after a quiet spell could only be told by a one-off test. search_log now also stores the encode, cross-encoder, retrieval, rewrite-call and metadata times, and the seconds since the search before (NULL = the first since a restart); an answer from the cache stores none, since it carries the times of the search it copies. Replicated: the remote columns are added at start-up like llm_calls'. /admin/searches gets a Speed table: all searches, those after an hour or more without one, and the first after a restart, median (a true one: these groups are small) and slowest 5%. The latest searches show their encode and cross-encoder times and when one came after a quiet spell. rewrite_call_ms is the Groq rewrite's own time. groq_time_ms also counts the wait for the encode, so it overstated the rewrite whenever the encode was…d144aa2
-
feat(analytics): count what each reader does, per day
siddhm11 +1: Claude Opus 5.5There are no accounts, so a reader is the anonymous cookie. Interactions recorded saves and passes, but not visits, searches, feed pages, papers opened or questions asked, and the owner's own testing was mixed in with everyone else's (October's three active readers were the owner). reader_days keeps one replicated row per reader per UTC day: pages, searches, feed pages, papers opened, saves, passes and questions, with owner = 1 for a browser holding the preview token. analytics.observe(), called from the HTTP middleware for every finished request, classifies it by route, so no handler has to remember; failed requests, first visits, static files, figures, health and admin pages don't count. Counts live in memory and are written every minute and on shutdown, rows rewritten whole so turso_sync pushes them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>ae5214c -
feat(analytics): log searches, and keep and reuse their AI overviews
siddhm11 +1: Claude Opus 5.5Searches weren't recorded at all: 321 of 335 saves came from search results, but not how many searches there were or what was asked. search_log now keeps one row per search: the query (collapsed, at most 200 characters), its query_id (which the results' clicks and saves carry), the result count, retrieval mode, the AI rewrite when it changed the query, the time taken, and whether it was the owner. It is not stored against the reader. search_overviews keeps the AI overview shown for a query over its top five papers, and is also its cache: the same search reuses it for a week instead of a new model call (counted as search_overview cache hits). What people typed is kept 90 days: a daily housekeeping run clears query text, rewrites, overviews and search subjects in llm_calls, locally and in Turso, which only ever receives new rows and so must be told. Counts stay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>bc1e7b6