@stalfh233/omc-cli 0.8.13 → 0.8.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artifacts.js +3 -2
- package/dist/call.js +31 -0
- package/dist/cli-output.js +19 -0
- package/dist/cli.js +186 -23
- package/dist/form-support.js +3 -1
- package/dist/human-summary.js +84 -2
- package/dist/intent/capabilities/datarule.js +126 -12
- package/dist/intent/cli.js +35 -2
- package/dist/intent/compare.js +18 -0
- package/dist/intent/plan-apply.js +19 -5
- package/dist/intent/plan-file.js +38 -0
- package/dist/intent/readback.js +3 -0
- package/dist/intent/schema.js +1 -1
- package/dist/lanes/datarule-contract.js +2 -1
- package/dist/lanes/datarule.js +59 -2
- package/dist/lanes/environment.js +43 -3
- package/dist/lanes/field-contract.js +1 -1
- package/dist/lanes/field.js +17 -2
- package/dist/lanes/form.js +1 -1
- package/dist/lanes/model-references.js +29 -1
- package/dist/lanes/runtime-data-contract.js +2 -2
- package/dist/lanes/runtime-data.js +328 -31
- package/dist/lanes/workflow.js +79 -2
- package/dist/model-purge.js +2 -13
- package/dist/mojibake.js +69 -0
- package/dist/read-shapes.js +2 -1
- package/dist/recipes/datarule.js +1 -0
- package/dist/recipes/form.js +2 -2
- package/dist/recipes/runtime-data.js +4 -4
- package/dist/stdout-pipe.js +78 -0
- package/dist/tool-types.js +10 -0
- package/dist/write.js +56 -7
- package/package.json +3 -3
- package/skills/omc-business-configuration.md +1 -1
- package/skills/omc-capabilities.md +1 -1
package/dist/lanes/workflow.js
CHANGED
|
@@ -7,7 +7,7 @@ import { ToolRefusalError } from "../tool-types.js";
|
|
|
7
7
|
import { writeTool } from "../write.js";
|
|
8
8
|
import { registerPackageTool } from "../package-tool.js";
|
|
9
9
|
import { writeSummary } from "../human-summary.js";
|
|
10
|
-
import { defineTool, ToolInputError } from "../tool-types.js";
|
|
10
|
+
import { defineTool, isRequiredAlternativePlaceholder, ToolInputError } from "../tool-types.js";
|
|
11
11
|
import { DEFAULT_SCAN_CONCURRENCY, mapWithConcurrency } from "../concurrency.js";
|
|
12
12
|
import { wireCall, wireRows, WireError } from "../wire.js";
|
|
13
13
|
import { diagnoseInstanceActivity, getInstanceBaseInfo, isCanceledInstanceStatus, isFinishedInstanceStatus, listInstanceActivities, listWorkItemsByParticipant, resolveBizObjectIdByInstance, searchWorkItems, wireString } from "../workflow-support.js";
|
|
@@ -3836,6 +3836,81 @@ export function registerWorkflowLane(tools) {
|
|
|
3836
3836
|
},
|
|
3837
3837
|
rollback: workflowRollbackSpec("workflow.update"),
|
|
3838
3838
|
});
|
|
3839
|
+
/**
|
|
3840
|
+
* F7(0.8.15,探针 I):候选 workflowCode 列表——解析失败时给可复制的核对面。
|
|
3841
|
+
* 平台没有「流程全集」端点(WorkflowTemplateController 只有按 schemaCode 的
|
|
3842
|
+
* list/getAllWorkflow),所以沿用 workflow.list 的模型索引骨架,并共用同一模型
|
|
3843
|
+
* 上限(WORKFLOW_LIST_MODEL_CAP=50,超出标 candidatesTruncated)。差异:本枚举
|
|
3844
|
+
* 只做 schemaCode→workflowCode 的点查询(每模型 1 wire getWorkflow,不经
|
|
3845
|
+
* isworkflow、不读 get_published 摘要),只服务失败路径,不替代 workflow.list
|
|
3846
|
+
* 的完整清单(那里有存在性/发布态/规则绑定计数)。
|
|
3847
|
+
*/
|
|
3848
|
+
const WORKFLOW_DELETE_CANDIDATE_MODEL_CAP = WORKFLOW_LIST_MODEL_CAP;
|
|
3849
|
+
async function availableWorkflowCodes(session) {
|
|
3850
|
+
try {
|
|
3851
|
+
const scope = await resolveApplicationScope(session, undefined);
|
|
3852
|
+
const tree = wireRows((await wireCall(session, { path: ENDPOINTS.applicationTree, query: { appCode: scope.code } })).data);
|
|
3853
|
+
const models = flattenTreeRows(tree).filter((row) => row.type === "BizModel" && typeof row.code === "string" && row.code.length > 0);
|
|
3854
|
+
const scan = models.slice(0, WORKFLOW_DELETE_CANDIDATE_MODEL_CAP);
|
|
3855
|
+
const codes = [];
|
|
3856
|
+
for (const model of scan) {
|
|
3857
|
+
try {
|
|
3858
|
+
const linked = (await wireCall(session, { path: ENDPOINTS.workflowGetBySchema, query: { schemaCode: String(model.code) } })).data;
|
|
3859
|
+
const code = linked !== null && typeof linked.workflowCode === "string" && linked.workflowCode.length > 0 ? linked.workflowCode : undefined;
|
|
3860
|
+
if (code !== undefined)
|
|
3861
|
+
codes.push(code);
|
|
3862
|
+
}
|
|
3863
|
+
catch {
|
|
3864
|
+
// 单模型读失败不中断候选枚举(同 workflow.list 的容错口径)
|
|
3865
|
+
}
|
|
3866
|
+
}
|
|
3867
|
+
return { codes: [...new Set(codes)], scannedModels: scan.length, truncated: models.length > scan.length };
|
|
3868
|
+
}
|
|
3869
|
+
catch {
|
|
3870
|
+
return { codes: [], scannedModels: 0, truncated: false };
|
|
3871
|
+
}
|
|
3872
|
+
}
|
|
3873
|
+
/**
|
|
3874
|
+
* F7(0.8.15,探针 I):只给流程码(code / workflowCode 别名)时反查所属模型。
|
|
3875
|
+
* 依据:平台 get_published 把 header 的 schemaCode 写回模板
|
|
3876
|
+
* (WorkflowTemplateController.getPublished,8.6.26 :618-655 ——
|
|
3877
|
+
* `templateModel.setSchemaCode(headerModel.getSchemaCode())`),一次读即可;
|
|
3878
|
+
* 模型侧 getWorkflow 只反方向(schemaCode → workflowCode),不能当本用途。
|
|
3879
|
+
* 解析不出就零写入拒绝,并列出当前应用可用的 workflowCode + workflow.list 指引。
|
|
3880
|
+
*/
|
|
3881
|
+
async function resolveWorkflowDeleteSchema(session, args) {
|
|
3882
|
+
if (!isRequiredAlternativePlaceholder(args.schemaCode))
|
|
3883
|
+
return;
|
|
3884
|
+
let published;
|
|
3885
|
+
try {
|
|
3886
|
+
published = await wireCall(session, { path: ENDPOINTS.workflowGetPublished, query: { workflowCode: args.code } });
|
|
3887
|
+
}
|
|
3888
|
+
catch (error) {
|
|
3889
|
+
if (!isWorkflowAbsent(error))
|
|
3890
|
+
throw error;
|
|
3891
|
+
}
|
|
3892
|
+
const data = (published?.data ?? null);
|
|
3893
|
+
const schemaCode = data !== null && typeof data.schemaCode === "string" && data.schemaCode.length > 0 ? data.schemaCode : undefined;
|
|
3894
|
+
if (schemaCode !== undefined) {
|
|
3895
|
+
args.schemaCode = schemaCode;
|
|
3896
|
+
return;
|
|
3897
|
+
}
|
|
3898
|
+
const candidates = await availableWorkflowCodes(session);
|
|
3899
|
+
throw new ToolRefusalError({
|
|
3900
|
+
status: "refused",
|
|
3901
|
+
blocker: "workflow-not-found",
|
|
3902
|
+
workflowCode: args.code,
|
|
3903
|
+
candidates: candidates.codes,
|
|
3904
|
+
scannedModels: candidates.scannedModels,
|
|
3905
|
+
...(candidates.truncated ? { candidatesTruncated: true } : {}),
|
|
3906
|
+
nextCommand: `omc call workflow.list --args '{}'`,
|
|
3907
|
+
message: `workflow.delete 只给了流程码 ${args.code},但流程读面解析不出它所属的模型(workflow/get_published ${args.code} 缺席或未带回 schemaCode)——无法定位要删的流程,本次零写入。` +
|
|
3908
|
+
(candidates.codes.length > 0
|
|
3909
|
+
? `当前应用可用的 workflowCode:${candidates.codes.join("、")}。`
|
|
3910
|
+
: `当前应用未扫到可用 workflowCode(scannedModels=${candidates.scannedModels})。`) +
|
|
3911
|
+
`核对流程码后重发(也可同时显式给 schemaCode);流程清单用 nextCommand:omc call workflow.list(按模型索引,可传 applicationCode)。`,
|
|
3912
|
+
});
|
|
3913
|
+
}
|
|
3839
3914
|
writeTool({
|
|
3840
3915
|
tools,
|
|
3841
3916
|
name: "workflow.delete",
|
|
@@ -3844,7 +3919,7 @@ export function registerWorkflowLane(tools) {
|
|
|
3844
3919
|
scope: WORKFLOW_TOOLS["workflow.delete"].scope,
|
|
3845
3920
|
description: WORKFLOW_TOOLS["workflow.delete"].description,
|
|
3846
3921
|
inputSchema: {
|
|
3847
|
-
schemaCode: z.string().min(1),
|
|
3922
|
+
schemaCode: z.string().min(1).describe("模型 code;只给 code/workflowCode 时可省略——工具用 workflow/get_published 一次读反查所属模型"),
|
|
3848
3923
|
code: z.string().min(1).describe("流程编码——本参数名是 code"),
|
|
3849
3924
|
unbindListviews: z
|
|
3850
3925
|
.boolean()
|
|
@@ -3854,6 +3929,7 @@ export function registerWorkflowLane(tools) {
|
|
|
3854
3929
|
// F7(0.8.8):dry-run 与真写共用同一份只读扫描——预览列出会被解绑的视图,
|
|
3855
3930
|
// 真写在任何写 wire 之前也先跑这里。两者都不写。
|
|
3856
3931
|
writeLint: async (session, args) => {
|
|
3932
|
+
await resolveWorkflowDeleteSchema(session, args);
|
|
3857
3933
|
if (args.unbindListviews !== true) {
|
|
3858
3934
|
return {
|
|
3859
3935
|
wouldChange: true,
|
|
@@ -3892,6 +3968,7 @@ export function registerWorkflowLane(tools) {
|
|
|
3892
3968
|
};
|
|
3893
3969
|
},
|
|
3894
3970
|
execute: async (session, args) => {
|
|
3971
|
+
await resolveWorkflowDeleteSchema(session, args);
|
|
3895
3972
|
const steps = [];
|
|
3896
3973
|
// Opt-in unbind (F7): the workflow.publish side effect binds every list
|
|
3897
3974
|
// view's `add` action to this workflow, and workflow.delete then answers
|
package/dist/model-purge.js
CHANGED
|
@@ -28,7 +28,7 @@ import { writeEnvelope } from "./cli-output.js";
|
|
|
28
28
|
import { ENDPOINTS } from "./endpoints.js";
|
|
29
29
|
import { wireCall, wireRows } from "./wire.js";
|
|
30
30
|
import { readModelRecord } from "./model-record.js";
|
|
31
|
-
import { inboundModelReferences, inboundReferenceRefusal, modelPurgeUnbindCommand } from "./lanes/model-references.js";
|
|
31
|
+
import { deletionOrderFromSteps, inboundModelReferences, inboundReferenceRefusal, modelPurgeUnbindCommand } from "./lanes/model-references.js";
|
|
32
32
|
import { resolveModelTreeNode } from "./lanes/model.js";
|
|
33
33
|
import { SessionManager } from "./session-manager.js";
|
|
34
34
|
import { ConfigStore, defaultPaths } from "./config-store.js";
|
|
@@ -64,18 +64,7 @@ async function sessionFor(environment) {
|
|
|
64
64
|
* `deletionSteps` keeps the order and never repeats an entry.
|
|
65
65
|
*/
|
|
66
66
|
export function purgeDeletionOrder(steps) {
|
|
67
|
-
|
|
68
|
-
const order = [];
|
|
69
|
-
for (const step of steps) {
|
|
70
|
-
const schemaCode = String(step.args.schemaCode ?? "");
|
|
71
|
-
const code = typeof step.args.code === "string" ? step.args.code : "";
|
|
72
|
-
const target = step.tool === "field.delete" ? `field.delete:${schemaCode}.${code}` : `${step.tool}:${schemaCode}`;
|
|
73
|
-
if (seen.has(target))
|
|
74
|
-
continue;
|
|
75
|
-
seen.add(target);
|
|
76
|
-
order.push(target);
|
|
77
|
-
}
|
|
78
|
-
return order;
|
|
67
|
+
return deletionOrderFromSteps(steps);
|
|
79
68
|
}
|
|
80
69
|
/**
|
|
81
70
|
* Read-only discovery: everything the purge would remove, in dependency order.
|
package/dist/mojibake.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 平台数据里的「双编码」中文(探针 I F10/F11,0.8.15)。
|
|
3
|
+
*
|
|
4
|
+
* 真机证据(local,2026-11-26):`/api/api/app/apppackage/list_all_group` 的
|
|
5
|
+
* wire 原文字节是 `22c3a5e280a6c2a8c3a9c692c2a822`(`"全部"` 的 UTF-8)——
|
|
6
|
+
* 服务端发出来的**已经是** U+00E5 U+2026 U+00A8 U+00E9 U+0192 U+00A8,
|
|
7
|
+
* 不是 CLI 解码错(`wire.ts` 全程 `response.text()`/`toString("utf8")`)。
|
|
8
|
+
* 还原:这些码点按 **windows-1252** 编码回字节是 E5 85 A8 E9 83 A8 = UTF-8 的
|
|
9
|
+
* 「全部」;同一个回执里的「默认」是正常 UTF-8,说明只有这一行数据在平台侧
|
|
10
|
+
* 被 1252 解码后又按 UTF-8 存回(DB 双编码)。
|
|
11
|
+
*
|
|
12
|
+
* 因此修复只能是**展示层的保守猜测**,绝不做通用转码:
|
|
13
|
+
* - 输入每个码点都必须能用 windows-1252 编回单字节(保证可逆);
|
|
14
|
+
* - 不能含控制字符、不能已含 CJK(已正常的中文原样放过);
|
|
15
|
+
* - 必须至少含一个 U+0080–U+00FF 的「疑似 mojibake」码点;
|
|
16
|
+
* - 重编码字节必须能被**严格 UTF-8** 解码(fatal,无 U+FFFD);
|
|
17
|
+
* - 解码结果必须真的出现 CJK。
|
|
18
|
+
* 任何一条不满足就原样返回,调用方据此决定是否打标记。
|
|
19
|
+
*
|
|
20
|
+
* 注意:只用 latin1 不够——1252 的 0x85 解码成 U+2026(`…`)、0x83 成 U+0192
|
|
21
|
+
* (`ƒ`),`Buffer.from(str, "latin1")` 会把它截成 0x26/0x03 直接破坏字节。
|
|
22
|
+
*/
|
|
23
|
+
const CP1252_REVERSE = (() => {
|
|
24
|
+
const reverse = new Map();
|
|
25
|
+
const decoder = new TextDecoder("windows-1252");
|
|
26
|
+
for (let byte = 0; byte <= 0xff; byte += 1) {
|
|
27
|
+
const char = decoder.decode(Uint8Array.of(byte));
|
|
28
|
+
// 1252 里未定义的 5 个字节在 WHATWG 解码器里回 U+0081 这类码点,仍可逆。
|
|
29
|
+
if (!reverse.has(char))
|
|
30
|
+
reverse.set(char, byte);
|
|
31
|
+
}
|
|
32
|
+
return reverse;
|
|
33
|
+
})();
|
|
34
|
+
const CJK = /[\u2E80-\u2EFF\u3000-\u303F\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF\uFF00-\uFFEF]/;
|
|
35
|
+
const SUSPICIOUS_LATIN1 = /[\u0080-\u00FF]/;
|
|
36
|
+
const UTF8_FATAL = new TextDecoder("utf-8", { fatal: true });
|
|
37
|
+
/**
|
|
38
|
+
* 尝试把「UTF-8 字节被 windows-1252 解码后再 UTF-8 编码」的字符串还原。
|
|
39
|
+
* 不匹配特征时原样返回,`repaired:false`。
|
|
40
|
+
*/
|
|
41
|
+
export function repairMojibakeText(input) {
|
|
42
|
+
if (input.length === 0)
|
|
43
|
+
return { value: input, repaired: false };
|
|
44
|
+
if (CJK.test(input) || SUSPICIOUS_LATIN1.test(input) === false)
|
|
45
|
+
return { value: input, repaired: false };
|
|
46
|
+
const bytes = new Uint8Array(input.length);
|
|
47
|
+
for (let index = 0; index < input.length; index += 1) {
|
|
48
|
+
const char = input[index];
|
|
49
|
+
const codePoint = char.codePointAt(0);
|
|
50
|
+
if (codePoint < 0x20)
|
|
51
|
+
return { value: input, repaired: false };
|
|
52
|
+
const byte = CP1252_REVERSE.get(char);
|
|
53
|
+
if (byte === undefined)
|
|
54
|
+
return { value: input, repaired: false };
|
|
55
|
+
bytes[index] = byte;
|
|
56
|
+
}
|
|
57
|
+
let decoded;
|
|
58
|
+
try {
|
|
59
|
+
decoded = UTF8_FATAL.decode(bytes);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
// 不是合法 UTF-8 字节序列:不是本类双编码,绝不猜。
|
|
63
|
+
return { value: input, repaired: false };
|
|
64
|
+
}
|
|
65
|
+
if (decoded === input || !CJK.test(decoded))
|
|
66
|
+
return { value: input, repaired: false };
|
|
67
|
+
return { value: decoded, repaired: true };
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=mojibake.js.map
|
package/dist/read-shapes.js
CHANGED
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
const READ_SHAPES = {
|
|
13
13
|
// r28k 治理面形状钉:截断≠空表;指纹有用途;doctor/get_status 分流。
|
|
14
14
|
"discover_environment": {
|
|
15
|
-
keys: ["applications:array<{code,name,groupId?,portalHidden?}>", "applicationsCount", "groups", "groupsCount", "foldersAndModels?", "foldersAndModelsCount?", "foldersAndModelsOmitted?", "models?", "modelsCount?", "modelsOmitted?", "tablesHint?", "applicationCode", "applicationResolution", "readiness", "detectedVersion", "inAnchorFamily", "versionSource", "versionFamily", "anchorVersion", "partition:{family,confidence,matched}", "versionNotice?", "environmentFingerprint", "fingerprintHint?", "platform:{productVersion,buildTime?,licenseType?,licenseExpiration?,source,licenseFaceUnavailable?,extensionBuildShaUnavailable?}|{versionUnavailable}", "detailArtifactId?"],
|
|
15
|
+
keys: ["applications:array<{code,name,groupId?,groupName?,groupNameRaw?,groupNameMojibake?,portalHidden?}>", "applicationsCount", "groups:array<{id,code,name,nameRaw?,nameMojibake?,isFallback}>", "groupsCount", "foldersAndModels?", "foldersAndModelsCount?", "foldersAndModelsOmitted?", "models?", "modelsCount?", "modelsOmitted?", "tablesHint?", "applicationCode", "applicationResolution", "readiness", "detectedVersion", "inAnchorFamily", "versionSource", "versionFamily", "anchorVersion", "partition:{family,confidence,matched}", "versionNotice?", "environmentFingerprint", "fingerprintHint?", "platform:{productVersion,buildTime?,licenseType?,licenseExpiration?,source,licenseFaceUnavailable?,extensionBuildShaUnavailable?}|{versionUnavailable}", "detailArtifactId?"],
|
|
16
16
|
notes: [
|
|
17
17
|
"applications/groups 内联;foldersAndModels/models 外置时是 null + *Omitted:true(不是 [])",
|
|
18
|
+
"groups[].name 是展示值:平台数据双编码(如 all 回 全部)被保守还原时带 nameRaw(平台原文)+ nameMojibake:true;应用行同源带 groupNameRaw/groupNameMojibake",
|
|
18
19
|
"environmentFingerprint 用途见 fingerprintHint(写前漂移/计划绑定/读缓存键,非审批令牌)",
|
|
19
20
|
"detectedVersion/inAnchorFamily/versionSource 与 doctor/fingerprint 同源",
|
|
20
21
|
"platform.productVersion 是原始版本串(如 AI-Platform-v1.1.25);buildTime 只有平台回传才有(8.6.26 info() 从不赋值)、扩展 build sha 无端点(extensionBuildShaUnavailable)",
|
package/dist/recipes/datarule.js
CHANGED
|
@@ -18,6 +18,7 @@ const submitCrossFieldCheck = Object.freeze({
|
|
|
18
18
|
},
|
|
19
19
|
preconditions: [
|
|
20
20
|
"需求是**提交时跨字段校验并弹提示拦截**(A 字段与 B 字段的比较)——这有**配置正解**,先于在线 JS onValidate 考虑(在线 JS 只在该协议确实表达不了时用)。",
|
|
21
|
+
"**执行面**:本规则默认只在**门户表单提交**时由前端执行;CLI `data.submit`/`data.save`(REST runtime/form 路径)对**非空值**不执行条件校验(字段为空时平台仍会走空值/必填校验);2.1.5 独有的 `validateHiddenProperties` 隐藏字段校验在 2.1.x submit 面会执行、8.6.26/8.7 不执行。CLI 侧只能用 `datarule.list` 核对配置,验收必须在门户点验;要在服务端强制拦截请改用业务规则。",
|
|
21
22
|
"比较符支持:等于/不等于/大于/大于等于/小于/小于等于/包含/属于/介于 等(中文或符号)。",
|
|
22
23
|
],
|
|
23
24
|
conditionalRequirements: [
|
package/dist/recipes/form.js
CHANGED
|
@@ -53,7 +53,7 @@ const formDraftTwoColumn = Object.freeze({
|
|
|
53
53
|
"**改既有表单**:优先用 `layout:{rows,...}`(见下,增量改行分组/span、不必回传整包 attrs);若要手写整包,先 `form.get full:true` 取 `publishedAttributesJson` 作基线(含 Title/Group/creater/createdTime/sequenceNo 系统控件),只改行分组与 span,不要把本配方的三字段最小布局直接盖上去。判据:`form.get full:true` 返回非空 publishedAttributesJson(或 published:true)→ 既有表单,受 form-publish-degrade 约束;无表单行 / publishedAttributesJson 为空或 \"{}\" → 新建表单,本配方可直接用。",
|
|
54
54
|
],
|
|
55
55
|
conditionalRequirements: [
|
|
56
|
-
"**改既有表单可用增量布局(不必回传整包 attrs)**:`form.draft {layout:{rows:[[\"visitNo\",\"customer\"],[\"remark\"]], spans:{visitNo:12,customer:12,remark:24}}}` 以已发布(无则草稿)表单为基线,只改这些控件的行分组与 span——其它控件/属性/HTML 逐键保留;未列入 rows 的控件(含 Title/Group/creater/createdTime/sequenceNo 等系统控件)保留原行,系统控件要移动须显式 `includeSystem:true`。layout 与 draftViewJson/draftAttributesJson/rebuild 互斥。列数仍由行分组决定,spans 省略时按行均分 24",
|
|
56
|
+
"**改既有表单可用增量布局(不必回传整包 attrs)**:`form.draft {layout:{rows:[[\"visitNo\",\"customer\"],[\"remark\"]], spans:{visitNo:12,customer:12,remark:24}}}` 以已发布(无则草稿)表单为基线,只改这些控件的行分组与 span——其它控件/属性/HTML 逐键保留;未列入 rows 的控件(含 Title/Group/creater/createdTime/sequenceNo 等系统控件)保留原行,系统控件要移动须显式 `includeSystem:true`。layout 与 draftViewJson/draftAttributesJson/rebuild/fieldCodes/childColumns/refreshFromFields/fromReadback 互斥。列数仍由行分组决定,spans 省略时按行均分 24",
|
|
57
57
|
"**列数由行分组决定,不由 span 决定**:一行放几个 code 就是几列;span 只控制控件在行内的 24 栅格宽度,且必须与行分组自洽(两列 span:12+12,整宽 span:24)",
|
|
58
58
|
"draftAttributesJson 的每个控件的 `options` 必须是**对象**,不能是 JSON 字符串(否则运行时写 options.name_i18n 抛错、整页空白)",
|
|
59
59
|
"**控件 type 是表单控件枚举,不是字段 propertyType**:1=单行文本, 2=多行文本, 3=日期, 4=数值, 5=单选, 6=复选, 7=下拉, 8=逻辑, 80=关联单选, 81=关联多选, 201=子表 …;对应 propertyType 0/1/3/2/12/13/14/4/9/11/8。错枚举默认拒 `form-control-type-mismatch`(逃生 allowTypeMismatch:true)",
|
|
@@ -85,7 +85,7 @@ const formDraftTwoColumn = Object.freeze({
|
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
code: "form-layout-param-conflict",
|
|
88
|
-
action: "layout 与 draftViewJson/draftAttributesJson/rebuild/fieldCodes 互斥:只改行分组与 span 用 layout;整表重搭或整包回写才用 draft*Json/rebuild",
|
|
88
|
+
action: "layout 与 draftViewJson/draftAttributesJson/rebuild/fieldCodes/childColumns/refreshFromFields/fromReadback 互斥:只改行分组与 span 用 layout;整表重搭或整包回写才用 draft*Json/rebuild。要加子表列的正确顺序:① 先 `form.publish {rebuild:true}` 把子表列物化进已发布表单;② 再 `form.draft {layout}`(baseline=published);③ 再 `form.publish`",
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
code: "form-publish-degrade",
|
|
@@ -174,9 +174,9 @@ const dataDeleteSweep = Object.freeze({
|
|
|
174
174
|
"**行数以 data.list total 为准,别按「N 提交=2N 行」外推**:带流程的 submit 原地推进同一行(r28b 实测 3→3);双行只在平台另起草稿行时出现(r30 的 5→10)",
|
|
175
175
|
],
|
|
176
176
|
conditionalRequirements: [
|
|
177
|
-
"批量 `bizObjectIds` 所有版本都放行(单次上限 200,超限分块串行),但必须看删后回读:成功判据是 `undeletedIds`
|
|
178
|
-
"删完逐条 `data.load` 确认 `exists:false`(`absent:true` / `modelResidue.total` 递减都不是删除成功的证明);最后再 `data.list` 复验 total:0。批量回执的 deletedCount
|
|
179
|
-
"id
|
|
177
|
+
"批量 `bizObjectIds` 所有版本都放行(单次上限 200,超限分块串行),但必须看删后回读:成功判据是 `undeletedIds` 与 `notInSchema` 均为空(`deletionVerified:true`),**不是** `remainingRows`/`clean`(整表状态,删一部分时 clean:false 正常)。出现 `undeletedIds`/`batchDeleteIneffective`(1.1.25 已知批量假成功:回执成功但行仍在)→ 对这些 id 改用单条 `bizObjectId` 重试(可 `--args-list` 一次跑多条单删)",
|
|
178
|
+
"删完逐条 `data.load` 确认 `exists:false`(`absent:true` / `modelResidue.total` 递减都不是删除成功的证明);最后再 `data.list` 复验 total:0。批量回执的 deletedCount/已删条数、alreadyAbsentCount/本来不存在条数与 notInSchema/不属于该模型条数要能对上",
|
|
179
|
+
"删前读不到该 id 默认回 `uncertain` + `delete-target-not-in-schema`(零删除 wire,可能 schemaCode 写错);确认并发已删、要做幂等重复清理时必须显式 `allowAlreadyAbsent:true`,并自行保证 schemaCode 正确",
|
|
180
180
|
],
|
|
181
181
|
priorToolReferences: [
|
|
182
182
|
{ tool: "data.list", args: { environment, schemaCode: model }, purpose: "取全量 ids(含 DRAFT 行),再拆成逐条 bizObjectId" },
|
|
@@ -184,7 +184,7 @@ const dataDeleteSweep = Object.freeze({
|
|
|
184
184
|
dryRun: {
|
|
185
185
|
supported: true,
|
|
186
186
|
command: `omc call data.delete --env ${environment} --args-list '[{"schemaCode":"${model}","bizObjectId":"<id1>"},{"schemaCode":"${model}","bizObjectId":"<id2>"}]'`,
|
|
187
|
-
notes: "多条用 bizObjectIds(所有版本放行,单次上限 200;删后逐条回读,dry-run 回执给 estimatedWireCalls≈3N+1);若回执报 batch-delete-ineffective/undeletedIds,用 --args-list 对未删 id 逐条单删。成功判据是 undeletedIds
|
|
187
|
+
notes: "多条用 bizObjectIds(所有版本放行,单次上限 200;删后逐条回读,dry-run 回执给 estimatedWireCalls≈3N+1);若回执报 batch-delete-ineffective/undeletedIds,用 --args-list 对未删 id 逐条单删。成功判据是 undeletedIds 与 notInSchema 均为空,不是 remainingRows/clean;删前读不到默认 uncertain,幂等重复清理需显式 allowAlreadyAbsent:true",
|
|
188
188
|
},
|
|
189
189
|
expectedReadback: {
|
|
190
190
|
readback: { deleted: true, exists: false },
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 下游提前关闭管道时的收尾(探针 I F10,0.8.15)。
|
|
3
|
+
*
|
|
4
|
+
* `omc … | head -c 3000` 这类用法会在下游读够后关闭读端。之后 CLI 再写
|
|
5
|
+
* stdout 会拿到 EPIPE:Node 默认把它当作**未处理的流错误**抛出,在
|
|
6
|
+
* `2>&1` 合流时堆栈本身又要写回同一个已关闭的管道,表现为「不返回」或
|
|
7
|
+
* 带堆栈的假失败。EPIPE 在这里不是故障——是消费方叫停,正确语义是安静
|
|
8
|
+
* 收工。本节把两处兜住:
|
|
9
|
+
*
|
|
10
|
+
* 1. `process.stdout.on("error")`:异步 EPIPE(write 调用已返回);
|
|
11
|
+
* 2. 包一层 `process.stdout.write`:已销毁的流可能**同步**抛
|
|
12
|
+
* ERR_STREAM_DESTROYED/EPIPE。
|
|
13
|
+
*
|
|
14
|
+
* 退出码选 **0**:下游拿到它要的字节后主动关闭,与 `grep -q`、`head` 的
|
|
15
|
+
* 预期一致(141 = SIGPIPE 也行,但会让 `set -o pipefail` 的脚本把一次
|
|
16
|
+
* 正常的提前截断读成失败)。非管道类错误不吞:重新抛给默认处理器。
|
|
17
|
+
*
|
|
18
|
+
* stderr 只吞管道关闭错误、不退出——诊断丢了不影响命令结果。
|
|
19
|
+
*
|
|
20
|
+
* 范围刻意收窄:「写完又写」(ERR_STREAM_WRITE_AFTER_END)不是下游关闭,
|
|
21
|
+
* 是调用方编程错误,仍按默认可见性抛出(保留堆栈)。
|
|
22
|
+
*/
|
|
23
|
+
// 只认「下游关闭」。ERR_STREAM_WRITE_AFTER_END 是**写完又写**的编程错误,
|
|
24
|
+
// 不在此列——必须按非管道错误重抛,别用安静 exit 0 把它掩盖。
|
|
25
|
+
const PIPE_CLOSED_CODES = new Set(["EPIPE", "ECONNRESET", "ERR_STREAM_DESTROYED"]);
|
|
26
|
+
function pipeClosed(error) {
|
|
27
|
+
const code = error?.code;
|
|
28
|
+
return typeof code === "string" && PIPE_CLOSED_CODES.has(code);
|
|
29
|
+
}
|
|
30
|
+
/** 下游已关:安静且立即退出(0)。 */
|
|
31
|
+
function exitQuietly() {
|
|
32
|
+
process.exitCode = 0;
|
|
33
|
+
process.exit(0);
|
|
34
|
+
}
|
|
35
|
+
let installed = false;
|
|
36
|
+
export function installStdoutPipeGuard() {
|
|
37
|
+
if (installed)
|
|
38
|
+
return;
|
|
39
|
+
installed = true;
|
|
40
|
+
process.stdout.on("error", (error) => {
|
|
41
|
+
if (pipeClosed(error))
|
|
42
|
+
exitQuietly();
|
|
43
|
+
// 非管道关闭错误保持默认可见性(异步抛,避免从事件处理器里同步打断)。
|
|
44
|
+
process.nextTick(() => {
|
|
45
|
+
throw error;
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
process.stderr.on("error", (error) => {
|
|
49
|
+
if (pipeClosed(error))
|
|
50
|
+
return;
|
|
51
|
+
process.nextTick(() => {
|
|
52
|
+
throw error;
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
const originalStdoutWrite = process.stdout.write.bind(process.stdout);
|
|
56
|
+
process.stdout.write = ((chunk, encodingOrCb, maybeCb) => {
|
|
57
|
+
try {
|
|
58
|
+
return originalStdoutWrite(chunk, encodingOrCb, maybeCb);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
if (pipeClosed(error))
|
|
62
|
+
exitQuietly();
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
const originalStderrWrite = process.stderr.write.bind(process.stderr);
|
|
67
|
+
process.stderr.write = ((chunk, encodingOrCb, maybeCb) => {
|
|
68
|
+
try {
|
|
69
|
+
return originalStderrWrite(chunk, encodingOrCb, maybeCb);
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
if (pipeClosed(error))
|
|
73
|
+
return true;
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=stdout-pipe.js.map
|
package/dist/tool-types.js
CHANGED
|
@@ -160,6 +160,16 @@ export function inputAliasSynonymKeys(toolName) {
|
|
|
160
160
|
export const REQUIRED_ALTERNATIVE_PLACEHOLDER = "__omc-required-alternative__";
|
|
161
161
|
const TOOL_INPUT_REQUIRED_ALTERNATIVES = Object.freeze({
|
|
162
162
|
"rule.list": Object.freeze({ schemaCode: "schemaCodes" }),
|
|
163
|
+
// F7(0.8.15,探针 I):workflow.delete 的读面同族都吃 workflowCode,真机
|
|
164
|
+
// `workflow.delete {workflowCode}` 却只回 `schemaCode:需要字符串`。让只给流程码
|
|
165
|
+
// 的调用方通过必填面(占位符),handler 用 workflow/get_published 一次读反查所属
|
|
166
|
+
// 模型(平台 getPublished 会 setSchemaCode 回模板)。requiredArgs 保持不变,
|
|
167
|
+
// commands 目录/golden 不漂移。
|
|
168
|
+
"workflow.delete": Object.freeze({ schemaCode: "code" }),
|
|
169
|
+
// 0.8.15 F9:field.get 的 `code` 保持必填(commands 目录/golden 的必填面不动),
|
|
170
|
+
// 只传 `fields[]`(多字段批量读)时补占位值,handler 剥掉占位后走 field.list
|
|
171
|
+
// 的 fields 选择器。两者同传由 inputRefine 明确拒绝。
|
|
172
|
+
"field.get": Object.freeze({ code: "fields" }),
|
|
163
173
|
});
|
|
164
174
|
/** 该工具的这个规范键是否由备选键填充(handler 用来区分「用户真传了」与占位)。 */
|
|
165
175
|
export function isRequiredAlternativePlaceholder(value) {
|
package/dist/write.js
CHANGED
|
@@ -19,8 +19,8 @@ import { isUncertainWireError, sha256, wireErrorKind, writeArtifact } from "./su
|
|
|
19
19
|
import { appendJournalEntry } from "./journal.js";
|
|
20
20
|
import { journalAudit } from "./write-audit.js";
|
|
21
21
|
import { capabilityArg, confirmProductionArg, environmentArg, WRITE_PROTOCOL } from "./args.js";
|
|
22
|
-
import { plannableArgsRaw } from "./plan.js";
|
|
23
|
-
import { defineTool, ToolRefusalError } from "./tool-types.js";
|
|
22
|
+
import { plannableArgs, plannableArgsRaw } from "./plan.js";
|
|
23
|
+
import { defineTool, isRequiredAlternativePlaceholder, ToolRefusalError } from "./tool-types.js";
|
|
24
24
|
import { assertFieldFamilyAllowed } from "./field-families.js";
|
|
25
25
|
import { validateBusinessCode, validateFieldEntryCodes } from "./code-rules.js";
|
|
26
26
|
import { hardLayoutViolations, validateFormLayout } from "./form-layout.js";
|
|
@@ -31,6 +31,33 @@ import { WireError, optionPublishMessages } from "./wire.js";
|
|
|
31
31
|
* The shared governed write pipeline and the low-level write registration
|
|
32
32
|
* factory every lane adapter uses.
|
|
33
33
|
*/
|
|
34
|
+
/**
|
|
35
|
+
* The required-alternative placeholder is a validation-time internal value, not
|
|
36
|
+
* a parameter fact. `admitGovernedWrite` builds the plan from the RAW args before
|
|
37
|
+
* `writeLint` runs; the lint may then resolve a placeholder into a real value
|
|
38
|
+
* (workflow.delete's schemaCode reverse lookup). The dry-run receipt must preview
|
|
39
|
+
* the RESOLVED action args — otherwise it shows `__omc-required-alternative__`
|
|
40
|
+
* as if it were a real schemaCode. Real writes / rollback / journal already read
|
|
41
|
+
* the resolved args, so they are untouched.
|
|
42
|
+
*/
|
|
43
|
+
function containsRequiredPlaceholder(value) {
|
|
44
|
+
if (isRequiredAlternativePlaceholder(value))
|
|
45
|
+
return true;
|
|
46
|
+
if (Array.isArray(value))
|
|
47
|
+
return value.some(containsRequiredPlaceholder);
|
|
48
|
+
if (value !== null && typeof value === "object")
|
|
49
|
+
return Object.values(value).some(containsRequiredPlaceholder);
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
function planWithResolvedArgs(plan, toolName, args) {
|
|
53
|
+
const unresolved = plan.actions.some((action) => action.tool === toolName && containsRequiredPlaceholder(action.args));
|
|
54
|
+
if (!unresolved)
|
|
55
|
+
return plan;
|
|
56
|
+
return {
|
|
57
|
+
...plan,
|
|
58
|
+
actions: plan.actions.map((action) => (action.tool === toolName ? { ...action, args: plannableArgs(toolName, args) } : action)),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
34
61
|
/**
|
|
35
62
|
* Shared governed write pipeline: coverage gate → environment write permission
|
|
36
63
|
* → session → version evidence (advisory: recorded as `versionEvidence:"absent"`,
|
|
@@ -69,7 +96,7 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
69
96
|
? (plan, session) => dryRunPayload(session, args).then((payload) => ({
|
|
70
97
|
status: "dry-run",
|
|
71
98
|
wouldChange: true,
|
|
72
|
-
plan,
|
|
99
|
+
plan: planWithResolvedArgs(plan, tool.name, args),
|
|
73
100
|
idempotency: idempotencyDeclaration(tool.name, "none"),
|
|
74
101
|
lintScope: lintDeclaration.lintScope,
|
|
75
102
|
...(lintDeclaration.lintUnchecked.length > 0 ? { unchecked: [...lintDeclaration.lintUnchecked] } : {}),
|
|
@@ -325,12 +352,29 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
325
352
|
const artifactRef = writeArtifact(ctx, `${tool.name}-${randomUUID().slice(0, 8)}.json`, artifact);
|
|
326
353
|
return { status: executed.status, steps: executed.steps, failedStep: executed.failedStep, ...executed.envelope, ...(args.requestId ? { requestId: args.requestId } : {}), artifactFingerprint: artifactRef.detailSha256 };
|
|
327
354
|
}
|
|
328
|
-
const { performed, readback, steps, halfSuccess, irreversible, rollbackReceipt, runtimeVerification, ruleStatus, serviceStatus } = executed;
|
|
355
|
+
const { performed, readback, steps, halfSuccess, irreversible, rollbackReceipt, runtimeVerification, ruleStatus, serviceStatus, status: producedStatus, blocker: producedBlocker, message: producedMessage, nextCommand: producedNextCommand, nextAction: producedNextAction, retryable: producedRetryable } = executed;
|
|
329
356
|
// Readback gate (live 2026-10-17): a tool that reports `readback.present:false`
|
|
330
357
|
// has NOT proven its own write — the platform accepted the request but the
|
|
331
358
|
// object is absent from the authoritative face. "Called without error" must
|
|
332
359
|
// never be stamped DELIVERED; downgrade to WRITE_UNVERIFIED and surface why.
|
|
333
|
-
const
|
|
360
|
+
const readbackGate = deliveryStateFor(readback);
|
|
361
|
+
// A producer-declared `uncertain` can never be DELIVERED either: it means the
|
|
362
|
+
// tool could not establish that the target belonged to the requested model
|
|
363
|
+
// (e.g. data.delete with a wrong schemaCode). Keep the gate's text when it
|
|
364
|
+
// already says something, otherwise use the producer's own diagnosis.
|
|
365
|
+
const writeStatus = producedStatus === "uncertain" ? "uncertain" : "ok";
|
|
366
|
+
const deliveryState = writeStatus === "uncertain" ? "WRITE_UNVERIFIED" : readbackGate.deliveryState;
|
|
367
|
+
// P1 复核:执行面的显式 uncertain 不能继承 `deliveryStateFor` 的 async 级联
|
|
368
|
+
// 文案——批量混合删除的 readback.absent=false 会被说成「删除级联中,稍后重跑」,
|
|
369
|
+
// 而真实结论是 delete-target-not-in-schema。生产者 blocker 优先。
|
|
370
|
+
const producedWarning = producedStatus === "uncertain"
|
|
371
|
+
? (producedBlocker !== undefined
|
|
372
|
+
? `本次调用未建立成功结论(${producedBlocker}):按 blocker/message/nextCommand 核对,勿当作已清理`
|
|
373
|
+
: producedMessage)
|
|
374
|
+
: undefined;
|
|
375
|
+
const readbackWarning = writeStatus === "uncertain"
|
|
376
|
+
? (producedWarning ?? "本次调用不代表成功(WRITE_UNVERIFIED):目标是否属于该模型/是否已删除未建立;按 message/nextCommand 先核对,勿宣称已清理")
|
|
377
|
+
: readbackGate.readbackWarning;
|
|
334
378
|
// Every production write echoes the explicit acknowledgement into the audit
|
|
335
379
|
// trail, so the record can always answer "was this a confirmed production
|
|
336
380
|
// write?".
|
|
@@ -368,7 +412,7 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
368
412
|
// timeline (reverting a no-op delete would try to "restore" something that
|
|
369
413
|
// never existed in this session).
|
|
370
414
|
const skipped = typeof performed.skipped === "string" ? performed.skipped : undefined;
|
|
371
|
-
const isNoopWrite = performed.noop === true || skipped === "already-absent" || skipped === "stale-record-cache";
|
|
415
|
+
const isNoopWrite = performed.noop === true || skipped === "already-absent" || skipped === "stale-record-cache" || skipped === "target-not-in-schema";
|
|
372
416
|
let rollbackRef;
|
|
373
417
|
if (tool.rollback && !isNoopWrite) {
|
|
374
418
|
const entry = appendJournalEntry(ctx.artifactsDir, {
|
|
@@ -390,8 +434,13 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
390
434
|
rollbackRef = { seq: entry.seq, hint: `omc rollback plan ${entry.seq}(--env ${entry.environment})` };
|
|
391
435
|
}
|
|
392
436
|
return {
|
|
393
|
-
status:
|
|
437
|
+
status: writeStatus,
|
|
394
438
|
deliveryState,
|
|
439
|
+
...(writeStatus === "uncertain" && producedBlocker !== undefined ? { blocker: producedBlocker } : {}),
|
|
440
|
+
...(writeStatus === "uncertain" && producedMessage !== undefined ? { message: producedMessage } : {}),
|
|
441
|
+
...(writeStatus === "uncertain" && producedNextCommand !== undefined ? { nextCommand: producedNextCommand } : {}),
|
|
442
|
+
...(writeStatus === "uncertain" && producedNextAction !== undefined ? { nextAction: producedNextAction } : {}),
|
|
443
|
+
...(writeStatus === "uncertain" && producedRetryable !== undefined ? { retryable: producedRetryable } : {}),
|
|
395
444
|
...((typeof performed.applicationCode === "string" ? { applicationCode: performed.applicationCode } : typeof readback.applicationCode === "string" ? { applicationCode: readback.applicationCode } : {})),
|
|
396
445
|
...(readOnlyEscapeNote !== undefined ? { readOnlyEscape: readOnlyEscapeNote } : {}),
|
|
397
446
|
performed,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.15",
|
|
4
4
|
"description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"commander": "14.0.3",
|
|
61
|
-
"omc-core": "0.8.
|
|
61
|
+
"omc-core": "0.8.15",
|
|
62
62
|
"proper-lockfile": "4.1.2",
|
|
63
63
|
"write-file-atomic": "6.0.0",
|
|
64
64
|
"zod": "^3.23.8",
|
|
@@ -76,6 +76,6 @@
|
|
|
76
76
|
"directory": "packages/omc-cli"
|
|
77
77
|
},
|
|
78
78
|
"optionalDependencies": {
|
|
79
|
-
"@stalfh233/omc-fake-platform": "0.8.
|
|
79
|
+
"@stalfh233/omc-fake-platform": "0.8.15"
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -135,7 +135,7 @@ rules:
|
|
|
135
135
|
datarules:
|
|
136
136
|
- { propertyCode: order_note, dataRuleType: 4, options: { requiredFormula: '{amount} 大于 {"valueType":"custom","value":5000}' }, name: 金额超5000说明必填 }
|
|
137
137
|
```
|
|
138
|
-
⚠️ **type 3/4/5 不驱动门户表单控件**(真机复核):平台存成 bizdatarule,只镜像进控件 `historyOpt`,运行时门户读的是控件 `options`。门户条件(如「金额>5000 时必填」)必须写在 `fields[].options`(`requiredFormula`/`readonlyCondition`/`shortTextStitch`);写进 `datarules[]` 设计器可见但门户不拦(validate/plan 给 `datarule-not-portal-facing` 警告)。datarule
|
|
138
|
+
⚠️ **type 3/4/5 不驱动门户表单控件**(真机复核):平台存成 bizdatarule,只镜像进控件 `historyOpt`,运行时门户读的是控件 `options`。门户条件(如「金额>5000 时必填」)必须写在 `fields[].options`(`requiredFormula`/`readonlyCondition`/`shortTextStitch`);写进 `datarules[]` 设计器可见但门户不拦(validate/plan 给 `datarule-not-portal-facing` 警告)。datarule 只用于服务端引擎(校验/计算)。未声明 `sortKey` = 顺序归平台、不参与比较;显式声明才严格比较。
|
|
139
139
|
|
|
140
140
|
- 规则排在字段发布之后(编译器按能力排序:先建全部模型/字段,再跑规则)。
|
|
141
141
|
- `rule.save` 只写草稿;`enabled` 由 `rule.enable` 保证(publish+启用)——readback 用 `enabled` 和**语义图摘要**(忽略画布几何)判等价。
|
|
@@ -87,7 +87,7 @@ only the section for the capability you need —
|
|
|
87
87
|
- **单据号/自动编号(原生,勿二开)**:自建单据号字段是 `field.create` 的 `SHORT_TEXT + options.formPropertyType:100 + options.seqNoSetting` 分段构建器(CONSTANT/DELIMITER/DATE/PROPERTY/SEQNO/UID 段);DATAITEM 不是段类型,而是设计师 UI 的 resetDate 显示值。SEQNO 段 `resetDate:DAY/MONTH/YEAR` 原生按期重置——`describe field.create --example field-serial-number`。**不要落 SequenceService SPI 二开**(真机 r50 + 8.6.26 反编译证据,2026-11-10);编号生成时机=submit(`data.save` 不生成)。系统 `sequenceNo` 控件另为 objectId 双轨,勿混淆。
|
|
88
88
|
|
|
89
89
|
- **能做哪些事**:字段族全链 create→publish→表单绑定;**CHILD_TABLE 子表**(子列是 schemaCode=父字段 code 上的普通字段);**计算字段**(默认用普通字段 + 「计算规则」,见下)。
|
|
90
|
-
- **工具**:`field.get
|
|
90
|
+
- **工具**:`field.get`(单字段/多字段读 = `field.list` + `code` 或 `fields[]` 选择器)、`field.list`、`field.create`、`field.update`、`field.publish`、`field.delete`
|
|
91
91
|
- **recipe**:
|
|
92
92
|
- `omc describe field.create --example numeric-two-decimals`(数值 + scale)
|
|
93
93
|
- `omc describe field.create --example dictionary-backed-single-select`
|