Commit graph

13 commits

Author SHA1 Message Date
Research Assistant
224882f697 fix: govern local figure pairing and ownership fallbacks 2026-06-22 22:15:39 +08:00
Research Assistant
72109ce858 test: verify reader figures preserve grouped strict matches 2026-06-15 15:42:17 +08:00
Research Assistant
52b87c43ba test: complete OCR-v2 gate test coverage and harness integration 2026-06-13 17:21:29 +08:00
Research Assistant
e4d050c298 fix: close OCR v2 real-paper structural and object gaps 2026-06-12 17:24:57 +08:00
Research Assistant
8dfc0a0425 feat: close OCR object gate for reader outputs
When figure_caption_candidate blocks lack explicit marker_type or caption_text in the strict inventory, _normalize_bucket now falls back to the structured block's text and infers figure_number/marker_type from the text content. This ensures candidate captions propagate through the reader-figure pipeline to the renderer and health summary.
2026-06-12 17:03:25 +08:00
Research Assistant
679da738e9 fix(ocr): cross-page block_id collision in reader normalization causes wrong figure_number
_index_structured_blocks used block_id as dict key, but PaddleOCR assigns
the same block_id for blocks on different pages. When A8E7SRVS page 6
block_id=5 (Fig.5) overwrites page 5 block_id=5 (Fig.1), reader output
rendered Figure 5 with Fig.1 caption text.

Add _index_blocks_by_page_and_id using (page, block_id) tuples for
page-aware lookup in _normalize_bucket. Keep serialized block_index
clean (plain int|str keys) to preserve JSON compatibility.

Add regression test for cross-page block_id collision.
2026-06-11 21:48:59 +08:00
Research Assistant
41ebec7d89 fix: tighten OCR strict-figure safety and audit hygiene 2026-06-11 14:53:34 +08:00
Research Assistant
a0a6e7f42e feat: add strict OCR sequence match promotion 2026-06-10 20:48:57 +08:00
Research Assistant
c86700b6f2 feat: persist OCR reader figure artifacts and health metrics 2026-06-10 20:43:54 +08:00
Research Assistant
7ec1f66da7 feat: materialize OCR reader figures and hold semantics
- Rewrite _materialize_reader_figure() to handle all source types:
  matched_figures -> EXACT_MATCH, held/ambiguous with candidates ->
  GROUPED_APPROXIMATE, held/ambiguous without candidates -> LEGEND_ONLY,
  unmatched_legends -> LEGEND_ONLY, unresolved_clusters -> ASSET_GROUP_ONLY
- Add _materialize_hold_outcome() for reader_hold vs audit_hold semantics
- Add _candidate_asset_ids_from_item() for flat candidate_asset_ids lists
- GROUPED_APPROXIMATE now requires visual candidates (no candidates -> LEGEND_ONLY)
- legend_block_id no longer consumed by audit_hold, only reader_hold
- Coverage now tracks gap (total - accounted) correctly
- 8 reader figure tests, 280 total tests passing
2026-06-10 20:26:55 +08:00
Research Assistant
b2d76f7d39 feat: add OCR reader input gating and deduplicated coverage 2026-06-10 20:23:18 +08:00
Research Assistant
df95b946a7 feat: add OCR reader figure schema and stable ids
- _stable_reader_figure_id: deterministic ID generation for reader figures
  (figure_number-based or visual_group fallback with page+asset)
- synthesize_reader_figures: shell that normalizes inventory, materializes
  reader figures with separate reader_status (RESOLVED/GROUPED_APPROXIMATE/
  DEFERRED/CAPTION_ONLY/ORPHAN_ASSETS) and strict_status (preserved from
  source bucket)
- _materialize_reader_figure: maps normalized items to reader figure dicts
- ReaderCoverage dataclass extended with as_dict()
- Tests: status separation, stable ID generation, normalization round-trip
2026-06-10 20:19:16 +08:00
Research Assistant
68ee5f735a feat: normalize strict OCR figure inventory for reader synthesis 2026-06-10 20:16:21 +08:00