feat(shipping-notice): 新增发货通知自动上传功能与候选资格评估

- 在环境配置中新增 SHIPPING_NOTICE_AUTO_UPLOAD_ENABLED 选项,默认关闭,需显式开启以支持自动上传。
- 引入新的 pytest.ini 文件,增加测试标记以支持自动化测试。
- 删除不再使用的 seed_shipping_notice_agents.py 文件,简化代码库。
- 更新相关 API,增强发货通知与候选资格评估功能,支持多种筛选条件。
- 增强文档与代码注释,反映新的业务逻辑与功能要求。
This commit is contained in:
hugo committed 2026-08-02 19:26:35 +08:00
1 parent cef3d5b26a
commit 3a9fbac2fc
226 files changed
+25010 -2098

No files matched your search

@@ -3,8 +3,8 @@ tests/test_shipping_process_gate_contract.py
用途:锁定全门禁中断恢复 Phase 1/1.5 契约与依赖图完整性(编码、动作、失效范围、原因归属)。
依赖:process_gate_contract、process_gate_dependency。
逻辑:调用 assert_*_integrity;断言 19 个唯一门禁、原因码唯一 owning_gate、
字段阻断资格与 Excel 仅重生失效范围。
逻辑:调用 assert_*_integrity;断言 20 个唯一门禁(含 freight_upload_rpa)、
原因码唯一 owning_gate、字段阻断资格与 Excel 仅重生失效范围。
"""
from __future__ import annotations
@@ -31,16 +31,19 @@ def test_process_gate_contract_integrity():
"""
校验门禁契约无重复编码、序号连续且动作/状态闭环。
核心逻辑:直接调用契约自检;再断言恰好 19 个唯一 gate_code。
核心逻辑:直接调用契约自检;再断言恰好 20 个唯一 gate_code。
"""
# [STEP 1] 契约自检(重复码 / 序号 / 动作归属)
assert_process_gate_contract_integrity()
# [STEP 2] 冻结规模:19 门禁且集合与有序列表一致
assert len(PROCESS_GATE_DEFINITIONS) == 19
assert len(PROCESS_GATE_CODES) == 19
assert len(PROCESS_GATE_CODE_SET) == 19
# [STEP 2] 冻结规模:20 门禁(含 freight_upload_rpa)且集合与有序列表一致
assert len(PROCESS_GATE_DEFINITIONS) == 20
assert len(PROCESS_GATE_CODES) == 20
assert len(PROCESS_GATE_CODE_SET) == 20
assert set(PROCESS_GATE_CODES) == PROCESS_GATE_CODE_SET
assert 'freight_upload_rpa' in PROCESS_GATE_CODE_SET
assert owning_gate_for_reason('upload_rpa_pending') == 'freight_upload_rpa'
assert owning_gate_for_reason('manual_upload_pending') == 'manual_upload_handoff'
def test_inventory_source_routing_primary_retry_action():
@@ -93,5 +96,6 @@ def test_process_gate_dependency_integrity_and_excel_only_scope():
excel_only = compute_invalidated_gates('excel_regeneration_only')
assert 'inventory_matching' not in excel_only
assert 'artifact_generation' in excel_only
assert 'freight_upload_rpa' in excel_only
assert 'manual_upload_handoff' in excel_only
assert set(excel_only) == set(PROCESS_GATE_INVALIDATION_RULES['excel_regeneration_only'])