mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 17:00:23 +00:00
- Add evidence_query class to build_query_plan() for intent='evidence' - Add ocr_evidence_available to enrich_query_plan_with_runtime() - Add OCR evidence enrichment in search.py and retrieve.py - Add routing contract tests (3 routing + 1 evidence hit) - All pre-existing tests pass
19 lines
540 B
Python
19 lines
540 B
Python
from __future__ import annotations
|
|
|
|
|
|
def test_retrieve_falls_back_to_ocr_evidence_when_vector_index_empty() -> None:
|
|
from paperforge.worker.ocr_evidence import build_evidence_hit
|
|
|
|
hit = build_evidence_hit(
|
|
paper_id="KEY001",
|
|
role="body_paragraph",
|
|
page=3,
|
|
block_id="p3_b12",
|
|
text="We applied 2 V/cm for 30 minutes.",
|
|
confidence=0.92,
|
|
verification="",
|
|
)
|
|
|
|
assert hit["source_type"] == "body_paragraph"
|
|
assert "V/cm" in hit["text"]
|
|
assert hit["confidence"] > 0.5
|