Add P0 infrastructure for the Volve-DIA benchmark

Set up the data, parsing and quality-control layer for a public benchmark
on the Volve daily drilling reports (DDR) and WITSML real-time data.

- Data manifest with SHA-256 hashes of the three Volve subtrees in use.
- DDR XML parser into DuckDB (1,759 reports, 26 wellbores, 23,447
  activities, 17 tables) with locked expected counts.
- Render QC of the publisher HTML against the XML (272,544 items).
- OCR client for the shared chandra vLLM service, with a page cache keyed
  on model, prompt hash, dpi, max_tokens and temperature, and OCR QC
  against the HTML on a 26-report pilot.
- Run logging (scripts/runlog.sh, logs/index.csv), the P0 runner and
  40 tests.
- Research plan, technical overview and progress page (in Vietnamese).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 12:45:34 +00:00
commit a3c175638f
172 changed files with 145856 additions and 0 deletions

15
configs/ocr-prompt.txt Normal file
View File

@@ -0,0 +1,15 @@
OCR this image to HTML, arranged as layout blocks. Each layout block must be a div with a data-bbox attribute in x0 y0 x1 y1 format. Bounding boxes are normalized to the 0-1000 range. The data-label attribute must contain exactly one of these labels:
- Title: the main title of the document
- Section Header: a heading that introduces a section
- Header: repeated or auxiliary content at the top of a page
- Footer: repeated or auxiliary content at the bottom of a page
- Paragraph: normal textual content that does not belong to another label
- Table: a table, preserving rows, columns, colspan, and rowspan in HTML
- Barcode: a one-dimensional barcode
- QR Code: a QR code
- Signature: a handwritten signature
- Stamp: an ink or digital stamp/seal
- Image: any other image, figure, photo, chart, or diagram
Preserve the natural reading order. Preserve all visible text accurately. Use HTML inside each block; tables must remain HTML tables. Use the simplest HTML structure that accurately represents the content. Return only the HTML layout blocks, without Markdown fences, explanations, JSON, or a surrounding html/body tag.

26
configs/ocr.yaml Normal file
View File

@@ -0,0 +1,26 @@
# Document parser: chandra served bare by vLLM behind an OpenAI-style /v1/chat/completions,
# one page image per request. Same request and post-processing as vopec-chatbot app/docs/ocr.py
# (DOCS_OCR_API=vllm, commit 25076e6, 2026-10-15). The prompt is a byte copy of
# vopec-chatbot app/docs/ocr-prompt.txt; its hash is checked before every run and is part of
# every cached page's key, so a changed prompt can never be mixed with pages read under the old one.
# The service URL is machine-local: set VOLVE_DIA_OCR_URL in .env (see .env.example).
model: chandra
prompt_file: configs/ocr-prompt.txt
prompt_sha256: de6580eeade3936f1cf1fc6435a9e59c7bc4f17246983fe1ac1a40efd38d30ff
# Near a fax scan's native ~204 dpi (vopec measurement); the Volve DDR PDFs are A4 renders.
dpi: 200
max_tokens: 12000
temperature: 0
# Pages in flight at once; vLLM batches them on the GPU. The service is shared with vopec-chatbot.
workers: 4
timeout_s: 600
# Transport errors and 5xx only; a page that still fails is recorded as failed and retried on the next run.
retries: 2
# Trailing-loop cut (vopec LOOP_CHARS / LOOP_MAX_UNIT / LOOP_CHECK_EVERY).
loop_chars: 3000
loop_max_unit: 200
loop_check_every: 500
# A page whose embedded images exceed this is a log plot: recorded skipped, never sent (vopec DOCS_OCR_MAX_PAGE_MB).
max_page_image_mb: 4
# Stop sending pages after this many failed in a row (the service is down); the next run resumes.
stop_after_failed: 8