@stalfh233/omc-cli 0.8.17 → 0.8.19

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/call.js CHANGED
@@ -272,8 +272,12 @@ function humanResultLine(result) {
272
272
  // 于是这一行又被印出来(round16 的「dry-run 不打印人话」断言失败)。
273
273
  if (status === "dry-run")
274
274
  return null;
275
- if (typeof result.summary === "string" && result.summary.trim().length > 0)
276
- return result.summary;
275
+ if (typeof result.summary === "string" && result.summary.trim().length > 0) {
276
+ // F4(w153):写面 summary 已存在时,mappingSnapshotGap 的同一句仍要进
277
+ // 人类行——探针只读 stderr 的首屏,不能让它埋在 JSON 里。
278
+ const gapNote = mappingSnapshotGapNote(result);
279
+ return gapNote !== undefined ? `${result.summary};${gapNote}` : result.summary;
280
+ }
277
281
  if (status === "ok" || status === "dry-run")
278
282
  return readDiagnosticLine(result);
279
283
  if (result?.blocker === undefined && status !== "error" && status !== "uncertain")
@@ -295,10 +299,29 @@ function readDiagnosticLine(result) {
295
299
  const unprojectedNote = unprojectedSummaryNote(result);
296
300
  if (unprojectedNote !== undefined)
297
301
  notes.push(unprojectedNote);
302
+ // F3(w153):业务键整个缺席(不是 null)时 unprojectedSummaryNote 无计数可给,
303
+ // 人类行改用 projectionWarning 的同一句 hint。
304
+ const projectionWarning = result.projectionWarning;
305
+ if (unprojectedNote === undefined && projectionWarning !== undefined && typeof projectionWarning.hint === "string" && projectionWarning.hint.length > 0)
306
+ notes.push(projectionWarning.hint);
298
307
  if (typeof result.dateReadbackNote === "string" && result.dateReadbackNote.length > 0)
299
308
  notes.push(result.dateReadbackNote);
309
+ const mappingGapNote = mappingSnapshotGapNote(result);
310
+ if (mappingGapNote !== undefined)
311
+ notes.push(mappingGapNote);
300
312
  return notes.length > 0 ? notes.join(";") : null;
301
313
  }
314
+ /**
315
+ * F4(w153):写面「映射配了但快照空」的人话行——JSON 里 mappingSnapshotGap
316
+ * 同一份证据,stderr 让调用方在写回执的第一屏就看到具体行/字段。
317
+ */
318
+ function mappingSnapshotGapNote(result) {
319
+ // 写面回执的读回诊断嵌在 readback 下(data.save/data.submit 的 execute 返回
320
+ // {performed,readback}),读面则可能平铺——两形都认。
321
+ const nested = result.readback !== null && typeof result.readback === "object" ? result.readback : undefined;
322
+ const gap = (result.mappingSnapshotGap ?? nested?.mappingSnapshotGap);
323
+ return gap !== undefined && typeof gap.hint === "string" && gap.hint.length > 0 ? gap.hint : undefined;
324
+ }
302
325
  /**
303
326
  * F5(w112 探针 H,P2):`items[].fields` 缺键像「值丢了」。行级
304
327
  * `items[].unprojected` 是权威点名,但 compact 外置 items 后行内证据不在信封里,
package/dist/goal-plan.js CHANGED
@@ -286,6 +286,26 @@ function sampleFor(node) {
286
286
  return "<value>";
287
287
  const shape = node;
288
288
  const typeName = shape._def?.typeName;
289
+ // 0.8.19(探针 M F1):可选/带默认/带 transform 的节点包了一层 wrapper。
290
+ // 旧实现落到默认 "<value>" 字符串,于是 `options: Expected object, received string`
291
+ // ——形状本来是对的,却被本地 schema 门判成非法(计划自相矛盾)。剥到内层再取样。
292
+ if ((typeName === "ZodOptional" || typeName === "ZodNullable" || typeName === "ZodDefault"
293
+ || typeName === "ZodBranded" || typeName === "ZodReadonly")
294
+ && shape._def?.innerType !== undefined) {
295
+ return sampleFor(shape._def.innerType);
296
+ }
297
+ // Zod 3 把 refine/superRefine 包成 ZodEffects,内层在 `_def.schema`(不是 innerType)。
298
+ if (typeName === "ZodEffects" && shape._def?.schema !== undefined) {
299
+ const inner = shape._def.schema;
300
+ // JSON 字符串类字段(jsonString = ZodString.refine)样值必须是合法 JSON。
301
+ if (inner._def?.typeName === "ZodString")
302
+ return "{}";
303
+ return sampleFor(inner);
304
+ }
305
+ if (typeName === "ZodUnion" && Array.isArray(shape.options) && shape.options.length > 0)
306
+ return sampleFor(shape.options[0]);
307
+ if (typeName === "ZodRecord")
308
+ return {};
289
309
  if (typeName === "ZodString")
290
310
  return "<value>";
291
311
  if (typeName === "ZodNumber")
@@ -69,7 +69,14 @@ function buildFaceIds(capabilityIds) {
69
69
  return capabilityIds.filter((id) => MULTI_FACE_SIGNAL_CAPABILITIES.includes(id));
70
70
  }
71
71
  function looksMultiFacePackage(goal, capabilityIds) {
72
- return buildFaceIds(capabilityIds).length >= 3 && hasParallelMarker(goal);
72
+ const faces = buildFaceIds(capabilityIds).length;
73
+ if (faces >= 3 && hasParallelMarker(goal))
74
+ return true;
75
+ // 0.8.19(探针 M F1):「建 A/B 模型、子表取主表字段、表单列表、数据规则、审批流程、造数」
76
+ // 全用顿号并列,没有 并/含/以及 等连词,被单配方别名「取主表」抢成一步 field.create。
77
+ // 顿号单独不足以判整包(同一字段的「code、名称、类型」也是顿号),所以只在
78
+ // **≥4 个能力面**时把顿号当并列词——三面及以下仍交给 composer/别名。
79
+ return faces >= 4 && /[、,]/.test(goal);
73
80
  }
74
81
  /**
75
82
  * r31c F1: multi-face asks must NOT be stolen by the first matching composer.
@@ -1400,6 +1407,13 @@ function goalRouteInner(registry, goal) {
1400
1407
  // 并跑通实例」不含 应用/系统/从零,却被别名「两列布局」压成一个 form.draft 配方。
1401
1408
  // 因此别名分支再加一条与 WHOLE_APP_CUES 同级的前置门:**≥3 个能力面 + 并列词**
1402
1409
  // (判据见 looksMultiFacePackage)时让位给下面的多面阶梯。单面句面数 1,照旧走配方。
1410
+ // 0.8.19(探针 M F1):顿号并列的整包句(「模型与字段、子表取主表字段、表单列表、
1411
+ // 数据规则、审批流程…」)没有 并/含/以及 连词,被单配方别名「取主表」抢成一步。
1412
+ // 判据在 looksMultiFacePackage 内(≥4 能力面 + 顿号);单面/两面句仍是 1–2 面,
1413
+ // composer 与别名路由不变。
1414
+ // 口径代价(已知且可接受):「字段、表单、列表、数据规则都改成两列布局」这类
1415
+ // 四当面 + 顿号句会走整包,丢掉强匹配的 two-column-layout 配方——与既有
1416
+ // 「≥4 面即整包」(looksWholePackage)同一口径,宁可多给 intent 主线。
1403
1417
  const multiFacePackageAsk = !readish && looksMultiFacePackage(goal, earlyScoredIds);
1404
1418
  if (!readish && !multiFacePackageAsk && !WHOLE_APP_CUES.some((cue) => goal.includes(cue))) {
1405
1419
  const aliasHit = bestAliasRecipe(registry, goal);
@@ -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
  };
@@ -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`),字段直接消失。
@@ -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 <视图>`
@@ -1489,12 +1518,87 @@ export function registerListViewLane(tools) {
1489
1518
  };
1490
1519
  }
1491
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
+ : "";
1492
1582
  return {
1493
1583
  wouldChange: true,
1494
- summary: `即将配置列表视图 ${args.schemaCode}/${code} 的列`,
1584
+ summary: `即将配置列表视图 ${args.schemaCode}/${code} 的列${summaryColumnClause}`,
1495
1585
  fieldCodes: normalizedFieldCodes.length > 20
1496
1586
  ? { count: normalizedFieldCodes.length, sha256: createHash("sha256").update(JSON.stringify(normalizedFieldCodes)).digest("hex"), note: "超过 20 项才摘要;顺序复核请分批配置" }
1497
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)}'` } : {}),
1498
1602
  ...(args.conditions !== undefined ? { conditions: args.conditions } : {}),
1499
1603
  };
1500
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"))
@@ -344,18 +344,78 @@ const RUNTIME_SYSTEM_FIELD_CODES = new Set([
344
344
  ...SYSTEM_FIELD_CODES, ...RUNTIME_ENGINE_RECORD_KEYS,
345
345
  "bizObjectId", "schemaCode", "updatedTime", "creator", "updater", "parentId", "sortKey",
346
346
  ]);
347
- function emptyBusinessProjection(items) {
348
- let businessColumns = 0;
347
+ const BUSINESS_NULL_WARNING_HINT = "模型可能未配置列表视图:data.list 只投影列表列,业务列会全为 null;核对写入结果请用 data.load,或用 listview.configure 给视图配列";
348
+ const BUSINESS_MISSING_WARNING_HINT = "本次返回行没有任何业务字段(只有系统列):data.list 只回列表视图投影列,键缺席≠值为空;盘点字段值用 data.load,或把业务列加进视图(listview.configure)";
349
+ function isBusinessProjectionCode(code) {
350
+ return code.length > 0 && !RUNTIME_SYSTEM_FIELD_CODES.has(code) && !code.endsWith("_") && !code.endsWith("_key");
351
+ }
352
+ export function projectionWarningOf(items, evidence, requestedFields,
353
+ /**
354
+ * 模型已发布业务列(可选)。业务键整个缺席时,光有视图证据分不清「视图漏配」
355
+ * 与「模型本来就没有业务列」——只有模型字段目录能判。传入空数组 = 纯系统模型,
356
+ * 静默(r53 的 system-only 行不是漏投影);undefined = 读不到,不编结论。
357
+ */
358
+ modelBusinessCodes) {
359
+ if (items.length === 0)
360
+ return undefined;
361
+ const businessKeys = new Set();
362
+ let hasBusinessValue = false;
349
363
  for (const item of items) {
350
364
  for (const [key, value] of Object.entries(item.fields)) {
351
- if (RUNTIME_SYSTEM_FIELD_CODES.has(key) || key.endsWith("_"))
365
+ if (!isBusinessProjectionCode(key))
352
366
  continue;
353
- businessColumns += 1;
367
+ businessKeys.add(key);
354
368
  if (value !== null && value !== undefined)
355
- return false;
369
+ hasBusinessValue = true;
356
370
  }
357
371
  }
358
- return items.length > 0 && businessColumns > 0;
372
+ const viewCodes = evidence?.viewColumnCodes;
373
+ const projectionKnown = viewCodes !== undefined;
374
+ if (businessKeys.size > 0 && hasBusinessValue)
375
+ return undefined;
376
+ // 显式窄投影:调用方自己只要了系统列(如 fields:["sequenceNo"]),业务列缺席
377
+ // 是请求本身的形状,不是视图漏配——不能反过来教「去配视图」。
378
+ if (businessKeys.size === 0
379
+ && requestedFields !== undefined
380
+ && requestedFields.length > 0
381
+ && requestedFields.every((code) => !isBusinessProjectionCode(code))) {
382
+ return {
383
+ reason: "caller-narrowed",
384
+ hint: "你显式只选了系统列,业务列不在本次投影里;业务值用 data.load 读单条,或把业务列加进 fields(只能选视图列)。",
385
+ projectionKnown,
386
+ ...(evidence?.viewColumnsCount !== undefined ? { viewColumnsCount: evidence.viewColumnsCount } : {}),
387
+ };
388
+ }
389
+ if (businessKeys.size === 0) {
390
+ const modelCodes = modelBusinessCodes?.filter(isBusinessProjectionCode);
391
+ // r53:模型自己没有业务列(纯系统模型)→ 系统-only 行是正常形状,不喊狼。
392
+ if (modelCodes !== undefined && modelCodes.length === 0)
393
+ return undefined;
394
+ // 有模型证据就点名「模型业务列里没回来的」;否则退回视图证据;都没有就不编字段名。
395
+ const unprojected = modelCodes !== undefined
396
+ ? modelCodes.filter((code) => !businessKeys.has(code))
397
+ : viewCodes === undefined
398
+ ? []
399
+ : viewCodes.filter((code) => isBusinessProjectionCode(code) && !businessKeys.has(code));
400
+ const detail = unprojected.length > 0
401
+ ? `${modelCodes !== undefined ? "模型的业务列" : "视图里的业务列"} ${unprojected.join("、")} 未出现在结果行`
402
+ : modelCodes === undefined && projectionKnown
403
+ ? "当前列表视图没有业务列"
404
+ : undefined;
405
+ return {
406
+ reason: "business-columns-missing",
407
+ hint: `${BUSINESS_MISSING_WARNING_HINT}${detail !== undefined ? `(${detail})` : ""}`,
408
+ projectionKnown,
409
+ ...(evidence?.viewColumnsCount !== undefined ? { viewColumnsCount: evidence.viewColumnsCount } : {}),
410
+ ...(unprojected.length > 0 ? { unprojected } : {}),
411
+ };
412
+ }
413
+ return {
414
+ reason: "business-columns-null",
415
+ hint: BUSINESS_NULL_WARNING_HINT,
416
+ projectionKnown,
417
+ ...(evidence?.viewColumnsCount !== undefined ? { viewColumnsCount: evidence.viewColumnsCount } : {}),
418
+ };
359
419
  }
