M3(1/5): @sfeel —— S-FEEL 子集的解析与求值,前后端同源

- lexer / parser(递归下降)/ evaluate / static-check,四文件纯函数,零 IO 零外部调用
- 子集封顶(ADR-006):比较 · 逻辑 · 算术 · 区间(开闭四态)· 列表与 in ·
  封闭内建函数集(字符串 / 数字 / 日期);未知函数一律拦下
- 单元格谓词(DMN 一格):`-` 任意 / 比较 / 区间 / 逗号析取
- staticCheck 给「画图即校验」用:语法 + 未知函数 + 引用路径清单
- app 侧以它替下 passthroughEvaluator:监听内容条件真求值,求值异常按不命中处置并留痕

32 个 sfeel 测试;全仓 182 个测试通过,门禁五道全绿

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
This commit is contained in:
JCAI Main Agent
2026-07-27 01:21:45 +08:00
co-authored by Claude Opus 5
parent f0444f1417
commit 146e9bbfad
13 changed files with 1048 additions and 26 deletions
+11 -11
View File
@@ -38,8 +38,8 @@ export declare const formFieldKindSchema: z.ZodEnum<{
number: "number";
file: "file";
text: "text";
check: "check";
date: "date";
check: "check";
textarea: "textarea";
radio: "radio";
select: "select";
@@ -54,8 +54,8 @@ export declare const formFieldSchema: z.ZodObject<{
number: "number";
file: "file";
text: "text";
check: "check";
date: "date";
check: "check";
textarea: "textarea";
radio: "radio";
select: "select";
@@ -191,8 +191,8 @@ export declare const viewBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"mail">;
dir: z.ZodEnum<{
out: "out";
in: "in";
out: "out";
}>;
statusLabel: z.ZodOptional<z.ZodString>;
editable: z.ZodOptional<z.ZodBoolean>;
@@ -418,8 +418,8 @@ export declare const deliverableSchema: z.ZodObject<{
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"mail">;
dir: z.ZodEnum<{
out: "out";
in: "in";
out: "out";
}>;
statusLabel: z.ZodOptional<z.ZodString>;
editable: z.ZodOptional<z.ZodBoolean>;
@@ -652,8 +652,8 @@ export declare const executionWorkOrderSchema: z.ZodObject<{
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"mail">;
dir: z.ZodEnum<{
out: "out";
in: "in";
out: "out";
}>;
statusLabel: z.ZodOptional<z.ZodString>;
editable: z.ZodOptional<z.ZodBoolean>;
@@ -773,8 +773,8 @@ export declare const executionWorkOrderSchema: z.ZodObject<{
number: "number";
file: "file";
text: "text";
check: "check";
date: "date";
check: "check";
textarea: "textarea";
radio: "radio";
select: "select";
@@ -863,8 +863,8 @@ export declare const acceptanceWorkOrderSchema: z.ZodObject<{
number: "number";
file: "file";
text: "text";
check: "check";
date: "date";
check: "check";
textarea: "textarea";
radio: "radio";
select: "select";
@@ -995,8 +995,8 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
}, z.core.$strip>, z.ZodObject<{
t: z.ZodLiteral<"mail">;
dir: z.ZodEnum<{
out: "out";
in: "in";
out: "out";
}>;
statusLabel: z.ZodOptional<z.ZodString>;
editable: z.ZodOptional<z.ZodBoolean>;
@@ -1116,8 +1116,8 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
number: "number";
file: "file";
text: "text";
check: "check";
date: "date";
check: "check";
textarea: "textarea";
radio: "radio";
select: "select";
@@ -1180,8 +1180,8 @@ export declare const workOrderSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
number: "number";
file: "file";
text: "text";
check: "check";
date: "date";
check: "check";
textarea: "textarea";
radio: "radio";
select: "select";
@@ -1375,9 +1375,9 @@ export declare const chatMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
}, z.core.$strip>, z.ZodObject<{
k: z.ZodLiteral<"system">;
type: z.ZodEnum<{
time: "time";
human: "human";
data: "data";
time: "time";
control: "control";
}>;
text: z.ZodString;
+5 -5
View File
@@ -8,9 +8,9 @@
import { z } from 'zod';
export declare const EVENT_TYPES: readonly ["data", "time", "human", "control"];
export declare const eventTypeSchema: z.ZodEnum<{
time: "time";
human: "human";
data: "data";
time: "time";
control: "control";
}>;
export type EventType = z.infer<typeof eventTypeSchema>;
@@ -71,9 +71,9 @@ export type EventPayload = z.infer<typeof eventPayloadSchema>;
export declare const envelopeSchema: z.ZodObject<{
id: z.core.$ZodBranded<z.ZodString, "EventId", "out">;
type: z.ZodEnum<{
time: "time";
human: "human";
data: "data";
time: "time";
control: "control";
}>;
correlation: z.ZodObject<{
@@ -134,9 +134,9 @@ export type Envelope = z.infer<typeof envelopeSchema>;
*/
export declare const envelopeDraftSchema: z.ZodObject<{
type: z.ZodEnum<{
time: "time";
human: "human";
data: "data";
time: "time";
control: "control";
}>;
payload: z.ZodObject<{
@@ -235,9 +235,9 @@ export declare const listenerSpecSchema: z.ZodObject<{
dynamic: "dynamic";
}>;
eventType: z.ZodEnum<{
time: "time";
human: "human";
data: "data";
time: "time";
control: "control";
}>;
keyFilter: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -260,9 +260,9 @@ export declare const registeredListenerSchema: z.ZodObject<{
dynamic: "dynamic";
}>;
eventType: z.ZodEnum<{
time: "time";
human: "human";
data: "data";
time: "time";
control: "control";
}>;
keyFilter: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
+2 -2
View File
@@ -77,9 +77,9 @@ export declare const manifestDeclarationsSchema: z.ZodObject<{
dynamic: "dynamic";
}>;
eventType: z.ZodEnum<{
time: "time";
human: "human";
data: "data";
time: "time";
control: "control";
}>;
keyFilter: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -954,9 +954,9 @@ export declare const activityManifestSchema: z.ZodObject<{
dynamic: "dynamic";
}>;
eventType: z.ZodEnum<{
time: "time";
human: "human";
data: "data";
time: "time";
control: "control";
}>;
keyFilter: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
+1 -1
View File
@@ -535,9 +535,9 @@ export declare const triggerConfigSchema: z.ZodObject<{
kind: z.ZodLiteral<"event">;
rule: z.ZodString;
eventType: z.ZodDefault<z.ZodEnum<{
time: "time";
human: "human";
data: "data";
time: "time";
control: "control";
}>>;
}, z.core.$strip>, z.ZodObject<{