haiku.rag/tests
Yiorgis Gozadinos 4aee18dcbe
Operator dashboard at GET /; tighten Logfire span shape
Self-contained HTML status page served from the ingester's FastAPI app.
Polls /health, /sources, /stats, /jobs?status={claimed,dead,succeeded}
every 3s from the browser and renders queue chips, sources with
last-poll/skip-reason/circuit state, active jobs with cancel, recent
failures with retry, and recently-completed feed with op badges so
DELETE rows are visually distinct from UPSERTs. Zero external deps —
single static HTML, no CDN, no fonts, no images. Works offline.

To support the dashboard:
- New /stats endpoint exposing rolling throughput (5m/30m/1h), worker
  occupancy, oldest-queued age, and per-source DLQ + queue-depth
  breakdowns. Each field is a single SQL aggregation against the queue.
- JobRepo gains count_succeeded_since, oldest_queued_age_seconds,
  counts_by_source.
- SourceSummary gains last_skip_reason. BasePoller now records the
  reason the most recent sweep attempt was skipped ("pending_work" /
  "circuit_open"), cleared on the next successful poll. Closes the
  gap where operators couldn't tell from /sources alone why a source
  wasn't picking up new work.

Auth: dashboard route is unauthenticated (markup only). The JS attaches
the bearer to its own JSON fetches; on 401 it prompts once and stashes
the token in localStorage.

Two Logfire fixes that landed alongside:

- Drop logfire.instrument_fastapi() and the [fastapi] extra. The control
  plane is polled frequently (dashboard + docker healthcheck), so every
  endpoint became a span and drowned the useful traces. logfire itself
  stays — pulled in transitively via pydantic-ai-slim[logfire] — so
  ingester.poller.* / ingester.job / document.* spans keep emitting.

- Wrap FSPoller._handle_watch_change in an ingester.poller.watch_event
  span and pass _enqueue_extra. Without this, the watchfiles callback
  ran with no active context, the _otel carrier in job.extra was empty,
  and the worker's ingester.job span surfaced as an orphan trace root
  instead of nesting under the FS event that caused it.
2026-05-26 11:44:47 +03:00
..
cassettes record cassettes against new fixtures, fix stale assertions 2026-05-26 11:44:46 +03:00
chat rotate chat TUI conversation id per launch / clear-chat 2026-05-21 14:21:51 +03:00
data swap doclaynet.pdf to the full paper, add real-PDF split/merge test 2026-05-26 11:44:45 +03:00
docker Replace MinIO with SeaweedFS for S3 integration tests 2026-04-08 14:19:32 +03:00
ingester Operator dashboard at GET /; tighten Logfire span shape 2026-05-26 11:44:47 +03:00
sandbox toc.json nodes carry chunk_ids; fix cite to accept DB-resolvable chunk_ids 2026-05-20 11:37:35 +03:00
skills drop list_documents/get_document from default RAG skill 2026-05-26 11:35:43 +03:00
store Cover unparseable-metadata path 2026-05-26 11:44:47 +03:00
tools remove dead code, add tool descriptions in frontend, update changelog 2026-04-20 15:38:17 +03:00
utils Checkout version logic and datetime utils 2025-12-19 12:03:16 +02:00
__init__.py Use LLM-as-a-judge to test QA 2025-06-25 18:18:28 +03:00
conftest.py swap doclaynet.pdf to the full paper, add real-PDF split/merge test 2026-05-26 11:44:45 +03:00
json_body_serializer.py Use cassette to record and reply llms in qa tests 2025-12-26 15:41:11 +02:00
test_chunk.py surface figure captions in search results, lower search.limit to 5 2026-05-18 16:49:43 +03:00
test_chunker.py swap doclaynet.pdf to the full paper, add real-PDF split/merge test 2026-05-26 11:44:45 +03:00
test_cli.py drop the old monitor, rename serve→mcp, add e2e tests 2026-05-26 11:42:41 +03:00
test_client.py swap doclaynet.pdf to the full paper, add real-PDF split/merge test 2026-05-26 11:44:45 +03:00
test_client_analyze.py record cassettes against new fixtures, fix stale assertions 2026-05-26 11:44:46 +03:00
test_config.py Drop the multi-agent research workflow 2026-05-20 12:46:48 +03:00
test_context.py search: only attach picture bytes from pre-expansion chunks 2026-05-19 15:03:22 +03:00
test_context_enhancement.py record cassettes against new fixtures, fix stale assertions 2026-05-26 11:44:46 +03:00
test_converters.py swap doclaynet.pdf to the full paper, add real-PDF split/merge test 2026-05-26 11:44:45 +03:00
test_database_autocreate.py Migrate LanceDB to native async API 2026-04-24 14:42:52 +03:00
test_docling_serve_client.py round-robin docling-serve across multiple base_urls 2026-05-26 11:44:45 +03:00
test_document.py Migrate LanceDB to native async API 2026-04-24 14:42:52 +03:00
test_download_models.py Drop the multi-agent research workflow 2026-05-20 12:46:48 +03:00
test_embedder.py Expose embedding batch size as config 2026-05-13 14:09:47 +03:00
test_embedder_config.py auto-append /v1 to vllm base_url, matching ollama behavior 2026-05-05 16:08:14 +03:00
test_filter.py Push document-id filter into chunk search query 2026-04-24 16:07:07 +03:00
test_info.py Migrate LanceDB to native async API 2026-04-24 14:42:52 +03:00
test_inspector.py render attached pictures in inspector context modal under qa.model.vision 2026-05-06 12:00:12 +03:00
test_lancedb_connection.py Group relative-path test with the other connect_lancedb dispatch tests 2026-04-25 09:28:46 +03:00
test_logging.py Additional tests 2026-02-13 18:08:46 +02:00
test_mcp.py rename embed_image_query to embed_image; run description check on text path 2026-05-05 16:15:47 +03:00
test_pdf_split.py Bound pdf_split memory + release lock between slices 2026-05-26 11:44:46 +03:00
test_picture_description.py cover picture-description provider and rebuild edge cases 2026-05-05 14:20:37 +03:00
test_picture_in_context.py search: only attach picture bytes from pre-expansion chunks 2026-05-19 15:03:22 +03:00
test_processing.py Replace picture_description.enabled with processing.pictures enum 2026-05-13 16:22:44 +03:00
test_reader.py async versions for convert_file() convert_text() 2025-11-26 17:46:25 +02:00
test_rebuild.py Ensure schema parity for _StagingChunkRecord 2026-05-14 15:11:18 +03:00
test_reranker.py coverage 2026-05-14 15:54:43 +03:00
test_s3_integration.py drop the old monitor, rename serve→mcp, add e2e tests 2026-05-26 11:42:41 +03:00
test_s3_source.py canonical metadata keys: source_revision + content_type, bump to 0.50.0 2026-05-26 11:43:30 +03:00
test_search.py rename embed_image_query to embed_image; run description check on text path 2026-05-05 16:15:47 +03:00
test_settings.py drop the old monitor, rename serve→mcp, add e2e tests 2026-05-26 11:42:41 +03:00
test_skill_generator.py Remove documents from state, fix tests 2026-04-20 09:48:18 +03:00
test_skill_tools.py drop list_documents/get_document from default RAG skill 2026-05-26 11:35:43 +03:00
test_title_generation.py drop private title/embedding forwarders from HaikuRAG 2026-04-24 15:52:50 +03:00
test_utils.py Drop the multi-agent research workflow 2026-05-20 12:46:48 +03:00
test_versioning.py Track all in-flight background vacuum tasks, not just the last one 2026-04-24 14:42:53 +03:00