feat(freight-rpa): 批次R解耦编排层并切换 onhand/inbound 契约

将 RPA 编排收编至 freight_rpa,回调迁 /api/freight-rpa/*。
共享目录与 Worker 契约一次切换至 onhand/inbound/upload,
并补 outbound 骨架与 tt16 排程 job key 迁移。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-10-17 23:18:48 +08:00
1 parent bf3154033b
commit ffc0d4a430
147 files changed
+4221 -2678

No files matched your search

+6 -6
View File
@@ -63,17 +63,17 @@ def test_archive_rejects_bad_outcome_and_unclaimed_path(tmp_path):
def test_inventory_worker_scans_with_claim(tmp_path):
"""库存 Worker 扫描必须先领取(processing/),不得原地消费根目录文件。"""
root = Path(__file__).resolve().parents[2] / "scripts" / "freight_rpa" / "inventory"
text = (root / "inventory_rpa_worker.py").read_text(encoding="utf-8")
"""onhand Worker 扫描必须先领取(processing/),不得原地消费根目录文件。"""
root = Path(__file__).resolve().parents[2] / "scripts" / "freight_rpa" / "onhand"
text = (root / "onhand_rpa_worker.py").read_text(encoding="utf-8")
assert "claim_trigger" in text
# 三处 handler 的 failed 目录推导必须基于 processed_dir(根目录),不得再用 trigger_path.parent
assert text.count('trigger_path.parent / "failed"') == 0
def test_receipt_worker_runs_periodic_disk_cleanup():
"""收料 Worker 必须周期执行保留清理(对齐库存),孤儿 receipt_* Profile 必须纳入清理。"""
receipt = (Path(__file__).resolve().parents[2] / "scripts" / "freight_rpa" / "receipt" / "receipt_rpa_worker.py").read_text(encoding="utf-8")
"""inbound Worker 必须周期执行保留清理(对齐 onhand),孤儿 inbound_* Profile 必须纳入清理。"""
receipt = (Path(__file__).resolve().parents[2] / "scripts" / "freight_rpa" / "inbound" / "inbound_rpa_worker.py").read_text(encoding="utf-8")
assert "run_worker_disk_cleanup" in receipt and "cleanup_interval_seconds" in receipt
cleanup = (Path(__file__).resolve().parents[2] / "scripts" / "freight_rpa" / "common" / "worker_disk_cleanup.py").read_text(encoding="utf-8")
assert '"receipt_"' in cleanup or "'receipt_'" in cleanup
assert '"inbound_"' in cleanup or "'inbound_'" in cleanup