@stalfh233/omc-cli 0.8.10 → 0.8.11
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/goal-routes.js +59 -3
- package/dist/intent/capabilities/field.js +77 -3
- package/dist/intent/plan-apply.js +13 -1
- package/dist/lanes/field.js +85 -9
- package/dist/lanes/list-view-contract.js +2 -2
- package/dist/lanes/list-view-shapes.js +46 -0
- package/dist/lanes/list-view.js +128 -101
- package/dist/recipes/datarule.js +1 -1
- package/dist/recipes/field.js +11 -4
- package/dist/recipes/runtime-data.js +31 -1
- package/dist/write.js +7 -2
- package/package.json +3 -3
- package/skills/omc-refusals.md +3 -0
- package/skills/omc-requirement-vocabulary.md +2 -1
package/dist/goal-routes.js
CHANGED
|
@@ -552,6 +552,58 @@ function orderedCapabilities(ids, index) {
|
|
|
552
552
|
* runtime/exact patches), not a second main path.
|
|
553
553
|
*/
|
|
554
554
|
const WHOLE_PACKAGE_CAPABILITIES = ["model", "field", "form", "listview", "datarule", "businessrule", "workflow", "onlinejs"];
|
|
555
|
+
/**
|
|
556
|
+
* F5(0.8.11,探针 F):整包路线推荐 intent 时,必须同时说清**intent 能/不能
|
|
557
|
+
* 覆盖什么**。
|
|
558
|
+
*
|
|
559
|
+
* 真机现象(0.8.10):`next "整包…"` 只给 `route.primary:"intent"` + 7 步
|
|
560
|
+
* `atomicSupplement.ladder`,没有一句解释覆盖面。agent 按推荐写完 YAML、apply
|
|
561
|
+
* 之后才发现:表单只有 publish/fieldCodes(两列布局要 `form.draft`)、listview
|
|
562
|
+
* 只声明列(排序/筛选要 `listview.configure`)、workflow 只到模板+发布(提交/
|
|
563
|
+
* 审批是 runtime 操作)、子表取主表字段的映射回填与精确 patch 以 `child-map-fill`
|
|
564
|
+
* 原子配方为事实源——一半需求要回落 `omc call`,而这些本可以在第一答里说清。
|
|
565
|
+
*
|
|
566
|
+
* 覆盖面文案与 `omc intent schema` 同源(schema.ts 的 form/listview/fields/
|
|
567
|
+
* workflow 节),改 schema 时同步本块。只挂在**整包且 primary=intent** 的
|
|
568
|
+
* route 上:单面 recipe/read/composer 路线不加(那是噪音,且它们本来就不是
|
|
569
|
+
* 声明式路径)。
|
|
570
|
+
*/
|
|
571
|
+
const INTENT_COVERAGE = Object.freeze({
|
|
572
|
+
note: "intent 覆盖面(与 `omc intent schema` 同源):covered 由 validate/plan/apply 声明式生成;needsCall 是 intent 不声明(或运行语义/精确 patch 不在声明面)的部分,apply 后用 command 走原子面补齐。",
|
|
573
|
+
covered: [
|
|
574
|
+
"模型 model(含 absent 删除)",
|
|
575
|
+
"标量字段与子表标量列(CHILD_TABLE subFields)",
|
|
576
|
+
"字段发布 field.publish",
|
|
577
|
+
"表单发布 form.publish + 绑定字段 form.fieldCodes",
|
|
578
|
+
"列表视图列 listview.fieldCodes",
|
|
579
|
+
"业务规则 rules(actions 紧凑 / nodeGraph 透传)",
|
|
580
|
+
"字段级数据规则 datarules",
|
|
581
|
+
"流程模板 + 发布 + 规则绑定 workflow(template/publish/bindRules)",
|
|
582
|
+
"在线 JS onlinejs、业务服务/方法 services",
|
|
583
|
+
],
|
|
584
|
+
needsCall: [
|
|
585
|
+
{
|
|
586
|
+
id: "child-map-fill",
|
|
587
|
+
what: "子表取主表字段:WORK_SHEET 关联列 + options.mappings(intent 子列可声明 relativeCode/options;映射回填只在门户表单执行、REST 不回填,精确改映射与读回以 child-map-fill 配方为准)",
|
|
588
|
+
command: "omc describe field.create --example child-map-fill",
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
id: "form-two-column-layout",
|
|
592
|
+
what: "表单两列布局(intent 的 form 只有 publish/fieldCodes,不含行分组/控件 span)",
|
|
593
|
+
command: "omc describe form.draft --example two-column-layout",
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
id: "listview-sorts-conditions",
|
|
597
|
+
what: "列表视图业务排序/筛选条件(intent 的 listview 只声明列,排序/条件/按钮 apply 后用 listview.configure 补)",
|
|
598
|
+
command: "omc describe listview.configure --param sorts",
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
id: "workflow-runtime",
|
|
602
|
+
what: "审批运行操作:提交/审批/待办/流转(intent 的 workflow 只到模板+发布+绑规则,运行实例走 data.save/data.submit/workitem.list)",
|
|
603
|
+
command: "omc describe data.submit --example workflow-backed-data-submit",
|
|
604
|
+
},
|
|
605
|
+
],
|
|
606
|
+
});
|
|
555
607
|
const COMPOSER_ROUTES = Object.freeze([
|
|
556
608
|
{
|
|
557
609
|
id: "model-purge",
|
|
@@ -773,9 +825,13 @@ function wholePackageRoute(registry, goal, index, hitCapabilities) {
|
|
|
773
825
|
ladder: atomicLadder,
|
|
774
826
|
}),
|
|
775
827
|
faceCount: faces.length,
|
|
828
|
+
// F5(0.8.11):主推 intent 时先交代「能/不能覆盖什么」,别让 agent 写完
|
|
829
|
+
// YAML 才发现半边需求要回落 omc call。atomic 主路径(intent.level=none)
|
|
830
|
+
// 不加——它没有推荐 intent,说明覆盖面只会误导。
|
|
831
|
+
...(intentCovered ? { intentCoverage: INTENT_COVERAGE } : {}),
|
|
776
832
|
atomicSupplement: {
|
|
777
833
|
note: intentCovered
|
|
778
|
-
? "intent 已覆盖下列能力的创建;原子工具只用于 intent 未覆盖面(删除/生命周期/运行数据/精确 patch
|
|
834
|
+
? "intent 已覆盖下列能力的创建;原子工具只用于 intent 未覆盖面(删除/生命周期/运行数据/精确 patch)——逐项见 intentCoverage.needsCall"
|
|
779
835
|
: "intent 仅覆盖下列能力中的部分面;未覆盖能力必须走原子工具",
|
|
780
836
|
capabilities: ordered,
|
|
781
837
|
// round16b: 这是**指针**(capability + why),不是第二套执行阶梯——
|
|
@@ -1517,7 +1573,7 @@ function goalRouteInner(registry, goal) {
|
|
|
1517
1573
|
match: { kind: readish ? "read-ladder" : "ladder", ref: `${routeOrder.join("→")}${routeOrder.includes("businessrule") && /累加|联动|审计|规则触发|自动累加|自动回写/.test(goal) ? "(规则面不在本阶梯)" : ""}`, capabilities: routeOrder },
|
|
1518
1574
|
route: {
|
|
1519
1575
|
...(whole ? (intentCoveredOf(ordered)
|
|
1520
|
-
? { primary: "intent", atomicSupplement }
|
|
1576
|
+
? { primary: "intent", intentCoverage: INTENT_COVERAGE, atomicSupplement }
|
|
1521
1577
|
: { primary: "atomic", note: "命中能力中有 intent.level=none 的面,声明式 intent 不覆盖全部需求,走原子工具阶梯", ladder }) : { ladder }),
|
|
1522
1578
|
// r28e F2(真机复现 2026-11-05):`next "建表单布局、在线JS、表单按钮"`
|
|
1523
1579
|
// 命中的是 model→form→listview→businessrule→onlinejs 的整包 ladder,
|
|
@@ -1615,7 +1671,7 @@ function goalRouteInner(registry, goal) {
|
|
|
1615
1671
|
capability: capabilityId,
|
|
1616
1672
|
lane: route.lane,
|
|
1617
1673
|
...(whole ? (intentCoveredOf([capabilityId])
|
|
1618
|
-
? { primary: "intent" }
|
|
1674
|
+
? { primary: "intent", intentCoverage: INTENT_COVERAGE }
|
|
1619
1675
|
: { primary: "atomic", note: "该能力无声明式面(intent.level=none),走原子工具" }) : {}),
|
|
1620
1676
|
...(readish ? { readTools: readToolsInLane(registry, route.lane) } : { tools: route.tools }),
|
|
1621
1677
|
// r66 ②(c-F4):有依赖顺序的能力(report)显式给 order,修掉 tools 键序
|
|
@@ -45,6 +45,50 @@ function relationCodeOf(field) {
|
|
|
45
45
|
const raw = field.options?.relativeCode ?? field.options?.schemaCode;
|
|
46
46
|
return typeof raw === "string" && raw.trim() ? raw.trim() : undefined;
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* 0.8.11 P0(探针 F):同一意图里既新建模型 A、又在模型 B 的关联字段(或子表关联列)
|
|
50
|
+
* 指向 A 时,plan 曾通过而 apply 在写前门被 `relation-target-not-found` 全量拒绝——
|
|
51
|
+
* 门的候选集只来自**基线**模型清单,不含本 plan 声明并即将创建的模型。
|
|
52
|
+
*
|
|
53
|
+
* `relationTargetsFromPlan` 列出「本包会提供的关联目标」:意图声明为存在、基线里还
|
|
54
|
+
* 不存在(本次 apply 会先 model.create)。plan 回执用它让调用方在 plan 阶段就能确认
|
|
55
|
+
* 同包引用可解析;apply 的写前门另按 changes 里**实际先于该字段**的 `model.create`
|
|
56
|
+
* 判,顺序被改坏时不会误放行。
|
|
57
|
+
*/
|
|
58
|
+
export function relationTargetsFromPlan(intent, baseline) {
|
|
59
|
+
const present = new Set(baseline.models.filter((model) => model.present).map((model) => model.code));
|
|
60
|
+
const declared = new Set(intent.models.filter((model) => model.absent !== true).map((model) => model.code));
|
|
61
|
+
const targets = new Set();
|
|
62
|
+
const collect = (target) => {
|
|
63
|
+
if (target && declared.has(target) && !present.has(target))
|
|
64
|
+
targets.add(target);
|
|
65
|
+
};
|
|
66
|
+
for (const model of intent.models) {
|
|
67
|
+
if (model.absent === true)
|
|
68
|
+
continue;
|
|
69
|
+
for (const field of model.fields) {
|
|
70
|
+
if (field.absent === true)
|
|
71
|
+
continue;
|
|
72
|
+
collect(relationCodeOf(field));
|
|
73
|
+
for (const sub of field.subFields ?? [])
|
|
74
|
+
collect(sub.relativeCode?.trim());
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return [...targets].sort();
|
|
78
|
+
}
|
|
79
|
+
/** The relation target a `field.create` payload names (top-level relativeCode wins, then options). */
|
|
80
|
+
function relationTargetOfPayload(args) {
|
|
81
|
+
const relative = typeof args.relativeCode === "string" ? args.relativeCode.trim() : "";
|
|
82
|
+
if (relative)
|
|
83
|
+
return relative;
|
|
84
|
+
const options = args.options;
|
|
85
|
+
if (options !== null && typeof options === "object" && !Array.isArray(options)) {
|
|
86
|
+
const schemaCode = options.schemaCode;
|
|
87
|
+
if (typeof schemaCode === "string")
|
|
88
|
+
return schemaCode.trim();
|
|
89
|
+
}
|
|
90
|
+
return "";
|
|
91
|
+
}
|
|
48
92
|
const familyOf = (wireType) => Object.entries(FIELD_PROPERTY_TYPES).find(([, value]) => value === wireType)?.[0];
|
|
49
93
|
/** Explicit option keys the intent declares (relations lift `relativeCode` to the row). */
|
|
50
94
|
function declaredOptionKeys(field) {
|
|
@@ -236,17 +280,33 @@ export async function lintIntentFieldCreateChanges(session, intent, changes) {
|
|
|
236
280
|
const overlays = intentOwnFieldOverlays(intent);
|
|
237
281
|
if (overlays.size === 0)
|
|
238
282
|
return undefined;
|
|
239
|
-
const relevant = changes
|
|
283
|
+
const relevant = changes
|
|
284
|
+
.map((change, index) => ({ change, index }))
|
|
285
|
+
.filter(({ change }) => change.tool === "field.create" && overlays.has(String(change.args.schemaCode ?? "")));
|
|
240
286
|
if (relevant.length === 0)
|
|
241
287
|
return undefined;
|
|
288
|
+
// 0.8.11 P0(探针 F):候选集必须含**本 plan 里在该字段之前 model.create 的模型**。
|
|
289
|
+
// 能力分级排序把 model 全部排在 field 之前,所以同包目标在写入时确实已存在;
|
|
290
|
+
// 只认「先于该字段」的创建(不按意图声明整包放行),顺序若被改坏仍会拒绝。
|
|
291
|
+
const createIndex = new Map();
|
|
292
|
+
changes.forEach((change, index) => {
|
|
293
|
+
if (change.tool !== "model.create")
|
|
294
|
+
return;
|
|
295
|
+
const code = String(change.args.code ?? "").trim();
|
|
296
|
+
if (code && !createIndex.has(code))
|
|
297
|
+
createIndex.set(code, index);
|
|
298
|
+
});
|
|
299
|
+
const declaredPresent = new Set(intent.models.filter((model) => model.absent !== true).map((model) => model.code));
|
|
242
300
|
// One model-list read for the whole plan (field.create would read it per field).
|
|
243
301
|
const relationCandidates = await modelSchemaCodes(session);
|
|
244
302
|
const targetVersion = session.detectedVersion();
|
|
245
|
-
for (const change of relevant) {
|
|
303
|
+
for (const { change, index } of relevant) {
|
|
246
304
|
const schemaCode = String(change.args.schemaCode ?? "");
|
|
305
|
+
const createdBefore = [...createIndex.entries()].filter(([, at]) => at < index).map(([code]) => code);
|
|
306
|
+
const candidates = createdBefore.length > 0 ? [...new Set([...relationCandidates, ...createdBefore])] : relationCandidates;
|
|
247
307
|
try {
|
|
248
308
|
await lintFieldCreateWrite(session, gateInputOf(schemaCode, change.args, targetVersion), {
|
|
249
|
-
relationCandidates,
|
|
309
|
+
relationCandidates: candidates,
|
|
250
310
|
pendingOwnFields: overlays.get(schemaCode),
|
|
251
311
|
});
|
|
252
312
|
}
|
|
@@ -254,14 +314,28 @@ export async function lintIntentFieldCreateChanges(session, intent, changes) {
|
|
|
254
314
|
if (!(error instanceof ToolRefusalError))
|
|
255
315
|
throw error;
|
|
256
316
|
const { status: _status, ...detail } = error.payload;
|
|
317
|
+
const target = relationTargetOfPayload(change.args);
|
|
318
|
+
const declaredButCreatedLater = target.length > 0
|
|
319
|
+
&& declaredPresent.has(target)
|
|
320
|
+
&& !createdBefore.includes(target)
|
|
321
|
+
&& !relationCandidates.includes(target);
|
|
257
322
|
return {
|
|
258
323
|
status: "refused",
|
|
259
324
|
...detail,
|
|
325
|
+
...(createdBefore.length > 0 ? { relationTargetsFromPlan: createdBefore } : {}),
|
|
260
326
|
intentField: {
|
|
261
327
|
schemaCode,
|
|
262
328
|
code: String(change.args.code ?? ""),
|
|
263
329
|
...(change.resource !== undefined ? { resource: change.resource } : {}),
|
|
264
330
|
},
|
|
331
|
+
...(declaredButCreatedLater
|
|
332
|
+
? {
|
|
333
|
+
relationTargetOrdering: {
|
|
334
|
+
target,
|
|
335
|
+
message: `关联目标 ${target} 是本意图声明的模型,但 plan 里没有在该字段之前创建它——重新 intent plan(模型创建由能力排序排在全部字段创建之前),不要手工调整 plan 顺序`,
|
|
336
|
+
},
|
|
337
|
+
}
|
|
338
|
+
: {}),
|
|
265
339
|
message: `${String(detail.message ?? "字段写前语义门拒绝")};intent apply 在任何写 wire 之前按整包字段面判定,本次零写入——修正意图后重新 intent plan`,
|
|
266
340
|
nextAction: "fix the declared fields/mappings in the intent, then re-run intent plan + apply",
|
|
267
341
|
};
|
|
@@ -21,7 +21,7 @@ import { jsonBytes, sha256, writeArtifact } from "../support.js";
|
|
|
21
21
|
import { INTENT_COMPILER_VERSION, intentConfigRoot, readIntentFile } from "./cli.js";
|
|
22
22
|
import { validateRuleNodeGraph, PLATFORM_TRIGGER_RULE_CODES, walkConditionLeaves } from "../lanes/rule-graph.js";
|
|
23
23
|
import { expectedRuleGraph } from "./capabilities/businessrule.js";
|
|
24
|
-
import { lintIntentFieldCreateChanges } from "./capabilities/field.js";
|
|
24
|
+
import { lintIntentFieldCreateChanges, relationTargetsFromPlan } from "./capabilities/field.js";
|
|
25
25
|
import { readBaseline, baselineFingerprintOf } from "./baseline.js";
|
|
26
26
|
import { compileIntent } from "./compiler.js";
|
|
27
27
|
import { buildPlan, verifyPlan } from "./plan-file.js";
|
|
@@ -205,6 +205,15 @@ export async function planIntent(intent, environment, planOut) {
|
|
|
205
205
|
const session = await context.sessions.session(environment);
|
|
206
206
|
const baseline = await readBaseline(session, intent);
|
|
207
207
|
const compiled = compileIntent(intent, baseline);
|
|
208
|
+
// 0.8.11 P0(探针 F):plan 回执点名「本包提供的关联目标」——同一次 apply 会
|
|
209
|
+
// 先 model.create 它们,所以同包 relation 引用在 plan 阶段即可确认可解析。
|
|
210
|
+
const relationTargets = relationTargetsFromPlan(intent, baseline);
|
|
211
|
+
const relationTargetsReceipt = relationTargets.length > 0
|
|
212
|
+
? {
|
|
213
|
+
relationTargetsFromPlan: relationTargets,
|
|
214
|
+
relationTargetsFromPlanNote: `本包提供的关联目标:同一次 apply 会先创建这些模型,指向它们的关联字段可解析(包外目标仍需已存在)`,
|
|
215
|
+
}
|
|
216
|
+
: {};
|
|
208
217
|
const plan = buildPlan({
|
|
209
218
|
environment: session.environmentName,
|
|
210
219
|
environmentFingerprint: session.environmentFingerprint(),
|
|
@@ -262,6 +271,7 @@ export async function planIntent(intent, environment, planOut) {
|
|
|
262
271
|
skippedCount: compiled.skipped.length,
|
|
263
272
|
riskClass: compiled.riskClass,
|
|
264
273
|
changeSummary,
|
|
274
|
+
...relationTargetsReceipt,
|
|
265
275
|
planArtifactId: artifact.artifactId,
|
|
266
276
|
planArtifactSha256: artifact.sha256,
|
|
267
277
|
...(warnings.length > 0 ? { warnings } : {}),
|
|
@@ -303,6 +313,7 @@ export async function planIntent(intent, environment, planOut) {
|
|
|
303
313
|
skippedCount: compiled.skipped.length,
|
|
304
314
|
riskClass: compiled.riskClass,
|
|
305
315
|
changeSummary,
|
|
316
|
+
...relationTargetsReceipt,
|
|
306
317
|
planArtifactId: artifact.artifactId,
|
|
307
318
|
planArtifactSha256: artifact.sha256,
|
|
308
319
|
planExternalized: true,
|
|
@@ -320,6 +331,7 @@ export async function planIntent(intent, environment, planOut) {
|
|
|
320
331
|
skippedCount: compiled.skipped.length,
|
|
321
332
|
riskClass: compiled.riskClass,
|
|
322
333
|
plan,
|
|
334
|
+
...relationTargetsReceipt,
|
|
323
335
|
planArtifactId: artifact.artifactId,
|
|
324
336
|
planArtifactSha256: artifact.sha256,
|
|
325
337
|
...(warnings.length > 0 ? { warnings } : {}),
|
package/dist/lanes/field.js
CHANGED
|
@@ -1016,13 +1016,26 @@ export function registerFieldLane(tools) {
|
|
|
1016
1016
|
const requested = [...(args.code ? [args.code] : []), ...(args.codes ?? [])];
|
|
1017
1017
|
const publishedRows = wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.schemaCode, isPublish: "true" } })).data);
|
|
1018
1018
|
const published = publishedRows.map((row) => String(row.code ?? row.propertyCode ?? "")).filter((code) => code !== "");
|
|
1019
|
+
// F3:与真写同门——父面缺失的 code 再看本模型 CHILD_TABLE 子 schema 的
|
|
1020
|
+
// 发布面(父模型级发布已覆盖子表列)。只在有缺失时读,正常路径零额外 wire。
|
|
1021
|
+
const parentMissing = requested.filter((code) => !published.includes(code));
|
|
1022
|
+
const childSchemas = [...new Set(publishedRows
|
|
1023
|
+
.filter((row) => Number(row.type ?? row.propertyType) === FIELD_PROPERTY_TYPES.CHILD_TABLE)
|
|
1024
|
+
.map((row) => String(row.code ?? row.propertyCode ?? ""))
|
|
1025
|
+
.filter((code) => code.length > 0))];
|
|
1026
|
+
const childFaces = parentMissing.length > 0 && childSchemas.length > 0
|
|
1027
|
+
? await readChildSchemaFieldFaces(session, childSchemas, parentMissing)
|
|
1028
|
+
: { published: new Map(), draft: new Map(), resolved: [] };
|
|
1029
|
+
const childPublished = new Set([...childFaces.published.values()].flatMap((codes) => [...codes]));
|
|
1030
|
+
const publishedAnywhere = (code) => published.includes(code) || childPublished.has(code);
|
|
1019
1031
|
return {
|
|
1020
|
-
wouldChange: requested.length === 0 || !requested.every((code) =>
|
|
1032
|
+
wouldChange: requested.length === 0 || !requested.every((code) => publishedAnywhere(code)),
|
|
1021
1033
|
schemaCode: args.schemaCode,
|
|
1022
1034
|
...(requested.length > 0 ? { requested } : {}),
|
|
1023
|
-
alreadyPublished: requested.length > 0 ? requested.filter((code) =>
|
|
1035
|
+
alreadyPublished: requested.length > 0 ? requested.filter((code) => publishedAnywhere(code)) : undefined,
|
|
1036
|
+
...(childFaces.resolved.length > 0 ? { resolvedFromChildSchemas: childFaces.resolved } : {}),
|
|
1024
1037
|
relationTargetsChecked: candidates.length,
|
|
1025
|
-
note: "关系目标悬空已按真写同门检查;发布是模型级(一次发布该模型全部草稿字段),alreadyPublished 只说明这些 code
|
|
1038
|
+
note: "关系目标悬空已按真写同门检查;发布是模型级(一次发布该模型全部草稿字段),alreadyPublished 只说明这些 code 已在发布面(含本模型子表 schema 的列)。",
|
|
1026
1039
|
};
|
|
1027
1040
|
},
|
|
1028
1041
|
lintScope: "full",
|
|
@@ -2043,6 +2056,52 @@ async function assertFieldPublishRelations(session, schemaCode) {
|
|
|
2043
2056
|
throw new ToolRefusalError({ status: "refused", blocker: "relation-target-not-found", schemaCode, message: relationFailure, candidates: relationCandidates.slice(0, 5) });
|
|
2044
2057
|
return relationCandidates;
|
|
2045
2058
|
}
|
|
2059
|
+
/**
|
|
2060
|
+
* 0.8.11 / 探针 F3:模型级发布覆盖子表 schema——父模型上 CHILD_TABLE(8) 字段的
|
|
2061
|
+
* code **就是**子 schema code,`bizproperty/publish` 一次把子表列一起发布
|
|
2062
|
+
* (父 CHILD_TABLE 字段的 subSchema 承载列;8.6.26 ModelManagementFacadeImpl
|
|
2063
|
+
* .assembleSchemaModel 把 CHILD_TABLE 的 code 解析成真实 schema,field.list 可读)。
|
|
2064
|
+
* 但 `bizproperty/list` 只列**传入 schemaCode** 的字段:拿子表列 code 问父模型
|
|
2065
|
+
* 发布面必然 miss。旧校验据此报 WRITE_UNVERIFIED + nonexistentCodes,诱导 agent
|
|
2066
|
+
* 重复 field.create(真机 2.1.5:refRepair 是 items 的列,父面 miss,实际已发布)。
|
|
2067
|
+
*
|
|
2068
|
+
* 只有请求 codes 在父面缺失时才读子 schema(正常发布零额外 wire)。子 schema 读
|
|
2069
|
+
* 失败按「本次未解释」处理——不能把版本差异变成误拒/误绿。
|
|
2070
|
+
*/
|
|
2071
|
+
async function readChildSchemaFieldFaces(session, childSchemas, missing) {
|
|
2072
|
+
const published = new Map();
|
|
2073
|
+
const draft = new Map();
|
|
2074
|
+
const resolved = [];
|
|
2075
|
+
const codeSet = (rows) => new Set(rows.map((row) => String(row.code ?? row.propertyCode ?? "")).filter((code) => code.length > 0));
|
|
2076
|
+
for (const childSchema of childSchemas) {
|
|
2077
|
+
let codes;
|
|
2078
|
+
try {
|
|
2079
|
+
codes = codeSet(wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: childSchema, isPublish: "true" } })).data));
|
|
2080
|
+
}
|
|
2081
|
+
catch {
|
|
2082
|
+
// 版本不对称(issue §1.4:部分构建对子 schema 的 bizproperty/list 回
|
|
2083
|
+
// 601003)。子面读不到就不解释,保持原有诚实降级,不因此整单拒绝。
|
|
2084
|
+
continue;
|
|
2085
|
+
}
|
|
2086
|
+
published.set(childSchema, codes);
|
|
2087
|
+
if (missing.some((code) => codes.has(code)))
|
|
2088
|
+
resolved.push(childSchema);
|
|
2089
|
+
}
|
|
2090
|
+
// 草稿面只在「所有子发布面都解释不了」时读:那是唯一需要区分
|
|
2091
|
+
// stillDraftCodes(存在但没发布)与 nonexistentCodes(不存在)的场景。
|
|
2092
|
+
const unexplained = missing.filter((code) => ![...published.values()].some((codes) => codes.has(code)));
|
|
2093
|
+
if (unexplained.length > 0) {
|
|
2094
|
+
for (const childSchema of published.keys()) {
|
|
2095
|
+
try {
|
|
2096
|
+
draft.set(childSchema, codeSet(wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: childSchema, isPublish: "false" } })).data)));
|
|
2097
|
+
}
|
|
2098
|
+
catch {
|
|
2099
|
+
// 同上的版本不对称:草稿面读不到就只报「本次未命中」。
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
return { published, draft, resolved };
|
|
2104
|
+
}
|
|
2046
2105
|
export async function executeFieldPublish(session, args) {
|
|
2047
2106
|
// bizproperty/publish is MODEL-SCOPED: one call publishes every draft
|
|
2048
2107
|
// field of the schema. `code`/`codes` only select which fields to verify
|
|
@@ -2211,9 +2270,23 @@ export async function executeFieldPublish(session, args) {
|
|
|
2211
2270
|
}
|
|
2212
2271
|
const publishOutcome = performed;
|
|
2213
2272
|
const readback = await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.schemaCode, isPublish: "true" } });
|
|
2214
|
-
const
|
|
2273
|
+
const readbackRows = wireRows(readback.data);
|
|
2274
|
+
const publishedCodes = readbackRows.map(codeOf).filter((code) => code.length > 0);
|
|
2215
2275
|
const requested = [...(args.code ? [args.code] : []), ...(args.codes ?? [])];
|
|
2216
2276
|
const present = requested.filter((code) => publishedCodes.includes(code));
|
|
2277
|
+
// F3:父面缺失的 code 可能属于本模型的 CHILD_TABLE 子 schema(父模型级发布
|
|
2278
|
+
// 已把子表列一起发布)。只在有缺失时才读子面,正常发布零额外 wire。
|
|
2279
|
+
const childSchemaCandidates = [...new Set([...readbackRows, ...draftRows]
|
|
2280
|
+
.filter((row) => Number(row.type ?? row.propertyType) === FIELD_PROPERTY_TYPES.CHILD_TABLE)
|
|
2281
|
+
.map(codeOf)
|
|
2282
|
+
.filter((code) => code.length > 0))];
|
|
2283
|
+
const parentMissing = requested.filter((code) => !publishedCodes.includes(code));
|
|
2284
|
+
const childFaces = parentMissing.length > 0 && childSchemaCandidates.length > 0
|
|
2285
|
+
? await readChildSchemaFieldFaces(session, childSchemaCandidates, parentMissing)
|
|
2286
|
+
: { published: new Map(), draft: new Map(), resolved: [] };
|
|
2287
|
+
const childPublishedCodes = new Set([...childFaces.published.values()].flatMap((codes) => [...codes]));
|
|
2288
|
+
const childDraftCodes = new Set([...childFaces.draft.values()].flatMap((codes) => [...codes]));
|
|
2289
|
+
const presentCodes = new Set([...present, ...requested.filter((code) => childPublishedCodes.has(code))]);
|
|
2217
2290
|
// r32(真机复现 0.6.13):`codes:["g1","notExist"]` 回 ok + DELIVERED +
|
|
2218
2291
|
// allRequestedPresent:false + verification.ok:true —— 三个成功标记与「有请求的
|
|
2219
2292
|
// 字段不在发布面」同真。不在发布面的 code 分两类,报法不同:
|
|
@@ -2223,9 +2296,9 @@ export async function executeFieldPublish(session, args) {
|
|
|
2223
2296
|
// 判失败;但既有的 verified/ok、allRequestedPresent、verification.ok 都不能
|
|
2224
2297
|
// 再报 true(派生的 readback.present=false 会让共享写门把 deliveryState 降为
|
|
2225
2298
|
// 既有枚举值 WRITE_UNVERIFIED——刻意不新增枚举外的值)。
|
|
2226
|
-
const missingRequested = requested.filter((code) => !
|
|
2227
|
-
const nonexistentCodes = missingRequested.filter((code) => !draftCodesBefore.has(code));
|
|
2228
|
-
const stillDraftCodes = missingRequested.filter((code) => draftCodesBefore.has(code));
|
|
2299
|
+
const missingRequested = requested.filter((code) => !presentCodes.has(code));
|
|
2300
|
+
const nonexistentCodes = missingRequested.filter((code) => !draftCodesBefore.has(code) && !childDraftCodes.has(code));
|
|
2301
|
+
const stillDraftCodes = missingRequested.filter((code) => draftCodesBefore.has(code) || childDraftCodes.has(code));
|
|
2229
2302
|
const allRequestedPresent = missingRequested.length === 0;
|
|
2230
2303
|
const targets = (requested.length > 0 ? requested : [...draftSnapshot.keys()]).filter((code) => publishedCodes.includes(code));
|
|
2231
2304
|
const verificationRun = await verifyFieldDetails(targets);
|
|
@@ -2263,8 +2336,11 @@ export async function executeFieldPublish(session, args) {
|
|
|
2263
2336
|
"平台无「单独发布」也无「取消发布」端点,这一步不可撤销;如需让它们不生效只能用 field.delete(会丢该列数据)。",
|
|
2264
2337
|
}
|
|
2265
2338
|
: {}),
|
|
2266
|
-
...(args.code ? { publishedFieldPresent:
|
|
2267
|
-
...(args.codes ? { publishedFieldsPresent: Object.fromEntries(args.codes.map((code) => [code,
|
|
2339
|
+
...(args.code ? { publishedFieldPresent: presentCodes.has(args.code) } : {}),
|
|
2340
|
+
...(args.codes ? { publishedFieldsPresent: Object.fromEntries(args.codes.map((code) => [code, presentCodes.has(code)])) } : {}),
|
|
2341
|
+
// F3:这些 code 不在父模型字段面,但在其 CHILD_TABLE 子 schema 的发布面
|
|
2342
|
+
// (父模型级发布覆盖子表列)。只增语义,成功回执形状不变。
|
|
2343
|
+
...(childFaces.resolved.length > 0 ? { resolvedFromChildSchemas: childFaces.resolved } : {}),
|
|
2268
2344
|
...(requested.length > 0
|
|
2269
2345
|
? {
|
|
2270
2346
|
allRequestedPresent,
|
|
@@ -10,7 +10,7 @@ export const LIST_VIEW_WIRE = Object.freeze({
|
|
|
10
10
|
createBody: "query/create body {schemaCode, name, code, type:'LIST', showOnPc:false, published:false} (forced design-time defaults); code is required by the platform — a missing code is refused with errcode 10005 「编码不能为空」 on a wasted live round trip (r26 live), so the tool fills schemaCode when code is omitted",
|
|
11
11
|
createReadback: "query/get_header readback",
|
|
12
12
|
configureDefault: "code omitted means the default view (code=schemaCode)",
|
|
13
|
-
configureColumns: "query/get then query/update: for each fieldCodes entry, append a missing column as visible, or repair an existing column's name/propertyType/displayFormat/visible in place (never skip an already-present column), then query/get readback; propertyType comes from published field metadata; NUMERICAL displayFormat is derived from the field's 0-based `options.scale` (0=integer,1=1dp,2=2dp,3=3dp…8=8dp) through the platform parseNumber table ({0:1,1:2,2:3,3:11,4:12,23:…, percent 0..:4/5/6/13/14/27..30, currency ¥ 2dp..:7/15/16/31..34} — verified live: scale 2 → displayFormat 3 = 2 decimals) and DATE displayFormat from options.format (1=yyyy-MM-dd,2=datetime,3=minute,4=yyyy-MM); the readback columns array carries {propertyCode,propertyType,displayFormat,visible,sumType} and added/updated name the fieldCodes touched",
|
|
13
|
+
configureColumns: "query/get then query/update: fieldCodes is OPTIONAL — omitted means the column set is NOT touched (the query/get queryColumns are echoed verbatim because saveBizQueryDetail saves the whole detail), which is the path for sorts/conditions/actions-only updates; replaceColumns:true without fieldCodes refuses listview-fieldcodes-required-for-replace and a call with no configurable key at all refuses listview-configure-no-intent (both zero-write); for each provided fieldCodes entry, append a missing column as visible, or repair an existing column's name/propertyType/displayFormat/visible in place (never skip an already-present column), then query/get readback; propertyType comes from published field metadata; NUMERICAL displayFormat is derived from the field's 0-based `options.scale` (0=integer,1=1dp,2=2dp,3=3dp…8=8dp) through the platform parseNumber table ({0:1,1:2,2:3,3:11,4:12,23:…, percent 0..:4/5/6/13/14/27..30, currency ¥ 2dp..:7/15/16/31..34} — verified live: scale 2 → displayFormat 3 = 2 decimals) and DATE displayFormat from options.format (1=yyyy-MM-dd,2=datetime,3=minute,4=yyyy-MM); the readback columns array carries {propertyCode,propertyType,displayFormat,visible,sumType} and added/updated name the fieldCodes touched",
|
|
14
14
|
configureSorts: "sorts -> querySorts [{propertyCode,propertyType,direction,sortKey,clientType}]; direction SortDirectionType numeric ASC(1)/DESC(2); omitted leaves the existing sorts untouched, provided replaces them",
|
|
15
15
|
configureConditions: "conditions -> queryConditions [{propertyCode,propertyType,displayType,filterType,defaultValue,options,startValue,endValue,shortcutFilter,choiceType,dateType,accurateSearch,showNull,includeSubData,buildTreeBy,visible,treeLimitScopeType,treeLimitConditionGroup,treeDefaultConditionGroup}]; minimum --param shape: {\"conditions\":[{\"propertyCode\":\"<code>\",\"filterType\":\"Eq\",\"defaultValue\":<value>}]}; filterType is the comparison OPERATOR (QueryFilterType STRING enum: Eq/NotEq/Gt/Lt/Gte/Lte/Like/NotLike/IsNull/IsNotNull/In/NotIn/Between/NotBetween/Of/NotOf/…; omitted → the platform default for the propertyType; aliases operator/op and legacy options.op); displayType INPUT(0)/RADIO(1)/CHECKBOX(2)/SELECT(3)/RANGE(4); choiceType SELECT(1)/POPUP(2)/TREE_LEFT(3); options is a JSON string (decoded on readback); the 2.1.5 tree-view triple treeLimitScopeType/treeLimitConditionGroup/treeDefaultConditionGroup is read as List<List<BizQueryDataRangeCondition>> [[{propertyCode,propertyType,operatorType,valueType,value,dynamicValue}]] and passed through verbatim: a baseline key with a DIFFERENT value refuses with listview-tree-conditions-changed (nextAction allowTreeConditionChange:true) and a baseline key omitted from the submitted row refuses with listview-tree-conditions-would-be-lost; value equality canonicalises JSON text vs object, object key order, and numeric propertyType/operatorType (\"1\"==1) but keeps value/dynamicValue string-strict; readback compares all three keys whenever either side carries one and reports the drift as a coercion; conditionReadback is equivalent only for field-by-field equality, otherwise coerced with from/to details; viewConditionsAppliedRest:false records that REST data.list --queryCode does not apply fixed conditions",
|
|
16
16
|
configureConditionMap: "queryConditionMap {<schemaCode>: queryConditions[]} is read-derived (query/get with a formCode child-table filter); BizQueryDetailConfig persists queryConditions/querySorts only, so the map is not a configure input",
|
|
@@ -126,7 +126,7 @@ export const LIST_VIEW_LANE_CONTRACT = Object.freeze({
|
|
|
126
126
|
}),
|
|
127
127
|
"listview.configure": Object.freeze({
|
|
128
128
|
scope: LIST_VIEW_SCOPE,
|
|
129
|
-
description: "配置列表视图(列、排序、查询条件、行/列表按钮、呈现、自定义按钮、视图头扩展选项与视图类型)。**code 语义**:省略 `code`(或 code=schemaCode)= 配置**默认视图**(code = 模型 code,8.6.41 起默认视图同样可 configure),日常配列就用它,**不要先 listview.create**(会多一个视图);改默认视图影响所有用户;仅需第二个视图时才 listview.create(configure 带 code
|
|
129
|
+
description: "配置列表视图(列、排序、查询条件、行/列表按钮、呈现、自定义按钮、视图头扩展选项与视图类型)。**code 语义**:省略 `code`(或 code=schemaCode)= 配置**默认视图**(code = 模型 code,8.6.41 起默认视图同样可 configure),日常配列就用它,**不要先 listview.create**(会多一个视图);改默认视图影响所有用户;仅需第二个视图时才 listview.create(configure 带 code 指向它)。`fieldCodes` 可省略——**省略=不动列**(只改排序/筛选/动作时不必重发列集合;`replaceColumns:true` 仍必须带 fieldCodes,全空参数零写入拒)。读回 query,按 `fieldCodes` 追加缺失列或**原地修正**已存在列的 name/propertyType/displayFormat/visible(不再跳过既有列),置为可见;数值列 displayFormat 由字段 0 基 `options.scale` 推导(0=整数,1=1位,2=2位,3=3位…8=8位)、日期列由 `options.format` 推导(1/2/3/4),回显 `columns` 为完整列对象并给出 `added`/`updated`;`sorts`→querySorts(direction ASC/DESC)、`conditions`→queryConditions(**比较符是 `filterType`(QueryFilterType 字符串枚举 Eq/NotEq/…;别名 operator/op;省略时按 propertyType 取平台默认)**、displayType/choiceType/options 字符串解码;2.1.5 树视图过滤组三键 `treeLimitScopeType`/`treeLimitConditionGroup`/`treeDefaultConditionGroup` 原样透传(值不同默认拒 `listview-tree-conditions-changed`,确认改写传 `allowTreeConditionChange:true`;缺键拒 `listview-tree-conditions-would-be-lost`);写后条件回读等价校验给出 conditionReadback)、`actions`→queryActions(queryActionType QUERY(1)…BATCH_SUBMIT(23)、associationType BIZSHEET(0)/WORKFLOW(1))、`presentation`→queryPresentation(htmlJson/actionsJson/columnsJson/queryViewDataSource/schemaRelations/options 均为 JSON 字符串,合法 JSON 读回解码)、`buttons`→customButtons(写面 customButtonJson JSON 数组字符串;bindAction/useLocation/operateType/showPermType 以枚举名发送;triggerType 强制 QUERY、triggerCode=视图 code、sortKey 按数组位,缺省回传读面 customButtons 有效集;ADD_DATA/FORM 目标绑定走 actionConfig——schemaCodeVal+formListData+configureList,targetCode/targetObjCode 对其无效会被拒;高层参数 targetModel/targetForm/configureList 从读回元数据展开,未解析即 listview-button-target-unresolved 零副作用拒)、`options`→视图头 BizQueryOption(`pagingSetting`{pageSize,showTotal} 分页、`listViewModeSetting`{mode,canSwitch} 列表模式,缺省回传读面有效 options、提供时整体替换,rowColorSetting 无 8.6.26 类证据故对象形态拒绝)与 `presentationType`→QueryPresentationType(LIST/BOARD/CALENDAR/GANTT,缺省回传读面有效值;GANTT 必须同时提供 `gantt`→queryGanttModel 且 startTimePropertyCode/endTimePropertyCode/titlePropertyCode 非空,缺省不触碰既有 gantt)与 `queryLayer`→层级展示(BizQueryLayer[] 数组原样发送)及 `multiTableHeaderConfig`→多级表头(HeaderConfig[] JSON 字符串;缺省回传读面有效值、提供时整体替换)省略时不触碰既有值,提供时整体替换并经出门前 dry-lint;`query/update` 后回读。`queryConditionMap` 为只读派生(query/get 带 formCode 子表条件时才出现),非配置输入。**发布语义**:`query/update` 自动置 publish=TRUE——视图无草稿/发布两态、无需独立发布步骤。**依赖顺序**:视图与表单脚手架都依赖**已发布字段**,规范顺序 model.create → field.create → field.publish(模型级)→ form.draft → form.publish →(需要第二视图时 listview.create)→ listview.configure → rule.save → rule.enable → workflow。",
|
|
130
130
|
}),
|
|
131
131
|
"listview.delete": Object.freeze({
|
|
132
132
|
scope: LIST_VIEW_SCOPE,
|
|
@@ -515,6 +515,32 @@ const LISTVIEW_CONDITION_KEYS = new Set([
|
|
|
515
515
|
// listview-condition-unknown-key 会把「原样带回」的路堵死),值原样透传。
|
|
516
516
|
...LISTVIEW_TREE_CONDITION_KEYS,
|
|
517
517
|
]);
|
|
518
|
+
/**
|
|
519
|
+
* F4(probe F / 0.8.11):`fieldCodes` 从必填转可选——只改排序/筛选/动作时不必
|
|
520
|
+
* 重发整份列集合(`sorts`/`conditions` 的文档语义本来就是「省略=不动」)。
|
|
521
|
+
* 但两种写仍然是零意图或自相矛盾的,必须在 preflight 零副作用拒收:
|
|
522
|
+
* - 一个可改项都没传 → 平台会照常 200 保存一份没有变化的视图(也会把
|
|
523
|
+
* `{...model}` 的读面回声写回),调用方白拿绿灯;
|
|
524
|
+
* - `replaceColumns:true` 却省略 `fieldCodes` → 「fieldCodes 即权威列全集」
|
|
525
|
+
* 没有全集可依,语义矛盾。
|
|
526
|
+
* 本清单是「传了就算有意图」的键面:`replaceColumns` 只是 `fieldCodes` 的修饰,
|
|
527
|
+
* `replaceActions`/`defaultActions` 只是 `actions` 的修饰,单传它们不算改配置。
|
|
528
|
+
*/
|
|
529
|
+
export const LISTVIEW_CONFIGURE_INTENT_KEYS = Object.freeze([
|
|
530
|
+
"fieldCodes",
|
|
531
|
+
"hideDefaultSystemFields",
|
|
532
|
+
"sorts",
|
|
533
|
+
"conditions",
|
|
534
|
+
"actions",
|
|
535
|
+
"presentation",
|
|
536
|
+
"buttons",
|
|
537
|
+
"buttonScripts",
|
|
538
|
+
"options",
|
|
539
|
+
"presentationType",
|
|
540
|
+
"gantt",
|
|
541
|
+
"queryLayer",
|
|
542
|
+
"multiTableHeaderConfig",
|
|
543
|
+
]);
|
|
518
544
|
/**
|
|
519
545
|
* Out-the-door dry lint for `sorts`/`conditions`/`actions`/`presentation`/
|
|
520
546
|
* `buttons`/`options`. `omc call` bypasses zod, so this refuses a malformed list
|
|
@@ -524,6 +550,26 @@ const LISTVIEW_CONDITION_KEYS = new Set([
|
|
|
524
550
|
* `listViewModeSetting` (rowColorSetting has no class).
|
|
525
551
|
*/
|
|
526
552
|
export function assertListViewConfigureShape(args) {
|
|
553
|
+
// F4:replaceColumns 与「不动列」互斥——先报更具体的那条。
|
|
554
|
+
if (args.replaceColumns === true && (args.fieldCodes === undefined || args.fieldCodes.length === 0)) {
|
|
555
|
+
throw new ToolRefusalError({
|
|
556
|
+
status: "refused",
|
|
557
|
+
blocker: "listview-fieldcodes-required-for-replace",
|
|
558
|
+
nextAction: "replaceColumns:true 表示 fieldCodes 是权威列全集(未列出的列全部移除):请同时给出 fieldCodes(想保留的业务列/系统列都写进去),只想改排序/筛选/动作就省略 replaceColumns。本次零写入。",
|
|
559
|
+
message: "replaceColumns:true 必须同时提供 fieldCodes——没有权威列集合可依(缺 fieldCodes 时本工具不动列,与「按 fieldCodes 重建列」自相矛盾)。本次零写入,视图未被修改。",
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
const provided = args;
|
|
563
|
+
if (!LISTVIEW_CONFIGURE_INTENT_KEYS.some((key) => provided[key] !== undefined)) {
|
|
564
|
+
throw new ToolRefusalError({
|
|
565
|
+
status: "refused",
|
|
566
|
+
blocker: "listview-configure-no-intent",
|
|
567
|
+
nextAction: `至少传一个要改的项(${LISTVIEW_CONFIGURE_INTENT_KEYS.join(" / ")})再调用;` +
|
|
568
|
+
"只读盘点用 listview.get。本次零写入。",
|
|
569
|
+
message: "listview.configure 没有收到任何要修改的项:这是一次零意图的写(平台会照常保存并回 200)。" +
|
|
570
|
+
`至少传一个:${LISTVIEW_CONFIGURE_INTENT_KEYS.join(" / ")}。`,
|
|
571
|
+
});
|
|
572
|
+
}
|
|
527
573
|
const lists = [
|
|
528
574
|
["sorts", args.sorts],
|
|
529
575
|
["conditions", args.conditions],
|
package/dist/lanes/list-view.js
CHANGED
|
@@ -821,9 +821,9 @@ export function registerListViewLane(tools) {
|
|
|
821
821
|
inputSchema: {
|
|
822
822
|
schemaCode: z.string().min(1),
|
|
823
823
|
code: z.string().optional(),
|
|
824
|
-
fieldCodes: z.array(z.string()).min(1).describe("要展示的字段:可给 propertyCode
|
|
824
|
+
fieldCodes: z.array(z.string()).min(1).optional().describe("要展示的字段:可给 propertyCode 或字段显示名(唯一匹配时自动解析,歧义或不存在则拒绝,不静默跳过)。**省略 = 不动列**(只改排序/筛选/动作时可省)"),
|
|
825
825
|
hideDefaultSystemFields: z.boolean().optional().describe("是否隐藏平台默认系统列(createdTime/creater/name/sequenceNo 等);平台 update 按提交列集合决定,不能靠 visible:false"),
|
|
826
|
-
replaceColumns: z.boolean().optional().describe("把 fieldCodes 当作列集合的权威全集:未列出的已有列(含系统列)全部移除,最终列 = fieldCodes
|
|
826
|
+
replaceColumns: z.boolean().optional().describe("把 fieldCodes 当作列集合的权威全集:未列出的已有列(含系统列)全部移除,最终列 = fieldCodes(按给定顺序)。**必须同时给 fieldCodes**,只传 replaceColumns 会被拒(listview-fieldcodes-required-for-replace)。默认 false 为增量(保留已有列,省略 fieldCodes 时列完全不动)。系统列与业务列一视同仁——想要 createdTime/sequenceNo 就把它写进 fieldCodes"),
|
|
827
827
|
sorts: z.array(listViewSortArg).optional().describe("querySorts; omitted leaves the existing sorts untouched, provided replaces them。成员键:propertyCode + direction(ASC/DESC),其余可省"),
|
|
828
828
|
conditions: z.array(listViewConditionArg).optional().describe("queryConditions; omitted leaves the existing conditions untouched, provided replaces them(2.1.5 树视图三键原样带回;值变化默认拒 listview-tree-conditions-changed)"),
|
|
829
829
|
allowTreeConditionChange: z.boolean().optional().describe("仅当确认要改写树过滤组时传 true:允许提交值与基线的 treeLimitScopeType/treeLimitConditionGroup/treeDefaultConditionGroup 不同(新值原样写入);默认 false 时值不同即拒 listview-tree-conditions-changed。本参数只放行值差异,不放行缺键——基线有值而提交行没带仍拒 listview-tree-conditions-would-be-lost。"),
|
|
@@ -918,72 +918,79 @@ export function registerListViewLane(tools) {
|
|
|
918
918
|
let sortKey = columns.reduce((max, c) => Math.max(max, Number(c.sortKey) || 0), 0);
|
|
919
919
|
const added = [];
|
|
920
920
|
const updated = [];
|
|
921
|
-
//
|
|
922
|
-
//
|
|
923
|
-
//
|
|
924
|
-
//
|
|
925
|
-
const
|
|
926
|
-
if (
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
const
|
|
942
|
-
|
|
943
|
-
})
|
|
944
|
-
.filter((code) => typeof code === "string");
|
|
945
|
-
if (childTableRefs.length > 0) {
|
|
946
|
-
const alternatives = args.fieldCodes.filter((ref) => {
|
|
921
|
+
// F4(probe F / 0.8.11):fieldCodes 可选。省略时**不动列**——columns 是
|
|
922
|
+
// query/get 的读面回声,下面原样提交(平台 query/update 是整体保存,
|
|
923
|
+
// 必须带回既有 queryColumns,不能用空集合重建,也不触碰 replaceColumns)。
|
|
924
|
+
// 只改 sorts/conditions/actions 的调用因此不再需要重发整份列集合。
|
|
925
|
+
const fieldRefs = args.fieldCodes;
|
|
926
|
+
if (fieldRefs !== undefined) {
|
|
927
|
+
// A `fieldCodes` entry may be a propertyCode OR a display name (cpdocs
|
|
928
|
+
// base3.0 parity); an unresolvable reference is REFUSED, never silently
|
|
929
|
+
// skipped — a silently dropped column reported as success is the
|
|
930
|
+
// "declared a column, nothing appeared" trap.
|
|
931
|
+
const unknownRefs = fieldRefs.filter((ref) => resolveFieldRef(fieldRows, ref) === undefined);
|
|
932
|
+
if (unknownRefs.length > 0)
|
|
933
|
+
throw new ToolRefusalError({
|
|
934
|
+
status: "refused",
|
|
935
|
+
blocker: "listview-columns-unknown-field",
|
|
936
|
+
unknown: unknownRefs,
|
|
937
|
+
message: `fieldCodes 引用了模型 ${args.schemaCode} 发布面上不存在的字段(可给 propertyCode 或字段名):${unknownRefs.join("、")};先 field.create + field.publish,或修正引用`,
|
|
938
|
+
});
|
|
939
|
+
// r29b F5b: 列表视图不支持整列展示子表——平台会 50000「服务异常」,dry-run
|
|
940
|
+
// 以前也不拦。写前按 propertyType=CHILD_TABLE(8) 拒绝并给替代。
|
|
941
|
+
const childTableRefs = fieldRefs
|
|
942
|
+
.map((ref) => {
|
|
947
943
|
const resolved = resolveFieldRef(fieldRows, ref);
|
|
948
944
|
if (!resolved)
|
|
949
|
-
return
|
|
945
|
+
return null;
|
|
950
946
|
const field = fieldRows.find((row) => (row.code ?? row.propertyCode) === resolved.code);
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
947
|
+
const type = Number(field.type ?? field.propertyType);
|
|
948
|
+
return type === 8 ? resolved.code : null;
|
|
949
|
+
})
|
|
950
|
+
.filter((code) => typeof code === "string");
|
|
951
|
+
if (childTableRefs.length > 0) {
|
|
952
|
+
const alternatives = fieldRefs.filter((ref) => {
|
|
953
|
+
const resolved = resolveFieldRef(fieldRows, ref);
|
|
954
|
+
if (!resolved)
|
|
955
|
+
return false;
|
|
956
|
+
const field = fieldRows.find((row) => (row.code ?? row.propertyCode) === resolved.code);
|
|
957
|
+
return Number(field.type ?? field.propertyType) !== 8;
|
|
958
|
+
});
|
|
959
|
+
throw new ToolInputError({
|
|
960
|
+
status: "error",
|
|
961
|
+
blocker: "tool-input-invalid",
|
|
962
|
+
tool: "listview.configure",
|
|
963
|
+
message: `列表视图不支持整列展示子表(propertyType=CHILD_TABLE):${childTableRefs.join("、")}。` +
|
|
964
|
+
"平台会回 50000 服务异常。请改用子表首列/展开列,或在详情页(form)看子表;列表只放主表标量列。",
|
|
965
|
+
nextCommand: alternatives.length > 0
|
|
966
|
+
? `omc call listview.configure --args '${JSON.stringify({ schemaCode: args.schemaCode, code, fieldCodes: alternatives })}'`
|
|
967
|
+
: `omc call field.list --args '${JSON.stringify({ schemaCode: args.schemaCode, published: true })}'`,
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
// replaceColumns: the caller's fieldCodes ARE the view. Start from an
|
|
971
|
+
// empty set so system columns fall away unless listed — a system field
|
|
972
|
+
// can still be shown by naming its code in fieldCodes (createdTime etc.
|
|
973
|
+
// are published fields too), so the caller controls the exact set.
|
|
974
|
+
if (args.replaceColumns === true)
|
|
975
|
+
columns.length = 0;
|
|
976
|
+
for (const ref of fieldRefs) {
|
|
977
|
+
const fieldCode = resolveFieldRef(fieldRows, ref).code;
|
|
978
|
+
const field = fieldRows.find((row) => (row.code ?? row.propertyCode) === fieldCode);
|
|
979
|
+
const type = Number(field.type ?? field.propertyType);
|
|
980
|
+
const displayFormat = columnDisplayFormat(type, field.options);
|
|
981
|
+
const existing = columns.find((c) => c.propertyCode === fieldCode);
|
|
982
|
+
if (existing) {
|
|
983
|
+
existing.name = field.name;
|
|
984
|
+
existing.propertyType = type;
|
|
985
|
+
existing.displayFormat = displayFormat;
|
|
986
|
+
existing.visible = true;
|
|
987
|
+
updated.push(fieldCode);
|
|
988
|
+
continue;
|
|
989
|
+
}
|
|
990
|
+
sortKey += 1;
|
|
991
|
+
columns.push({ name: field.name, propertyCode: fieldCode, propertyType: type, isDefaultProperty: false, displayFormat, width: "160", sortKey, sumType: null, relativeSchemaCode: null, childColumns: null, clientType: "PC", schemaAlias: "a_1", propertyAlias: fieldCode, syncDefaultFormat: false, displayFields: null, queryLevel: 1, options: null, visible: true, virtualField: false, enableEncrypt: false, autoFilled: false });
|
|
992
|
+
added.push(fieldCode);
|
|
983
993
|
}
|
|
984
|
-
sortKey += 1;
|
|
985
|
-
columns.push({ name: field.name, propertyCode: fieldCode, propertyType: type, isDefaultProperty: false, displayFormat, width: "160", sortKey, sumType: null, relativeSchemaCode: null, childColumns: null, clientType: "PC", schemaAlias: "a_1", propertyAlias: fieldCode, syncDefaultFormat: false, displayFields: null, queryLevel: 1, options: null, visible: true, virtualField: false, enableEncrypt: false, autoFilled: false });
|
|
986
|
-
added.push(fieldCode);
|
|
987
994
|
}
|
|
988
995
|
// replaceColumns already reduced the set to fieldCodes; hideDefaultSystemFields
|
|
989
996
|
// additionally drops any system column that slipped in (an echoed system
|
|
@@ -992,6 +999,10 @@ export function registerListViewLane(tools) {
|
|
|
992
999
|
// the platform forces every submitted column visible=true
|
|
993
1000
|
// (BizQueryController.reSetQueryColumns:1000-1027), so visible:false is
|
|
994
1001
|
// not an option.
|
|
1002
|
+
// F4:fieldCodes 省略时 configuredColumns 就是 query/get 的原样列集合。
|
|
1003
|
+
// 平台 query/update 是整体保存(saveBizQueryDetail),所以必须带回既有
|
|
1004
|
+
// queryColumns;这不是 replaceColumns(不做重建/增删),除非调用方显式
|
|
1005
|
+
// hideDefaultSystemFields:true 才滤掉系统列。
|
|
995
1006
|
const configuredColumns = filterDefaultSystemColumns(columns, args.hideDefaultSystemFields === true);
|
|
996
1007
|
const body = { ...model, queryColumns: configuredColumns };
|
|
997
1008
|
if (args.presentation !== undefined)
|
|
@@ -1189,8 +1200,10 @@ export function registerListViewLane(tools) {
|
|
|
1189
1200
|
// :209-226),增量 configure(未传 replaceColumns/hideDefaultSystemFields)会
|
|
1190
1201
|
// 把它们原样保留——真机 4 列请求回读 8 列,调用方会以为 fieldCodes 写错了。
|
|
1191
1202
|
// 只报告不改变写入语义;权威列集合 = 调用方 fieldCodes + 平台既有列。
|
|
1192
|
-
|
|
1193
|
-
|
|
1203
|
+
// F4:省略 fieldCodes 时列本来就不动,不存在「平台额外保留」的可疑差集——
|
|
1204
|
+
// 这个提示只在调用方点名了列、且没要求权威全集时才出现。
|
|
1205
|
+
if (fieldRefs !== undefined && args.replaceColumns !== true && args.hideDefaultSystemFields !== true) {
|
|
1206
|
+
const requestedCodes = new Set(fieldRefs.map((ref) => resolveFieldRef(fieldRows, ref)?.code ?? ref));
|
|
1194
1207
|
const systemColumnsAdded = [
|
|
1195
1208
|
...new Set(afterCols
|
|
1196
1209
|
.map((column) => String(column.propertyCode ?? ""))
|
|
@@ -1367,45 +1380,59 @@ export function registerListViewLane(tools) {
|
|
|
1367
1380
|
dryRunPayload: async (session, args) => {
|
|
1368
1381
|
const code = args.code ?? args.schemaCode;
|
|
1369
1382
|
const fieldRows = wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.schemaCode, isPublish: "true" } })).data);
|
|
1370
|
-
//
|
|
1371
|
-
//
|
|
1372
|
-
const
|
|
1373
|
-
if (
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
return Number(field.type ?? field.propertyType) === 8 ? resolved.code : null;
|
|
1387
|
-
})
|
|
1388
|
-
.filter((value) => typeof value === "string");
|
|
1389
|
-
if (childTableRefs.length > 0) {
|
|
1390
|
-
const alternatives = args.fieldCodes.filter((ref) => {
|
|
1383
|
+
// F4(probe F / 0.8.11):fieldCodes 可选——只改排序/筛选/动作时不校验列,
|
|
1384
|
+
// 预览也不再谎称「配置列」。
|
|
1385
|
+
const fieldRefs = args.fieldCodes;
|
|
1386
|
+
if (fieldRefs !== undefined) {
|
|
1387
|
+
// R75-B(2026-11-18):未知列此前 dry-run 只在 fieldCodes 回显、真写才拒
|
|
1388
|
+
// (investigate-B E3 实证)。同一判定提前到这里——dry-run 与真写同答案。
|
|
1389
|
+
const unknownRefs = fieldRefs.filter((ref) => resolveFieldRef(fieldRows, ref) === undefined);
|
|
1390
|
+
if (unknownRefs.length > 0)
|
|
1391
|
+
throw new ToolRefusalError({
|
|
1392
|
+
status: "refused",
|
|
1393
|
+
blocker: "listview-columns-unknown-field",
|
|
1394
|
+
unknown: unknownRefs,
|
|
1395
|
+
message: `fieldCodes 引用了模型 ${args.schemaCode} 发布面上不存在的字段(可给 propertyCode 或字段名):${unknownRefs.join("、")};先 field.create + field.publish,或修正引用`,
|
|
1396
|
+
});
|
|
1397
|
+
const childTableRefs = fieldRefs
|
|
1398
|
+
.map((ref) => {
|
|
1391
1399
|
const resolved = resolveFieldRef(fieldRows, ref);
|
|
1392
1400
|
if (!resolved)
|
|
1393
|
-
return
|
|
1401
|
+
return null;
|
|
1394
1402
|
const field = fieldRows.find((row) => (row.code ?? row.propertyCode) === resolved.code);
|
|
1395
|
-
return Number(field.type ?? field.propertyType)
|
|
1396
|
-
})
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1403
|
+
return Number(field.type ?? field.propertyType) === 8 ? resolved.code : null;
|
|
1404
|
+
})
|
|
1405
|
+
.filter((value) => typeof value === "string");
|
|
1406
|
+
if (childTableRefs.length > 0) {
|
|
1407
|
+
const alternatives = fieldRefs.filter((ref) => {
|
|
1408
|
+
const resolved = resolveFieldRef(fieldRows, ref);
|
|
1409
|
+
if (!resolved)
|
|
1410
|
+
return false;
|
|
1411
|
+
const field = fieldRows.find((row) => (row.code ?? row.propertyCode) === resolved.code);
|
|
1412
|
+
return Number(field.type ?? field.propertyType) !== 8;
|
|
1413
|
+
});
|
|
1414
|
+
throw new ToolInputError({
|
|
1415
|
+
status: "error",
|
|
1416
|
+
blocker: "tool-input-invalid",
|
|
1417
|
+
tool: "listview.configure",
|
|
1418
|
+
message: `列表视图不支持整列展示子表(propertyType=CHILD_TABLE):${childTableRefs.join("、")}。` +
|
|
1419
|
+
"平台会回 50000 服务异常。请改用子表首列/展开列,或在详情页(form)看子表;列表只放主表标量列。",
|
|
1420
|
+
nextCommand: alternatives.length > 0
|
|
1421
|
+
? `omc call listview.configure --args '${JSON.stringify({ schemaCode: args.schemaCode, code, fieldCodes: alternatives })}'`
|
|
1422
|
+
: `omc call field.list --args '${JSON.stringify({ schemaCode: args.schemaCode, published: true })}'`,
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
const changedFaces = ["sorts", "conditions", "actions", "buttons", "presentation", "options", "presentationType", "gantt", "queryLayer", "multiTableHeaderConfig"].filter((key) => args[key] !== undefined);
|
|
1427
|
+
if (fieldRefs === undefined) {
|
|
1428
|
+
return {
|
|
1429
|
+
wouldChange: true,
|
|
1430
|
+
summary: `即将配置列表视图 ${args.schemaCode}/${code}:列不变${changedFaces.length > 0 ? `;改 ${changedFaces.join("、")}` : ""}`,
|
|
1431
|
+
columnsUnchanged: true,
|
|
1432
|
+
...(args.conditions !== undefined ? { conditions: args.conditions } : {}),
|
|
1433
|
+
};
|
|
1407
1434
|
}
|
|
1408
|
-
const normalizedFieldCodes =
|
|
1435
|
+
const normalizedFieldCodes = fieldRefs.map((ref) => resolveFieldRef(fieldRows, ref)?.code ?? ref);
|
|
1409
1436
|
return {
|
|
1410
1437
|
wouldChange: true,
|
|
1411
1438
|
summary: `即将配置列表视图 ${args.schemaCode}/${code} 的列`,
|
package/dist/recipes/datarule.js
CHANGED
|
@@ -124,7 +124,7 @@ const dataruleChildColumn = Object.freeze({
|
|
|
124
124
|
tool: "datarule.create",
|
|
125
125
|
args: {
|
|
126
126
|
environment,
|
|
127
|
-
schemaCode: "
|
|
127
|
+
schemaCode: "<子表父字段 code,如 items>",
|
|
128
128
|
propertyCode: "amount",
|
|
129
129
|
dataRuleType: 2,
|
|
130
130
|
options: {
|
package/dist/recipes/field.js
CHANGED
|
@@ -215,15 +215,15 @@ const childTable = Object.freeze({
|
|
|
215
215
|
},
|
|
216
216
|
preconditions: ["目标模型已存在;父字段 code 和子列 codes 尚未存在;父模型字段发布后再配置表单"],
|
|
217
217
|
conditionalRequirements: [
|
|
218
|
-
"
|
|
218
|
+
"**父字段 `code` = 子 schema code = 子列 field.create/update 的 schemaCode(同一个值)**;平台要求全局唯一,跨模型撞名就加前缀(如 `<model>_items`),撞名时只回 errcode 40000「调用数据库发生异常」(实测);",
|
|
219
219
|
"子表列不得是 CHILD_TABLE、OCR、ELECTRONIC_SIGN、RELEVANCE_DATA 或 FORMULA;关系列必须另带 relativeCode 与 options;子列 NUMERICAL 同样必须带 options.scale",
|
|
220
220
|
],
|
|
221
221
|
priorToolReferences: [],
|
|
222
222
|
dryRun: { supported: true, command: `omc call field.create --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 验证 subFields 并跳过环境写入" },
|
|
223
|
-
expectedReadback: { readback: { field: { code: "
|
|
223
|
+
expectedReadback: { readback: { field: { code: "<model>_items", propertyType: "CHILD_TABLE", subSchema: { properties: ["itemName", "itemQty"] } } }, next: ["field.publish", "form.draft", "form.publish"] },
|
|
224
224
|
refusalRecovery: [
|
|
225
225
|
{ code: "capability-out-of-coverage", action: "补齐 subFields,并移除不支持的嵌套/高级子列族" },
|
|
226
|
-
{ code: "child-table-update-unsupported", action: "子列用 schemaCode
|
|
226
|
+
{ code: "child-table-update-unsupported", action: "子列用 schemaCode=<父字段 code>(本配方即 <model>_items)的 field.create/update;不要向父字段 update 传 options/choices/subFields" },
|
|
227
227
|
...commonRecovery,
|
|
228
228
|
],
|
|
229
229
|
requiresEnvironmentDerivedIds: false,
|
|
@@ -241,6 +241,11 @@ const childTable = Object.freeze({
|
|
|
241
241
|
* `BizPropertyController.java:1138-1146` 用 `getAppFunctionByCodeIgnoreDelete`
|
|
242
242
|
* 取顶层 app function,子表没有该行);F9 映射正确性读面在 `field.get` 的
|
|
243
243
|
* `options.mappings` 与 `mappingRuntimeNote`,不必等到 `data.save`。
|
|
244
|
+
*
|
|
245
|
+
* 探针 F(0.8.11):`schemaCode` 曾经写 `<model>_items` 约定名,真机 2.1.5 上
|
|
246
|
+
* 子表子 schema code 就是**父模型 CHILD_TABLE(8) 字段的 code**(父字段叫 `items`
|
|
247
|
+
* 就是 `items`;`BizPropertyManagerImpl.java:197` 用 `bizProperty.getCode()` 建子
|
|
248
|
+
* schema),按约定名建列 → 300004「数据模型不存在!」。
|
|
244
249
|
*/
|
|
245
250
|
const childTableParentFieldFill = Object.freeze({
|
|
246
251
|
id: "child-map-fill",
|
|
@@ -250,7 +255,7 @@ const childTableParentFieldFill = Object.freeze({
|
|
|
250
255
|
tool: "field.create",
|
|
251
256
|
args: {
|
|
252
257
|
environment,
|
|
253
|
-
schemaCode: "
|
|
258
|
+
schemaCode: "<子表父字段 code>",
|
|
254
259
|
code: "refParent",
|
|
255
260
|
name: "关联",
|
|
256
261
|
propertyType: "WORK_SHEET",
|
|
@@ -263,11 +268,13 @@ const childTableParentFieldFill = Object.freeze({
|
|
|
263
268
|
},
|
|
264
269
|
},
|
|
265
270
|
preconditions: [
|
|
271
|
+
"**子表子 schema code = 父模型 CHILD_TABLE(8) 字段的 code**(父字段 code 为 `items` 时 schemaCode 就是 `items`),不是 `<model>_items` 约定名:`omc call field.list --args '{\"schemaCode\":\"<父模型>\"}'` 找 type:8 字段的 code;同一口径见 `omc contract field-families` 的 `childTableSubSchema`。",
|
|
266
272
|
"子表 code 全局唯一;先建并发布快照标量列,再建关联列。",
|
|
267
273
|
"**发布用父模型 code**:`field.publish {\"schemaCode\":\"<父模型>\"}`——子表 code 会被拒(300004 → `field-publish-child-schema`);模型级一次发全部草稿字段,子表列随父模型发。",
|
|
268
274
|
],
|
|
269
275
|
conditionalRequirements: [
|
|
270
276
|
"映射只在门户选值时回填:CLI data.save(/api/runtime/form/save)不跑 options.mappings,快照列需调用方自填;配置正确性以字段行 options.mappings 为准。",
|
|
277
|
+
"schemaCode 填子表(=父字段 code),发布填父模型 code——两者不是同一个 code,别互相套用。",
|
|
271
278
|
"关联列必须带 relativeCode(=options.schemaCode=主模型);source=主模型字段、target=本子表列,均裸 code。",
|
|
272
279
|
"关联列不能是 CHILD_TABLE/OCR/ELECTRONIC_SIGN/MULT_WORK_SHEET/RELEVANCE_DATA/FORMULA。",
|
|
273
280
|
],
|
|
@@ -26,6 +26,36 @@ const workflowSave = Object.freeze({
|
|
|
26
26
|
requiresEnvironmentDerivedIds: true,
|
|
27
27
|
prerequisiteData: { source: "workflow.get_published; data.save authoritative readback", fields: ["workflow.code", "bizObjectId", "workflowInstanceId", "workItemId"] },
|
|
28
28
|
});
|
|
29
|
+
// F6(0.8.11 探针 F):`describe data.save --example basic` 此前 not-found——
|
|
30
|
+
// 唯一的配方是 workflow-backed-data-save,纯草稿保存的调用者得先猜 id 再改。
|
|
31
|
+
// 这里给最小可抄形状:标量字段草稿落库,不推进流程、不带 workflowCode/子表;
|
|
32
|
+
// 子表/关联映射的注意事项指回 workflow-backed-data-save(不复制正文)。
|
|
33
|
+
const basicDraftSave = Object.freeze({
|
|
34
|
+
id: "basic",
|
|
35
|
+
title: "最小草稿保存(无流程、纯标量字段)",
|
|
36
|
+
status: "offline-valid",
|
|
37
|
+
tool: "data.save",
|
|
38
|
+
args: { environment, schemaCode: model, formData: { name: "草稿示例" } },
|
|
39
|
+
preconditions: [
|
|
40
|
+
"模型与默认表单已发布;schemaCode 换成你自己的模型 code(formData 的键=已发布字段 code)",
|
|
41
|
+
"formData 只放标量字段,不带 id(带 id 是更新既有记录的语义)",
|
|
42
|
+
],
|
|
43
|
+
conditionalRequirements: [
|
|
44
|
+
"纯草稿保存:不带 workflowCode / submit——行落为 DRAFT,不推进流程,也不触发 Create/Update 规则(DRAFT 行跳过规则分发)",
|
|
45
|
+
"子表数组、关联/人员字段形状、流程草稿走 `omc describe data.save --example workflow-backed-data-save`;正式数据一调完成态用 data.submit",
|
|
46
|
+
],
|
|
47
|
+
priorToolReferences: [
|
|
48
|
+
{ tool: "model.list", args: { environment }, purpose: "确认 schemaCode(models[].schemaCode)" },
|
|
49
|
+
{ tool: "field.list", args: { environment, schemaCode: model, published: true }, purpose: "确认 formData 里的字段 code 已发布" },
|
|
50
|
+
],
|
|
51
|
+
dryRun: { supported: true, command: `omc call data.save --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 只校验输入与治理;落库与读回要真写后才权威" },
|
|
52
|
+
expectedReadback: { performed: { bizObjectId: "<data.save.performed.bizObjectId>" }, readback: { authoritative: { sequenceStatus: "DRAFT" }, next: "data.load 核对字段值 / data.submit 提交为正式数据" } },
|
|
53
|
+
refusalRecovery: [
|
|
54
|
+
{ code: "save-update-target-absent", action: "formData.id 指向不存在的行——新建请省略 id" },
|
|
55
|
+
...commonRecovery,
|
|
56
|
+
],
|
|
57
|
+
requiresEnvironmentDerivedIds: false,
|
|
58
|
+
});
|
|
29
59
|
const plainSubmit = Object.freeze({
|
|
30
60
|
id: "plain-data-submit",
|
|
31
61
|
title: "无流程模型:新建并提交一调完成(COMPLETED,触发 Create 规则)——正式数据的标准路径",
|
|
@@ -167,7 +197,7 @@ const dataDeleteSweep = Object.freeze({
|
|
|
167
197
|
requiresEnvironmentDerivedIds: false,
|
|
168
198
|
});
|
|
169
199
|
export const RUNTIME_DATA_METADATA = Object.freeze({
|
|
170
|
-
"data.save": Object.freeze({ recipes: [workflowSave], relatedTools: ["workflow.get_published", "data.submit", "workitem.list", "data.update"] }),
|
|
200
|
+
"data.save": Object.freeze({ recipes: [workflowSave, basicDraftSave], relatedTools: ["workflow.get_published", "data.submit", "workitem.list", "data.update"] }),
|
|
171
201
|
"data.update": Object.freeze({ recipes: [childRowsUpsert], relatedTools: ["data.load", "data.save", "data.submit"] }),
|
|
172
202
|
"data.submit": Object.freeze({ recipes: [plainSubmit, workflowSubmit], relatedTools: ["data.save", "workitem.list", "data.load"] }),
|
|
173
203
|
"data.list": Object.freeze({ recipes: [dataListFilter, reportChartVerifyNumericRecipe], relatedTools: ["data.load", "data.delete", "listview.configure", "field.list"] }),
|
package/dist/write.js
CHANGED
|
@@ -169,8 +169,13 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
169
169
|
status: "refused",
|
|
170
170
|
blocker: `wire-${error.kind}`,
|
|
171
171
|
errcode: 300004,
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
// 探针 F(0.8.11):真机 2.1.5 上子表子 schema code = 父模型的
|
|
173
|
+
// CHILD_TABLE(8) 字段 code(`BizPropertyManagerImpl.java:197` 用
|
|
174
|
+
// `bizProperty.getCode()` 建子 schema),不是 `<model>_items`
|
|
175
|
+
// 约定名。先分叉再查 rulelog,否则 agent 会去翻不存在的规则。
|
|
176
|
+
message: `${error.message}——先分叉:① 若 schemaCode 是子表列,子表的子 schema code = 父模型的 CHILD_TABLE(8) 字段 code(不是 \`<model>_items\`),先 field.list 父模型找 type:8 字段的 code;② 若 modelPresent:true 且 form 已发布,这个 300004 大概率是业务规则节点运行时异常,不是模型缺失;先查 rulelog 的 EXCEPTION/ROLLBACK,再看最近改动的规则。`,
|
|
177
|
+
nextCommand: "omc call field.list --args '{\"schemaCode\":\"<父模型>\"}'",
|
|
178
|
+
nextAction: "在回执里找 type:8(CHILD_TABLE)字段的 code——父字段 code 就是子 schema code;用它对子列重试。确认不是子表问题后,再按 diagnostic 查 rulelog 的 EXCEPTION/ROLLBACK",
|
|
174
179
|
diagnostic: "omc call rulelog.search --args '{\"schemaCode\":\"<model>\",\"includeNodes\":true}';再用 rule.get 检查最近改动规则,隔离法是暂时删/禁规则后重试",
|
|
175
180
|
};
|
|
176
181
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.11",
|
|
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.11",
|
|
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.11"
|
|
80
80
|
}
|
|
81
81
|
}
|
package/skills/omc-refusals.md
CHANGED
|
@@ -75,6 +75,9 @@ Model present + form published yet submit says `300004 数据模型不存在`? O
|
|
|
75
75
|
rule-node exception in disguise (r44b): `rulelog.search {schemaCode,includeNodes:true}`
|
|
76
76
|
→ `EXCEPTION`/`ROLLBACK` nodes → `rule.get` the changed rule; disable/delete it to
|
|
77
77
|
isolate. Never recreate a healthy model.
|
|
78
|
+
Rule out the child-schema case first: a child column's `schemaCode` is the parent
|
|
79
|
+
model's CHILD_TABLE(8) **field code** (`items`, never `<model>_items`);
|
|
80
|
+
`field.list <父模型>` → `type:8` field's code. Then the rulelog branch below.
|
|
78
81
|
Line up the model's field-level config first: an `AGGREGATION` FORMULA field whose
|
|
79
82
|
`aggregation.schemaCode` points at a **child-table schema** publishes fine and then
|
|
80
83
|
makes every `data.submit`/`data.update` on that model 40000 (r18 2026-10-26 live;
|
|
@@ -45,7 +45,8 @@ capability's coverage/tools/boundaries from `omc-capabilities`.
|
|
|
45
45
|
|
|
46
46
|
1. 先在子表 schema 建快照标量列(如 `repairNoSnapshot` SHORT_TEXT)并发布。
|
|
47
47
|
2. 再建关联列,形状照抄配方 `omc describe field.create --example child-map-fill`:
|
|
48
|
-
`field.create {schemaCode:"
|
|
48
|
+
`field.create {schemaCode:"<子表父字段 code>", code:"refParent", propertyType:"WORK_SHEET", relativeCode:"<model>", options:{schemaCode:"<model>", queryCode:"<model>", displayField:"<父字段>", mappings:[{source:"<父字段>",target:"<快照列>"}]}}`。
|
|
49
|
+
子表子 schema code **就是父模型的 CHILD_TABLE(8) 字段 code**(父字段叫 `items` 就是 `items`,不是 `<model>_items`);`omc call field.list --args '{"schemaCode":"<父模型>"}'` 找 type:8 字段的 code。
|
|
49
50
|
3. `field.publish`(整模型一次)→ `field.get` 读回核对 `options.mappings`。
|
|
50
51
|
|
|
51
52
|
- **字段映射**的事实源是字段行 `options.mappings`(`source`=关联目标/父模型字段,`target`=本子表列,都是裸 code);改表单控件属性里的映射会被平台按字段重算覆盖。
|