Archived
范式退役:活动只剩一种、只跑 Loop;审批活动可管;活动库重做
用户定的两件,一并落地。
**一、活动不再分 flow 和 loop —— 彻底退役 flow**
· `flow-engine` 模块整个删除(runner 379 行 + step-sequence 184 行 + 测试);
· `paradigm` 从清单身份、`activity_package`/`task` 两张表、任务卡与活动库一并退场;
`businessModel` 不再是判别联合 —— 只有案例模型(CMMN + 说明书 + DMN)一形;
· task 的引擎分派从「按 paradigm 取两个之一」收成**唯一的引擎**;
· `activities/` 四个 flow 活动(A1 受理 / A4 定价 / A6 议价 / A7 归档)各写了一份
案例模型:阶段照原来的步分,触达世界的项一律 manualActivationRule,
能算的交 DMN(A1 的三分类 P-03、A4 的 P-01/P-02)不交 Agent;
· 六个占位槽位的骨架从「机器步落台账 + 一张验收单」改成案例骨架,包版本 0.8.0 → 0.9.0。
**代价写在明处,不假装没有**:`turn-runner` 每一拍都要 `agent.decide` ——
环境里没有模型 key,案例活动一步也走不动。三套端到端(统一报价 / 新建流程包 / 测试台
Trace)整套跳过,文件头写明恢复条件:①有可用模型 ②走法改写成按 Enabled 集推进。
**不许把断言改松让它变绿** —— 绿得不诚实比红着更坏。debt.md 已记。
**二、审批活动可管**(新能力)
· `sys.approval_template`:审批点**可复用的那一半** —— 审批人看哪几项、按什么名字看、
怎么催、说什么话。谁来审不在里面(与活动点同口径,运营时轮值);驳回回哪个节点
也不在里面(那是每张图自己的事,留在节点上);
· 三条路由 + 引用反查:还被审批点引着就不许删(409),删了那些节点会**静默**退回旧行为;
· 运行时 `basisOf`:引了模板就按模板筛与改名,没引即旧行为(载荷全摊开)。
模板改了只影响新发出的审批单 —— 在途单的依据在发出那一刻已定形。
**三、活动库重做**:一区两格 —— 「活动(装进来的)」与「审批活动(配出来的)」,
都用流程卡那套两段式卡片(头 + 四格数据板),幽灵卡当入口(装入活动 / 新建审批活动);
「标准/案例」那一维随范式一起撤,业务分类成了唯一的一维,以行内小签呈现。
迁移 0020:两张表 drop paradigm、建 approval_template。已在开发库跑过并重播种。
实测(丁子乔账号):建「定价审批」模板 → 流程包 A5 属性里选得到 → 引用反查计数正确。
四闸绿(api:check 随本提交)。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
This commit is contained in:
+99
-149
@@ -310,10 +310,6 @@ export declare const govTaskRowSchema: z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "TaskId", "out">;
|
||||
title: z.ZodString;
|
||||
activityId: z.ZodString;
|
||||
paradigm: z.ZodEnum<{
|
||||
loop: "loop";
|
||||
flow: "flow";
|
||||
}>;
|
||||
ownerName: z.ZodString;
|
||||
runtime: z.ZodEnum<{
|
||||
running: "running";
|
||||
@@ -344,10 +340,6 @@ export declare const listGovTasksRoute: {
|
||||
id: z.core.$ZodBranded<z.ZodString, "TaskId", "out">;
|
||||
title: z.ZodString;
|
||||
activityId: z.ZodString;
|
||||
paradigm: z.ZodEnum<{
|
||||
loop: "loop";
|
||||
flow: "flow";
|
||||
}>;
|
||||
ownerName: z.ZodString;
|
||||
runtime: z.ZodEnum<{
|
||||
running: "running";
|
||||
@@ -522,6 +514,7 @@ export declare const listProcessPackagesRoute: {
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"terminate">;
|
||||
}, z.core.$strip>], "kind">;
|
||||
templateId: z.ZodOptional<z.ZodString>;
|
||||
nudge: z.ZodOptional<z.ZodObject<{
|
||||
deadline: z.ZodString;
|
||||
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
@@ -645,6 +638,7 @@ export declare const saveProcessRoute: {
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"terminate">;
|
||||
}, z.core.$strip>], "kind">;
|
||||
templateId: z.ZodOptional<z.ZodString>;
|
||||
nudge: z.ZodOptional<z.ZodObject<{
|
||||
deadline: z.ZodString;
|
||||
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
@@ -752,6 +746,7 @@ export declare const saveProcessRoute: {
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"terminate">;
|
||||
}, z.core.$strip>], "kind">;
|
||||
templateId: z.ZodOptional<z.ZodString>;
|
||||
nudge: z.ZodOptional<z.ZodObject<{
|
||||
deadline: z.ZodString;
|
||||
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
@@ -892,6 +887,7 @@ export declare const setProcessStateRoute: {
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"terminate">;
|
||||
}, z.core.$strip>], "kind">;
|
||||
templateId: z.ZodOptional<z.ZodString>;
|
||||
nudge: z.ZodOptional<z.ZodObject<{
|
||||
deadline: z.ZodString;
|
||||
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
@@ -1011,6 +1007,7 @@ export declare const deleteProcessVersionRoute: {
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"terminate">;
|
||||
}, z.core.$strip>], "kind">;
|
||||
templateId: z.ZodOptional<z.ZodString>;
|
||||
nudge: z.ZodOptional<z.ZodObject<{
|
||||
deadline: z.ZodString;
|
||||
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
@@ -1052,6 +1049,94 @@ export declare const deleteProcessVersionRoute: {
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
};
|
||||
/** 审批模板一览 —— 活动库里「审批活动」那一格看的就是它 */
|
||||
export declare const listApprovalTemplatesRoute: {
|
||||
readonly method: "GET";
|
||||
readonly path: "/api/gov/approval-templates";
|
||||
readonly output: z.ZodObject<{
|
||||
templates: z.ZodArray<z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
name: z.ZodString;
|
||||
basis: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
field: z.ZodString;
|
||||
label: z.ZodString;
|
||||
}, z.core.$strip>>>;
|
||||
nudge: z.ZodOptional<z.ZodObject<{
|
||||
deadline: z.ZodString;
|
||||
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
after: z.ZodString;
|
||||
action: z.ZodEnum<{
|
||||
nudge: "nudge";
|
||||
escalate: "escalate";
|
||||
}>;
|
||||
}, z.core.$strip>>>;
|
||||
}, z.core.$strip>>;
|
||||
message: z.ZodOptional<z.ZodString>;
|
||||
usedBy: z.ZodArray<z.ZodObject<{
|
||||
packageId: z.ZodString;
|
||||
nodeId: z.ZodString;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
};
|
||||
/** 建或改一张模板 —— id 已存在即覆盖(模板是配置,不长版本) */
|
||||
export declare const upsertApprovalTemplateRoute: {
|
||||
readonly method: "PUT";
|
||||
readonly path: "/api/gov/approval-templates";
|
||||
readonly body: z.ZodObject<{
|
||||
template: z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
name: z.ZodString;
|
||||
basis: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
field: z.ZodString;
|
||||
label: z.ZodString;
|
||||
}, z.core.$strip>>>;
|
||||
nudge: z.ZodOptional<z.ZodObject<{
|
||||
deadline: z.ZodString;
|
||||
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
after: z.ZodString;
|
||||
action: z.ZodEnum<{
|
||||
nudge: "nudge";
|
||||
escalate: "escalate";
|
||||
}>;
|
||||
}, z.core.$strip>>>;
|
||||
}, z.core.$strip>>;
|
||||
message: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>;
|
||||
}, z.core.$strip>;
|
||||
readonly output: z.ZodObject<{
|
||||
template: z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
name: z.ZodString;
|
||||
basis: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
field: z.ZodString;
|
||||
label: z.ZodString;
|
||||
}, z.core.$strip>>>;
|
||||
nudge: z.ZodOptional<z.ZodObject<{
|
||||
deadline: z.ZodString;
|
||||
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
after: z.ZodString;
|
||||
action: z.ZodEnum<{
|
||||
nudge: "nudge";
|
||||
escalate: "escalate";
|
||||
}>;
|
||||
}, z.core.$strip>>>;
|
||||
}, z.core.$strip>>;
|
||||
message: z.ZodOptional<z.ZodString>;
|
||||
}, z.core.$strip>;
|
||||
}, z.core.$strip>;
|
||||
};
|
||||
/** 删一张模板 —— 还被审批点引着就拒(409):删了引它的节点会退回「载荷全摊开」 */
|
||||
export declare const deleteApprovalTemplateRoute: {
|
||||
readonly method: "DELETE";
|
||||
readonly path: "/api/gov/approval-templates/:id";
|
||||
readonly params: z.ZodObject<{
|
||||
id: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
readonly output: z.ZodObject<{
|
||||
ok: z.ZodBoolean;
|
||||
}, z.core.$strip>;
|
||||
};
|
||||
/**
|
||||
* 删整条流 —— 连同它的**所有版本**。货架上一条流一张卡,删的就是那张卡。
|
||||
* 两道闸:任一版有在途单即拒(那些单要按它跑完);还有调起规则指着它也拒 ——
|
||||
@@ -1129,6 +1214,7 @@ export declare const deleteProcessFlowRoute: {
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"terminate">;
|
||||
}, z.core.$strip>], "kind">;
|
||||
templateId: z.ZodOptional<z.ZodString>;
|
||||
nudge: z.ZodOptional<z.ZodObject<{
|
||||
deadline: z.ZodString;
|
||||
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
@@ -1255,6 +1341,7 @@ export declare const editProcessVersionRoute: {
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"terminate">;
|
||||
}, z.core.$strip>], "kind">;
|
||||
templateId: z.ZodOptional<z.ZodString>;
|
||||
nudge: z.ZodOptional<z.ZodObject<{
|
||||
deadline: z.ZodString;
|
||||
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
@@ -1366,6 +1453,7 @@ export declare const validateProcessRoute: {
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"terminate">;
|
||||
}, z.core.$strip>], "kind">;
|
||||
templateId: z.ZodOptional<z.ZodString>;
|
||||
nudge: z.ZodOptional<z.ZodObject<{
|
||||
deadline: z.ZodString;
|
||||
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
@@ -1669,10 +1757,6 @@ export declare const installActivityRoute: {
|
||||
name: z.ZodString;
|
||||
packageVersion: z.ZodString;
|
||||
category: z.ZodString;
|
||||
paradigm: z.ZodEnum<{
|
||||
loop: "loop";
|
||||
flow: "flow";
|
||||
}>;
|
||||
sdkVersion: z.ZodString;
|
||||
checksum: z.ZodString;
|
||||
signature: z.ZodOptional<z.ZodString>;
|
||||
@@ -1817,8 +1901,7 @@ export declare const installActivityRoute: {
|
||||
}, z.core.$strip>;
|
||||
}, z.core.$strip>;
|
||||
assets: z.ZodObject<{
|
||||
businessModel: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
paradigm: z.ZodLiteral<"loop">;
|
||||
businessModel: z.ZodObject<{
|
||||
cmmnXml: z.ZodString;
|
||||
narrative: z.ZodString;
|
||||
dmn: z.ZodObject<{
|
||||
@@ -1851,137 +1934,7 @@ export declare const installActivityRoute: {
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>>;
|
||||
}, z.core.$strip>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
paradigm: z.ZodLiteral<"flow">;
|
||||
steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
kind: z.ZodLiteral<"tool">;
|
||||
tool: z.ZodString;
|
||||
name: z.ZodString;
|
||||
label: z.ZodString;
|
||||
input: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
output: z.ZodOptional<z.ZodObject<{
|
||||
domain: z.ZodString;
|
||||
object: z.ZodString;
|
||||
key: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
fields: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
when: z.ZodOptional<z.ZodString>;
|
||||
view: z.ZodOptional<z.ZodString>;
|
||||
failure: z.ZodObject<{
|
||||
retry: z.ZodObject<{
|
||||
times: z.ZodNumber;
|
||||
backoff: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
fallback: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
kind: z.ZodLiteral<"human">;
|
||||
workOrder: z.ZodEnum<{
|
||||
execution: "execution";
|
||||
acceptance: "acceptance";
|
||||
}>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"blocked">;
|
||||
}, z.core.$strip>], "kind">;
|
||||
}, z.core.$strip>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"llm">;
|
||||
model: z.ZodString;
|
||||
template: z.ZodString;
|
||||
outputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
||||
name: z.ZodString;
|
||||
label: z.ZodString;
|
||||
input: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
output: z.ZodOptional<z.ZodObject<{
|
||||
domain: z.ZodString;
|
||||
object: z.ZodString;
|
||||
key: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
fields: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
when: z.ZodOptional<z.ZodString>;
|
||||
view: z.ZodOptional<z.ZodString>;
|
||||
failure: z.ZodObject<{
|
||||
retry: z.ZodObject<{
|
||||
times: z.ZodNumber;
|
||||
backoff: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
fallback: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
kind: z.ZodLiteral<"human">;
|
||||
workOrder: z.ZodEnum<{
|
||||
execution: "execution";
|
||||
acceptance: "acceptance";
|
||||
}>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"blocked">;
|
||||
}, z.core.$strip>], "kind">;
|
||||
}, z.core.$strip>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"human">;
|
||||
workOrder: z.ZodEnum<{
|
||||
execution: "execution";
|
||||
acceptance: "acceptance";
|
||||
}>;
|
||||
card: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
||||
deadline: z.ZodString;
|
||||
name: z.ZodString;
|
||||
label: z.ZodString;
|
||||
input: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
output: z.ZodOptional<z.ZodObject<{
|
||||
domain: z.ZodString;
|
||||
object: z.ZodString;
|
||||
key: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
fields: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
when: z.ZodOptional<z.ZodString>;
|
||||
view: z.ZodOptional<z.ZodString>;
|
||||
failure: z.ZodObject<{
|
||||
retry: z.ZodObject<{
|
||||
times: z.ZodNumber;
|
||||
backoff: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
fallback: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
kind: z.ZodLiteral<"human">;
|
||||
workOrder: z.ZodEnum<{
|
||||
execution: "execution";
|
||||
acceptance: "acceptance";
|
||||
}>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"blocked">;
|
||||
}, z.core.$strip>], "kind">;
|
||||
}, z.core.$strip>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"pure-tool">;
|
||||
tool: z.ZodString;
|
||||
name: z.ZodString;
|
||||
label: z.ZodString;
|
||||
input: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
output: z.ZodOptional<z.ZodObject<{
|
||||
domain: z.ZodString;
|
||||
object: z.ZodString;
|
||||
key: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
||||
fields: z.ZodRecord<z.ZodString, z.ZodString>;
|
||||
}, z.core.$strip>>;
|
||||
when: z.ZodOptional<z.ZodString>;
|
||||
view: z.ZodOptional<z.ZodString>;
|
||||
failure: z.ZodObject<{
|
||||
retry: z.ZodObject<{
|
||||
times: z.ZodNumber;
|
||||
backoff: z.ZodString;
|
||||
}, z.core.$strip>;
|
||||
fallback: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
||||
kind: z.ZodLiteral<"human">;
|
||||
workOrder: z.ZodEnum<{
|
||||
execution: "execution";
|
||||
acceptance: "acceptance";
|
||||
}>;
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"blocked">;
|
||||
}, z.core.$strip>], "kind">;
|
||||
}, z.core.$strip>;
|
||||
}, z.core.$strip>], "kind">>;
|
||||
parallelGroups: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
name: z.ZodString;
|
||||
steps: z.ZodArray<z.ZodString>;
|
||||
}, z.core.$strip>>>;
|
||||
}, z.core.$strip>], "paradigm">;
|
||||
}, z.core.$strip>;
|
||||
skills: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
id: z.core.$ZodBranded<z.ZodString, "SkillId", "out">;
|
||||
label: z.ZodString;
|
||||
@@ -2102,10 +2055,6 @@ export declare const listActivitiesRoute: {
|
||||
activityId: z.ZodString;
|
||||
name: z.ZodString;
|
||||
category: z.ZodString;
|
||||
paradigm: z.ZodEnum<{
|
||||
loop: "loop";
|
||||
flow: "flow";
|
||||
}>;
|
||||
enabled: z.ZodBoolean;
|
||||
packageVersions: z.ZodArray<z.ZodObject<{
|
||||
version: z.ZodString;
|
||||
@@ -2489,6 +2438,7 @@ export declare const govWorkflowRoute: {
|
||||
}, z.core.$strip>, z.ZodObject<{
|
||||
kind: z.ZodLiteral<"terminate">;
|
||||
}, z.core.$strip>], "kind">;
|
||||
templateId: z.ZodOptional<z.ZodString>;
|
||||
nudge: z.ZodOptional<z.ZodObject<{
|
||||
deadline: z.ZodString;
|
||||
steps: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
||||
|
||||
Reference in New Issue
Block a user