Commit graph

14 commits

Author SHA1 Message Date
LLLin000
3cda942f96 fix: appendix numbering cross-cutting bugs (TABLE regex, int block_id, table alpha prefix, weak-caption tie-break)
3 distinct bugs found and fixed:

1. TABLE in figure regex (_FIGURE_NUMBER_PATTERN)
   Removed TABLE/Table from figure regex — caused table captions to be
   extracted as figure numbers and roadmapped into figure inventory.
   Added unit tests (table_numeric_caption_is_not_a_figure_number,
   table_appendix_caption_marker_has_no_figure_number).

2. int block_id type mismatch in cross-page lookup
   CrossPageSettlementPass and PrimarySamePagePass compared block_id
   with === but deduped_legends use int keys while ResourceRef stores
   str.  Fixed by casting both to str.  Table continuation lookup
   missed page filter, picking wrong page's same block_id.  Added
   page filter + int_block_id tests.

3. Table appendix support gaps
   - Table prefix regex only accepted digits/roman, not 'TABLE A1'.
     Added [A-Z]\d+ token and strip-leading-alpha in parse.
   - _is_validation_first_table_candidate didn't cover figure_title
     raw_label blocks with table_caption_like style.  Added second
     gate.
   - _is_weak_explicit_table_caption only checked table_caption roles.
     Extended to include validation-first candidates.
   - Same-page tie-break didn't apply for weak-explicit captions.
     Ported _bare_table_tie_break into vnext pass.
   - figure_caption_candidate not excluded from note attachment.
   - Continuation merge stripped leading duplicate table marker.

M84CTEM9 vault verification: 6/6 figures matched (3 main + 3
appendix + assets), 4/4 tables (Table 1,2 + Table A1,A2 + assets),
0 false positives, 0 figure asset leakage.
2026-07-04 01:29:06 +08:00
LLLin000
2e542dabd0 fix(ocr): unblock pairing framework merge 2026-07-03 22:50:15 +08:00
LLLin000
a9e68ac9e0 feat(ocr): complete table vnext passes with notes, accounting, and diff tooling 2026-07-03 20:19:46 +08:00
LLLin000
1cc44b5f5a test(ocr): lock figure vnext extraction baseline 2026-07-03 19:38:19 +08:00
LLLin000
28827d1f64 fix(ocr): fix verdict false positives - 26->8 regression, add noise_cleanup/consolidated verdicts 2026-07-03 18:20:00 +08:00
LLLin000
17958f1c15 analysis(ocr): generate vnext cutover diff reports for full corpus 2026-07-03 17:12:39 +08:00
LLLin000
7bf4a6d7d4 feat(ocr): expand legacy-vnext comparison harness for cutover gates 2026-07-03 17:01:52 +08:00
LLLin000
6a332e6b49 test(ocr): add portable vnext real-paper comparison harness 2026-07-03 12:47:39 +08:00
LLLin000
f95925b226 refactor(ocr): split legacy and vnext figure entrypoints 2026-07-03 12:01:11 +08:00
LLLin000
8dba963394 fix: complete reference detection fixes — 5 problem families 2026-07-03 01:46:27 +08:00
Research Assistant
eac49edcf2 test: lock OCR readiness baseline and restore coverage ledger 2026-06-18 22:10:52 +08:00
Research Assistant
ab81677419 docs: update PROJECT-MANAGEMENT with rebuild script docs, review fixes, table ordering 2026-06-14 23:20:01 +08:00
Research Assistant
5fc9554c66 fix(ocr): protect figure/image blocks from backmatter normalization, fix duplicate title, and add unified rebuild entry point
- ocr_render.py: extend consumed frontmatter roles skip from page 1 to pages <= 2,
  preventing paper_title appearing twice on pre-proof papers
- ocr_document.py: add image/media block promotion in backmatter zone normalization
  so raw image blocks become media_asset instead of backmatter_body; this fixes
  build_figure_inventory producing 0 matched_figures. Also check seed_role in
  _sanitize_reference_zone_boundary since it runs before role resolution
- scripts/dev/ocr_rebuild_paper.py: single-paper rebuild + block_trace regeneration
  entry point (will be wired into CLI later)
- tests: boundary protection and completeness check tests
- DW trace regenerated with correct role distribution
2026-06-14 18:47:50 +08:00
Research Assistant
04c942c8db chore: remove root debug scripts, relocate rebuild_verify to scripts/dev 2026-06-08 12:15:17 +08:00