@stalfh233/omc-cli 0.8.34 → 0.8.36

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.
@@ -19,6 +19,7 @@ import { jsonBytes, summarizeValue } from "./support.js";
19
19
  * - `inlineKeys` ← 旧 `ALWAYS_INLINE_KEYS`(教学/证据键 + 字节上限)
20
20
  * - `shapePreservingKeys` ← 旧 `CODE_NAME_LIST_KEYS`(保形为 `code|name` 码表)
21
21
  * - `codeListKeys` ← 旧 `CODE_LIST_KEYS`(配置清单保形为裸码表)
22
+ * - `identifierListKeys` ← W47(`schemaCodes`/`absentModels`… 外置时仍为数组)
22
23
  * - `bulkyKeys` ← 旧 `BULKY_READ_KEYS`(压成 `*Count`,外置时补空占位)
23
24
  * - `nonContainerKeys` ← 旧 `NON_CONTAINER_KEYS`(回执派生数组不算结果容器)
24
25
  * - `containerKeys` ← 旧 `CONTAINER_NAME_KEYS` 的判定顺序
@@ -47,6 +48,15 @@ export const READ_SMALL_ROW_SET_LIMIT = 10;
47
48
  export const READ_TRIGGER_ROW_SET_LIMIT = 60;
48
49
  /** `code|name` 码表的内联对数上限(~1–2KB);更大的清单回退 count + artifact。 */
49
50
  export const READ_CODE_NAME_PAIR_LIMIT = 40;
51
+ /**
52
+ * 标识符清单(`schemaCodes`/`absentModels`/…)的内联条数上限。
53
+ *
54
+ * 2026-12 W47:这几个键的值**就是答案**(「本次问了哪些模型/规则」),不是正文
55
+ * bulk——3 个模型被折成 `{count:3,sha256,omitted}` 后,agent 无从知道读了哪些、
56
+ * 哪些缺席,只能去 artifact 再取一次。工具入参本身有批上限(≤20),这里的上限
57
+ * 只是防御:超过仍保形为数组(头 + count + truncated),不再退化成哈希。
58
+ */
59
+ export const READ_IDENTIFIER_LIST_LIMIT = 40;
50
60
  /** `rules` 瘦身行的内联上限(r62b-F3:9 条连名字都看不到曾逼二次取回)。 */
51
61
  export const READ_RULE_SLIM_LIMIT = 12;
52
62
  /** 教学串(`*Hint`)的内联上限;超过才摘要(0.6.91 真机:209B hint 被摘要)。 */
@@ -67,6 +77,11 @@ const ALWAYS_INLINE_KEYS = new Map([
67
77
  ["coverage", 1200],
68
78
  ["applicationResolution", 600],
69
79
  ["summaryHint", 600],
80
+ // W47(0.8.36d 真机):部分失败清单是**诊断回执**,不是结果 bulk——被折成
81
+ // `{count,sha256,omitted}` 后 `partial:true` 就没有任何可行动信息(哪条失败、
82
+ // 为什么)。≤2KB 原样内联;更大的失败清单仍在 artifact 里。
83
+ ["failed", 2000],
84
+ ["failures", 2000],
70
85
  ]);
71
86
  /** Config-inventory keys that compact to a code list (not a bare count). */
72
87
  const CODE_LIST_KEYS = new Set(["fields", "columns", "conditions", "sorts", "datarules", "buttons", "views", "sheets"]);
