Skip to content

P1: route engines by measured quality-per-dollar (benchmark fix, calibrated per-page-type ladders, uncapped escalation, gate calibration) #39

Description

@r-uben

Second tier of the 2026-06-09 quality diagnosis (docs/log/2026-06-09_quality-diagnosis.md). Design fixed by consilium panel (codex gpt-5.5 + gemini), 2026-06-09 — see docs/log/2026-06-10_p1-routing-design.md (added on the P1 branch).

Stage 1 — mechanical (no GT needed):

  • Benchmark scorer: coverage/alignment hard gate (missing/unaligned pages = failure, never 0.0 WER); split page_num=0 monolithic outputs via the contract splitter; fail loudly on markerless splits; persist NES (currently dropped on serialization).
  • Page-type tagging in the benchmark dataset: native_prose / native_table_or_equation / scanned_prose / scanned_table_or_equation / sparse_or_figure; macro-average by page type and paper.
  • Table-grid metric: structure + header alignment + cell edit similarity + numeric-cell EXACTNESS.
  • Agentic cap: delete the max_retries+1 coupling (route_page already treats max_attempts<=0 as whole-ladder); bounds = ladder exhaustion + max_cost_per_page + cost_budget; check budget BEFORE each paid call, skip paid rungs that don't fit.
  • Gate: finish_reason/done_reason truncation checks on every HTTP/Ollama path -> TRUNCATED, not success; context-aware min_word_count (sparse/figure/title pages: warning, not error -> no needless paid escalation).

Stage 2 — ground truth (needs human verification):

  • Hand-verified GT for table/equation pages of the 10-paper set (seed from native/premium VLM, human-check the numbers). Native text stays GT for born-digital prose only.

Stage 3 — calibration artifact + ladder unification:

  • socr benchmark calibrate --apply writes versioned calibration.lock.json (page-type ladders, metric summaries, benchmark hash, engine+model+backend identity, price assumptions). Shrinkage to global prior; specialize per page type only when stable under leave-one-paper-out. NO hardcoded pruning thresholds.
  • AUTO_ENGINE_ORDER, _LOCAL_ENGINE_ORDER, RepairRouter lists, provider_ladder() all delegate to the artifact (availability/key/budget-filtered at runtime, deterministic).
  • Provider identity = engine+model+backend (qwen3.5:cloud != local qwen3-vl).

Judge (TICKET-16) is a gate for authority expansion: deterministic fixes land first; the judge gains scanned/native-table coverage only after validation on a labeled set (FP/FN measured).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions