haiku.rag/tests/store
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
legacy_documents.py
test_citation.py Expose all chunk metadata on search results and citations through SearchResult.chunk_meta and Citation.chunk_meta 2026-08-17 19:42:23 +02:00
test_compression.py
test_database_info.py Split the store module by responsibility 2026-08-20 12:13:51 +03:00
test_document_item_grouped.py Stop the reranker fetch reading text it discards 2026-08-18 18:00:00 +03:00
test_document_items.py Split the store module by responsibility 2026-08-20 12:13:51 +03:00
test_document_meta_split.py Split the store module by responsibility 2026-08-20 12:13:51 +03:00
test_engine.py Split the store module by responsibility 2026-08-20 12:13:51 +03:00
test_indexes.py Split the store module by responsibility 2026-08-20 12:13:51 +03:00
test_migrations.py Stop eagerly importing Store from haiku.rag.store 2026-08-11 17:26:51 +01:00
test_open_path.py Read the table list and settings once per open 2026-08-18 14:58:17 +03:00
test_read_only.py Put multi-table writes behind one transaction boundary 2026-08-19 14:05:40 +03:00
test_restore.py Stop eagerly importing Store from haiku.rag.store 2026-08-11 17:26:51 +01:00
test_tags.py Split the store module by responsibility 2026-08-20 12:13:51 +03:00
test_v0_40_0_migration.py Split the store module by responsibility 2026-08-20 12:13:51 +03:00
test_v0_45_0_migration.py Split the store module by responsibility 2026-08-20 12:13:51 +03:00
test_v0_48_0_migration.py Split the store module by responsibility 2026-08-20 12:13:51 +03:00
test_v0_50_0_migration.py Reach and enforce 100% coverage 2026-07-26 20:11:02 +03:00
test_v0_58_0_migration.py Split the store module by responsibility 2026-08-20 12:13:51 +03:00
test_v0_64_0_migration.py Rename document_meta identity column document_id to id 2026-07-08 16:32:55 +03:00
test_v0_75_0_migration.py Trim comments, docstrings and docs to what they need to say 2026-08-18 12:38:02 +03:00