@stalfh233/omc-cli 0.8.16 → 0.8.18

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.
@@ -258,6 +258,11 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
258
258
  childTableSubSchema: '{"code":"<父字段 code>","properties":[{"code","name","schemaCode":"<父字段 code>","propertyType","propertyEmpty","sortKey"}]}',
259
259
  childTableFormControl: "Sheet(201) with columns[{type,width,key,parentKey,options}]; child column keys never enter viewJson",
260
260
  dateDefaultOptions: JSON.stringify(FIELD_DATE_DEFAULT_OPTIONS),
261
+ dateFormat: JSON.stringify({
262
+ default: FIELD_DATE_DEFAULT_OPTIONS.format,
263
+ formats: FIELD_DATE_FORMATS_EVIDENCED,
264
+ valueSemantics: "DATE(3) options.format 逐字比较、区分大小写;Java 写法 yyyy-MM-dd 不在任何族(字段能建,首次运行时 save 报 50000)。这是跨版本并集(8.6 的 19 项 ⊂ 2.1.5/8.7/8.8 的 55 项),平台是最终门",
265
+ }, null, 2),
261
266
  formulaOptions: FIELD_FORMULA_WIRE.outerOptions,
262
267
  formulaConfig: FIELD_FORMULA_WIRE.innerConfig,
263
268
  formulaRuntimeVerification: FIELD_FORMULA_WIRE.runtimeVerification,
@@ -277,6 +282,7 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
277
282
  childTableSubSchema: Object.freeze([behaviorBinding("test/child-table.test.ts#field.create CHILD_TABLE sends a subSchema (not options) with parent-coded child columns", assertFieldContract)]),
278
283
  childTableFormControl: Object.freeze([behaviorBinding("test/child-table.test.ts#form.draft scaffolds a Sheet201 control with columns and keeps child keys out of viewJson", assertFieldContract)]),
279
284
  dateDefaultOptions: Object.freeze([emitterBinding("lanes/field-contract.FIELD_DATE_DEFAULT_OPTIONS", assertFieldContract)]),
285
+ dateFormat: Object.freeze([emitterBinding("lanes/field-contract.FIELD_DATE_FORMATS_EVIDENCED", assertFieldContract)]),
280
286
  formulaOptions: Object.freeze([behaviorBinding("test/formula-resultformat.test.ts#validateFormulaOptions accepts the fwb", assertFieldContract)]),
281
287
  formulaConfig: Object.freeze([behaviorBinding("test/field-families.test.ts#field.create FORMULA persists formulaConfig + persistent", assertFieldContract)]),
282
288
  formulaRuntimeVerification: Object.freeze([behaviorBinding("test/field-families.test.ts#field.create FORMULA ACCEPTS aggregation written as an EXPRESSION (form 计算控件 subtable SUM; UI+runtime-verified 2026-10-07)", assertFieldContract)]),
@@ -322,7 +328,7 @@ export const FIELD_LANE_CONTRACT = Object.freeze({
322
328
  "For single/multi-select pass `choices` (e.g. [\"A\",\"B\",\"C\"]) or `options.optionsSet` with optionsType custom/dictionary/businessModel; dictionary uses checkedDictionary/checkedDictionaryCode, businessModel uses schemaCode/sheetDataItem.",
323
329
  "For a relation pass `relativeCode` and `options` (schemaCode/displayField/...). `searchFormula` and `conditions` are JSON strings for the relation data restriction/query conditions.",
324
330
  "For a relation display field the tool writes the field-row top-level `relativePropertyCode` = options.displayField (the runtime reads THAT key, not options.displayField — QueryRuntimeController.java:1214-1226) and defaults options.displayFieldType:0 + displayFieldFormat:\"\".",
325
- "For FORMULA pass `options.formulaConfig` (nested JSON string) + `options.persistent:true`; for RELEVANCE_DATA pass `options.relevanceField` + `options.referenceField` + `options.referenceFieldPropertyType`. 数值字段的小数位写 `options.scale`;顶层 `precision` 不被读取,若误传请改为 `precision→options.scale(数值小数位)`。数值显示格式写 `options.format`(`ratio.percentile`=20.00%、`RMB.percentile`=¥2,000.00、`percentile`=2,000.00;**百分比存比值** 0.5→50.00%;别名 percent/currency 归一;全表见 contract 的 numericalFormat)。",
331
+ "For FORMULA pass `options.formulaConfig` (nested JSON string) + `options.persistent:true`; for RELEVANCE_DATA pass `options.relevanceField` + `options.referenceField` + `options.referenceFieldPropertyType`. 数值字段的小数位写 `options.scale`;顶层 `precision` 不被读取,若误传请改为 `precision→options.scale(数值小数位)`。数值显示格式写 `options.format`(`ratio.percentile`=20.00%、`RMB.percentile`=¥2,000.00、`percentile`=2,000.00;**百分比存比值** 0.5→50.00%;别名 percent/currency 归一;全表见 contract 的 numericalFormat);DATE 用日期枚举 `YYYY-MM-DD`/`YYYY-MM-DD HH:mm:ss`/`YYYY年MM月DD日`。",
326
332
  "org 选人族(STAFF_SELECTOR 等 5/50/51/60/61)字段行 options 由工具写成发布安全形状(形状与读面键见 contract field 的 orgSelectorFieldRowOptions)。deptVisible/multi 是**表单控件面**判别键(disposeUpdateType/updateSelectionType 读 control.options,票 69 已由表单脚手架写入控件面),不出现在字段行。",
327
333
  ]),
328
334
  }),
@@ -360,6 +366,9 @@ export function assertFieldContract() {
360
366
  throw new Error("field contract must carry the RELEVANCE_DATA referenceField wire facts");
361
367
  if (!String(FIELD_LANE_CONTRACT.wire.numericalFormat).includes("ratio.percentile") || !String(FIELD_LANE_CONTRACT.wire.numericalFormat).includes("0.5 renders 50.00%"))
362
368
  throw new Error("field contract must carry the NUMERICAL display-format enum and the ratio value semantics");
369
+ const dateFormatWire = String(FIELD_LANE_CONTRACT.wire.dateFormat);
370
+ if (FIELD_DATE_FORMATS_EVIDENCED.length !== 55 || !dateFormatWire.includes("YYYY-MM-DD HH:mm:ss") || !dateFormatWire.includes("YYYY年MM月DD日"))
371
+ throw new Error("field contract must carry the full 55-item DATE options.format enum (dateFormat)");
363
372
  if (!String(FIELD_LANE_CONTRACT.wire.controlEmissionPolicy).includes("BizPropertyType.java:27-54"))
364
373
  throw new Error("field contract must carry the ticket-101 control-emission policy with its enum evidence");
365
374
  if (!String(FIELD_LANE_CONTRACT.wire.fieldRowDefaultPolicy).includes("MUST-FIXED"))
@@ -133,6 +133,26 @@ async function readPublishedFieldFace(session, schemaCode) {
133
133
  throw error;
134
134
  }
135
135
  }
