lllin000_PaperForge/paperforge/worker
Research Assistant faa70545eb fix: resolve figure_id collisions via name mutation
When two figures share the same figure_id (e.g. supplementary
"Figure S.1" and main "Figure 1" both mapped to "figure_001"),
the second occurrence is renamed with an "s" prefix:
  figure_001 -> figure_s001, figure_ss001, etc.

This avoids file overwrite in ocr_objects.py and ensures both
body and supplementary figures appear at their correct positions
in the rendered fulltext.

Changes:
- _resolve_figure_id_collisions() in ocr_figures.py
- figure_id passthrough in ocr_figure_reader.py (reader + normalize)
- _reader_figure_embed_target prefers explicit figure_id
- 11 unit tests covering single/triple/multi collisions, mixed buckets,
  empty IDs, realistic body+supplementary layout
2026-06-26 18:36:04 +08:00
..
__init__.py feat(prune): core orphan paper cleanup module 2026-05-18 21:48:18 +08:00
_domain.py chore: commit session work before hotfix switch 2026-05-18 22:47:30 +08:00
_progress.py ocr rebuild: add --resume checkpoint, fix garbled progress bar, remove debug print 2026-06-26 17:31:52 +08:00
_retry.py docs(v1.4): commit planning artifacts, test files, and phase summaries for phases 13-19 2026-04-27 19:12:03 +08:00
_utils.py feat: ocr reading-order fixes, single-source fulltext, redo closed-loop, release notes & manual 2026-06-01 18:12:31 +08:00
asset_index.py test: lock OCR phase2 figure inventory contract 2026-06-05 00:08:30 +08:00
asset_state.py style: ruff format pass across paperforge/ 2026-05-09 22:31:08 +08:00
base_views.py feat: add ocr_time frontmatter field — tracks last OCR completion time, shown in 重做OCR view 2026-06-01 15:36:11 +08:00
deep_reading.py test: lock OCR phase2 figure inventory contract 2026-06-05 00:08:30 +08:00
discussion.py chore: commit session work before hotfix switch 2026-05-18 22:47:30 +08:00
ocr.py fix: converge figure ownership arbitration and add VFS8CBW2 dense-composite diagnostics 2026-06-23 02:42:22 +08:00
ocr_artifacts.py fix: close structural convergence gaps — primary-path frontmatter anchor, health spine alignment, unresolved figure clusters, artifact cache cleanup 2026-06-08 00:24:54 +08:00
ocr_attach.py test: add OCR real-paper regression tests and cleanup 2026-06-10 12:36:15 +08:00
ocr_blocks.py fix: normalize OCR heading newlines and fix single-word heading level 2026-06-25 16:14:32 +08:00
ocr_decisions.py test: add OCR real-paper regression tests and cleanup 2026-06-10 12:36:15 +08:00
ocr_document.py fix: harden early OCR frontmatter-side zone inference 2026-06-25 15:57:53 +08:00
ocr_emit.py docs: audit OCR production route and mark experimental modules 2026-06-08 12:13:07 +08:00
ocr_errors.py feat: classify OCR errors and degraded completions 2026-06-08 12:34:44 +08:00
ocr_evidence.py feat: add OCR evidence objects and paper-context summary 2026-06-05 12:15:51 +08:00
ocr_families.py fix: reject weak isolated layout clusters 2026-06-22 22:15:12 +08:00
ocr_figure_reader.py fix: resolve figure_id collisions via name mutation 2026-06-26 18:36:04 +08:00
ocr_figures.py fix: resolve figure_id collisions via name mutation 2026-06-26 18:36:04 +08:00
ocr_health.py fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
ocr_index.py fix: stabilize legacy OCR structure and metadata recovery 2026-06-05 13:34:43 +08:00
ocr_layout.py test: add OCR real-paper regression tests and cleanup 2026-06-10 12:36:15 +08:00
ocr_maintenance.py fix: maintenance tab timezone, rebuild timestamp, title tooltip; UI: Vercel-inspired polish across all tabs 2026-06-24 01:08:20 +08:00
ocr_math.py fix: add relational-operator spacing and Greek-letter preservation to math normalization 2026-06-06 17:19:33 +08:00
ocr_metadata.py fix: reuse rebuild metadata and object extraction work 2026-06-22 22:15:25 +08:00
ocr_objects.py fix: reuse shared PDF access during object extraction 2026-06-22 22:16:24 +08:00
ocr_orchestrator.py test: add OCR real-paper regression tests and cleanup 2026-06-10 12:36:15 +08:00
ocr_pdf_spans.py fix: reuse rebuild metadata and object extraction work 2026-06-22 22:15:25 +08:00
ocr_profiles.py feat: partition OCR families inside zones 2026-06-09 17:49:52 +08:00
ocr_rebuild.py ocr rebuild: add --resume checkpoint, fix garbled progress bar, remove debug print 2026-06-26 17:31:52 +08:00
ocr_reference_signals.py fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
ocr_render.py fix: resolve figure_id collisions via name mutation 2026-06-26 18:36:04 +08:00
ocr_roles.py fix: normalize OCR heading newlines and fix single-word heading level 2026-06-25 16:14:32 +08:00
ocr_scores.py fix: converge figure ownership arbitration and add VFS8CBW2 dense-composite diagnostics 2026-06-23 02:42:22 +08:00
ocr_signatures.py feat: extend PANEL_LABEL_PATTERN to match lowercase sub-panel labels (a)(b) 2026-06-17 19:25:47 +08:00
ocr_structural_gate.py fix: heading detection, backmatter, table consumed, footnote reorder, figure crop + audit fixtures 2026-06-22 01:28:55 +08:00
ocr_tables.py A1: caption consumed only when matched_asset exists 2026-06-25 22:24:57 +08:00
ocr_versions.py style: fix lint issues in legacy backfill code 2026-06-05 13:01:55 +08:00
paper_meta.py chore: commit session work before hotfix switch 2026-05-18 22:47:30 +08:00
paper_resolver.py chore: commit session work before hotfix switch 2026-05-18 22:47:30 +08:00
prune.py fix(sync): avoid prune crash when optional deps are missing 2026-05-31 20:55:17 +08:00
repair.py chore: commit session work before hotfix switch 2026-05-18 22:47:30 +08:00
status.py feat: classify OCR errors and degraded completions 2026-06-08 12:34:44 +08:00
sync.py feat: ocr reading-order fixes, single-source fulltext, redo closed-loop, release notes & manual 2026-06-01 18:12:31 +08:00
update.py chore: commit session work before hotfix switch 2026-05-18 22:47:30 +08:00
vector_db.py chore: commit session work before hotfix switch 2026-05-18 22:47:30 +08:00