Archived
三面拆分⑭:纯编排第三轮 —— 活动卸岗位、卡点废除全真边、边号 E1–En 图上可选
活动契约不带负责人岗位(用户定): - schema:活动节点删 owner(审批点的 approver 是「卡到人的工位」的功能语义,保留) - 运行时:活动任务默认**全员轮值**(在岗候选并集、最闲者先、staffId 稳定排序, owner-resolved 事件岗位记「(全员轮值)」);运营分派机制落地后让位 —— 债已记 - closure:活动点不核岗位,missing-owner-position 只出自审批点 - 员工面链条:活动点报**实际承接人**(实例→任务→人),没起的如实报「轮值待派」; NodeInstance 公开 taskId/approvalId(店面读回,与端口型合流) - 画布/导出依赖文件/属性卡全线摘岗位;属性卡活动点明说「分派归运营」 卡点画法废除,顺序流一律真边(用户定): - 种子图重画:四条回跳/直达(E4 直接定价、E6 选型后定价、E10 不通过、E12 有异议) 全部画成折线真边,车道分层零交叉(顶 y30 / y190 / y230 / 缝隙对开 / 底 y380); 卡点节点删净,图=恰 10 语义节点 + 14 真边一一对应(测试守着) - graph-to-pkg 卡点认亲机制删除;pkg-to-graph 直接按 from→to 认亲 - 元素盘删卡点件;图例、属性卡卡点分支、kindLabel/kindTone 随删 边号 E1、E2…(用户定): - 语义边 id 即边号:种子 E1–E14;合并器铸号(旧边保号、新边取下一空号,回归测试守着) - 画布线标带号(`E3 直接寻源`,无注记的边也标 `E1`);拣选条以边号立牌, **条件不再上按钮** —— 条件/映射只住属性面 - 边在图上可选中:FlowDiagram 连线加宽透明命中垫(边可点时注解层提到形状层上), 点线即切属性卡到该边(实测 E4 命中) 测试:closure 28、advance-order 6、graph-to-pkg 5(新增铸号例)、seed 8、 端到端八例真库全绿(全员轮值下照跑);五闸退出码验过。 库:purge 后重种,唯一 unified-quote@v1 生效(双面判据齐)。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
/**
|
||||
* 流程包(无网关版)—— 守四件事:拓扑齐且零网关、分支即条件出边、
|
||||
* 审批点两个去向都由图表达、回边标了 reopen。
|
||||
* 流程包(纯编排版)—— 守四件事:拓扑齐、分支即条件出边、
|
||||
* 审批点两个去向都由图表达、图上每条语义边都画成真边(卡点画法已废)。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { MVP_PACKAGE } from '../seed-mvp-flow.ts';
|
||||
|
||||
describe('MVP_PACKAGE', () => {
|
||||
it('10 语义节点 · 14 边 · 一审批点双终点(网关在 schema 里已不存在)', () => {
|
||||
it('10 语义节点 · 14 边编号 E1–E14 · 一审批点双终点', () => {
|
||||
expect(MVP_PACKAGE.nodes).toHaveLength(10);
|
||||
expect(MVP_PACKAGE.edges).toHaveLength(14);
|
||||
expect(MVP_PACKAGE.edges.map((e) => e.id)).toEqual(Array.from({ length: 14 }, (_, i) => `E${i + 1}`));
|
||||
expect(MVP_PACKAGE.nodes.filter((n) => n.kind === 'approval')).toHaveLength(1);
|
||||
expect(MVP_PACKAGE.nodes.filter((n) => n.kind === 'end')).toHaveLength(2);
|
||||
});
|
||||
@@ -62,35 +62,29 @@ describe('MVP_PACKAGE', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it('手绘图存证:10 语义节点 + 4 卡点(直达两枚是正向边的呈现,回跳两枚照旧)', () => {
|
||||
it('手绘图存证:恰是 10 个语义节点,零卡点(卡点画法已废)', () => {
|
||||
const nodes = (MVP_PACKAGE.diagram as { nodes: { id: string; kind: string }[] }).nodes;
|
||||
expect(nodes.filter((n) => n.kind === 'callout')).toHaveLength(4);
|
||||
expect(nodes).toHaveLength(14);
|
||||
expect(nodes.filter((n) => n.kind === 'callout')).toHaveLength(0);
|
||||
expect(nodes).toHaveLength(10);
|
||||
const drawn = new Set(nodes.map((n) => n.id));
|
||||
for (const n of MVP_PACKAGE.nodes) expect(drawn.has(n.id), `图上缺 ${n.id}`).toBe(true);
|
||||
});
|
||||
|
||||
/*
|
||||
* 语义边必须**每条都画在图上**(直连线,或指向带 `to` 卡点的线)——
|
||||
* 画布保存由画出来的边反推语义边,没画的那条会在第一次存盘时被静默丢掉
|
||||
* 语义边必须**每条都画成真边** —— 画布保存由画出来的边反推语义边,
|
||||
* 没画的那条会在第一次存盘时被静默丢掉
|
||||
* (实测:A1→A3「直接寻源」漏画,mergeGraphIntoPackage 一过就没了)。
|
||||
*/
|
||||
it('图边对账:每条语义边都有画出来的对应(直连或经卡点)', () => {
|
||||
const dia = MVP_PACKAGE.diagram as {
|
||||
nodes: { id: string; kind: string; to?: string }[];
|
||||
edges: { from: string; to: string }[];
|
||||
};
|
||||
const calloutTo = new Map(dia.nodes.filter((n) => n.kind === 'callout').map((n) => [n.id, n.to]));
|
||||
const drawnPairs = new Set(dia.edges.map((e) => `${e.from}→${calloutTo.get(e.to) ?? e.to}`));
|
||||
for (const e of MVP_PACKAGE.edges) {
|
||||
expect(drawnPairs.has(`${e.from}→${e.to}`), `语义边 ${e.id}(${e.from}→${e.to})没画在图上`).toBe(true);
|
||||
}
|
||||
it('图边对账:每条语义边都画成真边,一一对应', () => {
|
||||
const dia = MVP_PACKAGE.diagram as { edges: { from: string; to: string }[] };
|
||||
const drawnPairs = dia.edges.map((e) => `${e.from}→${e.to}`).sort();
|
||||
const semPairs = MVP_PACKAGE.edges.map((e) => `${e.from}→${e.to}`).sort();
|
||||
expect(drawnPairs).toEqual(semPairs);
|
||||
});
|
||||
|
||||
it('几何:坐标吸附 10px 珊格,框不重叠', () => {
|
||||
const nodes = (MVP_PACKAGE.diagram as { nodes: { id: string; kind: string; x: number; y: number }[] }).nodes;
|
||||
const size = (kind: string) =>
|
||||
kind === 'callout' ? { w: 100, h: 30 } : kind === 'activity' ? { w: 100, h: 40 } : { w: 20, h: 20 };
|
||||
const size = (kind: string) => (kind === 'activity' ? { w: 100, h: 40 } : { w: 20, h: 20 });
|
||||
for (const n of nodes) {
|
||||
expect(n.x % 10, `${n.id} x`).toBe(0);
|
||||
expect(n.y % 10, `${n.id} y`).toBe(0);
|
||||
|
||||
Reference in New Issue
Block a user