136
+ /**
137
+ * `field.list` 行级 published 的**回退**读面:只有平台行本身不带 `published`
138
+ * 键(老构建/VO 差异)时才走。失败不抛——行面已经读成功,发布面读不到只能
139
+ * 诚实回 "unknown" + 原因;把 `[]` 当「都没发布」正是探针 L F1 那类假 false
140
+ * (「读不到」被读成 false,agent 据此重复发布/重复建列)。
141
+ */
142
+ async function readPublishedFieldCodeSet(session, schemaCode) {
143
+ try {
144
+ const rows = wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode, isPublish: "true" } })).data);
145
+ const codes = rows.map((row) => String(row.code ?? row.propertyCode ?? "")).filter((code) => code !== "");
146
+ return { ok: true, codes: new Set(codes) };
147
+ }
148
+ catch (error) {
149
+ const kind = error instanceof WireError ? (error.errcode !== undefined ? `errcode ${error.errcode}` : error.kind) : "transport";
150
+ return {
151
+ ok: false,
152
+ reason: `本环境 bizproperty/list 行未回 published,读发布面也失败(${kind});published 记 unknown(不代表未发布),重跑本命令即可重试`,
153
+ };
154
+ }
155
+ }
136
156
  /** Semantic relation gate: the designer only offers published business fields. */
137
157
  async function assertRelationOptionsFields(session, schemaCode, propertyType, relativeCode, options, pendingOwnFields = []) {
138
158
  const type = typeof propertyType === "number" ? propertyType : FIELD_PROPERTY_TYPES[String(propertyType ?? "")];
@@ -605,16 +625,49 @@ export function registerFieldLane(tools) {
605
625
  inputSchema: { environment: environmentArg, schemaCode: z.string(), published: z.boolean().default(false), code: z.string().optional(), fields: z.array(z.string()).optional(), full: z.boolean().optional().describe("行内联完整 options/subSchema(含子表原始 subSchema);默认面只有 code/name/type(+conditions/shapeWarning),验证 options 用 code/fields 或 full:true;propertyEmpty 平台带回才输出(不回省略,不塞 false)"), all: z.boolean().optional().describe("默认只返业务字段(滤掉 13 个系统字段:id/name/sequenceNo/createdTime/…);true 连系统字段一起返"), capability: capabilityArg },
606
626
  handler: async (ctx, args, self) => governedRead(ctx, self, args, async (session) => {
607
627
  const rows = wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.schemaCode, isPublish: args.published ? "true" : "false" } })).data);
608
- // r61 a-F9(r60a-F9):draft 面此前不报字段的发布态,行级缺 published 键
609
- // 被读成「未发布」(null 三态歧义:未发布 vs 本面不返回)。多拉一次发布面
610
- // code 集做行级双面比对——agent 一次清单就能回答「这个字段发布了吗」,
611
- // 不必再跑 published:true 交叉核对。
612
- const publishedCodes = new Set(wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.schemaCode, isPublish: "true" } })).data)
613
- .map((row) => String(row.code ?? row.propertyCode)));
614
- // 券商 issue 1.4(cpdocs 2026-10-27)补充:双面比对已经拉过发布面,
615
- // 空清单时顺手数出「发布面有几个业务字段」——把 hint 从「三种可能」
616
- // 收敛成一句可执行的判定(有 N 个 → 加 published:true 就能看到)。
617
- const publishedBusinessCount = [...publishedCodes].filter((code) => !isSystemFieldCode(code)).length;
628
+ // 探针 L F1(0.8.17 真机):行级 `published` 曾是「另读一次发布面的 code 集」,
629
+ // 与本次行数据**不是同一快照**——发布提交在飞时行先回来、发布面还没提交,
630
+ // 回执给出 published:false + publishedNote「双面比对」,agent 据此重复发布。
631
+ // 平台 VO 本来每行就带发布标记(同一次读的真值):
632
+ // - 2.1.5 `cloudpivot-metadata-AI-Platform-v2.1.5/.../BizPropertyFacadeImpl.java:253-264`
633
+ // `getListBySchemaCodeAndPublished`:isPublish=true → getPublishedPropertyList(),
634
+ // 否则 getAllPropertyList()(**全量**,含已发布;只按 isPublished 过滤的是发布面)。
635
+ // - 8.6.26 `.../cloudpivot-metadata-8.6.26/.../BizPropertyFacadeImpl.java:242-253` 同构。
636
+ // - 行列上的 `published` 由 BizProperty.published 复制而来
637
+ // (2.1.5 BizPropertyModel.java:334/367、8.6.26 :325;getPublished 默认 FALSE),
638
+ // `/bizproperty/list` 每行都序列化该键(2.1.5 + 8.6.26 真机回执逐行为证)。
639
+ // 于是:优先用**同一行**的标记;仅当键缺席(老构建/VO 差异)才回退读发布面
640
+ // 一次;仍读不到就回 "unknown" + 原因——绝不把「读不到」伪装成 false。
641
+ const platformPublished = new Map();
642
+ for (const row of rows) {
643
+ const code = String(row.code ?? row.propertyCode ?? "");
644
+ if (code !== "" && typeof row.published === "boolean")
645
+ platformPublished.set(code, row.published);
646
+ }
647
+ const fallbackNeeded = args.published !== true
648
+ && rows.some((row) => typeof row.published !== "boolean");
649
+ const publishedFallback = fallbackNeeded ? await readPublishedFieldCodeSet(session, args.schemaCode) : undefined;
650
+ /** 行级发布态:true/false 为真值,"unknown" 只在两条读面都给不出时出现。 */
651
+ const publishedOf = (code) => {
652
+ const direct = platformPublished.get(code);
653
+ if (direct !== undefined)
654
+ return direct;
655
+ // 发布面查询:返回的行本身就在发布面上,存在即已发布。
656
+ if (args.published === true)
657
+ return true;
658
+ if (publishedFallback !== undefined && publishedFallback.ok)
659
+ return publishedFallback.codes.has(code);
660
+ return "unknown";
661
+ };
662
+ let publishedUnknownReason = publishedFallback !== undefined && !publishedFallback.ok ? publishedFallback.reason : undefined;
663
+ // 券商 issue 1.4(cpdocs 2026-10-27)补充:空清单时数出「当前面里有几个业务
664
+ // 字段是已发布的」——把 hint 从「三种可能」收敛成一句可执行的判定。
665
+ // 真机语义下 draft 面含已发布行,计数直接来自行标记;只有当前面一个已发布
666
+ // 业务字段都没数到(空清单)时才补一次有界读(只为 hint 的可执行判定)。
667
+ let publishedBusinessCount = rows.filter((row) => {
668
+ const code = String(row.code ?? row.propertyCode ?? "");
669
+ return !isSystemFieldCode(code) && publishedOf(code) === true;
670
+ }).length;
618
671
  const mapped = rows.map((row) => {
619
672
  const type = Number(row.type ?? row.propertyType);
620
673
  const typeLabel = fieldTypeLabel(row.type ?? row.propertyType);
@@ -629,9 +682,10 @@ export function registerFieldLane(tools) {
629
682
  // #40-8:平台带回的字段时间戳逐行透传(键存在才给)。
630
683
  ...pickFieldTimestamps(row),
631
684
  name: row.name,
632
- // r61 a-F9:行级发布态(双面比对)——true=已出现在发布面;false=仅草稿。
685
+ // 行级发布态:true=已出现在发布面;false=仅草稿;"unknown"=平台未回行标记
686
+ // 且发布面读不到(见 publishedUnknownReason,不是未发布)。
633
687
  // 面级 `face` 是查询面选择器,与此行级键不同义。
634
- published: publishedCodes.has(String(fieldCode)),
688
+ published: publishedOf(String(fieldCode)),
635
689
  ...(redundantNameI18n(row.name_i18n, row.name) ? {} : typeof row.name_i18n === "string" ? { name_i18n: row.name_i18n } : {}),
636
690
  type: row.type ?? row.propertyType,
637
691
  ...(typeLabel !== undefined ? { typeName: typeLabel } : {}),
@@ -726,14 +780,27 @@ export function registerFieldLane(tools) {
726
780
  : {}),
727
781
  };
728
782
  });
