@stalfh233/omc-cli 0.8.14 → 0.8.16

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/write.js CHANGED
@@ -16,21 +16,49 @@ import { isPackageStopOutcome } from "./package.js";
16
16
  import { writeSummary } from "./human-summary.js";
17
17
  import { planFor } from "./plan.js";
18
18
  import { isUncertainWireError, sha256, wireErrorKind, writeArtifact } from "./support.js";
19
+ import { refusalFromWireError } from "./wire-refusal.js";
19
20
  import { appendJournalEntry } from "./journal.js";
20
21
  import { journalAudit } from "./write-audit.js";
21
22
  import { capabilityArg, confirmProductionArg, environmentArg, WRITE_PROTOCOL } from "./args.js";
22
- import { plannableArgsRaw } from "./plan.js";
23
- import { defineTool, ToolRefusalError } from "./tool-types.js";
23
+ import { plannableArgs, plannableArgsRaw } from "./plan.js";
24
+ import { defineTool, isRequiredAlternativePlaceholder, ToolRefusalError } from "./tool-types.js";
24
25
  import { assertFieldFamilyAllowed } from "./field-families.js";
25
26
  import { validateBusinessCode, validateFieldEntryCodes } from "./code-rules.js";
26
27
  import { hardLayoutViolations, validateFormLayout } from "./form-layout.js";
27
28
  import { prepareRuleGraph, validateRuleNodeGraph } from "./lanes/rule-graph.js";
28
29
  import { assertRuleNamePlatformAcceptable } from "./rule-support.js";
29
- import { WireError, optionPublishMessages } from "./wire.js";
30
+ import { WireError } from "./wire.js";
30
31
  /**
31
32
  * The shared governed write pipeline and the low-level write registration
32
33
  * factory every lane adapter uses.
33
34
  */
