lllin000_PaperForge/audit
LLLin000 e0260a8188 feat: recover 'Figure N' heading prefix from PDF text layer for OCR-missed captions
When PaddleOCR fails to detect a standalone 'Figure N' / 'FIGURE N'
heading (rendered in a bold/small-caps font that the OCR engine doesn't
read), the caption body is captured as figure_caption_candidate but
lacks the figure number prefix. The new _recover_figure_heading_prefix()
function checks the PDF text layer (via existing page_pdf_lines_by_page
infrastructure — no extra PDF open) and prepends the heading.

Key logic:
- Scans PDF text lines on the same page for 'Figure N' headings
- Confirms by checking if the NEXT PDF line (by y-order) shares ≥15
  chars of common prefix with the OCR caption candidate text
- Only runs when _extract_figure_number() returns None (no figure
  number in existing caption text)
- Integrated into build_figure_inventory() before _is_formal_legend()
  check, so recovered captions enter the legend matching pool

Fixes 'FIGURE 1' loss in 5S7UI34M and 'FIGURE 5' loss in HQAQBSBP.
372 figure tests pass.
2026-07-03 01:46:40 +08:00
..
2AGGSMVQ fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
2BYRLKQS fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
2E4EPHN2 fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
2GN9LMCW fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
2H8MZ27H fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
2HEUD5P9 fix: support Roman numeral and S-prefix table captions across roles/signatures/tables 2026-07-02 00:47:18 +08:00
2UIPV93M fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
2WUSQXGL fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
2YW2MJBL fix: support Roman numeral and S-prefix table captions across roles/signatures/tables 2026-07-02 00:47:18 +08:00
3CEUN7T3 fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
3CIQWBGA fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
3FDT9652 fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
3IL2JIHZ fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
3MPHY9LD fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
3QYCST4E fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
4AG67PBH audit: vision audit of 2HEUD5P9 + 4AG67PBH (4 oracle agents) 2026-06-28 23:40:08 +08:00
4AGGTJE9 fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
4CG7FRN7 fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
4DU8LEH2 fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
4FY3VQJS fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
4KCHGV2Z fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
4M3K4W7C fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
4M64NZEC fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
5DIEAVPW fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
6DIINFHX fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
6FGDBFQN fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
6QNRHRKX fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
7C8829BD fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
7FNV9AW2 fix: support Roman numeral and S-prefix table captions across roles/signatures/tables 2026-07-02 00:47:18 +08:00
7S5ZEVSK fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
8K39NHUQ fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
8VB9ZVQG docs: reconcile project truth files after blind audit 2026-06-19 15:52:12 +08:00
9EQV3ABQ fix: support Roman numeral and S-prefix table captions across roles/signatures/tables 2026-07-02 00:47:18 +08:00
23T2B8ZX fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
24A2QUAH fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
24YKLTHQ fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
27MSS3VH fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
28ALPCY7 fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
37LK5T97 fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
49NUE2G7 fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
53B47JM8 fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
62LTMCI8 fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
72D4YXEB fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
82W2IJIP fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
95FDVE4W fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
A6IC2SIK fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
A8E7SRVS fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
A35UYJBK fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
B43QSAJP fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
CAQNW9Q2 fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
CGGYTEEQ fix: support Roman numeral and S-prefix table captions across roles/signatures/tables 2026-07-02 00:47:18 +08:00
DAB9VMWW fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
DWQQK2YB fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
GTRPMM56 fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
GU9R8EPE docs: reconcile project truth files after blind audit 2026-06-19 15:52:12 +08:00
K7R8PEKW fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
KIX7SKXQ fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
KNEBDHHT fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
KUR9PBJC fix: support Roman numeral and S-prefix table captions across roles/signatures/tables 2026-07-02 00:47:18 +08:00
KZP6FB4Y fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
L6ALWJFP docs: reconcile project truth files after blind audit 2026-06-19 15:52:12 +08:00
LGGZ9SKS fix: support Roman numeral and S-prefix table captions across roles/signatures/tables 2026-07-02 00:47:18 +08:00
media_asset_samples feat: recover 'Figure N' heading prefix from PDF text layer for OCR-missed captions 2026-07-03 01:46:40 +08:00
N6XCZD25 fix: support Roman numeral and S-prefix table captions across roles/signatures/tables 2026-07-02 00:47:18 +08:00
PZ8B59K4 fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
RKSLQRIM fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
SAN9AYVR fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
TFI9P8KG docs: reconcile project truth files after blind audit 2026-06-19 15:52:12 +08:00
tmp_pdf feat: recover 'Figure N' heading prefix from PDF text layer for OCR-missed captions 2026-07-03 01:46:40 +08:00
TSCKAVIS fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
U746UJ7G fix: support Roman numeral and S-prefix table captions across roles/signatures/tables 2026-07-02 00:47:18 +08:00
V4UTP5X7 fix: support Roman numeral and S-prefix table captions across roles/signatures/tables 2026-07-02 00:47:18 +08:00
VFS8CBW2 fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
YGH7VEX6 fix: support Roman numeral and S-prefix table captions across roles/signatures/tables 2026-07-02 00:47:18 +08:00
YQIC2RDL fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
28ALPCY7_findings.md feat: recover 'Figure N' heading prefix from PDF text layer for OCR-missed captions 2026-07-03 01:46:40 +08:00
2026-06-28-data-audit-findings.json audit: vision audit of 2HEUD5P9 + 4AG67PBH (4 oracle agents) 2026-06-28 23:40:08 +08:00
coverage_ledger.json docs: update REVIEW and coverage ledger 2026-06-19 15:20:15 +08:00
deep-dive-report.md fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
investigation-findings.md fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
media_asset_vision_report.md feat: recover 'Figure N' heading prefix from PDF text layer for OCR-missed captions 2026-07-03 01:46:40 +08:00
reference-zone-audit.json fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
zone-role-batch-audit-report.md fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00