783
+ // issue 1.4 的 hint 要靠「发布面有几个业务字段」才能给可执行判定;只在
784
+ // 空清单且当前面一个已发布业务字段都没数到时补读一次(有界;非选择器面)。
785
+ if (!detailed && projected.length === 0 && args.published !== true && publishedBusinessCount === 0 && publishedFallback === undefined) {
786
+ const face = await readPublishedFieldCodeSet(session, args.schemaCode);
787
+ if (face.ok)
788
+ publishedBusinessCount = [...face.codes].filter((code) => !isSystemFieldCode(code)).length;
789
+ else
790
+ publishedUnknownReason = face.reason;
791
+ }
729
792
  return {
730
793
  schemaCode: args.schemaCode,
731
794
  // r45: 这是"本次查询的面选择器"回显(draft/published),不是字段发布状态——
732
795
  // 曾被误读为"字段未发布"。改名 face 消歧义;要查发布态用 field.publish 回读或详情面。
733
796
  face: args.published === true ? "published" : "draft",
734
- // r61 a-F9:行级 `published`(true/false)是双面比对出的**字段发布态**;
797
+ // 探针 L F1:行级 `published` 是**字段发布态**(true/false),取自平台该行的
798
+ // 发布标记(与行同一次读);"unknown"=平台未回标记且发布面也读不到,不是未发布。
735
799
  // `face` 只是本次查询的面选择器——两键不同义,别再拿 face 推断发布态。
736
- publishedNote: "行级 published=该字段是否已出现在发布面(双面比对);face=本次查询面(draft/published),不是字段发布态",
800
+ publishedNote: "行级 published:draft 面取自该行发布标记(与本行同一次读);published 面按面归属(出现在该面即 true);'unknown'=行无标记且发布面读不到(见 publishedUnknownReason),不是 false;face 只是查询面",
801
+ // 只有「行没带标记 + 回退读发布面也失败」才出现:明确说不可得,别让
802
+ // agent 把 false/空当结论(探针 L F1 的假 false 正是这么误导的)。
803
+ ...(publishedUnknownReason !== undefined ? { publishedUnknownReason } : {}),
737
804
  // 线上 #40 第 8 条:平台列表面不带时间戳时如实说「本环境没有」,
738
805
  // 别让 agent 以为「没显示=可再查一层」而反复试错。
739
806
  ...(mapped.some((field) => FIELD_TIMESTAMP_KEYS.some((key) => Object.prototype.hasOwnProperty.call(field, key)))
@@ -753,11 +820,13 @@ export function registerFieldLane(tools) {
753
820
  : {
754
821
  inventory: true,
755
822
  hint: projected.length === 0
756
- ? args.published === true
757
- ? "发布面没有业务字段——可能尚未发布(先 published:false 看草稿面)、尚未创建,或只有系统字段(all:true 核对)。字段详情(options/subSchema)用 code/fields 选择器或 full:true"
758
- : publishedBusinessCount > 0
759
- ? `字段详情(options/subSchema)用 code/fields 选择器或 full:true。当前 draft 面没有业务字段,但发布面有 ${publishedBusinessCount} 个业务字段——加 published:true 查看`
760
- : "字段详情(options/subSchema)用 code/fields 选择器或 full:true。当前 draft 面没有业务字段——字段可能都在 published 面(published:true)、尚未创建,或只有系统字段(all:true 核对)"
823
+ ? publishedUnknownReason !== undefined
824
+ ? "字段详情(options/subSchema)用 code/fields 选择器或 full:true。发布态不可得(见 publishedUnknownReason)——不是「都没发布」;重跑本命令即可重试"
825
+ : args.published === true
826
+ ? "发布面没有业务字段——可能尚未发布(先 published:false 看草稿面)、尚未创建,或只有系统字段(all:true 核对)。字段详情(options/subSchema)用 code/fields 选择器或 full:true"
827
+ : publishedBusinessCount > 0
828
+ ? `字段详情(options/subSchema)用 code/fields 选择器或 full:true。当前 draft 面没有业务字段,但发布面有 ${publishedBusinessCount} 个业务字段——加 published:true 查看`
829
+ : "字段详情(options/subSchema)用 code/fields 选择器或 full:true。当前 draft 面没有业务字段——字段可能都在 published 面(published:true)、尚未创建,或只有系统字段(all:true 核对)"
761
830
  : "字段详情(options/subSchema)用 code/fields 选择器或 full:true",
762
831
  }),
763
832
  };
@@ -862,6 +931,9 @@ export function registerFieldLane(tools) {
862
931
  tools,
863
932
  name: "field.create",
864
933
  search: { intents: ["加字段", "新增字段", "添加字段", "加一个字段", "单据号字段", "序列号字段", "编号规则字段", "百分比字段", "占比字段", "百分号显示"] },
934
+ nestedParamHints: {
935
+ format: "NUMERICAL 用平台常量(全表见 contract 的 numericalFormat;**百分比存比值** 0.5→50.00%);DATE 用日期枚举(`YYYY-MM-DD` / `YYYY-MM-DD HH:mm:ss` / `YYYY年MM月DD日`,共 55 项、区分大小写;全表见 contract 的 dateFormat),不是数值常量。",
936
+ },
865
937
  lane: FIELD_LANE,
866
938
  scope: FIELD_TOOLS["field.create"].scope,
867
939
  description: FIELD_TOOLS["field.create"].description,
@@ -2029,12 +2101,17 @@ async function formBindingAdvisory(session, schemaCode, publishedRows) {
2029
2101
  const fix = missingChildColumns.length > 0
2030
2102
  ? { schemaCode, ...(missingTopLevel.length > 0 ? { fieldCodes: missingTopLevel } : {}), childColumns: missingChildColumns }
2031
2103
  : { schemaCode, fieldCodes: missingTopLevel, rebuild: true };
2104
+ // F5(探针 K):两个写回执各报一条同义告警时,不要给同一条命令。子表列专用
2105
+ // form.publish 的一步绑定参数(field.publish 自身不改表单布局)。
2106
+ const nextCommand = missingChildColumns.length > 0 && missingTopLevel.length === 0
2107
+ ? `omc call form.publish --args '${JSON.stringify({ schemaCode, bindNewChildColumns: true })}'`
2108
+ : `omc call configure_form --args '${JSON.stringify(fix)}'`;
2032
2109
  return {
2033
2110
  formPresent: true,
2034
2111
  ...(missingTopLevel.length > 0 ? { notInFormLayout: missingTopLevel } : {}),
2035
2112
  ...(missingChildColumns.length > 0 ? { childColumnsNotInForm: missingChildColumns } : {}),
2036
- note: "字段已发布但**表单布局里没有**,业务页面看不到。子表列用 childColumns 增量绑进 Sheet201(不动其它控件);顶层缺字段用 rebuild:true(会重建布局)",
2037
- nextCommand: `omc call configure_form --args '${JSON.stringify(fix)}'`,
2113
+ note: "字段已发布但**表单布局里没有**,业务页面看不到。子表列用 form.publish {bindNewChildColumns:true}(或 configure_form childColumns)增量绑进 Sheet201,不动其它控件;顶层缺字段用 rebuild:true(会重建布局)",
2114
+ nextCommand,
2038
2115
  ...extras,
2039
2116
  };
2040
2117
  }
@@ -19,7 +19,7 @@ export const FORM_WIRE = Object.freeze({
19
19
  actionsColumns: "ticket 100: draftActionsJson/publishedActionsJson are REAL bizsheet columns (BizForm.java:95-100 @SerializableField; BizFormModel.java:59-62 serialized by bizsheet/get) — the designer writes draftActionsJson on save and both faces on publish (frontend-dist/admin/js/4280.cfa75764.js offsets 193538/185347); form.get full:true surfaces them; publish promotes draftActionsJson → publishedActionsJson",
20
20
  sheetListFace: "form.list: GET /api/api/app/bizsheet/list?schemaCode= (BizFormController.java:137-152 → ModelManagementFacadeImpl.getBizForms:481-488) answers the BizFormHeaderModel HEADER projection only — code, name, schemaCode, published, formType, sortKey, icon. formType is the INTEGER index (@JsonValue getIndex(), BizFormType.java:45-48): 0 DEFAULT_SHEET / 1 CUSTOMIZE_SHEET / 2 PRINT_TEMPLATE — decoded to the name with formTypeIndex kept (ADR 0002). existDraft/buttonCount/hasCustomScript are NOT on this face, so the default read never fabricates them: detail:true pays 1+N bizsheet/get for the content-derived faces. published is the same platform flag bit (r79-04): publish→draft leaves it false while the content is intact — the flag is reported as-is, content judgement needs detail:true. HTTP 404 means the version family has no /list endpoint: the tool answers sheetListUnavailable:true + the default slot only, never a fabricated list; a 601003 业务模型不存在 refusal is modelPresent:false (zero retries)",
21
21
  });
22
- const FORM_GET_DESCRIPTION = '读取默认表单(bizsheet/get)的发布状态与控件清单(紧凑默认)。**发布态以返回的 `published` / `existDraft` 布尔为准**(`published:true`=已发布;`published:false,existDraft:true`=只有草稿,**未发布**)——不要用 `publishedControlCodes` 是否非空来推断(草稿字段会让它非空,误判为已发布)。**每个模型交付前其默认表单必须 `published:true`**:用 `configure_form` 或 `form.draft(rebuild:true)`+`form.publish` 发布,并逐模型 `form.get` 核对。`full:true` 还返回 `options` 与 `customButtonJson`(表单工具栏按钮,数组原样;库里是字符串脏形时附 `customButtonJsonShapeWarning`——线上 #38 前端按钮不渲染)。传 `controls:["code",…]` 只取指定控件的 options(如关联控件的 mappings);传 `full:true` 才返回 draft/published 的完整 view/attributes/html/actions JSON(actions 列为设计器保存/发布的表单级按钮动作)。体积大,仅在需要整体布局时用。';
22
+ const FORM_GET_DESCRIPTION = '读取默认表单(bizsheet/get)的发布状态与控件清单(紧凑默认)。**`published`/`existDraft` 是内容面结论**(`published:true`=已发布;`published:false,existDraft:true`=只有草稿,**未发布**);平台 `bizsheet/get` 标记位见 `platformFlags`。`form.list` 的 `published` 仍为平台旗标,两者语义不同。不要用 `publishedControlCodes` 是否非空来推断(草稿字段会让它非空,误判为已发布)。**每个模型交付前其默认表单必须 `published:true`**:用 `configure_form` 或 `form.draft(rebuild:true)`+`form.publish` 发布,并逐模型 `form.get` 核对。`full:true` 还返回 `options` 与 `customButtonJson`(表单工具栏按钮,数组原样;库里是字符串脏形时附 `customButtonJsonShapeWarning`——线上 #38 前端按钮不渲染)。传 `controls:["code",…]` 只取指定控件的 options(如关联控件的 mappings);传 `full:true` 才返回 draft/published 的完整 view/attributes/html/actions JSON(actions 列为设计器保存/发布的表单级按钮动作)。体积大,仅在需要整体布局时用。';
23
23
  const FORM_DRAFT_DESCRIPTION = "Save the default-form DRAFT (bizsheet/update). Reads the current sheet, merges the caller's explicit draftViewJson/draftAttributesJson (or preserves the existing draft); when both are absent on a fresh default form, composes the designer-standard scaffold from the model's published fields. A redundant field (relation-mapping carry-through target) always stays bound; with no workflow it is hidden in the design (options.visible=false), with a workflow it stays visible for per-node propertyPermissions. Pass `draftHtmlJson` to thread custom online-script HTML through. Empty-layout guard: explicitly passing \"[]\"/\"{}\" view/attributes is refused (form-empty-layout) — the platform designer's Save is NOT lossless and clears drafts to exactly that shape; escape with allowEmptyLayout:true, and recover cleared drafts from the form version history (/api/api/app/bizsheet/history/list). **读回原样回写**:从 `form.get` 取回的 view/attributes 直接回传时加 `fromReadback:true`——工具会与已存草稿/发布面逐字比对,一致才放行(平台自身布局可能含子表列行/系统行默认宽度),被改动过的面照常按 validation 拒绝。**表单工具栏按钮**:`buttons`(数组)或 `customButtonJson`(原样字符串)写进 `biz_sheet.options.customButtonJson`(**数组+actionConfig 对象**,设计器同形——线上 #38:字符串形=双重编码,前端按钮不渲染,重写即自愈);**要到 form.publish 才生成 h_biz_button(triggerType=FORM)**,且表单页是否显示还取决于流程节点 `buttonPermission.customBtns[].enabled`(设计器「表单操作」勾选)。`useLocation` 用 FORM/ROW/LIST,表单工具栏按钮用 FORM。字段发布后如需刷新已发布表单的控件映射,用本工具 rebuild:false 重存(保留现有布局与在线JS)再 form.publish。**改既有表单勿整表重写**:先 `form.get full:true` 取 `publishedAttributesJson` 作基线、只改 rows/span;只写业务字段会丢系统控件并撞 form-publish-degrade。";
24
24
  const FORM_PUBLISH_DESCRIPTION = "Publish the default form (bizsheet/publish, proven shape: draft*Json promoted to published*Json verbatim) with published-face readback. **不影响在线 JS**:本工具只提拔布局草稿;改 JS 请用 onlinejs.compose(它自己会连同整张表单一起发布,不必再调本工具)。 Degrade guard: refuses to promote a draft carrying FEWER controls than the published face (form-publish-degrade) — the designer's Save clears drafts non-losslessly; recover via the form version history (/api/api/app/bizsheet/history/list) and rewrite the draft first, or pass allowDegrade:true to force the reduction. rebuild:true is the one-call refresh: discard the existing draft, re-scaffold from the published fields (non-structural control options preserved), then force-promote — use it after a field shape change. **表单工具栏按钮**:传 `buttons`(或 `customButtonJson`)→ 写进 `options.customButtonJson` 并在本次 publish 生成 `h_biz_button(triggerType=FORM, triggerCode=<formCode>)`(平台 `publishBizForm:1022`);`options.customButtonJson` 以**数组**写入(条目 `actionConfig` 为对象,设计器同形——线上 #38:字符串形=双重编码,前端按钮不渲染,回执给 formButtonsShapeWarning);表单页是否显示再由流程节点 `buttonPermission.customBtns[].enabled` 过滤。";
25
25
  const FORM_RUN_BUTTON_DESCRIPTION = "执行表单工具栏按钮(平台同款面:`POST /api/api/runtime/form/executeCustomButton`,body `{bizButtonModel, bizObjectList:[<完整业务对象>], reacquireDataFromDb:true}`)。**与列表行按钮不同**:列表按钮发 `launcher/domain_service_runtime/<schema>/<rule>` + `ids[]`(用 `rule.run`),表单按钮带**整条记录**,不能互换。按钮来源 `GET /api/api/system/getCustomButtons`(只列 triggerType=FORM 的 h_biz_button)。前提:按钮已由 `form.publish` 的 `buttons`/`customButtonJson` 生成。返回是执行结果信封,规则副作用用 `data.load` 另读;被规则 UPDATE 的目标行须是 COMPLETED(引擎查不到 DRAFT)。`302045` = 数据被占用。**`10005` 换等价面 `rule.run`(见 contract form),勿反复重试。**";
@@ -200,8 +200,13 @@ export function registerFormLane(tools) {
200
200
  schemaCode: args.schemaCode,
201
201
  sheetCode,
202
202
  present: true,
203
- published: platformPublished,
204
- existDraft: platformDraft,
203
+ // 探针 L F7(0.8.18,真机):顶层 published:true + existDraft:false 与
204
+ // faces.published.present:true 并列,读者要自己发现 flagMismatch。顶层两个
205
+ // 布尔改为**faces 内容面的规范化结论**(与 effectiveFace 同源);平台
206
+ // bizsheet/get 标记位原样保留在 platformFlags 供排查,平台原文不丢。
207
+ published: publishedPresent,
208
+ existDraft: draftPresent,
209
+ platformFlags: { published: platformPublished, existDraft: platformDraft },
205
210
  effectiveFace: faceVerdict.effectiveFace,
206
211
  effectiveFaceNote: faceVerdict.effectiveFaceNote,
207
212
  faces: {
@@ -213,8 +218,7 @@ export function registerFormLane(tools) {
213
218
  ...(flagMismatch
214
219
  ? {
215
220
  flagMismatch: true,
216
- flagNote: "平台布尔与内容不一致:published/existDraft 来自 bizsheet/get 的标记位,faces 由 draft/published 的 view/attributes/html/actions 四份布局面内容规范化比较推导。判「现在有几面」以 faces 为准;判「能否被运行时读到」以 published 为准(平台可能未刷新标记)。" +
217
- FORM_FLAG_AUTHORITY_NOTE,
221
+ flagNote: "平台布尔与内容不一致:顶层 published/existDraft 已按 faces 内容面结论给出(内容优先);platformFlags 保留 bizsheet/get 原始标记位供排查(会滞后)。以 faces/effectiveFace 为准:published*Json 内容才是运行时面,旗标不拿来做结论。",
218
222
  }
219
223
  : {}),
220
224
  };
@@ -334,7 +338,9 @@ export function registerFormLane(tools) {
334
338
  // 原样保留 → 外置了也没省体积。超过 4KB 的单串改为 `*Omitted` + 字节数,
335
339
  // 正文用 `artifact get <detailArtifactId> --jq draftViewJson` 定向取回。
336
340
  compact: (result) => {
337
- const KEEP = new Set(["draftControls", "publishedControls", "customButtonJson", "options", "formButtons", "formButtonCodes"]);
341
+ // 探针 L F7:platformFlags 只有两个布尔,compact 若不保留会被压成
342
+ // `platformFlagsCount:2`,平台原文恰好在降载时丢失。
343
+ const KEEP = new Set(["draftControls", "publishedControls", "customButtonJson", "options", "formButtons", "formButtonCodes", "platformFlags"]);
338
344
  // r28e F4 暴露的潜在 bug:handler 已经交过 `*Codes`/`*Count`/`*Omitted`
339
345
  // 这类**已压缩**的键,若再走数组分支会被二次加后缀
340
346
  // (`publishedControlCodes` → `publishedControlCodesCodes`),字段直接消失。
@@ -671,6 +677,7 @@ export function registerFormLane(tools) {
671
677
  // 实测 form.draft 改布局后直接 form.publish **不带 force 也正常提拔**
672
678
  // (errcode 0 / published true)。误导会让人多传一个没必要的护栏。
673
679
  force: z.boolean().optional().describe("仅在回执 already-published(同一份草稿重复发布被短路)且你确认要重推时使用;正常流程(改草稿→publish)不需要它"),
680
+ bindNewChildColumns: z.boolean().optional().describe("true=发布前先把已发布但不在表单 Sheet201 columns 里的子表列增量绑定(同 configure_form childColumns),再一次发布;默认 false 只告警"),
674
681
  allowDegrade: z.boolean().optional().describe("显式放行降级提拔(草稿控件数 < 已发布面);默认拒绝(form-publish-degrade),防把空/残草稿提拔成发布版"),
675
682
  rebuild: z
676
683
  .boolean()
@@ -694,6 +701,7 @@ export function registerFormLane(tools) {
694
701
  sheetCode: resolveSheetCode(args.schemaCode, args.sheetCode),
695
702
  ...(args.allowDegrade !== undefined ? { allowDegrade: args.allowDegrade } : {}),
696
703
  ...(args.rebuild !== undefined ? { rebuild: args.rebuild } : {}),
704
+ ...(args.bindNewChildColumns !== undefined ? { bindNewChildColumns: args.bindNewChildColumns } : {}),
697
705
  ...(args.force !== undefined ? { force: args.force } : {}),
698
706
  }),
699
707
  lintScope: "partial",
@@ -843,11 +843,11 @@ export function registerListViewLane(tools) {
843
843
  inputSchema: {
844
844
  schemaCode: z.string().min(1),
845
845
  code: z.string().optional(),
846
- fieldCodes: z.array(z.string()).min(1).optional().describe("要展示的字段:可给 propertyCode 或字段显示名(唯一匹配时自动解析,歧义或不存在则拒绝,不静默跳过)。**省略 = 不动列**(只改排序/筛选/动作时可省)"),
846
+ fieldCodes: z.array(z.string()).min(1).optional().describe("要展示的字段:可给 propertyCode 或字段显示名(唯一匹配时自动解析,歧义或不存在则拒绝,不静默跳过)。**省略 = 不动列**(只改排序/筛选/动作时可省)。**默认增量**:不传 replaceColumns+hideDefaultSystemFields 会保留平台既有系统列(默认视图 4 个)→ 点名 4 列实际 8 列;要精确列集合两者都传(--dry-run 看 columnBehavior)"),
847
847
  hideDefaultSystemFields: z.boolean().optional().describe("是否隐藏平台默认系统列(createdTime/creater/name/sequenceNo 等);平台 update 按提交列集合决定,不能靠 visible:false"),
848
848
  replaceColumns: z.boolean().optional().describe("把 fieldCodes 当作列集合的权威全集:未列出的已有列(含系统列)全部移除,最终列 = fieldCodes(按给定顺序)。**必须同时给 fieldCodes**,只传 replaceColumns 会被拒(listview-fieldcodes-required-for-replace)。默认 false 为增量(保留已有列,省略 fieldCodes 时列完全不动)。系统列与业务列一视同仁——想要 createdTime/sequenceNo 就把它写进 fieldCodes"),
849
849
  sorts: z.array(listViewSortArg).optional().describe("querySorts; omitted leaves the existing sorts untouched, provided replaces them。成员键:propertyCode + direction(ASC/DESC),其余可省"),
850
- conditions: z.array(listViewConditionArg).optional().describe("queryConditions; omitted leaves the existing conditions untouched, provided replaces them(2.1.5 树视图三键原样带回;值变化默认拒 listview-tree-conditions-changed)"),
850
+ conditions: z.array(listViewConditionArg).optional().describe("queryConditions; omitted leaves the existing conditions untouched, provided replaces them(2.1.5 树视图三键原样带回;值变化默认拒 listview-tree-conditions-changed)。最小行:--example configure-conditions"),
851
851
  allowTreeConditionChange: z.boolean().optional().describe("仅当确认要改写树过滤组时传 true:允许提交值与基线的 treeLimitScopeType/treeLimitConditionGroup/treeDefaultConditionGroup 不同(新值原样写入);默认 false 时值不同即拒 listview-tree-conditions-changed。本参数只放行值差异,不放行缺键——基线有值而提交行没带仍拒 listview-tree-conditions-would-be-lost。"),
852
852
  actions: z.array(listViewActionArg).optional().describe("queryActions; omitted leaves the existing actions untouched, provided MERGES into the effective set by actionCode (existing platform defaults like 新增/删除/导入/导出 are preserved, a matching actionCode is updated). Use replaceActions:true for the authoritative full set"),
853
853
  replaceActions: z.boolean().optional().describe("把 actions 当作权威全集:未列出的已有动作(含平台内置的 add/删除/导入/导出/修改拥有者)全部移除。默认 false 为合并(保留内置动作,按 actionCode 更新/追加)"),
@@ -1232,8 +1232,37 @@ export function registerListViewLane(tools) {
1232
1232
  .filter((columnCode) => columnCode.length > 0 && SYSTEM_FIELD_CODES.has(columnCode) && !requestedCodes.has(columnCode))),
1233
1233
  ];
1234
1234
  if (systemColumnsAdded.length > 0) {
1235
+ // F2(0.8.18 探针 L):提示要能直接抄——把本次请求列原样写成权威列集合。
1236
+ // 调用方显式要了系统列时不能加 hideDefaultSystemFields,否则那条列又会被滤掉,
1237
+ // 提示里也不能再无条件建议 hide。
1238
+ const requestedSystemCodes = [...requestedCodes].filter((requestedCode) => SYSTEM_FIELD_CODES.has(requestedCode));
1239
+ const preciseHint = requestedSystemCodes.length === 0
1240
+ ? `要精确 ${requestedCodes.size} 列请同时传 replaceColumns:true + hideDefaultSystemFields:true(系统列与业务列一视同仁,想保留哪个就写进 fieldCodes)`
1241
+ : `要精确 ${requestedCodes.size} 列请照抄 nextCommand(它用 replaceColumns 保留你点名的系统列 ${requestedSystemCodes.join("、")},不要再加 hideDefaultSystemFields)`;
1235
1242
  readback.systemColumnsAdded = systemColumnsAdded;
1236
- readback.systemColumnsNote = `平台额外保留系统列 ${systemColumnsAdded.join("、")};要精确 ${requestedCodes.size} 列请同时传 replaceColumns:true + hideDefaultSystemFields:true(系统列与业务列一视同仁,想保留哪个就写进 fieldCodes)`;
1243
+ readback.systemColumnsNote = `平台额外保留系统列 ${systemColumnsAdded.join("、")};${preciseHint}`;
1244
+ const exactArgs = {
1245
+ schemaCode: args.schemaCode,
1246
+ code,
1247
+ fieldCodes: [...requestedCodes],
1248
+ replaceColumns: true,
1249
+ ...(requestedSystemCodes.length === 0 ? { hideDefaultSystemFields: true } : {}),
1250
+ };
1251
+ readback.systemColumnsExactArgs = exactArgs;
1252
+ readback.nextCommand = `omc call listview.configure --env <env> --args '${JSON.stringify(exactArgs)}'`;
1253
+ }
1254
+ }
1255
+ // F2(0.8.18 探针 L 复核):hideDefaultSystemFields 会把调用方**点名**的系统列
1256
+ // 一并滤掉(平台按提交列集合保存,visible:false 无效)。写后必须点名被移除的列,
1257
+ // 不能因为 systemColumnsAdded 为空就当作一切正常。
1258
+ if (fieldRefs !== undefined && args.hideDefaultSystemFields === true) {
1259
+ const requestedSystemCodes = [
1260
+ ...new Set(fieldRefs.map((ref) => resolveFieldRef(fieldRows, ref)?.code ?? ref)),
1261
+ ].filter((requestedCode) => SYSTEM_FIELD_CODES.has(requestedCode));
1262
+ const hiddenRequested = requestedSystemCodes.filter((requestedCode) => !afterCols.some((column) => String(column.propertyCode ?? "") === requestedCode));
1263
+ if (hiddenRequested.length > 0) {
1264
+ readback.hiddenRequestedSystemColumns = hiddenRequested;
1265
+ readback.hiddenRequestedSystemColumnsNote = `hideDefaultSystemFields:true 移除了你点名的系统列 ${hiddenRequested.join("、")}(平台按提交列集合保存,visible:false 无效);要保留请去掉该参数,或传 replaceColumns:true 且不要 hideDefaultSystemFields`;
1237
1266
  }
1238
1267
  }
1239
1268
  // r35(2026-10-31 真机):视图固定条件读回正确,但 `data.list --queryCode <视图>`
@@ -1260,6 +1289,11 @@ export function registerListViewLane(tools) {
1260
1289
  readback.conditionVerification = {
1261
1290
  configFace: "配置面验收:listview.get 回读 conditions(propertyCode/filterType/defaultValue);本次提交了 conditions 时 conditionReadback 已比对",
1262
1291
  command: `omc call listview.get --env <env> --args '${JSON.stringify({ schemaCode: args.schemaCode, code })}'`,
1292
+ // F10(0.8.17 探针 K):验收口径集中一处写明,别让探针去找不存在的
1293
+ // REST 运行面验证入口。配置面 = conditionReadback.equivalent;运行面
1294
+ // 只有门户点验,平台没有 REST 入口。
1295
+ acceptance: "配置面验收 = conditionReadback.equivalent;运行面 = 门户点验(REST 无入口)",
1296
+ portalCheck: `需人工在门户打开视图 ${code}(模型 ${args.schemaCode}),按固定条件筛选一次并核对返回行——平台不提供 REST 运行面验证入口,本工具不提供假验证`,
1263
1297
  runtimeRunnable: false,
1264
1298
  runtimeNote: "视图固定条件只在门户运行时生效;平台没有 REST 验证入口(REST data.list --queryCode 不应用固定条件)。不要用 data.list --queryCode 断言过滤生效。",
1265
1299
  ...(dataListOp !== undefined
@@ -1484,12 +1518,87 @@ export function registerListViewLane(tools) {
1484
1518
  };
1485
1519
  }
1486
1520
  const normalizedFieldCodes = fieldRefs.map((ref) => resolveFieldRef(fieldRows, ref)?.code ?? ref);
1521
+ const requestedSet = new Set(normalizedFieldCodes);
1522
+ const requestedSystemCodes = normalizedFieldCodes.filter((columnCode) => SYSTEM_FIELD_CODES.has(columnCode));
1523
+ const replace = args.replaceColumns === true;
1524
+ const hide = args.hideDefaultSystemFields === true;
1525
+ // F2(0.8.18 探针 L):写前就把「平台既有系统列会保留」说清楚。增量模式下
1526
+ // 最终列 = 基线列 ∪ fieldCodes,所以必须先读基线视图;replaceColumns 的
1527
+ // 最终列只由 fieldCodes 决定,无需读视图。
1528
+ let baselineKnown = true;
1529
+ let projectedCodes;
1530
+ let baselineBusinessColumnsRetained = 0;
1531
+ if (replace) {
1532
+ const uniqueFieldCodes = [...new Set(normalizedFieldCodes)];
1533
+ projectedCodes = hide ? uniqueFieldCodes.filter((columnCode) => !SYSTEM_FIELD_CODES.has(columnCode)) : uniqueFieldCodes;
1534
+ }
1535
+ else {
1536
+ let baselineModel = {};
1537
+ try {
1538
+ const baseline = await wireCall(session, { path: ENDPOINTS.listQueryGet, query: { schemaCode: args.schemaCode, code, clientType: "PC" } });
1539
+ baselineModel = (baseline.data ?? {});
1540
+ }
1541
+ catch (error) {
1542
+ // 视图不存在时真写会以 302025 拒绝;dry-run 不应因为「读基线」先换一种失败。
1543
+ if (!(error instanceof WireError && error.kind === "business"))
1544
+ throw error;
1545
+ }
1546
+ baselineKnown = Boolean(baselineModel.id);
1547
+ const baselineCodes = baselineKnown
1548
+ ? readArray(baselineModel, "queryColumns")
1549
+ .map((column) => String(column.propertyCode ?? ""))
1550
+ .filter((columnCode) => columnCode.length > 0)
1551
+ : [];
1552
+ baselineBusinessColumnsRetained = baselineCodes.filter((columnCode) => !SYSTEM_FIELD_CODES.has(columnCode) && !requestedSet.has(columnCode)).length;
1553
+ projectedCodes = [...new Set([...baselineCodes, ...normalizedFieldCodes])].filter((columnCode) => !hide || !SYSTEM_FIELD_CODES.has(columnCode));
1554
+ }
1555
+ // 必须基于 hide 过滤后的 projectedCodes:hide 为 true 时系统列已被移除,
1556
+ // 不能再报「保留」。这样 fieldCodes + 基线业务 + 系统 = expectedColumnCount。
1557
+ const systemColumnsRetained = projectedCodes.filter((columnCode) => SYSTEM_FIELD_CODES.has(columnCode) && !requestedSet.has(columnCode));
1558
+ const exactArgs = {
1559
+ schemaCode: args.schemaCode,
1560
+ code,
1561
+ fieldCodes: normalizedFieldCodes,
1562
+ replaceColumns: true,
1563
+ ...(requestedSystemCodes.length === 0 ? { hideDefaultSystemFields: true } : {}),
1564
+ };
1565
+ const preciseHint = requestedSystemCodes.length === 0
1566
+ ? `要精确 ${normalizedFieldCodes.length} 列请同时传 replaceColumns:true + hideDefaultSystemFields:true`
1567
+ : `要精确 ${normalizedFieldCodes.length} 列请照抄 nextCommand(保留你点名的系统列 ${requestedSystemCodes.join("、")},不要再加 hideDefaultSystemFields)`;
1568
+ const hiddenRequestedSystemNote = hide && requestedSystemCodes.length > 0
1569
+ ? `hideDefaultSystemFields:true 会移除你点名的系统列 ${requestedSystemCodes.join("、")}——最终列里不会出现;要保留请去掉该参数,或照抄 nextCommand(replaceColumns 且不 hide)`
1570
+ : undefined;
1571
+ const retainedNote = !replace && !hide && !baselineKnown
1572
+ ? `未传 replaceColumns/hideDefaultSystemFields 会保留平台既有列;基线视图读不到,最终列数未知(先 listview.get 确认视图)。${preciseHint}`
1573
+ : !replace && !hide && systemColumnsRetained.length > 0
1574
+ ? `未传 replaceColumns/hideDefaultSystemFields:平台既有系统列 ${systemColumnsRetained.join("、")} 会保留,本次点名 ${normalizedFieldCodes.length} 列实际 ${projectedCodes.length} 列;${preciseHint}`
1575
+ : undefined;
1576
+ const columnNote = hiddenRequestedSystemNote ?? retainedNote;
1577
+ const summaryColumnClause = !replace && (hide || columnNote !== undefined)
1578
+ ? baselineKnown
1579
+ ? `;实际 ${projectedCodes.length} 列`
1580
+ : ";实际列数未知(基线视图读不到)"
1581
+ : "";
1487
1582
  return {
1488
1583
  wouldChange: true,
1489
- summary: `即将配置列表视图 ${args.schemaCode}/${code} 的列`,
1584
+ summary: `即将配置列表视图 ${args.schemaCode}/${code} 的列${summaryColumnClause}`,
1490
1585
  fieldCodes: normalizedFieldCodes.length > 20
1491
1586
  ? { count: normalizedFieldCodes.length, sha256: createHash("sha256").update(JSON.stringify(normalizedFieldCodes)).digest("hex"), note: "超过 20 项才摘要;顺序复核请分批配置" }
1492
1587
  : normalizedFieldCodes,
1588
+ columnBehavior: {
1589
+ mode: replace ? "replaceColumns" : "incremental",
1590
+ hideDefaultSystemFields: hide,
1591
+ // 基线读不到时不能把「未知」当已知:只报 baselineUnknown,不发列数/差集。
1592
+ ...(baselineKnown
1593
+ ? {
1594
+ systemColumnsRetained,
1595
+ baselineBusinessColumnsRetained,
1596
+ expectedColumnCount: projectedCodes.length,
1597
+ }
1598
+ : { baselineUnknown: true }),
1599
+ ...(columnNote !== undefined ? { note: columnNote } : {}),
1600
+ },
1601
+ ...(columnNote !== undefined ? { nextCommand: `omc call listview.configure --env <env> --args '${JSON.stringify(exactArgs)}'` } : {}),
1493
1602
  ...(args.conditions !== undefined ? { conditions: args.conditions } : {}),
1494
1603
  };
1495
1604
  },
@@ -43,6 +43,7 @@ export function dataSubmitDescription() {
43
43
  "Distinct from data.save: data.save persists as DRAFT; data.submit advances the record to COMPLETED (no workflow) or drives the workflow instance.",
44
44
  "**省略 `formData` 的两条合法面**:审批提交(带 workItemId)平台使用已存业务数据;**已有草稿直提(带 bizObjectId、无 workItemId)也合法**——载荷按 data.load 读回行合并(省略 ≡ 传 {},平台 mergeObject 覆盖;给了则覆盖读回值)。只有**新建**(无 bizObjectId、无 workItemId)必须给 formData。审批提交不要携带子表数组。",
45
45
  `就地语义:${wire.submitInPlace};无流程 readback 必须确认 objectId 与传入 bizObjectId 相同;无 bizObjectId 的 workflowCode 新建单 → PROCESSING + workflowInstanceId,无流程 → 该行 COMPLETED。`,
46
+ "readback.decision:提交前实例/行仍 DRAFT 的起始提交=SUBMIT;审批节点提交=APPROVE/REJECT(驳回重激活 token 是 PROCESSING)。",
46
47
  `既有草稿发起流程的唯一支持形状是两段式:先 data.save 带 workflowCode 暂存(saveWorkflow→startWorkflow(finishStart=FALSE);getReplayToken 门、sequenceStatus 与返回形状见 data.save 的 workflowCode 段),再以返回的 workItemId 提交(带流程模型提交**必须**带 bizObjectId+workflowInstanceId+workItemId 三元——只带 bizObjectId 会答「流程实例无待办」、只缺 workItemId 会 50000;完整形状见 omc describe data.submit --example workflow-backed-data-submit,待办查询用 workitem.list)。`,
47
48
  `仅无 workflowCode/workItemId/workflowInstanceId 且无 bizObjectId 时保留 save→submit 便捷链(新建记录);只要存在 workItemId 或 workflowInstanceId 就 fail-closed 拒绝(blocker submit-biz-object-id-required),零 runtime/form/submit wire。`,
48
49
  `formType 自动判定:无任何 workflowCode/workItemId/workflowInstanceId 时**先按模型自动判定**——GET workflow/isworkflow?schemaCode=true 则用 workflow/getWorkflow 解析已发布流程码并**发起流程**(formType="${wire.formTypeWorkflow}",自动先 GET getReplayToken 注入 replayToken,否则 ${wire.replayTokenErrcode} 频繁重复提交);模型无流程 → "${wire.formTypeNoWorkflow}"(无流程提交,走 live 已证链 ${wire.submitChain};单发新建对象会 ${wire.typeCastErrcode},bizObject 勿带字符串 status)或 workItemId+workflowInstanceId(审批待办,agree **顶层**通过/驳回(approval 对象里放 agree 会被静默忽略并按通过处理),**必须带 bizObjectId 指向在途单据**,否则引擎 NPE ${wire.approvalNpeErrcode})→ "${wire.formTypeWorkflow}"。即「无流程直接提交、有流程发起流程」,不再把有流程模型的新建数据落成游离 sheet 行。`,
@@ -159,7 +160,7 @@ export function assertRuntimeDataContract() {
159
160
  assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.save", ["bizObjectId", "sheetCode", "bizsheet/get", "workflowCode", "sequenceStatus", "workItem", "propertyType 9", "50000", "mappings", "rowStatus", "DRAFT", "submit:true", "CHILD_TABLE"]);
160
161
  assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.update", ["runtime/form/save", "bizObjectId", "COMPLETED", "304001", "form/load", "rowStatus", "child-rows-upsert"]);
161
162
  assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.delete", ["absence", "sheetCode", "notInSchema", "allowAlreadyAbsent"]);
162
- assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.submit", ["getReplayToken", "replayToken", "bizObjectId", "objectId", "DRAFT", "COMPLETED", "10009", "100005", "NPE", "两段式", "finishStart=FALSE"]);
163
+ assertDescriptionCarries(RUNTIME_DATA_LANE_CONTRACT, "data.submit", ["getReplayToken", "replayToken", "bizObjectId", "objectId", "DRAFT", "COMPLETED", "10009", "100005", "NPE", "两段式", "finishStart=FALSE", "decision", "SUBMIT"]);
163
164
  if (!RUNTIME_DATA_WIRE.workflowDraftSave.includes("finishStart=FALSE"))
164
165
  throw new Error("runtime-data contract must pin the portal draft-save chain (finishStart=FALSE)");
165
166
  if (!RUNTIME_DATA_WIRE.workflowStartCreateOnly.includes("40000"))