Archived
资料文件真产出来了;E04/I01 补到验收线,顺手填了几个「墙拦住却不给路」的坑
**资料文件全链**(用户:审核资料这一步要真产出 word/excel/md/html,前端能渲、点资料名能开)
接手时这一步一个文件都产不出来 —— S3 剧本白纸黑字写着「file_ref 本 MVP 阶段可留空」。
文件是台账那一行的投影,不另存一份:
· 声明 `file:{titleColumn,bodyColumn,formatColumn}`,它同时是授权面(没声明就点不开)
· 现造真字节 —— docx/xlsx 是自己打的 OOXML 包(zip-write:store+CRC32,零依赖)
· 读回来渲 —— 解的就是造出来那份字节,渲得出来才证明文件是真的
· 件上 `data-file-of` → 工作区二级界面(Word 纸面/Excel 网格/渲好的 md/沙箱 html)+ 下载原件
放行落地前把每一份冻进 `sys.task_asset_file`(迁移 0029):归档件点开的必须是签字那一刻
那一份,而资料落在主数据上、试跑单不落正式表 —— 不存这一份,收工后一个都点不开。
工作成果里「产出的资料」自成一摞。Markdown 富文本渲染顺带销账(仍零依赖)。
**Harness**
· 画面按「这一拍办完之后」在办的那一步挑 —— 从前拿拍首的局面决定拍尾的事:
收掉 S4、发出 S5 的卡,而屏上还摆着 S4 的只读件,人无处可填(墙要配路第四次现形)
· 验收「重做」真能退回重做,且打回后台账没动就不许再提交(软硬两段,不锁死单子)
· 立监听的授权面是清单声明;发卡的授权面是调人预算,不是计划项
· 读工具同参重调有兜底;空转写身后还有行动就不废串;finish 的 doneWhen 按写完后的草稿算
**界面**
· 翻件与翻页各归各位(从前二选一,多卡多页时页翻不动);没得翻写「—」不写 0/0
· 工作成果详情能翻份;表宽超出能横滑(E04/I01 抄版式时把 overflow-x 抄丢了)
· 查看面灰底滚过一屏变白 —— 两条独立的路都治了(沙箱内不同色 / 弹性子项不长个)
· 测试台「取不到」不再当成「还活着」
**活动**
E04 关系覆盖、I01 品牌内容各自补到验收线:判据全读基座数、判据指向的东西摆上卡面、
样例满载且名字 ≤14 字;提交前要裁的判据搬进说明书(模型会压拍,压过之后只有说明书还在)。
验收:e2e i01 4/4、e04 3/3 全部 released,资料在办中渲得出、放行后存了档点得开;
门禁 typecheck/lint/depcruise/1628 测全绿。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EEJX8Z7CHejvwmDQyPQuBX
This commit is contained in:
@@ -207,6 +207,85 @@ const landingRate: ToolHandler = async ({ input }) => {
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* E04 覆盖度重算 —— **纯工具**:决策链节点比对,同输入必同结论。
|
||||
*
|
||||
* 节点算「已覆盖」要同时满足三条:该节点上有联系人对应(`decisionNode` 匹配)、
|
||||
* 那个人标了 `keyPerson=true`、亲密度 `relationship>=3`。少一条都算空白 ——
|
||||
* 认得这个人不等于覆盖了这个人。权重按 BT 层级(bt-03 高层 > bt-02 技术 > bt-01 采购)。
|
||||
*
|
||||
* **一次可查一批**(`customers` 数组):同一批候选客户逐一临场调,每调一次就多截断
|
||||
* 一拍(工具调用后同拍其余动作作废)——一单 N 家候选就要 N 拍,批量传入只需一拍。
|
||||
* 契约演进只增不破坏:仍收单条 `{customerCode,decisionNodes,contacts}` 走 legacy 路径,
|
||||
* 批量给 `customers` 时优先。
|
||||
*/
|
||||
const BT_WEIGHT: Record<string, number> = { 'bt-01': 1, 'bt-02': 2, 'bt-03': 3 };
|
||||
|
||||
type DecisionNode = { node: string; btLevel: string; required: boolean };
|
||||
type CoverageContact = { contactCode: string; decisionNode: string; keyPerson: boolean; influence: string; relationship: number };
|
||||
type CustomerCoverageInput = { customerCode: string; decisionNodes: DecisionNode[]; contacts: CoverageContact[] };
|
||||
|
||||
const scoreOne = (customerCode: string, nodes: DecisionNode[], contacts: CoverageContact[]) => {
|
||||
const required = nodes.filter((n) => n.required === true);
|
||||
const coveredNodes: string[] = [];
|
||||
const gapNodes: string[] = [];
|
||||
let weightTotal = 0;
|
||||
let weightCovered = 0;
|
||||
for (const n of required) {
|
||||
const weight = BT_WEIGHT[n.btLevel] ?? 1;
|
||||
weightTotal += weight;
|
||||
const covered = contacts.some((c) => c.decisionNode === n.node && c.keyPerson === true && c.relationship >= 3);
|
||||
if (covered) {
|
||||
coveredNodes.push(n.node);
|
||||
weightCovered += weight;
|
||||
} else {
|
||||
gapNodes.push(n.node);
|
||||
}
|
||||
}
|
||||
const coverageScore = weightTotal === 0 ? 0 : Math.round((weightCovered / weightTotal) * 100);
|
||||
return { customerCode, coverageScore, coveredNodes, gapNodes };
|
||||
};
|
||||
|
||||
const recomputeScore: ToolHandler = async ({ input }) => {
|
||||
const batch = input['customers'];
|
||||
if (Array.isArray(batch)) {
|
||||
const results = (batch as CustomerCoverageInput[]).map((c) =>
|
||||
scoreOne(c.customerCode, Array.isArray(c.decisionNodes) ? c.decisionNodes : [], Array.isArray(c.contacts) ? c.contacts : []),
|
||||
);
|
||||
return { ok: true, output: { results } };
|
||||
}
|
||||
const nodes = Array.isArray(input['decisionNodes']) ? (input['decisionNodes'] as DecisionNode[]) : [];
|
||||
const contacts = Array.isArray(input['contacts']) ? (input['contacts'] as CoverageContact[]) : [];
|
||||
return { ok: true, output: scoreOne(String(input['customerCode'] ?? ''), nodes, contacts) };
|
||||
};
|
||||
|
||||
/**
|
||||
* E04 关键人排序 —— **纯工具**:影响力 × 亲密度缺口,批量算,不逐人临场拍。
|
||||
*
|
||||
* `relationshipGap = 5 - relationship`(亲密度越低缺口越大);
|
||||
* `rankScore = 影响力权重 × relationshipGap`;阈值 `>=9→high, >=4→medium, else→low`
|
||||
* (业务可调常量,不是这一单的临场判断)。
|
||||
*/
|
||||
const INFLUENCE_WEIGHT: Record<string, number> = { high: 3, medium: 2, low: 1 };
|
||||
|
||||
const rankKeyPersons: ToolHandler = async ({ input }) => {
|
||||
const contacts = Array.isArray(input['contacts'])
|
||||
? (input['contacts'] as Array<{ contactCode: string; influence: string; relationship: number }>)
|
||||
: [];
|
||||
const ranked = contacts
|
||||
.map((c) => {
|
||||
const weight = INFLUENCE_WEIGHT[c.influence] ?? 1;
|
||||
const relationshipGap = Math.max(0, 5 - Number(c.relationship ?? 0));
|
||||
const rankScore = weight * relationshipGap;
|
||||
const priority = rankScore >= 9 ? 'high' : rankScore >= 4 ? 'medium' : 'low';
|
||||
return { contactCode: c.contactCode, relationshipGap, rankScore, priority };
|
||||
})
|
||||
.sort((a, b) => b.rankScore - a.rankScore);
|
||||
const counts = { high: 0, medium: 0, low: 0 } as Record<string, number>;
|
||||
for (const r of ranked) counts[r.priority] = (counts[r.priority] ?? 0) + 1;
|
||||
return { ok: true, output: { ranked, counts } };
|
||||
};
|
||||
|
||||
/** 出站发送 —— 写类:过程中登记为动作意向,放行后由系统执行落地(OS 7.3) */
|
||||
const mailSend: ToolHandler = async ({ input, connection }) => {
|
||||
// 运行时只拿得到申报过的连接目标;真发信由 channel 的出站面承担
|
||||
@@ -272,4 +351,6 @@ export const FIRST_PARTY_TOOLS: ReadonlyArray<readonly [string, ToolHandler]> =
|
||||
['quote-archive.landing-rate', landingRate],
|
||||
['mail.send', mailSend],
|
||||
['slot.placeholder', slotPlaceholder],
|
||||
['crm-relationship-coverage.recompute-score', recomputeScore],
|
||||
['crm-relationship-coverage.rank-key-persons', rankKeyPersons],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user