@stalfh233/omc-cli 0.8.11 → 0.8.13
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 +1 -1
- package/dist/form-default.js +9 -5
- package/dist/form-support.js +348 -3
- package/dist/lanes/form.js +23 -2
- package/dist/lanes/runtime-data-contract.js +1 -1
- package/dist/lanes/runtime-data.js +96 -11
- package/dist/model-purge.js +31 -12
- package/dist/path-projection.js +150 -11
- package/dist/recipes/form.js +10 -1
- package/dist/recipes/runtime-data.js +4 -1
- package/package.json +3 -3
- package/skills/omc-start-here.md +1 -1
package/dist/cli.js
CHANGED
|
@@ -3619,7 +3619,7 @@ async function main() {
|
|
|
3619
3619
|
.option("--env <environment>")
|
|
3620
3620
|
.option("--environment <environment>")
|
|
3621
3621
|
.option("--apply")
|
|
3622
|
-
.addHelpText("after", "\n一条命令按依赖倒序清掉一个模型:列表视图 → 业务规则 → 计算规则 → 流程实例 → 流程 → 模型(字段/表单随模型级联,并级联删除流程模板 <code>_wf 及其发起权限绑定)。默认 dry-run。\n
|
|
3622
|
+
.addHelpText("after", "\n一条命令按依赖倒序清掉一个模型:列表视图 → 业务规则 → 计算规则 → 流程实例 → 流程 → 模型(字段/表单随模型级联,并级联删除流程模板 <code>_wf 及其发起权限绑定)。默认 dry-run。\n入站引用(被其它模型关联字段引用,或子表关联列指向自身):dry-run 回 status:\"dry-run\" + blocker:\"model-referenced-by\" 并预置 unbindSteps/wouldRequireFlags(一条完整计划,零写入);--apply 未带 --unbind-references 时回 blocked/partial 并给 deletionSteps;加 --unbind-references --apply 让本命令先拆引用(破坏性:会删除引用列/子表关联列,列数据不可恢复),任一步失败即停且不删模型。\n业务数据:--purge-instances 删流程实例;普通业务行(无流程)不会自动带走——先 data.delete 清(sweep-all-readback 配方),再 purge,否则留孤儿数据。\n")
|
|
3623
3623
|
.action(async (options) => {
|
|
3624
3624
|
const rest = ["model-purge",
|
|
3625
3625
|
...(options.code ? ["--code", options.code] : []),
|
package/dist/form-default.js
CHANGED
|
@@ -41,9 +41,11 @@ function extractControls(formGet) {
|
|
|
41
41
|
return undefined;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
* `form.get`
|
|
45
|
-
*
|
|
46
|
-
*
|
|
44
|
+
* `form.get` 的**默认(非 full)面**把大字段降载(长字符串 → `{length, sha256,
|
|
45
|
+
* omitted:true}`、控件清单 → `{keys, sha256, omitted:true}`),raw 面在
|
|
46
|
+
* detailArtifactId。`full:true` 在 2.1.5 实测全文内联(约 19KB),只有超过内联
|
|
47
|
+
* 上限才走 `*Omitted` + artifact——但 `controls:true` 仍可能只回定义摘要。
|
|
48
|
+
* 把摘要当数组会读成「2 个控件」。
|
|
47
49
|
*
|
|
48
50
|
* r10 (2026-10-22) F1: `form-default --apply` cloned that摘要 as the draft, wrote
|
|
49
51
|
* a 2-control form, and `form.publish`'s degrade guard then refused its own
|
|
@@ -137,8 +139,10 @@ export async function cmdFormDefault(args) {
|
|
|
137
139
|
return 0;
|
|
138
140
|
}
|
|
139
141
|
// 2) form.draft:需要完整 draftAttributesJson——单控件投影不够,取发布面的全量控件
|
|
140
|
-
// 图。`controls:true`
|
|
141
|
-
//
|
|
142
|
+
// 图。`controls:true` 的定义映射可能是摘要({keys,sha256}),默认面的大字符串也
|
|
143
|
+
// 可能被通用降载折成 {length,sha256};`full:true` 在 2.1.5 是全文内联,但超过
|
|
144
|
+
// 内联上限(当前 32KB)会外置成 `*Omitted` + artifact——两条路都以 detail
|
|
145
|
+
// artifact 为安全取值面。
|
|
142
146
|
const getAll = await runToolCall("form.get", { args: { schemaCode: schema, full: true, ...(environment ? { environment } : {}) }, requestId: request, environment, print: silent });
|
|
143
147
|
if (getAll.exitCode !== 0) {
|
|
144
148
|
const classified = classifyResult(getAll.result);
|
package/dist/form-support.js
CHANGED
|
@@ -4,7 +4,7 @@ import { decodeJsonObjectColumn } from "./json-column.js";
|
|
|
4
4
|
import { ToolRefusalError } from "./tool-types.js";
|
|
5
5
|
import { FIELD_CONTROL_TYPES, childColumnsOf, SYSTEM_FIELD_CODES, fieldControlOptions, relationDisplayField, relationMappings, } from "./field-families.js";
|
|
6
6
|
import { deriveControlOptions } from "./capability-shape.js";
|
|
7
|
-
import { hardLayoutViolations, validateFormLayoutShape, controlTypeMismatches, FORM_CONTROL_TYPE_HINT } from "./form-layout.js";
|
|
7
|
+
import { ALLOWED_SPANS, FULL_SPAN, hardLayoutViolations, validateFormLayout, validateFormLayoutShape, controlTypeMismatches, FORM_CONTROL_TYPE_HINT } from "./form-layout.js";
|
|
8
8
|
/**
|
|
9
9
|
* Propagate each relation field's `options.mappings` into its form control so
|
|
10
10
|
* the form-fill carry is configured where the form renderer reads it. The
|
|
@@ -845,6 +845,327 @@ export function assertCallerFormLayout(args) {
|
|
|
845
845
|
});
|
|
846
846
|
}
|
|
847
847
|
}
|
|
848
|
+
const LAYOUT_SYSTEM_CONTROL_TYPES = new Set([100, 101, 102, 103, 104, 105, 106, 200, 203, 249]);
|
|
849
|
+
/** 系统/布局控件:系统字段码、设计器脚手架的 Title…/Group… 键,或系统控件类型。 */
|
|
850
|
+
export function isLayoutSystemControl(code, control) {
|
|
851
|
+
if (SYSTEM_FIELD_CODES.has(code))
|
|
852
|
+
return true;
|
|
853
|
+
if (/^(Title|Group)\d*$/.test(code))
|
|
854
|
+
return true;
|
|
855
|
+
const rawType = control && typeof control === "object" ? control.type : undefined;
|
|
856
|
+
const type = Number(rawType);
|
|
857
|
+
return Number.isInteger(type) && LAYOUT_SYSTEM_CONTROL_TYPES.has(type);
|
|
858
|
+
}
|
|
859
|
+
function layoutRowsOf(face) {
|
|
860
|
+
if (typeof face !== "string")
|
|
861
|
+
return undefined;
|
|
862
|
+
try {
|
|
863
|
+
const parsed = JSON.parse(face);
|
|
864
|
+
if (!Array.isArray(parsed))
|
|
865
|
+
return undefined;
|
|
866
|
+
if (!parsed.every((row) => Array.isArray(row) && row.every((cell) => typeof cell === "string")))
|
|
867
|
+
return undefined;
|
|
868
|
+
return parsed;
|
|
869
|
+
}
|
|
870
|
+
catch {
|
|
871
|
+
return undefined;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
/** 行内自动均分:24/n 必须在 span 白名单内(n=1→24,2→12,3→8,4→6;>4 无整数解)。 */
|
|
875
|
+
function evenLayoutSpan(count) {
|
|
876
|
+
if (count <= 0)
|
|
877
|
+
return undefined;
|
|
878
|
+
const span = FULL_SPAN / count;
|
|
879
|
+
return Number.isInteger(span) && ALLOWED_SPANS.has(span) ? span : undefined;
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* `layout` 是增量面,与「整包布局/重建」参数互斥。纯参数门:在写权限门与任何
|
|
883
|
+
* wire 之前拒绝(preflight 调用,execute 也调一次防内部调用方绕过)。
|
|
884
|
+
*/
|
|
885
|
+
export function assertLayoutRequestConflicts(args) {
|
|
886
|
+
if (args.layout === undefined)
|
|
887
|
+
return;
|
|
888
|
+
const conflictKeys = ["draftViewJson", "draftAttributesJson", "rebuild", "refreshFromFields", "fromReadback", "fieldCodes", "childColumns"].filter((key) => args[key] !== undefined);
|
|
889
|
+
if (conflictKeys.length === 0)
|
|
890
|
+
return;
|
|
891
|
+
throw new ToolRefusalError({
|
|
892
|
+
status: "refused",
|
|
893
|
+
blocker: "form-layout-param-conflict",
|
|
894
|
+
schemaCode: String(args.schemaCode ?? ""),
|
|
895
|
+
sheetCode: String(args.sheetCode ?? args.schemaCode ?? ""),
|
|
896
|
+
conflictKeys,
|
|
897
|
+
message: `layout 与 ${conflictKeys.join("、")} 互斥:layout 是增量面(以已发布表单为基线,只改这些控件的行分组与 span),不要同时回传整包 attrs/view、不要重建;二选一。`,
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* 用 `layout` 生成 form.draft 的 viewJson/attributesJson:基线控件面逐键保留,只改
|
|
902
|
+
* rows 分组 + 被点名控件的 options.span。dry-run(writeLint)与真写共用本函数,
|
|
903
|
+
* 因此两边答案逐字相同。
|
|
904
|
+
*/
|
|
905
|
+
export async function composeFormLayoutDraft(session, args) {
|
|
906
|
+
const { layout } = args;
|
|
907
|
+
const sheet = await readFormOrNull(session, args.schemaCode, args.sheetCode);
|
|
908
|
+
const decode = (value) => decodeJsonObjectColumn(value, { invalid: "undefined", array: "reject", object: "accept" });
|
|
909
|
+
const publishedAttrs = sheet === null ? undefined : decode(sheet.publishedAttributesJson);
|
|
910
|
+
const draftAttrs = sheet === null ? undefined : decode(sheet.draftAttributesJson);
|
|
911
|
+
const baseline = publishedAttrs !== undefined && Object.keys(publishedAttrs).length > 0
|
|
912
|
+
? "published"
|
|
913
|
+
: draftAttrs !== undefined && Object.keys(draftAttrs).length > 0
|
|
914
|
+
? "draft"
|
|
915
|
+
: undefined;
|
|
916
|
+
if (sheet === null || baseline === undefined) {
|
|
917
|
+
throw new ToolRefusalError({
|
|
918
|
+
status: "refused",
|
|
919
|
+
blocker: "form-layout-baseline-absent",
|
|
920
|
+
schemaCode: args.schemaCode,
|
|
921
|
+
sheetCode: args.sheetCode,
|
|
922
|
+
message: `表单 ${args.sheetCode} 没有可作基线的控件面(published/draft 的 attributes 都为空或不存在):layout 是增量面,必须先有表单控件。新建表单用 form.draft {rebuild:true} 或 draftAttributesJson 先建布局,不要用 layout 从零搭表。`,
|
|
923
|
+
});
|
|
924
|
+
}
|
|
925
|
+
const attrs = (baseline === "published" ? publishedAttrs : draftAttrs);
|
|
926
|
+
const attrCodes = Object.keys(attrs);
|
|
927
|
+
const attrSet = new Set(attrCodes);
|
|
928
|
+
const rowsInput = layout.rows;
|
|
929
|
+
if (!Array.isArray(rowsInput) || rowsInput.length === 0) {
|
|
930
|
+
throw new ToolRefusalError({
|
|
931
|
+
status: "refused",
|
|
932
|
+
blocker: "form-layout-rows-invalid",
|
|
933
|
+
schemaCode: args.schemaCode,
|
|
934
|
+
sheetCode: args.sheetCode,
|
|
935
|
+
message: "layout.rows 必须是非空二维数组:一行几个 code 就是几列(如 [[\"a\",\"b\"],[\"c\"]])。",
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
const named = [];
|
|
939
|
+
const namedSet = new Set();
|
|
940
|
+
for (const [rowIndex, row] of rowsInput.entries()) {
|
|
941
|
+
if (!Array.isArray(row) || row.length === 0) {
|
|
942
|
+
throw new ToolRefusalError({
|
|
943
|
+
status: "refused",
|
|
944
|
+
blocker: "form-layout-rows-invalid",
|
|
945
|
+
schemaCode: args.schemaCode,
|
|
946
|
+
sheetCode: args.sheetCode,
|
|
947
|
+
row: rowIndex + 1,
|
|
948
|
+
message: `layout.rows 第 ${rowIndex + 1} 行是空行或不是数组:每行至少要有一个控件 code。`,
|
|
949
|
+
});
|
|
950
|
+
}
|
|
951
|
+
for (const code of row) {
|
|
952
|
+
if (typeof code !== "string" || code === "") {
|
|
953
|
+
throw new ToolRefusalError({
|
|
954
|
+
status: "refused",
|
|
955
|
+
blocker: "form-layout-rows-invalid",
|
|
956
|
+
schemaCode: args.schemaCode,
|
|
957
|
+
sheetCode: args.sheetCode,
|
|
958
|
+
row: rowIndex + 1,
|
|
959
|
+
message: `layout.rows 第 ${rowIndex + 1} 行含非字符串/空 code;每个单元格必须是控件 code 字符串。`,
|
|
960
|
+
});
|
|
961
|
+
}
|
|
962
|
+
if (namedSet.has(code)) {
|
|
963
|
+
throw new ToolRefusalError({
|
|
964
|
+
status: "refused",
|
|
965
|
+
blocker: "form-layout-rows-duplicate",
|
|
966
|
+
schemaCode: args.schemaCode,
|
|
967
|
+
sheetCode: args.sheetCode,
|
|
968
|
+
field: code,
|
|
969
|
+
message: `layout.rows 里 ${code} 出现多次:一个控件只能占一个位置(否则换行/覆盖语义不唯一)。`,
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
namedSet.add(code);
|
|
973
|
+
named.push(code);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
const unknownControls = named.filter((code) => !attrSet.has(code));
|
|
977
|
+
if (unknownControls.length > 0) {
|
|
978
|
+
throw new ToolRefusalError({
|
|
979
|
+
status: "refused",
|
|
980
|
+
blocker: "form-layout-unknown-controls",
|
|
981
|
+
schemaCode: args.schemaCode,
|
|
982
|
+
sheetCode: args.sheetCode,
|
|
983
|
+
unknownControls,
|
|
984
|
+
availableControls: attrCodes,
|
|
985
|
+
message: `layout.rows 引用了基线 ${baseline} 控件面里不存在的控件:${unknownControls.join("、")}。布局只能重排**已有控件**;新字段先 field.publish 并用 form.draft {rebuild:true} 等把控件加进表单,再用 layout 调布局。`,
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
const systemNamed = named.filter((code) => isLayoutSystemControl(code, attrs[code]));
|
|
989
|
+
if (systemNamed.length > 0 && layout.includeSystem !== true) {
|
|
990
|
+
throw new ToolRefusalError({
|
|
991
|
+
status: "refused",
|
|
992
|
+
blocker: "layout-system-control-locked",
|
|
993
|
+
schemaCode: args.schemaCode,
|
|
994
|
+
sheetCode: args.sheetCode,
|
|
995
|
+
systemControls: systemNamed,
|
|
996
|
+
message: `layout.rows 点名了系统控件 ${systemNamed.join("、")}:系统控件默认保留原行,不参与业务布局重排。确要移动它们请显式传 includeSystem:true;否则从 rows 里去掉(它们会自动保留在基线位置)。`,
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
const spanInput = layout.spans ?? {};
|
|
1000
|
+
const straySpans = Object.keys(spanInput).filter((code) => !namedSet.has(code));
|
|
1001
|
+
if (straySpans.length > 0) {
|
|
1002
|
+
throw new ToolRefusalError({
|
|
1003
|
+
status: "refused",
|
|
1004
|
+
blocker: "form-layout-spans-unknown",
|
|
1005
|
+
schemaCode: args.schemaCode,
|
|
1006
|
+
sheetCode: args.sheetCode,
|
|
1007
|
+
unknownSpans: straySpans,
|
|
1008
|
+
message: `layout.spans 只给 layout.rows 里的控件:${straySpans.join("、")} 不在任何一行。未列入 rows 的控件保留基线 span,不需要也不必给它传 span。`,
|
|
1009
|
+
});
|
|
1010
|
+
}
|
|
1011
|
+
const spans = {};
|
|
1012
|
+
for (const [rowIndex, row] of rowsInput.entries()) {
|
|
1013
|
+
const explicit = row.map((code) => spanInput[code]);
|
|
1014
|
+
let used = 0;
|
|
1015
|
+
for (const [cellIndex, span] of explicit.entries()) {
|
|
1016
|
+
if (span === undefined)
|
|
1017
|
+
continue;
|
|
1018
|
+
if (!Number.isInteger(span) || !ALLOWED_SPANS.has(span)) {
|
|
1019
|
+
throw new ToolRefusalError({
|
|
1020
|
+
status: "refused",
|
|
1021
|
+
blocker: "form-layout-invalid",
|
|
1022
|
+
schemaCode: args.schemaCode,
|
|
1023
|
+
sheetCode: args.sheetCode,
|
|
1024
|
+
validation: [{ classification: "layout_invalid_span", row: rowIndex + 1, field: row[cellIndex], span }],
|
|
1025
|
+
message: `layout.spans.${row[cellIndex]} = ${String(span)} 不在允许宽度 ${[...ALLOWED_SPANS].join("/")}。`,
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
used += span;
|
|
1029
|
+
}
|
|
1030
|
+
const autoCount = explicit.filter((span) => span === undefined).length;
|
|
1031
|
+
if (autoCount > 0) {
|
|
1032
|
+
const remaining = FULL_SPAN - used;
|
|
1033
|
+
const autoSpan = remaining > 0 && remaining % autoCount === 0 ? remaining / autoCount : Number.NaN;
|
|
1034
|
+
if (!Number.isInteger(autoSpan) || !ALLOWED_SPANS.has(autoSpan)) {
|
|
1035
|
+
throw new ToolRefusalError({
|
|
1036
|
+
status: "refused",
|
|
1037
|
+
blocker: "form-layout-span-unsatisfiable",
|
|
1038
|
+
schemaCode: args.schemaCode,
|
|
1039
|
+
sheetCode: args.sheetCode,
|
|
1040
|
+
row: rowIndex + 1,
|
|
1041
|
+
codes: [...row],
|
|
1042
|
+
usedWidth: used,
|
|
1043
|
+
autoColumns: autoCount,
|
|
1044
|
+
allowedSpans: [...ALLOWED_SPANS],
|
|
1045
|
+
message: `layout.rows 第 ${rowIndex + 1} 行(${row.join(" + ")})无法自动均分:已用 ${used} 格,剩 ${remaining} 格给 ${autoCount} 个未指定 span 的控件。给这些控件显式传 layout.spans,或调整行内控件数。`,
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
explicit.forEach((span, cellIndex) => {
|
|
1049
|
+
if (span === undefined)
|
|
1050
|
+
spans[row[cellIndex]] = autoSpan;
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
else if (used > FULL_SPAN) {
|
|
1054
|
+
throw new ToolRefusalError({
|
|
1055
|
+
status: "refused",
|
|
1056
|
+
blocker: "form-layout-invalid",
|
|
1057
|
+
schemaCode: args.schemaCode,
|
|
1058
|
+
sheetCode: args.sheetCode,
|
|
1059
|
+
validation: [{ classification: "layout_row_overflow", row: rowIndex + 1, message: `第 ${rowIndex + 1} 行 span 合计 ${used},超过 ${FULL_SPAN}` }],
|
|
1060
|
+
message: `layout.rows 第 ${rowIndex + 1} 行(${row.join(" + ")})显式 span 合计 ${used},超过 ${FULL_SPAN}。`,
|
|
1061
|
+
});
|
|
1062
|
+
}
|
|
1063
|
+
explicit.forEach((span, cellIndex) => {
|
|
1064
|
+
if (span !== undefined)
|
|
1065
|
+
spans[row[cellIndex]] = span;
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
// 基线行分组(保留未点名控件):去非法 cell/重复 cell,空行丢弃。
|
|
1069
|
+
const parsedBaseline = layoutRowsOf(baseline === "published" ? sheet.publishedViewJson : sheet.draftViewJson) ?? [];
|
|
1070
|
+
const seenCell = new Set();
|
|
1071
|
+
const baselineRows = [];
|
|
1072
|
+
const droppedCells = [];
|
|
1073
|
+
for (const row of parsedBaseline) {
|
|
1074
|
+
const kept = [];
|
|
1075
|
+
for (const cell of row) {
|
|
1076
|
+
if (!attrSet.has(cell)) {
|
|
1077
|
+
droppedCells.push(cell);
|
|
1078
|
+
continue;
|
|
1079
|
+
}
|
|
1080
|
+
if (seenCell.has(cell))
|
|
1081
|
+
continue;
|
|
1082
|
+
seenCell.add(cell);
|
|
1083
|
+
kept.push(cell);
|
|
1084
|
+
}
|
|
1085
|
+
if (kept.length > 0)
|
|
1086
|
+
baselineRows.push(kept);
|
|
1087
|
+
}
|
|
1088
|
+
const firstNamed = baselineRows.findIndex((row) => row.some((code) => namedSet.has(code)));
|
|
1089
|
+
const lastNamed = firstNamed < 0 ? -1 : baselineRows.reduce((last, row, index) => (row.some((code) => namedSet.has(code)) ? index : last), firstNamed);
|
|
1090
|
+
const prefix = firstNamed < 0 ? baselineRows : baselineRows.slice(0, firstNamed);
|
|
1091
|
+
const suffix = firstNamed < 0 ? [] : baselineRows.slice(lastNamed + 1);
|
|
1092
|
+
const orphanRows = [];
|
|
1093
|
+
if (firstNamed >= 0) {
|
|
1094
|
+
for (let index = firstNamed; index <= lastNamed; index += 1) {
|
|
1095
|
+
const rest = baselineRows[index].filter((code) => !namedSet.has(code));
|
|
1096
|
+
if (rest.length > 0)
|
|
1097
|
+
orphanRows.push(rest);
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
const layoutRows = rowsInput.map((row) => [...row]);
|
|
1101
|
+
const finalRows = firstNamed < 0 ? [...baselineRows, ...layoutRows] : [...prefix, ...layoutRows, ...orphanRows, ...suffix];
|
|
1102
|
+
// 基线 viewJson 里没有的控件(平台草稿可能不完整):按 attrs 顺序追加为末行,保证
|
|
1103
|
+
// 覆盖率门(attributes ↔ rows 一一对应)成立,一个控件都不丢。
|
|
1104
|
+
const placed = new Set(finalRows.flat());
|
|
1105
|
+
const appended = attrCodes.filter((code) => !placed.has(code));
|
|
1106
|
+
for (const code of appended)
|
|
1107
|
+
finalRows.push([code]);
|
|
1108
|
+
// 只改被点名控件的 options.span;其它控件/属性逐键保留(深拷贝后原样序列化)。
|
|
1109
|
+
const composed = JSON.parse(JSON.stringify(attrs));
|
|
1110
|
+
for (const code of named) {
|
|
1111
|
+
const control = composed[code];
|
|
1112
|
+
const options = control.options;
|
|
1113
|
+
if (options === undefined) {
|
|
1114
|
+
control.options = { span: spans[code] };
|
|
1115
|
+
continue;
|
|
1116
|
+
}
|
|
1117
|
+
if (options === null || typeof options !== "object" || Array.isArray(options)) {
|
|
1118
|
+
throw new ToolRefusalError({
|
|
1119
|
+
status: "refused",
|
|
1120
|
+
blocker: "form-layout-invalid",
|
|
1121
|
+
schemaCode: args.schemaCode,
|
|
1122
|
+
sheetCode: args.sheetCode,
|
|
1123
|
+
validation: [{ classification: "control_options_not_object", field: code, message: `控件 ${code} 的 options 不是对象` }],
|
|
1124
|
+
message: `控件 ${code} 的 options 不是对象(基线里是 ${typeof options}):无法安全改 span。先按 form.get 原文修复该控件,再用 layout。`,
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
options.span = spans[code];
|
|
1128
|
+
}
|
|
1129
|
+
const layoutRowStart = firstNamed < 0 ? baselineRows.length : prefix.length;
|
|
1130
|
+
const layoutRowEnd = layoutRowStart + layoutRows.length;
|
|
1131
|
+
const violations = validateFormLayout(finalRows, composed);
|
|
1132
|
+
// 调用方 authored 的行/span 违规 → 拒;平台基线保留下来的行形状(如设计器自带的
|
|
1133
|
+
// 系统行/子表列行)→ 只告警,与本文件 form.draft 的 roundtrip 容忍同口径。
|
|
1134
|
+
const touchesCaller = (violation) => {
|
|
1135
|
+
if (violation.classification === "layout_coverage_mismatch")
|
|
1136
|
+
return true;
|
|
1137
|
+
if (typeof violation.row === "number")
|
|
1138
|
+
return violation.row - 1 >= layoutRowStart && violation.row - 1 < layoutRowEnd;
|
|
1139
|
+
if (typeof violation.field === "string")
|
|
1140
|
+
return namedSet.has(violation.field);
|
|
1141
|
+
return true;
|
|
1142
|
+
};
|
|
1143
|
+
const blocking = violations.filter(touchesCaller);
|
|
1144
|
+
if (blocking.length > 0) {
|
|
1145
|
+
throw new ToolRefusalError({
|
|
1146
|
+
status: "refused",
|
|
1147
|
+
blocker: "form-layout-invalid",
|
|
1148
|
+
schemaCode: args.schemaCode,
|
|
1149
|
+
sheetCode: args.sheetCode,
|
|
1150
|
+
validation: blocking,
|
|
1151
|
+
message: "layout 生成的布局未过布局门;按 validation 修正 rows/spans(span 白名单/行宽≤24/整行独占)。",
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
const warnings = violations.filter((violation) => !touchesCaller(violation));
|
|
1155
|
+
const preserved = attrCodes.filter((code) => !namedSet.has(code));
|
|
1156
|
+
const receipt = {
|
|
1157
|
+
baseline,
|
|
1158
|
+
rows: finalRows.length,
|
|
1159
|
+
named,
|
|
1160
|
+
preserved,
|
|
1161
|
+
...(appended.length > 0 ? { appended } : {}),
|
|
1162
|
+
...(droppedCells.length > 0 ? { droppedCells: [...new Set(droppedCells)] } : {}),
|
|
1163
|
+
spans,
|
|
1164
|
+
includeSystem: layout.includeSystem === true,
|
|
1165
|
+
note: "只改 rows 分组与这些控件的 span;其它控件属性/HTML 逐键保留,未列入 rows 的控件保留基线行(锚定在被点名控件周围)",
|
|
1166
|
+
};
|
|
1167
|
+
return { viewJson: JSON.stringify(finalRows), attributesJson: JSON.stringify(composed), receipt, warnings };
|
|
1168
|
+
}
|
|
848
1169
|
export async function lintFormControlTypes(session, args) {
|
|
849
1170
|
if (typeof args.draftAttributesJson !== "string")
|
|
850
1171
|
return undefined;
|
|
@@ -989,6 +1310,10 @@ function hasExplicitDraftIntent(args) {
|
|
|
989
1310
|
export function refuseEmptyCallerLayout(args) {
|
|
990
1311
|
if (args.allowEmptyLayout === true)
|
|
991
1312
|
return;
|
|
1313
|
+
// layout 是增量面:完整 view/attrs 由 composeFormLayoutDraft 从基线组合出来,
|
|
1314
|
+
// 调用方本来就不传整包面——这不是「没有布局意图」。
|
|
1315
|
+
if (args.layout !== undefined)
|
|
1316
|
+
return;
|
|
992
1317
|
const emptyFaces = [];
|
|
993
1318
|
if (typeof args.draftViewJson === "string" && isEmptyLayoutJson(args.draftViewJson))
|
|
994
1319
|
emptyFaces.push("draftViewJson");
|
|
@@ -1463,6 +1788,10 @@ export function readFormButtons(options) {
|
|
|
1463
1788
|
* so the high-level orchestrator never bypasses the scaffold.
|
|
1464
1789
|
*/
|
|
1465
1790
|
export async function executeFormDraftWrite(session, args) {
|
|
1791
|
+
// 增量布局面(探针 G F3):与整包布局/重建参数互斥,必须在组合之前判。
|
|
1792
|
+
const layoutRequest = args.layout;
|
|
1793
|
+
if (layoutRequest !== undefined)
|
|
1794
|
+
assertLayoutRequestConflicts({ ...args });
|
|
1466
1795
|
// 兼容别名:`fieldCodes:["items.category"]` 等价于
|
|
1467
1796
|
// `childColumns:[{parent:"items",fieldCodes:["category"]}]`(issue #24)。
|
|
1468
1797
|
// 点号形式是使用者最自然的写法——子表列在父模型里本来就该这样指代。
|
|
@@ -1490,6 +1819,17 @@ export async function executeFormDraftWrite(session, args) {
|
|
|
1490
1819
|
if (args.draftHtmlJson !== undefined) {
|
|
1491
1820
|
assertHtmlRender(args.draftHtmlJson, { schemaCode: args.schemaCode, sheetCode: args.sheetCode, face: "draftHtmlJson" });
|
|
1492
1821
|
}
|
|
1822
|
+
// 增量布局面:以已发布(无则草稿)控件面为基线组合出完整 viewJson/attributesJson。
|
|
1823
|
+
// 组合失败(无基线/未知控件/系统控件/span 不自洽)就在任何 wire 之前拒;dry-run 走
|
|
1824
|
+
// 同一个 composeFormLayoutDraft(见 form.draft 的 writeLint),两边答案逐字相同。
|
|
1825
|
+
let layoutReceipt;
|
|
1826
|
+
let composedLayoutWarnings = [];
|
|
1827
|
+
if (layoutRequest !== undefined) {
|
|
1828
|
+
const composed = await composeFormLayoutDraft(session, { schemaCode: args.schemaCode, sheetCode: args.sheetCode, layout: layoutRequest });
|
|
1829
|
+
layoutReceipt = composed.receipt;
|
|
1830
|
+
composedLayoutWarnings = composed.warnings;
|
|
1831
|
+
args = { ...args, draftViewJson: composed.viewJson, draftAttributesJson: composed.attributesJson };
|
|
1832
|
+
}
|
|
1493
1833
|
// Caller-provided layouts get the distribution-grade shape gate (options
|
|
1494
1834
|
// objects, string viewJson cells, no child keys as rows) before any wire.
|
|
1495
1835
|
// Ticket 74 — refuse CALLER-PROVIDED empty layouts before any wire call.
|
|
@@ -1567,7 +1907,8 @@ export async function executeFormDraftWrite(session, args) {
|
|
|
1567
1907
|
// 是工具从已存平台布局追加子表列——两者都不是手写布局,跳过;调用方显式
|
|
1568
1908
|
// allowTypeMismatch:true 时降级为回执 warning(不偷偷改用户输入)。
|
|
1569
1909
|
let controlTypeWarnings;
|
|
1570
|
-
|
|
1910
|
+
// layout 面只改 rows/span,不 author 控件 type:基线里的 type 原样保留,不做枚举交叉校验。
|
|
1911
|
+
if (layoutRequest === undefined && args.draftAttributesJson !== undefined && args.fromReadback !== true && args.amendChildColumns !== true) {
|
|
1571
1912
|
const typeLint = await lintFormControlTypes(session, {
|
|
1572
1913
|
schemaCode: args.schemaCode,
|
|
1573
1914
|
sheetCode: args.sheetCode,
|
|
@@ -1637,7 +1978,9 @@ export async function executeFormDraftWrite(session, args) {
|
|
|
1637
1978
|
// the violations reported as warnings. Caller-authored layouts stay strict.
|
|
1638
1979
|
const roundTripFaces = new Set();
|
|
1639
1980
|
let layoutWarnings = [];
|
|
1640
|
-
|
|
1981
|
+
// layout 组合面已由 composeFormLayoutDraft 做「调用方 rows/spans 严判 + 平台保序行容忍」
|
|
1982
|
+
// 校验,不再按调用方手写整包布局二次严判(基线是平台自己的形状)。
|
|
1983
|
+
if (layoutRequest === undefined && (args.draftViewJson !== undefined || args.draftAttributesJson !== undefined)) {
|
|
1641
1984
|
const pre2 = pre;
|
|
1642
1985
|
const same = (provided, stored) => typeof provided === "string" && typeof stored === "string" && provided.trim() === stored.trim();
|
|
1643
1986
|
const viewRoundTrip = same(args.draftViewJson, pre2?.publishedViewJson) || same(args.draftViewJson, pre2?.draftViewJson);
|
|
@@ -1871,6 +2214,8 @@ export async function executeFormDraftWrite(session, args) {
|
|
|
1871
2214
|
// stored column is the stringified form the form page refuses to render.
|
|
1872
2215
|
...(customButtonJsonStoredShape(sheet.options) === "string" ? { formButtonsShapeWarning: CUSTOM_BUTTON_JSON_STRING_SHAPE_WARNING } : {}),
|
|
1873
2216
|
...(mergedOptions !== undefined ? { customButtonJsonWritten: true } : {}),
|
|
2217
|
+
...(layoutReceipt !== undefined ? { layout: layoutReceipt } : {}),
|
|
2218
|
+
...(composedLayoutWarnings.length > 0 ? { layoutWarnings: composedLayoutWarnings } : {}),
|
|
1874
2219
|
...(controlTypeWarnings !== undefined
|
|
1875
2220
|
? {
|
|
1876
2221
|
controlTypeMismatchAllowed: true,
|
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, lintFormPublishReadOnly, lintFormControlTypes, readFormButtons, readFormOrNull, refuseEmptyCallerLayout, validateHtmlRender, customButtonJsonStoredShape, CUSTOM_BUTTON_JSON_STRING_SHAPE_WARNING, FORM_FLAG_AUTHORITY_NOTE, compareFormFaces, resolveEffectiveFormFace } from "../form-support.js";
|
|
4
|
+
import { executeFormDraftWrite, executeFormPublishWrite, executeFormRunButtonWrite, lintFormPublishReadOnly, lintFormControlTypes, readFormButtons, readFormOrNull, refuseEmptyCallerLayout, validateHtmlRender, customButtonJsonStoredShape, CUSTOM_BUTTON_JSON_STRING_SHAPE_WARNING, FORM_FLAG_AUTHORITY_NOTE, compareFormFaces, resolveEffectiveFormFace, composeFormLayoutDraft, assertLayoutRequestConflicts } 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";
|
|
@@ -573,6 +573,14 @@ export function registerFormLane(tools) {
|
|
|
573
573
|
sheetCode: z.string().min(1).optional().describe("表单槽位码;省略时默认 = schemaCode(模型码即默认表单槽位)"),
|
|
574
574
|
draftViewJson: z.string().optional().describe("行分组:JSON 二维字符串数组 `[[\"codeA\",\"codeB\"],[\"codeC\"]]`——**一行几个 code 就是几列**(不是改 span 来改列数);末行只放一个 code 即整宽。每个 code 必须同时出现在 draftAttributesJson 里。现成样例:`omc describe form.draft --example two-column-layout`"),
|
|
575
575
|
draftAttributesJson: z.string().optional().describe("控件表:JSON 对象 `{ \"codeA\": { key:\"codeA\", type: <表单控件类型号>, options:{ name:\"显示名\", span: 12 } } }`。**控件 type 是表单控件枚举,不是字段 propertyType**(80=关联单选/201=子表…);错枚举拒 `form-control-type-mismatch`。`span` 是 24 栅格宽度:两列各 span:12、整宽 span:24(须与 draftViewJson 行分组自洽)。样例:`omc describe form.draft --example two-column-layout`"),
|
|
576
|
+
layout: z
|
|
577
|
+
.object({
|
|
578
|
+
rows: z.array(z.array(z.string().min(1)).min(1)).min(1),
|
|
579
|
+
spans: z.record(z.string(), z.number().int().positive()).optional(),
|
|
580
|
+
includeSystem: z.boolean().optional(),
|
|
581
|
+
})
|
|
582
|
+
.optional()
|
|
583
|
+
.describe("增量布局(推荐):{rows:[[\"a\",\"b\"],[\"c\"]],spans?:{a:12},includeSystem?}。以已发布(无则草稿)表单为基线,只改 rows 行分组与这些控件 span,**不必回传整包 attrs**;未列入 rows 的控件保留原行,系统控件须 includeSystem:true 才动。与 draftViewJson/draftAttributesJson/rebuild 互斥"),
|
|
576
584
|
allowTypeMismatch: z.boolean().optional().describe("放行控件 type 与字段 propertyType 不匹配(默认拒 form-control-type-mismatch;仅平台模板明确要求特殊控件时用)"),
|
|
577
585
|
draftHtmlJson: z.string().optional(),
|
|
578
586
|
fieldCodes: z.array(z.string().min(1)).optional().describe("脚手架绑定的已发布字段(按此顺序);由 configure_form/intent 显式传入。子表列写「父字段.子列」等价于 childColumns"),
|
|
@@ -597,13 +605,26 @@ export function registerFormLane(tools) {
|
|
|
597
605
|
preflight: (args) => {
|
|
598
606
|
// Zero-wire refusal (ticket 74): fires in semanticGate BEFORE the
|
|
599
607
|
// governed pipeline — including the rollback before-capture read.
|
|
600
|
-
|
|
608
|
+
const resolved = { ...args, sheetCode: resolveSheetCode(args.schemaCode, args.sheetCode) };
|
|
609
|
+
// layout 是增量面,与整包布局/重建参数互斥:纯参数门,零 wire。
|
|
610
|
+
assertLayoutRequestConflicts(resolved);
|
|
611
|
+
refuseEmptyCallerLayout(resolved);
|
|
601
612
|
},
|
|
602
613
|
// R75-B seam: dry-run 与真写共用这一个 session 只读 lint(dry-run 直接跑它)。
|
|
603
614
|
// 控件 type 交叉校验需要 field.list(propertyType 是另一套枚举),纯参数门
|
|
604
615
|
// 拿不到;放进这里才能让 `--dry-run` 与真写同答案。executeFormDraftWrite 里
|
|
605
616
|
// 再跑同一函数,直调执行器的路径也绕不过去。
|
|
606
617
|
writeLint: async (session, args) => {
|
|
618
|
+
// layout 面:dry-run 直接跑与真写同一个 composeFormLayoutDraft(读基线 →
|
|
619
|
+
// 重排 rows/span → 过布局门),预览里的 layout 回执即真写会写下的形状。
|
|
620
|
+
if (args.layout !== undefined) {
|
|
621
|
+
const composed = await composeFormLayoutDraft(session, {
|
|
622
|
+
schemaCode: args.schemaCode,
|
|
623
|
+
sheetCode: resolveSheetCode(args.schemaCode, args.sheetCode),
|
|
624
|
+
layout: args.layout,
|
|
625
|
+
});
|
|
626
|
+
return { layout: composed.receipt, ...(composed.warnings.length > 0 ? { layoutWarnings: composed.warnings } : {}) };
|
|
627
|
+
}
|
|
607
628
|
if (args.fromReadback === true)
|
|
608
629
|
return { controlTypeCheck: "skipped-fromReadback" };
|
|
609
630
|
const lint = await lintFormControlTypes(session, {
|
|
@@ -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 逃生;op 大小写不敏感);响应行在 items[],业务字段在 items[].fields.<code>(不是 rows[],也不是 item 顶层——--jq 常用 items[].fields.sku);空模型返回空列表;列表只投影视图列:**显式选列只能收窄、不能扩列**(视图外 code 进 columnsOutsideView,扩列用 data.load);**已判定未投影的列会从 items[].fields 省略键**(items[].unprojected 点名;不是数据丢失——data.load
|
|
8
|
+
return `按简化过滤 DSL 查询业务对象(runtime/query/list);DSL 在 CLI 内翻译为平台 queryCondition(${wire.dslShape}),并按发布字段元数据为每个条件注入 propertyType(未知过滤字段将被拒绝,可用 rawCondition 逃生;op 大小写不敏感);响应行在 items[],业务字段在 items[].fields.<code>(不是 rows[],也不是 item 顶层——--jq 常用 items[].fields.sku);空模型返回空列表;列表只投影视图列:**显式选列只能收窄、不能扩列**(视图外 code 进 columnsOutsideView,扩列用 data.load);**已判定未投影的列会从 items[].fields 省略键**(items[].unprojected 点名;不是数据丢失——data.load 有值;有视图列证据时系统列如 sequenceNo 同判;全 null 时 readback 追加 projectionHint,先 listview.configure 配置视图列或用 data.load 读单条)。键缺席=字段不存在或该行已判定未投影(见 items[].unprojected);键在且值 null=真空值(未投影或真空值不再同形;nullSemantics 说明口径)。`;
|
|
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)。`;
|
|
@@ -461,10 +461,35 @@ export function projectionHintFace(items, evidence) {
|
|
|
461
461
|
* `null`(与真空值同形),顶层 `projectionHint.unprojected` 只在整列全 null 时
|
|
462
462
|
* 出现,脚本按行对账仍会把 null 当数据丢失。行级 `unprojected` 用**同一份**
|
|
463
463
|
* 视图列证据(queryColumns)逐行标注:值 null 且不在视图列 → 本行未投影。
|
|
464
|
-
*
|
|
465
|
-
*
|
|
464
|
+
*
|
|
465
|
+
* F5(w91,0.8.12 真机):**系统列同样按证据判**——视图只配 4 个业务列时
|
|
466
|
+
* `sequenceNo` 回 `null` 却不在 `unprojected`,与 `data.load`(sequenceNo=记录 id)
|
|
467
|
+
* 自相矛盾。平台证据:列表 SELECT 只取视图列(`BizObjectFacadeImpl.handleQueryColumn`
|
|
468
|
+
* 8.6.26:4155-4182 / 2.1.5:1830-1860,display 缺省 false),`completeSystemFields`
|
|
469
|
+
* 的系统列白名单**不含 sequenceNo**(8.6.26:4866-4875 / 2.1.5
|
|
470
|
+
* `QueryDisplayFieldResolver:38,78-89`);行对象仍为每个已发布属性建字段,没查出来
|
|
471
|
+
* 的值留 null(`BizObject.createBizObject` 8.6.26:151-170 / `toObjectMap`:309-316)。
|
|
472
|
+
* 所以有视图列证据时系统列与业务列同判;`*_key` 孪生列仍不算(投影证据只覆盖
|
|
473
|
+
* 主列),拿不到视图清单时只用 `projectionMiss`,绝不拿 null 猜。
|
|
474
|
+
*/
|
|
475
|
+
const isKeyTwinProjectionCode = (key) => key.endsWith("_") || key.endsWith("_key");
|
|
476
|
+
/**
|
|
477
|
+
* 平台 `completeSystemFields` 无条件补进 SELECT 的系统列(8.6.26
|
|
478
|
+
* `BizObjectFacadeImpl:4870`;2.1.5 `QueryDisplayFieldResolver.REQUIRED_SYSTEM_FIELDS:38`):
|
|
479
|
+
* 它们**不由视图列决定**,所以视图清单里没有也不代表「未投影」——此时 null 就是真值。
|
|
480
|
+
* 只有白名单外的系统列(典型 `sequenceNo`、`version`)才随视图列证据判。
|
|
466
481
|
*/
|
|
467
|
-
|
|
482
|
+
/**
|
|
483
|
+
* 即便列在视图里,平台 `runtime/query/list` 也不回值、恒为 null 的系统列。
|
|
484
|
+
* `sequenceNo` 就是典型(`completeSystemFields` 白名单不含它:8.6.26
|
|
485
|
+
* `BizObjectFacadeImpl:4870` / 2.1.5 `QueryDisplayFieldResolver.REQUIRED_SYSTEM_FIELDS:38`),
|
|
486
|
+
* 而 `data.load` 同记录有值。null 因此不代表真空值——与未投影同判(省略键)。
|
|
487
|
+
*/
|
|
488
|
+
const RUNTIME_NEVER_VALUED_WHEN_NULL = new Set(["sequenceNo"]);
|
|
489
|
+
const RUNTIME_ALWAYS_PROJECTED_FIELD_CODES = new Set([
|
|
490
|
+
"id", "name", "owner", "creater", "createdTime", "modifiedTime", "sequenceStatus",
|
|
491
|
+
"workflowInstanceId", "ownerDeptId", "ownerDeptQueryCode",
|
|
492
|
+
]);
|
|
468
493
|
export function itemUnprojectedFields(fields, projectionMiss, viewColumnCodes) {
|
|
469
494
|
const missed = projectionMiss.length > 0 ? new Set(projectionMiss) : undefined;
|
|
470
495
|
if (viewColumnCodes === undefined && missed === undefined)
|
|
@@ -472,12 +497,21 @@ export function itemUnprojectedFields(fields, projectionMiss, viewColumnCodes) {
|
|
|
472
497
|
const inView = viewColumnCodes === undefined ? undefined : new Set(viewColumnCodes);
|
|
473
498
|
return Object.entries(fields)
|
|
474
499
|
.filter(([code, value]) => {
|
|
475
|
-
if (
|
|
500
|
+
if (isKeyTwinProjectionCode(code))
|
|
476
501
|
return false;
|
|
477
502
|
if (value !== null && value !== undefined)
|
|
478
503
|
return false;
|
|
479
|
-
if (inView !== undefined)
|
|
504
|
+
if (inView !== undefined) {
|
|
505
|
+
// 视图含 sequenceNo 也不代表平台会回值(completeSystemFields 白名单不含它)。
|
|
506
|
+
if (RUNTIME_NEVER_VALUED_WHEN_NULL.has(code))
|
|
507
|
+
return true;
|
|
508
|
+
if (RUNTIME_ALWAYS_PROJECTED_FIELD_CODES.has(code))
|
|
509
|
+
return false;
|
|
480
510
|
return !inView.has(code);
|
|
511
|
+
}
|
|
512
|
+
// 无视图证据:系统列保持旧口径(不猜),只认 projectionMiss 的业务列。
|
|
513
|
+
if (RUNTIME_SYSTEM_FIELD_CODES.has(code))
|
|
514
|
+
return false;
|
|
481
515
|
return missed.has(code);
|
|
482
516
|
})
|
|
483
517
|
.map(([code]) => code);
|
|
@@ -512,7 +546,7 @@ export function omitUnprojectedFields(items) {
|
|
|
512
546
|
});
|
|
513
547
|
}
|
|
514
548
|
/** 人类/脚本读 null 的唯一权威口径;与行级 `unprojected` 同时出现才完整。 */
|
|
515
|
-
export const DATA_LIST_NULL_SEMANTICS = "items[].fields.<code> 键缺席=字段不存在或该行已判定未投影(items[].unprojected
|
|
549
|
+
export const DATA_LIST_NULL_SEMANTICS = "items[].fields.<code> 键缺席=字段不存在或该行已判定未投影(items[].unprojected 已省略该键;有视图列证据时系统列如 sequenceNo 与业务列同判);键在且值为 null 才是真空值;判真值用 data.load。";
|
|
516
550
|
/**
|
|
517
551
|
* B2(issue 2026-11-25,真机 `milestone_ledger`):`data.list` 对关联字段静默回
|
|
518
552
|
* null,而同一条记录 `data.load` 有真实值(`{id, displayCode, <显示字段>}`)。
|
|
@@ -1293,6 +1327,42 @@ async function loadPublishedFieldMeta(session, schemaCode) {
|
|
|
1293
1327
|
return null;
|
|
1294
1328
|
}
|
|
1295
1329
|
}
|
|
1330
|
+
/**
|
|
1331
|
+
* F6(w91,0.8.12 真机):`data.save` 传 2 行(风机皮带、润滑油),读回顺序相反、
|
|
1332
|
+
* `sortKey:null`。平台证据:子表读回**固定按 sortKey ASC**(`BizObjectConverterImpl`
|
|
1333
|
+
* 8.6.26:1235,1247 / 2.1.5 `BizObjectItem.toDataMap`:61-67;`SubBizObjectLoader`:137
|
|
1334
|
+
* 同序),而表单运行时保存路径不补 sortKey(`BizObjectInsertModel`/`BizObjectUpdateItem`
|
|
1335
|
+
* 无 sortKey 写入;补值只存在于导入合并 `IntegrationMergerUtils:34-37`、规则
|
|
1336
|
+
* `CreateServiceExecutor:166`/`BizObjectUtil:131`、流程结束 `EndActivityRuntime:277-278`)。
|
|
1337
|
+
* 所以新建保存/提交时,缺 sortKey 的子行按数组下标补 1..n;调用方显式值原样保留。
|
|
1338
|
+
* 更新既有记录不补(既有行可能已有 sortKey,猜起点会撞号)。
|
|
1339
|
+
*/
|
|
1340
|
+
function stampChildSortKeys(formData, childCodes) {
|
|
1341
|
+
let changed = false;
|
|
1342
|
+
const next = { ...formData };
|
|
1343
|
+
for (const code of childCodes) {
|
|
1344
|
+
const rows = formData[code];
|
|
1345
|
+
if (!Array.isArray(rows))
|
|
1346
|
+
continue;
|
|
1347
|
+
let mutated = false;
|
|
1348
|
+
const stamped = rows.map((entry, index) => {
|
|
1349
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry))
|
|
1350
|
+
return entry;
|
|
1351
|
+
const row = entry;
|
|
1352
|
+
if (row.sortKey !== null && row.sortKey !== undefined && String(row.sortKey).trim() !== "")
|
|
1353
|
+
return row;
|
|
1354
|
+
if (typeof row.rowStatus === "string" && row.rowStatus.trim().toLowerCase() === "deleted")
|
|
1355
|
+
return row;
|
|
1356
|
+
mutated = true;
|
|
1357
|
+
return { ...row, sortKey: index + 1 };
|
|
1358
|
+
});
|
|
1359
|
+
if (mutated) {
|
|
1360
|
+
next[code] = stamped;
|
|
1361
|
+
changed = true;
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
return changed ? next : formData;
|
|
1365
|
+
}
|
|
1296
1366
|
async function stampChildRowStatuses(session, schemaCode, formData, preloaded) {
|
|
1297
1367
|
const loaded = preloaded !== undefined ? preloaded : await loadPublishedFieldMeta(session, schemaCode);
|
|
1298
1368
|
if (!loaded || loaded.childCodes.length === 0)
|
|
@@ -1321,13 +1391,22 @@ async function stampChildRowStatuses(session, schemaCode, formData, preloaded) {
|
|
|
1321
1391
|
* The one write-path preflight shared by data.save / data.update / data.submit:
|
|
1322
1392
|
* load the published field metadata ONCE, refuse the proven bad value shapes
|
|
1323
1393
|
* (date/relation/child-row-id) BEFORE any mutation, then stamp rowStatus.
|
|
1394
|
+
*
|
|
1395
|
+
* `skipChildRowIdGate`:审批提交(workItemId/workflowInstanceId)先由
|
|
1396
|
+
* `submit-approval-child-rows` 统一拒——无 id 子行的 `child-rows-missing-id`
|
|
1397
|
+
* 教学会让调用方补 `rowStatus:"Added"`,然后再撞审批门(真机两道门互相打架)。
|
|
1398
|
+
* `assignChildSortKeys`:仅新建记录(save/submit)补 1..n,见 stampChildSortKeys。
|
|
1324
1399
|
*/
|
|
1325
1400
|
async function prepareRuntimeFormData(session, schemaCode, formData, opts) {
|
|
1326
1401
|
const loaded = await loadPublishedFieldMeta(session, schemaCode);
|
|
1327
1402
|
if (loaded)
|
|
1328
|
-
assertRuntimeFieldValueShapes(loaded.meta, formData, loaded.childCodes, {
|
|
1403
|
+
assertRuntimeFieldValueShapes(loaded.meta, formData, loaded.childCodes, {
|
|
1404
|
+
schemaCode,
|
|
1405
|
+
isUpdate: opts.isUpdate && opts.skipChildRowIdGate !== true,
|
|
1406
|
+
});
|
|
1329
1407
|
const stamped = await stampChildRowStatuses(session, schemaCode, formData, loaded);
|
|
1330
|
-
|
|
1408
|
+
const withSortKeys = opts.assignChildSortKeys === true ? stampChildSortKeys(stamped.formData, stamped.childCodes) : stamped.formData;
|
|
1409
|
+
return { formData: withSortKeys, childCodes: stamped.childCodes, serialNumberCodes: loaded ? [...loaded.meta].filter(([, field]) => field.serialNumber).map(([code]) => code) : [], fieldCodes: loaded ? [...loaded.meta.keys()] : undefined, schemaLoaded: loaded !== null };
|
|
1331
1410
|
}
|
|
1332
1411
|
/**
|
|
1333
1412
|
* Translate a platform DATE options.format into a validator regex. The format
|
|
@@ -3247,7 +3326,7 @@ export function registerRuntimeDataLane(tools) {
|
|
|
3247
3326
|
// 券商 issue 1.3(cpdocs 2026-10-27):更新既有记录的主键契约——平台
|
|
3248
3327
|
// BizObjectModel.getId() 只读 bizObject.data.id;顶层 bizObject.bizObjectId
|
|
3249
3328
|
// 被保存逻辑忽略,errcode:0 但 objectId 是新 id(静默新建孤儿行)。
|
|
3250
|
-
'business-object data keyed by field code(关联/人员形状同默认描述)。引擎拥有键(sequenceStatus 等)会被剥离——读改写的 sequenceStatus
|
|
3329
|
+
'business-object data keyed by field code(关联/人员形状同默认描述)。引擎拥有键(sequenceStatus 等)会被剥离——读改写的 sequenceStatus 不会把行钉回旧状态。新建时子表行缺 sortKey 会按数组下标补 1..n(平台读回按 sortKey ASC;更新既有记录请显式带 sortKey)。mappings 仅门户回填;字典-backed 不校验取值(不存在/已停用码也会落库,要拦请配数据规则)。既有记录更新:主键必须放 formData.id(顶层 bizObject.bizObjectId 被平台忽略会静默新建孤儿行——直调 REST 同理,cpdocs issue §1.3);id 无对应行会被拒(save-update-target-absent),新建请省略 id。'),
|
|
3251
3330
|
workflowCode: z.string().optional().describe("portal draft-save shape: create the row AND a DRAFT workflow instance + start workItem (finishStart=FALSE); submit later via data.submit with the returned workItemId. formData must NOT carry an id — in-place workflow start has no REST surface in 8.6.26。发起语义阶梯:本参数=发起停在第一节点(行/实例双 DRAFT,首办待办=发起人);到第一个审批节点用 data.submit 三件套;无流程模型用 submit:true 一调完成态;代他人发起(可选发起人)唯一路径=业务规则 CREATE+startWorkflow(完成态发起,不留草稿待办)"),
|
|
3252
3331
|
submit: z.boolean().optional().describe("true=保存后立即直提(无流程模型 DRAFT→COMPLETED,触发 Create 规则);与 workflowCode 互斥。**按业务约定正式数据优先直接 data.submit(无 id=新建并提交一调完成)——本参数是便捷别名,save 的定位是草稿/暂存**"),
|
|
3253
3332
|
allowStaffOnSubmit: z.boolean().optional().describe("submit:true 时显式允许携带人员字段(issue#10:人员字段提交面两种形状都可能 50000,可靠链路是 save 落库后提交时省略;个别平台构建接受提交面携带,自担风险)"),
|
|
@@ -3272,7 +3351,7 @@ export function registerRuntimeDataLane(tools) {
|
|
|
3272
3351
|
// 写后孤儿判据(返回 objectId ≠ 传入 id = 平台没按更新处理)使用。
|
|
3273
3352
|
const saveSuppliedId = typeof rawSaveData.id === "string" ? rawSaveData.id.trim() : "";
|
|
3274
3353
|
const saveIsUpdate = saveSuppliedId.length > 0;
|
|
3275
|
-
const prepared = await prepareRuntimeFormData(session, args.schemaCode, rawSaveData, { isUpdate: saveIsUpdate });
|
|
3354
|
+
const prepared = await prepareRuntimeFormData(session, args.schemaCode, rawSaveData, { isUpdate: saveIsUpdate, assignChildSortKeys: !saveIsUpdate });
|
|
3276
3355
|
const formData = prepared.formData;
|
|
3277
3356
|
const writeDiagnostics = { ...ignoredNullDiagnostic(formData), ...unknownFieldDiagnostic(formData, prepared.fieldCodes, prepared.childCodes, prepared.schemaLoaded) };
|
|
3278
3357
|
// issue#9 C1 + issue#10 勘误:提交面(submit:true / data.submit)的人员字段
|
|
@@ -3926,7 +4005,13 @@ export function registerRuntimeDataLane(tools) {
|
|
|
3926
4005
|
nextCommand: `omc call data.submit --args '{"schemaCode":"<schemaCode>","bizObjectId":"<data.load 的 bizObjectId>"}'`,
|
|
3927
4006
|
});
|
|
3928
4007
|
}
|
|
3929
|
-
const stampedSubmit = await prepareRuntimeFormData(session, args.schemaCode, (args.formData ?? {}), {
|
|
4008
|
+
const stampedSubmit = await prepareRuntimeFormData(session, args.schemaCode, (args.formData ?? {}), {
|
|
4009
|
+
isUpdate: targetObjectId !== null,
|
|
4010
|
+
// F1/F2:审批提交先判 submit-approval-child-rows;不要再先教「补 rowStatus:Added」。
|
|
4011
|
+
skipChildRowIdGate: hasWorkItem || hasInstance,
|
|
4012
|
+
// F6:只有新建(无 bizObjectId)才按数组下标补 sortKey;审批/既有记录不猜。
|
|
4013
|
+
assignChildSortKeys: targetObjectId === null,
|
|
4014
|
+
});
|
|
3930
4015
|
const formData = stampedSubmit.formData;
|
|
3931
4016
|
// r5-asset 2026-10-20: the platform APPENDS child rows carried in an
|
|
3932
4017
|
// approval submit's formData (no upsert by row id, no error). Live: an
|
package/dist/model-purge.js
CHANGED
|
@@ -206,18 +206,28 @@ export async function planPurge(options, injected) {
|
|
|
206
206
|
deletionSteps: refusal.deletionSteps,
|
|
207
207
|
deletionOrder: purgeDeletionOrder(refusal.deletionSteps),
|
|
208
208
|
nextCommand,
|
|
209
|
-
|
|
209
|
+
// F4(0.8.12,探针 G):dry-run 是「看完整计划」的面,不是执行面。
|
|
210
|
+
// 入站引用(含自建子表关联列)是删模型必然要拆的内部列,dry-run 直接
|
|
211
|
+
// 预置 unbindSteps 并说明 apply 要加的 flag,而不是逼调用方先加破坏性
|
|
212
|
+
// 开关才能看到计划。--apply 未带 flag 的行为不变(model.delete 零写入
|
|
213
|
+
// 拒绝,引导见 dry-run 的 note)。
|
|
214
|
+
...(unbindEnabled
|
|
215
|
+
? { unbindReferences: true, unbindSteps: purgeDeletionOrder(unbindSteps) }
|
|
216
|
+
: options.apply
|
|
217
|
+
? {}
|
|
218
|
+
: { unbindSteps: purgeDeletionOrder(unbindSteps), wouldRequireFlags: ["--unbind-references"] }),
|
|
210
219
|
referenceNotice: `${options.schemaCode} 有入站引用(${refusal.referencingModels.map((model) => model.schemaCode).join("、")};` +
|
|
211
220
|
`子表列经 parentCode 解析回本模型时属于自引用)。` +
|
|
212
221
|
(unbindEnabled
|
|
213
222
|
? `已开启 --unbind-references:本命令会先按 deletionSteps 执行拆引用(${unbindSteps.map((step) => step.tool).join(" → ")};` +
|
|
214
223
|
`**破坏性:会删除引用列/子表关联列,列数据不可恢复**),全部成功后再让 model.delete 级联;任一步失败即停,不会删模型。`
|
|
215
|
-
: `--apply
|
|
216
|
-
|
|
224
|
+
: `--apply 未带 --unbind-references 时 model.delete 会零写入拒绝;unbindSteps 是本命令会执行的拆引用步骤(` +
|
|
225
|
+
`${unbindSteps.map((step) => step.tool).join(" → ")};**破坏性:会删除引用列/子表关联列,列数据不可恢复**),` +
|
|
226
|
+
`nextCommand 就是带上 --unbind-references 的同一条命令;也可以自己按 deletionSteps 逐条执行。`),
|
|
217
227
|
};
|
|
218
228
|
steps.push(unbindEnabled
|
|
219
229
|
? `🔧 拆引用(--unbind-references):${unbindSteps.map((step) => step.command).join(" → ")} → 再删模型`
|
|
220
|
-
:
|
|
230
|
+
: `🔗 入站引用(apply 前先拆;--unbind-references 一条命令,或按 deletionSteps 首步 ${refusal.deletionSteps[0]?.command ?? ""})→ 再删模型`);
|
|
221
231
|
}
|
|
222
232
|
}
|
|
223
233
|
catch {
|
|
@@ -314,7 +324,7 @@ export async function deleteInstancesForPurge(session, workflowCode, instanceIds
|
|
|
314
324
|
}
|
|
315
325
|
return { failed, steps, unremovableInstances };
|
|
316
326
|
}
|
|
317
|
-
export async function cmdModelPurge(args) {
|
|
327
|
+
export async function cmdModelPurge(args, injected) {
|
|
318
328
|
const request = requestId();
|
|
319
329
|
const flag = (name) => argvValue(args, name);
|
|
320
330
|
const schemaCode = flag("--code") ?? flag("--schema") ?? flag("--schema-code");
|
|
@@ -325,8 +335,8 @@ export async function cmdModelPurge(args) {
|
|
|
325
335
|
const usage = [
|
|
326
336
|
"用法:omc model-purge --code <模型code> [--purge-instances] [--unbind-references] [--env <环境>] [--apply]",
|
|
327
337
|
" 一条命令按依赖倒序清掉:列表视图 → 自建业务规则 → 流程实例 → 流程 → 模型(字段/表单/计算规则/预置规则随模型级联)。",
|
|
328
|
-
" 默认 dry-run
|
|
329
|
-
" --unbind-references 才会先按 deletionSteps 拆入站引用(field.delete 引用列 + field.publish
|
|
338
|
+
" 默认 dry-run(只列计划,不写;入站引用的 unbindSteps 已在 dry-run 预置)。--purge-instances 才删流程实例(workflow.delete 遇到实例会 402508)。",
|
|
339
|
+
" --unbind-references 才会先按 deletionSteps 拆入站引用(field.delete 引用列 + field.publish 所属模型,**破坏性:列数据不可恢复**),再删模型;不带它 --apply 不会自动拆引用。",
|
|
330
340
|
" 每步回读确认;某步失败即停并说明已完成到哪一步(幂等,可修好后重跑)。",
|
|
331
341
|
].join("\n");
|
|
332
342
|
const invalid = (message) => {
|
|
@@ -338,7 +348,7 @@ export async function cmdModelPurge(args) {
|
|
|
338
348
|
const options = { schemaCode, apply, purgeInstances, unbindReferences, ...(environment !== undefined ? { environment } : {}) };
|
|
339
349
|
let plan;
|
|
340
350
|
try {
|
|
341
|
-
plan = await planPurge(options);
|
|
351
|
+
plan = await planPurge(options, injected);
|
|
342
352
|
}
|
|
343
353
|
catch (error) {
|
|
344
354
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -348,17 +358,26 @@ export async function cmdModelPurge(args) {
|
|
|
348
358
|
if (!apply) {
|
|
349
359
|
const referenced = plan.inboundReferences !== undefined && plan.inboundReferences.length > 0;
|
|
350
360
|
const unbindEnabled = plan.unbindReferences === true;
|
|
361
|
+
const blocked = plan.blockers.length > 0;
|
|
351
362
|
writeEnvelope(envelope("ok", {
|
|
352
|
-
|
|
363
|
+
// F4(0.8.12,探针 G):入站引用是「删模型必然要拆的内部列」,是计划里的
|
|
364
|
+
// 一步,不是执行失败——dry-run 只有真 blocker(活流程实例)才 blocked。
|
|
365
|
+
// 未带 --unbind-references 时保留 blocker:"model-referenced-by"(与
|
|
366
|
+
// model.delete dry-run 同名同义),并给出预置的 unbindSteps /
|
|
367
|
+
// wouldRequireFlags,让调用方无需先加破坏性开关就能看完整计划。
|
|
368
|
+
status: blocked ? "blocked" : "dry-run",
|
|
353
369
|
...plan,
|
|
354
|
-
...(
|
|
370
|
+
...(referenced && !unbindEnabled ? { blocker: "model-referenced-by" } : {}),
|
|
371
|
+
...(blocked
|
|
355
372
|
? {}
|
|
356
373
|
: {
|
|
357
374
|
note: `dry-run 只列计划、不写。--apply 按上面的顺序执行;每步回读确认。` +
|
|
358
375
|
(referenced
|
|
359
376
|
? unbindEnabled
|
|
360
377
|
? `已开启 --unbind-references:--apply 会先执行 unbindSteps(${(plan.unbindSteps ?? []).join(" → ")};**破坏性:会删除引用列/子表关联列,列数据不可恢复**),再把 model.delete 交给主流程级联。`
|
|
361
|
-
: `入站引用已预扫(与 model.delete 同一份 gate
|
|
378
|
+
: `入站引用已预扫(与 model.delete 同一份 gate):--apply 未带 --unbind-references 时 model.delete 会零写入拒绝。` +
|
|
379
|
+
`unbindSteps 是本命令会执行的拆引用步骤(${(plan.unbindSteps ?? []).join(" → ")};**破坏性:会删除引用列/子表关联列,列数据不可恢复**);` +
|
|
380
|
+
`nextCommand 是同一条命令加上 ${(plan.wouldRequireFlags ?? ["--unbind-references"]).join(" ")} --apply,也可以自己按 deletionSteps 逐条拆。`
|
|
362
381
|
: ""),
|
|
363
382
|
}),
|
|
364
383
|
}, request));
|
|
@@ -374,7 +393,7 @@ export async function cmdModelPurge(args) {
|
|
|
374
393
|
}));
|
|
375
394
|
return CLI_EXIT_CODES.policyRefused;
|
|
376
395
|
}
|
|
377
|
-
const session = await sessionFor(environment);
|
|
396
|
+
const session = injected ?? (await sessionFor(environment));
|
|
378
397
|
const call = async (tool, toolArgs) => {
|
|
379
398
|
const outcome = await runToolCall(tool, { args: toolArgs, requestId: request, ...(environment !== undefined ? { environment } : {}), print: () => undefined });
|
|
380
399
|
return { ok: outcome.exitCode === 0, result: outcome.result };
|
package/dist/path-projection.js
CHANGED
|
@@ -533,6 +533,123 @@ export function projectionRetryCommand(context, path) {
|
|
|
533
533
|
`--jq ${shellQuote(path)}`,
|
|
534
534
|
].join(" ");
|
|
535
535
|
}
|
|
536
|
+
/**
|
|
537
|
+
* 0.8.12 F7(探针 G 真机 2.1.5):`form.get` 的 `full:true` 独占键。紧凑面只回
|
|
538
|
+
* 控件码/计数/按钮计数,六份布局 JSON、`options`、按钮定义正文只在 full 面
|
|
539
|
+
* (见 `lanes/form.ts` 的 full 分支)。`--jq publishedAttributesJson` 在紧凑面
|
|
540
|
+
* pathMiss,而 C6(0.8.4)的紧凑回执默认不带 available/nextCommand——读起来就是
|
|
541
|
+
* 「这个字段不存在」。已知键直接指路 `full:true`,不要让调用方再猜一轮。
|
|
542
|
+
*
|
|
543
|
+
* `draftRows`/`publishedRows` 是行分组:紧凑面**能解析 viewJson 时**也给
|
|
544
|
+
* (r28e F4),解析不出时只剩 full 面的小布局摘要——所以它们在这里,但
|
|
545
|
+
* nextCommand 只在整路径就是该键时给(带后缀的话 full 面也解析不了字符串)。
|
|
546
|
+
*/
|
|
547
|
+
export const FORM_FULL_ONLY_KEYS = Object.freeze([
|
|
548
|
+
"draftViewJson",
|
|
549
|
+
"draftAttributesJson",
|
|
550
|
+
"draftHtmlJson",
|
|
551
|
+
"draftActionsJson",
|
|
552
|
+
"publishedViewJson",
|
|
553
|
+
"publishedAttributesJson",
|
|
554
|
+
"publishedHtmlJson",
|
|
555
|
+
"publishedActionsJson",
|
|
556
|
+
"options",
|
|
557
|
+
"customButtonJson",
|
|
558
|
+
"htmlRenderCompat",
|
|
559
|
+
"draftRows",
|
|
560
|
+
"publishedRows",
|
|
561
|
+
]);
|
|
562
|
+
/**
|
|
563
|
+
* 把 `{...原参数, full:true}` 重建成一条可复制命令。参数 >500B 或不是合法对象
|
|
564
|
+
* 就放弃(宁可不给,不截断造假)——与 `projectionRetryCommand` 同一纪律。
|
|
565
|
+
*/
|
|
566
|
+
function fullFaceRetryCommand(context, path) {
|
|
567
|
+
if (context === undefined || context.tool === undefined || context.tool.length === 0 || context.argsJson === undefined)
|
|
568
|
+
return undefined;
|
|
569
|
+
let parsed;
|
|
570
|
+
try {
|
|
571
|
+
parsed = JSON.parse(context.argsJson);
|
|
572
|
+
}
|
|
573
|
+
catch {
|
|
574
|
+
return undefined;
|
|
575
|
+
}
|
|
576
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
|
|
577
|
+
return undefined;
|
|
578
|
+
const args = parsed;
|
|
579
|
+
// 中间态:已带 full:true 就不再拼第二遍(真正的外置指引在 fullFaceGuidance)。
|
|
580
|
+
if (args.full === true)
|
|
581
|
+
return undefined;
|
|
582
|
+
const json = JSON.stringify({ ...args, full: true });
|
|
583
|
+
if (Buffer.byteLength(json, "utf8") > RETRY_ARGS_MAX_BYTES)
|
|
584
|
+
return undefined;
|
|
585
|
+
return [
|
|
586
|
+
`omc call ${context.tool}`,
|
|
587
|
+
...(context.environment !== undefined && context.environment.length > 0 ? [`--env ${context.environment}`] : []),
|
|
588
|
+
`--args ${shellQuote(json)}`,
|
|
589
|
+
`--jq ${shellQuote(path)}`,
|
|
590
|
+
].join(" ");
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* F7:仅当 miss 的**顶层段**就是某个 full 面独占键时指路。带后缀(`x.y`)的 miss
|
|
594
|
+
* 落点更深,`head !== at`,这里不接管——否则给的命令重跑仍会 miss。
|
|
595
|
+
*/
|
|
596
|
+
export function fullFaceGuidance(path, at, retry) {
|
|
597
|
+
if (retry === undefined || retry.tool !== "form.get")
|
|
598
|
+
return undefined;
|
|
599
|
+
if (at === undefined || at.length === 0)
|
|
600
|
+
return undefined;
|
|
601
|
+
const head = path.replace(/^\$\.?/, "").replace(/^[.\/]+/, "").split(/[.\[]/)[0] ?? "";
|
|
602
|
+
if (head !== at || !FORM_FULL_ONLY_KEYS.includes(head))
|
|
603
|
+
return undefined;
|
|
604
|
+
// 已经是 full 面还 miss:正文 >32KB 时 full 面会外置(`<key>Omitted` + artifact),
|
|
605
|
+
// 再让调用方加 full:true 是死循环——直接指 artifact。
|
|
606
|
+
if (retry.argsJson !== undefined) {
|
|
607
|
+
try {
|
|
608
|
+
const parsed = JSON.parse(retry.argsJson);
|
|
609
|
+
if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed) && parsed.full === true) {
|
|
610
|
+
const key = head.replace(/'/g, "'\\''");
|
|
611
|
+
return {
|
|
612
|
+
key: head,
|
|
613
|
+
fullOnlyKeys: FORM_FULL_ONLY_KEYS,
|
|
614
|
+
hint: `${head} 在 full 面;本次 full:true 已外置(>32KB)——正文用 artifact get <id> --jq '${key}' 取(或看 ${head}Omitted)。`,
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
catch {
|
|
619
|
+
// 参数不是合法 JSON:退回「重跑 full:true」的行动句(不编造命令)。
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
const nextCommand = fullFaceRetryCommand(retry, path);
|
|
623
|
+
const hint = `${head} 只在 full:true 面(紧凑面只给控件码/计数)——${nextCommand !== undefined ? "按 nextCommand 重跑" : "加 \"full\":true 重跑"};fullOnlyKeys 是同组键。`;
|
|
624
|
+
return { key: head, fullOnlyKeys: FORM_FULL_ONLY_KEYS, ...(nextCommand !== undefined ? { nextCommand } : {}), hint };
|
|
625
|
+
}
|
|
626
|
+
/** F7:紧凑回执的 hint 字节纪律(与既有 pathMiss hint 同口径)。 */
|
|
627
|
+
/**
|
|
628
|
+
* F7:pathMiss 的通用教学——「这一层到底有什么」。默认面受 C6 的 300B 预算约束
|
|
629
|
+
* 不内联(完整键表进 `--explain` 的 `available`);此函数供 `--explain` 面与
|
|
630
|
+
* 需要显式教学文案的调用方复用。
|
|
631
|
+
*/
|
|
632
|
+
export function pathMissAvailableHint(at, available, availableAll) {
|
|
633
|
+
const list = availableAll ?? available;
|
|
634
|
+
if (!Array.isArray(list))
|
|
635
|
+
return undefined;
|
|
636
|
+
const keys = list.map((entry) => String(entry)).filter((entry) => entry.length > 0);
|
|
637
|
+
if (keys.length === 0)
|
|
638
|
+
return undefined;
|
|
639
|
+
const head = `${at !== undefined && at.length > 0 ? at : "该层"} 未命中;该层键:`;
|
|
640
|
+
const suffix = "(--explain 看全部;裸 --jq 列键)";
|
|
641
|
+
const budget = 200 - Buffer.byteLength(head + suffix, "utf8") - 12;
|
|
642
|
+
const shown = [];
|
|
643
|
+
for (const key of keys.slice(0, 5)) {
|
|
644
|
+
if (Buffer.byteLength([...shown, key].join("、"), "utf8") > budget)
|
|
645
|
+
break;
|
|
646
|
+
shown.push(key);
|
|
647
|
+
}
|
|
648
|
+
if (shown.length < Math.min(5, keys.length))
|
|
649
|
+
return undefined;
|
|
650
|
+
const rest = keys.length > shown.length ? ` 等 ${keys.length} 个` : "";
|
|
651
|
+
return `${head}${shown.join("、")}${rest}${suffix}`;
|
|
652
|
+
}
|
|
536
653
|
/**
|
|
537
654
|
* 多路径一次投影时的**唯一一份**顶层说明。只给位置语义 + helpRef——
|
|
538
655
|
* F1(retro 22):语法长句不内联(教程只在 help)。
|
|
@@ -823,6 +940,17 @@ export function projectResultExtract(result, paths, keysOnly, retry, explain = f
|
|
|
823
940
|
}
|
|
824
941
|
return multiPath ? pathMissEntryHint(at, available) : PATH_MISS_HINT;
|
|
825
942
|
};
|
|
943
|
+
/**
|
|
944
|
+
* F7(0.8.12)与 C6(0.8.4)的边界:默认 pathMiss 仍只留「在哪断 + 最接近的键 +
|
|
945
|
+
* 教程指针」(≤300B,无 available/hint);full 面独占键只允许带一条**能装进
|
|
946
|
+
* 300B** 的 `nextCommand`,装不下就留给 `--explain`。
|
|
947
|
+
*/
|
|
948
|
+
const compactMissExtra = (_path, _at, entry, fullFace) => {
|
|
949
|
+
if (fullFace?.nextCommand === undefined)
|
|
950
|
+
return {};
|
|
951
|
+
const candidate = { ...entry, nextCommand: fullFace.nextCommand };
|
|
952
|
+
return Buffer.byteLength(JSON.stringify(candidate), "utf8") <= 300 ? { nextCommand: fullFace.nextCommand } : {};
|
|
953
|
+
};
|
|
826
954
|
out.extract = paths.map((path) => {
|
|
827
955
|
// r28f F2:对象构造 / 函数调用不是 pathMiss——先识别,别伪装成键缺失。
|
|
828
956
|
const unsupported = detectUnsupportedJqSyntax(path);
|
|
@@ -849,26 +977,30 @@ export function projectResultExtract(result, paths, keysOnly, retry, explain = f
|
|
|
849
977
|
const didYouMean = pathMissDidYouMean(fan.at, fan.available, fan.availableAll);
|
|
850
978
|
const correction = missCorrectionFor(path, fan.at, fan.available, fan.availableAll);
|
|
851
979
|
const nextCommand = correction !== undefined ? projectionRetryCommand(retry, correction.correctPath) : undefined;
|
|
852
|
-
|
|
980
|
+
// F7(0.8.12):与单路径面同口径(full 面独占键 / 可用键 hint)。
|
|
981
|
+
const fullFace = fullFaceGuidance(path, fan.at, retry);
|
|
982
|
+
const baseMiss = {
|
|
853
983
|
path,
|
|
854
984
|
content: null,
|
|
855
985
|
pathMiss: true,
|
|
856
986
|
missedAt: fan.at,
|
|
857
987
|
...(didYouMean !== undefined ? { didYouMean } : {}),
|
|
858
988
|
helpRef: PATH_MISS_HELP_REF,
|
|
859
|
-
|
|
860
|
-
|
|
989
|
+
};
|
|
990
|
+
return {
|
|
991
|
+
...baseMiss,
|
|
861
992
|
...(explain
|
|
862
993
|
? {
|
|
994
|
+
...(fullFace !== undefined ? { fullOnlyKeys: fullFace.fullOnlyKeys } : {}),
|
|
863
995
|
available: fan.available,
|
|
864
996
|
...(fan.availableTruncated !== undefined ? { availableTruncated: fan.availableTruncated } : {}),
|
|
865
997
|
missedEntries: fan.missedEntries,
|
|
866
998
|
...(correction !== undefined ? { correctPath: correction.correctPath } : {}),
|
|
867
|
-
...(nextCommand !== undefined ? { nextCommand } : {}),
|
|
999
|
+
...(fullFace !== undefined ? {} : nextCommand !== undefined ? { nextCommand } : {}),
|
|
868
1000
|
...(readFromArtifact ? resultLayerNote(result, path, projectionSource, fan.at) ?? {} : {}),
|
|
869
|
-
hint: missHintFor(fan.at, fan.available, correction),
|
|
1001
|
+
hint: fullFace?.hint ?? missHintFor(fan.at, fan.available, correction),
|
|
870
1002
|
}
|
|
871
|
-
:
|
|
1003
|
+
: compactMissExtra(path, fan.at, baseMiss, fullFace)),
|
|
872
1004
|
};
|
|
873
1005
|
}
|
|
874
1006
|
return {
|
|
@@ -899,24 +1031,31 @@ export function projectResultExtract(result, paths, keysOnly, retry, explain = f
|
|
|
899
1031
|
const didYouMean = pathMissDidYouMean(single.at, single.available, single.availableAll);
|
|
900
1032
|
const correction = missCorrectionFor(path, single.at, single.available, single.availableAll);
|
|
901
1033
|
const nextCommand = correction !== undefined ? projectionRetryCommand(retry, correction.correctPath) : undefined;
|
|
902
|
-
|
|
1034
|
+
// F7(0.8.12):full 面独占键直接指路;否则紧凑面也要给「这层有什么」。
|
|
1035
|
+
const fullFace = fullFaceGuidance(path, single.at, retry);
|
|
1036
|
+
const baseMiss = {
|
|
903
1037
|
path,
|
|
904
1038
|
content: null,
|
|
905
1039
|
pathMiss: true,
|
|
906
1040
|
missedAt: single.at,
|
|
907
1041
|
...(didYouMean !== undefined ? { didYouMean } : {}),
|
|
908
1042
|
helpRef: PATH_MISS_HELP_REF,
|
|
909
|
-
|
|
1043
|
+
};
|
|
1044
|
+
// C6(0.8.4):整层键表/可复制路径/重跑命令/成因说明是排查载荷,只在
|
|
1045
|
+
// --explain 给;默认只允许一条装得进 300B 的 full 面重试命令(F7)。
|
|
1046
|
+
return {
|
|
1047
|
+
...baseMiss,
|
|
910
1048
|
...(explain
|
|
911
1049
|
? {
|
|
1050
|
+
...(fullFace !== undefined ? { fullOnlyKeys: fullFace.fullOnlyKeys } : {}),
|
|
912
1051
|
available: single.available,
|
|
913
1052
|
...(single.availableTruncated !== undefined ? { availableTruncated: single.availableTruncated } : {}),
|
|
914
1053
|
...(correction !== undefined ? { correctPath: correction.correctPath } : {}),
|
|
915
|
-
...(nextCommand !== undefined ? { nextCommand } : {}),
|
|
1054
|
+
...(fullFace !== undefined ? {} : nextCommand !== undefined ? { nextCommand } : {}),
|
|
916
1055
|
...(readFromArtifact ? resultLayerNote(result, path, projectionSource, single.at) ?? {} : {}),
|
|
917
|
-
hint: missHintFor(single.at, single.available, correction),
|
|
1056
|
+
hint: fullFace?.hint ?? missHintFor(single.at, single.available, correction),
|
|
918
1057
|
}
|
|
919
|
-
:
|
|
1058
|
+
: compactMissExtra(path, single.at, baseMiss, fullFace)),
|
|
920
1059
|
};
|
|
921
1060
|
}
|
|
922
1061
|
return {
|
package/dist/recipes/form.js
CHANGED
|
@@ -50,9 +50,10 @@ const formDraftTwoColumn = Object.freeze({
|
|
|
50
50
|
preconditions: [
|
|
51
51
|
"visitNo/customer/remark 三个字段已 field.publish(布局只能引用已发布字段)",
|
|
52
52
|
"两段 JSON 都是**字符串**(tool 参数是 string,不是对象)",
|
|
53
|
-
"
|
|
53
|
+
"**改既有表单**:优先用 `layout:{rows,...}`(见下,增量改行分组/span、不必回传整包 attrs);若要手写整包,先 `form.get full:true` 取 `publishedAttributesJson` 作基线(含 Title/Group/creater/createdTime/sequenceNo 系统控件),只改行分组与 span,不要把本配方的三字段最小布局直接盖上去。判据:`form.get full:true` 返回非空 publishedAttributesJson(或 published:true)→ 既有表单,受 form-publish-degrade 约束;无表单行 / publishedAttributesJson 为空或 \"{}\" → 新建表单,本配方可直接用。",
|
|
54
54
|
],
|
|
55
55
|
conditionalRequirements: [
|
|
56
|
+
"**改既有表单可用增量布局(不必回传整包 attrs)**:`form.draft {layout:{rows:[[\"visitNo\",\"customer\"],[\"remark\"]], spans:{visitNo:12,customer:12,remark:24}}}` 以已发布(无则草稿)表单为基线,只改这些控件的行分组与 span——其它控件/属性/HTML 逐键保留;未列入 rows 的控件(含 Title/Group/creater/createdTime/sequenceNo 等系统控件)保留原行,系统控件要移动须显式 `includeSystem:true`。layout 与 draftViewJson/draftAttributesJson/rebuild 互斥。列数仍由行分组决定,spans 省略时按行均分 24",
|
|
56
57
|
"**列数由行分组决定,不由 span 决定**:一行放几个 code 就是几列;span 只控制控件在行内的 24 栅格宽度,且必须与行分组自洽(两列 span:12+12,整宽 span:24)",
|
|
57
58
|
"draftAttributesJson 的每个控件的 `options` 必须是**对象**,不能是 JSON 字符串(否则运行时写 options.name_i18n 抛错、整页空白)",
|
|
58
59
|
"**控件 type 是表单控件枚举,不是字段 propertyType**:1=单行文本, 2=多行文本, 3=日期, 4=数值, 5=单选, 6=复选, 7=下拉, 8=逻辑, 80=关联单选, 81=关联多选, 201=子表 …;对应 propertyType 0/1/3/2/12/13/14/4/9/11/8。错枚举默认拒 `form-control-type-mismatch`(逃生 allowTypeMismatch:true)",
|
|
@@ -78,6 +79,14 @@ const formDraftTwoColumn = Object.freeze({
|
|
|
78
79
|
action: "按回执 mismatches 的 expectedType 改控件 type(关联单选=80、子表=201、单行文本=1…);或改既有表单时先 `form.get full:true` 取 publishedAttributesJson 作基线只改 rows/span,不要手拼控件 type。确属平台模板要求的特殊控件才传 allowTypeMismatch:true",
|
|
79
80
|
},
|
|
80
81
|
{ code: "form-field-not-published", action: "先 field.publish 再排布局" },
|
|
82
|
+
{
|
|
83
|
+
code: "layout-system-control-locked",
|
|
84
|
+
action: "layout.rows 只摆业务控件;系统控件(Title/Group/creater/createdTime/sequenceNo)默认保留原行。确要移动它们再加 includeSystem:true(同一行几个 code 仍是几列)",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
code: "form-layout-param-conflict",
|
|
88
|
+
action: "layout 与 draftViewJson/draftAttributesJson/rebuild/fieldCodes 互斥:只改行分组与 span 用 layout;整表重搭或整包回写才用 draft*Json/rebuild",
|
|
89
|
+
},
|
|
81
90
|
{
|
|
82
91
|
code: "form-publish-degrade",
|
|
83
92
|
action: "本配方只有业务字段,覆盖既有表单会丢系统控件。恢复:① `omc call form.get --args '{\"schemaCode\":\"<model>\",\"full\":true}'` 取 publishedAttributesJson;② 以它为基线只改 rows/span(保留 Title/Group/creater/createdTime/sequenceNo 与其它控件)重写草稿;③ 再 form.publish。纯新建表单(publishedAttributesJson 为空)不触发此门。不要把 allowDegrade:true 当默认解法",
|
|
@@ -11,6 +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 时工具按数组下标补 1..n(平台读回固定 sortKey ASC;更新既有记录请显式带 sortKey)",
|
|
14
15
|
"**50000 疑应用未发布**:某些环境里模型所在应用未发布时运行时写稳定 50000(工具反推拒 app-not-published;同调用在已发布应用成功);非普遍规律——另有一类环境未发布也能写(2026-09-19 实测,案卷 docs/issues/omc-cli-findings-2026-09-19.md B17)。遇 50000 先只读核对,别仅凭「应用未发布」放弃运行时验证。",
|
|
15
16
|
],
|
|
16
17
|
priorToolReferences: [
|
|
@@ -86,6 +87,8 @@ const workflowSubmit = Object.freeze({
|
|
|
86
87
|
preconditions: ["同一 recipe 的 data.save 已成功并读回 DRAFT;workflowInstanceId/workItemId/bizObjectId 均非空"],
|
|
87
88
|
conditionalRequirements: [
|
|
88
89
|
"workItemId 或 workflowInstanceId 出现时必须传 bizObjectId;身份只能复制 data.save 的 authoritative readback",
|
|
90
|
+
"**审批提交(workItemId/workflowInstanceId)只传主表字段**:formData 里不要带子表数组——平台按「追加行」再插一份(真机 2→6 行),CLI 默认拒 `submit-approval-child-rows`。子表数组只在保存/首次提交时带;确要在审批中追加子行才显式传 allowChildRowAppend:true",
|
|
91
|
+
"子表读回顺序按 sortKey ASC(平台固定排序):**新建**保存/提交时 CLI 会给缺 sortKey 的子行按数组下标补 1..n(显式值保留);更新既有记录请显式带 sortKey,否则 null 排序不保证",
|
|
89
92
|
],
|
|
90
93
|
priorToolReferences: [
|
|
91
94
|
{ tool: "data.save", args: { environment, schemaCode: model, workflowCode: "<workflow.code>", formData: { name: "recipe draft" } }, purpose: "提供三个环境生成的提交身份" },
|
|
@@ -153,7 +156,7 @@ const childRowsUpsert = Object.freeze({
|
|
|
153
156
|
refusalRecovery: [
|
|
154
157
|
{ code: "child-rows-missing-id", action: "无 id 的行补 id 或改 rowStatus:Added" },
|
|
155
158
|
],
|
|
156
|
-
notes: "data.save 新建时子行可不带 id(工具 stamp Added);本配方指 update
|
|
159
|
+
notes: "data.save 新建时子行可不带 id(工具 stamp Added,并按数组下标补缺省 sortKey 1..n);本配方指 update/既有记录——更新既有行请显式带 sortKey(平台读回按 sortKey ASC,null 顺序不保证)",
|
|
157
160
|
requiresEnvironmentDerivedIds: true,
|
|
158
161
|
});
|
|
159
162
|
const dataDeleteSweep = Object.freeze({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.13",
|
|
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.13",
|
|
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.13"
|
|
80
80
|
}
|
|
81
81
|
}
|
package/skills/omc-start-here.md
CHANGED
|
@@ -35,7 +35,7 @@ be treated as a second source. Read this, then follow the topics it names.
|
|
|
35
35
|
5. 键名按对象不同:模型 `schemaCode`、默认表单 `sheetCode`(可省略,默认 == 模型 code)、流程 `workflowCode`/`code`——报错会提示同义键;字段族名认不出会给「最接近的族」。
|
|
36
36
|
6. **写操作串行**:同一环境不要并发写(含多个 `omc call` 并行进程——环境写锁互斥,r31 实证并行 field.create 2/3 被拒);多个写合并为一条 `omc script` 逐行跑(进程内自动串行);`write-lock-held` 是瞬态:**优先在发起时就排队**——`omc call <tool> --wait 5000`(或 `omc intent apply ... --wait 5000`)让 CLI 内部有界重试,不必自己再花一轮。
|
|
37
37
|
7. **单个对象优先高阶编排工具**:模型+字段用 `configure_model`(一次含全部字段),表单用 `configure_form`,列表用 `listview.configure`(**默认视图已存在,省略 code 即配置它,不要 `listview.create`**)。原子工具留给单点修改。
|
|
38
|
-
8. 拿到 `detailArtifactId` 先 `artifact get <id> --summary` 看结构,再 `--keys/--jq` 取所需;**读面要某一列时直接 `omc call <tool> … --jq 'items[].fields.xxx'`(`[]` 映射数组,一次调用拿整列;裸 `--jq` 列键),不要再落 artifact 二次取**;`field.list`/`workflow.*` 默认面已给清单与节点摘要;`workflow.get_draft` 默认面已含 `edges`,改流程只需传 `activities`+`routes`。**注意**:`form.get
|
|
38
|
+
8. 拿到 `detailArtifactId` 先 `artifact get <id> --summary` 看结构,再 `--keys/--jq` 取所需;**读面要某一列时直接 `omc call <tool> … --jq 'items[].fields.xxx'`(`[]` 映射数组,一次调用拿整列;裸 `--jq` 列键),不要再落 artifact 二次取**;`field.list`/`workflow.*` 默认面已给清单与节点摘要;`workflow.get_draft` 默认面已含 `edges`,改流程只需传 `activities`+`routes`。**注意**:`form.get` / `workflow.get_draft` 的 `full:true` 在 2.1.5 实测**全文内联**(`form.get --full` 约 19KB,要落盘加 `--out-file <路径>`);只有原生正文超过内联上限(当前 32KB)才外置,回执带 `fullOmitted:true` + `fullArtifactHint`,正文用 `artifact get <id>` 取。看到 `omitted:true` 才是摘要:默认(非 full)面的通用降载会把超长字符串/大对象/数组折成 `{length|keys|count, sha256, omitted}`——别把 `full:true` 的全文误判成桩(用户实测陷阱)。
|
|
39
39
|
9. **Windows/PowerShell 乱码**:CLI 输出是 UTF-8,PowerShell 管道默认按 GBK(936) 解码会全屏乱码——根因在终端不在 CLI。消费端先 `chcp 65001` + `[Console]::OutputEncoding=[Text.Encoding]::UTF8` 再读 CLI 输出。
|
|
40
40
|
9. 每个 section 读一次即可;同一 topic 不要反复读。
|
|
41
41
|
10. **复杂流程先预检角色**:读 `org.role.list`/`org.user.search`,用真实可解析对象;缺独立角色就报告阻塞,不伪造。主子表条件按规则行 `schemaCode` 回所属子模型验证。
|