haiku.rag/haiku_rag_slim/haiku/rag/client
Yiorgis Gozadinos 629e1ba4ea
Split the store module by responsibility
engine.py held four unrelated things: what the tables are, how to open a
connection, how to read a database's state, and the Store that coordinates
writes. At 1240 lines the Store's own concerns — locks, migrations, vacuum,
tags — were hard to find among them.

Table records, Arrow schemas, index_specs, ensure_indexes, REQUIRED_TABLES
and query_to_pydantic move to store/schema.py, which imports nothing from
haiku.rag: it describes the tables and never opens or mutates one.

gather_database_info, get_database_stats, DatabaseInfo and its result models
move to store/info.py. Nothing in Store calls them — they are read paths for
the CLI, doctor, inspector and ingester API — so info depends on engine and
not the reverse.

engine.py keeps the Store, ConnectionMode, connect_lancedb, the tag helpers
and the restore-order and retention constants. No re-exports: importers
point at the new modules.

test_app_info_uses_connect_lancedb_for_remote patched
haiku.rag.store.engine.connect_lancedb; gather_database_info now binds that
name in info.py, so the patch targets where the call is looked up.
2026-08-20 12:13:51 +03:00
..
__init__.py Move source adapters out of the ingester package 2026-08-20 11:46:55 +03:00
agents.py Lend the caller's client to the capability 2026-08-18 14:58:18 +03:00
documents.py Move source adapters out of the ingester package 2026-08-20 11:46:55 +03:00
downloads.py Normalize pragma comments to the codebase's single-line form 2026-07-26 20:18:19 +03:00
exceptions.py typed UnsupportedSourceError replaces pipeline string-marker matching 2026-05-26 11:44:46 +03:00
processing.py Move source adapters out of the ingester package 2026-08-20 11:46:55 +03:00
rebuild.py Split the store module by responsibility 2026-08-20 12:13:51 +03:00
search.py Stop the reranker fetch reading text it discards 2026-08-18 18:00:00 +03:00
titles.py Extract title generation into client/titles.py 2026-04-24 14:42:53 +03:00