@stalfh233/omc-cli 0.8.35 → 0.8.37
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/approval-flow.js +1 -1
- package/dist/cli.js +12 -0
- package/dist/endpoints.js +16 -0
- package/dist/form-support.js +692 -13
- package/dist/lanes/app.js +47 -6
- package/dist/lanes/businessrule.js +167 -51
- package/dist/lanes/form-contract.js +3 -3
- package/dist/lanes/form.js +47 -14
- package/dist/lanes/rule-lifecycle-contract.js +5 -4
- package/dist/lanes/rule-lifecycle.js +136 -3
- package/dist/lanes/runtime-data/date-format.js +47 -0
- package/dist/lanes/runtime-data/field-options.js +58 -0
- package/dist/lanes/runtime-data/record-write.js +47 -6
- package/dist/lanes/runtime-data/shapes.js +23 -0
- package/dist/lanes/runtime-data/submission.js +277 -66
- package/dist/lanes/runtime-data/write-support.js +237 -46
- package/dist/lanes/workflow/template-fetch.js +94 -11
- package/dist/lanes/workflow/template-read.js +30 -11
- package/dist/lanes/workflow-contract.js +1 -1
- package/dist/model-purge.js +62 -26
- package/dist/plan.js +63 -5
- package/dist/read-projection.js +59 -0
- package/dist/read-shapes.js +8 -6
- package/dist/read.js +12 -2
- package/dist/recipes/field.js +7 -3
- package/dist/recipes/form.js +51 -1
- package/dist/recipes/runtime-data.js +5 -4
- package/dist/runtime-support.js +98 -20
- package/dist/search-index.js +4 -0
- package/dist/tools.js +18 -0
- package/dist/wire.js +119 -11
- package/dist/write-outcome.js +14 -0
- package/dist/write.js +66 -5
- package/package.json +3 -3
- package/skills/omc-business-configuration.md +7 -6
- package/skills/omc-capabilities.md +1 -0
package/dist/model-purge.js
CHANGED
|
@@ -562,24 +562,37 @@ export async function executePurge(plan, session, call) {
|
|
|
562
562
|
// referrers 拼 deletionOrder/nextCommand:自引用(子表列 parentCode 解析回自身)
|
|
563
563
|
// 时得到 ["m","m"],nextCommand 只是重跑同一条命令——照做必再撞同一拒绝。
|
|
564
564
|
let deleteRefusal;
|
|
565
|
+
// F12(探针 AA,0.8.36):删除确认只认**记录面 absent**(或计划时模型本就不
|
|
566
|
+
// 存在);平台 deleteTask FAIL 直接判失败——absent=true 遇到 FAIL 也不能算成功
|
|
567
|
+
// (model.ts 同口径:记录面 absent 只说明还没删)。
|
|
568
|
+
let deleteConfirmed = !plan.modelExists;
|
|
569
|
+
let deleteTask;
|
|
565
570
|
if (!failed) {
|
|
566
571
|
const outcome = await call("model.delete", { schemaCode });
|
|
567
572
|
const readback = outcome.result.readback;
|
|
568
573
|
const absent = readback?.absent === true || outcome.result.performed?.skipped === "already-absent";
|
|
574
|
+
deleteTask = readback?.deleteTask !== null && typeof readback?.deleteTask === "object" ? readback.deleteTask : undefined;
|
|
575
|
+
const taskFailed = deleteTask?.taskStatus === "FAIL";
|
|
569
576
|
referrers = Array.isArray(outcome.result.referencingModels)
|
|
570
577
|
? outcome.result.referencingModels.map((row) => String(row.schemaCode ?? "")).filter((code) => code.length > 0)
|
|
571
578
|
: [];
|
|
572
579
|
const refusalMessage = typeof outcome.result.message === "string" && outcome.result.message.length > 0 ? outcome.result.message : refusalText(outcome.result);
|
|
573
|
-
record(`model.delete:${schemaCode}`, outcome.ok || absent, outcome.ok || absent
|
|
580
|
+
record(`model.delete:${schemaCode}`, (outcome.ok || absent) && !taskFailed, (outcome.ok || absent) && !taskFailed
|
|
574
581
|
? (readback ? { cascades: true, absent: readback.absent ?? null } : undefined)
|
|
575
|
-
: {
|
|
576
|
-
|
|
582
|
+
: {
|
|
583
|
+
message: taskFailed ? `平台删除任务失败:${String(deleteTask?.message ?? refusalMessage)}` : refusalMessage,
|
|
584
|
+
...(referrers.length > 0 ? { referencedBy: referrers } : {}),
|
|
585
|
+
});
|
|
586
|
+
if ((!outcome.ok && !absent) || taskFailed) {
|
|
577
587
|
failed = true;
|
|
578
588
|
const inboundReferences = Array.isArray(outcome.result.inboundReferences) ? outcome.result.inboundReferences : [];
|
|
579
589
|
const deletionSteps = Array.isArray(outcome.result.deletionSteps) ? outcome.result.deletionSteps : [];
|
|
580
590
|
if (inboundReferences.length > 0)
|
|
581
591
|
deleteRefusal = { inboundReferences, deletionSteps, message: refusalMessage };
|
|
582
592
|
}
|
|
593
|
+
else {
|
|
594
|
+
deleteConfirmed = !plan.modelExists || absent;
|
|
595
|
+
}
|
|
583
596
|
}
|
|
584
597
|
const status = failed ? "partial" : "ok";
|
|
585
598
|
const mixedReferencesAtRefusal = plan.unbindReferences !== true && selfLabels.size > 0 && (plan.crossModelUnbindSteps?.length ?? 0) > 0;
|
|
@@ -618,18 +631,29 @@ export async function executePurge(plan, session, call) {
|
|
|
618
631
|
`拆完引用后由 model.delete 级联;② 自己按 deletionSteps 逐条执行。` +
|
|
619
632
|
(refusalHasCrossModel ? "不要在未拆引用时重试 --apply(不带 --unbind-references 仍会零写入拒绝)。" : ""),
|
|
620
633
|
}
|
|
621
|
-
:
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
: "
|
|
628
|
-
|
|
634
|
+
: deleteTask?.taskStatus === "FAIL"
|
|
635
|
+
? {
|
|
636
|
+
nextAction: "fix-and-rerun",
|
|
637
|
+
deleteTask,
|
|
638
|
+
modelDeleteTaskFailed: true,
|
|
639
|
+
...(referrers.length > 0 ? { blockedBy: referrers } : {}),
|
|
640
|
+
message: `${schemaCode} 未删除:平台删除任务失败(deleteTask.taskStatus=FAIL,真因见 deleteTask.message:${String(deleteTask?.message ?? "平台未返回 message")})。` +
|
|
641
|
+
`记录面 absent 只说明还没删,不代表成功。按平台原文拆引用/清理残留后重试 --apply(幂等);先只读复核再动手。`,
|
|
642
|
+
}
|
|
643
|
+
: {
|
|
644
|
+
nextAction: "fix-and-rerun",
|
|
645
|
+
...(referrers.length > 0 ? { blockedBy: referrers } : {}),
|
|
646
|
+
message: referrers.length > 0
|
|
647
|
+
? `${schemaCode} 仍被 ${referrers.join("、")} 的关联字段引用,模型不能删。先跑 omc model-purge --code ${schemaCode}(dry-run)拿 inboundReferences / deletionSteps;` +
|
|
648
|
+
`再加 --unbind-references --apply 让一条命令自动拆引用(破坏性:会删除引用列),或逐条拆后再 --apply。`
|
|
649
|
+
: "在失败的这一步停下(幂等,可修好后重跑同一条命令)。已成功的步骤不会重复破坏。",
|
|
650
|
+
};
|
|
629
651
|
const result = {
|
|
630
652
|
status,
|
|
631
653
|
schemaCode,
|
|
632
|
-
|
|
654
|
+
// F12(探针 AA,0.8.36):verdict 只认记录面——已删净(absent)就 clean,
|
|
655
|
+
// 未确认(模型记录仍在)才是 cascading;失败一律 partial。
|
|
656
|
+
verdict: failed ? "partial" : deleteConfirmed ? "clean" : "cascading",
|
|
633
657
|
...(plan.workflowCode !== undefined ? { workflowCode: plan.workflowCode } : {}),
|
|
634
658
|
...(plan.unbindReferences === true
|
|
635
659
|
? { unbindReferences: true }
|
|
@@ -652,20 +676,32 @@ export async function executePurge(plan, session, call) {
|
|
|
652
676
|
steps,
|
|
653
677
|
...(failed
|
|
654
678
|
? failureFields
|
|
655
|
-
:
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
"
|
|
668
|
-
|
|
679
|
+
: {
|
|
680
|
+
// F12(探针 AA,0.8.36):已删净(记录面 absent=true)不再教「重跑本
|
|
681
|
+
// 命令」(那会被读成「还没删完」并触发重复删除);只给只读复核。
|
|
682
|
+
...(deleteConfirmed
|
|
683
|
+
? {
|
|
684
|
+
note: "已删净(记录面 absent=true):流程实例逐个删除 → " +
|
|
685
|
+
(unbindOutcome !== undefined ? "拆入站引用(field.delete 引用列 → field.publish 所属模型)→ " : "") +
|
|
686
|
+
"model.delete 级联带走流程模板/列表视图/字段/表单/业务规则;平台记录面已确认 absent。" +
|
|
687
|
+
"**这就是 r12–r14 三次脏沙盒的根治**:实例先走,就不会留下指向空模板的待办。",
|
|
688
|
+
recheckCommand: `omc residue ${schemaCode}`,
|
|
689
|
+
}
|
|
690
|
+
: {
|
|
691
|
+
note: "尚未确认删净(记录面仍能读到模型):model.delete 是平台异步任务(建删除历史后立即返回,级联时长不定),absent=false 只表示级联仍在进行,不是失败。" +
|
|
692
|
+
"先只读复核(recheckCommand / data.list),仍在再幂等重跑本命令;不要凭「命令已返回」当作已删除。",
|
|
693
|
+
recheckCommand: `omc residue ${schemaCode}`,
|
|
694
|
+
...(deleteTask !== undefined ? { deleteTask } : {}),
|
|
695
|
+
}),
|
|
696
|
+
...(unremovableInstances.length > 0
|
|
697
|
+
? {
|
|
698
|
+
cleanupWarning: `${unremovableInstances.length} 条停滞实例无法通过平台 REST 删除(delete_instance 50000:业务对象已不存在,平台 NPE)。` +
|
|
699
|
+
"它们没有在办待办,所以不会污染全局待办搜索;模型已按其能力级联清理。" +
|
|
700
|
+
"残留的 `biz_workflow_instance` 行需要维护者清库(平台不提供强制删除面);再次用同 code 建流程前先清,否则新实例会继承这些行。",
|
|
701
|
+
maintainerAction: `DELETE FROM biz_workflow_instance WHERE id IN (${unremovableInstances.map((item) => `'${item.id}'`).join(", ")});`,
|
|
702
|
+
}
|
|
703
|
+
: {}),
|
|
704
|
+
}),
|
|
669
705
|
};
|
|
670
706
|
return { failed, result };
|
|
671
707
|
}
|
package/dist/plan.js
CHANGED
|
@@ -52,13 +52,71 @@ function smallStringPreview(value) {
|
|
|
52
52
|
/**
|
|
53
53
|
* F5(探针 Y,0.8.34):`formData` 的子表值是数组,`smallStringPreview` 只收标量,
|
|
54
54
|
* 于是 dry-run 静默省略子表行——调用方在提交前看不到「子表到底带了几行」。
|
|
55
|
-
*
|
|
56
|
-
*
|
|
55
|
+
*
|
|
56
|
+
* F9(探针 AA,0.8.36):旧实现只给**首行**,多行子表在提交前无法核对第 2..n 行。
|
|
57
|
+
* 现在在 400B 预算内尽量多给**整行**:`rows:[...]`(每行只含标量叶子),
|
|
58
|
+
* `omittedRows = count - rows.length`;`firstRow` 保留为兼容别名(= rows[0])。
|
|
59
|
+
*
|
|
60
|
+
* F9 复审(2026-12-02):预算必须按**回执真实 JSON 字节**算。旧实现只累加每行
|
|
61
|
+
* value 的字节,key/引号/冒号/逗号/数组括号全不计,于是「value 总长 380B」的
|
|
62
|
+
* 一行实际序列化 600B 仍被当预算内塞进回执。现在每加一行都拿候选
|
|
63
|
+
* `JSON.stringify([...rows, row])` 的实际字节与 400 比;放不下整行就停,不塞
|
|
64
|
+
* 半行(半行比不给更容易被误读成「这行缺字段」)。仅当**首行本身**就超预算时,
|
|
65
|
+
* 退回按同一 JSON 字节预算裁剪出的标量叶子集合,保证 `firstRow` 仍在。
|
|
57
66
|
*/
|
|
67
|
+
const CHILD_PREVIEW_BUDGET_BYTES = 400;
|
|
68
|
+
/** `[...]` 两字节固定开销,裁剪单行时先扣掉,保证数组整体仍 ≤400B。 */
|
|
69
|
+
const CHILD_PREVIEW_ROW_BUDGET_BYTES = CHILD_PREVIEW_BUDGET_BYTES - 2;
|
|
70
|
+
function jsonBytes(value) {
|
|
71
|
+
return Buffer.byteLength(JSON.stringify(value), "utf8");
|
|
72
|
+
}
|
|
73
|
+
/** 一行里的全部标量叶子(不做预算裁决,预算在 childRowsPreview 按 JSON 字节做)。 */
|
|
74
|
+
function scalarLeaves(value) {
|
|
75
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
76
|
+
return undefined;
|
|
77
|
+
const out = {};
|
|
78
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
79
|
+
if (typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean")
|
|
80
|
+
out[key] = entry;
|
|
81
|
+
}
|
|
82
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
83
|
+
}
|
|
84
|
+
/** 首行超预算时的逃生:按序列化后的实际字节保留尽量多的标量叶子。 */
|
|
85
|
+
function trimScalarPreview(leaves, maxBytes) {
|
|
86
|
+
const out = {};
|
|
87
|
+
for (const [key, entry] of Object.entries(leaves)) {
|
|
88
|
+
const candidate = { ...out, [key]: entry };
|
|
89
|
+
if (jsonBytes(candidate) > maxBytes)
|
|
90
|
+
continue;
|
|
91
|
+
out[key] = entry;
|
|
92
|
+
}
|
|
93
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
94
|
+
}
|
|
58
95
|
function childRowsPreview(rows) {
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
|
|
96
|
+
const previewRows = [];
|
|
97
|
+
for (const [index, row] of rows.entries()) {
|
|
98
|
+
const leaves = scalarLeaves(row);
|
|
99
|
+
if (leaves === undefined)
|
|
100
|
+
continue;
|
|
101
|
+
if (jsonBytes([...previewRows, leaves]) > CHILD_PREVIEW_BUDGET_BYTES) {
|
|
102
|
+
// 首行就超预算:给预算内裁剪后的标量前缀(firstRow 兼容别名仍在),
|
|
103
|
+
// 其余行整行不再塞。
|
|
104
|
+
if (index === 0 && previewRows.length === 0) {
|
|
105
|
+
const trimmed = trimScalarPreview(leaves, CHILD_PREVIEW_ROW_BUDGET_BYTES);
|
|
106
|
+
if (trimmed !== undefined)
|
|
107
|
+
previewRows.push(trimmed);
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
previewRows.push(leaves);
|
|
112
|
+
}
|
|
113
|
+
const firstRow = previewRows[0];
|
|
114
|
+
return {
|
|
115
|
+
count: rows.length,
|
|
116
|
+
...(previewRows.length > 0 ? { rows: previewRows } : {}),
|
|
117
|
+
...(firstRow !== undefined ? { firstRow } : {}),
|
|
118
|
+
omittedRows: Math.max(0, rows.length - previewRows.length),
|
|
119
|
+
};
|
|
62
120
|
}
|
|
63
121
|
function summarizedArgs(tool, args) {
|
|
64
122
|
if (typeof args.summary === "string" && typeof args.fingerprint === "string")
|
package/dist/read-projection.js
CHANGED
|
@@ -19,6 +19,7 @@ import { jsonBytes, summarizeValue } from "./support.js";
|
|
|
19
19
|
* - `inlineKeys` ← 旧 `ALWAYS_INLINE_KEYS`(教学/证据键 + 字节上限)
|
|
20
20
|
* - `shapePreservingKeys` ← 旧 `CODE_NAME_LIST_KEYS`(保形为 `code|name` 码表)
|
|
21
21
|
* - `codeListKeys` ← 旧 `CODE_LIST_KEYS`(配置清单保形为裸码表)
|
|
22
|
+
* - `identifierListKeys` ← W47(`schemaCodes`/`absentModels`… 外置时仍为数组)
|
|
22
23
|
* - `bulkyKeys` ← 旧 `BULKY_READ_KEYS`(压成 `*Count`,外置时补空占位)
|
|
23
24
|
* - `nonContainerKeys` ← 旧 `NON_CONTAINER_KEYS`(回执派生数组不算结果容器)
|
|
24
25
|
* - `containerKeys` ← 旧 `CONTAINER_NAME_KEYS` 的判定顺序
|
|
@@ -47,6 +48,15 @@ export const READ_SMALL_ROW_SET_LIMIT = 10;
|
|
|
47
48
|
export const READ_TRIGGER_ROW_SET_LIMIT = 60;
|
|
48
49
|
/** `code|name` 码表的内联对数上限(~1–2KB);更大的清单回退 count + artifact。 */
|
|
49
50
|
export const READ_CODE_NAME_PAIR_LIMIT = 40;
|
|
51
|
+
/**
|
|
52
|
+
* 标识符清单(`schemaCodes`/`absentModels`/…)的内联条数上限。
|
|
53
|
+
*
|
|
54
|
+
* 2026-12 W47:这几个键的值**就是答案**(「本次问了哪些模型/规则」),不是正文
|
|
55
|
+
* bulk——3 个模型被折成 `{count:3,sha256,omitted}` 后,agent 无从知道读了哪些、
|
|
56
|
+
* 哪些缺席,只能去 artifact 再取一次。工具入参本身有批上限(≤20),这里的上限
|
|
57
|
+
* 只是防御:超过仍保形为数组(头 + count + truncated),不再退化成哈希。
|
|
58
|
+
*/
|
|
59
|
+
export const READ_IDENTIFIER_LIST_LIMIT = 40;
|
|
50
60
|
/** `rules` 瘦身行的内联上限(r62b-F3:9 条连名字都看不到曾逼二次取回)。 */
|
|
51
61
|
export const READ_RULE_SLIM_LIMIT = 12;
|
|
52
62
|
/** 教学串(`*Hint`)的内联上限;超过才摘要(0.6.91 真机:209B hint 被摘要)。 */
|
|
@@ -67,6 +77,14 @@ const ALWAYS_INLINE_KEYS = new Map([
|
|
|
67
77
|
["coverage", 1200],
|
|
68
78
|
["applicationResolution", 600],
|
|
69
79
|
["summaryHint", 600],
|
|
80
|
+
// W47(0.8.36d 真机):部分失败清单是**诊断回执**,不是结果 bulk——被折成
|
|
81
|
+
// `{count,sha256,omitted}` 后 `partial:true` 就没有任何可行动信息(哪条失败、
|
|
82
|
+
// 为什么)。≤2KB 原样内联;更大的失败清单仍在 artifact 里。
|
|
83
|
+
["failed", 2000],
|
|
84
|
+
["failures", 2000],
|
|
85
|
+
// #77.2:withDraft 的「app 面会补建 7 条预置」披露是教学键——compact 折叠
|
|
86
|
+
// 成 {length,sha256,omitted} 后,调用方看不到自己多出来的预置行是怎么来的。
|
|
87
|
+
["draftNote", 1200],
|
|
70
88
|
]);
|
|
71
89
|
/** Config-inventory keys that compact to a code list (not a bare count). */
|
|
72
90
|
const CODE_LIST_KEYS = new Set(["fields", "columns", "conditions", "sorts", "datarules", "buttons", "views", "sheets"]);
|
|
@@ -78,6 +96,11 @@ const CODE_LIST_KEYS = new Set(["fields", "columns", "conditions", "sorts", "dat
|
|
|
78
96
|
const CODE_NAME_LIST_KEYS = new Set(["roles", "groups", "models", "departments", "workflows", "services", "methods"]);
|
|
79
97
|
/** 节点类清单:参与者是扫描目标(r46 用户实测)——内联 `code:name@participant`。 */
|
|
80
98
|
const ACTIVITY_LIST_KEYS = new Set(["activities"]);
|
|
99
|
+
/**
|
|
100
|
+
* 标识符清单:值是「这次覆盖了哪些 code」的事实(不是 bulk 正文)。外置时仍为
|
|
101
|
+
* 字符串数组,见 `READ_IDENTIFIER_LIST_LIMIT` 的说明。
|
|
102
|
+
*/
|
|
103
|
+
const IDENTIFIER_LIST_KEYS = new Set(["schemaCodes", "absentModels", "ruleCodes", "modelCodes", "missingCodes"]);
|
|
81
104
|
/**
|
|
82
105
|
* Keys whose values are the bulk a compact projection replaces with a count.
|
|
83
106
|
* Everything else is a small facet identity/decision fields (workflowCode,
|
|
@@ -185,6 +208,20 @@ function slimRuleRow(rule) {
|
|
|
185
208
|
name: typeof rule.name === "string" ? rule.name : null,
|
|
186
209
|
...(rule.enabled !== undefined ? { enabled: rule.enabled } : {}),
|
|
187
210
|
...(rule.defaultRule !== undefined ? { defaultRule: rule.defaultRule } : {}),
|
|
211
|
+
// #77.3:`rule.list --withDraft` 的判定面(publishEnabled/draftEnabled/
|
|
212
|
+
// draftStatus/executable/executableBasis)是显式开关的唯一答案——compact
|
|
213
|
+
// 若把它瘦身掉,开了 withDraft 反而看不到可执行性(默认行没有这些键,
|
|
214
|
+
// 投影逐字节不变)。
|
|
215
|
+
...(rule.executable !== undefined
|
|
216
|
+
? {
|
|
217
|
+
publishEnabled: rule.publishEnabled ?? null,
|
|
218
|
+
draftEnabled: rule.draftEnabled ?? null,
|
|
219
|
+
draftStatus: rule.draftStatus ?? null,
|
|
220
|
+
executable: rule.executable,
|
|
221
|
+
...(rule.executableBasis !== undefined ? { executableBasis: rule.executableBasis } : {}),
|
|
222
|
+
...(rule.draftOnly === true ? { draftOnly: true } : {}),
|
|
223
|
+
}
|
|
224
|
+
: {}),
|
|
188
225
|
// r83:rule.list --withMappings 的映射摘要随行保留(否则 >2048B 的常见
|
|
189
226
|
// 7 条预置规则会「开了 withMappings 却在默认面看不到映射」)。
|
|
190
227
|
...(Array.isArray(rule.mappings) ? { mappings: rule.mappings } : {}),
|
|
@@ -211,11 +248,32 @@ function projectGenericEntry(policy, key, value) {
|
|
|
211
248
|
[`${key}Count`]: value.length,
|
|
212
249
|
};
|
|
213
250
|
}
|
|
251
|
+
if (policy.identifierListKeys.has(key) && Array.isArray(value)) {
|
|
252
|
+
// W47(0.8.36d 真机回归):`rule.list --schemaCodes` 的 `schemaCodes`/
|
|
253
|
+
// `absentModels` 是「本次覆盖了哪些模型」的答案,通用摘要把它折成
|
|
254
|
+
// `{count,sha256,omitted}`——外置与内联不同形,调用方读不到自己问过的清单。
|
|
255
|
+
// 条数在工具入参批上限内(≤20)时原样内联;异常大的清单保留数组头 + count。
|
|
256
|
+
const entries = value;
|
|
257
|
+
const identifiers = entries.every((entry) => typeof entry === "string" || typeof entry === "number");
|
|
258
|
+
if (identifiers) {
|
|
259
|
+
if (entries.length <= READ_IDENTIFIER_LIST_LIMIT)
|
|
260
|
+
return { [key]: entries };
|
|
261
|
+
return { [key]: entries.slice(0, READ_IDENTIFIER_LIST_LIMIT), [`${key}Count`]: entries.length, [`${key}Truncated`]: true };
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// 空数组没有 bulk 可藏:折成 `{count:0,sha256,omitted}` 只会把「确实没有」
|
|
265
|
+
// (例如 `failed: []` 的零失败)变成需要二次取回的噪声。空对象同理。
|
|
266
|
+
// 注意顺序:放在 bulky 分支**之后**,否则 `data: {}` 之类会丢掉 `<key>Count`
|
|
267
|
+
// 而改变 bulky 面的既有形状。
|
|
214
268
|
if (policy.bulkyKeys.has(key)) {
|
|
215
269
|
return {
|
|
216
270
|
[`${key}Count`]: Array.isArray(value) ? value.length : value && typeof value === "object" ? Object.keys(value).length : 0,
|
|
217
271
|
};
|
|
218
272
|
}
|
|
273
|
+
if (Array.isArray(value) && value.length === 0)
|
|
274
|
+
return { [key]: [] };
|
|
275
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0)
|
|
276
|
+
return { [key]: {} };
|
|
219
277
|
// r28a 真机(2026-11-05)/ 2026-11-22(0.6.93 真机):见旧 read.ts 的一整段
|
|
220
278
|
// 说明——小对象、教学串、`*Hint` 都不该被摘要成 `{count/keys,sha256,omitted}`。
|
|
221
279
|
if (policy.inlineKeys.has(key) && jsonBytes(value) <= policy.inlineKeys.get(key)) {
|
|
@@ -248,6 +306,7 @@ export function defaultReadProjectionPolicy() {
|
|
|
248
306
|
inlineKeys: ALWAYS_INLINE_KEYS,
|
|
249
307
|
shapePreservingKeys: CODE_NAME_LIST_KEYS,
|
|
250
308
|
codeListKeys: CODE_LIST_KEYS,
|
|
309
|
+
identifierListKeys: IDENTIFIER_LIST_KEYS,
|
|
251
310
|
bulkyKeys: BULKY_READ_KEYS,
|
|
252
311
|
nonContainerKeys: NON_CONTAINER_KEYS,
|
|
253
312
|
};
|
package/dist/read-shapes.js
CHANGED
|
@@ -107,8 +107,8 @@ const READ_SHAPES = {
|
|
|
107
107
|
notes: ["计数用 total(totalElements);分组=值域×count,key 是存储值/code,null 单列 nullBucket;分桶 count 并发窗口 4;数值指标(sum/avg/min/max+field)本地折叠(cap 1000,null 不进聚合、avg 分母排除 null);coverage.mode=server-total/paged-local-scan/local-scan/server-aggregate,/sum 不可用或形状不符回退本地(strategyFallback);complete:false 只覆盖已扫行,勿外推", "child=子表目标:count 走 list_child totalElements,数值列只拉目标列分页折叠"],
|
|
108
108
|
},
|
|
109
109
|
"app.list": {
|
|
110
|
-
keys: ["applications:array<{code,name,groupId?,modelCount}>", "applicationsCount", "omitted"],
|
|
111
|
-
notes: ["applicationsCount + omitted 与 discover 同构;omitted:false 表示内联即全集"],
|
|
110
|
+
keys: ["applications:array<{code,name,groupId?,modelCount}>", "applicationsCount", "omitted", "omittedCount?", "nextCommand?", "tablesHint?"],
|
|
111
|
+
notes: ["applicationsCount + omitted 与 discover 同构;omitted:false 表示内联即全集", "外置档默认只内联 20 条:all:true 取到 500 条,limit/offset 做客户端翻页(平台 apppackage/list 无分页参数,一次返回全量);omitted:true 时按 nextCommand 续取,或 --jq applications[].code 直接从 artifact 取"],
|
|
112
112
|
},
|
|
113
113
|
"model.list": {
|
|
114
114
|
// Compact diet may rewrite models to "code|name" pairs and add modelsCount.
|
|
@@ -154,8 +154,8 @@ const READ_SHAPES = {
|
|
|
154
154
|
// artifact get --shape 先看骨架再 --jq)。published/draft 两面同形,仅 templateType
|
|
155
155
|
// 与 published 键不同。
|
|
156
156
|
"workflow.list": {
|
|
157
|
-
keys: ["applicationResolution", "modelsCount", "scannedModels", "filteredBy?{schemaCode}", "filteredModelScanned?", "filteredModelNote?", "withWorkflow", "publishedCount", "absentCount", "workflows:array<{modelCode,workflowCode,exists,published,ruleBindingCount,readFailed?}>", "wire", "partial?", "omittedModels?", "nextCommand?", "indexNote", "environmentFingerprint"],
|
|
158
|
-
notes: ["无流程的模型 workflowCode:null + exists:false
|
|
157
|
+
keys: ["applicationResolution", "modelsCount", "scannedModels", "filteredBy?{schemaCode}", "filteredModelScanned?", "filteredModelNote?", "withWorkflow", "publishedCount", "absentCount", "workflows:array<{modelCode,workflowCode,workflowCodes,headerProbe,probeMismatch?,exists,published,ruleBindingCount,readFailed?}>", "wire", "partial?", "omittedModels?", "omittedModelCodes?", "omittedModelCodesTruncated?", "nextCommand?", "indexNote", "environmentFingerprint"],
|
|
158
|
+
notes: ["无流程的模型 workflowCode:null + exists:false(不是错误);平台无应用级流程清单端点,本面按 schemaCode 绑定、一个模型可挂多个流程(workflowCodes 全列,headerProbe 如实回 header)", "ruleBindingCount = flow 级 handler + 节点级事件 + SYSTEM_ACTIVITY 顶层绑定的规则码总数(比 get_published 摘要里的同名键多算节点级)", "schemaCode 是**客户端过滤**(先按应用扫描再过滤该模型,不伪造平台过滤);模型不在应用内 → workflow-list-model-not-found + availableModels"],
|
|
159
159
|
},
|
|
160
160
|
"workflow.get_published": {
|
|
161
161
|
// A2 locator:模板摘要 activities[].code ↔ 实例/待办 activityCode(Activity.java:26-30
|
|
@@ -178,10 +178,11 @@ const READ_SHAPES = {
|
|
|
178
178
|
],
|
|
179
179
|
},
|
|
180
180
|
"rule.list": {
|
|
181
|
-
keys: ["rules:array<{code,name,enabled,status,ruleVersion,defaultRule,preset,mappings?,mappingsUnavailable?}>", "rulesCount", "modelPresent", "source", "executableHint", "mappingsWireNote?", "schemaCodes?/modelsCount?/models
|
|
181
|
+
keys: ["rules:array<{code,name,enabled,status,ruleVersion,defaultRule,preset,mappings?,mappingsUnavailable?,publishEnabled?,draftEnabled?,draftStatus?,executable?,executableBasis?,draftOnly?}>", "rulesCount", "modelPresent", "source", "executableHint", "draftFace?/draftRowsCount?/draftNote?", "mappingsWireNote?", "schemaCodes?/modelsCount?/models?/partial?/failed?/absentModels?"],
|
|
182
182
|
notes: [
|
|
183
183
|
"入参/他面叫 ruleCode,本面返回 rules[].code",
|
|
184
184
|
"source=published-list:enabled/status 来自 PUBLISH 投影;可执行性看 rule.get / rule.enable.verified",
|
|
185
|
+
"withDraft:true 追加 app DRAFT 面(+1 wire,规则<7 时平台可能补建 7 条预置;回执 draftNote 披露):逐行 publishEnabled/draftEnabled/draftStatus/executable/executableBasis,并补入 PUBLISH 清单看不到的禁用/草稿行(draftOnly:true,enabled/status 为 null)。executable 按平台 getExecutableBySchemaCodeAndCode:DEFAULT 需 DRAFT enabled=true、status!=DISABLED、至少 1 条 latestPublished;CODING/DECISION 只要求 DRAFT 存在",
|
|
185
186
|
"modelPresent:false 时未发 list(避免幻影 schema 补建 7 条预置)",
|
|
186
187
|
"withMappings:true 时每行带 mappings[]={nodeCode,serviceCode,serviceMethodCode,inputCount,outputCount}(摘要,正文 inputMappings/outputMappings 用 rule.get);行里读不到图 → mappingsUnavailable:true(≠没有映射)",
|
|
187
188
|
"schemaCodes[] 跨模型清单:models[] 每元素与单模型回执同形(含 modelPresent:false/rulesCount;三句提示抬到顶层 crossModelNotes,逐模型相同不重复),失败汇总在 failed[](partial:true);上限 20 个模型",
|
|
@@ -221,9 +222,10 @@ const READ_SHAPES = {
|
|
|
221
222
|
// A2 locator:控件清单键 ↔ config.diff 的逐控件差异路径(BizFormModel.java:26-32
|
|
222
223
|
// 六列分面存储,diff 按控件 key 对齐,前缀 view/attributes/html/actions)。
|
|
223
224
|
locator: { controlCodes: "publishedControlCodes|draftControlCodes", diffPath: "changes[].path" },
|
|
224
|
-
keys: ["present", "published", "publishedControlCodes", "draftControlCodes", "childColumnLocator?:{path,children[]}", "formButtonCodes?", "formButtons?", "customButtonJson?(full)", "customButtonJsonShapeWarning?"],
|
|
225
|
+
keys: ["present", "published", "publishedControlCodes", "draftControlCodes", "decorations[{key,type,row}]", "childColumnLocator?:{path,children[]}", "formButtonCodes?", "formButtons?", "customButtonJson?(full)", "customButtonJsonShapeWarning?"],
|
|
225
226
|
notes: [
|
|
226
227
|
"控件清单键是 publishedControlCodes/draftControlCodes,不是 controls;两面差异的逐控件路径在 config.diff changes[].path(前缀 view/attributes/html/actions,按控件 key 对齐)",
|
|
228
|
+
"非字段控件(200/202/203)在 decorations(html=options.name)",
|
|
227
229
|
"表单按钮读 formButtonCodes/formButtons;full:true 另带 customButtonJson 数组原样(库里是字符串脏形时给 customButtonJsonShapeWarning——线上 #38 前端按钮不渲染,重写 buttons 自愈)",
|
|
228
230
|
],
|
|
229
231
|
},
|
package/dist/read.js
CHANGED
|
@@ -2,7 +2,7 @@ import { assertWithinCoverage } from "./coverage.js";
|
|
|
2
2
|
import { wireErrorKind, isUncertainWireError, refusalFromCoverage, sha256, writeArtifact } from "./support.js";
|
|
3
3
|
import { READ_FULL_INLINE_CEILING_BYTES, omittedScalarKeys, passthroughScalars, projectReadResult, projectReadSemantics, } from "./read-projection.js";
|
|
4
4
|
import { plannableArgsRaw } from "./plan.js";
|
|
5
|
-
import { WireError } from "./wire.js";
|
|
5
|
+
import { WireError, PLATFORM_API_UP_ROUTE_NOT_FOUND, PLATFORM_API_DOWN } from "./wire.js";
|
|
6
6
|
import { describeWireFailure, isRetryableTransportKind } from "./wire-failure.js";
|
|
7
7
|
/**
|
|
8
8
|
* B3(0.8.4,2026-11-25 真机):幂等读的有界重试。
|
|
@@ -157,7 +157,9 @@ export async function governedRead(ctx, tool, args, execute, options = {}) {
|
|
|
157
157
|
const plan = projectReadResult(result, {
|
|
158
158
|
toolName: tool.name,
|
|
159
159
|
full: options.full === true,
|
|
160
|
-
|
|
160
|
+
// issue #65:投影需要本次参数(app.list 的 all/limit/offset 决定内联多少条),
|
|
161
|
+
// 但前面的完整性短路/缓存键仍只看结果。传 args 是纯增量,旧的两参 compact 照旧可用。
|
|
162
|
+
...(options.compact !== undefined ? { customProjection: (raw) => options.compact(raw, session, args) } : {}),
|
|
161
163
|
});
|
|
162
164
|
const rawBytes = plan.decision.bytes;
|
|
163
165
|
if (options.full === true) {
|
|
@@ -208,6 +210,14 @@ export async function governedRead(ctx, tool, args, execute, options = {}) {
|
|
|
208
210
|
// 端点、尝试次数、失败分类、可执行回退都在这里(判定不变)。
|
|
209
211
|
attempts: Math.max(1, attempts),
|
|
210
212
|
...transportDiagnostics(tool.name, error, sessionRef?.environmentName ?? args.environment, Math.max(0, attempts - 1), facts),
|
|
213
|
+
// issue #77.6:网关 HTML 404 的判定子类(healthz 探测结果)随回执带出,
|
|
214
|
+
// 调用方据此区分「平台在线但路由没到」与「平台不可用」。
|
|
215
|
+
...(error instanceof WireError && error.diagnostic?.health !== undefined
|
|
216
|
+
? {
|
|
217
|
+
healthProbe: error.diagnostic.health,
|
|
218
|
+
gateway404Class: error.diagnostic.health.up ? PLATFORM_API_UP_ROUTE_NOT_FOUND : PLATFORM_API_DOWN,
|
|
219
|
+
}
|
|
220
|
+
: {}),
|
|
211
221
|
// issue 2026-11 F5:传输失败时把「到底打的是哪台」一起回出来——真机会话里
|
|
212
222
|
// env list 是 cwd 作用域,agent 静默落到全局 default 的另一台主机,只看
|
|
213
223
|
// detail 无从判断。configRoot/项目根用 `omc env list` 复核。
|
package/dist/recipes/field.js
CHANGED
|
@@ -56,11 +56,15 @@ const formConditionalRequired = Object.freeze({
|
|
|
56
56
|
name: "请假事由",
|
|
57
57
|
options: { requiredFormula: '{leave_amount} 大于 {"valueType":"custom","value":5000}' },
|
|
58
58
|
},
|
|
59
|
-
preconditions: [
|
|
60
|
-
|
|
59
|
+
preconditions: [
|
|
60
|
+
"目标字段与作为条件的字段都已发布",
|
|
61
|
+
"这是门户表单交互层(真实门户打开表单、改条件字段值来验证控件是否变必填);**不要用 datarule.create**——实测 type4 不会让门户控件变必填,且符号式经 historyOpt 会让表单渲染崩溃",
|
|
62
|
+
"**权威面 = 字段级 `options.requiredFormula`**(本 recipe)。控件级同名键(`form.draft` 的 `draftAttributesJson.<控件>.options.requiredFormula`)是派生面:设计器保存会按字段元数据/规则行重建控件,手写控件级会被清空(**已在 8.1.108 真机连续 3 次验证**;**其他版本需真机采样**)。不要手写控件级;回执 `requiredFormulaDrift` 点名时改字段级。",
|
|
63
|
+
],
|
|
64
|
+
conditionalRequirements: ["条件串:`{字段} 操作符 [值]`(操作符两侧留空格),字段级写入自动配对 bizdatarule type4。操作符用**中文**(真实设计器产出):等于/不等于/大于/小于/大于等于/小于等于/包含/不包含/包含全部/包含任意一个/等于任意一个/为空/不为空;也接受符号 == != > >= <= Contains IsEmpty。为空/不为空**不带值**(`{reason} 不为空`),其余带 JSON 值 {\"valueType\":...,\"value\":...}。多条件用 ` && `、多组用 ` || `。**不是** eq/gt/isnull——会让门户渲染 SyntaxError"],
|
|
61
65
|
priorToolReferences: [{ tool: "field.list", args: { environment, schemaCode: model, published: true }, purpose: "确认条件字段与目标字段都已发布" }],
|
|
62
66
|
dryRun: { supported: true, command: `omc call field.update --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 校验字段 options 形状,不写入" },
|
|
63
|
-
expectedReadback: { readback: { field: { code: "leaveReason", options: { requiredFormula: "<protocol>" } } }, next: ["(一调)field.update cascadeRepublish:true", "(分步)field.publish → form.draft(rebuild) → form.publish", "(只刷新表单)form.publish rebuild:true"] },
|
|
67
|
+
expectedReadback: { readback: { field: { code: "leaveReason", options: { requiredFormula: "<protocol>" } } }, verification: "字段级回读 field.get full:true → options.requiredFormula;控件级用 form.get controls:true 读 draftAttributesJson(派生面,应一致);设计器保存后应仍在门户生效(点验:改条件字段值看控件必填)。requiredFormulaDrift 为空即对齐。", next: ["(一调)field.update cascadeRepublish:true", "(分步)field.publish → form.draft(rebuild) → form.publish", "(只刷新表单)form.publish rebuild:true"] },
|
|
64
68
|
refusalRecovery: [
|
|
65
69
|
{ code: "capability-out-of-coverage", action: "条件串用中文或符号操作符(等于/大于/不为空 或 == />/IsEmpty);恒必填用字面量 \"true\"" },
|
|
66
70
|
...commonRecovery,
|
package/dist/recipes/form.js
CHANGED
|
@@ -95,8 +95,58 @@ const formDraftTwoColumn = Object.freeze({
|
|
|
95
95
|
],
|
|
96
96
|
requiresEnvironmentDerivedIds: false,
|
|
97
97
|
});
|
|
98
|
+
/**
|
|
99
|
+
* GitLab issue #57(CloudPivot 8.1.108):设计器「描述说明」控件(type 202)的正文
|
|
100
|
+
* 是 `options.name` 里的整段 HTML(前端 template.ts:185 + 移动端
|
|
101
|
+
* `innerHTML` 渲染分支)。此前只能由用户在设计器手加,rebuild 还会清空。
|
|
102
|
+
* 配方给一个可直接抄的红字提示形状;`decorations` 是增量面,不必回传整包 attrs。
|
|
103
|
+
*/
|
|
104
|
+
const formDraftDescription = Object.freeze({
|
|
105
|
+
id: "form-description-block",
|
|
106
|
+
title: "表单加描述块/红色说明文字(类型 202 布局控件,HTML 写 options.name)",
|
|
107
|
+
aliases: ["描述块", "描述控件", "描述说明", "富文本说明", "红字提示", "说明文字"],
|
|
108
|
+
status: "offline-valid",
|
|
109
|
+
tool: "form.draft",
|
|
110
|
+
args: {
|
|
111
|
+
environment,
|
|
112
|
+
schemaCode: model,
|
|
113
|
+
decorations: [
|
|
114
|
+
{
|
|
115
|
+
type: 202,
|
|
116
|
+
html: '<div style="color:#e02020">如涉及二级图纸归档,需明确产品是否做小批试制</div>',
|
|
117
|
+
span: 24,
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
preconditions: [
|
|
122
|
+
"表单已有控件面(先 configure_form 或 form.draft 把字段绑进表单);decorations 是增量面,不负责从零建表",
|
|
123
|
+
"202 的正文是 html(写进 options.name,设计器同形,按 innerHTML 渲染);200 分组标题 / 203 表单标题用 name 纯文本",
|
|
124
|
+
"**存储/发布/读回已在 2.1.5 验证;门户设计器渲染未验证**(需 8.1.108 或真页采样)——写完务必门户打开表单点验,不要只凭 form.get 回执宣称渲染正常",
|
|
125
|
+
"key 省略自动生成 Description<序号>;带 key 命中既有布局控件=改它(其余 options 原样保留)",
|
|
126
|
+
"row 是 1-based 插入行(省略=末尾追加一行);span ∈ 6/8/12/16/18/24,插入已占满的行会拒 form-decoration-row-full",
|
|
127
|
+
"decorations 与 draftViewJson/draftAttributesJson/layout/rebuild/fieldCodes/childColumns 互斥",
|
|
128
|
+
],
|
|
129
|
+
conditionalRequirements: [
|
|
130
|
+
"写完必须 form.publish 才在门户生效;验收用 form.get 的 `decorations`(html 原文 + row)核对,不要整包 diff",
|
|
131
|
+
"rebuild:true 会原样保留 202 描述块(含 displayFormula);额外的分组标题/表单标题会被 fail-closed 拒绝并在 losing 列出",
|
|
132
|
+
],
|
|
133
|
+
priorToolReferences: [
|
|
134
|
+
{ tool: "form.get", args: { environment, schemaCode: model }, purpose: "确认表单已有控件面,并看 decorations 里已有的描述块 key/row" },
|
|
135
|
+
],
|
|
136
|
+
dryRun: { supported: true, command: `omc call form.draft --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 跑同一个 composeFormDecorationsDraft:回执 decorations.added/rows 就是真写会写下的控件,零 wire 写入" },
|
|
137
|
+
expectedReadback: {
|
|
138
|
+
readback: { decorations: { added: [{ type: 202 }] }, next: ["form.publish", "form.get 核对 decorations"] },
|
|
139
|
+
},
|
|
140
|
+
refusalRecovery: [
|
|
141
|
+
{ code: "form-decorations-no-baseline", action: "先用 configure_form 或 form.draft 把已发布字段绑进表单,再加描述块" },
|
|
142
|
+
{ code: "form-decoration-param-conflict", action: "decorations 是增量面:只传 decorations,不要同时传整包 draftViewJson/draftAttributesJson 或 rebuild" },
|
|
143
|
+
{ code: "form-decoration-row-full", action: "省略 row 让描述块单独占一末行;或换到尚有 24 栅格余量的行;或显式传合法的 span" },
|
|
144
|
+
...commonRecovery,
|
|
145
|
+
],
|
|
146
|
+
requiresEnvironmentDerivedIds: false,
|
|
147
|
+
});
|
|
98
148
|
export const FORM_METADATA = Object.freeze({
|
|
99
149
|
"configure_form": Object.freeze({ recipes: [configureFormRecipe], relatedTools: ["field.list", "field.update", "listview.create", "listview.get"] }),
|
|
100
|
-
"form.draft": Object.freeze({ recipes: [formDraftTwoColumn], relatedTools: ["field.list", "field.publish", "form.get", "form.publish"] }),
|
|
150
|
+
"form.draft": Object.freeze({ recipes: [formDraftTwoColumn, formDraftDescription], relatedTools: ["field.list", "field.publish", "form.get", "form.publish"] }),
|
|
101
151
|
});
|
|
102
152
|
//# sourceMappingURL=form.js.map
|
|
@@ -11,7 +11,7 @@ const workflowSave = Object.freeze({
|
|
|
11
11
|
preconditions: ["模型默认表单/字段和 workflow 已发布;应用可用;formData 不带已存在 id"],
|
|
12
12
|
conditionalRequirements: [
|
|
13
13
|
"workflow draft-save 总是 INSERT;不要把已存在记录 id 放进 formData",
|
|
14
|
-
"子表新建行缺 sortKey 时工具按数组下标补
|
|
14
|
+
"子表新建行缺 sortKey 时工具按数组下标补 0..n-1(平台读回固定 sortKey ASC;更新既有记录请显式带 sortKey)",
|
|
15
15
|
"关联字段(WORK_SHEET)在 formData 里写 `\"<relationField>\":\"<bizObjectId>\"`(`{id}` 也接受;读回是 `{schemaCode,id,displayCode}`);子表行内关联列同理。人员/组织字段写数组 `[{id,type,name}]`。",
|
|
16
16
|
"**50000 疑应用未发布**:某些环境里模型所在应用未发布时运行时写稳定 50000(工具反推拒 app-not-published;同调用在已发布应用成功);非普遍规律——另有一类环境未发布也能写(2026-09-19 实测,案卷 docs/issues/omc-cli-findings-2026-09-19.md B17)。遇 50000 先只读核对,别仅凭「应用未发布」放弃运行时验证。",
|
|
17
17
|
],
|
|
@@ -90,14 +90,15 @@ const workflowSubmit = Object.freeze({
|
|
|
90
90
|
conditionalRequirements: [
|
|
91
91
|
"workItemId 或 workflowInstanceId 出现时必须传 bizObjectId;身份只能复制 data.save 的 authoritative readback",
|
|
92
92
|
"**审批提交(workItemId/workflowInstanceId)只传主表字段**:formData 里不要带子表数组——平台按「追加行」再插一份(真机 2→6 行),CLI 默认拒 `submit-approval-child-rows`。子表数组只在保存/首次提交时带;确要在审批中追加子行才显式传 allowChildRowAppend:true",
|
|
93
|
-
"子表读回顺序按 sortKey ASC(平台固定排序):**新建**保存/提交时 CLI 会给缺 sortKey 的子行按数组下标补
|
|
93
|
+
"子表读回顺序按 sortKey ASC(平台固定排序):**新建**保存/提交时 CLI 会给缺 sortKey 的子行按数组下标补 0..n-1(显式值保留);更新既有记录请显式带 sortKey,否则 null 排序不保证",
|
|
94
|
+
"节点字段权限(editable/visible)只是门户读面膜:REST 提交/普通更新都不校验(回执 nodeFieldPermissionNote)",
|
|
94
95
|
],
|
|
95
96
|
priorToolReferences: [
|
|
96
97
|
{ tool: "data.save", args: { environment, schemaCode: model, workflowCode: "<workflow.code>", formData: { name: "recipe draft" } }, purpose: "提供三个环境生成的提交身份" },
|
|
97
98
|
{ tool: "workitem.list", args: { environment }, purpose: "当 data.save 未直接返回 workItemId 时按 workflowInstanceId 解析待办" },
|
|
98
99
|
],
|
|
99
100
|
dryRun: { supported: true, command: `omc call data.submit --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 验证两段式参数关系,不推进 workflow" },
|
|
100
|
-
expectedReadback: { performed: { formType: "1" }, readback: { sequenceStatus: "COMPLETED", workflowInstanceId: "<same-as-data.save>", workItemId: "<same-as-data.save>" } },
|
|
101
|
+
expectedReadback: { performed: { formType: "1" }, readback: { sequenceStatus: "COMPLETED", workflowInstanceId: "<same-as-data.save>", workItemId: "<same-as-data.save>", nodeFieldPermissionNote: "<带 formData 的审批提交回:节点权限只作用门户读面膜>" } },
|
|
101
102
|
refusalRecovery: [
|
|
102
103
|
{ code: "submit-biz-object-id-required", action: "把 data.save 的 bizObjectId 原样传给 data.submit" },
|
|
103
104
|
{ code: "submit-existing-workflow-unsupported", action: "不要用旧行 + workflowCode 启动;先 data.save 新建 DRAFT,再用返回 workItemId 提交" },
|
|
@@ -158,7 +159,7 @@ const childRowsUpsert = Object.freeze({
|
|
|
158
159
|
refusalRecovery: [
|
|
159
160
|
{ code: "child-rows-missing-id", action: "无 id 的行补 id 或改 rowStatus:Added" },
|
|
160
161
|
],
|
|
161
|
-
notes: "data.save 新建时子行可不带 id(工具 stamp Added,并按数组下标补缺省 sortKey
|
|
162
|
+
notes: "data.save 新建时子行可不带 id(工具 stamp Added,并按数组下标补缺省 sortKey 0..n-1);本配方指 update/既有记录——更新既有行请显式带 sortKey(平台读回按 sortKey ASC,null 顺序不保证)",
|
|
162
163
|
requiresEnvironmentDerivedIds: true,
|
|
163
164
|
});
|
|
164
165
|
const dataDeleteSweep = Object.freeze({
|