haiku.rag/haiku_rag_slim/haiku/rag/ingester/api/routes
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 HTTP control plane 2026-05-26 11:41:54 +03:00
config.py Add /database and /config endpoints to the ingester API 2026-06-09 12:11:33 +03:00
dashboard.py feat(ingester): serve control plane under a configurable base path 2026-06-09 23:02:43 -04:00
database.py Split the store module by responsibility 2026-08-20 12:13:51 +03:00
dlq.py Bound ?limit and ?offset on /jobs and /dlq 2026-05-26 16:05:47 +03:00
health.py Add pool-wide circuit breaker to the worker pool 2026-05-27 10:52:48 +03:00
jobs.py Bound ?limit and ?offset on /jobs and /dlq 2026-05-26 16:05:47 +03:00
providers.py Probe docling-serve only when converter or chunker uses it 2026-05-27 15:18:25 +03:00
sources.py Tighten retry/reap_stale guards; fix SourceSummary.type leak 2026-05-26 12:38:55 +03:00
stats.py Operator dashboard at GET /; tighten Logfire span shape 2026-05-26 11:44:47 +03:00