判据 ⑥ 跑通:A4 成本定价全链 —— 补齐取价基准这一环

A4 卡在 S3 底价自检要 `deviation`,而 S1「取价基准」调的是历史价工具,
那个工具**根本不回价格**:声明说出 deviation,工具给不出,于是永远缺一环。

按业务本意补齐:
  · `crm.history-price-read` 增回 `lastPrice`(上次成交单价)—— 一个不回价的
    「历史价工具」取不出价格基准;无历史的新料号回 0,由下游按「无基准」处置,
    不凭空编一个偏离率。
  · 新增纯工具 `quote-pricing.basis`:基准价 ↔ 拟报价 → 偏离率。
    偏离率要等 S2 定出拟报价才算得出来,所以落在 S2 之后(新步 S2B)。
  · A4 声明:S1 改落 `last_price`,新增 S2B,台账加 `last_price` 列。

顺带修:样例集一份喂所有工具,`quote-pricing.basis` 的必填 `quotedPrice` 不在其中,
新工具过不了两审 → 活动包安装被拒 → 旧资产继续生效,现象是「改了没反应」。
样例改为各家必填的并集。

现在 A4 跑完整条:取价基准 → DMN 定价(利润模型 P-01)→ 算偏离率 →
DMN 底价自检(底价门禁 P-02,处置=直接放行)→ 条件跳步 → 报价草案验收放行。

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

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:14:01 +08:00
co-authored by Claude Opus 5
parent 9201f6b094
commit c17ccaf049
7 changed files with 105 additions and 10 deletions
+15 -4
View File
@@ -59,7 +59,7 @@ export const manifest: ActivityManifest = {
identity: {
activityId: ACTIVITY_ID,
name: 'A4 · 成本定价',
packageVersion: '0.1.1',
packageVersion: '0.1.2',
category: '统一报价',
paradigm: 'flow',
sdkVersion: '0.1.0-m5',
@@ -113,7 +113,7 @@ export const manifest: ActivityManifest = {
humanCallBudget: 2,
},
resources: {
tools: [{ name: 'crm.history-price-read' }],
tools: [{ name: 'quote-pricing.basis' }, { name: 'crm.history-price-read' }],
skills: [],
models: ['quote-extractor'],
roles: ['BD'],
@@ -123,7 +123,7 @@ export const manifest: ActivityManifest = {
declarations: {
models: ['quote-extractor'],
tools: [{ name: 'crm.history-price-read' }],
tools: [{ name: 'crm.history-price-read' }, { name: 'quote-pricing.basis' }],
ledger: [
{
domain: DOMAIN,
@@ -133,6 +133,7 @@ export const manifest: ActivityManifest = {
{ name: 'pn', type: 'text', primaryKey: true, masked: false, label: 'PN' },
{ name: 'quoted_price', type: 'number', primaryKey: false, masked: false, label: '拟报单价' },
{ name: 'margin', type: 'number', primaryKey: false, masked: false, label: '毛利率' },
{ name: 'last_price', type: 'number', primaryKey: false, masked: false, label: '基准价' },
{ name: 'deviation', type: 'number', primaryKey: false, masked: false, label: '偏离度' },
{ name: 'disposition', type: 'text', primaryKey: false, masked: false, label: '门禁处置' },
],
@@ -167,7 +168,8 @@ export const manifest: ActivityManifest = {
label: 'S1 取价基准',
// Type A 取历史价近期价;B/C 取供应商底价表(C 类参考替代对标表)
input: { pn: 'pn' },
output: { domain: DOMAIN, object: 'draft', key: { pn: 'pn' }, fields: { deviation: 'deviation' } },
// 取回来的是**基准价**;偏离率要等 S2 定出拟报价才算得出来(见 S2B)
output: { domain: DOMAIN, object: 'draft', key: { pn: 'pn' }, fields: { last_price: 'lastPrice' } },
tool: 'crm.history-price-read',
failure: { retry: { times: 2, backoff: 'PT1M' }, fallback: { kind: 'human', workOrder: 'execution' } },
},
@@ -185,6 +187,15 @@ export const manifest: ActivityManifest = {
tool: 'quote-pricing.margin',
failure: { retry: { times: 1, backoff: 'PT10S' }, fallback: { kind: 'blocked' } },
},
{
kind: 'pure-tool',
name: 'S2B_deviation',
label: 'S2B 算偏离率(基准价 ↔ 拟报价)',
input: { lastPrice: 'last_price', quotedPrice: 'quoted_price' },
output: { domain: DOMAIN, object: 'draft', key: { pn: 'pn' }, fields: { deviation: 'deviation' } },
tool: 'quote-pricing.basis',
failure: { retry: { times: 1, backoff: 'PT10S' }, fallback: { kind: 'blocked' } },
},
{
kind: 'pure-tool',
name: 'S3_floor_gate',