@stalfh233/omc-cli 0.8.5 → 0.8.6
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/bench/scenario.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/code-rules.js +116 -4
- package/dist/coverage.js +2 -1
- package/dist/discovery.js +8 -2
- package/dist/goal-routes.js +35 -5
- package/dist/human-summary.js +19 -1
- package/dist/intent/capabilities/field.js +1 -1
- package/dist/lanes/form.js +1 -1
- package/dist/lanes/list-view.js +19 -11
- package/dist/lanes/model-contract.js +2 -2
- package/dist/lanes/model.js +34 -20
- package/dist/lanes/runtime-data-contract.js +3 -3
- package/dist/lanes/runtime-data.js +18 -6
- package/dist/lanes/workflow.js +66 -1
- package/dist/model-purge.js +1 -1
- package/dist/model-scaffold.js +6 -3
- package/dist/recipes/runtime-data.js +1 -1
- package/dist/residue.js +1 -1
- package/dist/version-family-gaps.js +33 -6
- package/dist/write.js +34 -8
- package/package.json +3 -3
- package/skills/omc-business-configuration.md +1 -0
- package/skills/omc-refusals.md +4 -2
package/dist/bench/scenario.js
CHANGED
|
@@ -308,7 +308,7 @@ export async function runScenario(harness) {
|
|
|
308
308
|
// nonces, so a slow or partially-orphaned cascade cannot block the next
|
|
309
309
|
// run (orphaned default data items are undeletable — 301012).
|
|
310
310
|
// Ticket 23: the order is dependency-inverted (d→p→c). Back-to-back
|
|
311
|
-
// deletes race the previous model's
|
|
311
|
+
// deletes race the previous model's async cascade (duration unbounded):
|
|
312
312
|
// live evidence shows the p/c deletes can come back refused
|
|
313
313
|
// (model-referenced-by while the relation columns still exist, or a
|
|
314
314
|
// transient wire-business envelope while the engine is busy) — wait and
|
package/dist/cli.js
CHANGED
|
@@ -3529,7 +3529,7 @@ async function main() {
|
|
|
3529
3529
|
const rest = ["rule-when", ...(options.schema ? ["--schema", options.schema] : []), ...(options.schemaCode ? ["--schema-code", options.schemaCode] : []), ...(options.on ? ["--on", options.on] : []), ...(Array.isArray(options.when) ? options.when.flatMap((w) => ["--when", w]) : []), ...(Array.isArray(options.then) ? options.then.flatMap((a) => ["--then", a]) : []), ...(options.name ? ["--name", options.name] : []), ...(options.env ? ["--env", options.env] : []), ...(options.environment ? ["--environment", options.environment] : []), ...(options.apply ? ["--apply"] : [])];
|
|
3530
3530
|
commandExitCode = await cmdRuleWhen(rest);
|
|
3531
3531
|
});
|
|
3532
|
-
command.command("approval-flow").option("--schema <schemaCode>").option("--schema-code <schemaCode>").addOption(new Option("--steps <step>", "
|
|
3532
|
+
command.command("approval-flow").option("--schema <schemaCode>").option("--schema-code <schemaCode>").addOption(new Option("--steps <step>", "审批步骤,可重复;`节点名@role:<角色code>` 或 `节点名@user:<userId>`").argParser(collectValues).default([])).option("--env <environment>").option("--environment <environment>").option("--apply").option("--no-originator-node").option("--no-reject-to-start").addHelpText("after", "\n审批流拼装器:--steps 名称@role:<角色code> 或 节点名@user:<userId>(多级给多个)。编译为验证模板(START→填写→审批链→END,审批节点字段只读),--apply 建流+权限+发布。\n`@user:` 适合单账号/角色无成员环境;role 参与者按 OU 解析,先 `org.role.users` 复核。\n边界:非发起人身份的审批无法在单会话 CLI 内推进(单 token);若要验跨账号审批,用第二账号另建环境,或把参与人设为 {Originator}。\n").action(async (options) => {
|
|
3533
3533
|
const rest = ["approval-flow", ...(options.schema ? ["--schema", options.schema] : []), ...(options.schemaCode ? ["--schema-code", options.schemaCode] : []), ...(Array.isArray(options.steps) ? options.steps.flatMap((s) => ["--steps", s]) : []), ...(options.env ? ["--env", options.env] : []), ...(options.environment ? ["--environment", options.environment] : []), ...(options.apply ? ["--apply"] : []), ...(options.originatorNode === false ? ["--no-originator-node"] : []), ...(options.rejectToStart === false ? ["--no-reject-to-start"] : [])];
|
|
3534
3534
|
commandExitCode = await cmdApprovalFlow(rest);
|
|
3535
3535
|
});
|
package/dist/code-rules.js
CHANGED
|
@@ -13,9 +13,18 @@ const CODE_PATTERNS = {
|
|
|
13
13
|
lower_snake: /^[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/u,
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* never claim (they are minted by the platform; reusing one
|
|
18
|
-
* engine's own columns). Mirrors base3.0's reserved sets.
|
|
16
|
+
* Group 1 — main-table system / audit column codes a business-authored model
|
|
17
|
+
* or field must never claim (they are minted by the platform; reusing one
|
|
18
|
+
* collides with the engine's own columns). Mirrors base3.0's reserved sets.
|
|
19
|
+
*
|
|
20
|
+
* Backend enum `DefaultPropertyType` (the same 14 codes in both builds):
|
|
21
|
+
* - 8.6.26: cp-sources/backend/decompiled-full/launcher-8.6.26/cloudpivot-shared-8.6.26/
|
|
22
|
+
* com/authine/cloudpivot/metadata/bizmodel/DefaultPropertyType.java:16-29
|
|
23
|
+
* - 2.1.5 : .../launcher-2.1.5/cloudpivot-contracts-AI-Platform-v2.1.5/
|
|
24
|
+
* com/authine/cloudpivot/metadata/bizmodel/DefaultPropertyType.java:16-29
|
|
25
|
+
* Checked by `BizPropertyManagerImpl.validateNotEqualDefaultPropertyCode`
|
|
26
|
+
* (8.6.26 :1017-1020; 2.1.5 :1048-1051), i.e. on every property created or
|
|
27
|
+
* renamed through the property manager (child columns included).
|
|
19
28
|
*/
|
|
20
29
|
export const RESERVED_CODES = new Set([
|
|
21
30
|
"id",
|
|
@@ -33,6 +42,61 @@ export const RESERVED_CODES = new Set([
|
|
|
33
42
|
"ownerDeptQueryCode",
|
|
34
43
|
"version",
|
|
35
44
|
].map((code) => code.toLowerCase()));
|
|
45
|
+
/**
|
|
46
|
+
* Group 2a — platform EXTENDED property codes (`DefaultPropertyExtendType`).
|
|
47
|
+
* Not plain audit columns: they are the display-name companions the engine
|
|
48
|
+
* maintains next to `creater`/`owner`/`modifier`, so a business field claiming
|
|
49
|
+
* one collides with platform-managed data. Same five codes in both builds:
|
|
50
|
+
* - 8.6.26: .../launcher-8.6.26/cloudpivot-shared-8.6.26/
|
|
51
|
+
* com/authine/cloudpivot/metadata/bizmodel/DefaultPropertyExtendType.java:9-13
|
|
52
|
+
* - 2.1.5 : .../launcher-2.1.5/cloudpivot-contracts-AI-Platform-v2.1.5/
|
|
53
|
+
* com/authine/cloudpivot/metadata/bizmodel/DefaultPropertyExtendType.java:9-13
|
|
54
|
+
* Checked (equalsIgnoreCase) by validateNotEqualDefaultPropertyCode
|
|
55
|
+
* (8.6.26 :1021-1024; 2.1.5 :1052-1055) — 301014 on the platform.
|
|
56
|
+
*/
|
|
57
|
+
export const RESERVED_EXTEND_CODES = new Set([
|
|
58
|
+
"createdName",
|
|
59
|
+
"createdDeptName",
|
|
60
|
+
"ownerName",
|
|
61
|
+
"ownerDeptName",
|
|
62
|
+
"modifiedName",
|
|
63
|
+
].map((code) => code.toLowerCase()));
|
|
64
|
+
/**
|
|
65
|
+
* Group 2b — engine-internal reserved words (`INTERNAL_RESERVED_WORDS_LOWERCASE`).
|
|
66
|
+
* Not enum members: a literal lowercase set hit with `code.toLowerCase()`.
|
|
67
|
+
* - 8.6.26: .../launcher-8.6.26/cloudpivot-metadata-8.6.26/
|
|
68
|
+
* com/authine/cloudpivot/metadata/BizPropertyManagerImpl.java:129 (set),
|
|
69
|
+
* checked at :1025-1027
|
|
70
|
+
* - 2.1.5 : .../launcher-2.1.5/cloudpivot-metadata-AI-Platform-v2.1.5/
|
|
71
|
+
* com/authine/cloudpivot/metadata/BizPropertyManagerImpl.java:109 (set),
|
|
72
|
+
* checked at :1056-1058
|
|
73
|
+
*/
|
|
74
|
+
export const RESERVED_INTERNAL_CODES = new Set([
|
|
75
|
+
"parentworkflowinstanceid",
|
|
76
|
+
"sheetbizobjectid",
|
|
77
|
+
]);
|
|
78
|
+
/**
|
|
79
|
+
* Group 3 — SUB-TABLE-only reserved columns (`DefaultSubPropertyType`). The
|
|
80
|
+
* platform checks this enum ONLY when `getBizSchema().isSubSchema()` is true
|
|
81
|
+
* (8.6.26 BizPropertyManagerImpl.java:1028-1033; 2.1.5 :1059-1063), so a
|
|
82
|
+
* main-table field may legitimately be called `parentId`/`sortKey`.
|
|
83
|
+
*
|
|
84
|
+
* Child columns ride `BizPropertyFacadeImpl.save` → `subSchema.addProperty`
|
|
85
|
+
* (8.6.26 history/bizmodel/BizPropertyFacadeImpl.java:86-89; 2.1.5 :75-78), so
|
|
86
|
+
* they get group 1+2 as well; the sub-only increment is `parentId` + `sortKey`
|
|
87
|
+
* (the enum's `id/modifier/modifiedTime/version` are already in group 1).
|
|
88
|
+
*
|
|
89
|
+
* Enum: 8.6.26 .../cloudpivot-shared-8.6.26/.../DefaultSubPropertyType.java:12-17;
|
|
90
|
+
* 2.1.5 .../cloudpivot-contracts-AI-Platform-v2.1.5/.../DefaultSubPropertyType.java:12-17.
|
|
91
|
+
*/
|
|
92
|
+
export const RESERVED_SUBTABLE_CODES = new Set([
|
|
93
|
+
"id",
|
|
94
|
+
"parentId",
|
|
95
|
+
"sortKey",
|
|
96
|
+
"modifier",
|
|
97
|
+
"modifiedTime",
|
|
98
|
+
"version",
|
|
99
|
+
].map((code) => code.toLowerCase()));
|
|
36
100
|
/**
|
|
37
101
|
* SQL 关键字(MySQL 未加引号时的保留字)。平台在 wire 才拒绝(10033
|
|
38
102
|
* 编码[order]为SQL关键字),这里前置到与 code 格式同层,省一轮建了再改。
|
|
@@ -50,6 +114,19 @@ export function inferCodeStyle(code) {
|
|
|
50
114
|
return CODE_PATTERNS.lower_snake.test(code) ? "lower_snake" : null;
|
|
51
115
|
return CODE_PATTERNS.lowerCamel.test(code) ? "lowerCamel" : null;
|
|
52
116
|
}
|
|
117
|
+
/** True when the code is reserved for the given kind/scope (mirrors the backend checks). */
|
|
118
|
+
function reservedClassification(lowerCode, options) {
|
|
119
|
+
if (RESERVED_CODES.has(lowerCode))
|
|
120
|
+
return "main";
|
|
121
|
+
// Group 1 also covers model codes (existing local behaviour). Groups 2/3 are
|
|
122
|
+
// property-code checks on the platform (`validateAddProperty`), so they apply
|
|
123
|
+
// to fields only — a model named `ownerName` is not a platform collision.
|
|
124
|
+
if (options.kind === "field" && (RESERVED_EXTEND_CODES.has(lowerCode) || RESERVED_INTERNAL_CODES.has(lowerCode)))
|
|
125
|
+
return "extended";
|
|
126
|
+
if (options.kind === "field" && options.subTable === true && RESERVED_SUBTABLE_CODES.has(lowerCode))
|
|
127
|
+
return "subtable";
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
53
130
|
/** Returns the (normalized) violations; an empty array means the code is valid. */
|
|
54
131
|
export function validateBusinessCode(rawCode, options) {
|
|
55
132
|
const maxLength = options.kind === "model" ? MODEL_CODE_MAX_LENGTH : FIELD_CODE_MAX_LENGTH;
|
|
@@ -69,8 +146,21 @@ export function validateBusinessCode(rawCode, options) {
|
|
|
69
146
|
else if (!detected) {
|
|
70
147
|
violations.push({ code, classification: "code_style", message: `code "${code}" 既不是 lowerCamel 也不是 lower_snake(须以字母开头,仅含字母/数字/下划线,且不得连续或结尾下划线)` });
|
|
71
148
|
}
|
|
72
|
-
|
|
149
|
+
const reserved = reservedClassification(code.toLowerCase(), options);
|
|
150
|
+
if (reserved === "main")
|
|
73
151
|
violations.push({ code, classification: "code_reserved", message: `code "${code}" 是平台系统/保留字段编码,业务模型与字段不得使用(会与平台自身列冲突)` });
|
|
152
|
+
else if (reserved === "extended")
|
|
153
|
+
violations.push({
|
|
154
|
+
code,
|
|
155
|
+
classification: "code_reserved",
|
|
156
|
+
message: `code "${code}" 是平台扩展/内部保留字段编码(DefaultPropertyExtendType / INTERNAL_RESERVED_WORDS_LOWERCASE,如 ownerName、createdName、parentworkflowinstanceid、sheetbizobjectid),平台会报 301014;平台自动维护该列,业务字段不得占用`,
|
|
157
|
+
});
|
|
158
|
+
else if (reserved === "subtable")
|
|
159
|
+
violations.push({
|
|
160
|
+
code,
|
|
161
|
+
classification: "code_reserved",
|
|
162
|
+
message: `code "${code}" 是子表(CHILD_TABLE)平台保留列(DefaultSubPropertyType,如 parentId、sortKey),子表列不得使用(平台报 301014);主表字段不受此组限制`,
|
|
163
|
+
});
|
|
74
164
|
if (SQL_KEYWORD_CODES.has(code.toLowerCase()))
|
|
75
165
|
violations.push({
|
|
76
166
|
code,
|
|
@@ -83,4 +173,26 @@ export function validateBusinessCode(rawCode, options) {
|
|
|
83
173
|
export function businessCodeValid(rawCode, options) {
|
|
84
174
|
return validateBusinessCode(rawCode, options).length === 0;
|
|
85
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* Validate a field entry's code AND (when it is a CHILD_TABLE) its sub-column
|
|
178
|
+
* codes. Child columns are ordinary properties on the sub-schema, so the
|
|
179
|
+
* platform runs the same `validateNotEqualDefaultPropertyCode` over them
|
|
180
|
+
* (BizPropertyFacadeImpl.save → subSchema.addProperty); only the sub-table-only
|
|
181
|
+
* group is extra. Missing/non-string codes are left to the shape gates.
|
|
182
|
+
*/
|
|
183
|
+
export function validateFieldEntryCodes(entry) {
|
|
184
|
+
const violations = [];
|
|
185
|
+
if (typeof entry.code === "string")
|
|
186
|
+
violations.push(...validateBusinessCode(entry.code, { kind: "field" }));
|
|
187
|
+
if (Array.isArray(entry.subFields)) {
|
|
188
|
+
for (const sub of entry.subFields) {
|
|
189
|
+
if (!sub || typeof sub !== "object")
|
|
190
|
+
continue;
|
|
191
|
+
const subCode = sub.code;
|
|
192
|
+
if (typeof subCode === "string")
|
|
193
|
+
violations.push(...validateBusinessCode(subCode, { kind: "field", subTable: true }));
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return violations;
|
|
197
|
+
}
|
|
86
198
|
//# sourceMappingURL=code-rules.js.map
|
package/dist/coverage.js
CHANGED
|
@@ -127,7 +127,8 @@ export function versionFamilyNotice(manifest, detectedVersion) {
|
|
|
127
127
|
return undefined;
|
|
128
128
|
return (`兼容模式:检测到 CloudPivot ${detectedVersion},不在 OMC 锚定的 ${manifest.version_family} 族` +
|
|
129
129
|
`(锚点 ${manifest.anchor_version})。OMC 基于 8.6 构建,非 8.6 环境按兼容支持,部分能力面可能不适用。` +
|
|
130
|
-
`取证口径:以本环境真机实测为准,8.6 文档与反编译结论仅作参考。`
|
|
130
|
+
`取证口径:以本环境真机实测为准,8.6 文档与反编译结论仅作参考。` +
|
|
131
|
+
`族差异清单见 docs/platform-contracts/2.1-delta.md(逐条带 file:line;未登记的条目按实测,不臆断同形或不同形)。`);
|
|
131
132
|
}
|
|
132
133
|
/**
|
|
133
134
|
* 无版本证据时的兼容提示(2026-11-24 产品口径)。
|
package/dist/discovery.js
CHANGED
|
@@ -276,7 +276,7 @@ function summarizeDescription(description) {
|
|
|
276
276
|
return sentence.length > 200 ? `${sentence.slice(0, 197)}...` : sentence;
|
|
277
277
|
}
|
|
278
278
|
/** A terse type label: `string`, `integer`, `array<string>`, `string: A|B`. */
|
|
279
|
-
function terseType(node, depth = 0) {
|
|
279
|
+
export function terseType(node, depth = 0) {
|
|
280
280
|
if (!node)
|
|
281
281
|
return "any";
|
|
282
282
|
// 审查 2026-11-04:展开嵌套 object 后递归可能遇到自引用 schema($refStrategy:none
|
|
@@ -317,7 +317,13 @@ function terseType(node, depth = 0) {
|
|
|
317
317
|
if (rendered.length === 0)
|
|
318
318
|
return "object";
|
|
319
319
|
const joined = `object{${rendered.join(",")}}`;
|
|
320
|
-
|
|
320
|
+
if (joined.length <= 80)
|
|
321
|
+
return joined;
|
|
322
|
+
// F4(0.8.6):超预算时**弃类型不弃键名**——旧实现整块退回 "object",调用方连
|
|
323
|
+
// 成员键都看不到(`sorts` 四项展开约 93 字符,`buttons` 较短才显示)。键名长度
|
|
324
|
+
// 仍超预算才退回 "object"。
|
|
325
|
+
const keys = `object{${Object.keys(node.properties ?? {}).join(",")}}`;
|
|
326
|
+
return keys.length <= 80 ? keys : "object";
|
|
321
327
|
}
|
|
322
328
|
return node.type ?? "any";
|
|
323
329
|
}
|
package/dist/goal-routes.js
CHANGED
|
@@ -13,10 +13,19 @@ import { surfaceRefFor } from "./surface-ref.js";
|
|
|
13
13
|
*/
|
|
14
14
|
const SCOUT_CUES = ["能不能", "能不能够", "能否", "是否支持", "支持吗", "支持不支持", "可不可以", "有没有办法", "有没有可能", "怎么实现", "如何实现", "怎么写", "怎么配置"];
|
|
15
15
|
const MODIFY_CUES = ["修改", "调整", "更新", "重命名", "改名", "编辑", "删除", "去掉", "移除", "改为", "改成"];
|
|
16
|
-
const READ_CUES = ["查看", "读回", "盘点", "现状", "列出", "有哪些", "有没有", "检查", "审计", "导出", "只读", "看看", "看下", "查一下", "查询一下", "查一查", "梳理", "清点", "给我一份", "哪些", "是什么", "是否", "是否正确", "现有", "已有", "
|
|
16
|
+
const READ_CUES = ["查看", "读回", "盘点", "现状", "列出", "有哪些", "有没有", "检查", "审计", "导出", "只读", "看看", "看下", "查一下", "查询一下", "查一查", "梳理", "清点", "给我一份", "哪些", "是什么", "是否", "是否正确", "现有", "已有", "多少条", "数一下", "有几条", "几条", "有几个", "几个", "几笔", "多少个", "名单", "分布", "排查", "日志", "执行记录", "触发了吗", "触发失败", "调用记录"];
|
|
17
17
|
// r67a:「排查/日志/执行记录/触发了吗/触发失败/调用记录」——运行面排障问句全是读意图
|
|
18
18
|
// (r67a 真机调查:「规则触发失败了怎么排查」被写阶梯抢走,next 不消费工具级 intents,
|
|
19
|
-
// 只能在 READ_CUES
|
|
19
|
+
// 只能在 READ_CUES 层修)。裸「查」仍不进(见注释的匹配方向)。
|
|
20
|
+
//
|
|
21
|
+
// 0.8.6 P1(探针复现,P1 原句):「…两节点审批流并跑通一条实例、2 条数据」判成
|
|
22
|
+
// mode:"read" + write:false 的只读清单。归因是裸「条数」按 includes 匹配到
|
|
23
|
+
// 「2 条**数**据」的子串——与同文件的 AGGREGATE_ASK / GRAPH_AGGREGATE_RE
|
|
24
|
+
// 的 r70 教训同源,那两处早已写成 `条数(?!据)`。所以这里不能简单删词,改为
|
|
25
|
+
// 同一否定前瞻的独立词表:
|
|
26
|
+
// 正例(必须仍 read)「查一下订单有多少条数」——条数后不是「据」,命中;
|
|
27
|
+
// 反例(必须不因它判 read)「保存并启用一条数据事件规则」「…2 条数据」。
|
|
28
|
+
const READ_CUE_PATTERNS = [/条数(?!据)/];
|
|
20
29
|
const BUILD_CUES = ["新建", "创建", "搭建", "从零", "从无到有", "做", "建", "加", "实现", "生成", "新增", "保存", "启用", "录入", "添加", "造", "填报", "打卡"];
|
|
21
30
|
// r67a:删裸单字「录」——「录入」已在列,「录」单字会误吃「查看调用记**录**/执行记**录**」这类
|
|
22
31
|
// 读问句(真机调查:「业务方法调用记录在哪看」被 build 抢走)。
|
|
@@ -103,6 +112,20 @@ const WRITE_DESTINATION = /(写入|写到|写进|回写|落到|存到|更新到|
|
|
|
103
112
|
// 前导的「应用目录树看一下」)。
|
|
104
113
|
const READ_INVENTORY_VERBS = /(查|看|列|盘点|清点|梳理|导出|搜)/;
|
|
105
114
|
const READ_INVENTORY_NOUNS = /(应用|目录|树|清单|列表|环境)/;
|
|
115
|
+
/**
|
|
116
|
+
* 复合名词剥离(0.8.6 P1,探针复现):`列表` 是 **列表视图**(listview 能力面)
|
|
117
|
+
* 的子串——整包写需求「…表单发布、列表视图、金额数据规则、两节点审批流…」没有
|
|
118
|
+
* 任何裸写词(「交付/发布」都不在 BUILD/MODIFY/裸写词表),于是名词「列表」+
|
|
119
|
+
* 动词「列」同时命中,被误判成读盘点(mode:"read"、write:false)。
|
|
120
|
+
*
|
|
121
|
+
* 判据:做动词×名词匹配前,先把平台面**复合名词**从句子里抹掉。这样连
|
|
122
|
+
* 复合词内部的「列」也不会冒充读动词(例如「…列表视图、还有一个应用」)。
|
|
123
|
+
* 这不是删名词——真盘点问句不含「视图」,照旧命中:
|
|
124
|
+
* 反例(必须仍 read)「列出用户列表」「查应用列表和目录树」「应用目录树看一下」;
|
|
125
|
+
* 正例(必须不被本判定改判 read)「配一个列表视图」「建模型 + 列表视图 + 审批流」
|
|
126
|
+
* (二者另由写词否决兜住)以及 P1 整包原句(无裸写词,只能靠剥离复合词放行)。
|
|
127
|
+
*/
|
|
128
|
+
const READ_INVENTORY_COMPOUNDS = /列表视图/g;
|
|
106
129
|
/** 裸单字写词:不在 BUILD/MODIFY cues 里、但出现在写问句中的高频字(含「配」)。 */
|
|
107
130
|
const READ_INVENTORY_WRITE_WORDS = /(建|加|搭|配|删|改|造|写|做)/;
|
|
108
131
|
/** r67-01-F1/F2:whole-package 门前的读盘点判定(词面与理由见上方注释)。 */
|
|
@@ -114,7 +137,8 @@ function looksReadInventoryAsk(goal) {
|
|
|
114
137
|
return false;
|
|
115
138
|
if (MODIFY_CUES.some((cue) => goal.includes(cue)))
|
|
116
139
|
return false;
|
|
117
|
-
|
|
140
|
+
const scoped = goal.replace(READ_INVENTORY_COMPOUNDS, "");
|
|
141
|
+
return READ_INVENTORY_VERBS.test(scoped) && READ_INVENTORY_NOUNS.test(scoped);
|
|
118
142
|
}
|
|
119
143
|
function detectMode(goal) {
|
|
120
144
|
if (SCOUT_CUES.some((cue) => goal.includes(cue)))
|
|
@@ -125,7 +149,7 @@ function detectMode(goal) {
|
|
|
125
149
|
return "modify";
|
|
126
150
|
if (build)
|
|
127
151
|
return "build";
|
|
128
|
-
if (READ_CUES.some((cue) => goal.includes(cue)))
|
|
152
|
+
if (READ_CUES.some((cue) => goal.includes(cue)) || READ_CUE_PATTERNS.some((pattern) => pattern.test(goal)))
|
|
129
153
|
return "read";
|
|
130
154
|
const lead = goal.trimStart();
|
|
131
155
|
if (LEADING_READ_VERBS.some((verb) => lead.startsWith(verb)) && !/^(查重|查错)/.test(lead))
|
|
@@ -427,8 +451,14 @@ const FIRST_SECTION_INLINE_BUDGET_BYTES = 2048;
|
|
|
427
451
|
* recipes, so its inline section budget is tighter — the 4096B `next` ceiling
|
|
428
452
|
* must survive a ladder + a 2.5KB section (r18: "工作流审批流程" would have
|
|
429
453
|
* been 4729B). Single-capability routes keep the fuller budget (F9).
|
|
454
|
+
*
|
|
455
|
+
* w30: 1200 → 1600. skills 增长后最常用的小节(模型与字段)实测 1276B(工单记录
|
|
456
|
+
* 1443B 来自另一 skills 快照;本轮 HEAD 复测 1276B),已越过 1200B,内联对每个
|
|
457
|
+
* ladder 任务全线失效(每次多一跳 `help --section`,约 0.5s)。
|
|
458
|
+
* 1600 覆盖最常见小节(模型与字段),仍不内联 2473B(表单与视图)/2540B
|
|
459
|
+
* (流程字段权限)这类大节。代价:ladder 回执最多 +1.6KB。
|
|
430
460
|
*/
|
|
431
|
-
const LADDER_INLINE_BUDGET_BYTES =
|
|
461
|
+
const LADDER_INLINE_BUDGET_BYTES = 1600;
|
|
432
462
|
function routeReads(readSections, recipeMatched = false, inlineBudget = FIRST_SECTION_INLINE_BUDGET_BYTES) {
|
|
433
463
|
const budgeted = pickSectionPointer(readSections, recipeMatched).map((pointer) => ({ ...pointer, bytes: sectionBytes(pointer) }));
|
|
434
464
|
// Inline the ONE pointer's content when it fits the budget: the agent then
|
package/dist/human-summary.js
CHANGED
|
@@ -103,6 +103,18 @@ export function writeSummary(tool, args, outcome, phase = "done") {
|
|
|
103
103
|
const schema = stringArg(args, "schemaCode");
|
|
104
104
|
return `未删除(batch-delete-ineffective)${ids.length} 条回读仍在${schema ? `(${schema})` : ""}:${ids.join("、")};改用单条 data.delete 重试`;
|
|
105
105
|
}
|
|
106
|
+
// F7(0.8.6):physically_delete 是平台异步任务(建删除历史后立即返回)。回执
|
|
107
|
+
// `readback.absent=false` 表示级联仍在跑、记录面还查得到目标——zh 行首词必须是
|
|
108
|
+
// 否定,照 data.delete 的既有先例;否则人/CI 把「已删除模型 X」当成已生效。
|
|
109
|
+
if (phase === "done" && tool === "model.delete" && outcome?.readback?.absent === false) {
|
|
110
|
+
const code = stringArg(args, "schemaCode") ?? stringArg(args, "code") ?? "?";
|
|
111
|
+
return `未删净(级联中)模型 ${code}:平台异步删除任务未完成,记录面仍查得到——不要当作已删除;以 readback.absent=true 且应用树无该节点为准,稍后重跑 model.delete(幂等)复核`;
|
|
112
|
+
}
|
|
113
|
+
if (phase === "done" && tool === "model.deleteMany" && outcome?.readback?.allAbsent === false) {
|
|
114
|
+
const perCode = (outcome.readback.perCode ?? {});
|
|
115
|
+
const pending = Object.entries(perCode).filter(([, value]) => value?.absent === false).map(([code]) => code);
|
|
116
|
+
return `未删净(级联中)${pending.length > 0 ? pending.join("、") : "部分模型"}:平台异步删除任务未完成,记录面仍查得到——不要当作已删除;按 perCode 逐项复核,稍后重跑 model.deleteMany(幂等)`;
|
|
117
|
+
}
|
|
106
118
|
// r28b F11: data.delete already-absent must NOT read as「已删除…」— humans/CI
|
|
107
119
|
// that skim stderr treat the leading verb as the outcome. Say「未删除」first.
|
|
108
120
|
if (phase === "done" && tool === "data.delete" && outcome?.performed?.skipped === "already-absent") {
|
|
@@ -158,7 +170,13 @@ function phraseOf(tool, args, outcome) {
|
|
|
158
170
|
}
|
|
159
171
|
case "configure_form": {
|
|
160
172
|
const codes = args.fieldCodes;
|
|
161
|
-
|
|
173
|
+
// F9(0.8.6):结果行曾恒为「配置并发布表单 ?」——summarize 把 outcome 写死
|
|
174
|
+
// undefined。回落链按「最能标识对象」排序:显式 sheetCode → 回执里的真实
|
|
175
|
+
// 表单名 readback.formName(sheetGet 的 name)→ 模型 code(默认表单槽位)
|
|
176
|
+
// → 未知才是 ?。plan 阶段没有回执,落到 schemaCode。
|
|
177
|
+
const readbackFormName = typeof outcome?.readback?.formName === "string" && outcome.readback.formName.length > 0 ? outcome.readback.formName : undefined;
|
|
178
|
+
const shownForm = stringArg(args, "sheetCode") ?? readbackFormName ?? (schemaCode !== undefined ? String(schemaCode) : "?");
|
|
179
|
+
return `配置并发布表单 ${shownForm}(模型 ${schemaCode ?? "?"})${Array.isArray(codes) && codes.length > 0 ? `,绑定字段 ${codes.map(String).join("、")}` : "(绑定全部已发布字段)"}`;
|
|
162
180
|
}
|
|
163
181
|
case "configure_rule":
|
|
164
182
|
return `保存并启用业务规则 ${stringArg(args, "name") ?? ""}(${stringArg(args, "ruleCode") ?? "?"},模型 ${schemaCode ?? "?"})`;
|
|
@@ -399,7 +399,7 @@ export const fieldCapability = {
|
|
|
399
399
|
pushError(ctx, "intent-subfield-code-invalid", "子列 code 必须是非空字符串", `${subBase}.code`, "value");
|
|
400
400
|
else {
|
|
401
401
|
subCode = subCodeNode.value.trim();
|
|
402
|
-
const violations = validateBusinessCode(subCode, { kind: "field" });
|
|
402
|
+
const violations = validateBusinessCode(subCode, { kind: "field", subTable: true });
|
|
403
403
|
if (violations.length > 0)
|
|
404
404
|
pushError(ctx, "intent-subfield-code-invalid", `子列 code 未过出门前校验:${violations.map((violation) => violation.message).join(";")}`, `${subBase}.code`, "value", { validation: violations });
|
|
405
405
|
if (seenSubCodes.has(subCode))
|
package/dist/lanes/form.js
CHANGED
|
@@ -763,7 +763,7 @@ export function registerFormLane(tools) {
|
|
|
763
763
|
},
|
|
764
764
|
};
|
|
765
765
|
},
|
|
766
|
-
summarize: (args,
|
|
766
|
+
summarize: (args, outcome, phase) => writeSummary("configure_form", args, outcome, phase),
|
|
767
767
|
});
|
|
768
768
|
writeTool({
|
|
769
769
|
tools,
|
package/dist/lanes/list-view.js
CHANGED
|
@@ -405,6 +405,23 @@ export function decodeButtonScript(input) {
|
|
|
405
405
|
...(parsed !== undefined ? { actionConfig: parsed } : {}),
|
|
406
406
|
};
|
|
407
407
|
}
|
|
408
|
+
/**
|
|
409
|
+
* 306103(删除后将无可用视图)。平台要求**每个模型至少保留一个 PC 可见视图和
|
|
410
|
+
* 一个 MOBILE 可见视图**;该码只在 2.1.5 出现(`ErrorCode.java:383`),8.6.26
|
|
411
|
+
* 无 306103。导出以便回执文案被测试钉住(PC/MOBILE 各一条 + 正确出路)。
|
|
412
|
+
*/
|
|
413
|
+
export function listviewLastVisibleRefusal(schemaCode, code) {
|
|
414
|
+
return new ToolRefusalError({
|
|
415
|
+
status: "refused",
|
|
416
|
+
blocker: "listview-last-visible",
|
|
417
|
+
schemaCode,
|
|
418
|
+
code,
|
|
419
|
+
nextCommand: `omc model-purge --code ${schemaCode}`,
|
|
420
|
+
message: `不能删除视图 ${code}:平台要求**至少保留一个 PC 可见视图和一个 MOBILE 可见视图**(PC + MOBILE 各一条,306103)。` +
|
|
421
|
+
`单独删最后一条视图没有意义——删模型会级联删除它的所有视图。要继续用这个模型就**就地改**(listview.configure 省略 code 即改默认视图),` +
|
|
422
|
+
`要整体清理就用 model-purge(默认 dry-run,先看计划)。`,
|
|
423
|
+
});
|
|
424
|
+
}
|
|
408
425
|
export function registerListViewLane(tools) {
|
|
409
426
|
tools.push(defineTool({
|
|
410
427
|
name: "listview.get",
|
|
@@ -731,7 +748,7 @@ export function registerListViewLane(tools) {
|
|
|
731
748
|
fieldCodes: z.array(z.string()).min(1).describe("要展示的字段:可给 propertyCode 或字段显示名(唯一匹配时自动解析,歧义或不存在则拒绝,不静默跳过)"),
|
|
732
749
|
hideDefaultSystemFields: z.boolean().optional().describe("是否隐藏平台默认系统列(createdTime/creater/name/sequenceNo 等);平台 update 按提交列集合决定,不能靠 visible:false"),
|
|
733
750
|
replaceColumns: z.boolean().optional().describe("把 fieldCodes 当作列集合的权威全集:未列出的已有列(含系统列)全部移除,最终列 = fieldCodes(按给定顺序)。默认 false 为增量(保留已有列)。系统列与业务列一视同仁——想要 createdTime/sequenceNo 就把它写进 fieldCodes"),
|
|
734
|
-
sorts: z.array(listViewSortArg).optional().describe("querySorts; omitted leaves the existing sorts untouched, provided replaces them"),
|
|
751
|
+
sorts: z.array(listViewSortArg).optional().describe("querySorts; omitted leaves the existing sorts untouched, provided replaces them。成员键:propertyCode + direction(ASC/DESC),其余可省"),
|
|
735
752
|
conditions: z.array(listViewConditionArg).optional().describe("queryConditions; omitted leaves the existing conditions untouched, provided replaces them(2.1.5 树视图三键原样带回;值变化默认拒 listview-tree-conditions-changed)"),
|
|
736
753
|
allowTreeConditionChange: z.boolean().optional().describe("仅当确认要改写树过滤组时传 true:允许提交值与基线的 treeLimitScopeType/treeLimitConditionGroup/treeDefaultConditionGroup 不同(新值原样写入);默认 false 时值不同即拒 listview-tree-conditions-changed。本参数只放行值差异,不放行缺键——基线有值而提交行没带仍拒 listview-tree-conditions-would-be-lost。"),
|
|
737
754
|
actions: z.array(listViewActionArg).optional().describe("queryActions; omitted leaves the existing actions untouched, provided MERGES into the effective set by actionCode (existing platform defaults like 新增/删除/导入/导出 are preserved, a matching actionCode is updated). Use replaceActions:true for the authoritative full set"),
|
|
@@ -1293,16 +1310,7 @@ export function registerListViewLane(tools) {
|
|
|
1293
1310
|
// list view per model. r15's `nextCommand` fell back to the generic
|
|
1294
1311
|
// refusal router; name the constraint and the only real deletion path.
|
|
1295
1312
|
if (error instanceof WireError && error.kind === "business" && (error.errcode === 306103 || /无可用视图/.test(error.message)))
|
|
1296
|
-
throw
|
|
1297
|
-
status: "refused",
|
|
1298
|
-
blocker: "listview-last-visible",
|
|
1299
|
-
schemaCode: args.schemaCode,
|
|
1300
|
-
code: args.code,
|
|
1301
|
-
nextCommand: `omc model-purge --code ${args.schemaCode}`,
|
|
1302
|
-
message: `不能删除视图 ${args.code}:平台要求每个模型至少保留一条可见列表视图(306103)。` +
|
|
1303
|
-
`单独删最后一条视图没有意义——视图会随模型一起级联删除。要继续用这个模型就**就地改**(listview.configure 省略 code 即改默认视图),` +
|
|
1304
|
-
`要整体清理就用 model-purge(默认 dry-run,先看计划)。`,
|
|
1305
|
-
});
|
|
1313
|
+
throw listviewLastVisibleRefusal(args.schemaCode, args.code);
|
|
1306
1314
|
throw error;
|
|
1307
1315
|
}
|
|
1308
1316
|
const readback = await wireCall(session, { path: ENDPOINTS.listQueryGetHeader, query: { schemaCode: args.schemaCode, code: args.code } });
|
|
@@ -13,7 +13,7 @@ export const MODEL_WIRE = Object.freeze({
|
|
|
13
13
|
deleteIdNamespace: "physically_delete resolves each row id as an AppFunction id (removeBizModel → getAppFunction(id), AppIntegrationFacadeImpl) and answers 601003 业务模型不存在 for a biz-model record id; the two id spaces are NOT interchangeable. model.delete/deleteMany resolve the node across applications (default app first, then applicationList per-app trees) and refuse fail-closed with model-application-unresolved when the record exists but no tree node does — never guessing a record id",
|
|
14
14
|
deleteTolerance: "already-absent short-circuits; the authoritative record face polls to verified absence; the tree node is eventually consistent and reported as treeNodePending",
|
|
15
15
|
referencePrecheck: "before physically_delete, every same-app sibling model's bizproperty faces (draft + published) are scanned for relation fields targeting the model (relativeCode or options.schemaCode of WORK_SHEET/MULT_WORK_SHEET/RELEVANCE_DATA); any hit refuses with blocker model-referenced-by + referencingModels — the server-side async 'xxx被模型 yyy 引用,不能删除' (AppIntegrationFacadeImpl.deleteFunctions:2201, live TID xydiq8enji3ziq4bl2diurx9c) surfaced at call time instead of errcode 0 followed by a silent async failure",
|
|
16
|
-
dependencyInvertedDelete: "referenced cleanup is dependency-inverted: delete referencing models first, then the referenced model; the physical delete
|
|
16
|
+
dependencyInvertedDelete: "referenced cleanup is dependency-inverted: delete referencing models first, then the referenced model; the physical delete is a platform async task whose duration is UNBOUNDED (a live probe exceeded 4 minutes), so absent:false + treeNodePending:true means wait-and-recheck (the poll runs ~60s and returns nextAction guidance), never an immediate failure verdict and never a completed deletion — especially right after deleting a referencing model, whose cascade may still be dropping the relation columns",
|
|
17
17
|
usableLadder: "model.create → field.create → model-scoped field.publish (rung-1..3); configure_model performs an authoritative readback immediately after every model.create, field.create, field.publish, form.draft, and form.publish step and stops with completed/failed step evidence on failure; form draft/publish is the separate configure_form capability",
|
|
18
18
|
summaryWire: "bizmodels/get_summary (GET ?schemaCode) returns the data-title string; bizmodels/update_summary (POST {schemaCode, summary}) requires a non-empty summary (validateNotEmpty) and answers 300014 BIZ_SCHEMA_NOT_PUBLISHED (ErrorCode.java:194) for a missing schema — 8.6.26 BizSchemaController.java:668-736",
|
|
19
19
|
});
|
|
@@ -112,7 +112,7 @@ export const MODEL_LANE_CONTRACT = Object.freeze({
|
|
|
112
112
|
}),
|
|
113
113
|
"model.delete": Object.freeze({
|
|
114
114
|
scope: MODEL_SCOPE,
|
|
115
|
-
description: "物理删除模型(apppackage/physically_delete [{id,code,type:BizModel}]);exact-absence 读回在 `readback.absent`/`readback.treeNodePending`(顶层无这两键——用 `--jq readback.absent`)。id 必须是应用树 AppFunction id(业务模型记录 id → 601003)。无 `applicationCode` 时跨应用解析节点,记录在但树节点缺 → `model-application-unresolved`。同应用入站引用预检 → `model-referenced-by`(dependency-inverted
|
|
115
|
+
description: "物理删除模型(apppackage/physically_delete [{id,code,type:BizModel}]);exact-absence 读回在 `readback.absent`/`readback.treeNodePending`(顶层无这两键——用 `--jq readback.absent`)。id 必须是应用树 AppFunction id(业务模型记录 id → 601003)。无 `applicationCode` 时跨应用解析节点,记录在但树节点缺 → `model-application-unresolved`。同应用入站引用预检 → `model-referenced-by`(dependency-inverted:先删引用方再删被引用方)。平台为异步任务、时长不定:`absent:false` 不当成功(deliveryState=WRITE_UNVERIFIED),以记录面与应用树为准,稍后重跑(幂等)。`performed.taskId` 为平台删除历史任务号(无查询端点)。可显式传 `applicationCode`。",
|
|
116
116
|
}),
|
|
117
117
|
configure_model: Object.freeze({
|
|
118
118
|
scope: MODEL_SCOPE,
|
package/dist/lanes/model.js
CHANGED
|
@@ -5,7 +5,7 @@ import { modelSchemaCodes, lintFieldCreateWrite } from "./field.js";
|
|
|
5
5
|
import { fieldChangeWireBody, prepareFieldChange, sameFieldChange } from "../field-change.js";
|
|
6
6
|
import { executeFormDraftWrite, executeFormPublishWrite } from "../form-support.js";
|
|
7
7
|
import { mapBounded } from "../support.js";
|
|
8
|
-
import { validateBusinessCode } from "../code-rules.js";
|
|
8
|
+
import { validateBusinessCode, validateFieldEntryCodes } from "../code-rules.js";
|
|
9
9
|
import { writeSummary } from "../human-summary.js";
|
|
10
10
|
import { capabilityArg, environmentArg } from "../args.js";
|
|
11
11
|
import { governedRead, withoutReadbackCache } from "../read.js";
|
|
@@ -913,7 +913,7 @@ export function registerModelLane(tools) {
|
|
|
913
913
|
message: `${args.schemaCode} 的业务模型记录仍在(bizmodels/get_all 持续返回),但应用树里没有它的节点(AppFunction)。` +
|
|
914
914
|
`**这是平台侧的不可删状态**:physically_delete 用 AppFunction id 定位,而平台 removeBizModel 找不到 AppFunction 行时抛 APP_FUNCTION_MODEL_NOTEXIST——本工具不猜测 id(传业务记录 id 只会得到 601003 业务模型不存在),因此无法通过 physically_delete 删除。` +
|
|
915
915
|
`已连续复查 4 次、间隔约 1s,记录仍在,因此不是读缓存滞后。` +
|
|
916
|
-
|
|
916
|
+
`已知成因:删除级联被中断(级联是平台异步任务、时长不定,中途失败会留下「记录在、节点没了」的残骸)。` +
|
|
917
917
|
`可行出路(按代价排序):① 用平台「回收站 → 物理删除」清理该残留(apppackage/physically_deleteAll 同一路径);` +
|
|
918
918
|
`② 换一个未占用的 schema code 继续(r11/r12 探针均采用此法);` +
|
|
919
919
|
`③ 若你有平台数据库权限,删除 h_biz_schema/h_biz_property/h_biz_sheet 对应行并重启 launcher 清缓存——但这是维护者操作,不在工具权限内。` +
|
|
@@ -954,7 +954,7 @@ export function registerModelLane(tools) {
|
|
|
954
954
|
referencingModels,
|
|
955
955
|
deletionOrder: [...referencingModels.map((model) => model.schemaCode), args.schemaCode],
|
|
956
956
|
nextCommand: `omc call model.delete --args '${JSON.stringify({ schemaCode: referencingModels[0].schemaCode })}'`,
|
|
957
|
-
message: `${args.schemaCode} 被模型 ${referencingModels.map((model) => model.schemaCode).join("、")} 的关联字段引用,不能删除(服务端 deleteFunctions
|
|
957
|
+
message: `${args.schemaCode} 被模型 ${referencingModels.map((model) => model.schemaCode).join("、")} 的关联字段引用,不能删除(服务端 deleteFunctions 的异步拒绝已提前到调用时)。依赖倒序清理:先删引用方模型(或先删其关联字段),再删被引用模型;引用方物理删除是平台异步任务、时长不定,完成后再删本模型。`,
|
|
958
958
|
});
|
|
959
959
|
}
|
|
960
960
|
// Model deletion CASCADES the workflow template away but leaves
|
|
@@ -968,11 +968,18 @@ export function registerModelLane(tools) {
|
|
|
968
968
|
method: "POST",
|
|
969
969
|
body: [{ id: targetId, code: args.schemaCode, type: "BizModel" }],
|
|
970
970
|
});
|
|
971
|
-
//
|
|
972
|
-
//
|
|
973
|
-
//
|
|
974
|
-
//
|
|
975
|
-
|
|
971
|
+
// F7(0.8.6):physically_delete 返回的是 AppDeleteHistoryModel,含平台
|
|
972
|
+
// 后台任务的 taskId(AppDeleteHistoryModel.java:28),此前被丢弃。平台
|
|
973
|
+
// 没有 taskId 查询端点(不新增工具),但把它留在回执里可供人工/维护者
|
|
974
|
+
// 对账删除历史;判定仍以记录面 absent + 应用树为准。
|
|
975
|
+
const deleteHistory = (performed.data ?? {});
|
|
976
|
+
const taskId = typeof deleteHistory.taskId === "string" && deleteHistory.taskId.length > 0 ? deleteHistory.taskId : undefined;
|
|
977
|
+
// Both the model record and the app-tree node are eventually consistent.
|
|
978
|
+
// The platform answers as soon as the async task is queued; the cascade
|
|
979
|
+
// duration is NOT bounded (measured >4min on a live probe). Poll the
|
|
980
|
+
// authoritative record face briefly, then report the tree-node state as a
|
|
981
|
+
// pending hint with explicit wait-and-recheck guidance instead of a
|
|
982
|
+
// failure — and never as a completed deletion.
|
|
976
983
|
let absent = false;
|
|
977
984
|
for (let attempt = 0; attempt < 16 && !absent; attempt += 1) {
|
|
978
985
|
if (attempt > 0)
|
|
@@ -985,10 +992,10 @@ export function registerModelLane(tools) {
|
|
|
985
992
|
const cleanVerdict = absent && !treeNodePending
|
|
986
993
|
? "已删干净(判据:bizmodels 记录 absent=true 且应用树无该 BizModel 节点)"
|
|
987
994
|
: absent && treeNodePending
|
|
988
|
-
? "记录已删、树节点残留——级联仍在拆或残留需 model-purge
|
|
989
|
-
: "
|
|
995
|
+
? "记录已删、树节点残留——级联仍在拆或残留需 model-purge;稍后复核 model.delete(幂等)"
|
|
996
|
+
: "尚未删净:记录还在(级联进行中),稍后重跑 model.delete 复核";
|
|
990
997
|
return {
|
|
991
|
-
performed: { errcode: performed.errcode, deletedId: targetId, applicationCode },
|
|
998
|
+
performed: { errcode: performed.errcode, deletedId: targetId, applicationCode, ...(taskId !== undefined ? { taskId } : {}) },
|
|
992
999
|
readback: {
|
|
993
1000
|
absent,
|
|
994
1001
|
treeNodePending,
|
|
@@ -1009,7 +1016,9 @@ export function registerModelLane(tools) {
|
|
|
1009
1016
|
? {}
|
|
1010
1017
|
: {
|
|
1011
1018
|
nextAction: "wait-and-recheck",
|
|
1012
|
-
|
|
1019
|
+
nextCommand: `omc call model.list --args '${JSON.stringify({ filter: args.schemaCode })}'`,
|
|
1020
|
+
recheckCommand: `omc residue ${args.schemaCode}`,
|
|
1021
|
+
note: "平台 physically_delete 是异步任务:建删除历史后立即返回,级联时长不定(8.6.26 实测可超过 4 分钟),absent:false 表示删除尚未完成,不是失败。平台无 taskId 查询端点,以记录面 absent=true 且应用树无该节点为准;用 nextCommand/recheckCommand 复核,稍后重跑 model.delete(幂等,already-absent 短路)。若刚删除引用方模型,其级联可能仍在拆除关联列,必须等它完成后再删本模型。",
|
|
1013
1022
|
}),
|
|
1014
1023
|
},
|
|
1015
1024
|
};
|
|
@@ -1101,7 +1110,7 @@ export function registerModelLane(tools) {
|
|
|
1101
1110
|
status: "refused",
|
|
1102
1111
|
blocker: "model-referenced-by",
|
|
1103
1112
|
blockedTargets,
|
|
1104
|
-
message: `批量删除被拒(零副作用):${blockedTargets.map((blocked) => `${blocked.schemaCode} 被模型 ${blocked.referencingModels.map((model) => model.schemaCode).join("、")} 的关联字段引用`).join(";")}。依赖倒序清理:把引用方模型一并纳入 schemaCodes
|
|
1113
|
+
message: `批量删除被拒(零副作用):${blockedTargets.map((blocked) => `${blocked.schemaCode} 被模型 ${blocked.referencingModels.map((model) => model.schemaCode).join("、")} 的关联字段引用`).join(";")}。依赖倒序清理:把引用方模型一并纳入 schemaCodes(或先删其关联字段);引用方物理删除是平台异步任务、时长不定,完成后再删被引用模型。`,
|
|
1105
1114
|
});
|
|
1106
1115
|
}
|
|
1107
1116
|
return { targets, alreadyAbsent, entries, treeRowList, appsToScan, applicationCode };
|
|
@@ -1133,9 +1142,13 @@ export function registerModelLane(tools) {
|
|
|
1133
1142
|
method: "POST",
|
|
1134
1143
|
body: entries,
|
|
1135
1144
|
});
|
|
1136
|
-
//
|
|
1137
|
-
//
|
|
1138
|
-
|
|
1145
|
+
// F7(0.8.6):批量入口同样丢弃了平台回执里的 taskId(AppDeleteHistoryModel);
|
|
1146
|
+
// 把它留在回执里,判定仍以 perCode.absent 为准。
|
|
1147
|
+
const deleteHistory = (performed.data ?? {});
|
|
1148
|
+
const taskId = typeof deleteHistory.taskId === "string" && deleteHistory.taskId.length > 0 ? deleteHistory.taskId : undefined;
|
|
1149
|
+
// Per-model absence polling on the authoritative record face. The async
|
|
1150
|
+
// task duration is unbounded (do not promise a window); pending codes
|
|
1151
|
+
// carry the same wait-and-recheck guidance as model.delete.
|
|
1139
1152
|
const absentSet = new Set();
|
|
1140
1153
|
for (let attempt = 0; attempt < 16 && absentSet.size < entries.length; attempt += 1) {
|
|
1141
1154
|
if (attempt > 0)
|
|
@@ -1158,15 +1171,16 @@ export function registerModelLane(tools) {
|
|
|
1158
1171
|
}
|
|
1159
1172
|
const absent = absentSet.has(code);
|
|
1160
1173
|
const treeNodePending = afterTree.some((row) => row.type === "BizModel" && row.code === code);
|
|
1161
|
-
perCode[code] = absent ? { absent, ...(treeNodePending ? { treeNodePending } : {}) } : { absent, treeNodePending, nextAction: "wait-and-recheck", note: "
|
|
1174
|
+
perCode[code] = absent ? { absent, ...(treeNodePending ? { treeNodePending } : {}) } : { absent, treeNodePending, nextAction: "wait-and-recheck", nextCommand: `omc call model.list --args '${JSON.stringify({ filter: code })}'`, note: "平台物理删除是异步任务,级联时长不定:absent:false 表示该模型的删除尚未完成,不是失败。稍后重跑 model.deleteMany(幂等,already-absent 短路)复核。" };
|
|
1162
1175
|
}
|
|
1163
1176
|
const allAbsent = targets.every((code) => perCode[code]?.absent === true);
|
|
1177
|
+
const pendingCodes = targets.filter((code) => perCode[code]?.absent === false);
|
|
1164
1178
|
return {
|
|
1165
|
-
performed: { errcode: performed.errcode, deletedIds: entries.map((entry) => entry.id), alreadyAbsent, requested: targets, applicationCode },
|
|
1179
|
+
performed: { errcode: performed.errcode, deletedIds: entries.map((entry) => entry.id), alreadyAbsent, requested: targets, applicationCode, ...(taskId !== undefined ? { taskId } : {}) },
|
|
1166
1180
|
readback: {
|
|
1167
1181
|
perCode,
|
|
1168
1182
|
allAbsent,
|
|
1169
|
-
...(allAbsent ? {} : { nextAction: "wait-and-recheck", note: "部分模型仍在异步级联中;按 perCode
|
|
1183
|
+
...(allAbsent ? {} : { nextAction: "wait-and-recheck", nextCommand: `omc residue ${pendingCodes[0] ?? targets[0]}`, note: "部分模型仍在异步级联中;按 perCode 逐项查看,稍后重跑(幂等)。" }),
|
|
1170
1184
|
},
|
|
1171
1185
|
};
|
|
1172
1186
|
},
|
|
@@ -1470,7 +1484,7 @@ export function registerModelLane(tools) {
|
|
|
1470
1484
|
const entries = fieldEntriesOf(args);
|
|
1471
1485
|
const violations = [
|
|
1472
1486
|
...validateBusinessCode(args.code, { kind: "model" }),
|
|
1473
|
-
...entries.flatMap((entry) =>
|
|
1487
|
+
...entries.flatMap((entry) => validateFieldEntryCodes(entry)),
|
|
1474
1488
|
];
|
|
1475
1489
|
if (violations.length > 0)
|
|
1476
1490
|
throw new ToolRefusalError({ status: "refused", blocker: "business-code-invalid", message: "code 未过出门前校验;按 validation 修正(长度/风格/保留字)", validation: violations });
|
|
@@ -5,7 +5,7 @@ export { RUNTIME_DATA_WIRE, RUNTIME_QUERY_OPERATORS, ENGINE_OWNED_KEYS, SUBMIT_S
|
|
|
5
5
|
import { RUNTIME_DATA_WIRE } from "omc-core/wire-facts";
|
|
6
6
|
export function dataListDescription() {
|
|
7
7
|
const wire = RUNTIME_DATA_WIRE;
|
|
8
|
-
return `按简化过滤 DSL 查询业务对象(runtime/query/list);DSL 在 CLI 内翻译为平台 queryCondition(${wire.dslShape}),并按发布字段元数据为每个条件注入 propertyType(未知过滤字段将被拒绝,可用 rawCondition 逃生);响应行在 items[],业务字段在 items[].fields.<code>(不是 rows[],也不是 item 顶层——--jq 常用 items[].fields.sku);空模型返回空列表;未配列的自定义字段投影为 null——这是显示面缺列配置、不是数据缺失(data.load 有值),显式选列在结果中全为 null 而发布字段元数据显示其存在时,readback 追加 projectionHint(先用 listview.configure 配置该模型的默认视图列,或用 data.load
|
|
8
|
+
return `按简化过滤 DSL 查询业务对象(runtime/query/list);DSL 在 CLI 内翻译为平台 queryCondition(${wire.dslShape}),并按发布字段元数据为每个条件注入 propertyType(未知过滤字段将被拒绝,可用 rawCondition 逃生);响应行在 items[],业务字段在 items[].fields.<code>(不是 rows[],也不是 item 顶层——--jq 常用 items[].fields.sku);空模型返回空列表;未配列的自定义字段投影为 null——这是显示面缺列配置、不是数据缺失(data.load 有值),显式选列在结果中全为 null 而发布字段元数据显示其存在时,readback 追加 projectionHint(先用 listview.configure 配置该模型的默认视图列,或用 data.load 读单条权威值)。键缺席=字段不存在;键在值 null=未投影或真空值(见 projectionHint.unprojected)。`;
|
|
9
9
|
}
|
|
10
10
|
export function dataAggregateDescription() {
|
|
11
11
|
return `临时计数与数值聚合(纯读)。count:runtime/query/list size:1 读 totalElements(服务端精确、不受 cap 影响;带 filter +1 field.list)。sum/avg/min/max:field 必填且已发布 propertyType=2(NUMERICAL);无 GET_LIST 改源时优先 /sum ALL_DATA(coverage.mode=server-aggregate,全量精确),否则/失败/键不符回退本地折叠(strategyFallback;size:200 翻页至 cap 1000,null 不进聚合、avg=sum/非 null 行数,nonNullCount=0→value:null)。complete 看 rowsScanned>=total,否则 missingCount+capNotice,绝不外推。groupBy 单列:count 值域可枚举(options/字典)→值域×count(V+3 wire),分桶并发窗口 4(限流退化 2,见 wire.concurrency),桶序稳定;按 count 降序取 topN(默认 10/上限 20),截断给 truncatedBuckets/bucketsTruncatedCount,null 单列 nullBucket;不可枚举或数值指标→本地扫描(coverage.mode=paged-local-scan/local-scan),数值桶 {key,count,nonNullCount,value} 按 value 降序、并列按 key,null 行进 nullBucket。filter.draftPolicy:count+groupBy 默认 includeDrafts:false 注入 sequenceStatus≠DRAFT;数值指标不默认排除;count 省略=平台默认(无条件含草稿、带条件排草稿);显式 false 强制排除。边界:临时问句用本工具;持久图表/看板用 report.chartdata,视图汇总列用 sumType,写时计算用 datarule type2。子表计数/求和用 child(主表 schemaCode + childSchemaCode/bizObjectId)。`;
|
|
@@ -41,7 +41,7 @@ export function dataSubmitDescription() {
|
|
|
41
41
|
const wire = RUNTIME_DATA_WIRE;
|
|
42
42
|
return describeTool(`M2 runtime data SUBMIT (runtime/form/submit, WorkItemSubmitVO).`, [
|
|
43
43
|
"Distinct from data.save: data.save persists as DRAFT; data.submit advances the record to COMPLETED (no workflow) or drives the workflow instance.",
|
|
44
|
-
"
|
|
44
|
+
"**省略 `formData` 的两条合法面**:审批提交(带 workItemId)平台使用已存业务数据;**已有草稿直提(带 bizObjectId、无 workItemId)也合法**——载荷按 data.load 读回行合并(省略 ≡ 传 {},平台 mergeObject 覆盖;给了则覆盖读回值)。只有**新建**(无 bizObjectId、无 workItemId)必须给 formData。审批提交不要携带子表数组。",
|
|
45
45
|
`就地语义:${wire.submitInPlace};无流程 readback 必须确认 objectId 与传入 bizObjectId 相同;无 bizObjectId 的 workflowCode 新建单 → PROCESSING + workflowInstanceId,无流程 → 该行 COMPLETED。`,
|
|
46
46
|
`既有草稿发起流程的唯一支持形状是两段式:先 data.save 带 workflowCode 暂存(saveWorkflow→startWorkflow(finishStart=FALSE);getReplayToken 门、sequenceStatus 与返回形状见 data.save 的 workflowCode 段),再以返回的 workItemId 提交(带流程模型提交**必须**带 bizObjectId+workflowInstanceId+workItemId 三元——只带 bizObjectId 会答「流程实例无待办」、只缺 workItemId 会 50000;完整形状见 omc describe data.submit --example workflow-backed-data-submit,待办查询用 workitem.list)。`,
|
|
47
47
|
`仅无 workflowCode/workItemId/workflowInstanceId 且无 bizObjectId 时保留 save→submit 便捷链(新建记录);只要存在 workItemId 或 workflowInstanceId 就 fail-closed 拒绝(blocker submit-biz-object-id-required),零 runtime/form/submit wire。`,
|
|
@@ -154,7 +154,7 @@ function desc(lead) {
|
|
|
154
154
|
}
|
|
155
155
|
export function assertRuntimeDataContract() {
|
|
156
156
|
assertLaneContract(RUNTIME_DATA_LANE_CONTRACT);
|
|
157
|
-
assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.list", ["queryCondition", "propertyType", "rawCondition", "projectionHint", "listview.configure", "data.load", "items[].fields"]);
|
|
157
|
+
assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.list", ["queryCondition", "propertyType", "rawCondition", "projectionHint", "listview.configure", "data.load", "items[].fields", "键缺席", "未投影或真空值"]);
|
|
158
158
|
assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.aggregate", ["totalElements", "groupBy", "local-scan", "cap 1000", "draftPolicy", "report.chartdata", "sum", "avg", "NUMERICAL", "nonNullCount"]);
|
|
159
159
|
assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.save", ["bizObjectId", "sheetCode", "bizsheet/get", "workflowCode", "sequenceStatus", "workItem", "propertyType 9", "50000", "mappings", "rowStatus", "DRAFT", "submit:true", "CHILD_TABLE"]);
|
|
160
160
|
assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.update", ["runtime/form/save", "bizObjectId", "COMPLETED", "304001", "form/load", "rowStatus", "child-rows-upsert"]);
|
|
@@ -362,7 +362,10 @@ export function projectionHintFace(items, evidence) {
|
|
|
362
362
|
const hasValue = new Set();
|
|
363
363
|
for (const item of items) {
|
|
364
364
|
for (const [key, value] of Object.entries(item.fields)) {
|
|
365
|
-
|
|
365
|
+
// `*_key` 是平台给单选/字典字段铸的孪生列(BizObject.SELECTION_KEY_SUFFIX
|
|
366
|
+
// ="_key":8.6.26 BizObject.java:83 / 2.1.5 BizObject.java:59,两版同形)——
|
|
367
|
+
// 它不在发布业务字段里,全 null 不代表「视图漏配了一列」。
|
|
368
|
+
if (RUNTIME_SYSTEM_FIELD_CODES.has(key) || key.endsWith("_") || key.endsWith("_key"))
|
|
366
369
|
continue;
|
|
367
370
|
if (value === null || value === undefined) {
|
|
368
371
|
if (!hasValue.has(key) && !allNull.includes(key))
|
|
@@ -3496,7 +3499,7 @@ export function registerRuntimeDataLane(tools) {
|
|
|
3496
3499
|
inputSchema: {
|
|
3497
3500
|
schemaCode: z.string().min(1),
|
|
3498
3501
|
sheetCode: z.string().optional(),
|
|
3499
|
-
formData: runtimeFormDataArg.optional().describe("business-object data keyed by field code
|
|
3502
|
+
formData: runtimeFormDataArg.optional().describe("business-object data keyed by field code;新建记录必填(无 bizObjectId 时);已有草稿直提可省略——按 data.load 读回行合并(省略 ≡ 传 {},给了则覆盖读回值);审批提交(带 workItemId)可省略——平台使用已存业务数据"),
|
|
3500
3503
|
workflowCode: z.string().optional(),
|
|
3501
3504
|
workflowInstanceId: z.string().optional(),
|
|
3502
3505
|
workItemId: z.string().optional(),
|
|
@@ -3586,13 +3589,19 @@ export function registerRuntimeDataLane(tools) {
|
|
|
3586
3589
|
});
|
|
3587
3590
|
}
|
|
3588
3591
|
const { sheetCode, resolvedFrom } = await resolveFormSheetCode(session, { schemaCode: args.schemaCode, sheetCode: args.sheetCode });
|
|
3589
|
-
|
|
3592
|
+
// 只有**新建**提交才需要 formData:带 bizObjectId 时下面的载荷是
|
|
3593
|
+
// 「读回行全量 ⊕ formData」(本函数下方的既有行分支),formData 缺省与 {} 等价,
|
|
3594
|
+
// 平台侧 mergeObject 也是 map.putAll(existed.getData()) 再覆盖
|
|
3595
|
+
// (2.1.5 BizObjectFacadeImpl.java:1373-1379 / 8.6.26 :2461-2471),
|
|
3596
|
+
// 所以既有草稿直提省略 formData 是合法形状,不是缺参。
|
|
3597
|
+
if (!hasWorkItem && targetObjectId === null && args.formData === undefined) {
|
|
3590
3598
|
throw new ToolInputError({
|
|
3591
3599
|
status: "error",
|
|
3592
3600
|
blocker: "tool-input-invalid",
|
|
3593
3601
|
tool: "data.submit",
|
|
3594
|
-
message: "
|
|
3595
|
-
|
|
3602
|
+
message: "新建提交(无 bizObjectId)必须给 formData;**已有草稿直提可省略 formData**(按 data.load 读回行合并,省略 ≡ 传 {})。" +
|
|
3603
|
+
"要提交已有记录请在参数里直接带 bizObjectId(见 nextCommand),不要省略 bizObjectId。",
|
|
3604
|
+
nextCommand: `omc call data.submit --args '{"schemaCode":"<schemaCode>","bizObjectId":"<data.load 的 bizObjectId>"}'`,
|
|
3596
3605
|
});
|
|
3597
3606
|
}
|
|
3598
3607
|
const stampedSubmit = await prepareRuntimeFormData(session, args.schemaCode, (args.formData ?? {}), { isUpdate: targetObjectId !== null });
|
|
@@ -3642,7 +3651,6 @@ export function registerRuntimeDataLane(tools) {
|
|
|
3642
3651
|
`确要在提交携带人员字段(个别平台构建接受),显式带 allowStaffOnSubmit:true 自担。`,
|
|
3643
3652
|
});
|
|
3644
3653
|
}
|
|
3645
|
-
const validation = await portalRequiredViolations(session, args.schemaCode, sheetCode, args.formData ?? {}).catch(() => ({ requiredFields: [], missingRequired: [], requiredFace: "unavailable" }));
|
|
3646
3654
|
// Directive: a workflow-backed model's submit must START the workflow, not
|
|
3647
3655
|
// merely save a sheet row. When the caller names no workflow params, detect
|
|
3648
3656
|
// the model's workflow and start it (formType=1 + workflowCode); a model
|
|
@@ -3774,6 +3782,10 @@ export function registerRuntimeDataLane(tools) {
|
|
|
3774
3782
|
};
|
|
3775
3783
|
payload.actionCode = "submit";
|
|
3776
3784
|
}
|
|
3785
|
+
// 门户必填按**实际提交的载荷**判:新建=formData;既有行=上面合成的
|
|
3786
|
+
// bizObject.data(「读回行 ⊕ formData」)。只拿 args.formData 判,会在
|
|
3787
|
+
// 省略 formData 的既有草稿直提上误报 missingRequired。
|
|
3788
|
+
const validation = await portalRequiredViolations(session, args.schemaCode, sheetCode, payload.bizObject.data ?? {}).catch(() => ({ requiredFields: [], missingRequired: [], requiredFace: "unavailable" }));
|
|
3777
3789
|
let replayToken;
|
|
3778
3790
|
if (hasWorkflowCode && !hasWorkItem && !hasInstance) {
|
|
3779
3791
|
// Starting a workflow (formType=1 + workflowCode, no workItem) requires
|
package/dist/lanes/workflow.js
CHANGED
|
@@ -3328,7 +3328,28 @@ export function registerWorkflowLane(tools) {
|
|
|
3328
3328
|
const participantWarnings = participantReferenceWarnings(data);
|
|
3329
3329
|
const rejectWarnings = rejectToStartCancelWarnings(data);
|
|
3330
3330
|
const originatorWarnings = approvalByOriginatorWarnings(data);
|
|
3331
|
-
|
|
3331
|
+
// F10(0.8.6):平台 publish 成功后在**首次发布**(workflowVersion=1,两族同
|
|
3332
|
+
// 语义:2.1.5 ProcessDefineAssemblyServiceImpl:141-147 / 8.6.26 :175-181)会
|
|
3333
|
+
// 静默把该模型各列表视图的 add 动作改成 setQueryActionRelativeType(WORKFLOW)
|
|
3334
|
+
// + setRelativeCode(流程码)(WorkflowTemplateController.publish →
|
|
3335
|
+
// updateBizQueryBindWorkflowCode → updateBizQueryAddAction,8.6.26 :805/:830-846;
|
|
3336
|
+
// 2.1.5 :695-711/:741-761)。不告知的话清理期只在 workflow.delete 撞 303024。
|
|
3337
|
+
// 代价:平台列表面 listQueryList 只回 code/name,确认绑定需 1 次 list + 每视图
|
|
3338
|
+
// 1 次 get(本模型通常 1-3 个视图)。
|
|
3339
|
+
const addBindings = await listviewAddBindings(session, args.schemaCode, args.code);
|
|
3340
|
+
const firstPublish = Number(data.workflowVersion) === 1;
|
|
3341
|
+
const listviewBinding = {
|
|
3342
|
+
bound: addBindings.bound,
|
|
3343
|
+
...(firstPublish ? {} : { firstPublish: false }),
|
|
3344
|
+
note: addBindings.bound.length > 0
|
|
3345
|
+
? firstPublish
|
|
3346
|
+
? "首次发布已把本模型各列表视图的 add 动作绑到本流程;删流程前先 listview.configure 清 actions 或用 workflow.delete 的 nextCommand"
|
|
3347
|
+
: "列表视图的 add 动作已绑定本流程(本次不是首次发布,绑定沿用既有配置);删流程前先 listview.configure 清 actions 或用 workflow.delete 的 nextCommand"
|
|
3348
|
+
: addBindings.readable
|
|
3349
|
+
? "无隐式绑定"
|
|
3350
|
+
: "列表视图读取失败,未能确认 add 绑定;删流程前先 listview.get 复核",
|
|
3351
|
+
};
|
|
3352
|
+
return { performed: { errcode: performed.errcode }, readback: { workflowCode: args.code, published: isPublished, workflowVersion: data.workflowVersion ?? null, listviewBinding, ...(strippedEmptyConditionGroups > 0 ? { strippedEmptyConditionGroups, strippedEmptyConditionGroupsNote: "调用方连线里有 N 条带平台存量写法 ruleConditionGroup:[](=无条件);工具写前已剥离该键,未上送" } : {}), ...(warnings.length ? { warnings } : {}), ...(participantWarnings.length ? { participantWarnings } : {}), ...(rejectWarnings.length || originatorWarnings.length ? { workflowWarnings: [...rejectWarnings, ...originatorWarnings] } : {}), workflowRenderCompat: workflowRenderCompat(data) } };
|
|
3332
3353
|
},
|
|
3333
3354
|
preflight: (args) => {
|
|
3334
3355
|
assertTemplateNotMinimal(args.template ?? {}, "workflow.publish");
|
|
@@ -4239,6 +4260,50 @@ export function registerWorkflowLane(tools) {
|
|
|
4239
4260
|
// Publishing a flow creates NO permission row, so a freshly published flow is
|
|
4240
4261
|
// unusable by anyone who is not a platform admin.
|
|
4241
4262
|
const permissionRows = async (session, workflowCode) => wireRows((await wireCall(session, { path: ENDPOINTS.workflowListPermission, query: { workflowCode } })).data);
|
|
4263
|
+
/**
|
|
4264
|
+
* F10(0.8.6):workflow.publish 的隐式绑定回执。平台首次发布后会把该模型
|
|
4265
|
+
* 各列表视图 `add` 动作的 relativeType 改成 WORKFLOW、relativeCode 改成流程码
|
|
4266
|
+
* (8.6.26 WorkflowTemplateController.publish:805 → updateBizQueryAddAction:830-846;
|
|
4267
|
+
* 2.1.5 publish:695-711 → :741-761)。列表面只回 code/name,故需 1 次 list +
|
|
4268
|
+
* 每视图 1 次 get;读失败时 readable=false,回执不得谎称「无绑定」。
|
|
4269
|
+
*/
|
|
4270
|
+
async function listviewAddBindings(session, schemaCode, workflowCode) {
|
|
4271
|
+
const bound = [];
|
|
4272
|
+
let readable = false;
|
|
4273
|
+
try {
|
|
4274
|
+
const listed = wireRows((await wireCall(session, { path: ENDPOINTS.listQueryList, query: { schemaCode, clientType: "PC" } })).data);
|
|
4275
|
+
readable = true;
|
|
4276
|
+
for (const row of listed) {
|
|
4277
|
+
const code = String(row.code ?? "");
|
|
4278
|
+
if (!code)
|
|
4279
|
+
continue;
|
|
4280
|
+
try {
|
|
4281
|
+
const got = await wireCall(session, { path: ENDPOINTS.listQueryGet, query: { schemaCode, code, clientType: "PC" } });
|
|
4282
|
+
const model = (got.data ?? null);
|
|
4283
|
+
const actions = model !== null && Array.isArray(model.queryActions) ? model.queryActions : [];
|
|
4284
|
+
const hit = actions.some((action) => {
|
|
4285
|
+
if (String(action.actionCode ?? "") !== "add")
|
|
4286
|
+
return false;
|
|
4287
|
+
const association = action.queryActionRelativeType ?? action.associationType;
|
|
4288
|
+
const associationCode = String(action.relativeCode ?? action.associationCode ?? "");
|
|
4289
|
+
const isWorkflow = association === 1 ||
|
|
4290
|
+
association === "1" ||
|
|
4291
|
+
String(association ?? "").toUpperCase() === "WORKFLOW";
|
|
4292
|
+
return isWorkflow && (associationCode === workflowCode || associationCode === "");
|
|
4293
|
+
});
|
|
4294
|
+
if (hit)
|
|
4295
|
+
bound.push({ code, actionCode: "add" });
|
|
4296
|
+
}
|
|
4297
|
+
catch {
|
|
4298
|
+
readable = false;
|
|
4299
|
+
}
|
|
4300
|
+
}
|
|
4301
|
+
}
|
|
4302
|
+
catch {
|
|
4303
|
+
readable = false;
|
|
4304
|
+
}
|
|
4305
|
+
return { bound, readable };
|
|
4306
|
+
}
|
|
4242
4307
|
/** Best-effort: which list views still bind this workflow (303024 recovery). */
|
|
4243
4308
|
async function findListviewsBoundToWorkflow(session, schemaCode, workflowCode) {
|
|
4244
4309
|
const bound = [];
|
package/dist/model-purge.js
CHANGED
|
@@ -361,7 +361,7 @@ export async function cmdModelPurge(args) {
|
|
|
361
361
|
}
|
|
362
362
|
: {
|
|
363
363
|
note: "已清理:流程实例逐个删除 → model.delete 级联带走流程模板/列表视图/字段/表单/业务规则。" +
|
|
364
|
-
"model.delete
|
|
364
|
+
"model.delete 是平台异步任务(建删除历史后立即返回,级联时长不定),稍后仍能读到模型记录属正常残留,重跑本命令即可(幂等)。" +
|
|
365
365
|
"**这就是 r12–r14 三次脏沙盒的根治**:实例先走,就不会留下指向空模板的待办。",
|
|
366
366
|
}),
|
|
367
367
|
};
|
package/dist/model-scaffold.js
CHANGED
|
@@ -22,7 +22,7 @@ import { CLI_EXIT_CODES, classifyResult, envelope, refusalText, requestId } from
|
|
|
22
22
|
import { writeEnvelope } from "./cli-output.js";
|
|
23
23
|
import { assertSafeInputPath } from "./artifacts.js";
|
|
24
24
|
import { readFileSync } from "node:fs";
|
|
25
|
-
import { resolve } from "node:path";
|
|
25
|
+
import { join, resolve } from "node:path";
|
|
26
26
|
/** Validate the caller's `--fields` payload (fail before any write). */
|
|
27
27
|
export function validateScaffoldFields(fields) {
|
|
28
28
|
const problems = [];
|
|
@@ -98,12 +98,15 @@ export async function cmdModelScaffold(args) {
|
|
|
98
98
|
return invalid("--fields-file 不能与 --fields/--fields-json 同时使用");
|
|
99
99
|
let inputJson = fieldsJson;
|
|
100
100
|
if (fieldsFile !== undefined) {
|
|
101
|
+
const root = resolve(process.env.OMC_CONFIG_HOME ?? process.cwd());
|
|
101
102
|
try {
|
|
102
|
-
const root = resolve(process.env.OMC_CONFIG_HOME ?? process.cwd());
|
|
103
103
|
inputJson = readFileSync(assertSafeInputPath(root, fieldsFile, "--fields-file"), "utf8");
|
|
104
104
|
}
|
|
105
105
|
catch (error) {
|
|
106
|
-
|
|
106
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
107
|
+
// F2(0.8.6):越界报错要能直接照做——旧文案只说「必须在配置根内」,
|
|
108
|
+
// 不给路径。与 --args-file(cli.ts)同配方:给根内示例文件路径。
|
|
109
|
+
return invalid(`--fields-file 读取失败:${detail}${/must be inside the configuration root/.test(detail) ? `。把参数文件放到 ${root} 之下(如 ${join(root, "args.json")}),再用 --fields-file 引用` : ""}`);
|
|
107
110
|
}
|
|
108
111
|
}
|
|
109
112
|
if (inputJson === undefined)
|
|
@@ -34,7 +34,7 @@ const plainSubmit = Object.freeze({
|
|
|
34
34
|
args: { environment, schemaCode: model, formData: { name: "正式记录" } },
|
|
35
35
|
preconditions: ["模型无已发布流程(有流程走 workflow-backed-data-submit)", "模型+表单已发布"],
|
|
36
36
|
conditionalRequirements: [
|
|
37
|
-
"**不带 bizObjectId 即新建并提交**(工具内部建稿+直提,一次调用 COMPLETED);已有草稿要直提时才带 data.save 读回的 bizObjectId;不要手造 id",
|
|
37
|
+
"**不带 bizObjectId 即新建并提交**(工具内部建稿+直提,一次调用 COMPLETED);已有草稿要直提时才带 data.save 读回的 bizObjectId;不要手造 id。**带 bizObjectId 时 formData 可省略**(载荷=读回行 ⊕ formData,省略 ≡ 传 {},给了则覆盖),新建(无 id)才必须给 formData",
|
|
38
38
|
"**目标模型已发布流程时行为不同(r36 实证)**:无 workItemId 的 data.submit = 一调新建并**启动流程**(PROCESSING,读回返回首审批待办 workItemId)——合法路径非错误;要『先草稿后提交/中途改稿』用两段式 data.save(草稿读回三元身份)→ data.submit(workItemId)",
|
|
39
39
|
],
|
|
40
40
|
priorToolReferences: [],
|
package/dist/residue.js
CHANGED
|
@@ -133,7 +133,7 @@ export async function scanResidues(session, prefix, options = {}) {
|
|
|
133
133
|
coverage: { report: "not-scanned(用 report.tree + report.get 判,BI 残留看 readback.biResidue)", workflow: "模板跟模型走(模型删即删)" },
|
|
134
134
|
...(systemPresetCount > 0 ? { systemPresetCount } : {}),
|
|
135
135
|
...(pendingCascade ? { pendingCascade: true } : {}),
|
|
136
|
-
note: pendingCascade ? "
|
|
136
|
+
note: pendingCascade ? "模型已不存在但仍有级联面命中:平台删除为异步任务、时长不定,稍后重跑,幂等" : "clean 仅指已扫描面;report 面未扫描——报表残留判定用 report.tree(树)+ report.get(BI 残留看 biResidue)",
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
139
|
export async function cmdResidue(prefix, options, transport) {
|
|
@@ -49,6 +49,25 @@ const FAMILY_GAPS = [
|
|
|
49
49
|
evidence: "r27 真机 2026-11-05(1.1.25,reporter 未起):biInit:failed;r63/r65 真机(同 1.1.25,reporter 已起):biInitialized:true、bi.present:true——族级结论已被实测推翻,needsReconfirm",
|
|
50
50
|
},
|
|
51
51
|
];
|
|
52
|
+
/**
|
|
53
|
+
* 按版本族登记的**差异清单指针**(`kind: "family-delta"`)。
|
|
54
|
+
*
|
|
55
|
+
* 与 `FAMILY_GAPS` 的区别:那里登记的是「该族缺这个端点」,这里登记的是
|
|
56
|
+
* 「该族与锚点有**逐条清单**的差异」——既有新增/收紧,也有同形契约。2.1 属于后者:
|
|
57
|
+
* 它的差异分散在列表视图删除门(306103)、查看态按钮拆分、物理删除异步完成面等
|
|
58
|
+
* 多条上,逐条写在文档里。调用方**先读 `doc` 再下结论**;未登记的条目不要臆断
|
|
59
|
+
* 「与 8.6 同形」或「都变了」——两句话都是无证据断言。
|
|
60
|
+
*/
|
|
61
|
+
const FAMILY_DELTAS = [
|
|
62
|
+
{
|
|
63
|
+
id: "ai-platform 2.1 族差异(非缺席,逐条清单)",
|
|
64
|
+
kind: "family-delta",
|
|
65
|
+
families: ["2.1"],
|
|
66
|
+
doc: "docs/platform-contracts/2.1-delta.md",
|
|
67
|
+
fallback: "先读 docs/platform-contracts/2.1-delta.md(§2.11 通用契约、§2.12 2.1 新增,逐条带 file:line)再动手;已知项含 2.1 新增的列表视图删除门(306103:至少各留一个 PC/MOBILE 可见视图)。清单未覆盖的面按平台实测为准",
|
|
68
|
+
evidence: "launcher-2.1.5 反编译对照 launcher-8.6.26(2.1-delta.md §2.11/§2.12 的 file:line);探针 A 2026-11-26 双版本核实;客户口径 8.8 = AI-Platform 2.1.x(同文档标题)",
|
|
69
|
+
},
|
|
70
|
+
];
|
|
52
71
|
/** r28k F9 — 固定文案,doctor / get_status 共用,避免两义。 */
|
|
53
72
|
export const KNOWN_GAPS_CLAIM_MEANING = "只列已知缺口;未列 ≠ 已验证可用——跨版本面一律先 scouting / 看 coverage.manifest";
|
|
54
73
|
function familyOf(version) {
|
|
@@ -60,14 +79,15 @@ function familyOf(version) {
|
|
|
60
79
|
* `version` 为 undefined(无版本证据)时返回全部家族条目——保守方向:
|
|
61
80
|
* 调用方宁可多看到一条,也不要漏掉一个会 404 的端点。
|
|
62
81
|
*
|
|
63
|
-
* 族判定用 `partitionVersion`(version-partition.ts
|
|
64
|
-
* `families` 仍是 **X.Y 端点族**(8.0/8.1、1.0/1.1),因为缺口是端点级而不是
|
|
82
|
+
* 族判定用 `partitionVersion`(version-partition.ts);`FAMILY_GAPS` / `FAMILY_DELTAS`
|
|
83
|
+
* 里的 `families` 仍是 **X.Y 端点族**(8.0/8.1、1.0/1.1、2.1),因为缺口是端点级而不是
|
|
65
84
|
* 整个分区级的——分区级能力差异看 `CAPABILITIES`。
|
|
66
85
|
*/
|
|
67
86
|
export function unsupportedCapabilities(manifest, version) {
|
|
68
87
|
const partition = partitionVersion(version);
|
|
69
88
|
const family = version === undefined ? undefined : familyOf(version);
|
|
70
89
|
const applicable = FAMILY_GAPS.filter((gap) => family === undefined || gap.families === undefined || gap.families.includes(family));
|
|
90
|
+
const deltas = FAMILY_DELTAS.filter((delta) => family === undefined || delta.families === undefined || delta.families.includes(family));
|
|
71
91
|
return {
|
|
72
92
|
completeness: "known-gaps-only",
|
|
73
93
|
coverageClaim: "known-gaps-only",
|
|
@@ -76,7 +96,8 @@ export function unsupportedCapabilities(manifest, version) {
|
|
|
76
96
|
inAnchorFamily: version === undefined ? null : partition.family === "anchor-8.6" || version.startsWith(`${manifest.version_family}.`),
|
|
77
97
|
partition: { family: partition.family, confidence: partition.confidence, matched: partition.matched },
|
|
78
98
|
// 锚点族内部无缺口时也别回空数组造成"没有限制"的错觉——platform-absent 永远在。
|
|
79
|
-
|
|
99
|
+
// 族差异指针排在最前:调用方先看到「这一族有逐条清单」,再读具体缺口。
|
|
100
|
+
capabilities: [...deltas, ...applicable, ...PLATFORM_ABSENCES],
|
|
80
101
|
};
|
|
81
102
|
}
|
|
82
103
|
/**
|
|
@@ -90,16 +111,22 @@ export function formatDoctorHumanSummary(input) {
|
|
|
90
111
|
if (input.warnCount <= 0 && caps.length === 0) {
|
|
91
112
|
return `${head}——逐项明细与冷启动指引在 stdout 的 result`;
|
|
92
113
|
}
|
|
114
|
+
// `family-delta` 是「这一族有逐条差异清单」的指针,不是「不可用」:
|
|
115
|
+
// 混进「不可用:」会读成能力缺失(2.1 的多数差异是新增/收紧)。
|
|
116
|
+
const deltas = caps.filter((cap) => cap.kind === "family-delta");
|
|
117
|
+
const unavailableCaps = caps.filter((cap) => cap.kind !== "family-delta");
|
|
93
118
|
const versionBit = typeof input.detectedVersion === "string" && input.detectedVersion.length > 0
|
|
94
119
|
? `版本 ${input.detectedVersion}`
|
|
95
120
|
: input.unsupported?.detectedVersion
|
|
96
121
|
? `版本 ${input.unsupported.detectedVersion}`
|
|
97
122
|
: undefined;
|
|
98
|
-
const shortIds =
|
|
123
|
+
const shortIds = unavailableCaps.slice(0, 6).map((cap) => shortCapabilityId(cap.id));
|
|
99
124
|
const unavailable = shortIds.length > 0
|
|
100
|
-
? `不可用:${shortIds.join("、")}${
|
|
125
|
+
? `不可用:${shortIds.join("、")}${unavailableCaps.length > shortIds.length ? ` 等${unavailableCaps.length}项` : ""}`
|
|
101
126
|
: undefined;
|
|
102
|
-
const
|
|
127
|
+
const docs = [...new Set(deltas.map((cap) => cap.doc).filter((doc) => typeof doc === "string" && doc.length > 0))];
|
|
128
|
+
const deltaBit = docs.length > 0 ? `族差异清单:${docs.join("、")}` : undefined;
|
|
129
|
+
const detail = [versionBit, unavailable, deltaBit].filter(Boolean).join(";");
|
|
103
130
|
return detail.length > 0
|
|
104
131
|
? `${head}——${detail}(详见 result.unsupportedCapabilities)`
|
|
105
132
|
: `${head}——逐项明细、冷启动指引与 unsupportedCapabilities 都在 stdout 的 result(stderr 不重复)`;
|
package/dist/write.js
CHANGED
|
@@ -22,7 +22,7 @@ import { capabilityArg, confirmProductionArg, environmentArg, WRITE_PROTOCOL } f
|
|
|
22
22
|
import { plannableArgsRaw } from "./plan.js";
|
|
23
23
|
import { defineTool, ToolRefusalError } from "./tool-types.js";
|
|
24
24
|
import { assertFieldFamilyAllowed } from "./field-families.js";
|
|
25
|
-
import { validateBusinessCode } from "./code-rules.js";
|
|
25
|
+
import { validateBusinessCode, validateFieldEntryCodes } from "./code-rules.js";
|
|
26
26
|
import { hardLayoutViolations, validateFormLayout } from "./form-layout.js";
|
|
27
27
|
import { prepareRuleGraph, validateRuleNodeGraph } from "./lanes/rule-graph.js";
|
|
28
28
|
import { assertRuleNamePlatformAcceptable } from "./rule-support.js";
|
|
@@ -421,15 +421,36 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
421
421
|
* has not proven its write. "Called without error" must never be stamped
|
|
422
422
|
* DELIVERED (live 2026-10-17: model.create returned errcode 0 + present:false
|
|
423
423
|
* while the menu row was orphaned; the AI read DELIVERED as success).
|
|
424
|
+
*
|
|
425
|
+
* Deletion receipts use the mirror key: `readback.absent`. The platform's
|
|
426
|
+
* physically_delete is an async task (AppPackageController.java:1351-1358 /
|
|
427
|
+
* 8.6.26 :1423 → AppIntegrationFacadeImpl.syncDeletePhysicalResources
|
|
428
|
+
* :1112-1131 creates `AppDeleteHistory(TaskStatus.RUN)` and returns
|
|
429
|
+
* immediately), so `absent:false` means "cascade still running", NOT success.
|
|
430
|
+
* Without this branch the same receipt was stamped DELIVERED (0.8.5 live).
|
|
424
431
|
*/
|
|
425
432
|
export function deliveryStateFor(readback) {
|
|
426
|
-
const
|
|
427
|
-
|
|
428
|
-
|
|
433
|
+
const record = readback !== null && typeof readback === "object" ? readback : undefined;
|
|
434
|
+
if (record?.present === false)
|
|
435
|
+
return {
|
|
429
436
|
deliveryState: "WRITE_UNVERIFIED",
|
|
430
437
|
readbackWarning: "读回显示目标不存在(readback.present=false):平台接受了请求但权威面查不到——不要当作最终一致性豁免,按失败排查(模型挂载/路径/权限)",
|
|
431
|
-
}
|
|
432
|
-
|
|
438
|
+
};
|
|
439
|
+
// `absent:false` on a deletion receipt = the authoritative record face still
|
|
440
|
+
// returns the target. The platform accepted the request but the async delete
|
|
441
|
+
// has not completed; never read that as "deleted".
|
|
442
|
+
if (record?.absent === false)
|
|
443
|
+
return {
|
|
444
|
+
deliveryState: "WRITE_UNVERIFIED",
|
|
445
|
+
readbackWarning: "目标是删除级联中:平台 async 任务未完成(readback.absent=false,权威面仍查得到目标),勿当成功——以记录面 absent=true 且应用树无节点为准,稍后重跑本工具(幂等)复核",
|
|
446
|
+
};
|
|
447
|
+
// model.deleteMany reports the same fact per target: `allAbsent:false`.
|
|
448
|
+
if (record?.allAbsent === false)
|
|
449
|
+
return {
|
|
450
|
+
deliveryState: "WRITE_UNVERIFIED",
|
|
451
|
+
readbackWarning: "目标是删除级联中:平台 async 任务未完成(readback.allAbsent=false,见 perCode 逐项),勿当成功——稍后重跑本工具(幂等)复核",
|
|
452
|
+
};
|
|
453
|
+
return { deliveryState: "DELIVERED" };
|
|
433
454
|
}
|
|
434
455
|
/**
|
|
435
456
|
* Single source of truth for requestId replay enum strings (r30a F1).
|
|
@@ -561,9 +582,14 @@ export function writeTool(definition) {
|
|
|
561
582
|
if (name === "field.create")
|
|
562
583
|
assertFieldFamilyAllowed(args);
|
|
563
584
|
// CFG-naming: reject an invalid business code BEFORE the write permission
|
|
564
|
-
// gate and any wire call (length / style / reserved system codes).
|
|
585
|
+
// gate and any wire call (length / style / reserved system codes). For
|
|
586
|
+
// CHILD_TABLE this also lints its sub-column codes: child columns are
|
|
587
|
+
// properties on the sub-schema, so the platform applies the same
|
|
588
|
+
// DefaultPropertyType/ExtendType checks plus DefaultSubPropertyType.
|
|
565
589
|
if (name === "model.create" || name === "field.create") {
|
|
566
|
-
const violations =
|
|
590
|
+
const violations = name === "model.create"
|
|
591
|
+
? validateBusinessCode(String(args.code ?? ""), { kind: "model" })
|
|
592
|
+
: validateFieldEntryCodes(args);
|
|
567
593
|
if (violations.length > 0)
|
|
568
594
|
throw new ToolRefusalError({ status: "refused", blocker: "business-code-invalid", message: "code 未过出门前校验;按 validation 修正(长度/风格/保留字)", validation: violations });
|
|
569
595
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.6",
|
|
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.6",
|
|
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.6"
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -48,6 +48,7 @@ node "$CLI" help omc-five-piece-flow
|
|
|
48
48
|
- **code 长度平台硬限**:模型 code ≤26 字符、字段 code ≤28(`business-code-invalid` 出门校验;长业务名先起短 code,长名放 name)。
|
|
49
49
|
- 模型层字段默认可空;必填、只读、可见性在表单和流程节点配置。
|
|
50
50
|
- `propertyEmpty` 默认 `false`,不要把业务必填硬编码在数据模型。
|
|
51
|
+
- **`<code>_key` 孪生列(单选/字典,8.6/2.1 同形)**:运行面成对存 `<code>`(显示值)与 `<code>_key`(字典 key),列表开 `displayBackupColumns` 才加进列集;**过滤用原字段名 + key 值**(不是显示值),否则静默 0 条(2.1.5 `BizObject.java:59`/`BizObjectFacadeImpl.java:1857`;8.6.26 `:83`/`:4182`)。
|
|
51
52
|
- 关联单选优先读目标模型已发布字段,明确显示字段;无映射不要写空数组字符串。
|
|
52
53
|
|
|
53
54
|
## 子表
|
package/skills/omc-refusals.md
CHANGED
|
@@ -114,8 +114,10 @@ approved draft, and decide with the human. A second write may duplicate.
|
|
|
114
114
|
**dependency-inverted**: delete referencing models first, then the referenced
|
|
115
115
|
one.
|
|
116
116
|
- `absent:false` + `treeNodePending:true` with `nextAction:"wait-and-recheck"` —
|
|
117
|
-
the platform's
|
|
118
|
-
|
|
117
|
+
the platform's delete is an async task whose duration is unbounded (a live
|
|
118
|
+
probe exceeded 4 minutes); `deliveryState` is `WRITE_UNVERIFIED`. **Not a
|
|
119
|
+
failure — but not a completed deletion either.** Re-run later; the call is
|
|
120
|
+
idempotent and `already-absent` short-circuits.
|
|
119
121
|
|
|
120
122
|
## 6. Idempotency & replay
|
|
121
123
|
|