Coverage for src / quber / playground / __init__.py: 100%

0 statements  

« prev     ^ index     » next       coverage.py v7.14.0, created at 2026-09-23 22:14 -0400

1"""The answering playground: ask questions of an ingested document and see 

2each answer grounded on the page it came from. 

3 

4`app` is the FastAPI server (`quber playground` starts it) and owns every 

5route. It serves the page from `static/`, lists documents and resolves cited 

6ids through `db`, and runs uploads as subprocess jobs — `quber fuse` and 

7`quber figure`, then `ingest_fusion`. The upload's track selects the model 

8line for the whole job: the figure scan's model and the ingest's chunking 

9stream together. `ingest_fusion` writes the `ade_playground` Postgres schema 

10that `schema.sql` defines; nothing else writes it. 

11 

12A question flows retrieval-first: `retrieval` fuses vector and keyword 

13ranking over the ingested chunks (`embedding` supplies the vectors), a 

14ranker chosen by settings orders them (`selection` reads a window of the 

15fused ranking with Haiku; `ranking` judges every page and chunk with Jev), 

16and `answers` turns the retrieved context 

17into one `Answer` whose payload says what shape the reply took. `agent` is 

18the older single-shot answerer; `answers` supersedes it for the app, and it 

19remains the context builder and the benchmark's baseline arm. 

20 

21`benchmark` measures the answering path against FinanceBench and is not 

22imported by the server. 

23 

24Where the local corpus lives (staged PDFs, parse artifacts, uploads) comes 

25from `get_settings().playground`, never from a path relative to this package. 

26"""