Files
2026-07-13 19:57:46 +08:00

2.8 KiB
Raw Permalink Blame History

业务交接:确认件导出与保存后恢复

业务目标与触发

目标:对已存在 identifier 的订单执行 source export或在订单已经保存但确认件失败时只恢复导出不重新创建/保存。

触发:导出确认件、恢复确认件、导出 Xingyou/Liantai、JOB/备案、visitor-detail、保存后导出失败。母团不是客户订单不能直接导出客户确认件。

Skill 标准化

使用 skills/erp-coordinator 和 skills/erp-export-recovery。默认 exportTypes 是 xingyou-confirmLiantai、job-order、visitor-detail 必须明确请求。恢复任务必须有 exportOnly=true 和 neverResave=true缺 identifier 先澄清。

Task JSON

operation=export_confirmationtask 有 schemaVersion=erp-task-v1、identifier、exportTypes、recovery、attachments、originalText。不能带 create_order payloadroute=split_parent 的 confirmation export 在契约层阻断。

示例skills/erp-export-recovery/tests/fixtures/export-xingyou.json、export-job.json、export-parent-block.json。

脚本与工具

node scripts/validate_erp_task.js --task <task.json> --json
node scripts/run_export_recovery.js --task <task.json> --mode dry-run --json

脚本进入 operation handler、registry 和 source artifact 输出。PDF 不在本阶段自动转换;如用户明确要 PDF交给 erp-pdf-delivery。

结果

dry_run 表示已规划 source export、没有保存completed 报告已有 identifier 和 artifact 类型blocked/invalid_task 说明母团、类型、registry 或安全问题post_save_recovery_required 只走恢复execution_uncertain 先回查。

阻塞与恢复

没有 identifier、registry 无记录、母团导出、artifact 类型不支持、session 不可用或保存状态不确定都阻塞。source export 失败保留恢复入口;任何导出/PDF失败都不能重下单或重保存。

测试与证据

  • Skill quick_validateskills/erp-export-recovery。
  • 内容/行为测试tools/tests/erp_export_recovery_skill_content.test.js、erp_export_recovery_skill_behavior.test.js。
  • Xingyou/JOB fixture dry-run 通过split_parent fixture 在契约层拒绝。
  • 既有 operation handlers/export tests 和 source-only 证据是回归依据。

风险

重复保存、默认类型误选、母团错导出、PDF与source耦合、旧registry、内部路径泄露是主要风险。缓解existing identifier、explicit types、exportOnly/neverResave、source-first、脱敏回复。

负责人

Skill 规则负责人维护导出意图与澄清;脚本负责人维护 handler、registry、artifact 和 audit交付负责人维护文件交付。交接日期2026-07-12。

下一步

如需 visitor-detail 进入统一 dispatcher先单独设计 operation/handler/fixture如需 PDF 交付,按 diagnostics-pdf 文档单独运行,不扩大 create/update 范围。