把原来 1-2 步的简单动作(pickSpace+search+shot)扩成完整的多步操作串: 新增动作类型(拟人化操作增强): - waitIdle 等待表格加载(networkidle + 自定义时长) - resetQuery 点「重置」清空查询条件 - refresh 点「刷新」按钮重拉列表 - clickRow 点表格第 N 行看详情 - openEdit 打开某行编辑抽屉 - cancelDrawer 关闭抽屉 - expectRow / expectNoRow 断言行存在/不存在(业务关键字) - switchTab 切 Tab - nextPage 翻到下一页 - openColumnSetting 点齿轮看列设置 - hoverRow 悬停行(先看看) - readFirstRow 读首行内容 - readRowCount 读列表行数 节点动作设计模式(每节点 6-14 步): 1. 列表节点:pickSpace → waitIdle → refresh → readRowCount → search → expectRow → hoverRow → shot 2. 创建节点:pickSpace → refresh → openCreate → fillForm → save → toast → cancelDrawer → search → expectRow → shot 3. 审核节点:pickSpace → selectFilter(按状态筛) → search → expectRow → hoverRow → shot 4. 详情节点:pickSpace → waitIdle → refresh → readRowCount → search → shot 总步数: - seq-1 风控:21 节点 · 174 步 · 平均 8.3 步/节点 - seq-2 三方:22 节点 · 160 步 · 平均 7.3 步/节点 - seq-3 机构:7 节点 · 71 步 · 平均 10.1 步/节点 - seq-4 TEE:9 节点 · 63 步 · 平均 7.0 步/节点 - seq-5 三模式:12 节点 · 73 步 · 平均 6.1 步/节点 合计 71 节点 · 541 真实步骤(v7 是 71 节点 · 平均 1-2 步) 实测 seq-3 完整跑通:224.3s 完成 7 节点 × 71 步
1085 lines
55 KiB
JavaScript
1085 lines
55 KiB
JavaScript
/**
|
||
* 5 张业务时序图 → DAG 数据模型(带数据流可视化 metadata)
|
||
*
|
||
* 依据 docs/sequence_diagrams.md 把时序图拍平成节点-边图:
|
||
* participants : 泳道(每个参与者占一列)
|
||
* stages : 阶段(在背景上分色块)
|
||
* nodes : 节点(每个时序图步骤一个;带泳道、阶段、图标、数据预览、对应用例)
|
||
* edges : 边(节点之间的箭头;按时序图自上而下;带数据标签 + 类型)
|
||
*
|
||
* 节点对应的真实用例来自 docs/e2e/cases/ 下已存在的脚本(meta.tc 一致即可关联);
|
||
* 这里不绑死用例文件存在与否——节点缺脚本时前端会显示「无脚本」徽标,不影响 DAG 渲染。
|
||
*
|
||
* 数据流 metadata 约定:
|
||
* node.icon - 节点左侧小图标(emoji 或 svg glyph)
|
||
* node.data - { name:'订单', preview:'订单#20260808-001\n¥1,200 · 待付款' }
|
||
* edge.label - 边上显示的数据标签(例:订单、合约哈希、密文、凭证)
|
||
* edge.kind - 边的数据种类 → 决定标签色与流光
|
||
* request | contract | cipher | voucher | notify | response | callback
|
||
*/
|
||
|
||
const SWIMLANES = {
|
||
user: { label: '数据使用方', color: '#58a6ff', bg: '#0d2944' },
|
||
ops: { label: '平台运营方', color: '#a371f7', bg: '#23193d' },
|
||
provider: { label: '数据提供方', color: '#3fb950', bg: '#0f2b18' },
|
||
server: { label: '数据服务方', color: '#d29922', bg: '#2b230c' },
|
||
regulator: { label: '监管方', color: '#f78166', bg: '#3b1d12' },
|
||
tee: { label: 'TEE 硬件', color: '#ff7b72', bg: '#3b1216' },
|
||
psi: { label: '集中式 PSI', color: '#79c0ff', bg: '#0d2944' },
|
||
fl: { label: '联邦学习', color: '#7ee787', bg: '#0f2b18' },
|
||
mpc: { label: '多方安全计算', color: '#ffa657', bg: '#2b230c' }
|
||
}
|
||
|
||
/** 边种类 → 颜色(用于标签/流光) */
|
||
const EDGE_KINDS = {
|
||
request: { label: 'request', color: '#58a6ff', glow: 'rgba(88,166,255,.45)', text: '#9cc8ff' },
|
||
contract: { label: 'contract', color: '#a371f7', glow: 'rgba(163,113,247,.45)', text: '#c8b0ff' },
|
||
cipher: { label: 'cipher', color: '#7ee787', glow: 'rgba(126,231,135,.45)', text: '#b6f0bc' },
|
||
voucher: { label: 'voucher', color: '#d29922', glow: 'rgba(210,153,34,.45)', text: '#f0c878' },
|
||
notify: { label: 'notify', color: '#9aa7b4', glow: 'rgba(154,167,180,.35)', text: '#cfd6df' },
|
||
response: { label: 'response', color: '#3fb950', glow: 'rgba(63,185,80,.45)', text: '#7ed084' },
|
||
callback: { label: 'callback', color: '#f78166', glow: 'rgba(247,129,102,.45)', text: '#ffb098' }
|
||
}
|
||
|
||
// ───────── 图1:沙盒交付(两方/标准) ─────────
|
||
const seq1 = {
|
||
id: 'seq-1',
|
||
no: 1,
|
||
title: '沙盒交付(两方/标准)',
|
||
subtitle: '数据使用方 ↔ 数据提供方,端到端 5 阶段',
|
||
participants: ['user', 'ops', 'provider', 'server', 'regulator'],
|
||
stages: [
|
||
{ id: 's1-1', name: '阶段1:需求与撮合', color: 'rgba(88,166,255,.07)' },
|
||
{ id: 's1-2', name: '阶段2:合约签订', color: 'rgba(163,113,247,.07)' },
|
||
{ id: 's1-3', name: '阶段3:算法开发与调试', color: 'rgba(210,153,34,.07)' },
|
||
{ id: 's1-4', name: '阶段4:交付与执行', color: 'rgba(63,185,80,.07)' },
|
||
{ id: 's1-5', name: '阶段5:结算与审计', color: 'rgba(247,129,102,.07)' }
|
||
],
|
||
nodes: [
|
||
{ id: 'n1-1', lane: 'user', stage: 's1-1', icon: '📝', label: '提交数据需求', sub: '门户·资源目录', data: { name: '需求单', preview: '客群画像 · 25-35岁\n精度:城市级 · 周期:30天' } , route: '/tds/market' , mode: 'create', apiKey: 'demand_create',
|
||
actions: [
|
||
{ type: 'pickSpace', desc: '顶部选「金融风控空间」' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh', desc: '刷新看现有需求' },
|
||
{ type: 'readRowCount', desc: '看看当前有几家提交过' },
|
||
{ type: 'openCreate', desc: '点「新建」开抽屉' },
|
||
{ type: 'fillForm', fields: { '需求编号': (ctx) => `DM-RISK-${ctx.runId}-AUTO`, '需求标题': '信贷违约预测建模任务', '需求类型': 'API', '用途说明': '银行风控建模 · 模型上链', '数据范围': '城市级 · 周期30天' }, desc: '填需求表单' },
|
||
{ type: 'save', desc: '点保存提交' },
|
||
{ type: 'toast', expect: '新增成功', desc: '等提示' },
|
||
{ type: 'cancelDrawer', desc: '关掉抽屉看列表' },
|
||
{ type: 'waitIdle', ms: 500 },
|
||
{ type: 'search', keyword: (ctx) => `DM-RISK-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DM-RISK-${ctx.runId}`, desc: '断言刚提交的需求已在列表' },
|
||
{ type: 'hoverRow', text: (ctx) => `DM-RISK-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '需求已在列表里' }
|
||
]
|
||
},
|
||
{ id: 'n1-2', lane: 'ops', stage: 's1-1', icon: '🤝', label: '交易撮合', sub: '人工 + AI 助手' , route: '/tds/orders',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'readRowCount', desc: '看看撮合池多大' },
|
||
{ type: 'search', keyword: (ctx) => `DM-RISK-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DM-RISK-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DM-RISK-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '我看到的需求单已入撮合池' }
|
||
]
|
||
},
|
||
{ id: 'n1-3', lane: 'ops', stage: 's1-1', icon: '📤', label: '推送匹配订单', sub: '→ 提供方' , route: '/tds/orders',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'selectFilter', label: '订单状态', option: '待匹配' },
|
||
{ type: 'waitIdle', ms: 500 },
|
||
{ type: 'search', keyword: (ctx) => `DM-RISK-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DM-RISK-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DM-RISK-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '待匹配池里的本次需求' }
|
||
]
|
||
},
|
||
{ id: 'n1-4', lane: 'provider', stage: 's1-1', icon: '✅', label: '确认接单' , route: '/tds/orders' , mode: 'status', apiKey: 'demand_accept',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DM-RISK-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DM-RISK-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DM-RISK-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '我(提供方)接到的需求' }
|
||
]
|
||
},
|
||
{ id: 'n1-5', lane: 'server', stage: 's1-1', icon: '⚙️', label: '挂出算法服务', sub: '真实业务算法' , route: '/tds/products' , mode: 'create', apiKey: 'algorithm_publish',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'selectFilter', label: '产品类型', option: '算法' },
|
||
{ type: 'waitIdle', ms: 500 },
|
||
{ type: 'readRowCount', desc: '看算法池有多少' },
|
||
{ type: 'openCreate', desc: '点新建挂算法' },
|
||
{ type: 'fillForm', fields: { '产品名称': 'XGBoost 风控评分模型 v2.1', '产品类型': '算法', '敏感级别': '一般', '算法语言': 'python3.11', '运行参数': 'n_estimators=800 max_depth=6 lr=0.05' }, desc: '填算法产品' },
|
||
{ type: 'save' },
|
||
{ type: 'toast', expect: '新增成功' },
|
||
{ type: 'cancelDrawer' },
|
||
{ type: 'search', keyword: (ctx) => `ALG-${ctx.runId}` },
|
||
{ type: 'expectRow', text: 'XGBoost 风控评分模型' },
|
||
{ type: 'shot', seq: 10, desc: '刚挂出的算法' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n1-6', lane: 'user', stage: 's1-2', icon: '🖋️', label: '使用方订单签约', case: 'TC-CONTRACT-007', data: { name: '签约', preview: '数字签名 ed25519\n指纹 a3f9…c12d' } , route: '/tds/contracts',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'selectFilter', label: '合约状态', option: '待我方签署' },
|
||
{ type: 'waitIdle', ms: 500 },
|
||
{ type: 'search', keyword: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '我(使用方)要签的合约' }
|
||
]
|
||
},
|
||
{ id: 'n1-7', lane: 'provider', stage: 's1-2', icon: '🖋️', label: '提供方订单签约' , route: '/tds/contracts',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'selectFilter', label: '合约状态', option: '待对方签署' },
|
||
{ type: 'waitIdle', ms: 500 },
|
||
{ type: 'search', keyword: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '提供方要签的合约' }
|
||
]
|
||
},
|
||
{ id: 'n1-8', lane: 'ops', stage: 's1-2', icon: '📜', label: '生成合作协议 & 数字合约' , route: '/tds/contracts' , mode: 'create', apiKey: 'contract_create',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'readRowCount', desc: '看合约池多大' },
|
||
{ type: 'openCreate', desc: '点新建开抽屉' },
|
||
{ type: 'fillForm', fields: { '合约编号': (ctx) => `CON-${ctx.runId}-AUTO`, '合约名称': '信贷违约预测服务合约', '交付类型': 'API', '计费模式': '按调用' }, desc: '填合约表单' },
|
||
{ type: 'save' },
|
||
{ type: 'toast', expect: '新增成功' },
|
||
{ type: 'cancelDrawer' },
|
||
{ type: 'waitIdle', ms: 500 },
|
||
{ type: 'search', keyword: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '生成的数字合约在列表' }
|
||
]
|
||
},
|
||
{ id: 'n1-9', lane: 'regulator',stage: 's1-2', icon: '⛓️', label: '上链 / 存证', case: 'TC-CONTRACT_API-006', data: { name: '合约哈希', preview: 'sha256:7f3a…b91e\nFISCO-BCOS group0' } , route: '/tds/chain' , mode: 'status', apiKey: 'contract_sign',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: '区块链存证列表(本次签约记录)' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n1-10', lane: 'server', stage: 's1-3', icon: '💻', label: '交付算法代码', sub: '上传到沙盒', route: '/tdc/hosting-job' , mode: 'status', apiKey: 'sample_upload',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '算法代码交付任务' }
|
||
]
|
||
},
|
||
{ id: 'n1-11', lane: 'provider', stage: 's1-3', icon: '🧪', label: '提供样例数据', sub: '信贷样本 12万条', route: '/tdc/datasources',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: '信贷样本' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'hoverRow', text: '信贷样本' },
|
||
{ type: 'shot', seq: 10, desc: '我能提供的数据资源(含信贷样本)' }
|
||
]
|
||
},
|
||
{ id: 'n1-12', lane: 'user', stage: 's1-3', icon: '🛠️', label: '沙盒开发调试', case: 'TC-HOSTING-001', data: { name: '调试日志', preview: 'shap≈0.42 · AUC=0.87\n耗时 12s · 8/12 步骤' } , route: '/tdc/sandbox' , mode: 'create', apiKey: 'sandbox_create',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '刚建好的沙盒托管任务' }
|
||
]
|
||
},
|
||
{ id: 'n1-13', lane: 'ops', stage: 's1-3', icon: '🔍', label: '算法审核' , route: '/tdc/hosting-job' , mode: 'status', apiKey: 'sandbox_audit',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'selectFilter', label: '审核状态', option: '待审核' },
|
||
{ type: 'waitIdle', ms: 500 },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '审核前的算法' }
|
||
]
|
||
},
|
||
{ id: 'n1-14', lane: 'user', stage: 's1-3', icon: '👍', label: '审核通过' , route: '/tdc/hosting-job',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '算法已通过审核' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n1-15', lane: 'provider', stage: 's1-4', icon: '🔐', label: '灌入数据到沙盒' , route: '/tdc/hosting-job' , mode: 'status', apiKey: 'sample_upload',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '样例数据已灌入沙盒' }
|
||
]
|
||
},
|
||
{ id: 'n1-16', lane: 'user', stage: 's1-4', icon: '🚀', label: '安全沙盒交付执行', case: 'TC-DELIVERY-001', data: { name: '交付结果', preview: 'AES-256-GCM · 1.2MB\nsha256:c12f…dd09' } , route: '/tdc/delivery' , mode: 'execute', apiKey: 'sandbox_calculate',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '沙盒执行前的任务' }
|
||
]
|
||
},
|
||
{ id: 'n1-17', lane: 'user', stage: 's1-4', icon: '📊', label: '提取计算结果', sub: '真实业务指标', route: '/tdc/delivery' , mode: 'query', apiKey: 'sandbox_extract',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '提取的真实业务结果(AUC/KS/求交数等)' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n1-18', lane: 'user', stage: 's1-5', icon: '💰', label: '订单支付(线下)' , route: '/tds/billing',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '我的待付账单' }
|
||
]
|
||
},
|
||
{ id: 'n1-19', lane: 'ops', stage: 's1-5', icon: '🧾', label: '生成结算凭证' , route: '/tds/billing' , mode: 'create', apiKey: 'settlement_create',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: '结算中心 — 待生成凭证' }
|
||
]
|
||
},
|
||
{ id: 'n1-20', lane: 'regulator',stage: 's1-5', icon: '📤', label: '提交交易凭证' , route: '/tds/evidence',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'search', keyword: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '已提交给监管方的交易凭证' }
|
||
]
|
||
},
|
||
{ id: 'n1-21', lane: 'regulator',stage: 's1-5', icon: '🛡️', label: '审计核验', case: 'TC-EVIDENCE-001', data: { name: '审计结果', preview: '✔ 链上存证匹配\n✔ 调用频次合规' } , route: '/tds/audit' , mode: 'query', apiKey: 'auditlog_search',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '本次合约的审计记录' }
|
||
]
|
||
},
|
||
],
|
||
edges: [
|
||
{ from: 'n1-1', to: 'n1-2', label: '需求单', kind: 'request' },
|
||
{ from: 'n1-2', to: 'n1-3', label: '匹配订单', kind: 'request' },
|
||
{ from: 'n1-3', to: 'n1-4', label: '订单推送', kind: 'request' },
|
||
{ from: 'n1-4', to: 'n1-2', label: '确认回执', kind: 'callback' },
|
||
{ from: 'n1-5', to: 'n1-2', label: '算法挂出', kind: 'notify' },
|
||
{ from: 'n1-2', to: 'n1-6', label: '订单', kind: 'request' },
|
||
{ from: 'n1-2', to: 'n1-7', label: '订单', kind: 'request' },
|
||
{ from: 'n1-6', to: 'n1-8', label: '签名', kind: 'contract' },
|
||
{ from: 'n1-7', to: 'n1-8', label: '签名', kind: 'contract' },
|
||
{ from: 'n1-8', to: 'n1-9', label: '合约哈希', kind: 'contract' },
|
||
{ from: 'n1-9', to: 'n1-10', label: '存证回执', kind: 'callback' },
|
||
{ from: 'n1-10', to: 'n1-11', label: '代码', kind: 'request' },
|
||
{ from: 'n1-11', to: 'n1-12', label: '样例数据', kind: 'cipher' },
|
||
{ from: 'n1-12', to: 'n1-13', label: '算法', kind: 'request' },
|
||
{ from: 'n1-13', to: 'n1-14', label: '审核结果', kind: 'response' },
|
||
{ from: 'n1-14', to: 'n1-15', label: '投产通知', kind: 'notify' },
|
||
{ from: 'n1-15', to: 'n1-16', label: '密态灌入', kind: 'cipher' },
|
||
{ from: 'n1-16', to: 'n1-17', label: '交付结果', kind: 'cipher' },
|
||
{ from: 'n1-17', to: 'n1-18', label: '结算请求', kind: 'request' },
|
||
{ from: 'n1-18', to: 'n1-19', label: '支付回执', kind: 'voucher' },
|
||
{ from: 'n1-19', to: 'n1-20', label: '结算凭证', kind: 'voucher' },
|
||
{ from: 'n1-20', to: 'n1-21', label: '凭证', kind: 'voucher' }
|
||
]
|
||
}
|
||
|
||
// ───────── 图2:沙盒交付(三方) ─────────
|
||
const seq2 = {
|
||
id: 'seq-2',
|
||
no: 2,
|
||
title: '沙盒交付(三方)',
|
||
subtitle: '服务方多一节签约 + 算法开发',
|
||
participants: ['user', 'ops', 'provider', 'server', 'regulator'],
|
||
stages: [
|
||
{ id: 's2-1', name: '阶段1:发现与撮合', color: 'rgba(88,166,255,.07)' },
|
||
{ id: 's2-2', name: '阶段2:合约签订', color: 'rgba(163,113,247,.07)' },
|
||
{ id: 's2-3', name: '阶段3:算法开发与调试', color: 'rgba(210,153,34,.07)' },
|
||
{ id: 's2-4', name: '阶段4:正式交付与执行', color: 'rgba(63,185,80,.07)' },
|
||
{ id: 's2-5', name: '阶段5:结算与审计', color: 'rgba(247,129,102,.07)' }
|
||
],
|
||
nodes: [
|
||
{ id: 'n2-1', lane: 'user', stage: 's2-1', icon: '📝', label: '数据需求 / 资源目录下单', case: 'TC-TRADE-003', data: { name: '需求', preview: '三方联合建模\n画像×风控×消费' } , route: '/tds/market' , mode: 'create', apiKey: 'demand_create',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'openCreate' },
|
||
{ type: 'fillForm', fields: { '需求编号': (ctx) => `DM-PSI-${ctx.runId}`, '需求标题': '黑名单跨机构求交', '需求类型': 'PSI', '数据范围': '全国 · 450万黑名单' } },
|
||
{ type: 'save' },
|
||
{ type: 'toast', expect: '新增成功' },
|
||
{ type: 'cancelDrawer' },
|
||
{ type: 'search', keyword: (ctx) => `DM-PSI-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DM-PSI-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DM-PSI-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '三方求交需求已入池' }
|
||
]
|
||
},
|
||
{ id: 'n2-2', lane: 'ops', stage: 's2-1', icon: '🤝', label: '交易撮合' , route: '/tds/orders',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DM-PSI-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DM-PSI-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DM-PSI-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '三方撮合池里的需求' }
|
||
]
|
||
},
|
||
{ id: 'n2-3', lane: 'ops', stage: 's2-1', icon: '🧐', label: '订单审核' , route: '/tds/orders',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'selectFilter', label: '订单状态', option: '待审核' },
|
||
{ type: 'waitIdle', ms: 500 },
|
||
{ type: 'search', keyword: (ctx) => `DM-PSI-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DM-PSI-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '运营方审核中的三方订单' }
|
||
]
|
||
},
|
||
{ id: 'n2-4', lane: 'provider', stage: 's2-1', icon: '📦', label: '提供数据资源' , route: '/tds/products',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'selectFilter', label: '产品类型', option: '数据' },
|
||
{ type: 'waitIdle', ms: 500 },
|
||
{ type: 'search', keyword: '黑名单' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: '我能提供的数据资源' }
|
||
]
|
||
},
|
||
{ id: 'n2-5', lane: 'server', stage: 's2-1', icon: '⚙️', label: '提供算法服务' , route: '/tds/products',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'selectFilter', label: '产品类型', option: '算法' },
|
||
{ type: 'waitIdle', ms: 500 },
|
||
{ type: 'search', keyword: 'OPRF' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: '我能提供的 PSI 算法' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n2-6', lane: 'user', stage: 's2-2', icon: '🖋️', label: '使用方签约' , route: '/tds/contracts',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '使用方要签的合约' }
|
||
]
|
||
},
|
||
{ id: 'n2-7', lane: 'provider', stage: 's2-2', icon: '🖋️', label: '提供方签约' , route: '/tds/contracts',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '提供方要签的合约' }
|
||
]
|
||
},
|
||
{ id: 'n2-8', lane: 'server', stage: 's2-2', icon: '🖋️', label: '服务方签约' , route: '/tds/contracts',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '服务方要签的合约' }
|
||
]
|
||
},
|
||
{ id: 'n2-9', lane: 'ops', stage: 's2-2', icon: '📜', label: '生成合作协议 & 数字合约' , route: '/tds/contracts' , mode: 'create', apiKey: 'contract_create',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'openCreate' },
|
||
{ type: 'fillForm', fields: { '合约编号': (ctx) => `CON-${ctx.runId}`, '合约名称': '三方黑名单 OPRF 求交合约', '交付类型': 'PSI', '计费模式': '按次数' } },
|
||
{ type: 'save' },
|
||
{ type: 'toast', expect: '新增成功' },
|
||
{ type: 'cancelDrawer' },
|
||
{ type: 'search', keyword: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '三方合约已生成' }
|
||
]
|
||
},
|
||
{ id: 'n2-10', lane: 'regulator',stage: 's2-2', icon: '⛓️', label: '上链 / 存证', data: { name: '合约哈希', preview: '三方合约 0xa3…91f\nFISCO-BCOS group0' } , route: '/tds/chain' , mode: 'status', apiKey: 'contract_sign',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: '三方合约上链' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n2-11', lane: 'provider', stage: 's2-3', icon: '🧪', label: '提供样例数据' , route: '/tdc/datasources' ,
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: '黑名单' },
|
||
{ type: 'expectRow', text: '黑名单' },
|
||
{ type: 'hoverRow', text: '黑名单' },
|
||
{ type: 'shot', seq: 10, desc: '提供方样例数据' }
|
||
]
|
||
},
|
||
{ id: 'n2-12', lane: 'server', stage: 's2-3', icon: '💻', label: '编写算法代码', case: 'TC-HOSTING-001', data: { name: '算法', preview: 'XGBoost · lr=0.05\n树深 6 · 迭代 200' } , route: '/tds/dev-center' , mode: 'create', apiKey: 'sandbox_create',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '服务方刚写的三方算法' }
|
||
]
|
||
},
|
||
{ id: 'n2-13', lane: 'server', stage: 's2-3', icon: '📤', label: '提交算法审核' , route: '/tds/dev-center',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '算法提交审核' }
|
||
]
|
||
},
|
||
{ id: 'n2-14', lane: 'ops', stage: 's2-3', icon: '🔍', label: '算法审核' , route: '/tds/dev-center' , mode: 'status', apiKey: 'sandbox_audit',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'selectFilter', label: '审核状态', option: '待审核' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '运营方审核中' }
|
||
]
|
||
},
|
||
{ id: 'n2-15', lane: 'server', stage: 's2-3', icon: '👍', label: '审核通过' , route: '/tds/dev-center',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '三方算法已通过' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n2-16', lane: 'provider', stage: 's2-4', icon: '🔐', label: '灌入数据到沙盒' , route: '/tdc/hosting-job' ,
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '三方数据已灌入沙盒' }
|
||
]
|
||
},
|
||
{ id: 'n2-17', lane: 'user', stage: 's2-4', icon: '🚀', label: '安全沙盒交付执行', case: 'TC-DELIVERY-001', data: { name: '三方联合', preview: 'MPC·SPDZ 协议\n128MB 中间碎片' } , route: '/tdc/delivery' , mode: 'execute', apiKey: 'sandbox_deliver',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '三方 SPDZ 计算进行中' }
|
||
]
|
||
},
|
||
{ id: 'n2-18', lane: 'user', stage: 's2-4', icon: '📨', label: '回传交付凭证' , route: '/tdc/delivery',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '交付凭证已生成' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n2-19', lane: 'user', stage: 's2-5', icon: '💰', label: '订单付款(线下)' , route: '/tds/billing',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '我的三方账单' }
|
||
]
|
||
},
|
||
{ id: 'n2-20', lane: 'ops', stage: 's2-5', icon: '🧾', label: '生成结算凭证' , route: '/tds/billing' , mode: 'create', apiKey: 'settlement_create',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DT-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '三方结算凭证' }
|
||
]
|
||
},
|
||
{ id: 'n2-21', lane: 'regulator',stage: 's2-5', icon: '📤', label: '提交交易凭证' , route: '/tds/evidence',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '三方交易凭证提交' }
|
||
]
|
||
},
|
||
{ id: 'n2-22', lane: 'regulator',stage: 's2-5', icon: '🛡️', label: '审计核验', case: 'TC-EVIDENCE-001', data: { name: '审计', preview: '三方交付均留痕\n✔ 数据不跨境' } , route: '/tds/audit' , mode: 'query', apiKey: 'auditlog_search',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CON-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '三方审计记录' }
|
||
]
|
||
},
|
||
],
|
||
edges: [
|
||
{ from: 'n2-1', to: 'n2-2', label: '需求', kind: 'request' },
|
||
{ from: 'n2-2', to: 'n2-3', label: '订单', kind: 'request' },
|
||
{ from: 'n2-3', to: 'n2-4', label: '撮合', kind: 'request' },
|
||
{ from: 'n2-3', to: 'n2-5', label: '撮合', kind: 'request' },
|
||
{ from: 'n2-4', to: 'n2-6', label: '资源', kind: 'request' },
|
||
{ from: 'n2-5', to: 'n2-6', label: '服务', kind: 'request' },
|
||
{ from: 'n2-5', to: 'n2-7', label: '服务', kind: 'request' },
|
||
{ from: 'n2-5', to: 'n2-8', label: '服务', kind: 'request' },
|
||
{ from: 'n2-6', to: 'n2-9', label: '签名', kind: 'contract' },
|
||
{ from: 'n2-7', to: 'n2-9', label: '签名', kind: 'contract' },
|
||
{ from: 'n2-8', to: 'n2-9', label: '签名', kind: 'contract' },
|
||
{ from: 'n2-9', to: 'n2-10', label: '合约哈希', kind: 'contract' },
|
||
{ from: 'n2-10', to: 'n2-11', label: '存证', kind: 'callback' },
|
||
{ from: 'n2-11', to: 'n2-12', label: '样例数据', kind: 'cipher' },
|
||
{ from: 'n2-12', to: 'n2-13', label: '算法', kind: 'request' },
|
||
{ from: 'n2-13', to: 'n2-14', label: '审核请求', kind: 'request' },
|
||
{ from: 'n2-14', to: 'n2-15', label: '审核结果', kind: 'response' },
|
||
{ from: 'n2-15', to: 'n2-16', label: '投产', kind: 'notify' },
|
||
{ from: 'n2-16', to: 'n2-17', label: '密态灌入', kind: 'cipher' },
|
||
{ from: 'n2-17', to: 'n2-18', label: '交付结果', kind: 'cipher' },
|
||
{ from: 'n2-18', to: 'n2-19', label: '结算', kind: 'request' },
|
||
{ from: 'n2-19', to: 'n2-20', label: '支付回执', kind: 'voucher' },
|
||
{ from: 'n2-20', to: 'n2-21', label: '结算凭证', kind: 'voucher' },
|
||
{ from: 'n2-21', to: 'n2-22', label: '凭证', kind: 'voucher' }
|
||
]
|
||
}
|
||
|
||
// ───────── 图3:机构会员注册与资源发布 ─────────
|
||
const seq3 = {
|
||
id: 'seq-3',
|
||
no: 3,
|
||
title: '机构会员注册与资源发布',
|
||
subtitle: '机构入驻 → 资源上架 → 浏览购买',
|
||
participants: ['user', 'ops', 'provider', 'server'],
|
||
stages: [
|
||
{ id: 's3-1', name: '机构会员注册', color: 'rgba(88,166,255,.07)' },
|
||
{ id: 's3-2', name: '数据资源发布', color: 'rgba(63,185,80,.07)' },
|
||
{ id: 's3-3', name: '数据资源购买', color: 'rgba(163,113,247,.07)' },
|
||
{ id: 's3-4', name: '算法产品发布', color: 'rgba(210,153,34,.07)' }
|
||
],
|
||
nodes: [
|
||
{ id: 'n3-1', lane: 'user', stage: 's3-1', icon: '🏢', label: '注册机构会员、发布数据需求', case: 'TC-IDENTITY-004', data: { name: '机构注册', preview: '营业执照 OCR 通过\n法人:张三 · 信用:A级' } , route: '/tds/market' , mode: 'create', apiKey: 'connector_register',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'openCreate' },
|
||
{ type: 'fillForm', fields: { '连接器编号': (ctx) => `CONN-${ctx.runId}`, '连接器名称': '华夏银行风控部·信贷违约预测连接器', '服务地址': (ctx) => `https://e2e.${ctx.scenario||'risk'}.connector.local:8443`, '机构名称': '华夏银行风控部' } },
|
||
{ type: 'save' },
|
||
{ type: 'toast', expect: '新增成功' },
|
||
{ type: 'cancelDrawer' },
|
||
{ type: 'search', keyword: (ctx) => `CONN-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CONN-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `CONN-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '刚注册好的连接器(带真实机构名)' }
|
||
]
|
||
},
|
||
{ id: 'n3-2', lane: 'provider', stage: 's3-1', icon: '🏢', label: '注册机构会员、申请入驻' , route: '/tdc/members' ,
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'readRowCount', desc: '看会员中心现有机构数' },
|
||
{ type: 'search', keyword: '华夏银行' },
|
||
{ type: 'expectRow', text: '华夏银行' },
|
||
{ type: 'hoverRow', text: '华夏银行' },
|
||
{ type: 'shot', seq: 10, desc: '会员中心里我刚申请的入驻' }
|
||
]
|
||
},
|
||
{ id: 'n3-3', lane: 'server', stage: 's3-1', icon: '🏢', label: '注册机构会员、发布算法产品' , route: '/tdc/members',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'search', keyword: '算法' },
|
||
{ type: 'shot', seq: 10, desc: '会员中心里服务方机构' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n3-4', lane: 'provider', stage: 's3-2', icon: '📦', label: '提交数据资源、上架目录', case: 'TC-CATALOG-001', data: { name: '资源目录', preview: '「一线消费力指数」\n样本 120万 · 30 字段' } , route: '/tdc/datasources' , mode: 'create', apiKey: 'product_create',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'openCreate' },
|
||
{ type: 'fillForm', fields: { '产品编号': (ctx) => `DATA-${ctx.runId}`, '产品名称': '一线消费力指数(120万 · 30字段)', '产品类型': '数据', '敏感级别': '一般', '价格': 600 } },
|
||
{ type: 'save' },
|
||
{ type: 'toast', expect: '新增成功' },
|
||
{ type: 'cancelDrawer' },
|
||
{ type: 'search', keyword: (ctx) => `DATA-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `DATA-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `DATA-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '刚上架的数据资源(含真实业务数据集名)' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n3-5', lane: 'user', stage: 's3-3', icon: '🛒', label: '浏览资源目录、下单购买' , route: '/tds/catalog' ,
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: '消费力' },
|
||
{ type: 'readRowCount', desc: '看目录里有多少公开数据集' },
|
||
{ type: 'hoverRow', text: '消费力' },
|
||
{ type: 'shot', seq: 10, desc: '浏览公共数据目录(可见本次上架的数据集)' }
|
||
]
|
||
},
|
||
{ id: 'n3-6', lane: 'user', stage: 's3-3', icon: '🔌', label: '连接器注册', case: 'TC-CONNECTOR-001', data: { name: '连接器', preview: '[email protected]\nSNP 已签发 · v3.2' } , route: '/tds/connectors' , mode: 'create', apiKey: 'connector_register',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'openCreate' },
|
||
{ type: 'fillForm', fields: { '连接器编号': (ctx) => `CONN-${ctx.runId}-USER`, '连接器名称': '使用方·信贷违约预测连接器', '服务地址': (ctx) => `https://e2e.user.connector.local:8444`, '机构名称': '平安银行联合建模组' } },
|
||
{ type: 'save' },
|
||
{ type: 'toast', expect: '新增成功' },
|
||
{ type: 'cancelDrawer' },
|
||
{ type: 'search', keyword: (ctx) => `CONN-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `CONN-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `CONN-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '我(使用方)注册的连接器' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n3-7', lane: 'server', stage: 's3-4', icon: '🛠️', label: '发布算法 / 服务产品' , route: '/tds/products' , mode: 'create', apiKey: 'algorithm_publish',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'selectFilter', label: '产品类型', option: '算法' },
|
||
{ type: 'waitIdle', ms: 500 },
|
||
{ type: 'openCreate' },
|
||
{ type: 'fillForm', fields: { '产品编号': (ctx) => `ALG-${ctx.runId}`, '产品名称': 'FedAvg 安全聚合 v3.0', '产品类型': '算法', '敏感级别': '敏感', '价格': 1200 } },
|
||
{ type: 'save' },
|
||
{ type: 'toast', expect: '新增成功' },
|
||
{ type: 'cancelDrawer' },
|
||
{ type: 'search', keyword: (ctx) => `ALG-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `ALG-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `ALG-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '刚发布的算法(含真实业务算法名 FedAvg v3.0)' }
|
||
]
|
||
},
|
||
],
|
||
edges: [
|
||
{ from: 'n3-1', to: 'n3-4', label: '需求', kind: 'request' },
|
||
{ from: 'n3-2', to: 'n3-4', label: '入驻申请', kind: 'request' },
|
||
{ from: 'n3-4', to: 'n3-5', label: '资源目录', kind: 'notify' },
|
||
{ from: 'n3-5', to: 'n3-6', label: '购买订单', kind: 'request' },
|
||
{ from: 'n3-3', to: 'n3-7', label: '机构认证', kind: 'notify' }
|
||
]
|
||
}
|
||
|
||
// ───────── 图4:隐私计算沙盒执行链路(TEE) ─────────
|
||
const seq4 = {
|
||
id: 'seq-4',
|
||
no: 4,
|
||
title: '隐私计算沙盒执行链路',
|
||
subtitle: 'TEE 硬件:用后即焚,仅结果出域',
|
||
participants: ['ops', 'tee', 'provider', 'user', 'server'],
|
||
stages: [
|
||
{ id: 's4-1', name: '触发:合约达成 → 创建沙盒', color: 'rgba(163,113,247,.07)' },
|
||
{ id: 's4-2', name: '数据灌入(加密通道)', color: 'rgba(255,123,114,.07)' },
|
||
{ id: 's4-3', name: '内存加工(按算法)', color: 'rgba(210,153,34,.07)' },
|
||
{ id: 's4-4', name: '结果出域', color: 'rgba(63,185,80,.07)' },
|
||
{ id: 's4-5', name: '用后即焚 → 凭证回传', color: 'rgba(247,129,102,.07)' }
|
||
],
|
||
nodes: [
|
||
{ id: 'n4-1', lane: 'ops', stage: 's4-1', icon: '📜', label: '合约签 → 创建安全沙盒', data: { name: '沙盒元数据', preview: 'policy:deny-all\ntflavor:kata-qemu-snp' } , route: '/tdc/sandbox' , mode: 'create', apiKey: 'sandbox_create',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'openCreate' },
|
||
{ type: 'fillForm', fields: { '沙盒编号': (ctx) => `TEE-${ctx.runId}`, '沙盒名称': 'TEE 机密沙盒', '策略': 'deny-all', '硬件': 'kata-qemu-snp' } },
|
||
{ type: 'save' },
|
||
{ type: 'toast', expect: '新增成功' },
|
||
{ type: 'cancelDrawer' },
|
||
{ type: 'search', keyword: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '新建的 TEE 机密沙盒' }
|
||
]
|
||
},
|
||
{ id: 'n4-2', lane: 'ops', stage: 's4-1', icon: '📣', label: '通知数据导入', case: 'TC-HOSTING-001' , route: '/tdc/hosting-job',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'search', keyword: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '已通知数据导入' }
|
||
]
|
||
},
|
||
{ id: 'n4-3', lane: 'provider', stage: 's4-2', icon: '🔐', label: '密态传输数据', data: { name: '加密数据', preview: 'AES-256-GCM\n12 MB · nonce 8e3…' } , route: '/tdc/hosting-job' , mode: 'status', apiKey: 'sandbox_upload',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '密态传输进行中' }
|
||
]
|
||
},
|
||
{ id: 'n4-4', lane: 'tee', stage: 's4-2', icon: '🛡️', label: '接收加密数据' , route: '/tdc/sandbox',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: 'TEE 内已收到密文' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n4-5', lane: 'tee', stage: 's4-3', icon: '🧠', label: '计算执行', case: 'TC-DELIVERY-001', data: { name: 'TEE 内运行', preview: 'CDH 远程证明通过\nSNP report OK' } , route: '/tdc/sandbox' , mode: 'execute', apiKey: 'sandbox_deliver',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: 'TEE 内存计算中(CDH 证明通过)' }
|
||
]
|
||
},
|
||
{ id: 'n4-6', lane: 'user', stage: 's4-4', icon: '📥', label: '接收计算结果', case: 'TC-USAGE-001', data: { name: '结果', preview: '联合模型 v1.2\nAUC 0.91 · 1.2 MB' } , route: '/tdc/delivery',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'readRowCount', desc: '看可用结果' },
|
||
{ type: 'search', keyword: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '我从 TEE 拿到的结果' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n4-7', lane: 'tee', stage: 's4-5', icon: '🔥', label: '数据销毁、环境清零' , route: '/tdc/destroy-log' , mode: 'status', apiKey: 'sandbox_destroy',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'hoverRow', text: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: 'TEE 数据销毁日志' }
|
||
]
|
||
},
|
||
{ id: 'n4-8', lane: 'tee', stage: 's4-5', icon: '📨', label: '沙盒释放、凭证回传', case: 'TC-EVIDENCE-001', data: { name: '执行凭证', preview: 'attest:sha256:c12…\n执行时间 8m12s' } , route: '/tdc/destroy-log',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: 'TEE 凭证回传' }
|
||
]
|
||
},
|
||
{ id: 'n4-9', lane: 'ops', stage: 's4-5', icon: '✔️', label: '收到释放回执' , route: '/tds/evidence',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'expectRow', text: (ctx) => `TEE-${ctx.runId}` },
|
||
{ type: 'shot', seq: 10, desc: '运营方收到释放回执' }
|
||
]
|
||
},
|
||
],
|
||
edges: [
|
||
{ from: 'n4-1', to: 'n4-2', label: '创建事件', kind: 'notify' },
|
||
{ from: 'n4-2', to: 'n4-3', label: '导入通知', kind: 'notify' },
|
||
{ from: 'n4-3', to: 'n4-4', label: '加密数据', kind: 'cipher' },
|
||
{ from: 'n4-4', to: 'n4-5', label: '解密入内存', kind: 'cipher' },
|
||
{ from: 'n4-5', to: 'n4-6', label: '结果加密出域', kind: 'cipher' },
|
||
{ from: 'n4-6', to: 'n4-7', label: 'ACK', kind: 'callback' },
|
||
{ from: 'n4-7', to: 'n4-8', label: '销毁完成', kind: 'notify' },
|
||
{ from: 'n4-8', to: 'n4-9', label: '释放凭证', kind: 'voucher' }
|
||
]
|
||
}
|
||
|
||
// ───────── 图5:三种隐私计算模式对比 ─────────
|
||
const seq5 = {
|
||
id: 'seq-5',
|
||
no: 5,
|
||
title: '三种隐私计算模式对比',
|
||
subtitle: '集中式 PSI · 联邦学习 · 多方安全计算(并行调度)',
|
||
participants: ['ops', 'psi', 'fl', 'mpc'],
|
||
stages: [
|
||
{ id: 's5-1', name: '场景:按需求选择计算模式', color: 'rgba(88,166,255,.07)' },
|
||
{ id: 's5-2', name: '部署沙盒', color: 'rgba(163,113,247,.07)' },
|
||
{ id: 's5-3', name: '计算加工', color: 'rgba(210,153,34,.07)' },
|
||
{ id: 's5-4', name: '结果回传', color: 'rgba(63,185,80,.07)' }
|
||
],
|
||
nodes: [
|
||
{ id: 'n5-1', lane: 'ops', stage: 's5-1', icon: '🧭', label: '按场景选择模式', data: { name: '选型', preview: '按"是否可集中"\n选 PSI / FL / MPC' } , route: '/tds/policies',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'search', keyword: '隐私' },
|
||
{ type: 'hoverRow', text: '隐私' },
|
||
{ type: 'shot', seq: 10, desc: '隐私策略列表里选择计算模式' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n5-2', lane: 'psi', stage: 's5-2', icon: '🏗️', label: '部署 1 个集中沙盒' , route: '/flow/projects' , mode: 'create', apiKey: 'sandbox_create',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'search', keyword: 'PSI' },
|
||
{ type: 'shot', seq: 10, desc: 'PSI 集中沙盒已部署' }
|
||
]
|
||
},
|
||
{ id: 'n5-3', lane: 'fl', stage: 's5-2', icon: '🏗️', label: '各参与方本地部署(N 个)' , route: '/flow/projects' , mode: 'create', apiKey: 'sandbox_create',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: 'FL' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: 'FL 各方本地沙盒已部署' }
|
||
]
|
||
},
|
||
{ id: 'n5-4', lane: 'mpc', stage: 's5-2', icon: '🏗️', label: '各参与方本地部署(N 个)' , route: '/flow/projects' , mode: 'create', apiKey: 'sandbox_create',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: 'MPC' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: 'MPC 各方本地沙盒已部署' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n5-5', lane: 'psi', stage: 's5-3', icon: '🔐', label: '数据加密出域 → 集中融合', data: { name: 'PSI 协议', preview: 'OPRF + 加密求交\n隐私集合 ≈ 5w' } , route: '/tdc/privacy',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: 'PSI' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: 'PSI 求交计算中' }
|
||
]
|
||
},
|
||
{ id: 'n5-6', lane: 'fl', stage: 's5-3', icon: '🖥️', label: '数据不出域 → 本地明文训练' , route: '/tdc/privacy',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: 'FL' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: 'FL 本地训练中' }
|
||
]
|
||
},
|
||
{ id: 'n5-7', lane: 'fl', stage: 's5-3', icon: '🔁', label: '沙盒间传输加密模型参数', data: { name: '梯度', preview: 'ΔW · 0.8 MB\n加噪 ε=0.1' } , route: '/tdc/privacy',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: '梯度' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: 'FL 加密梯度传输中' }
|
||
]
|
||
},
|
||
{ id: 'n5-8', lane: 'mpc', stage: 's5-3', icon: '✂️', label: '数据不出域 → 秘密分享成碎片' , route: '/tdc/privacy',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: 'Shamir' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: 'MPC 秘密分享' }
|
||
]
|
||
},
|
||
{ id: 'n5-9', lane: 'mpc', stage: 's5-3', icon: '🔁', label: '沙盒间传输加密中间碎片', data: { name: '秘密分享', preview: '3-of-5 Shamir\n碎片 24 KB ×5' } , route: '/tdc/privacy',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: '碎片' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: 'MPC 中间碎片传输' }
|
||
]
|
||
},
|
||
|
||
{ id: 'n5-10', lane: 'psi', stage: 's5-4', icon: '📥', label: '返回求交结果', case: 'TC-USAGE-001', data: { name: '结果', preview: '交集 ID 数 4872\n用时 32s' } , route: '/tdc/privacy',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: '求交' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: 'PSI 交集结果' }
|
||
]
|
||
},
|
||
{ id: 'n5-11', lane: 'fl', stage: 's5-4', icon: '📥', label: '返回联合模型' , route: '/tdc/privacy',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: '联合模型' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: 'FL 联合模型结果' }
|
||
]
|
||
},
|
||
{ id: 'n5-12', lane: 'mpc', stage: 's5-4', icon: '📥', label: '返回联合统计结果', case: 'TC-USAGE-022', data: { name: '结果', preview: '均值 μ=124.7\nσ=8.3 · 用时 5m' } , route: '/tds/policy-conflict',
|
||
actions: [
|
||
{ type: 'pickSpace' },
|
||
{ type: 'waitIdle', ms: 700 },
|
||
{ type: 'refresh' },
|
||
{ type: 'search', keyword: '策略冲突' },
|
||
{ type: 'readRowCount' },
|
||
{ type: 'shot', seq: 10, desc: 'MPC 联合统计结果' }
|
||
]
|
||
},
|
||
],
|
||
edges: [
|
||
{ from: 'n5-1', to: 'n5-2', label: '模式 PSI', kind: 'request' },
|
||
{ from: 'n5-1', to: 'n5-3', label: '模式 FL', kind: 'request' },
|
||
{ from: 'n5-1', to: 'n5-4', label: '模式 MPC', kind: 'request' },
|
||
|
||
{ from: 'n5-2', to: 'n5-5', label: '沙盒就绪', kind: 'notify' },
|
||
{ from: 'n5-5', to: 'n5-10', label: '求交结果', kind: 'cipher' },
|
||
|
||
{ from: 'n5-3', to: 'n5-6', label: '沙盒就绪', kind: 'notify' },
|
||
{ from: 'n5-6', to: 'n5-7', label: '梯度', kind: 'cipher' },
|
||
{ from: 'n5-7', to: 'n5-11', label: '聚合模型', kind: 'cipher' },
|
||
|
||
{ from: 'n5-4', to: 'n5-8', label: '沙盒就绪', kind: 'notify' },
|
||
{ from: 'n5-8', to: 'n5-9', label: '碎片', kind: 'cipher' },
|
||
{ from: 'n5-9', to: 'n5-12', label: '聚合统计', kind: 'cipher' }
|
||
]
|
||
}
|
||
|
||
/**
|
||
* 把"老格式"边(数组 [from,to,dashed])平滑成新格式(对象);调用方放心传老数据
|
||
*/
|
||
function normalizeEdges(edges) {
|
||
return edges.map((e) => {
|
||
if (Array.isArray(e)) {
|
||
const [from, to, dashed] = e
|
||
return { from, to, label: '', kind: dashed ? 'callback' : 'request' }
|
||
}
|
||
return e
|
||
})
|
||
}
|
||
|
||
const graphs = [seq1, seq2, seq3, seq4, seq5].map((g) => ({
|
||
...g,
|
||
edges: normalizeEdges(g.edges)
|
||
}))
|
||
|
||
export const DAG = {
|
||
swimlanes: SWIMLANES,
|
||
edgeKinds: EDGE_KINDS,
|
||
graphs
|
||
}
|
||
|
||
/** 收集一张图里所有节点关联到的真实 TC 编号(用于点「启动」时直接喂给 runner) */
|
||
export function collectTcs(graph) {
|
||
const set = new Set()
|
||
for (const n of graph.nodes) if (n.case) set.add(n.case)
|
||
return [...set]
|
||
} |