Compiled from
raw/codebase-snapshots/monorepo-packages-2026-04-09.mdraw/architecture-docs/app-README.md
Lexery — DocList Surface
DocList is the document list / legislation catalog resolver layer: it turns messy user language and partial identifiers into structured act identity against the Rada legislation catalog. It pairs with LLDBI (what is indexed) in retrieval.
Three Applications (Package Detail)
@lexery/doclist-resolver-api
Cloudflare Worker для act resolution і disambiguation. Розгорнутий як edge function, забезпечує low-latency lookup для Brain pipeline. Приймає partial act identifiers (назва, номер, фрагменти тексту) і повертає structured act identity з confidence scores. При multiple matches повертає AMBIGUOUS_ACT_MATCH з ranked candidates для clarification.
@lexery/doclist-updater-db
Daily incremental updater — забезпечує синхронізацію каталогу з даними Верховної Ради:
- Завантажує delta з Rada API (нові акти, зміни до існуючих)
- Парсить structured metadata (назва, номер, дата, статус)
- Генерує embeddings для act-level vectors
- Оновлює Qdrant collection
lexery_legislation_acts - Оновлює Supabase
legislation_documentsтаблицю
Працює як scheduled job — або через cron, або через GitHub Actions trigger.
@lexery/doclist-full-import
Full catalog importer для початкового наповнення або повного rebuild. На відміну від updater, обробляє весь каталог Ради від початку, не тільки delta. Використовується при:
- Initial setup нового environment
- Rebuild після schema changes в Qdrant
- Recovery після data corruption
| App | Responsibility |
|---|---|
doclist-resolver-api | Lookup і disambiguation для act identification |
doclist-full-import | Bulk catalog import / rebuild workflows |
doclist-updater-db | Incremental updates as the catalog changes |
Together they keep the catalog aligned with parliament data while exposing a stable API for the agent pipeline.
Catalog Numbers
Поточний стан каталогу (observed):
- 374 acts у Supabase
legislation_documentsтаблиці - Кожен акт має
qdrant_statustracking:indexed(chunks є в Qdrant),pending(в черзі на indexing),failed(помилка при processing) - 966 import jobs processed — кожен job відповідає за import або re-index конкретного акту, tracked у
legislation_import_jobs - ~21,266 chunks у Qdrant
lexery_legislation_chunkscollection
Ці числа ростуть по мірі додавання нових актів через import proposals і regular updater runs.
Role in the product
Rada legislation catalog → structured lookup → Brain can ask “which act does this query mean?”
When Brain must bind a query to a concrete act, DocList is the authority for catalog membership and identifier normalization (subject to the caveats below). LLDBI then answers whether that act is indexed for vector search.
Reason codes (disambiguation and gaps)
DocList and downstream stages emit reasons that downstream logic (including U6) interprets:
AMBIGUOUS_ACT_MATCH— multiple plausible acts; may need clarificationACT_FOUND_IN_CATALOG_NOT_INDEXED— catalog hit but not in LLDBI / Qdrant → ties to import proposalsACT_FOUND_BUT_ARTICLE_NOT_RETRIEVED— act known but retrieval did not surface the article sliceACT_NOT_FOUND_IN_CATALOG— no catalog anchor; different recovery path
These codes are part of honest coverage and retry policy.
Integration: U6 Recovery
U6 Recovery calls DocList when retrieval needs disambiguation or catalog confirmation — especially after a weak or ambiguous U4 pass. The resolver output feeds traces consumed by run snapshots (doclist_trace).
Exact identifiers: interpret.ts and pipeline.ts
For nreg probes, interpret.ts and pipeline.ts strip year-hardening filters so exact structured identifiers are not over-constrained by year heuristics. That preserves precision when the user (or upstream) already supplied a registry-grade key.
Lookup priority (conceptual)
- Exact structured identifiers first (strongest signal)
- Act-title cues and metadata matches
- Broad rewrite / noisy text last (highest false-positive risk)
This ordering reduces accidental binding when query rewrite adds generic terms.
Historical note
The DocList updater lineage starts in the public beta repo under paths such as scripts/legislation/Documentation List DB/UpdaterDB/. The current split apps are the production evolution of that script-era updater.
Catalog vs index
DocList can say “act exists”; LLDBI must still contain chunks for retrieval. Always cross-check both when triaging “missing law” reports.
Related
- Lexery - LLDBI Surface
- Lexery - Retrieval, LLDBI, DocList
- Lexery - U6 Recovery
- Lexery - Import Proposal Loop
- Lexery - Corpus Evolution
- Lexery - Legacy Beta App
- Lexery - Retry and Recovery
- Lexery - Coverage Gap Honesty
- Lexery - Storage Topology