@@ -78,6 +93,11 @@ const CODE_LIST_KEYS = new Set(["fields", "columns", "conditions", "sorts", "dat
78
93
  const CODE_NAME_LIST_KEYS = new Set(["roles", "groups", "models", "departments", "workflows", "services", "methods"]);
79
94
  /** 节点类清单:参与者是扫描目标(r46 用户实测)——内联 `code:name@participant`。 */
80
95
  const ACTIVITY_LIST_KEYS = new Set(["activities"]);
96
+ /**
97
+ * 标识符清单:值是「这次覆盖了哪些 code」的事实(不是 bulk 正文)。外置时仍为
98
+ * 字符串数组,见 `READ_IDENTIFIER_LIST_LIMIT` 的说明。
99
+ */
100
+ const IDENTIFIER_LIST_KEYS = new Set(["schemaCodes", "absentModels", "ruleCodes", "modelCodes", "missingCodes"]);
81
101
  /**
82
102
  * Keys whose values are the bulk a compact projection replaces with a count.
83
103
  * Everything else is a small facet identity/decision fields (workflowCode,
@@ -211,11 +231,32 @@ function projectGenericEntry(policy, key, value) {
211
231
  [`${key}Count`]: value.length,
212
232
  };
213
233
  }
234
+ if (policy.identifierListKeys.has(key) && Array.isArray(value)) {
235
+ // W47(0.8.36d 真机回归):`rule.list --schemaCodes` 的 `schemaCodes`/
236
+ // `absentModels` 是「本次覆盖了哪些模型」的答案,通用摘要把它折成
237
+ // `{count,sha256,omitted}`——外置与内联不同形,调用方读不到自己问过的清单。
238
+ // 条数在工具入参批上限内(≤20)时原样内联;异常大的清单保留数组头 + count。
239
+ const entries = value;
240
+ const identifiers = entries.every((entry) => typeof entry === "string" || typeof entry === "number");
241
+ if (identifiers) {
242
+ if (entries.length <= READ_IDENTIFIER_LIST_LIMIT)
243
+ return { [key]: entries };
244
+ return { [key]: entries.slice(0, READ_IDENTIFIER_LIST_LIMIT), [`${key}Count`]: entries.length, [`${key}Truncated`]: true };
245
+ }
246
+ }
247
+ // 空数组没有 bulk 可藏:折成 `{count:0,sha256,omitted}` 只会把「确实没有」
248
+ // (例如 `failed: []` 的零失败)变成需要二次取回的噪声。空对象同理。
249
+ // 注意顺序:放在 bulky 分支**之后**,否则 `data: {}` 之类会丢掉 `<key>Count`
250
+ // 而改变 bulky 面的既有形状。
214
251
  if (policy.bulkyKeys.has(key)) {
215
252
  return {
216
253
  [`${key}Count`]: Array.isArray(value) ? value.length : value && typeof value === "object" ? Object.keys(value).length : 0,
217
254
  };
218
255
  }
256
+ if (Array.isArray(value) && value.length === 0)
257
+ return { [key]: [] };
258
+ if (value !== null && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0)
259
+ return { [key]: {} };
219
260
  // r28a 真机(2026-11-05)/ 2026-11-22(0.6.93 真机):见旧 read.ts 的一整段
220
261
  // 说明——小对象、教学串、`*Hint` 都不该被摘要成 `{count/keys,sha256,omitted}`。
221
262
  if (policy.inlineKeys.has(key) && jsonBytes(value) <= policy.inlineKeys.get(key)) {
@@ -248,6 +289,7 @@ export function defaultReadProjectionPolicy() {
248
289
  inlineKeys: ALWAYS_INLINE_KEYS,
249
290
  shapePreservingKeys: CODE_NAME_LIST_KEYS,
250
291
  codeListKeys: CODE_LIST_KEYS,
292
+ identifierListKeys: IDENTIFIER_LIST_KEYS,
251
293
  bulkyKeys: BULKY_READ_KEYS,
252
294
  nonContainerKeys: NON_CONTAINER_KEYS,
253
295
  };
@@ -290,9 +332,25 @@ export function externalizedShapePlaceholders(result, dropped) {
290
332
  placeholders.omittedNote = "被折叠的键保留空占位(保形:脚本可直接 .length/.map),真实内容是完整数据,用 detailArtifactId 取;空占位不代表 0 条。";
291
333
  return placeholders;
292
334
  }
335
+ /**
336
+ * F6(探针 Z,0.8.34):只有**真的有内容**的 bulky 键才算「被折叠外置」。
337
+ * 空数组/空对象/null/空串没有内容可搬,对它们宣称 `truncated:true` 只会让
338
+ * 调用方以为「0 条但被截断」(与 r57 的 `rules: []` 误读同族)。非空键照旧外置。
339
+ */
340
+ function bulkyKeyHasContent(value) {
341
+ if (value === null || value === undefined)
342
+ return false;
343
+ if (Array.isArray(value))
344
+ return value.length > 0;
345
+ if (typeof value === "object")
346
+ return Object.keys(value).length > 0;
347
+ if (typeof value === "string")
348
+ return value.trim().length > 0;
349
+ return true;
350
+ }
293
351
  /** 旧 `droppedShapeKeys`:语义投影里没有出现的 bulky 键。 */
294
352
  export function droppedShapeKeys(result, payload, policy = defaultReadProjectionPolicy()) {
295
- return Object.keys(result).filter((key) => policy.bulkyKeys.has(key) && !(key in payload));
353
+ return Object.keys(result).filter((key) => policy.bulkyKeys.has(key) && !(key in payload) && bulkyKeyHasContent(result[key]));
296
354
  }
297
355
  /**
298
356
  * Carry the handler's small top-level facets through a compact projection.
@@ -107,8 +107,8 @@ const READ_SHAPES = {
107
107
  notes: ["计数用 total(totalElements);分组=值域×count,key 是存储值/code,null 单列 nullBucket;分桶 count 并发窗口 4;数值指标(sum/avg/min/max+field)本地折叠(cap 1000,null 不进聚合、avg 分母排除 null);coverage.mode=server-total/paged-local-scan/local-scan/server-aggregate,/sum 不可用或形状不符回退本地(strategyFallback);complete:false 只覆盖已扫行,勿外推", "child=子表目标:count 走 list_child totalElements,数值列只拉目标列分页折叠"],
108
108
  },
109
109
  "app.list": {
110
- keys: ["applications:array<{code,name,groupId?,modelCount}>", "applicationsCount", "omitted"],
111
- notes: ["applicationsCount + omitted 与 discover 同构;omitted:false 表示内联即全集"],
110
+ keys: ["applications:array<{code,name,groupId?,modelCount}>", "applicationsCount", "omitted", "omittedCount?", "nextCommand?", "tablesHint?"],
111
+ notes: ["applicationsCount + omitted 与 discover 同构;omitted:false 表示内联即全集", "外置档默认只内联 20 条:all:true 取到 500 条,limit/offset 做客户端翻页(平台 apppackage/list 无分页参数,一次返回全量);omitted:true 时按 nextCommand 续取,或 --jq applications[].code 直接从 artifact 取"],
112
112
  },
113
113
  "model.list": {
114
114
  // Compact diet may rewrite models to "code|name" pairs and add modelsCount.
@@ -221,9 +221,10 @@ const READ_SHAPES = {
221
221
  // A2 locator:控件清单键 ↔ config.diff 的逐控件差异路径(BizFormModel.java:26-32
222
222
  // 六列分面存储,diff 按控件 key 对齐,前缀 view/attributes/html/actions)。
223
223
  locator: { controlCodes: "publishedControlCodes|draftControlCodes", diffPath: "changes[].path" },
224
- keys: ["present", "published", "publishedControlCodes", "draftControlCodes", "childColumnLocator?:{path,children[]}", "formButtonCodes?", "formButtons?", "customButtonJson?(full)", "customButtonJsonShapeWarning?"],
224
+ keys: ["present", "published", "publishedControlCodes", "draftControlCodes", "decorations[{key,type,row}]", "childColumnLocator?:{path,children[]}", "formButtonCodes?", "formButtons?", "customButtonJson?(full)", "customButtonJsonShapeWarning?"],
225
225
  notes: [
226
226
  "控件清单键是 publishedControlCodes/draftControlCodes,不是 controls;两面差异的逐控件路径在 config.diff changes[].path(前缀 view/attributes/html/actions,按控件 key 对齐)",
227
+ "非字段控件(200/202/203)在 decorations(html=options.name)",
227
228
  "表单按钮读 formButtonCodes/formButtons;full:true 另带 customButtonJson 数组原样(库里是字符串脏形时给 customButtonJsonShapeWarning——线上 #38 前端按钮不渲染,重写 buttons 自愈)",
228
229
  ],
229
230
  },
package/dist/read.js CHANGED
@@ -157,7 +157,9 @@ export async function governedRead(ctx, tool, args, execute, options = {}) {
157
157
  const plan = projectReadResult(result, {
158
158
  toolName: tool.name,
159
159
  full: options.full === true,
160
- ...(options.compact !== undefined ? { customProjection: (raw) => options.compact(raw, session) } : {}),
160
+ // issue #65:投影需要本次参数(app.list 的 all/limit/offset 决定内联多少条),
161
+ // 但前面的完整性短路/缓存键仍只看结果。传 args 是纯增量,旧的两参 compact 照旧可用。
162
+ ...(options.compact !== undefined ? { customProjection: (raw) => options.compact(raw, session, args) } : {}),
161
163
  });
162
164
  const rawBytes = plan.decision.bytes;
163
165
  if (options.full === true) {
@@ -56,11 +56,15 @@ const formConditionalRequired = Object.freeze({
56
56
  name: "请假事由",
57
57
  options: { requiredFormula: '{leave_amount} 大于 {"valueType":"custom","value":5000}' },
58
58
  },
59
- preconditions: ["目标字段与作为条件的字段都已发布", "这是门户表单交互层(真实门户打开表单、改条件字段值来验证控件是否变必填);**不要用 datarule.create**——实测 type4 不会让门户控件变必填,且符号式经 historyOpt 会让表单渲染崩溃"],
60
- conditionalRequirements: ["条件串:`{字段} 操作符 [值]`(操作符两侧留空格)。操作符用**中文**(真实设计器产出):等于/不等于/大于/小于/大于等于/小于等于/包含/不包含/包含全部/包含任意一个/等于任意一个/为空/不为空;也接受符号 == != > >= <= Contains IsEmpty。为空/不为空**不带值**(`{reason} 不为空`),其余带 JSON 值 {\"valueType\":...,\"value\":...}。多条件用 ` && `、多组用 ` || `。**不是** eq/gt/isnull——会让门户渲染 SyntaxError"],
59
+ preconditions: [
60
+ "目标字段与作为条件的字段都已发布",
61
+ "这是门户表单交互层(真实门户打开表单、改条件字段值来验证控件是否变必填);**不要用 datarule.create**——实测 type4 不会让门户控件变必填,且符号式经 historyOpt 会让表单渲染崩溃",
62
+ "**权威面 = 字段级 `options.requiredFormula`**(本 recipe)。控件级同名键(`form.draft` 的 `draftAttributesJson.<控件>.options.requiredFormula`)是派生面:设计器保存会按字段元数据/规则行重建控件,手写控件级会被清空(**已在 8.1.108 真机连续 3 次验证**;**其他版本需真机采样**)。不要手写控件级;回执 `requiredFormulaDrift` 点名时改字段级。",
63
+ ],
64
+ conditionalRequirements: ["条件串:`{字段} 操作符 [值]`(操作符两侧留空格),字段级写入自动配对 bizdatarule type4。操作符用**中文**(真实设计器产出):等于/不等于/大于/小于/大于等于/小于等于/包含/不包含/包含全部/包含任意一个/等于任意一个/为空/不为空;也接受符号 == != > >= <= Contains IsEmpty。为空/不为空**不带值**(`{reason} 不为空`),其余带 JSON 值 {\"valueType\":...,\"value\":...}。多条件用 ` && `、多组用 ` || `。**不是** eq/gt/isnull——会让门户渲染 SyntaxError"],
61
65
  priorToolReferences: [{ tool: "field.list", args: { environment, schemaCode: model, published: true }, purpose: "确认条件字段与目标字段都已发布" }],
62
66
  dryRun: { supported: true, command: `omc call field.update --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 校验字段 options 形状,不写入" },
63
- expectedReadback: { readback: { field: { code: "leaveReason", options: { requiredFormula: "<protocol>" } } }, next: ["(一调)field.update cascadeRepublish:true", "(分步)field.publish → form.draft(rebuild) → form.publish", "(只刷新表单)form.publish rebuild:true"] },
67
+ expectedReadback: { readback: { field: { code: "leaveReason", options: { requiredFormula: "<protocol>" } } }, verification: "字段级回读 field.get full:true → options.requiredFormula;控件级用 form.get controls:true 读 draftAttributesJson(派生面,应一致);设计器保存后应仍在门户生效(点验:改条件字段值看控件必填)。requiredFormulaDrift 为空即对齐。", next: ["(一调)field.update cascadeRepublish:true", "(分步)field.publish → form.draft(rebuild) → form.publish", "(只刷新表单)form.publish rebuild:true"] },
64
68
  refusalRecovery: [
65
69
  { code: "capability-out-of-coverage", action: "条件串用中文或符号操作符(等于/大于/不为空 或 == />/IsEmpty);恒必填用字面量 \"true\"" },
66
70
  ...commonRecovery,
@@ -95,8 +95,58 @@ const formDraftTwoColumn = Object.freeze({
95
95
  ],
96
96
  requiresEnvironmentDerivedIds: false,
97
97
  });
98
+ /**
99
+ * GitLab issue #57(CloudPivot 8.1.108):设计器「描述说明」控件(type 202)的正文
100
+ * 是 `options.name` 里的整段 HTML(前端 template.ts:185 + 移动端
101
+ * `innerHTML` 渲染分支)。此前只能由用户在设计器手加,rebuild 还会清空。
102
+ * 配方给一个可直接抄的红字提示形状;`decorations` 是增量面,不必回传整包 attrs。
103
+ */
104
+ const formDraftDescription = Object.freeze({
105
+ id: "form-description-block",
106
+ title: "表单加描述块/红色说明文字(类型 202 布局控件,HTML 写 options.name)",
107
+ aliases: ["描述块", "描述控件", "描述说明", "富文本说明", "红字提示", "说明文字"],
108
+ status: "offline-valid",
109
+ tool: "form.draft",
110
+ args: {
111
+ environment,
112
+ schemaCode: model,
113
+ decorations: [
114
+ {
115
+ type: 202,
116
+ html: '<div style="color:#e02020">如涉及二级图纸归档,需明确产品是否做小批试制</div>',
117
+ span: 24,
118
+ },
119
+ ],
120
+ },
121
+ preconditions: [
122
+ "表单已有控件面(先 configure_form 或 form.draft 把字段绑进表单);decorations 是增量面,不负责从零建表",
123
+ "202 的正文是 html(写进 options.name,设计器同形,按 innerHTML 渲染);200 分组标题 / 203 表单标题用 name 纯文本",
124
+ "**存储/发布/读回已在 2.1.5 验证;门户设计器渲染未验证**(需 8.1.108 或真页采样)——写完务必门户打开表单点验,不要只凭 form.get 回执宣称渲染正常",
125
+ "key 省略自动生成 Description<序号>;带 key 命中既有布局控件=改它(其余 options 原样保留)",
126
+ "row 是 1-based 插入行(省略=末尾追加一行);span ∈ 6/8/12/16/18/24,插入已占满的行会拒 form-decoration-row-full",
127
+ "decorations 与 draftViewJson/draftAttributesJson/layout/rebuild/fieldCodes/childColumns 互斥",
128
+ ],
129
+ conditionalRequirements: [
130
+ "写完必须 form.publish 才在门户生效;验收用 form.get 的 `decorations`(html 原文 + row)核对,不要整包 diff",
131
+ "rebuild:true 会原样保留 202 描述块(含 displayFormula);额外的分组标题/表单标题会被 fail-closed 拒绝并在 losing 列出",
132
+ ],
133
+ priorToolReferences: [
134
+ { tool: "form.get", args: { environment, schemaCode: model }, purpose: "确认表单已有控件面,并看 decorations 里已有的描述块 key/row" },
135
+ ],
136
+ dryRun: { supported: true, command: `omc call form.draft --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 跑同一个 composeFormDecorationsDraft:回执 decorations.added/rows 就是真写会写下的控件,零 wire 写入" },
137
+ expectedReadback: {
138
+ readback: { decorations: { added: [{ type: 202 }] }, next: ["form.publish", "form.get 核对 decorations"] },
139
+ },
140
+ refusalRecovery: [
141
+ { code: "form-decorations-no-baseline", action: "先用 configure_form 或 form.draft 把已发布字段绑进表单,再加描述块" },
142
+ { code: "form-decoration-param-conflict", action: "decorations 是增量面:只传 decorations,不要同时传整包 draftViewJson/draftAttributesJson 或 rebuild" },
143
+ { code: "form-decoration-row-full", action: "省略 row 让描述块单独占一末行;或换到尚有 24 栅格余量的行;或显式传合法的 span" },
144
+ ...commonRecovery,
145
+ ],
146
+ requiresEnvironmentDerivedIds: false,
147
+ });
98
148
  export const FORM_METADATA = Object.freeze({
99
149
  "configure_form": Object.freeze({ recipes: [configureFormRecipe], relatedTools: ["field.list", "field.update", "listview.create", "listview.get"] }),
100
- "form.draft": Object.freeze({ recipes: [formDraftTwoColumn], relatedTools: ["field.list", "field.publish", "form.get", "form.publish"] }),
150
+ "form.draft": Object.freeze({ recipes: [formDraftTwoColumn, formDraftDescription], relatedTools: ["field.list", "field.publish", "form.get", "form.publish"] }),
101
151
  });
102
152
  //# sourceMappingURL=form.js.map
@@ -91,13 +91,14 @@ const workflowSubmit = Object.freeze({
91
91
  "workItemId 或 workflowInstanceId 出现时必须传 bizObjectId;身份只能复制 data.save 的 authoritative readback",
92
92
  "**审批提交(workItemId/workflowInstanceId)只传主表字段**:formData 里不要带子表数组——平台按「追加行」再插一份(真机 2→6 行),CLI 默认拒 `submit-approval-child-rows`。子表数组只在保存/首次提交时带;确要在审批中追加子行才显式传 allowChildRowAppend:true",
93
93
  "子表读回顺序按 sortKey ASC(平台固定排序):**新建**保存/提交时 CLI 会给缺 sortKey 的子行按数组下标补 1..n(显式值保留);更新既有记录请显式带 sortKey,否则 null 排序不保证",
94
+ "节点字段权限(editable/visible)只是门户读面膜:REST 提交/普通更新都不校验(回执 nodeFieldPermissionNote)",
94
95
  ],
95
96
  priorToolReferences: [
96
97
  { tool: "data.save", args: { environment, schemaCode: model, workflowCode: "<workflow.code>", formData: { name: "recipe draft" } }, purpose: "提供三个环境生成的提交身份" },
97
98
  { tool: "workitem.list", args: { environment }, purpose: "当 data.save 未直接返回 workItemId 时按 workflowInstanceId 解析待办" },
98
99
  ],
99
100
  dryRun: { supported: true, command: `omc call data.submit --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 验证两段式参数关系,不推进 workflow" },
100
- expectedReadback: { performed: { formType: "1" }, readback: { sequenceStatus: "COMPLETED", workflowInstanceId: "<same-as-data.save>", workItemId: "<same-as-data.save>" } },
101
+ expectedReadback: { performed: { formType: "1" }, readback: { sequenceStatus: "COMPLETED", workflowInstanceId: "<same-as-data.save>", workItemId: "<same-as-data.save>", nodeFieldPermissionNote: "<带 formData 的审批提交回:节点权限只作用门户读面膜>" } },
101
102
  refusalRecovery: [
102
103
  { code: "submit-biz-object-id-required", action: "把 data.save 的 bizObjectId 原样传给 data.submit" },
103
104
  { code: "submit-existing-workflow-unsupported", action: "不要用旧行 + workflowCode 启动;先 data.save 新建 DRAFT,再用返回 workItemId 提交" },
@@ -75,6 +75,10 @@ const KEY_RULES = Object.freeze({
75
75
  nodeGraph: { cls: "user", source: "规则图(节点/动作/条件)是需求本体", user: "utterance" },
76
76
  draftViewJson: { cls: "user", source: "表单布局行分组是需求本体", user: "utterance" },
77
77
  draftAttributesJson: { cls: "user", source: "控件属性(span/options)是需求本体", user: "utterance" },
78
+ // issue #57(0.8.36):form.draft 的 decorations(非字段布局控件 200/202/203)——
79
+ // 正文(202 的 html 写 options.name)与行位/span 是需求本体;key/row 省略时由工具
80
+ // 自动生成(参数内部默认,不是独立槽位)。来源 recipe:form-description-block。
81
+ decorations: { cls: "user", source: "描述块/分组标题的正文与行位是需求本体", user: "utterance" },
78
82
  handler: { cls: "user", source: "绑定哪个流程事件(start/cancel/activate/end)由需求决定", user: "utterance" },
79
83
  methodName: { cls: "user", source: "方法名属于接口契约", user: "utterance" },
80
84
  methodConfig: { cls: "user", source: "HTTP 契约来自外部接口文档", user: "utterance" },
@@ -80,6 +80,20 @@ export function deliveryStateFor(readback) {
80
80
  deliveryState: "WRITE_UNVERIFIED",
81
81
  readbackWarning: "目标是删除级联中:平台 async 任务未完成(readback.allAbsent=false,见 perCode 逐项),勿当成功——稍后重跑本工具(幂等)复核",
82
82
  };
83
+ // issue #65:权威读回里有「请求值与落库值不一致」的字段级证据 → 请求送达但
84
+ // 写入未被证明。平台会静默忽略自动生成/规则/权限字段(真机:8 条 data.update
85
+ // 的 name 全被数据标题覆盖,回执仍是 DELIVERED)。envelope 保持 ok(不误升
86
+ // uncertain),只收回 DELIVERED。
87
+ const fieldWriteMismatch = Array.isArray(record?.fieldWriteMismatch) ? record.fieldWriteMismatch : [];
88
+ if (fieldWriteMismatch.length > 0) {
89
+ const fields = fieldWriteMismatch
90
+ .map((entry) => (entry !== null && typeof entry === "object" ? String(entry.field ?? "") : ""))
91
+ .filter((field) => field.length > 0);
92
+ return {
93
+ deliveryState: "WRITE_UNVERIFIED",
94
+ readbackWarning: `读回与本次提交不一致${fields.length > 0 ? `:${fields.join("、")}` : ""}(见 fieldWriteMismatch)——平台可能忽略该字段(自动生成/数据标题/规则重算/权限)。请求已送达,但本次写入未被证明:先 data.load 复核;需要真正落地请改自建业务字段或去掉自动生成规则,勿当作已完成`,
95
+ };
96
+ }
83
97
  return { deliveryState: "DELIVERED" };
84
98
  }
85
99
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stalfh233/omc-cli",
3
- "version": "0.8.34",
3
+ "version": "0.8.36",
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.34",
61
+ "omc-core": "0.8.36",
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.34"
79
+ "@stalfh233/omc-fake-platform": "0.8.36"
80
80
  }
81
81
  }
@@ -128,7 +128,7 @@ rules:
128
128
  - **每个 filter 项必须有且只有一个条件来源**:`from`(动态 EQ)或一个比较键(`equals`/`notEquals`/`gt`/`gte`/`lt`/`lte` + 标量)。缺来源 `intent-rule-leaf-source-missing` 拒绝;**绝不**静默成 `EQ null`。
129
129
  - 动作节点的条件分「定位数据」与「执行门」两类,**别混**(详见下「规则图的触发条件」)。
130
130
  - **跨模型 UPDATE 目标查找键=`filterCondition.mainConditions`**(`[[{targetSchemaDataItem, ruleConditionType, ruleValueType, value|currentSchemaDataItem}]]`,非触发条件的 conditionGroups——错键静默反序列化为空,引擎恒报「查找范围不存在数据」形似跨模型不可用,r42 曾误判;校验 `rule-graph-filter-condition-wrong-key` 已拦)。连坑:叶取值键 `value` 非 fixedValue;`rule.node.update` 只写 DRAFT,改完须 `rule.enable`/`--publish` 重发布才生效。
131
- - **跨模型写(`targetObjectCode`≠规则模型)平台支持、可运行时生效**(2026-09-28 真机复核)。两个前提:① 承载它的规则必须真的触发——`Create` 规则在提交时触发;`Update` 规则只在 `data.update` 触发,**submit 不执行它**(放进 `Update` 是典型静默空转,lint 警告 `rule-graph-cross-model-update-trigger-inert`;也可绑定流程事件如 `end`)。② 目标行必须已提交——目标查询不匹配 DRAFT 行,`data.save` 未 submit 的行不回写。
131
+ - **跨模型写(`targetObjectCode`≠规则模型)平台支持、可运行时生效**(真机)。两个前提:① 规则必须真的触发——`Create` 在提交时触发;`Update` 只在 `data.update` 触发,**submit 不执行它**(放进 `Update` 是典型静默空转,lint 警告 `rule-graph-cross-model-update-trigger-inert`;可改绑流程事件如 `end`)。② 目标行必须已提交——目标查询不匹配 DRAFT 行,`data.save` 未 submit 的行不回写。
132
132
  - 关联字段:`type: WORK_SHEET` + `relativeCode: <目标模型>` + `options.displayField`,与 `field.create` 行形状一致。(键名是 `relativeCode`,wire 键 `relativeSchemaCode`,别混。)
133
133
  - 节点显示名用 activity 级的 `name`(`participant.name` 只作参与者说明,平台不认作节点名;`{type: Originator, name: 部门负责人}` 会被工具提升为节点名)。
134
134
  - **字段级数据规则**(`models[].datarules[]`,`dataRuleType` 1校验/2计算/3拼接/4必填/5只读)——注意是 `dataRuleType`(不是 `type`):
@@ -136,7 +136,7 @@ rules:
136
136
  datarules:
137
137
  - { propertyCode: order_note, dataRuleType: 4, options: { requiredFormula: '{amount} 大于 {"valueType":"custom","value":5000}' }, name: 金额超5000说明必填 }
138
138
  ```
139
- ⚠️ **type 3/4/5 不驱动门户表单控件**(真机复核):平台存成 bizdatarule,只镜像进控件 `historyOpt`,运行时门户读的是控件 `options`。门户条件(如「金额>5000 时必填」)必须写在 `fields[].options`(`requiredFormula`/`readonlyCondition`/`shortTextStitch`);写进 `datarules[]` 设计器可见但门户不拦(validate/plan 给 `datarule-not-portal-facing` 警告)。datarule 只用于服务端引擎(校验/计算)。未声明 `sortKey` = 顺序归平台、不参与比较;显式声明才严格比较。
139
+ ⚠️ **type 3/4/5 不驱动门户表单控件**:平台存成 bizdatarule,只镜像进控件 `historyOpt`,运行时门户读的是控件 `options`。门户条件必须写在 `fields[].options`(`requiredFormula`/`readonlyCondition`/`shortTextStitch`);写进 `datarules[]` 设计器可见但门户不拦(`datarule-not-portal-facing` 警告)。datarule 只用于服务端引擎。未声明 `sortKey` = 顺序归平台、不参与比较;显式声明才严格比较。
140
140
 
141
141
  - 规则排在字段发布之后(编译器按能力排序:先建全部模型/字段,再跑规则)。
142
142
  - `rule.save` 只写草稿;`enabled` 由 `rule.enable` 保证(publish+启用)——readback 用 `enabled` 和**语义图摘要**(忽略画布几何)判等价。
@@ -144,13 +144,14 @@ rules:
144
144
  ## 表单与视图
145
145
 
146
146
  - 新字段加入已有表单:`form.publish --args '{...,"rebuild":true}'` 一步(重建脚手架+强制提拔);或分步 `form.draft --rebuild` → `form.publish`。
147
- - rebuild 会保留已识别的关系映射、显示和布局 options;Sheet201 columns 按最新子表字段刷新。
148
- - **配置列表视图用 `listview.configure`(省略 `code` 即平台自动生成的默认视图 code=schemaCode),不要先 `listview.create`——那会多出一个视图。** 只有确实要第二个视图才 create;两者职责分开。
147
+ - rebuild 保留关系映射、显示/布局 options 与 202 描述块,Sheet201 columns 按最新子表字段刷新;额外 200/203 实例 fail-closed 列于 `losing`。
148
+ - **描述块/描述控件(红色说明、富文本说明)**(设计器「描述说明」= 布局控件 type 202,非字段):正文是 `options.name` 里的 HTML;`form.draft {decorations:[{type:202,html:"<div style=\"color:#e02020\">…</div>"}]}` 增量加,`form.get` 的 `decorations` 核对;200/203 同面。
149
+ - **配置列表视图用 `listview.configure`(省略 `code` 即平台默认视图 code=schemaCode),不要先 `listview.create`——那会多出一个视图**;确实要第二个视图才 create。
149
150
  - 数值控件:`scale` 是小数位数(0=整数,1=1位,2=2位…);「金额两位小数」用 `scale:2`。列表列 displayFormat 由 scale 推导。
150
- - **`percentile` 不是百分比**(高频误读,2026-10-30 现场反馈):表单控件的 `format` 里 `integer`(200) / `tenths`(2,000.0) / `percentile`(2,000.00) 都是小数位;**百分比要带 `ratio` 词**——`ratio`(20%) / `ratio.tenths`(20.0%) / `ratio.percentile`(20.00),货币用 `RMB.*`/`dollar.*`。字段行 `options.format` 缺 `scale` 时控件按平台默认 `integer` 生成(不是两位小数),所以「金额」务必显式 `scale:2`。
151
+ - **`percentile` 不是百分比**(高频误读):`format` 里 `integer`/`tenths`/`percentile` 都是小数位;**百分比要带 `ratio` 词**(`ratio`/`ratio.tenths`/`ratio.percentile`),货币 `RMB.*`/`dollar.*`。字段 `options.format` 缺 `scale` 时按 `integer` 生成,金额务必显式 `scale:2`。
151
152
  - **列表列只放业务字段**:平台 `listview.create` 会预置系统列(`name/creater/createdTime/sequenceNo`)和一条 `createdTime` 默认筛选;intent 的 `fieldCodes` 是权威集合,编译器用 `replaceColumns:true + hideDefaultSystemFields:true + conditions:[]` 清掉预置项。要展示某系统列/筛选就显式点名。
152
153
  - 筛选条件默认显示:`conditions[].visible` 不传也应为 true。
153
- - 配置默认视图后即可用 `data.list`;否则部分 8.6.26 读面业务列可能为 null,单行用 `data.load` 核对。
154
+ - 配置默认视图后 `data.list` 才有业务列;单行核对用 `data.load`。
154
155
  - 读回视图用 `listview.get`(默认回列/排序/条件/动作紧凑清单)与 `listview.list`。
155
156
  - **model.create 不自动发布表单页**(r65 真机):模型建好 ≠ 门户有页面——直接打开会回「form is unpublished」。要 `form.publish` + `listview.configure`(默认视图)后门户才有页面可看。
156
157
  - **门户页面 URL 模式**(r65 真机取证,验收/取证用):
@@ -116,6 +116,7 @@ only the section for the capability you need —
116
116
  - **每个模型交付前其默认表单必须已发布**:只建草稿=用户无法录入/查看。用 `configure_form` 或 `form.draft(rebuild:true)`+`form.publish` 发布。
117
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
+ - **条件必填/只读/显示的权威面是字段级 `options`**(`field.update` 写 `requiredFormula`/`readonlyCondition`/`displayFormula`,自动配对 bizdatarule)。控件级同名键(`form.draft` 的 `draftAttributesJson.<控件>.options.*`)是**派生面**:平台设计器保存会按字段元数据/规则行重建控件,手工写控件级会被清空(**已在 8.1.108 真机验证;其他版本需真机采样**)。不要手写控件级;`form.draft`/`form.publish` 回执的 `requiredFormulaDrift` 点名不一致时改字段级。recipe:`omc describe field.update --example form-conditional-required`。
119
120
  - **表单按钮**:`form.publish {buttons:[…]}` 写 `options.customButtonJson` 并生成 `h_biz_button(triggerType=FORM)`;表单页显示还取决于流程节点 `buttonPermission.customBtns[].enabled`(设计器「表单操作」勾选)。执行用 `form.runButton`(带整条记录,区别于列表按钮的 `rule.run`)。
120
121
 
121
122
  ## 列表视图 `listview`