fix(shipping-notice): 跳过未选中页物理表避免空重建污染整单

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-09-08 19:33:55 +08:00
1 parent 76729df27c
commit c4a27324c8
2 files changed
+224 -3

No files matched your search

@@ -572,7 +572,8 @@ def _physical_table_targets_profile_region(
核心逻辑:同页页脚/签章等非目标 MinerU 表不得因重建失败阻断已成功目标表。
当前页已配置专属表区但全部没有 ``line_layouts``(仅表头壳)时明确跳过,
避免空重建产出 ``PARSE_STRATEGY_NO_VALID_ROW_RECONSTRUCTION`` 污染整单。
虚拟页、缺失 bbox 或页尺寸异常时仍 fail-open,避免表检测遗漏被错误跳过。
模板已有表区但本页未被运行时选中时,真实物理表同样跳过(虚拟页仍 fail-open)。
虚拟页、缺失 bbox、页尺寸异常或全无表区配置时仍 fail-open,避免表检测遗漏被错误跳过。
Args:
raw_table: 物理表身份、页码与 bbox。
@@ -609,7 +610,16 @@ def _physical_table_targets_profile_region(
and isinstance(region.get('region'), dict)
]
if not page_regions:
# 本页无模板表区配置:保守保留,供虚拟页/漏检回退。
# 模板已声明表区、但本页未被 select_runtime_region_ids 选中时,
# 真实 MinerU 表必须跳过:否则空重建会写入
# PARSE_STRATEGY_NO_VALID_ROW_RECONSTRUCTION 并 blocking 污染已成功目标页
# (FOX TW 仅 exact_page=2 时第 1 页表即属此类)。
# 虚拟页已在上方提前 return True;全无表区配置时仍 fail-open。
if any(
isinstance(region, dict) and str(region.get('region_id') or '')
for region in table_regions
):
return False
return True
# [STEP 2] 仅含 line_layouts 的明细区才是重建目标;纯表头壳直接跳过。
active_regions = [