判据 ⑦:审批点两条走向跑通 + 修草稿基线按字段捕获

审批点(AP 定价审批)卡到 PM 丁子乔工位,依据快照齐、驳回走向按声明呈现。
  · 驳回必附意见:空意见被拒 ✓
  · 驳回 → **回 A4 重开新实例**(A4 #2),旧实例不复活 —— 已裁定 ①④ 的落地 ✓

沿路两处修:

① 审批点的 `reject.mapping` 是空的 —— 重开的是**新的 A4 实例**,它照样要过 A4 的
   入参契约,空映射等于把「驳回回 A4」写成一句空话(实测:重开必失败)。按 G2J→A4
   同样的口径补齐。

② 草稿基线只在**建行那一刻**捕获一次:后续步新写的字段没有基线,冲突检查把它们
   一律当成「他单改过」。于是重开的实例分步写同一行,放行时必被自己的前一版挡下
   (实测 A4#2:「4 处字段已被他单改动」= margin/quoted_price/deviation/disposition)。
   改为**按字段首次写入时捕获**(jsonb 右操作数胜:已有基线不动,新字段补上)。
   加了真实 PG 的回归测试。

gates: tsc / eslint / depcruise / 398 测试 全绿

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
This commit is contained in:
2026-07-27 05:23:28 +08:00
co-authored by Claude Opus 5
parent c17ccaf049
commit 227764b7da
4 changed files with 80 additions and 1 deletions
+14 -1
View File
@@ -217,7 +217,20 @@ export async function seedQuote(container: Container): Promise<void> {
kind: 'approval',
label: 'AP 定价审批',
approver: { position: 'PM', strategy: 'sole' },
reject: { kind: 'reopen', nodeId: 'A4', mapping: [] },
// 驳回走向的载荷映射不能空:重开的是**新的 A4 实例**,它照样要过 A4 的入参契约。
// 空映射 = 重开必失败,等于把「驳回回 A4」写成了一句空话。
reject: {
kind: 'reopen',
nodeId: 'A4',
mapping: [
{ target: 'customerCode', source: { from: 'initiation', path: 'customerCode' } },
{ target: 'records', source: { from: 'output-port', port: 'intake', path: 'records' } },
{ target: 'pn', source: { from: 'output-port', port: 'intake', path: 'pn' } },
{ target: 'materialType', source: { from: 'output-port', port: 'intake', path: 'type_tag' } },
{ target: 'customerGrade', source: { from: 'constant', value: '普通客户' } },
{ target: 'volumeTier', source: { from: 'constant', value: '大批量' } },
],
},
nudge: { deadline: 'PT30M', steps: [{ after: 'PT20M', action: 'nudge' }] },
layout: { row: 0, col: 6 },
},