资料文件真产出来了;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:
@@ -169,6 +169,84 @@ const PLACEHOLDER_TOOL = {
|
||||
connectionKeys: [] as string[],
|
||||
};
|
||||
|
||||
/**
|
||||
* E04 覆盖度重算 —— **纯工具**(活动私有作用域):决策链节点比对,同输入必同结论。
|
||||
* 出参键名与台账列同名(`coverage_score`),模型拿回结果直接 write,不必改名。
|
||||
*/
|
||||
const COVERAGE_SCORE_TOOL = {
|
||||
name: 'crm-relationship-coverage.recompute-score',
|
||||
displayName: '关系覆盖度重算',
|
||||
version: '1.1.0',
|
||||
description:
|
||||
'按决策链节点比对重算关系覆盖度:节点算已覆盖要同时满足有联系人对应/标了关键人/亲密度≥3。' +
|
||||
'出参给覆盖率与缺口节点列表,权重按 BT 层级(bt-03 高层 > bt-02 技术 > bt-01 采购)。' +
|
||||
'一次可查一批 —— 传 customers 数组,出参走 results(逐家客户各调一次会多截断一拍)。',
|
||||
input: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
customers: {
|
||||
type: 'array',
|
||||
description: '批量(优先):[{customerCode, decisionNodes:[{node,btLevel,required}], contacts:[{contactCode,decisionNode,keyPerson,influence,relationship}]}]',
|
||||
},
|
||||
customerCode: { type: 'string', description: '单条查询' },
|
||||
decisionNodes: { type: 'array', description: '单条:[{node, btLevel, required}]' },
|
||||
contacts: { type: 'array', description: '单条:[{contactCode, decisionNode, keyPerson, influence, relationship}]' },
|
||||
},
|
||||
},
|
||||
output: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
customerCode: { type: 'string' },
|
||||
coverageScore: { type: 'integer' },
|
||||
coveredNodes: { type: 'array' },
|
||||
gapNodes: { type: 'array' },
|
||||
results: { type: 'array', description: '批量查询的逐家结果:每项 {customerCode, coverageScore, coveredNodes, gapNodes}' },
|
||||
},
|
||||
},
|
||||
effect: 'read' as const,
|
||||
errors: [] as Array<{ code: string; retryable: boolean; message: string }>,
|
||||
idempotent: true,
|
||||
timeoutMs: 5_000,
|
||||
retries: 0,
|
||||
connectionKeys: [] as string[],
|
||||
pure: true,
|
||||
ownerActivityId: 'crm-relationship-coverage',
|
||||
};
|
||||
|
||||
/**
|
||||
* E04 关键人排序 —— **纯工具**(活动私有作用域):影响力 × 亲密度缺口,批量算。
|
||||
* 出参键名与台账列同名(`priority`/`relationship_gap`/`rank_score`),模型照抄即可。
|
||||
*/
|
||||
const RANK_KEY_PERSONS_TOOL = {
|
||||
name: 'crm-relationship-coverage.rank-key-persons',
|
||||
displayName: '关键人经营优先级排序',
|
||||
version: '1.0.0',
|
||||
description:
|
||||
'按影响力 × 亲密度缺口批量排序关键人 —— 传 contacts 数组,一次算完,不逐人临场拍。' +
|
||||
'出参给每人的亲密度缺口、排序分与优先级档(high/medium/low)。',
|
||||
input: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
contacts: { type: 'array', description: '[{contactCode, influence, relationship}]' },
|
||||
},
|
||||
},
|
||||
output: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
ranked: { type: 'array', description: '[{contactCode, relationshipGap, rankScore, priority}],已按 rankScore 降序' },
|
||||
counts: { type: 'object' },
|
||||
},
|
||||
},
|
||||
effect: 'read' as const,
|
||||
errors: [] as Array<{ code: string; retryable: boolean; message: string }>,
|
||||
idempotent: true,
|
||||
timeoutMs: 5_000,
|
||||
retries: 0,
|
||||
connectionKeys: [] as string[],
|
||||
pure: true,
|
||||
ownerActivityId: 'crm-relationship-coverage',
|
||||
};
|
||||
|
||||
/** 白名单:逐槽位授权 —— 谁能调什么,治理台说了算,活动代码里看不到这张表 */
|
||||
const ALLOWLIST: Readonly<Record<string, readonly string[]>> = {
|
||||
// A1 已是真活动:白名单里摘掉占位工具 —— 它一在,模型就会拿它糊弄过去
|
||||
@@ -211,7 +289,7 @@ export async function seedMvp(container: Container): Promise<void> {
|
||||
log(`① LLM 实例已绑定:deepseek-v4-flash · deepseek-v4-pro${apiKey === undefined ? '(环境无密钥 —— 两条都是未绑定,去治理台补)' : ''}`);
|
||||
|
||||
/* ② 功能工具注册两审 + 逐槽位白名单 */
|
||||
for (const contract of [HISTORY_TOOL, MAIL_TOOL, CLASSIFY_TOOL, PLACEHOLDER_TOOL]) {
|
||||
for (const contract of [HISTORY_TOOL, MAIL_TOOL, CLASSIFY_TOOL, PLACEHOLDER_TOOL, COVERAGE_SCORE_TOOL, RANK_KEY_PERSONS_TOOL]) {
|
||||
const verdict = await container.toolbox.register({
|
||||
contract,
|
||||
samples: [
|
||||
@@ -238,7 +316,7 @@ export async function seedMvp(container: Container): Promise<void> {
|
||||
for (const [activityId, tools] of Object.entries(ALLOWLIST)) {
|
||||
await container.toolbox.setAllowlist(activityId, tools);
|
||||
}
|
||||
log('② 功能工具已注册并入白名单(读类 1 · 写类 1 · 纯工具 2,逐活动授权)');
|
||||
log('② 功能工具已注册并入白名单(读类 1 · 写类 1 · 纯工具 4,逐活动授权)');
|
||||
|
||||
/*
|
||||
* ③ 活动装入 —— 两批:
|
||||
|
||||
Reference in New Issue
Block a user