@stalfh233/omc-cli 0.6.65 → 0.6.66
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/cli.js +5 -3
- package/dist/config-store.js +58 -6
- package/dist/form-support.js +88 -26
- package/dist/lanes/businessrule.js +10 -2
- package/dist/lanes/form-contract.js +4 -4
- package/dist/lanes/form.js +9 -2
- package/dist/lanes/rule-graph.js +15 -0
- package/dist/read-shapes.js +5 -2
- package/dist/recipes/businessrule.js +2 -1
- package/dist/refusal-guidance.js +14 -0
- package/dist/write.js +9 -4
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createInterface } from "node:readline/promises";
|
|
|
7
7
|
import { stdin, argv } from "node:process";
|
|
8
8
|
import { createRequire } from "node:module";
|
|
9
9
|
import { Command, CommanderError, Option } from "commander";
|
|
10
|
-
import { ConfigStore, defaultPaths, removedProfileKeys } from "./config-store.js";
|
|
10
|
+
import { ConfigStore, defaultPaths, removedProfileKeys, resolveMainCheckout } from "./config-store.js";
|
|
11
11
|
import { loadCoverageManifest, versionFamilyNotice } from "./coverage.js";
|
|
12
12
|
import { redactText } from "./redact.js";
|
|
13
13
|
import { readArgsFile, readStdinArgs, runToolCall, toolsByTextIntent, validateAgentPaths } from "./call.js";
|
|
@@ -613,7 +613,7 @@ async function cmdCall(store, args) {
|
|
|
613
613
|
if (rawArgs === "-")
|
|
614
614
|
parsedArgs = readStdinArgs();
|
|
615
615
|
else if (argsFile)
|
|
616
|
-
parsedArgs = readArgsFile(argsFile, resolve(process.env.OMC_CONFIG_HOME ?? process.cwd()));
|
|
616
|
+
parsedArgs = readArgsFile(argsFile, resolve(process.env.OMC_CONFIG_HOME ?? resolveMainCheckout(process.cwd())));
|
|
617
617
|
else if (rawArgs) {
|
|
618
618
|
parsedArgs = JSON.parse(rawArgs);
|
|
619
619
|
if (parsedArgs === null || typeof parsedArgs !== "object" || Array.isArray(parsedArgs))
|
|
@@ -626,7 +626,9 @@ async function cmdCall(store, args) {
|
|
|
626
626
|
// r10 F9: an out-of-root `--args-file` was reported under "--args 必须是
|
|
627
627
|
// 合法 JSON", which points the reader at the wrong flag. Name the real
|
|
628
628
|
// cause (and the configuration root) when the failure came from the file.
|
|
629
|
-
|
|
629
|
+
// 线上 #39-D:args-file 配置根与 .omc-envs 同源——worktree 下回退主检出
|
|
630
|
+
// (git 结构锚定),.scratch 参数文件不再因 worktree 被迫挪位置。
|
|
631
|
+
const configRoot = resolve(process.env.OMC_CONFIG_HOME ?? resolveMainCheckout(process.cwd()));
|
|
630
632
|
// 1.1 of issue 2026-10-23: the old hint told the caller to write a TEMP file
|
|
631
633
|
// while the validator only accepts paths under the config root — the two
|
|
632
634
|
// instructions contradicted each other and neither named the root. Offer a
|
package/dist/config-store.js
CHANGED
|
@@ -1,7 +1,38 @@
|
|
|
1
1
|
import { existsSync, readFileSync, copyFileSync, chmodSync, mkdirSync, statSync } from "node:fs";
|
|
2
2
|
import { dirname, join, resolve } from "node:path";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
4
5
|
import { sync as writeFileAtomicSync } from "write-file-atomic";
|
|
6
|
+
/**
|
|
7
|
+
* 线上 #39 摩擦 D(詹记真机 2026-11-16):git worktree 下环境准入失效——`.omc-envs`
|
|
8
|
+
* 白名单绑定「当前目录」,同一仓库每开一个 worktree 就丢一次准入。回退解析:worktree 的
|
|
9
|
+
* `.git` 是指向主仓的指针文件,`git rev-parse --git-common-dir` 回主仓 `.git`,其父目录
|
|
10
|
+
* 即主检出。**git 结构锚定**(不是任意向上爬目录):仅当 cwd 的 .git 缺席或为指针文件、
|
|
11
|
+
* 且解析出的主检出 ≠ cwd 时才回退——白名单语义不变(同一 git 仓库 = 同一项目)。
|
|
12
|
+
*/
|
|
13
|
+
export function resolveMainCheckout(projectDir = process.cwd()) {
|
|
14
|
+
const cwd = resolve(projectDir);
|
|
15
|
+
const dotGit = join(cwd, ".git");
|
|
16
|
+
if (!existsSync(dotGit))
|
|
17
|
+
return cwd; // 非 git 目录:不猜
|
|
18
|
+
try {
|
|
19
|
+
const stat = statSync(dotGit);
|
|
20
|
+
if (stat.isDirectory())
|
|
21
|
+
return cwd; // 主检出本身:无需回退
|
|
22
|
+
// .git 是文件(worktree 指针)——用 git 解析主仓
|
|
23
|
+
const r = spawnSync("git", ["rev-parse", "--git-common-dir"], { cwd, encoding: "utf8", timeout: 5_000 });
|
|
24
|
+
if (r.status === 0 && typeof r.stdout === "string") {
|
|
25
|
+
const commonDir = resolve(cwd, r.stdout.trim());
|
|
26
|
+
const mainCheckout = dirname(commonDir);
|
|
27
|
+
if (mainCheckout !== cwd && existsSync(join(mainCheckout, ".git")))
|
|
28
|
+
return mainCheckout;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// git 不可用/超时:按无回退处理
|
|
33
|
+
}
|
|
34
|
+
return cwd;
|
|
35
|
+
}
|
|
5
36
|
/**
|
|
6
37
|
* Removed governance keys. This is a development branch: seeing one of these in
|
|
7
38
|
* an operator's omc.config.json is an error to be fixed, never silently ignored
|
|
@@ -160,15 +191,36 @@ export class ConfigStore {
|
|
|
160
191
|
return [...names];
|
|
161
192
|
}
|
|
162
193
|
readProjectEnvBinding() {
|
|
163
|
-
if (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
194
|
+
if (existsSync(this.paths.projectEnvPath)) {
|
|
195
|
+
const name = readFileSync(this.paths.projectEnvPath, "utf8").trim();
|
|
196
|
+
if (name)
|
|
197
|
+
return name;
|
|
198
|
+
}
|
|
199
|
+
// 线上 #39-D:worktree 下回退主检出的 .omc-env(cwd 无绑定或空时)。
|
|
200
|
+
const main = join(resolveMainCheckout(dirname(this.paths.projectEnvPath)), ".omc-env");
|
|
201
|
+
if (main !== this.paths.projectEnvPath && existsSync(main)) {
|
|
202
|
+
const name = readFileSync(main, "utf8").trim();
|
|
203
|
+
if (name)
|
|
204
|
+
return name;
|
|
205
|
+
}
|
|
206
|
+
return undefined;
|
|
167
207
|
}
|
|
168
208
|
readProjectEnvsFile() {
|
|
169
|
-
|
|
209
|
+
const fromCwd = this.readEnvsFrom(this.paths.projectEnvsPath);
|
|
210
|
+
if (fromCwd.length > 0)
|
|
211
|
+
return fromCwd;
|
|
212
|
+
// 线上 #39-D:worktree 丢环境准入——cwd 的 .omc-envs 不存在/为空时,回退同一
|
|
213
|
+
// git 仓库主检出的白名单(git 结构锚定,见 resolveMainCheckout)。显式本地文件
|
|
214
|
+
// 优先(worktree 里 omc env allow 写的是 cwd,语义保持)。
|
|
215
|
+
const main = join(resolveMainCheckout(dirname(this.paths.projectEnvsPath)), ".omc-envs");
|
|
216
|
+
if (main !== this.paths.projectEnvsPath)
|
|
217
|
+
return this.readEnvsFrom(main);
|
|
218
|
+
return [];
|
|
219
|
+
}
|
|
220
|
+
readEnvsFrom(path) {
|
|
221
|
+
if (!existsSync(path))
|
|
170
222
|
return [];
|
|
171
|
-
return readFileSync(
|
|
223
|
+
return readFileSync(path, "utf8")
|
|
172
224
|
.split(/\r?\n/u)
|
|
173
225
|
.map((line) => line.replace(/#.*$/u, "").trim())
|
|
174
226
|
.filter((line) => line !== "");
|
package/dist/form-support.js
CHANGED
|
@@ -834,20 +834,21 @@ export function refuseEmptyCallerLayout(args) {
|
|
|
834
834
|
}
|
|
835
835
|
/**
|
|
836
836
|
* Form-toolbar buttons are a THREE-LAYER configuration (live 2026-10-23, 1.1.25
|
|
837
|
-
* + backend source):
|
|
838
|
-
* 1. `bizsheet.options.customButtonJson`
|
|
839
|
-
*
|
|
837
|
+
* + backend source; shape corrected by GitLab #38, live 8.6.26 2026-11-16):
|
|
838
|
+
* 1. `bizsheet.options.customButtonJson` — a JSON ARRAY with each entry's
|
|
839
|
+
* `actionConfig` as an OBJECT (the designer's own save shape) — is the
|
|
840
|
+
* authoring face; `ModelManagementFacadeImpl.publishBizForm:1022` turns it
|
|
840
841
|
* into `h_biz_button` rows with `triggerType=FORM`, `triggerCode=<formCode>`
|
|
841
|
-
* at publish time.
|
|
842
|
+
* at publish time. The pre-r72 CLI wrote a STRINGIFIED array (double JSON
|
|
843
|
+
* encoding); the platform stores that string verbatim in the JSON column
|
|
844
|
+
* and the form page then silently drops every button (#38: designer-shaped
|
|
845
|
+
* columns render, stringified ones never do — version drift vs the 1.1.25
|
|
846
|
+
* fastjson refusal, which is why the string form was ever written).
|
|
842
847
|
* 2. Those rows are what `ActionPermissionHandler` reads
|
|
843
848
|
* (`getByTriggerTypeAndCode(FORM, bizCode)`).
|
|
844
849
|
* 3. Whether a button shows at a given node is filtered by the workflow
|
|
845
850
|
* activity's `buttonPermission.customBtns[].enabled` (the designer's
|
|
846
851
|
* 「表单操作」 checkboxes) plus `showPermCode`.
|
|
847
|
-
*
|
|
848
|
-
* `customButtonJson` MUST stay a string inside the options JSON — passing the
|
|
849
|
-
* array inline makes the platform answer 50000 (fastjson
|
|
850
|
-
* "syntax error, position at 0, name customButtonJson").
|
|
851
852
|
*/
|
|
852
853
|
export const FORM_BUTTON_LOCATIONS = Object.freeze(["FORM", "ROW", "LIST"]);
|
|
853
854
|
const FORM_BUTTON_BIND_ACTIONS = new Set([
|
|
@@ -906,6 +907,17 @@ export function validateFormButtons(buttons, tool) {
|
|
|
906
907
|
if ((bindAction === "BUSINESS_RULE" || bindAction === "FLOW") && (typeof button.targetCode !== "string" || button.targetCode === ""))
|
|
907
908
|
throw new ToolRefusalError({ status: "refused", blocker: "form-buttons-invalid", message: `${tool}: buttons[${index}] ${bindAction} 需要 targetCode` });
|
|
908
909
|
}
|
|
910
|
+
// actionConfig rides inside options.customButtonJson as a JSON OBJECT —
|
|
911
|
+
// the designer's own shape (live #38, 8.6.26). The old code serialized it
|
|
912
|
+
// once (the h_biz_button.actionConfig WIRE column is a String), but on the
|
|
913
|
+
// stored-options face a stringified actionConfig inside a stringified
|
|
914
|
+
// customButtonJson is exactly the double encoding that made the form page
|
|
915
|
+
// silently drop every button. A stringified blob from a legacy readback is
|
|
916
|
+
// unwrapped to the object; a corrupt one refuses.
|
|
917
|
+
if (rawConfig !== undefined && rawConfig !== null && (Array.isArray(rawConfig) || typeof rawConfig !== "object") && typeof rawConfig !== "string")
|
|
918
|
+
throw new ToolRefusalError({ status: "refused", blocker: "form-buttons-invalid", message: `${tool}: buttons[${index}].actionConfig 必须是对象(或其 JSON 字符串)` });
|
|
919
|
+
if (rawConfig !== undefined && typeof rawConfig === "string" && rawConfig.trim() !== "" && config === undefined && scriptShorthand === undefined)
|
|
920
|
+
throw new ToolRefusalError({ status: "refused", blocker: "form-buttons-invalid", message: `${tool}: buttons[${index}].actionConfig 不是合法 JSON 对象(解析失败)` });
|
|
909
921
|
return {
|
|
910
922
|
...button,
|
|
911
923
|
code,
|
|
@@ -913,13 +925,9 @@ export function validateFormButtons(buttons, tool) {
|
|
|
913
925
|
useLocation,
|
|
914
926
|
bindAction,
|
|
915
927
|
operateType,
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
? { actionConfig: JSON.stringify({ ...(config ?? {}), scriptData: scriptShorthand }) }
|
|
920
|
-
: button.actionConfig !== undefined && typeof button.actionConfig !== "string"
|
|
921
|
-
? { actionConfig: JSON.stringify(button.actionConfig) }
|
|
922
|
-
: {}),
|
|
928
|
+
...(config !== undefined || scriptShorthand !== undefined
|
|
929
|
+
? { actionConfig: { ...(config ?? {}), ...(scriptShorthand !== undefined ? { scriptData: scriptShorthand } : {}) } }
|
|
930
|
+
: {}),
|
|
923
931
|
sortKey: typeof button.sortKey === "number" ? button.sortKey : index,
|
|
924
932
|
};
|
|
925
933
|
});
|
|
@@ -1019,28 +1027,77 @@ export function mergeFormOptionsWithButtons(existingOptions, input, tool) {
|
|
|
1019
1027
|
else if (rawConfig !== null && typeof rawConfig === "object" && !Array.isArray(rawConfig)) {
|
|
1020
1028
|
config = { ...rawConfig };
|
|
1021
1029
|
}
|
|
1022
|
-
byCode.set(patch.code, { ...current, actionConfig:
|
|
1030
|
+
byCode.set(patch.code, { ...current, actionConfig: { ...config, scriptData: patch.script } });
|
|
1023
1031
|
}
|
|
1024
1032
|
final = [...byCode.values()].map((button, index) => ({ ...button, sortKey: typeof button.sortKey === "number" ? button.sortKey : index }));
|
|
1025
1033
|
}
|
|
1026
1034
|
if (removeCodes.length > 0 && mode === "replace")
|
|
1027
1035
|
throw new ToolRefusalError({ status: "refused", blocker: "form-buttons-invalid", message: `${tool}: removeButtonCodes 只用于 buttonsMode:"merge"(replace 已用新列表整体替换)` });
|
|
1028
|
-
options
|
|
1036
|
+
// #38: the column rides `options` as a JSON ARRAY (designer shape) — the
|
|
1037
|
+
// options column itself is serialized once for the wire, so an extra
|
|
1038
|
+
// JSON.stringify here is double encoding the platform stores verbatim and
|
|
1039
|
+
// the form page then drops every button. Legacy dirty entries (a
|
|
1040
|
+
// stringified actionConfig inside an ARRAY-form rewrite of a stringified
|
|
1041
|
+
// column) are unwrapped on the way through, so ANY button write heals the
|
|
1042
|
+
// whole list.
|
|
1043
|
+
options.customButtonJson = final.map(unwrapButtonActionConfig);
|
|
1029
1044
|
return JSON.stringify(options);
|
|
1030
1045
|
}
|
|
1031
|
-
/**
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1046
|
+
/** #38: a stored legacy button may carry a STRINGIFIED actionConfig (the old
|
|
1047
|
+
* CLI write shape). Unwrap it to the object form so a rewrite heals it; a
|
|
1048
|
+
* corrupt blob is passed through untouched for the readback lint to name. */
|
|
1049
|
+
function unwrapButtonActionConfig(button) {
|
|
1050
|
+
const rawConfig = button.actionConfig;
|
|
1051
|
+
if (typeof rawConfig !== "string" || rawConfig.trim() === "")
|
|
1052
|
+
return button;
|
|
1037
1053
|
try {
|
|
1038
|
-
const parsed = JSON.parse(
|
|
1039
|
-
|
|
1054
|
+
const parsed = JSON.parse(rawConfig);
|
|
1055
|
+
if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed))
|
|
1056
|
+
return { ...button, actionConfig: parsed };
|
|
1040
1057
|
}
|
|
1041
1058
|
catch {
|
|
1042
|
-
|
|
1059
|
+
// corrupt blob: leave verbatim — form.get/readback shape lint names it
|
|
1060
|
+
}
|
|
1061
|
+
return button;
|
|
1062
|
+
}
|
|
1063
|
+
export function customButtonJsonStoredShape(options) {
|
|
1064
|
+
const record = decodeOptionsColumn(options);
|
|
1065
|
+
const raw = record.customButtonJson;
|
|
1066
|
+
if (raw === null || raw === undefined || raw === "")
|
|
1067
|
+
return "absent";
|
|
1068
|
+
if (Array.isArray(raw))
|
|
1069
|
+
return "array";
|
|
1070
|
+
if (typeof raw === "string") {
|
|
1071
|
+
try {
|
|
1072
|
+
return Array.isArray(JSON.parse(raw)) ? "string" : "absent";
|
|
1073
|
+
}
|
|
1074
|
+
catch {
|
|
1075
|
+
return "absent";
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
return "absent";
|
|
1079
|
+
}
|
|
1080
|
+
export const CUSTOM_BUTTON_JSON_STRING_SHAPE_WARNING = "customButtonJson 被存为字符串(双重编码)——前端按钮不渲染,设计器形状=数组+actionConfig 对象(线上 #38);用 form.draft/form.publish 重写 buttons 即自愈";
|
|
1081
|
+
/** The caller's buttons from a READ face (parsed array, or null when absent).
|
|
1082
|
+
* #39/#38: decodes BOTH stored forms — the designer's ARRAY (authoritative;
|
|
1083
|
+
* the read face used to be blind to it and answered null while the store
|
|
1084
|
+
* held real buttons) and the legacy stringified one (dirty stores must read
|
|
1085
|
+
* back too, flagged by customButtonJsonStoredShape). */
|
|
1086
|
+
export function readFormButtons(options) {
|
|
1087
|
+
const record = decodeOptionsColumn(options);
|
|
1088
|
+
const raw = record.customButtonJson;
|
|
1089
|
+
let parsed = raw;
|
|
1090
|
+
if (typeof raw === "string") {
|
|
1091
|
+
if (raw === "")
|
|
1092
|
+
return null;
|
|
1093
|
+
try {
|
|
1094
|
+
parsed = JSON.parse(raw);
|
|
1095
|
+
}
|
|
1096
|
+
catch {
|
|
1097
|
+
return null;
|
|
1098
|
+
}
|
|
1043
1099
|
}
|
|
1100
|
+
return Array.isArray(parsed) ? parsed : null;
|
|
1044
1101
|
}
|
|
1045
1102
|
export async function executeFormDraftWrite(session, args) {
|
|
1046
1103
|
// 兼容别名:`fieldCodes:["items.category"]` 等价于
|
|
@@ -1430,6 +1487,9 @@ export async function executeFormDraftWrite(session, args) {
|
|
|
1430
1487
|
readback: {
|
|
1431
1488
|
hasDraft: sheet.existDraft === true || typeof sheet.draftViewJson === "string",
|
|
1432
1489
|
...(formButtons !== null ? { formButtons, formButtonCodes: formButtons.map((button) => String(button.code ?? "")) } : {}),
|
|
1490
|
+
// #38 shape lint: the readback must never echo "configured" while the
|
|
1491
|
+
// stored column is the stringified form the form page refuses to render.
|
|
1492
|
+
...(customButtonJsonStoredShape(sheet.options) === "string" ? { formButtonsShapeWarning: CUSTOM_BUTTON_JSON_STRING_SHAPE_WARNING } : {}),
|
|
1433
1493
|
...(mergedOptions !== undefined ? { customButtonJsonWritten: true } : {}),
|
|
1434
1494
|
...(roundTripFaces.size > 0
|
|
1435
1495
|
? {
|
|
@@ -1666,6 +1726,8 @@ export async function executeFormPublishWrite(session, args) {
|
|
|
1666
1726
|
formButtonNote: "按钮已写入 options.customButtonJson,本次 publish 已生成 h_biz_button(triggerType=FORM);表单页是否显示还取决于流程节点 buttonPermission.customBtns[].enabled(设计器「表单操作」勾选)",
|
|
1667
1727
|
}
|
|
1668
1728
|
: {}),
|
|
1729
|
+
// #38 shape lint — same guard as the form.draft readback.
|
|
1730
|
+
...(customButtonJsonStoredShape(sheet.options) === "string" ? { formButtonsShapeWarning: CUSTOM_BUTTON_JSON_STRING_SHAPE_WARNING } : {}),
|
|
1669
1731
|
},
|
|
1670
1732
|
};
|
|
1671
1733
|
}
|
|
@@ -340,7 +340,7 @@ export function registerBusinessRuleLane(tools) {
|
|
|
340
340
|
description: RULE_TOOLS["rule.get"].description,
|
|
341
341
|
inputSchema: {
|
|
342
342
|
environment: environmentArg,
|
|
343
|
-
id: z.string().min(1).optional().describe("规则记录 id
|
|
343
|
+
id: z.string().min(1).optional().describe("规则记录 id——更新会铸新 ID,旧 id 读到旧图(回执标 staleId/latestId);当前生效行用 schemaCode + ruleCode 定位"),
|
|
344
344
|
schemaCode: z.string().min(1).optional().describe("业务键定位:模型 code(与 ruleCode 同传,免去先 rule.list 取 id)"),
|
|
345
345
|
ruleCode: z.string().min(1).optional().describe("业务键定位:规则 code(如 Create/Update/自定义),与 schemaCode 同传"),
|
|
346
346
|
full: z.boolean().optional().describe("返回原始存储图(含确定性布局 x/y/width/height 与路由 points);默认返回语义图,确定性布局已投影去掉(可直接重存,保存时会重新生成布局)"),
|
|
@@ -392,6 +392,10 @@ export function registerBusinessRuleLane(tools) {
|
|
|
392
392
|
// Ticket 109 — stale-row detection: same-code saves mint NEW record
|
|
393
393
|
// ids while old ids stay readable (historical graphs). Reading by a
|
|
394
394
|
// superseded id shows an OLD graph; flag it and pin the effective id.
|
|
395
|
+
// Online #39 (friction E) sharpens the receipt: the frontend holding
|
|
396
|
+
// the old id renders the old graph and reads as "the change didn't
|
|
397
|
+
// take" — so the flag set also carries the issue-shaped trio
|
|
398
|
+
// (staleId/latestId/note) next to the ticket-109 names.
|
|
395
399
|
let staleRow = false;
|
|
396
400
|
let effectiveId;
|
|
397
401
|
let staleRowMessage;
|
|
@@ -409,6 +413,7 @@ export function registerBusinessRuleLane(tools) {
|
|
|
409
413
|
// the list face being unreachable must not break the row readback
|
|
410
414
|
}
|
|
411
415
|
}
|
|
416
|
+
const staleNote = "该 ID 非当前生效行——rule.save 更新会生成新记录 ID,旧 ID 仍可读旧图;用 latestId 或按 ruleCode 读";
|
|
412
417
|
const projected = projectRuleGraph(parse(record.node), routes, args.full === true);
|
|
413
418
|
// 存量体检(2026-10-16 中冶反馈):读回不只给结构,还跑一次写面同源的
|
|
414
419
|
// dry-lint,把"已启用但运行时会被静默跳过/UI 独有算子/选项 key 撞车"
|
|
@@ -463,7 +468,7 @@ export function registerBusinessRuleLane(tools) {
|
|
|
463
468
|
schedulerSetting: parse(record.schedulerSetting),
|
|
464
469
|
renderCompat,
|
|
465
470
|
...(semanticFindings ? { semanticFindings } : {}),
|
|
466
|
-
...(staleRow ? { staleRow, effectiveId, staleRowMessage } : {}),
|
|
471
|
+
...(staleRow ? { staleRow, effectiveId, staleRowMessage, staleId: true, latestId: effectiveId, note: staleNote } : {}),
|
|
467
472
|
};
|
|
468
473
|
if (args.withRuntime === true) {
|
|
469
474
|
const coding = record.developmentMode === 1 || record.developmentMode === "1" || record.developmentMode === "CODING";
|
|
@@ -516,6 +521,9 @@ export function registerBusinessRuleLane(tools) {
|
|
|
516
521
|
? payload.schedulerSetting.dataSourceType
|
|
517
522
|
: undefined,
|
|
518
523
|
...(payload.statusLag ? { statusLag: payload.statusLag, statusNote: payload.statusNote } : {}),
|
|
524
|
+
// #39 摩擦 E:summary 面也要带 stale 提示——持旧 id 的调用方常只看
|
|
525
|
+
// summary,漏掉 stale 会把旧图当成「改了没生效」。
|
|
526
|
+
...(staleRow ? { staleId: true, latestId: effectiveId, note: staleNote } : {}),
|
|
519
527
|
};
|
|
520
528
|
}
|
|
521
529
|
if (args.keys !== undefined) {
|
|
@@ -15,12 +15,12 @@ export const FORM_WIRE = Object.freeze({
|
|
|
15
15
|
publishAlreadyPublished: "published:true with force!==true skips as already-published",
|
|
16
16
|
forceRepublish: "onlinejs.compose passes force:true so it can re-promote after a prior publish",
|
|
17
17
|
emptyLayoutGuard: "ticket 74: the platform designer's Save is NOT lossless — it clears draftViewJson to \"[]\" and draftAttributesJson to \"{}\"; form.draft refuses CALLER-PROVIDED empty layouts (blocker form-empty-layout, zero wire, escape allowEmptyLayout:true) and form.publish refuses to promote a draft with fewer controls than the published face (blocker form-publish-degrade, escape allowDegrade:true); the recovery path is the form version history (/api/api/app/bizsheet/history/list) — fetch the intact version's view/attributes originals and rewrite the draft before publishing",
|
|
18
|
-
formButtons: "form toolbar buttons are a three-layer configuration (live 2026-10-23, 1.1.25): (1) bizsheet.options.customButtonJson — a STRINGIFIED
|
|
18
|
+
formButtons: "form toolbar buttons are a three-layer configuration (live 2026-10-23, 1.1.25; shape corrected by GitLab #38 live 8.6.26 2026-11-16): (1) bizsheet.options.customButtonJson — a JSON ARRAY with each entry's actionConfig as an OBJECT (the designer's save shape; a STRINGIFIED array is double encoding the platform stores verbatim and the form page then silently drops every button — the pre-r72 CLI form, now unwrapped+healed on every write and linted via shapeWarning in readbacks) — is the authoring face; ModelManagementFacadeImpl.publishBizForm:1022 turns it into h_biz_button rows with triggerType=FORM, triggerCode=<formCode> at publish; (2) those rows are what ActionPermissionHandler.getByTriggerTypeAndCode(FORM, bizCode) reads; (3) whether a button shows at a node is filtered by the workflow activity's buttonPermission.customBtns[].enabled (the designer 表单操作 checkboxes) plus showPermCode; the execute face is POST /api/api/runtime/form/executeCustomButton {bizButtonModel, bizObjectList:[<full bizObject>], reacquireDataFromDb:true} — NOT the list-button launcher path with ids[]",
|
|
19
19
|
actionsColumns: "ticket 100: draftActionsJson/publishedActionsJson are REAL bizsheet columns (BizForm.java:95-100 @SerializableField; BizFormModel.java:59-62 serialized by bizsheet/get) — the designer writes draftActionsJson on save and both faces on publish (frontend-dist/admin/js/4280.cfa75764.js offsets 193538/185347); form.get full:true surfaces them; publish promotes draftActionsJson → publishedActionsJson",
|
|
20
20
|
});
|
|
21
|
-
const FORM_GET_DESCRIPTION = '读取默认表单(bizsheet/get)的发布状态与控件清单(紧凑默认)。**发布态以返回的 `published` / `existDraft` 布尔为准**(`published:true`=已发布;`published:false,existDraft:true`=只有草稿,**未发布**)——不要用 `publishedControlCodes` 是否非空来推断(草稿字段会让它非空,误判为已发布)。**每个模型交付前其默认表单必须 `published:true`**:用 `configure_form` 或 `form.draft(rebuild:true)`+`form.publish` 发布,并逐模型 `form.get` 核对。`full:true` 还返回 `options`
|
|
22
|
-
const FORM_DRAFT_DESCRIPTION = "Save the default-form DRAFT (bizsheet/update). Reads the current sheet, merges the caller's explicit draftViewJson/draftAttributesJson (or preserves the existing draft); when both are absent on a fresh default form, composes the designer-standard scaffold from the model's published fields. A redundant field (relation-mapping carry-through target) always stays bound; with no workflow it is hidden in the design (options.visible=false), with a workflow it stays visible for per-node propertyPermissions. Pass `draftHtmlJson` to thread custom online-script HTML through. Empty-layout guard: explicitly passing \"[]\"/\"{}\" view/attributes is refused (form-empty-layout) — the platform designer's Save is NOT lossless and clears drafts to exactly that shape; escape with allowEmptyLayout:true, and recover cleared drafts from the form version history (/api/api/app/bizsheet/history/list). **读回原样回写**:从 `form.get` 取回的 view/attributes 直接回传时加 `fromReadback:true`——工具会与已存草稿/发布面逐字比对,一致才放行(平台自身布局可能含子表列行/系统行默认宽度),被改动过的面照常按 validation 拒绝。**表单工具栏按钮**:`buttons`(数组)或 `customButtonJson`(原样字符串)写进 `biz_sheet.options.customButtonJson
|
|
23
|
-
const FORM_PUBLISH_DESCRIPTION = "Publish the default form (bizsheet/publish, proven shape: draft*Json promoted to published*Json verbatim) with published-face readback. **不影响在线 JS**:本工具只提拔布局草稿;改 JS 请用 onlinejs.compose(它自己会连同整张表单一起发布,不必再调本工具)。 Degrade guard: refuses to promote a draft carrying FEWER controls than the published face (form-publish-degrade) — the designer's Save clears drafts non-losslessly; recover via the form version history (/api/api/app/bizsheet/history/list) and rewrite the draft first, or pass allowDegrade:true to force the reduction. rebuild:true is the one-call refresh: discard the existing draft, re-scaffold from the published fields (non-structural control options preserved), then force-promote — use it after a field shape change. **表单工具栏按钮**:传 `buttons`(或 `customButtonJson`)→ 写进 `options.customButtonJson` 并在本次 publish 生成 `h_biz_button(triggerType=FORM, triggerCode=<formCode>)`(平台 `publishBizForm:1022`);`options.customButtonJson`
|
|
21
|
+
const FORM_GET_DESCRIPTION = '读取默认表单(bizsheet/get)的发布状态与控件清单(紧凑默认)。**发布态以返回的 `published` / `existDraft` 布尔为准**(`published:true`=已发布;`published:false,existDraft:true`=只有草稿,**未发布**)——不要用 `publishedControlCodes` 是否非空来推断(草稿字段会让它非空,误判为已发布)。**每个模型交付前其默认表单必须 `published:true`**:用 `configure_form` 或 `form.draft(rebuild:true)`+`form.publish` 发布,并逐模型 `form.get` 核对。`full:true` 还返回 `options` 与 `customButtonJson`(表单工具栏按钮,数组原样;库里是字符串脏形时附 `customButtonJsonShapeWarning`——线上 #38 前端按钮不渲染)。传 `controls:["code",…]` 只取指定控件的 options(如关联控件的 mappings);传 `full:true` 才返回 draft/published 的完整 view/attributes/html/actions JSON(actions 列为设计器保存/发布的表单级按钮动作)。体积大,仅在需要整体布局时用。';
|
|
22
|
+
const FORM_DRAFT_DESCRIPTION = "Save the default-form DRAFT (bizsheet/update). Reads the current sheet, merges the caller's explicit draftViewJson/draftAttributesJson (or preserves the existing draft); when both are absent on a fresh default form, composes the designer-standard scaffold from the model's published fields. A redundant field (relation-mapping carry-through target) always stays bound; with no workflow it is hidden in the design (options.visible=false), with a workflow it stays visible for per-node propertyPermissions. Pass `draftHtmlJson` to thread custom online-script HTML through. Empty-layout guard: explicitly passing \"[]\"/\"{}\" view/attributes is refused (form-empty-layout) — the platform designer's Save is NOT lossless and clears drafts to exactly that shape; escape with allowEmptyLayout:true, and recover cleared drafts from the form version history (/api/api/app/bizsheet/history/list). **读回原样回写**:从 `form.get` 取回的 view/attributes 直接回传时加 `fromReadback:true`——工具会与已存草稿/发布面逐字比对,一致才放行(平台自身布局可能含子表列行/系统行默认宽度),被改动过的面照常按 validation 拒绝。**表单工具栏按钮**:`buttons`(数组)或 `customButtonJson`(原样字符串)写进 `biz_sheet.options.customButtonJson`(**数组+actionConfig 对象**,设计器同形——线上 #38:字符串形=双重编码,前端按钮不渲染,重写即自愈);**要到 form.publish 才生成 h_biz_button(triggerType=FORM)**,且表单页是否显示还取决于流程节点 `buttonPermission.customBtns[].enabled`(设计器「表单操作」勾选)。`useLocation` 用 FORM/ROW/LIST,表单工具栏按钮用 FORM。 **表单控件属性(含关联填充 mappings)从字段行派生**:改关联映射的事实源在字段 options.mappings(field.update → field.publish),直接改这里的控件映射会被平台按字段重算覆盖(真机 2026-10-14 实证);字段发布后如需刷新已发布表单的控件映射,用本工具 rebuild:false 重存(保留现有布局与在线JS)再 form.publish。";
|
|
23
|
+
const FORM_PUBLISH_DESCRIPTION = "Publish the default form (bizsheet/publish, proven shape: draft*Json promoted to published*Json verbatim) with published-face readback. **不影响在线 JS**:本工具只提拔布局草稿;改 JS 请用 onlinejs.compose(它自己会连同整张表单一起发布,不必再调本工具)。 Degrade guard: refuses to promote a draft carrying FEWER controls than the published face (form-publish-degrade) — the designer's Save clears drafts non-losslessly; recover via the form version history (/api/api/app/bizsheet/history/list) and rewrite the draft first, or pass allowDegrade:true to force the reduction. rebuild:true is the one-call refresh: discard the existing draft, re-scaffold from the published fields (non-structural control options preserved), then force-promote — use it after a field shape change. **表单工具栏按钮**:传 `buttons`(或 `customButtonJson`)→ 写进 `options.customButtonJson` 并在本次 publish 生成 `h_biz_button(triggerType=FORM, triggerCode=<formCode>)`(平台 `publishBizForm:1022`);`options.customButtonJson` 以**数组**写入(条目 `actionConfig` 为对象,设计器同形——线上 #38:字符串形=双重编码,前端按钮不渲染,回执给 formButtonsShapeWarning);表单页是否显示再由流程节点 `buttonPermission.customBtns[].enabled` 过滤。";
|
|
24
24
|
const FORM_RUN_BUTTON_DESCRIPTION = "执行表单工具栏按钮(平台同款面:`POST /api/api/runtime/form/executeCustomButton`,body `{bizButtonModel, bizObjectList:[<完整业务对象>], reacquireDataFromDb:true}`)。**与列表行按钮不同**:列表按钮发 `launcher/domain_service_runtime/<schema>/<rule>` + `ids[]`(用 `rule.run`),表单按钮带**整条记录**,不能互换。按钮来源 `GET /api/api/system/getCustomButtons`(只列 triggerType=FORM 的 h_biz_button)。前提:按钮已由 `form.publish` 的 `buttons`/`customButtonJson` 生成。返回是执行结果信封,规则副作用用 `data.load` 另读;被规则 UPDATE 的目标行须是 COMPLETED(引擎查不到 DRAFT)。`302045` = 数据被占用。**`10005` 执行失败时优先换等价面 `rule.run`(launcher/domain_service_runtime/<schema>/<rule> + ids[])**——同一绑定规则在 rule.run 面已验证可用(r28b 实证),不要在 executeCustomButton 上反复重试。";
|
|
25
25
|
const CONFIGURE_FORM_DESCRIPTION = "High-level: bind fields into the default form and publish it (form.draft → form.publish), subject to the write permission gate. Delegates to the proven form.draft scaffold + form.publish paths so the real empty-form layout (and any caller-supplied draftHtmlJson) is persisted and promoted — never bypasses with a shortcut body. `sheetCode` is optional: omitted means the model's default sheet (sheetCode = schemaCode).";
|
|
26
26
|
export const FORM_LANE_CONTRACT = Object.freeze({
|
package/dist/lanes/form.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ENDPOINTS } from "../endpoints.js";
|
|
3
3
|
import { decodeButtonScript } from "./list-view.js";
|
|
4
|
-
import { executeFormDraftWrite, executeFormPublishWrite, executeFormRunButtonWrite, readFormButtons, readFormOrNull, refuseEmptyCallerLayout, validateHtmlRender } from "../form-support.js";
|
|
4
|
+
import { executeFormDraftWrite, executeFormPublishWrite, executeFormRunButtonWrite, readFormButtons, readFormOrNull, refuseEmptyCallerLayout, validateHtmlRender, customButtonJsonStoredShape, CUSTOM_BUTTON_JSON_STRING_SHAPE_WARNING } from "../form-support.js";
|
|
5
5
|
import { capabilityArg, environmentArg } from "../args.js";
|
|
6
6
|
import { governedRead } from "../read.js";
|
|
7
7
|
import { writeTool } from "../write.js";
|
|
@@ -158,7 +158,14 @@ export function registerFormLane(tools) {
|
|
|
158
158
|
// used to drop `options`, so a read→write round trip could never
|
|
159
159
|
// carry the buttons back.
|
|
160
160
|
options: sheet.options ?? null,
|
|
161
|
+
// #39 (GitLab, live 8.6.26): the authoritative button read. This
|
|
162
|
+
// projection used to decode ONLY the legacy stringified form, so a
|
|
163
|
+
// designer-authored ARRAY came back null while the store held real
|
|
164
|
+
// buttons — the read face was blind to them. readFormButtons now
|
|
165
|
+
// decodes both; a dirty stringified column is parsed AND flagged
|
|
166
|
+
// instead of silently echoed as "configured".
|
|
161
167
|
customButtonJson: readFormButtons(sheet.options),
|
|
168
|
+
...(customButtonJsonStoredShape(sheet.options) === "string" ? { customButtonJsonShapeWarning: CUSTOM_BUTTON_JSON_STRING_SHAPE_WARNING } : {}),
|
|
162
169
|
// Ticket 109 — render compatibility: the Online JS panel resolves
|
|
163
170
|
// generateCodeType(e) whose first line is `if(!e||!e.tagName)
|
|
164
171
|
// return ""` and then does o[type].push(...) (54286.fbbb415f.js)
|
|
@@ -304,7 +311,7 @@ export function registerFormLane(tools) {
|
|
|
304
311
|
buttons: z
|
|
305
312
|
.array(z.record(z.unknown()))
|
|
306
313
|
.optional()
|
|
307
|
-
.describe("表单工具栏按钮(写进 biz_sheet.options.customButtonJson;publish 时才生成 h_biz_button(triggerType=FORM))。每条至少 code/name/bindAction/operateType,useLocation 默认 FORM"),
|
|
314
|
+
.describe("表单工具栏按钮(写进 biz_sheet.options.customButtonJson;publish 时才生成 h_biz_button(triggerType=FORM))。每条至少 code/name/bindAction/operateType,useLocation 默认 FORM;新建还需 triggerCode/triggerType/showPermCode/showPermType + name_i18n(JSON 串形)+ addviewType,缺则平台 40000(#38 实证);code 语义化"),
|
|
308
315
|
customButtonJson: z.string().optional().describe("buttons 的原样 JSON 数组字符串(与 buttons 互斥;用于把 form.get 读回值直接回写)"),
|
|
309
316
|
buttonsMode: z.enum(["merge", "replace"]).optional().describe("默认 merge:按 code 增量 upsert(改一个按钮不必重发全表);replace:整表替换"),
|
|
310
317
|
removeButtonCodes: z.array(z.string().min(1)).optional().describe("要删除的按钮 code(仅 merge 模式)"),
|
package/dist/lanes/rule-graph.js
CHANGED
|
@@ -1355,6 +1355,21 @@ export function validateMethodMapping(mapping, nodeCode) {
|
|
|
1355
1355
|
if (typeof m[key] !== "string" || !m[key].trim())
|
|
1356
1356
|
blockers.push({ code: "rule-graph-bizaction-mapping-key", nodeCode, key: `methodMapping.${key}`, message: `methodMapping.${key} 必须是非空字符串(8.6.26 BizMethodMappingModel;serviceCode+serviceMethodCode 是存在性校验对)` });
|
|
1357
1357
|
}
|
|
1358
|
+
// 线上 #38(摩擦 B,詹记 8.6.26 真机):创建链 methodMapping 缺 serviceName/
|
|
1359
|
+
// serviceMethodName/methodCode 时平台按非空列落库失败,rule.save 回 40000
|
|
1360
|
+
// 「调用数据库发生异常」(照最小示例形状必炸;对照已成功规则补齐三键后一次
|
|
1361
|
+
// 成功)。只 warning 不拒——平台版本可能有差异,存量读回图也可能天然缺这三键
|
|
1362
|
+
// (透传语义不动),提示补齐而不是阻断。
|
|
1363
|
+
const nameSlotKeys = ["serviceName", "serviceMethodName", "methodCode"];
|
|
1364
|
+
const missingNameSlotKeys = nameSlotKeys.filter((key) => typeof m[key] !== "string" || !m[key].trim());
|
|
1365
|
+
if (missingNameSlotKeys.length > 0)
|
|
1366
|
+
blockers.push({
|
|
1367
|
+
code: "rule-graph-bizaction-mapping-names-missing",
|
|
1368
|
+
nodeCode,
|
|
1369
|
+
key: `methodMapping.${missingNameSlotKeys.join("/")}`,
|
|
1370
|
+
severity: "warning",
|
|
1371
|
+
message: `methodMapping 缺 ${missingNameSlotKeys.join("/")}——8.6.26 创建链按非空列落库,缺这些键时平台回 40000「调用数据库发生异常」(线上 #38 实证:补齐后一次成功)。对照 rule.get 读回的成功规则补齐;平台版本可能有差异,故仅提示不拦截`,
|
|
1372
|
+
});
|
|
1358
1373
|
const mappingArrays = [["inputMappings", m.inputMappings], ["outputMappings", m.outputMappings]];
|
|
1359
1374
|
for (const [listKey, list] of mappingArrays) {
|
|
1360
1375
|
if (list === undefined)
|
package/dist/read-shapes.js
CHANGED
|
@@ -130,8 +130,11 @@ const READ_SHAPES = {
|
|
|
130
130
|
],
|
|
131
131
|
},
|
|
132
132
|
"form.get": {
|
|
133
|
-
keys: ["present", "published", "publishedControlCodes", "draftControlCodes"],
|
|
134
|
-
notes: [
|
|
133
|
+
keys: ["present", "published", "publishedControlCodes", "draftControlCodes", "formButtonCodes?", "formButtons?", "customButtonJson?(full)", "customButtonJsonShapeWarning?"],
|
|
134
|
+
notes: [
|
|
135
|
+
"控件清单键是 publishedControlCodes/draftControlCodes,不是 controls",
|
|
136
|
+
"表单按钮读 formButtonCodes/formButtons;full:true 另带 customButtonJson 数组原样(库里是字符串脏形时给 customButtonJsonShapeWarning——线上 #38 前端按钮不渲染,重写 buttons 自愈)",
|
|
137
|
+
],
|
|
135
138
|
},
|
|
136
139
|
"listview.get": {
|
|
137
140
|
keys: ["present", "published", "lifecycle", "columns[]"],
|
|
@@ -464,7 +464,7 @@ const ruleBizactionInvokeService = Object.freeze({
|
|
|
464
464
|
nodeGraph: {
|
|
465
465
|
nodes: [
|
|
466
466
|
{ nodeCode: "Start", nodeName: "开始", nodeType: "START" },
|
|
467
|
-
{ nodeCode: "A1", nodeName: "调用服务并回写", nodeType: "BIZ_ACTION", inputParam: "_input", methodMapping: { schemaCode: model, serviceCode: "<svc>", serviceMethodCode: "<method>", inputMappings: [{ serviceMethodParameterCode: "<in_code>", codeType: 1, bizCode: "<src_field>", required: true }], outputMappings: [{ serviceMethodParameterCode: "<out_code>", codeType: 1, bizCode: "<dst_field>" }] } },
|
|
467
|
+
{ nodeCode: "A1", nodeName: "调用服务并回写", nodeType: "BIZ_ACTION", inputParam: "_input", methodMapping: { schemaCode: model, serviceCode: "<svc>", serviceName: "<服务名>", serviceMethodCode: "<method>", serviceMethodName: "<方法名>", methodCode: "<注册槽>", inputMappings: [{ serviceMethodParameterCode: "<in_code>", codeType: 1, bizCode: "<src_field>", required: true }], outputMappings: [{ serviceMethodParameterCode: "<out_code>", codeType: 1, bizCode: "<dst_field>" }] } },
|
|
468
468
|
{ nodeCode: "End", nodeName: "结束", nodeType: "END" },
|
|
469
469
|
],
|
|
470
470
|
routes: [
|
|
@@ -481,6 +481,7 @@ const ruleBizactionInvokeService = Object.freeze({
|
|
|
481
481
|
],
|
|
482
482
|
conditionalRequirements: [
|
|
483
483
|
"**系统节点由工具注入**——本 recipe 只写 Start→BIZ_ACTION→End;工具注入 SYSTEM_CREATE 并排在 BIZ_ACTION 之后(ASSIGN/BIZ_ACTION 必须在系统节点前)。",
|
|
484
|
+
"methodMapping 必带 serviceName/serviceMethodName/methodCode(缺则 40000,#38 实证)",
|
|
484
485
|
"**出参回写三前提(r28b 8 组实验定案,缺一出参恒 null 且节点日志仍 successful)**:① 响应 JSON 根级平铺出参键(信封嵌套如 {data:{...}} 静默不回写)② 挂预置 Create/Update 规则上下文(自定义规则/rule.run 不回写业务字段)③ 用 data.submit/data.update 触发(data.save 存草稿不触发)。回写是否成功只认 data.load 读字段,不认调用日志。",
|
|
485
486
|
"codeType:1 = 映射模型字段(bizCode=字段 code);codeType:0 = 常量(bizCode=常量值);serviceMethodParameterCode 必须与方法声明的参数 code 逐字一致",
|
|
486
487
|
"**接口响应必须在 JSON 根级**返回与出参 code 同名的键——嵌套在信封里(如 {data:{level}})会静默映射不上(p7 实测;r28b 8 组实验全因信封端点失败,换平铺端点后 4 组一次全过)",
|
package/dist/refusal-guidance.js
CHANGED
|
@@ -219,6 +219,20 @@ export function refusalRecovery(blocker, payload, options = {}) {
|
|
|
219
219
|
fixFirst: "处置三选一:① 换一个 code 重建(最快,不动回收站);② 门户「回收站」里物理删除该条目后原 code 可用;③ 保留残留用现名(先 report.get 核对 treeVisibility)。不要反复重试同 code——回收站不清空它就一直占。",
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
|
+
// 线上 #38(摩擦 B):40000「调用数据库发生异常」的引导曾单向判「平台侧故障,勿
|
|
223
|
+
// 改参数硬重试」——真机(詹记 8.6.26)两次实证反向成因:创建类写入缺非空列时平台
|
|
224
|
+
// 同样回 40000(rule.save 的 methodMapping 缺 serviceName/serviceMethodName/methodCode;
|
|
225
|
+
// form.draft/publish 的 button 缺 triggerCode/triggerType/showPermCode/showPermType——h_biz_button
|
|
226
|
+
// 的 NOT NULL 列)。照「勿改参数」引导原地打转;正确动作=对照已成功配置补齐字段。
|
|
227
|
+
// runtime-write-db-exception(运行面 40000)自带公式字段诊断教学,不在此重复。
|
|
228
|
+
if (blocker !== "runtime-write-db-exception" && (Number(payload.errcode) === 40000 || /调用数据库发生异常/.test(text0))) {
|
|
229
|
+
return {
|
|
230
|
+
whatWentWrong: "平台回 40000「调用数据库发生异常」——无明细掩码,有两种常见成因,先分叉再动手",
|
|
231
|
+
fixFirst: "① 真·平台故障(DB/ORM 层)→ 稍后重试同一请求,持续复现查平台日志;" +
|
|
232
|
+
"② **创建类写入缺非空列**(线上 #38 实证)——rule.save 的 methodMapping 缺 serviceName/serviceMethodName/methodCode;form.draft/form.publish 的 button 缺 triggerCode/triggerType/showPermCode/showPermType(h_biz_button 非空列)。照 recipe 最小示例形状新建必炸②:先 rule.get/form.get 读一条已成功落库的同族配置,对照补齐这些字段后一次成功。",
|
|
233
|
+
doNot: "不要只按「平台故障勿改参数」原地重试——成因②下同参数永远 40000;也不要不分叉就盲改参数——成因①下改了也没用",
|
|
234
|
+
};
|
|
235
|
+
}
|
|
222
236
|
// r19 p14: the report BI boundary is matched from the wire path in the
|
|
223
237
|
// message/detail, so both refused and frozen (uncertain) envelopes teach it.
|
|
224
238
|
if (mentionsDashboardChannel(payload)) {
|
package/dist/write.js
CHANGED
|
@@ -118,16 +118,21 @@ async function governedWrite(ctx, tool, args, execute, dryRunPayload, readOnlyEs
|
|
|
118
118
|
message: `${error.message}——这是平台 ORM 的对象状态错误(Serializer.update/delete 要求实体先被装载),不是入参或规则图的形状问题。` +
|
|
119
119
|
"同一份入参再保存一次通常即恢复。持续复现就换行:rule.delete 后重建(rule.save 会铸新记录),或用 rule.get 读回完整行再 rule.node.update 改一处——不要继续重试同一份 payload。",
|
|
120
120
|
};
|
|
121
|
-
// r30a F10:errcode 40000
|
|
122
|
-
//
|
|
121
|
+
// r30a F10:errcode 40000「调用数据库发生异常」曾单向判「平台侧故障,勿改参数」。
|
|
122
|
+
// 线上 #38(摩擦 B,詹记 8.6.26)实证反向成因:创建类写入缺非空列时平台同样
|
|
123
|
+
// 回 40000(rule.save 的 methodMapping 缺 serviceName/serviceMethodName/methodCode;
|
|
124
|
+
// form.draft/publish 的 button 缺 triggerCode/triggerType/showPermCode/showPermType),
|
|
125
|
+
// 照「勿改参数硬重试」引导原地打转。引导必须双向:先分叉成因再动手。
|
|
123
126
|
if (error.errcode === 40000 || /调用数据库发生异常/.test(error.message))
|
|
124
127
|
return {
|
|
125
128
|
status: "refused",
|
|
126
129
|
blocker: `wire-${error.kind}`,
|
|
127
130
|
errcode: error.errcode,
|
|
128
131
|
"platform-fault": true,
|
|
129
|
-
message: `${error.message}
|
|
130
|
-
|
|
132
|
+
message: `${error.message}——40000「调用数据库发生异常」是无明细掩码,两种常见成因(线上 #38 实证):` +
|
|
133
|
+
"① 真·平台故障(DB/ORM 层,重试/查平台日志);" +
|
|
134
|
+
"② 创建类写入缺非空列——rule.save 的 methodMapping 缺 serviceName/serviceMethodName/methodCode、form.draft/publish 的 button 缺 triggerCode/triggerType/showPermCode/showPermType 时同样回 40000(照 recipe 最小示例形状新建必炸;对照已成功落库的同族配置补齐字段后一次成功)。",
|
|
135
|
+
nextAction: "先分叉:本次是照示例新建/改配置吗?是→按成因②对照一条已成功配置(rule.get/form.get 读回)补齐非空列字段再重试;否→按成因①稍后重试同一请求,持续复现查平台 DB/ORM 日志",
|
|
131
136
|
...(error.diagnostic ? { diagnostic: error.diagnostic } : {}),
|
|
132
137
|
};
|
|
133
138
|
return { status: "refused", blocker: `wire-${error.kind}`, errcode: error.errcode, message: error.message, ...(error.diagnostic ? { diagnostic: error.diagnostic } : {}) };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.66",
|
|
4
4
|
"description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"commander": "14.0.3",
|
|
59
|
-
"omc-core": "0.6.
|
|
59
|
+
"omc-core": "0.6.66",
|
|
60
60
|
"proper-lockfile": "4.1.2",
|
|
61
61
|
"write-file-atomic": "6.0.0",
|
|
62
62
|
"zod": "^3.23.8",
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
"directory": "packages/omc-cli"
|
|
75
75
|
},
|
|
76
76
|
"optionalDependencies": {
|
|
77
|
-
"@stalfh233/omc-fake-platform": "0.6.
|
|
77
|
+
"@stalfh233/omc-fake-platform": "0.6.66"
|
|
78
78
|
}
|
|
79
79
|
}
|