/** * 活动包清单 —— 统一报价 A7 · 情报归档。 * * 业务素材:docs/MVP示例工作流.html §1.7(S1 结果登记 → S2 画像更新 → S3 落地率统计)。 * 「不成交也留资产:情报、客户画像、落地率」—— 写的是**共享域**,跨活动的沉淀事实。 */ import type { ActivityManifest } from '@contracts'; import { ARCHIVE_SKILLS } from './skills.ts'; import { CMMN_XML, NARRATIVE } from './case-model.ts'; import { activityIdSchema } from '@contracts'; import { ARCHIVE_LOGGED, ARCHIVE_RELEASE } from './views/report.ts'; const ACTIVITY_ID = activityIdSchema.parse('quote-archive'); export const manifest: ActivityManifest = { identity: { activityId: ACTIVITY_ID, name: 'A7 · 情报归档', packageVersion: '0.1.5', category: '统一报价', sdkVersion: '0.1.0-m5', checksum: 'dev-checksum-quote-archive', }, contract: { activityId: ACTIVITY_ID, version: '0.1.0', input: { data: { type: 'object', required: ['customerCode', 'quoteNo'], properties: { /** 归档写 (pn, quoted_at) 这一行,两个主键都由调用方给定 */ pn: { type: 'string' }, quotedAt: { type: 'string' }, customerCode: { type: 'string' }, quoteNo: { type: 'string' }, reason: { type: 'string' }, competitorPrice: { type: 'number' }, }, }, messageAllowed: true, }, output: { mandatory: [ { name: 'archived', payload: { type: 'object', properties: { landingRate: { type: 'number' } } }, description: '归档闭环:情报回写 + 落地率落账', }, ], selective: [], }, requiredDeliverables: [ { key: 'history-archive', label: '历史价格情报(归档)' }, { key: 'landing-stats', label: '报价落地率统计' }, ], acceptanceCriteria: [ { key: 'reason-logged', label: '拒绝原因 / 竞对价位已回写', level: 'L1', predicate: 'reasonLogged = true' }, { key: 'profile-updated', label: '客户画像标签已更新', level: 'L2', predicate: 'profileUpdated = true' }, { key: 'bd-release', label: 'BD 放行', level: 'L5' }, ], prohibitions: [{ key: 'no-blank-archive', statement: '不得空归档 —— 每一单不成交的报价也是情报资产' }], authorization: { discretion: [], preauthorizedActions: [], humanCallBudget: 2 }, resources: { tools: [], skills: ARCHIVE_SKILLS.map((s) => s.id), models: ['quote-extractor'], roles: ['BD'], budget: { steps: 30, tokens: 60_000, activeMinutes: 60, humanCalls: 2 }, }, }, declarations: { models: ['quote-extractor'], tools: [], ledger: [ { // 共享域:跨活动的沉淀事实(AM 11.3 暗耦合禁令的两条合法路径之一) domain: 'shared', object: 'history_price', label: '历史价格情报', fields: [ { name: 'pn', type: 'text', primaryKey: true, masked: false }, { name: 'quoted_at', type: 'date', primaryKey: true, masked: false }, { name: 'lost_reason', type: 'text', primaryKey: false, masked: false, label: '拒绝原因' }, { name: 'competitor_price', type: 'number', primaryKey: false, masked: false, label: '竞对价位' }, ], }, { domain: 'shared', object: 'customer', label: '客户资料库', fields: [ { name: 'customer_code', type: 'text', primaryKey: true, masked: false, label: '客户码' }, { name: 'grade', type: 'text', primaryKey: false, masked: false, label: '客户等级' }, { name: 'profile_tags', type: 'text', primaryKey: false, masked: false, label: '画像标签' }, ], }, { domain: 'shared', object: 'landing_stats', label: '报价落地率统计', fields: [ { name: 'period', type: 'text', primaryKey: true, masked: false, label: '月份' }, { name: 'landing_rate', type: 'number', primaryKey: false, masked: false, label: '落地率' }, { name: 'type_a_hit', type: 'number', primaryKey: false, masked: false, label: 'TypeA命中' }, { name: 'reply_rate_d3', type: 'number', primaryKey: false, masked: false, label: 'D+3回复率' }, ], }, ], listeners: [], // 7 天闭环(MVP示例 §1.7) harness: { memoryWindow: 15, stallAfter: 'P1D', nudge: [], retry: { times: 2, backoff: 'PT30S' } }, }, assets: { /* 资产初始版:案例模型(2026-07-29 起活动只有这一种业务模型) */ businessModel: { cmmnXml: CMMN_XML, narrative: NARRATIVE, dmn: { drd: [], tables: [] }, }, skills: ARCHIVE_SKILLS, viewTemplates: [ { name: 'archive-logged', html: ARCHIVE_LOGGED }, { name: 'archive-release', html: ARCHIVE_RELEASE }, ], cardSchemas: {}, distillHooks: [ { on: 'terminal', prompt: '归纳丢单的共性:价格、交期、竞对、客户类型 —— 供下一单更快更准。' }, ], }, samples: [ { name: '客户拒绝', input: { customerCode: 'C001', quoteNo: 'Q202601', reason: '竞对报价更低' }, expect: { ports: ['archived'] }, }, ], entry: { file: 'index.js', checksum: 'dev-entry-quote-archive' }, };