360
420
  const VIEW_PROJECTION_HINT = "该面仅回视图投影列;业务字段全 null 不代表未写入,真值用 data.load,或用 listview.configure 配列。";
361
421
  const PROJECTION_MISS_HINT = "这些字段没有出现在平台返回行里 ≠ 值为空;先查 listview.get 或用 data.load 复核";
@@ -667,6 +727,37 @@ export function relationColumnsNotProjected(codes, relationCodes, schemaCode, sa
667
727
  */
668
728
  const MAPPING_NOTE_LIMIT = 5;
669
729
  const MAPPING_NOTE_TARGET_LIMIT = 3;
730
+ /** 快照空值判据:null/undefined/空白串(0/false 是有效值,不算空)。 */
731
+ function mappingTargetEmpty(value) {
732
+ return value === null || value === undefined || (typeof value === "string" && value.trim() === "");
733
+ }
734
+ function childRowValues(row) {
735
+ if (row === null || typeof row !== "object" || Array.isArray(row))
736
+ return undefined;
737
+ const record = row;
738
+ return record.data !== null && typeof record.data === "object" && !Array.isArray(record.data)
739
+ ? record.data
740
+ : record;
741
+ }
742
+ function mappingSnapshotGapFor(hits) {
743
+ const gapHits = hits.filter((hit) => hit.gapRows.length > 0);
744
+ if (gapHits.length === 0)
745
+ return undefined;
746
+ const rows = [...new Set(gapHits.flatMap((hit) => hit.gapRows))].sort((a, b) => a - b);
747
+ const fields = [...new Set(gapHits.flatMap((hit) => hit.gapFields))];
748
+ const childTables = [...new Set(gapHits.map((hit) => hit.childTable))];
749
+ const location = gapHits
750
+ .slice(0, MAPPING_NOTE_LIMIT)
751
+ .map((hit) => `${hit.childTable} 第 ${hit.gapRows.join("/")} 行→${hit.gapFields.join("/")}`)
752
+ .join("、");
753
+ return {
754
+ rows,
755
+ fields,
756
+ childTables,
757
+ hint: `REST 写不跑关联映射,这些快照字段需在 formData 里自填(门户选值才会回填):${location}` +
758
+ `${gapHits.length > MAPPING_NOTE_LIMIT ? ` 等 ${gapHits.length} 处` : ""};映射配置以 field.get 的 options 为准。`,
759
+ };
760
+ }
670
761
  function relationMappingsOf(row) {
671
762
  const options = parseOptions(row.options);
672
763
  let raw = options.mappings ?? row.mappings;
@@ -705,6 +796,7 @@ async function childTableMappingHits(session, formData, childCodes) {
705
796
  // 元数据读不到就不提示(读面副作用不能阻断写)。
706
797
  continue;
707
798
  }
799
+ const formRows = Array.isArray(formData[childTable]) ? formData[childTable] : [];
708
800
  for (const row of rows) {
709
801
  const type = Number(row.propertyType ?? row.type);
710
802
  if (!RELATION_PROPERTY_TYPES.has(type))
@@ -713,8 +805,27 @@ async function childTableMappingHits(session, formData, childCodes) {
713
805
  if (!mapping.declared)
714
806
  continue;
715
807
  const relationField = String(row.code ?? row.propertyCode ?? "");
716
- if (relationField)
717
- hits.push({ childTable, relationField, targets: mapping.targets });
808
+ if (!relationField)
809
+ continue;
810
+ // F4(w153):同一份元数据顺带检查本次 formData 的快照空值,零额外 wire。
811
+ const gapRows = [];
812
+ const gapFields = [];
813
+ const targets = mapping.targets;
814
+ if (targets.length > 0) {
815
+ formRows.forEach((entry, index) => {
816
+ const values = childRowValues(entry);
817
+ if (values === undefined)
818
+ return;
819
+ const empty = targets.filter((target) => mappingTargetEmpty(values[target]));
820
+ if (empty.length === 0)
821
+ return;
822
+ gapRows.push(index + 1);
823
+ for (const target of empty)
824
+ if (!gapFields.includes(target))
825
+ gapFields.push(target);
826
+ });
827
+ }
828
+ hits.push({ childTable, relationField, targets, gapRows, gapFields });
718
829
  }
719
830
  }
720
831
  return hits;
@@ -732,6 +843,13 @@ function mappingRuntimeNoteFor(hits) {
732
843
  .join("、");
733
844
  return `REST 写不执行关联映射(options.mappings 只在门户选值时由表单运行时回填):${detail}${hits.length > shown.length ? ` 等 ${hits.length} 处` : ""};快照/映射目标字段需调用方在 formData 里自填,映射配置以 field.get 的 options 为准。`;
734
845
  }
846
+ /**
847
+ * F6(w153 探针 L,2026-11-28):`name` 是模型「数据标题」表达式(模型可配置
848
+ * summary,常见如 创建人+模型名+时间——不是固定文案),平台 insert/update
849
+ * 无条件覆盖(见 `nameOverwrittenNoteOf` 的源码链)。写前就要说清楚,而不是
850
+ * 等读回发现被改;只在 formData 真的传了 `name` 时提示。
851
+ */
852
+ export const DATA_TITLE_NOTE = "`name` 是平台数据标题(模型可配置 summary,常见如 创建人+模型名+时间)——传入会被覆盖;业务标识(单号/编码)请用自建字段。";
735
853
  const NAME_NOTE_VALUE_LIMIT = 40;
736
854
  function shortReadbackValue(value) {
737
855
  return value.length > NAME_NOTE_VALUE_LIMIT ? `${value.slice(0, NAME_NOTE_VALUE_LIMIT)}…` : value;
@@ -845,6 +963,11 @@ function inlineChildRowsOf(fields, bizObjectId) {
845
963
  for (const [key, value] of Object.entries(fields)) {
846
964
  if (key === "" || !Array.isArray(value) || value.length === 0)
847
965
  continue;
966
+ // 0.8.19(探针 M F2):`data.load full` 的系统人员列也序列化成对象数组
967
+ // (owner/modifier/creater/createdDeptId/ownerDeptId…),旧实现取「第一个数组键」
968
+ // → childRowsHint 给 `childSchemaCode:"modifier"`,照抄必错。只认业务键。
969
+ if (!isBusinessProjectionCode(key))
970
+ continue;
848
971
  if (!value.every((entry) => entry !== null && typeof entry === "object" && !Array.isArray(entry)))
849
972
  continue;
850
973
  return { childSchemaCode: key, bizObjectId: id };
@@ -2091,6 +2214,20 @@ export function registerRuntimeDataLane(tools) {
2091
2214
  .filter((row) => row.code.length > 0);
2092
2215
  return publishedCatalog;
2093
2216
  };
2217
+ /**
2218
+ * F3(0.8.18 复核):业务键整个缺席时,用已发布字段目录判「模型有没有业务列」。
2219
+ * 纯系统模型静默(r53);读失败返回 undefined(不编结论)。只在
2220
+ * 「视图没有业务列 + 调用方没有窄投影」时才付这笔读(复用 publishedFields
2221
+ * 的进程内缓存);视图已列业务列 / 全投影读都是零额外 wire。
2222
+ */
2223
+ const publishedBusinessCodes = async () => {
2224
+ try {
2225
+ return (await publishedFields()).map((row) => row.code).filter(isBusinessProjectionCode);
2226
+ }
2227
+ catch {
2228
+ return undefined;
2229
+ }
2230
+ };
2094
2231
  const publishedTypeByCode = async () => {
2095
2232
  if (publishedTypes)
2096
2233
  return publishedTypes;
@@ -2378,10 +2515,20 @@ export function registerRuntimeDataLane(tools) {
2378
2515
  const projectionMissAll = dataListProjectionMiss(collected, fields);
2379
2516
  const preview = dataListItemPreview(items);
2380
2517
  const nullProjection = items.some((item) => Object.values(item.fields).some((value) => value === null));
2518
+ // F3(w153):业务键整个缺席时也要读视图证据——否则「只有系统列」
2519
+ // 的回执说不出视图里到底缺了哪些业务列。零业务键本身是形状判据,
2520
+ // 不依赖 null。
2521
+ const businessMissing = items.length > 0 && !items.some((item) => Object.keys(item.fields).some(isBusinessProjectionCode));
2381
2522
  // F2(retro 24):出现 null 业务列才读视图证据(正常读取零额外 wire);
2382
2523
  // 证据链见 projectionHintFace 的源码注释。F5(w63):显式选列时必须读
2383
2524
  // 视图列证据才能判「超列」,一笔额外 query/get 只付在显式投影的读上。
2384
- const viewEvidence = nullProjection || fields !== undefined ? await listViewProjectionEvidence(session, args.schemaCode, args.queryCode ?? args.schemaCode) : undefined;
2525
+ const viewEvidence = nullProjection || fields !== undefined || businessMissing ? await listViewProjectionEvidence(session, args.schemaCode, args.queryCode ?? args.schemaCode) : undefined;
2526
+ // 只有「视图证据说不出业务列」时才读模型字段目录:视图里有业务列时
2527
+ // 已能点名未投影列(零额外 wire);纯系统窄投影是调用方自己收窄,也不读。
2528
+ const narrowToSystemAll = fields !== undefined && fields.length > 0 && fields.every((code) => !isBusinessProjectionCode(code));
2529
+ const viewNamesBusinessAll = (viewEvidence?.viewColumnCodes ?? []).some(isBusinessProjectionCode);
2530
+ const modelBusinessCodesAll = businessMissing && !narrowToSystemAll && !viewNamesBusinessAll ? await publishedBusinessCodes() : undefined;
2531
+ const projectionWarningAll = projectionWarningOf(items, viewEvidence, fields, modelBusinessCodesAll);
2385
2532
  const projectionHintAll = projectionHintWithMiss(projectionHintFace(items, viewEvidence), projectionMissAll);
2386
2533
  const columnsNotProjected = await relationNotProjectedOf(items, projectionMissAll, viewEvidence?.viewColumnCodes);
2387
2534
  const itemsWithProjection = attachItemUnprojected(items, projectionMissAll, viewEvidence?.viewColumnCodes);
@@ -2429,7 +2576,14 @@ export function registerRuntimeDataLane(tools) {
2429
2576
  itemsReturned: collected.length,
2430
2577
  resultTruncated: truncatedByCap,
2431
2578
  itemsExternalized: false,
2432
- ...(emptyBusinessProjection(items) ? { viewProjectionOnly: true, hint: VIEW_PROJECTION_HINT } : {}),
2579
+ ...(projectionWarningAll !== undefined
2580
+ ? {
2581
+ projectionWarning: projectionWarningAll,
2582
+ // caller-narrowed 是调用方自己的投影选择,不是「视图漏配」。
2583
+ ...(projectionWarningAll.reason !== "caller-narrowed" ? { viewProjectionOnly: true } : {}),
2584
+ hint: projectionWarningAll.hint,
2585
+ }
2586
+ : {}),
2433
2587
  // r29b F8 的 ids/itemsPreview 由 compact(外置时)现算,不在这里内联——
2434
2588
  // 内联会让小结果越过 2048B 外置阈值,反而把 items 挤成 []。
2435
2589
  ...(truncatedByCap
@@ -2452,6 +2606,9 @@ export function registerRuntimeDataLane(tools) {
2452
2606
  : {}),
2453
2607
  ...(projectionHintAll !== undefined ? { projectionHint: projectionHintAll } : {}),
2454
2608
  ...(anyNullField ? { nullSemantics: DATA_LIST_NULL_SEMANTICS } : {}),
2609
+ // 口径 = 行级证据(items[].unprojected 的跨行并集)。模型目录点名
2610
+ // (projectionWarning.unprojected)只进 warning.hint,不计入本数——
2611
+ // 否则人类行会指向该场景里并不存在的 `items[].unprojected`。
2455
2612
  ...(unprojectedCodes.length > 0 ? { unprojectedFieldCount: unprojectedCodes.length } : {}),
2456
2613
  ...(projectionMissAll.length > 0 ? { projectionMiss: projectionMissAll } : {}),
2457
2614
  ...(columnsNotProjected.length > 0 ? { columnsNotProjected } : {}),
@@ -2560,7 +2717,6 @@ export function registerRuntimeDataLane(tools) {
2560
2717
  // back null while `data.load` shows the real values. That reads as
2561
2718
  // "the write failed". Detect an all-null business projection (items
2562
2719
  // present, zero non-null business values) and say so.
2563
- const projectionEmpty = emptyBusinessProjection(items);
2564
2720
  const preview = dataListItemPreview(items);
2565
2721
  const requestedPage = args.page ?? 0;
2566
2722
  // r31b F9: an out-of-range page can answer total:0 / totalPages:1 (platform),
@@ -2595,7 +2751,12 @@ export function registerRuntimeDataLane(tools) {
2595
2751
  // projectionHintFace / listViewProjectionEvidence 的源码注释。
2596
2752
  // F5(w63):显式选列时必须读视图列证据才能判「超列」。
2597
2753
  const hasNullValue = items.some((item) => Object.values(item.fields).some((value) => value === null));
2598
- const viewEvidence = hasNullValue || fields !== undefined ? await listViewProjectionEvidence(session, args.schemaCode, args.queryCode ?? args.schemaCode) : undefined;
2754
+ const businessMissingPaged = items.length > 0 && !items.some((item) => Object.keys(item.fields).some(isBusinessProjectionCode));
2755
+ const viewEvidence = hasNullValue || fields !== undefined || businessMissingPaged ? await listViewProjectionEvidence(session, args.schemaCode, args.queryCode ?? args.schemaCode) : undefined;
2756
+ const narrowToSystemPaged = fields !== undefined && fields.length > 0 && fields.every((code) => !isBusinessProjectionCode(code));
2757
+ const viewNamesBusinessPaged = (viewEvidence?.viewColumnCodes ?? []).some(isBusinessProjectionCode);
2758
+ const modelBusinessCodesPaged = businessMissingPaged && !narrowToSystemPaged && !viewNamesBusinessPaged ? await publishedBusinessCodes() : undefined;
2759
+ const projectionWarningPaged = projectionWarningOf(items, viewEvidence, fields, modelBusinessCodesPaged);
2599
2760
  const projectionHintPaged = projectionHintWithMiss(projectionHintFace(items, viewEvidence), projectionMissPaged);
2600
2761
  const columnsNotProjected = await relationNotProjectedOf(items, projectionMissPaged, viewEvidence?.viewColumnCodes);
2601
2762
  const itemsWithProjection = attachItemUnprojected(items, projectionMissPaged, viewEvidence?.viewColumnCodes);
@@ -2626,8 +2787,10 @@ export function registerRuntimeDataLane(tools) {
2626
2787
  schemaCode: args.schemaCode,
2627
2788
  ...application,
2628
2789
  ...(inlineChild !== undefined ? { childRowsHint: childRowsAggregateHint(inlineChild, args.schemaCode, "本页内联了子表行") } : {}),
2629
- ...(projectionEmpty ? { projectionWarning: { reason: "business-columns-null", hint: "模型可能未配置列表视图:data.list 只投影列表列,业务列会全为 null;核对写入结果请用 data.load(或先建列表视图)" } } : {}),
2630
- ...(projectionEmpty ? { viewProjectionOnly: true, hint: VIEW_PROJECTION_HINT } : {}),
2790
+ ...(projectionWarningPaged !== undefined ? { projectionWarning: projectionWarningPaged } : {}),
2791
+ ...(projectionWarningPaged !== undefined && projectionWarningPaged.reason !== "caller-narrowed"
2792
+ ? { viewProjectionOnly: true, hint: projectionWarningPaged.hint }
2793
+ : {}),
2631
2794
  ...(args.queryCode !== undefined ? { queryCode: args.queryCode } : {}),
2632
2795
  total,
2633
2796
  // This branch is the non-`all` read. `excludedDraft` used to be
@@ -2657,6 +2820,7 @@ export function registerRuntimeDataLane(tools) {
2657
2820
  ...(choiceFilterFields.length > 0 && Number(total ?? 0) === 0 ? { filterValueHint: choiceFilterValueHint(choiceFilterFields) } : {}),
2658
2821
  ...(projectionHintPaged !== undefined ? { projectionHint: projectionHintPaged } : {}),
2659
2822
  ...(anyNullField ? { nullSemantics: DATA_LIST_NULL_SEMANTICS } : {}),
2823
+ // 同 all 路径:只数行级证据,模型目录点名留在 warning.hint。
2660
2824
  ...(unprojectedCodes.length > 0 ? { unprojectedFieldCount: unprojectedCodes.length } : {}),
2661
2825
  ...(projectionMissPaged.length > 0 ? { projectionMiss: projectionMissPaged } : {}),
2662
2826
  ...(columnsNotProjected.length > 0 ? { columnsNotProjected } : {}),
@@ -3452,12 +3616,31 @@ export function registerRuntimeDataLane(tools) {
3452
3616
  // 券商 issue 1.3(cpdocs 2026-10-27):更新既有记录的主键契约——平台
3453
3617
  // BizObjectModel.getId() 只读 bizObject.data.id;顶层 bizObject.bizObjectId
3454
3618
  // 被保存逻辑忽略,errcode:0 但 objectId 是新 id(静默新建孤儿行)。
3455
- 'business-object data keyed by field code(关联/人员形状同默认描述)。**单选关联 WORK_SHEET 9=id 串或 `{id}`;MULT_WORK_SHEET 11/人员/组织 50/51 才数组;人员/组织元素 `{id,type,name}`,type 必填**。引擎拥有键(sequenceStatus 等)会被剥离——读改写的 sequenceStatus 不会把行钉回旧状态。新建时子表行缺 sortKey 会按数组下标补 1..n(平台读回按 sortKey ASC;更新既有记录请显式带 sortKey)。mappings 仅门户回填;字典-backed 不校验取值(不存在/已停用码也会落库,要拦请配数据规则)。既有记录更新:主键必须放 formData.id(顶层 bizObject.bizObjectId 被平台忽略会静默新建孤儿行——直调 REST 同理,cpdocs issue §1.3);id 无对应行会被拒(save-update-target-absent),新建请省略 id。'),
3619
+ 'business-object data keyed by field code(关联/人员形状同默认描述)。**单选关联 WORK_SHEET 9=id 串或 `{id}`;MULT_WORK_SHEET 11/人员/组织 50/51 才数组;人员/组织元素 `{id,type,name}`,type 必填**。引擎拥有键(sequenceStatus 等)会被剥离——读改写的 sequenceStatus 不会把行钉回旧状态。新建时子表行缺 sortKey 会按数组下标补 1..n(平台读回按 sortKey ASC;更新既有记录请显式带 sortKey)。mappings 仅门户回填;子表快照字段为空会回 mappingSnapshotGap 点名行/字段;字典-backed 不校验取值(不存在/已停用码也会落库,要拦请配数据规则)。**`name` 是平台数据标题(模型可配置 summary,常见如 创建人+模型名+时间),传入会被覆盖;业务标识用自建字段**。既有记录更新:主键必须放 formData.id(顶层 bizObject.bizObjectId 被平台忽略会静默新建孤儿行——直调 REST 同理,cpdocs issue §1.3);id 无对应行会被拒(save-update-target-absent),新建请省略 id。'),
3456
3620
  workflowCode: z.string().optional().describe("portal draft-save shape: create the row AND a DRAFT workflow instance + start workItem (finishStart=FALSE); submit later via data.submit with the returned workItemId. formData must NOT carry an id — in-place workflow start has no REST surface in 8.6.26。发起语义阶梯:本参数=发起停在第一节点(行/实例双 DRAFT,首办待办=发起人);到第一个审批节点用 data.submit 三件套;无流程模型用 submit:true 一调完成态;代他人发起(可选发起人)唯一路径=业务规则 CREATE+startWorkflow(完成态发起,不留草稿待办)"),
3457
3621
  submit: z.boolean().optional().describe("true=保存后立即直提(无流程模型 DRAFT→COMPLETED,触发 Create 规则);与 workflowCode 互斥。**按业务约定正式数据优先直接 data.submit(无 id=新建并提交一调完成)——本参数是便捷别名,save 的定位是草稿/暂存**"),
3458
3622
  allowStaffOnSubmit: z.boolean().optional().describe("submit:true 时显式允许携带人员字段(issue#10:人员字段提交面两种形状都可能 50000,可靠链路是 save 落库后提交时省略;个别平台构建接受提交面携带,自担风险)"),
3459
3623
  ...readbackProjectionArgs,
3460
3624
  },
3625
+ // F4/F6(w153 探针 L):dry-run 也把「快照空值」与 name 标题语义说在写前。
3626
+ // 只读(父/子表已发布字段元数据)——与真写后的 mappingRuntimeNote 同源,
3627
+ // 真写路径仍只读一次子表 schema(本预览不参与真写)。
3628
+ dryRunPayload: async (session, args) => {
3629
+ const loaded = await loadPublishedFieldMeta(session, args.schemaCode);
3630
+ const formData = (args.formData ?? {});
3631
+ const mappingHits = loaded ? await childTableMappingHits(session, formData, loaded.childCodes) : [];
3632
+ const mappingRuntimeNote = mappingRuntimeNoteFor(mappingHits);
3633
+ const mappingSnapshotGap = mappingSnapshotGapFor(mappingHits);
3634
+ return {
3635
+ // F6 精度:只在 formData 真的传了 name 时才说标题会被覆盖。
3636
+ ...(Object.prototype.hasOwnProperty.call(formData, "name") ? { nameTitleNote: DATA_TITLE_NOTE } : {}),
3637
+ ...(mappingRuntimeNote !== undefined ? { mappingRuntimeNote } : {}),
3638
+ ...(mappingSnapshotGap !== undefined ? { mappingSnapshotGap } : {}),
3639
+ summary: mappingSnapshotGap !== undefined
3640
+ ? `计划写入 ${args.schemaCode};注意 ${mappingSnapshotGap.rows.length} 行子表快照字段为空(REST 不跑映射)`
3641
+ : `计划写入 ${args.schemaCode}`,
3642
+ };
3643
+ },
3461
3644
  execute: async (session, args) => {
3462
3645
  const applicationScope = await resolveApplicationScope(session);
3463
3646
  const application = { applicationCode: applicationScope.code, applicationResolution: applicationResolutionOf(applicationScope) };
@@ -3591,10 +3774,12 @@ export function registerRuntimeDataLane(tools) {
3591
3774
  const workflowNameNote = nameOverwrittenNoteOf(rawSaveData.name, workflowReadbackRecord?.name);
3592
3775
  // F4(w53):本次 formData 真带子表数组时才读子表字段元数据;无数组/读不到
3593
3776
  // 元数据 → 零提示(读失败不阻断写)。
3594
- const mappingRuntimeNote = mappingRuntimeNoteFor(await childTableMappingHits(session, formData, prepared.childCodes));
3777
+ const mappingHits = await childTableMappingHits(session, formData, prepared.childCodes);
3778
+ const mappingRuntimeNote = mappingRuntimeNoteFor(mappingHits);
3779
+ const mappingSnapshotGap = mappingSnapshotGapFor(mappingHits);
3595
3780
  return {
3596
3781
  performed: { errcode: performed.errcode, ...application, bizObjectId: returnedId, workflowInstanceId, workItemId, workItemSource, sheetCode, resolvedFrom, formType: "save-draft-workflow" },
3597
- readback: { ...application, ...writeDiagnostics, ...(mappingRuntimeNote !== undefined ? { mappingRuntimeNote } : {}), ...(workflowNameNote !== undefined ? { nameOverwrittenNote: workflowNameNote } : {}), authoritative: projectReadbackRecord(workflowReadbackRecord, args), sequenceStatus, expectedSequenceStatus: "DRAFT" },
3782
+ readback: { ...application, ...writeDiagnostics, ...(mappingRuntimeNote !== undefined ? { mappingRuntimeNote } : {}), ...(mappingSnapshotGap !== undefined ? { mappingSnapshotGap } : {}), ...(workflowNameNote !== undefined ? { nameOverwrittenNote: workflowNameNote } : {}), authoritative: projectReadbackRecord(workflowReadbackRecord, args), sequenceStatus, expectedSequenceStatus: "DRAFT" },
3598
3783
  };
3599
3784
  }
3600
3785
  // 券商 issue 1.3(cpdocs 2026-10-27):带 formData.id 的 save 是更新语义;
@@ -3692,11 +3877,14 @@ export function registerRuntimeDataLane(tools) {
3692
3877
  : undefined;
3693
3878
  // F4(w53):仅在本次 formData 含子表数组时读该子表字段元数据;没有数组 /
3694
3879
  // 读不到元数据 → 零提示、零额外 wire(读失败不阻断写)。
3695
- const mappingRuntimeNote = mappingRuntimeNoteFor(await childTableMappingHits(session, formData, prepared.childCodes));
3880
+ const mappingHits = await childTableMappingHits(session, formData, prepared.childCodes);
3881
+ const mappingRuntimeNote = mappingRuntimeNoteFor(mappingHits);
3882
+ const mappingSnapshotGap = mappingSnapshotGapFor(mappingHits);
3696
3883
  const plainReadback = {
3697
3884
  ...application,
3698
3885
  ...writeDiagnostics,
3699
3886
  ...(mappingRuntimeNote !== undefined ? { mappingRuntimeNote } : {}),
3887
+ ...(mappingSnapshotGap !== undefined ? { mappingSnapshotGap } : {}),
3700
3888
  ...(nameOverwrittenNote !== undefined ? { nameOverwrittenNote } : {}),
3701
3889
  authoritative: projectReadbackRecord(savedRecord, args),
3702
3890
  ...(savedEmptyFields.length > 0 ? { readbackWarning: readbackWarningFor(savedEmptyFields, "data.save") } : {}),
@@ -4259,7 +4447,7 @@ export function registerRuntimeDataLane(tools) {
4259
4447
  workflowInstanceId: z.string().optional(),
4260
4448
  workItemId: z.string().optional(),
4261
4449
  bizObjectId: z.string().optional().describe("existing record id; REQUIRED for workItem approval submits (formType=1 + workItemId) — the submit's bizObject must reference the in-flight record or the engine NPEs (DataChangeHandlerImpl.changeBizObject)"),
4262
- agree: z.boolean().optional(),
4450
+ agree: z.boolean().optional().describe("顶层参数:true=通过 / false=驳回,缺省 true;approval.agree 本工具写前即拒(submit-approval-agree-misplaced),平台侧才静默忽略(按通过)。"),
4263
4451
  allowChildRowAppend: z.boolean().optional().describe("默认 false:审批提交(带 workItemId/workflowInstanceId)时 formData 含子表数组会被拒——平台按追加插行,每次提交重复一份。确实要追加子行时才置 true。"),
4264
4452
  allowStaffOnSubmit: z.boolean().optional().describe("默认 false:提交携带人员字段会被拒(issue#10:两种形状都可能 50000;可靠链路=save 落库后提交省略人员字段)。个别平台构建接受提交面携带时置 true 自担。"),
4265
4453
  approval: z.record(z.string(), z.unknown()).optional(),
@@ -4367,6 +4555,17 @@ export function registerRuntimeDataLane(tools) {
4367
4555
  assignChildSortKeys: targetObjectId === null,
4368
4556
  });
4369
4557
  const formData = stampedSubmit.formData;
4558
+ // F4(w153):提交面同样点名「映射配置了但快照为空」的行/字段。
4559
+ // 成本说明(复核纠正):`data.save` 复用 prepareRuntimeFormData 已读的子表
4560
+ // 元数据读取(零额外 wire);standalone `data.submit` **新增一次**子表字段面
4561
+ // 读取——`prepareRuntimeFormData` 只读父模型 schemaCode 的已发布字段,父模型
4562
+ // 字段面不含子列(`options.mappings` 在子表 schema 上)。读失败静默跳过。
4563
+ // 边界:`data.submit {bizObjectId}` 省略 formData 的既有草稿直提,检查发生在
4564
+ // 「formData 与读回行合并」之前,故不会报 mappingSnapshotGap(已知残留,
4565
+ // 见 docs/known-residuals.md)。
4566
+ const submitMappingHits = await childTableMappingHits(session, formData, stampedSubmit.childCodes);
4567
+ const submitMappingRuntimeNote = mappingRuntimeNoteFor(submitMappingHits);
4568
+ const submitMappingSnapshotGap = mappingSnapshotGapFor(submitMappingHits);
4370
4569
  // r5-asset 2026-10-20: the platform APPENDS child rows carried in an
4371
4570
  // approval submit's formData (no upsert by row id, no error). Live: an
4372
4571
  // approval that echoed the whole form twice turned 2 detail rows into 6
@@ -4730,7 +4929,11 @@ export function registerRuntimeDataLane(tools) {
4730
4929
  }
4731
4930
  }
4732
4931
  const performedData = (performed.data ?? {});
4733
- let readback = { formType };
4932
+ let readback = {
4933
+ formType,
4934
+ ...(submitMappingRuntimeNote !== undefined ? { mappingRuntimeNote: submitMappingRuntimeNote } : {}),
4935
+ ...(submitMappingSnapshotGap !== undefined ? { mappingSnapshotGap: submitMappingSnapshotGap } : {}),
4936
+ };
4734
4937
  if (formType === "2") {
4735
4938
  const objectId = typeof performedData.objectId === "string" ? performedData.objectId : null;
4736
4939
  if (!objectId) {
@@ -4739,7 +4942,13 @@ export function registerRuntimeDataLane(tools) {
4739
4942
  // it with a fabricated sequenceStatus:COMPLETED.
4740
4943
  return {
4741
4944
  performed: { errcode: performed.errcode, sheetCode, resolvedFrom, formType, draftObjectId },
4742
- readback: { formType, sequenceStatus: null, missingObjectId: true },
4945
+ readback: {
4946
+ formType,
4947
+ sequenceStatus: null,
4948
+ missingObjectId: true,
4949
+ ...(submitMappingRuntimeNote !== undefined ? { mappingRuntimeNote: submitMappingRuntimeNote } : {}),
4950
+ ...(submitMappingSnapshotGap !== undefined ? { mappingSnapshotGap: submitMappingSnapshotGap } : {}),
4951
+ },
4743
4952
  };
4744
4953
  }
4745
4954
  if (targetObjectId && objectId !== targetObjectId) {
@@ -4837,6 +5046,13 @@ export function registerRuntimeDataLane(tools) {
4837
5046
  // Pure-instance submits (workflowInstanceId without workItemId) go
4838
5047
  // through the same engine path and deserve the same delta (item 11).
4839
5048
  const approvalDelta = (hasWorkItem || hasInstance) && args.summary !== true && args.full !== true && !(Array.isArray(args.fields) && args.fields.length > 0);
5049
+ // F5(探针 L):起始节点提交 ≠ 审批通过。判据与回执文案同源:提交前实例/行
5050
+ // 仍是 DRAFT → 本次消费的是起始待办(DRAFT→PROCESSING 只在起始提交时发生,
5051
+ // SubmitDataChangeHandlerImpl.updateWorkflowInstance:126-131)。驳回至发起人
5052
+ // 重激活的 token 是 PROCESSING,所以按提交前状态判、不按节点类型判(平台
5053
+ // ApprovalActionStatus.java:15/17 的 SUBMIT/AGREE 只是审批日志文案,两面不一致)。
5054
+ const startNodeSubmit = hasWorkItem && (retriedWithWorkItemId !== null || preSubmitStatus === "DRAFT");
5055
+ const rejected = hasWorkItem && args.agree === false;
4840
5056
  readback = {
4841
5057
  ...readback,
4842
5058
  workflowInstanceId: effectiveInstanceId,
@@ -4874,7 +5090,12 @@ export function registerRuntimeDataLane(tools) {
4874
5090
  };
4875
5091
  })(),
4876
5092
  ...(approvalDelta
4877
- ? { readbackShape: "approval-delta", readbackHint: "审批提交默认只回 sequenceStatus + 本次提交的字段;要整条记录(含子表/系统字段)加 full:true,要指定字段加 fields:[...]" }
5093
+ ? {
5094
+ readbackShape: "approval-delta",
5095
+ readbackHint: startNodeSubmit
5096
+ ? "发起提交(草稿→PROCESSING):默认只回 sequenceStatus + 本次提交的字段;要整条记录(含子表/系统字段)加 full:true,要指定字段加 fields:[...]"
5097
+ : "审批提交默认只回 sequenceStatus + 本次提交的字段;要整条记录(含子表/系统字段)加 full:true,要指定字段加 fields:[...]",
5098
+ }
4878
5099
  : {}),
4879
5100
  ...(serialGenerationFailed.length > 0
4880
5101
  ? { serialGenerationFailed, serialGenerationWarning: SERIAL_GENERATION_FAILURE_NOTE }
@@ -4887,9 +5108,10 @@ export function registerRuntimeDataLane(tools) {
4887
5108
  // this instance while the flow is still in flight (best-effort: a lookup
4888
5109
  // failure must never fail the submit).
4889
5110
  // r29c F12: 驳回/通过要能从回执区分——agree:false → decision:REJECT。
4890
- const rejected = hasWorkItem && args.agree === false;
5111
+ // F5(探针 L):起始节点提交(提交前 DRAFT)→ decision:SUBMIT;审批节点才
5112
+ // APPROVE/REJECT。判据见上方 startNodeSubmit(按提交前状态,不按节点类型)。
4891
5113
  if (hasWorkItem)
4892
- readback.decision = rejected ? "REJECT" : "APPROVE";
5114
+ readback.decision = rejected ? "REJECT" : startNodeSubmit ? "SUBMIT" : "APPROVE";
4893
5115
  if (hasWorkflow && effectiveInstanceId && sequenceStatus !== "COMPLETED") {
4894
5116
  try {
4895
5117
  const pending = await searchWorkItems(session, { instanceId: effectiveInstanceId });
@@ -5117,7 +5339,9 @@ export function registerRuntimeDataLane(tools) {
5117
5339
  // for the portal button, but for an API caller "I forgot the flag" and
5118
5340
  // "I approve" must not look identical in the receipt.
5119
5341
  // r29c F10: 只在审批提交(有 workItemId)时给 approvalNote;发起提交用 startNote。
5120
- ...(hasWorkItem && args.agree === undefined
5342
+ // F5(探针 L):起始节点提交(decision=SUBMIT)也不是审批——别再对它说
5343
+ // 「本次是审批提交」。
5344
+ ...(hasWorkItem && readback.decision !== "SUBMIT" && args.agree === undefined
5121
5345
  ? {
5122
5346
  approvalNote: "本次是审批提交但未传 agree——平台按**通过**处理(顶层 agree 缺省 true)。要驳回必须显式 agree:false;approval.agree 不生效。",
5123
5347
  }
@@ -41,7 +41,44 @@ const listViewConfigure = Object.freeze({
41
41
  ],
42
42
  requiresEnvironmentDerivedIds: false,
43
43
  });
44
+ /**
45
+ * F11(0.8.18 探针 L):`describe listview.configure --param conditions` 只回 schema,
46
+ * 没有可抄的最小行。单独给一条配方,形状与 sorts 的 `configure-default-list` 对齐;
47
+ * conditions 是整体替换,省略 fieldCodes 即「只改条件、不动列」。
48
+ */
49
+ const configureConditions = Object.freeze({
50
+ id: "configure-conditions",
51
+ title: "配置视图固定条件(最小行:propertyCode/filterType/defaultValue/displayType)",
52
+ status: "requires-prior-readback",
53
+ tool: "listview.configure",
54
+ args: {
55
+ environment,
56
+ schemaCode: model,
57
+ conditions: [{ propertyCode: "<propertyCode>", filterType: "Eq", defaultValue: "<value>", displayType: "INPUT" }],
58
+ },
59
+ preconditions: [
60
+ "字段已 field.publish;conditions 是整体替换(省略该参数 = 不改条件)",
61
+ "视图固定条件只在门户运行面生效:REST data.list --queryCode 不应用,验收看 listview.get 回读的 conditions",
62
+ ],
63
+ conditionalRequirements: [
64
+ "filterType 是 QueryFilterType 字符串枚举(Eq/Gte/Lte/Like…,省略时按 propertyType 取平台默认);displayType 是 INPUT/RADIO/CHECKBOX/SELECT/RANGE。",
65
+ "只想加条件不要重发列:省略 fieldCodes 即不动列;要精确列集合另配 replaceColumns+hideDefaultSystemFields。",
66
+ "2.1.5 树视图条件行需原样带回 treeLimitScopeType/treeLimitConditionGroup/treeDefaultConditionGroup,否则默认拒 listview-tree-conditions-changed。",
67
+ ],
68
+ priorToolReferences: [
69
+ { tool: "listview.get", args: { environment, schemaCode: model, code: model }, purpose: "读回既有 conditions(整体替换,先看基线)" },
70
+ { tool: "field.list", args: { environment, schemaCode: model, published: true }, purpose: "确认 propertyCode 与 propertyType 已发布" },
71
+ ],
72
+ dryRun: { supported: true, command: `omc call listview.configure --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 预检 conditions 形状与树过滤组门,不写" },
73
+ expectedReadback: { readback: { conditions: [{ propertyCode: "<propertyCode>", filterType: "Eq", defaultValue: "<value>", displayType: "INPUT" }] }, next: ["listview.get 核对 conditionReadback.equivalent", "门户点验运行面过滤(REST 无入口)"] },
74
+ refusalRecovery: [
75
+ { code: "listview-tree-conditions-would-be-lost", action: "提交行缺 treeLimitScopeType/treeLimitConditionGroup/treeDefaultConditionGroup:原样带回基线三键后重试" },
76
+ { code: "listview-tree-conditions-changed", action: "确认要改写树过滤组才传 allowTreeConditionChange:true;否则照抄基线值" },
77
+ ...commonRecovery,
78
+ ],
79
+ requiresEnvironmentDerivedIds: false,
80
+ });
44
81
  export const LISTVIEW_METADATA = Object.freeze({
45
- "listview.configure": Object.freeze({ recipes: [listViewConfigure], relatedTools: ["listview.list", "listview.get", "field.list", "field.publish"] }),
82
+ "listview.configure": Object.freeze({ recipes: [listViewConfigure, configureConditions], relatedTools: ["listview.list", "listview.get", "field.list", "field.publish"] }),
46
83
  });
47
84
  //# sourceMappingURL=list-view.js.map
package/dist/residue.js CHANGED
@@ -9,6 +9,10 @@ import { emitInvalid, emitResult } from "./command-transport.js";
9
9
  import { projectResultExtract } from "./path-projection.js";
10
10
  const MAX_ITEMS = 20;
11
11
  const SYSTEM_RULE_NAMES = new Set(["Available", "Cancel", "Create", "Delete", "GetList", "Load", "Update"]);
12
+ /** 未扫描面的补扫入口(探针 L F9:命令必须是真实存在、可复制执行的)。 */
13
+ const UNSCANNED_FACE_CHECKS = [
14
+ { face: "report", command: `omc call report.tree --args '{}'` },
15
+ ];
12
16
  function residueOrigin(row, faceName) {
13
17
  if (row.defaultRule === true || row.preset === true || row.system === true || row.systemPreset === true)
14
18
  return "system-preset";
@@ -116,10 +120,13 @@ export async function scanResidues(session, prefix, options = {}) {
116
120
  faces.push({ face: "report", count: -1, items: [], note: "not-scanned——报表残留判定用 report.tree(树)+ report.get(BI 残留看 readback.biResidue)" });
117
121
  }
118
122
  const compact = options.allFaces === true ? faces : nonZeroFaces;
119
- // 探针 J F9:report 面至今没有扫描入口(platform/lane 都只有清单读),
120
- // 所以每次 residue 都存在未扫描面。将来接上 report 扫描时移除这一项即可
121
- // ——三个键按 unscannedFaces 是否为空成组出现。
122
- const unscannedFaces = ["report"];
123
+ // 探针 J F9 + 探针 L F9:report 面至今没有扫描入口(platform/lane 都只有清单读),
124
+ // 所以每次 residue 都存在未扫描面,complete 恒为 false。**不要**引入「调用方声明
125
+ // 已核对」的 bypass——没有实际扫描就没有覆盖面证据;等接上 report 扫描入口、
126
+ // 真正扫过之后再让 complete 变 true。
127
+ const unscanned = UNSCANNED_FACE_CHECKS;
128
+ const unscannedFaces = unscanned.map((check) => check.face);
129
+ const complete = unscannedFaces.length === 0;
123
130
  return {
124
131
  prefix,
125
132
  faces: compact,
@@ -131,20 +138,28 @@ export async function scanResidues(session, prefix, options = {}) {
131
138
  // coverage 逐面标注,未扫面不得读作「零残留」。
132
139
  clean: userResidues === 0 && !pendingCascade,
133
140
  cleanWithinScannedFaces: userResidues === 0 && !pendingCascade,
141
+ // 探针 L F9:clean 的覆盖面结论单独出键。clean 语义不变(不改成 false),
142
+ // 但 complete:false 明说「这次扫描没覆盖全部面」,读者不能只看 clean。
143
+ complete,
134
144
  // r70 探针01-F7:真残留存在时顶层 clean:true 仍误导(coverage 在深处,首屏只看
135
145
  // clean)——caveat 常驻顶层,紧贴 clean 键。
136
146
  cleanCaveat: "clean 仅指已扫描面(scanned faces only);report 面未扫描(报表资源残留用 report.tree + report.get 判)",
137
- ...(unscannedFaces.length > 0
147
+ ...(unscanned.length > 0
138
148
  ? {
139
149
  cleanScope: "scanned-faces",
140
150
  unscannedFaces,
141
- reportCheckCommand: `omc call report.tree --args '{}'`,
151
+ ...(unscanned.some((check) => check.face === "report")
152
+ ? { reportCheckCommand: unscanned.find((check) => check.face === "report").command }
153
+ : {}),
154
+ mandatoryChecks: unscanned,
142
155
  }
143
156
  : {}),
144
157
  coverage: { report: "not-scanned(用 report.tree + report.get 判,BI 残留看 readback.biResidue)", workflow: "模板跟模型走(模型删即删)" },
145
158
  ...(systemPresetCount > 0 ? { systemPresetCount } : {}),
146
159
  ...(pendingCascade ? { pendingCascade: true } : {}),
147
- note: pendingCascade ? "scanned faces only——模型已不存在但仍有级联面命中:平台删除为异步任务、时长不定,稍后重跑,幂等" : "scanned faces only——clean 仅指已扫描面;report 面未扫描——报表残留判定用 report.tree(树)+ report.get(BI 残留看 biResidue)",
160
+ note: pendingCascade
161
+ ? "scanned faces only——模型已不存在但仍有级联面命中:平台删除为异步任务、时长不定,稍后重跑,幂等"
162
+ : "scanned faces only;report 面需另行核对——clean 仅指已扫描面,全局零残留看 complete + mandatoryChecks",
148
163
  };
149
164
  }
150
165
  export async function cmdResidue(prefix, options, transport) {
@@ -67,6 +67,8 @@ const KEY_RULES = Object.freeze({
67
67
  subFields: { cls: "user", source: "子表列清单是需求本体", user: "utterance" },
68
68
  formData: { cls: "user", source: "业务数据载荷是需求本体", user: "utterance" },
69
69
  filter: { cls: "user", source: "查询语义(op/字段/值)是需求本体", user: "utterance" },
70
+ // 0.8.18(探针 L F11):listview.configure 的固定条件行(propertyCode/filterType/defaultValue/displayType)。
71
+ conditions: { cls: "user", source: "视图固定筛选条件是需求本体(列候选由 field.list 给,判定/取值由需求给)", user: "utterance" },
70
72
  records: { cls: "user", source: "字典键值对是需求本体", user: "utterance" },
71
73
  source: { cls: "user", source: "在线 JS 源码是需求本体", user: "utterance" },
72
74
  template: { cls: "user", source: "流程拓扑(节点/连线/参与人/条件)是需求本体", user: "utterance" },
package/dist/wire.js CHANGED
@@ -278,7 +278,17 @@ function invalidateReadCache(session, call) {
278
278
  ENDPOINTS.dataRuleDelete,
279
279
  ]);
280
280
  const path = call.path;
281
- if (fieldPaths.includes(path)) {
281
+ if (path === ENDPOINTS.fieldPublish) {
282
+ // 模型级发布把**子表 schema 的列**一起送上发布面(2.1.5/8.6.26
283
+ // `BizPropertyManagerImpl.getPublishedPropertyList` 按父模型粒度物化,
284
+ // 真机 PLAIN 回执 `resolvedFromChildSchemas` 为证),但 POST body 只带父模型
285
+ // code——按 code 收窄失效会留下子 schema 的旧行面,同一进程里紧接的
286
+ // field.get/发布读回读到发布前快照(published:false,探针 L F1 的同族假值)。
287
+ // 发布是低频写,字段面整面清掉(其它模型只是多一次读,不会读错)。
288
+ dropAll([ENDPOINTS.fieldList]);
289
+ dropSchemaScoped([ENDPOINTS.sheetGet], schemaCodesFromBody(call.body));
290
+ }
291
+ else if (fieldPaths.includes(path)) {
282
292
  // Field writes change the field faces; sheet metadata is dropped for the
283
293
  // same schema as a conservative guard.
284
294
  dropSchemaScoped([ENDPOINTS.fieldList, ENDPOINTS.sheetGet], schemaCodesFromBody(call.body));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stalfh233/omc-cli",
3
- "version": "0.8.17",
3
+ "version": "0.8.19",
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.17",
61
+ "omc-core": "0.8.19",
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.17"
79
+ "@stalfh233/omc-fake-platform": "0.8.19"
80
80
  }
81
81
  }
@@ -114,7 +114,7 @@ only the section for the capability you need —
114
114
  - **recipe**:`omc describe configure_form --example publish-default-form`
115
115
  - **边界 / 陷阱**:默认表单已存在,用 `configure_form`/`form.draft(rebuild)`/`form.publish(rebuild:true)` 改它,不要新建;改字段形状后刷新表单一调用 `form.publish rebuild:true`。
116
116
  - **每个模型交付前其默认表单必须已发布**:只建草稿=用户无法录入/查看。用 `configure_form` 或 `form.draft(rebuild:true)`+`form.publish` 发布。
117
- - **发布态以 `form.get` 的 `published`/`existDraft` 布尔为准**,不要看 `publishedControlCodes` 是否非空(草稿字段也非空,会误判)。交付前列出每个模型的 `form.get.published` 核对。
117
+ - **`form.get` 的 `published`/`existDraft` 是内容面结论**(`platformFlags` 才是平台 `bizsheet/get` 的原始标记位);`form.list` 的 `published` 仍是平台旗标,两者语义不同——判发布面内容用 `form.get`,不要用 `form.list` 旗标或 `publishedControlCodes` 是否非空。交付前列出每个模型的 `form.get.published` 核对。
118
118
  - **写业务数据的前提是先发布模型+表单**:正确顺序 = 建模型 → 发布字段(`field.publish`)→ 建并**发布**默认表单(`form.publish`)→ 才 `data.save`/`data.submit`。不要在建/未发布状态下写业务数据。
119
119
  - **表单按钮**:`form.publish {buttons:[…]}` 写 `options.customButtonJson` 并生成 `h_biz_button(triggerType=FORM)`;表单页显示还取决于流程节点 `buttonPermission.customBtns[].enabled`(设计器「表单操作」勾选)。执行用 `form.runButton`(带整条记录,区别于列表按钮的 `rule.run`)。
120
120