35
+ /**
36
+ * The required-alternative placeholder is a validation-time internal value, not
37
+ * a parameter fact. `admitGovernedWrite` builds the plan from the RAW args before
38
+ * `writeLint` runs; the lint may then resolve a placeholder into a real value
39
+ * (workflow.delete's schemaCode reverse lookup). The dry-run receipt must preview
40
+ * the RESOLVED action args — otherwise it shows `__omc-required-alternative__`
41
+ * as if it were a real schemaCode. Real writes / rollback / journal already read
42
+ * the resolved args, so they are untouched.
43
+ */
44
+ function containsRequiredPlaceholder(value) {
45
+ if (isRequiredAlternativePlaceholder(value))
46
+ return true;
47
+ if (Array.isArray(value))
48
+ return value.some(containsRequiredPlaceholder);
49
+ if (value !== null && typeof value === "object")
50
+ return Object.values(value).some(containsRequiredPlaceholder);
51
+ return false;
52
+ }
53
+ function planWithResolvedArgs(plan, toolName, args) {
54
+ const unresolved = plan.actions.some((action) => action.tool === toolName && containsRequiredPlaceholder(action.args));
55
+ if (!unresolved)
56
+ return plan;
57
+ return {
58
+ ...plan,
59
+ actions: plan.actions.map((action) => (action.tool === toolName ? { ...action, args: plannableArgs(toolName, args) } : action)),
60
+ };
61
+ }
34
62
  /**
35
63
  * Shared governed write pipeline: coverage gate → environment write permission
36
64
  * → session → version evidence (advisory: recorded as `versionEvidence:"absent"`,
@@ -69,7 +97,7 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
69
97
  ? (plan, session) => dryRunPayload(session, args).then((payload) => ({
70
98
  status: "dry-run",
71
99
  wouldChange: true,
72
- plan,
100
+ plan: planWithResolvedArgs(plan, tool.name, args),
73
101
  idempotency: idempotencyDeclaration(tool.name, "none"),
74
102
  lintScope: lintDeclaration.lintScope,
75
103
  ...(lintDeclaration.lintUnchecked.length > 0 ? { unchecked: [...lintDeclaration.lintUnchecked] } : {}),
@@ -143,166 +171,8 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
143
171
  };
144
172
  if (error instanceof ToolRefusalError)
145
173
  throw error;
146
- if (error instanceof WireError) {
147
- // F3: rule-node runtime failures are masked by the platform as 300004.
148
- if (error.errcode === 300004) {
149
- // T20(2026-11-24):2.1.5 的树形自定义下拉发布门把「选项非法」包成
150
- // 外层 300004「数据模型不存在!」+ data 里的逐项 301013「…数据项的
151
- // 选项设置有误」(BizSchemaCheckServiceImpl :60-66)。payload 命中时
152
- // 必须比业务规则运行时异常的解释更优先,否则用户会去查 rulelog。
153
- const platformMessages = optionPublishMessages(error.payload);
154
- if (platformMessages.length > 0) {
155
- return {
156
- status: "refused",
157
- blocker: "field-options-publish-invalid",
158
- errcode: 300004,
159
- platformMessages,
160
- message: `平台在发布时拒绝了字段选项(外层 300004「数据模型不存在!」只是外壳,明细 301013):${platformMessages.join(";")}。` +
161
- "这是 2.1.5+ 的树形自定义下拉发布门,不是模型缺失或业务规则运行时异常:optionsSet.optionsType=\"custom\" + optionStructure=\"tree\" 时," +
162
- "每个节点的 code(平台内部叫选项编码,口语叫 key)与 value(显示值)必须非空,且 code 全树唯一(RadioOptionsModel.validateCustomTreeOptions,launcher-2.1.5 .../bizmodel/RadioOptionsModel.java:130-142)。" +
163
- "8.6/8.7 不查;平铺自定义/字典/业务模型下拉也不查。",
164
- nextCommand: "omc call field.list --args '{\"schemaCode\":\"<model>\",\"published\":false}'",
165
- nextAction: "核对报错字段的 optionsSet.custom 树,用 field.update 补非空 code/value;不需要层级就把 optionStructure 改成 \"flat\" 后重发",
166
- };
167
- }
168
- return {
169
- status: "refused",
170
- blocker: `wire-${error.kind}`,
171
- errcode: 300004,
172
- // 探针 F(0.8.11):真机 2.1.5 上子表子 schema code = 父模型的
173
- // CHILD_TABLE(8) 字段 code(`BizPropertyManagerImpl.java:197` 用
174
- // `bizProperty.getCode()` 建子 schema),不是 `<model>_items`
175
- // 约定名。先分叉再查 rulelog,否则 agent 会去翻不存在的规则。
176
- message: `${error.message}——先分叉:① 若 schemaCode 是子表列,子表的子 schema code = 父模型的 CHILD_TABLE(8) 字段 code(不是 \`<model>_items\`),先 field.list 父模型找 type:8 字段的 code;② 若 modelPresent:true 且 form 已发布,这个 300004 大概率是业务规则节点运行时异常,不是模型缺失;先查 rulelog 的 EXCEPTION/ROLLBACK,再看最近改动的规则。`,
177
- nextCommand: "omc call field.list --args '{\"schemaCode\":\"<父模型>\"}'",
178
- nextAction: "在回执里找 type:8(CHILD_TABLE)字段的 code——父字段 code 就是子 schema code;用它对子列重试。确认不是子表问题后,再按 diagnostic 查 rulelog 的 EXCEPTION/ROLLBACK",
179
- diagnostic: "omc call rulelog.search --args '{\"schemaCode\":\"<model>\",\"includeNodes\":true}';再用 rule.get 检查最近改动规则,隔离法是暂时删/禁规则后重试",
180
- };
181
- }
182
- // authine-orm Serializer.update/delete throws "Object <id> is not
183
- // serialized." when the entity handle was never loaded from the store.
184
- // That is a PLATFORM object-state error, not a shape error — reported as
185
- // `wire-business` the caller reads "my JSON is wrong" and retries the
186
- // wrong thing (r12 A6: rule.save on a preset Create row, self-healed by
187
- // delete+rebuild). Name the state and the two recoveries.
188
- if (/is not serialized|does not serialized/i.test(error.message))
189
- return {
190
- status: "refused",
191
- blocker: "orm-object-state",
192
- errcode: error.errcode,
193
- message: `${error.message}——这是平台 ORM 的对象状态错误(Serializer.update/delete 要求实体先被装载),不是入参或规则图的形状问题。` +
194
- "同一份入参再保存一次通常即恢复。持续复现就换行:rule.delete 后重建(rule.save 会铸新记录),或用 rule.get 读回完整行再 rule.node.update 改一处——不要继续重试同一份 payload。",
195
- };
196
- // r30a F10:errcode 40000「调用数据库发生异常」曾单向判「平台侧故障,勿改参数」。
197
- // 线上 #38(摩擦 B,詹记 8.6.26)实证反向成因:创建类写入缺非空列时平台同样
198
- // 回 40000(rule.save 的 methodMapping 缺 serviceName/serviceMethodName/methodCode;
199
- // form.draft/publish 的 button 缺 triggerCode/triggerType/showPermCode/showPermType),
200
- // 照「勿改参数硬重试」引导原地打转。引导必须双向:先分叉成因再动手。
201
- if (error.errcode === 40000 || /调用数据库发生异常/.test(error.message))
202
- return {
203
- status: "refused",
204
- blocker: `wire-${error.kind}`,
205
- errcode: error.errcode,
206
- "platform-fault": true,
207
- message: `${error.message}——40000「调用数据库发生异常」是无明细掩码,两种常见成因(线上 #38 实证):` +
208
- "① 真·平台故障(DB/ORM 层,重试/查平台日志);" +
209
- "② 创建类写入缺非空列——rule.save 的 methodMapping 缺 serviceName/serviceMethodName/methodCode、form.draft/publish 的 button 缺 triggerCode/triggerType/showPermCode/showPermType 时同样回 40000(照 recipe 最小示例形状新建必炸;对照已成功落库的同族配置补齐字段后一次成功)。",
210
- nextAction: "先分叉:本次是照示例新建/改配置吗?是→按成因②对照一条已成功配置(rule.get/form.get 读回)补齐非空列字段再重试;否→按成因①稍后重试同一请求,持续复现查平台 DB/ORM 日志",
211
- ...(error.diagnostic ? { diagnostic: error.diagnostic } : {}),
212
- };
213
- // 2.1.5(AI-Platform v2.1.5)提交新增「隐藏字段」校验:规则引用的隐藏字段
214
- // 也必须出现在 payload 里,否则 409200。8.6/8.7 没有这一道,旧调用方按
215
- // 「只传可见字段」构造会被拒。
216
- if (error.errcode === 409200)
217
- return {
218
- status: "refused",
219
- blocker: `wire-${error.kind}`,
220
- errcode: 409200,
221
- "platform-version": "2.1.5+",
222
- message: `${error.message}——2.1.5 起提交会校验**隐藏字段**(409200 HIDDEN_PROPERTY_SUBMIT_FAIL):数据规则引用的字段即使表单不可见,也必须出现在 formData/bizObject.data 里;8.6/8.7 不做这道校验。`,
223
- nextAction: "先 data.load/form.get 读回该记录(隐藏字段有真值),把缺失字段补进 payload 再提交;不要靠删字段绕过——规则仍会命中",
224
- nextCommand: "omc call data.load --args '{\"schemaCode\":\"<model>\",\"bizObjectId\":\"<id>\"}'",
225
- };
226
- // 2.1.5 起新增的「格式/长度/维护锁」错误码(8.6 这些场景回 10005/40000/50000,
227
- // 没有可读码)。不改变判定,只把码翻成人话 + 下一步。
228
- if (error.errcode === 309056 || error.errcode === 309057) {
229
- const kind = error.errcode === 309056 ? "名称" : "code";
230
- return {
231
- status: "refused",
232
- blocker: `wire-${error.kind}`,
233
- errcode: error.errcode,
234
- "platform-version": "2.1.5+",
235
- message: `${error.message}——2.1.5 起平台统一用 309056/309057 校验${kind}格式(8.6 是零散的 10005):名称 1–60 字符且不能以空格开头;code 必须字母开头、≤60、只含 A-Za-z0-9_。`,
236
- nextAction: `按上述规则改 ${kind}后重试;不要靠换中文/特殊字符绕过`,
237
- };
238
- }
239
- if (error.errcode === 601016 || error.errcode === 601019)
240
- return {
241
- status: "refused",
242
- blocker: "schema-maintenance-locked",
243
- errcode: error.errcode,
244
- "platform-version": "2.1.5+",
245
- message: `${error.message}——模型正在做表结构变更/层级路径维护(2.1.5 新增 601016/601019),期间不接收写入;这是**暂时锁**,不是参数错。`,
246
- nextAction: "等维护结束(或联系平台管理员确认迁移任务)后重试同一请求;不要改参数硬重试",
247
- };
248
- if (error.errcode === 700000)
249
- return {
250
- status: "refused",
251
- blocker: "value-length-out-of-bounds",
252
- errcode: 700000,
253
- "platform-version": "2.1.5+",
254
- message: `${error.message}——列长度溢出首次被翻译成 700000(8.6 只会回 40000/50000);先核对该字段的库列长度或 options 限制。`,
255
- nextAction: "缩短该字段值,或改字段长度(field.update → field.publish)后重试",
256
- };
257
- if (error.errcode === 550038)
258
- return {
259
- status: "refused",
260
- blocker: "inherited-rule-readonly",
261
- errcode: 550038,
262
- "platform-version": "2.1.5+",
263
- message: `${error.message}——该业务规则继承自父级(2.1.5 新增继承机制),不能直接改/删/发布/启停。`,
264
- nextAction: "到父级模型改规则,或用 rule.references 确认继承来源后再决定",
265
- };
266
- if (error.errcode === 401085)
267
- return {
268
- status: "refused",
269
- blocker: "workflow-activity-name-invalid",
270
- errcode: 401085,
271
- "platform-version": "2.1.5+",
272
- message: `${error.message}——2.1.5 的流程发布新增节点名校验:非空且 ≤80 字符单位(中文按 2 计),ERROR 级会让 publish 整体不发布。`,
273
- nextAction: "workflow.get_draft 读回 activities[].name,缩短超长/补齐空名后重新 publish",
274
- };
275
- if (error.errcode === 480000)
276
- return {
277
- status: "refused",
278
- blocker: "current-task-suspended",
279
- errcode: 480000,
280
- "platform-version": "2.1.5+",
281
- message: `${error.message}——当前任务被挂起(2.1.5 新增:前置/串行任务未完成),不是提交参数错。`,
282
- nextAction: "workitem.list 看同一实例的前置任务状态;前置完成后重试提交",
283
- };
284
- // 子表超限:8.6 = 36102,8.7/2.1.5 = 36104(同义)。
285
- if (error.errcode === 36102 || error.errcode === 36104)
286
- return {
287
- status: "refused",
288
- blocker: "child-table-data-over-limit",
289
- errcode: error.errcode,
290
- message: `${error.message}——子表查询结果超限(8.6 回 36102,8.7/2.1.5 回 36104,同一语义)。收窄 filters/时间窗,或分页读 list_child;不要靠调大 size 硬拉。`,
291
- nextCommand: "omc call data.list --args '{\"schemaCode\":\"<child>\",\"size\":20,\"page\":0}'",
292
- };
293
- // 2.1.5 起管理面统一 @AdminOnly(8.6 是 @RequireAdmin):401/403 往往不是
294
- // 「token 坏了」,而是该端点在新版要求管理员。
295
- if (error.kind === "http-status" && (error.diagnostic?.httpStatus === 401 || error.diagnostic?.httpStatus === 403))
296
- return {
297
- status: "refused",
298
- blocker: `wire-${error.kind}`,
299
- errcode: error.errcode,
300
- message: `${error.message}——HTTP ${error.diagnostic?.httpStatus}:先确认账号;2.1.5 起管理端点(programming.*、workflow.publish/update、license/info 等)统一为 @AdminOnly(8.6 是 @RequireAdmin),普通应用管理员可能不再放行。`,
301
- nextAction: "换管理员账号复验;仍 403 就区分「端点要求管理员」与「平台未开该功能」",
302
- ...(error.diagnostic ? { diagnostic: error.diagnostic } : {}),
303
- };
304
- return { status: "refused", blocker: `wire-${error.kind}`, errcode: error.errcode, message: error.message, ...(error.diagnostic ? { diagnostic: error.diagnostic } : {}) };
305
- }
174
+ if (error instanceof WireError)
175
+ return refusalFromWireError(error);
306
176
  throw error;
307
177
  }
308
178
  // A write tool that runs a step chain (field.update cascadeRepublish) may
@@ -325,12 +195,34 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
325
195
  const artifactRef = writeArtifact(ctx, `${tool.name}-${randomUUID().slice(0, 8)}.json`, artifact);
326
196
  return { status: executed.status, steps: executed.steps, failedStep: executed.failedStep, ...executed.envelope, ...(args.requestId ? { requestId: args.requestId } : {}), artifactFingerprint: artifactRef.detailSha256 };
327
197
  }
328
- const { performed, readback, steps, halfSuccess, irreversible, rollbackReceipt, runtimeVerification, ruleStatus, serviceStatus } = executed;
198
+ const { performed, readback, steps, halfSuccess, irreversible, rollbackReceipt, runtimeVerification, ruleStatus, serviceStatus, status: producedStatus, blocker: producedBlocker, message: producedMessage, nextCommand: producedNextCommand, nextAction: producedNextAction, retryable: producedRetryable, submitRefused: producedSubmitRefused, submitOutcome: producedSubmitOutcome } = executed;
329
199
  // Readback gate (live 2026-10-17): a tool that reports `readback.present:false`
330
200
  // has NOT proven its own write — the platform accepted the request but the
331
201
  // object is absent from the authoritative face. "Called without error" must
332
202
  // never be stamped DELIVERED; downgrade to WRITE_UNVERIFIED and surface why.
333
- const { deliveryState, readbackWarning } = deliveryStateFor(readback);
203
+ const readbackGate = deliveryStateFor(readback);
204
+ // A producer-declared `uncertain` can never be DELIVERED either: it means the
205
+ // tool could not establish that the target belonged to the requested model
206
+ // (e.g. data.delete with a wrong schemaCode). Keep the gate's text when it
207
+ // already says something, otherwise use the producer's own diagnosis.
208
+ const writeStatus = producedStatus === "uncertain" ? "uncertain" : producedStatus === "partial" ? "partial" : "ok";
209
+ const deliveryState = writeStatus === "ok" ? readbackGate.deliveryState : "WRITE_UNVERIFIED";
210
+ // P1 复核:执行面的显式 uncertain 不能继承 `deliveryStateFor` 的 async 级联
211
+ // 文案——批量混合删除的 readback.absent=false 会被说成「删除级联中,稍后重跑」,
212
+ // 而真实结论是 delete-target-not-in-schema。生产者 blocker 优先。partial 同理:
213
+ // 首段写已落,但复合目标未完成,必须用生产者自己的结论。
214
+ const producedWarning = producedStatus === "uncertain"
215
+ ? (producedBlocker !== undefined
216
+ ? `本次调用未建立成功结论(${producedBlocker}):按 blocker/message/nextCommand 核对,勿当作已清理`
217
+ : producedMessage)
218
+ : producedStatus === "partial"
219
+ ? (producedMessage ?? (producedBlocker !== undefined ? `本次只完成了复合操作的一部分(${producedBlocker}):按 blocker/message/nextCommand 继续,勿当作全部完成` : undefined))
220
+ : undefined;
221
+ const readbackWarning = writeStatus !== "ok"
222
+ ? (producedWarning ?? (writeStatus === "uncertain"
223
+ ? "本次调用不代表成功(WRITE_UNVERIFIED):目标是否属于该模型/是否已删除未建立;按 message/nextCommand 先核对,勿宣称已清理"
224
+ : "本次只完成了复合操作的一部分(WRITE_UNVERIFIED):按 message/nextCommand 继续,勿当作全部完成"))
225
+ : readbackGate.readbackWarning;
334
226
  // Every production write echoes the explicit acknowledgement into the audit
335
227
  // trail, so the record can always answer "was this a confirmed production
336
228
  // write?".
@@ -344,6 +236,8 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
344
236
  ...(steps !== undefined ? { steps } : {}),
345
237
  ...(ruleStatus !== undefined ? { ruleStatus } : {}),
346
238
  ...(serviceStatus !== undefined ? { serviceStatus } : {}),
239
+ ...(producedSubmitRefused !== undefined ? { submitRefused: producedSubmitRefused } : {}),
240
+ ...(producedSubmitOutcome !== undefined ? { submitOutcome: producedSubmitOutcome } : {}),
347
241
  ...(productionConfirmed ? { productionConfirmed: true } : {}),
348
242
  ...(reason !== undefined ? { reason } : {}),
349
243
  ...(tool.rollback
@@ -368,7 +262,7 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
368
262
  // timeline (reverting a no-op delete would try to "restore" something that
369
263
  // never existed in this session).
370
264
  const skipped = typeof performed.skipped === "string" ? performed.skipped : undefined;
371
- const isNoopWrite = performed.noop === true || skipped === "already-absent" || skipped === "stale-record-cache";
265
+ const isNoopWrite = performed.noop === true || skipped === "already-absent" || skipped === "stale-record-cache" || skipped === "target-not-in-schema";
372
266
  let rollbackRef;
373
267
  if (tool.rollback && !isNoopWrite) {
374
268
  const entry = appendJournalEntry(ctx.artifactsDir, {
@@ -390,8 +284,15 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
390
284
  rollbackRef = { seq: entry.seq, hint: `omc rollback plan ${entry.seq}(--env ${entry.environment})` };
391
285
  }
392
286
  return {
393
- status: "ok",
287
+ status: writeStatus,
394
288
  deliveryState,
289
+ ...(writeStatus !== "ok" && producedBlocker !== undefined ? { blocker: producedBlocker } : {}),
290
+ ...(writeStatus !== "ok" && producedMessage !== undefined ? { message: producedMessage } : {}),
291
+ ...(writeStatus !== "ok" && producedNextCommand !== undefined ? { nextCommand: producedNextCommand } : {}),
292
+ ...(writeStatus !== "ok" && producedNextAction !== undefined ? { nextAction: producedNextAction } : {}),
293
+ ...(writeStatus !== "ok" && producedRetryable !== undefined ? { retryable: producedRetryable } : {}),
294
+ ...(producedSubmitRefused !== undefined ? { submitRefused: producedSubmitRefused } : {}),
295
+ ...(producedSubmitOutcome !== undefined ? { submitOutcome: producedSubmitOutcome } : {}),
395
296
  ...((typeof performed.applicationCode === "string" ? { applicationCode: performed.applicationCode } : typeof readback.applicationCode === "string" ? { applicationCode: readback.applicationCode } : {})),
396
297
  ...(readOnlyEscapeNote !== undefined ? { readOnlyEscape: readOnlyEscapeNote } : {}),
397
298
  performed,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stalfh233/omc-cli",
3
- "version": "0.8.14",
3
+ "version": "0.8.16",
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.14",
61
+ "omc-core": "0.8.16",
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.14"
79
+ "@stalfh233/omc-fake-platform": "0.8.16"
80
80
  }
81
81
  }
@@ -87,7 +87,7 @@ only the section for the capability you need —
87
87
  - **单据号/自动编号(原生,勿二开)**:自建单据号字段是 `field.create` 的 `SHORT_TEXT + options.formPropertyType:100 + options.seqNoSetting` 分段构建器(CONSTANT/DELIMITER/DATE/PROPERTY/SEQNO/UID 段);DATAITEM 不是段类型,而是设计师 UI 的 resetDate 显示值。SEQNO 段 `resetDate:DAY/MONTH/YEAR` 原生按期重置——`describe field.create --example field-serial-number`。**不要落 SequenceService SPI 二开**(真机 r50 + 8.6.26 反编译证据,2026-11-10);编号生成时机=submit(`data.save` 不生成)。系统 `sequenceNo` 控件另为 objectId 双轨,勿混淆。
88
88
 
89
89
  - **能做哪些事**:字段族全链 create→publish→表单绑定;**CHILD_TABLE 子表**(子列是 schemaCode=父字段 code 上的普通字段);**计算字段**(默认用普通字段 + 「计算规则」,见下)。
90
- - **工具**:`field.get`(单字段读 = `field.list` + `code` 选择器)、`field.list`、`field.create`、`field.update`、`field.publish`、`field.delete`
90
+ - **工具**:`field.get`(单字段/多字段读 = `field.list` + `code` 或 `fields[]` 选择器)、`field.list`、`field.create`、`field.update`、`field.publish`、`field.delete`
91
91
  - **recipe**:
92
92
  - `omc describe field.create --example numeric-two-decimals`(数值 + scale)
93
93
  - `omc describe field.create --example dictionary-backed-single-select`
@@ -84,6 +84,28 @@ Terminology for the `omc` configuration CLI. Built on CloudPivot 8.6 (anchor
84
84
  - **Void envelope** — CloudPivot responses are `{errcode, errmsg, data}`;
85
85
  errcode 0 with `data: null` is a success with no payload.
86
86
 
87
+ ## Numeric display format constants (数值格式常量)
88
+
89
+ - 小数位词(后缀;裸值族直接用它):`integer`(0) / `tenths`(1) / `percentile`(2) /
90
+ `Millimeter`(3) / `tenThousand`(4) / `hundredThousand`(5) / `millionDecimals`(6) /
91
+ `tenMillionDecimals`(7) / `billionDecimals`(8)。**3 位小数是 `Millimeter`(不是
92
+ thousand)**,`RMB.Millimeter` 是真实常量。
93
+ - 族前缀(大小写、点号照写):裸值族无前缀;`ratio.` = 百分比
94
+ (`ratio` / `ratio.tenths` / … / `ratio.billionDecimals`);货币 `RMB.` /
95
+ `dollar.` / `euro.` / `HK.` **从 `.percentile`(2 位)起**,不存在
96
+ `.integer` / `.tenths` / `.thousand`。`none` = 不分组、不强制小数。
97
+ - 例:`{"scale":2,"format":"RMB.percentile"}` = ¥2,000.00;
98
+ `{"scale":3,"format":"RMB.Millimeter"}` = ¥2,000.000;
99
+ `{"scale":3,"format":"Millimeter"}` = 2,000.000;
100
+ `{"scale":2,"format":"ratio.percentile"}` = 20.00%。裸 `percentile` 是 2 位
101
+ 小数,**不是百分比**(百分比要带 `ratio` 词)。
102
+ - **未知 `format` 原样透传(fail-open)**:平台 runtime 的格式化 switch 没有
103
+ default(`QueryRuntimeController.java:1299-1547`),不认识的常量不格式化、
104
+ 门户显示原始小数;CLI 也原样落库(`src/field-families.ts:611-640`)。只写
105
+ 上面列出的常量。
106
+ - `scale` 是存储小数位数、`format` 是显示样式,两者应一致。查参数形状:
107
+ `omc describe field.create --param options`;lane 契约:`omc contract field-families`。
108
+
87
109
  ## Result vocabulary
88
110
 
89
111
  - `ok` — performed and authoritatively read back.