@stalfh233/omc-cli 0.8.5 → 0.8.7

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.
Files changed (46) hide show
  1. package/coverage/m1-coverage-manifest-v1.json +1 -0
  2. package/dist/approval-flow.js +49 -4
  3. package/dist/batch-call.js +21 -4
  4. package/dist/bench/scenario.js +1 -1
  5. package/dist/cli-stdout.js +1 -0
  6. package/dist/cli.js +84 -3
  7. package/dist/code-rules.js +144 -8
  8. package/dist/config-store.js +15 -1
  9. package/dist/coverage.js +2 -1
  10. package/dist/discovery.js +8 -2
  11. package/dist/endpoints.js +10 -0
  12. package/dist/form-layout.js +79 -0
  13. package/dist/form-support.js +65 -1
  14. package/dist/goal-routes.js +35 -5
  15. package/dist/graph.js +38 -3
  16. package/dist/human-summary.js +38 -2
  17. package/dist/intent/capabilities/field.js +1 -1
  18. package/dist/lanes/field-contract.js +4 -0
  19. package/dist/lanes/field-coverage.js +1 -0
  20. package/dist/lanes/field.js +20 -2
  21. package/dist/lanes/form-contract.js +1 -1
  22. package/dist/lanes/form.js +25 -3
  23. package/dist/lanes/list-view.js +21 -11
  24. package/dist/lanes/model-contract.js +2 -2
  25. package/dist/lanes/model-references.js +172 -0
  26. package/dist/lanes/model.js +226 -129
  27. package/dist/lanes/runtime-data-contract.js +3 -3
  28. package/dist/lanes/runtime-data.js +64 -8
  29. package/dist/lanes/workflow.js +91 -1
  30. package/dist/model-purge.js +1 -1
  31. package/dist/model-scaffold.js +6 -3
  32. package/dist/recipes/form.js +33 -6
  33. package/dist/recipes/runtime-data.js +1 -1
  34. package/dist/reserved.js +28 -0
  35. package/dist/residue.js +1 -1
  36. package/dist/tool-types.js +1 -0
  37. package/dist/version-family-gaps.js +33 -6
  38. package/dist/write.js +46 -8
  39. package/package.json +3 -3
  40. package/skills/omc-business-configuration.md +7 -0
  41. package/skills/omc-capabilities.md +1 -1
  42. package/skills/omc-playbook.md +5 -0
  43. package/skills/omc-refusals.md +4 -2
  44. package/skills/omc-start-here.md +1 -1
  45. package/skills/omc-tool-selection.md +2 -0
  46. package/skills/omc-write-hazards.md +3 -0
@@ -362,7 +362,10 @@ export function projectionHintFace(items, evidence) {
362
362
  const hasValue = new Set();
363
363
  for (const item of items) {
364
364
  for (const [key, value] of Object.entries(item.fields)) {
365
- if (RUNTIME_SYSTEM_FIELD_CODES.has(key) || key.endsWith("_"))
365
+ // `*_key` 是平台给单选/字典字段铸的孪生列(BizObject.SELECTION_KEY_SUFFIX
366
+ // ="_key":8.6.26 BizObject.java:83 / 2.1.5 BizObject.java:59,两版同形)——
367
+ // 它不在发布业务字段里,全 null 不代表「视图漏配了一列」。
368
+ if (RUNTIME_SYSTEM_FIELD_CODES.has(key) || key.endsWith("_") || key.endsWith("_key"))
366
369
  continue;
367
370
  if (value === null || value === undefined) {
368
371
  if (!hasValue.has(key) && !allNull.includes(key))
@@ -394,6 +397,44 @@ export function projectionHintFace(items, evidence) {
394
397
  ...(unprojected.length > 0 ? { unprojected } : {}),
395
398
  };
396
399
  }
400
+ /**
401
+ * F8(w44,2026-11-26 真机):`data.list` 的行内 `fields` 对**未投影**列也回
402
+ * `null`(与真空值同形),顶层 `projectionHint.unprojected` 只在整列全 null 时
403
+ * 出现,脚本按行对账仍会把 null 当数据丢失。行级 `unprojected` 用**同一份**
404
+ * 视图列证据(queryColumns)逐行标注:值 null 且不在视图列 → 本行未投影。
405
+ * `*_key` 孪生列与系统列不算(投影证据只覆盖业务列);拿不到视图清单时只用
406
+ * `projectionMiss`(请求列在 wire 行里整列缺席)判定,绝不拿 null 猜。
407
+ */
408
+ const isNonBusinessProjectionKey = (key) => RUNTIME_SYSTEM_FIELD_CODES.has(key) || key.endsWith("_") || key.endsWith("_key");
409
+ export function itemUnprojectedFields(fields, projectionMiss, viewColumnCodes) {
410
+ const missed = projectionMiss.length > 0 ? new Set(projectionMiss) : undefined;
411
+ if (viewColumnCodes === undefined && missed === undefined)
412
+ return [];
413
+ const inView = viewColumnCodes === undefined ? undefined : new Set(viewColumnCodes);
414
+ return Object.entries(fields)
415
+ .filter(([code, value]) => {
416
+ if (isNonBusinessProjectionKey(code))
417
+ return false;
418
+ if (value !== null && value !== undefined)
419
+ return false;
420
+ if (inView !== undefined)
421
+ return !inView.has(code);
422
+ return missed.has(code);
423
+ })
424
+ .map(([code]) => code);
425
+ }
426
+ /** 行级 `unprojected` 是加法:既有 `fields` 的键与 null 值逐字保留。 */
427
+ export function attachItemUnprojected(items, projectionMiss, viewColumnCodes) {
428
+ // 键只在**该行真的**有已判定未投影列时出现:无标注的行不加 `unprojected: []`
429
+ // ——每行多 ~20B 会把 25 行的小结果顶过 compact 外置阈值(0.8.7 全量实测
430
+ // composers `data.list --all` 因 `items` 被外置而失败),且空数组没有信息量。
431
+ return items.map((item) => {
432
+ const unprojected = itemUnprojectedFields(item.fields, projectionMiss, viewColumnCodes);
433
+ return unprojected.length > 0 ? { ...item, unprojected } : { ...item };
434
+ });
435
+ }
436
+ /** 人类/脚本读 null 的唯一权威口径;与行级 `unprojected` 同时出现才完整。 */
437
+ export const DATA_LIST_NULL_SEMANTICS = "items[].fields.<code> 键在且值为 null 可能是未投影进视图列(也可能本就是空值),不是「字段不存在」;items[].unprojected 只在该行有已判定的未投影列时出现(列出的 code 值必为 null),键缺席表示本行没有已判定的未投影列;判真值用 data.load。";
397
438
  /**
398
439
  * B2(issue 2026-11-25,真机 `milestone_ledger`):`data.list` 对关联字段静默回
399
440
  * null,而同一条记录 `data.load` 有真实值(`{id, displayCode, <显示字段>}`)。
@@ -1934,6 +1975,8 @@ export function registerRuntimeDataLane(tools) {
1934
1975
  const viewEvidence = nullProjection ? await listViewProjectionEvidence(session, args.schemaCode, args.queryCode ?? args.schemaCode) : undefined;
1935
1976
  const projectionHintAll = projectionHintWithMiss(projectionHintFace(items, viewEvidence), projectionMissAll);
1936
1977
  const columnsNotProjected = await relationNotProjectedOf(items, projectionMissAll, viewEvidence?.viewColumnCodes);
1978
+ const itemsWithProjection = attachItemUnprojected(items, projectionMissAll, viewEvidence?.viewColumnCodes);
1979
+ const anyNullField = items.some((item) => Object.values(item.fields).some((value) => value === null));
1937
1980
  return {
1938
1981
  schemaCode: args.schemaCode,
1939
1982
  ...application,
@@ -1981,9 +2024,10 @@ export function registerRuntimeDataLane(tools) {
1981
2024
  }
1982
2025
  : {}),
1983
2026
  ...(projectionHintAll !== undefined ? { projectionHint: projectionHintAll } : {}),
2027
+ ...(anyNullField ? { nullSemantics: DATA_LIST_NULL_SEMANTICS } : {}),
1984
2028
  ...(projectionMissAll.length > 0 ? { projectionMiss: projectionMissAll } : {}),
1985
2029
  ...(columnsNotProjected.length > 0 ? { columnsNotProjected } : {}),
1986
- items,
2030
+ items: itemsWithProjection,
1987
2031
  };
1988
2032
  }
1989
2033
  let result;
@@ -2123,6 +2167,8 @@ export function registerRuntimeDataLane(tools) {
2123
2167
  const viewEvidence = hasNullValue ? await listViewProjectionEvidence(session, args.schemaCode, args.queryCode ?? args.schemaCode) : undefined;
2124
2168
  const projectionHintPaged = projectionHintWithMiss(projectionHintFace(items, viewEvidence), projectionMissPaged);
2125
2169
  const columnsNotProjected = await relationNotProjectedOf(items, projectionMissPaged, viewEvidence?.viewColumnCodes);
2170
+ const itemsWithProjection = attachItemUnprojected(items, projectionMissPaged, viewEvidence?.viewColumnCodes);
2171
+ const anyNullField = items.some((item) => Object.values(item.fields).some((value) => value === null));
2126
2172
  // F6 工单 05b:只有本页行真的内联了子表数组才给一句(否则零字节);
2127
2173
  // 取第一条命中行,命令里的 schemaCode/childSchemaCode/bizObjectId 都是真值。
2128
2174
  const inlineChild = items
@@ -2162,6 +2208,7 @@ export function registerRuntimeDataLane(tools) {
2162
2208
  })(),
2163
2209
  ...(choiceFilterFields.length > 0 && Number(total ?? 0) === 0 ? { filterValueHint: choiceFilterValueHint(choiceFilterFields) } : {}),
2164
2210
  ...(projectionHintPaged !== undefined ? { projectionHint: projectionHintPaged } : {}),
2211
+ ...(anyNullField ? { nullSemantics: DATA_LIST_NULL_SEMANTICS } : {}),
2165
2212
  ...(projectionMissPaged.length > 0 ? { projectionMiss: projectionMissPaged } : {}),
2166
2213
  ...(columnsNotProjected.length > 0 ? { columnsNotProjected } : {}),
2167
2214
  totalPages,
@@ -2173,7 +2220,7 @@ export function registerRuntimeDataLane(tools) {
2173
2220
  size: page.size ?? args.size ?? 20,
2174
2221
  ...(pageOutOfRange ? { pageOutOfRange: true, emptyPage: true, hint: `page 从 0 开始,当前传了 ${requestedPage};合法范围 0..${Math.max(0, totalPages - 1)}。` } : {}),
2175
2222
  // r29b F8 的 ids/itemsPreview 由 compact(外置时)现算,见 dataListCompactProjection。
2176
- items,
2223
+ items: itemsWithProjection,
2177
2224
  };
2178
2225
  // r29b F8: ids/itemsPreview 已在同信封;artifact 提示由 compact 外置后的
2179
2226
  // fetch/detailArtifactId 承担。这里不改既有 projectionHint 主句(契约测试
@@ -3496,7 +3543,7 @@ export function registerRuntimeDataLane(tools) {
3496
3543
  inputSchema: {
3497
3544
  schemaCode: z.string().min(1),
3498
3545
  sheetCode: z.string().optional(),
3499
- formData: runtimeFormDataArg.optional().describe("business-object data keyed by field code;新建记录必填,审批提交(带 workItemId)可省略——平台使用已存业务数据"),
3546
+ formData: runtimeFormDataArg.optional().describe("business-object data keyed by field code;新建记录必填(无 bizObjectId 时);已有草稿直提可省略——按 data.load 读回行合并(省略 ≡ 传 {},给了则覆盖读回值);审批提交(带 workItemId)可省略——平台使用已存业务数据"),
3500
3547
  workflowCode: z.string().optional(),
3501
3548
  workflowInstanceId: z.string().optional(),
3502
3549
  workItemId: z.string().optional(),
@@ -3586,13 +3633,19 @@ export function registerRuntimeDataLane(tools) {
3586
3633
  });
3587
3634
  }
3588
3635
  const { sheetCode, resolvedFrom } = await resolveFormSheetCode(session, { schemaCode: args.schemaCode, sheetCode: args.sheetCode });
3589
- if (!hasWorkItem && args.formData === undefined) {
3636
+ // 只有**新建**提交才需要 formData:带 bizObjectId 时下面的载荷是
3637
+ // 「读回行全量 ⊕ formData」(本函数下方的既有行分支),formData 缺省与 {} 等价,
3638
+ // 平台侧 mergeObject 也是 map.putAll(existed.getData()) 再覆盖
3639
+ // (2.1.5 BizObjectFacadeImpl.java:1373-1379 / 8.6.26 :2461-2471),
3640
+ // 所以既有草稿直提省略 formData 是合法形状,不是缺参。
3641
+ if (!hasWorkItem && targetObjectId === null && args.formData === undefined) {
3590
3642
  throw new ToolInputError({
3591
3643
  status: "error",
3592
3644
  blocker: "tool-input-invalid",
3593
3645
  tool: "data.submit",
3594
- message: "新建提交缺少 formData;审批提交可省略 formData(子表数组不要带),新建记录才必须传 formData。",
3595
- nextCommand: "omc call data.submit --args '{\"schemaCode\":\"<schemaCode>\",\"formData\":{...}}'",
3646
+ message: "新建提交(无 bizObjectId)必须给 formData;**已有草稿直提可省略 formData**(按 data.load 读回行合并,省略 ≡ 传 {})。" +
3647
+ "要提交已有记录请在参数里直接带 bizObjectId(见 nextCommand),不要省略 bizObjectId。",
3648
+ nextCommand: `omc call data.submit --args '{"schemaCode":"<schemaCode>","bizObjectId":"<data.load 的 bizObjectId>"}'`,
3596
3649
  });
3597
3650
  }
3598
3651
  const stampedSubmit = await prepareRuntimeFormData(session, args.schemaCode, (args.formData ?? {}), { isUpdate: targetObjectId !== null });
@@ -3642,7 +3695,6 @@ export function registerRuntimeDataLane(tools) {
3642
3695
  `确要在提交携带人员字段(个别平台构建接受),显式带 allowStaffOnSubmit:true 自担。`,
3643
3696
  });
3644
3697
  }
3645
- const validation = await portalRequiredViolations(session, args.schemaCode, sheetCode, args.formData ?? {}).catch(() => ({ requiredFields: [], missingRequired: [], requiredFace: "unavailable" }));
3646
3698
  // Directive: a workflow-backed model's submit must START the workflow, not
3647
3699
  // merely save a sheet row. When the caller names no workflow params, detect
3648
3700
  // the model's workflow and start it (formType=1 + workflowCode); a model
@@ -3774,6 +3826,10 @@ export function registerRuntimeDataLane(tools) {
3774
3826
  };
3775
3827
  payload.actionCode = "submit";
3776
3828
  }
3829
+ // 门户必填按**实际提交的载荷**判:新建=formData;既有行=上面合成的
3830
+ // bizObject.data(「读回行 ⊕ formData」)。只拿 args.formData 判,会在
3831
+ // 省略 formData 的既有草稿直提上误报 missingRequired。
3832
+ const validation = await portalRequiredViolations(session, args.schemaCode, sheetCode, payload.bizObject.data ?? {}).catch(() => ({ requiredFields: [], missingRequired: [], requiredFace: "unavailable" }));
3777
3833
  let replayToken;
3778
3834
  if (hasWorkflowCode && !hasWorkItem && !hasInstance) {
3779
3835
  // Starting a workflow (formType=1 + workflowCode, no workItem) requires
@@ -3328,7 +3328,47 @@ export function registerWorkflowLane(tools) {
3328
3328
  const participantWarnings = participantReferenceWarnings(data);
3329
3329
  const rejectWarnings = rejectToStartCancelWarnings(data);
3330
3330
  const originatorWarnings = approvalByOriginatorWarnings(data);
3331
- return { performed: { errcode: performed.errcode }, readback: { workflowCode: args.code, published: isPublished, workflowVersion: data.workflowVersion ?? null, ...(strippedEmptyConditionGroups > 0 ? { strippedEmptyConditionGroups, strippedEmptyConditionGroupsNote: "调用方连线里有 N 条带平台存量写法 ruleConditionGroup:[](=无条件);工具写前已剥离该键,未上送" } : {}), ...(warnings.length ? { warnings } : {}), ...(participantWarnings.length ? { participantWarnings } : {}), ...(rejectWarnings.length || originatorWarnings.length ? { workflowWarnings: [...rejectWarnings, ...originatorWarnings] } : {}), workflowRenderCompat: workflowRenderCompat(data) } };
3331
+ // F10(0.8.6):平台 publish 成功后在**首次发布**(workflowVersion=1,两族同
3332
+ // 语义:2.1.5 ProcessDefineAssemblyServiceImpl:141-147 / 8.6.26 :175-181)会
3333
+ // 静默把该模型各列表视图的 add 动作改成 setQueryActionRelativeType(WORKFLOW)
3334
+ // + setRelativeCode(流程码)(WorkflowTemplateController.publish →
3335
+ // updateBizQueryBindWorkflowCode → updateBizQueryAddAction,8.6.26 :805/:830-846;
3336
+ // 2.1.5 :695-711/:741-761)。不告知的话清理期只在 workflow.delete 撞 303024。
3337
+ // 代价:平台列表面 listQueryList 只回 code/name,确认绑定需 1 次 list + 每视图
3338
+ // 1 次 get(本模型通常 1-3 个视图)。
3339
+ const addBindings = await listviewAddBindings(session, args.schemaCode, args.code);
3340
+ const firstPublish = Number(data.workflowVersion) === 1;
3341
+ const firstBoundView = addBindings.bound[0];
3342
+ // Same query/get response as the binding scan — no extra wire round-trip.
3343
+ // The unbind recipe mirrors workflow.delete's 303024 recovery (live-proven:
3344
+ // empty actions + replaceActions:true).
3345
+ const unbindCommand = firstBoundView === undefined
3346
+ ? undefined
3347
+ : `omc call listview.configure --env <env> --args '${JSON.stringify({
3348
+ schemaCode: args.schemaCode,
3349
+ code: firstBoundView.code,
3350
+ fieldCodes: firstBoundView.fieldCodes.length > 0 ? firstBoundView.fieldCodes : ["createdTime", "creater", "name", "sequenceNo"],
3351
+ actions: [],
3352
+ replaceActions: true,
3353
+ })}'`;
3354
+ const listviewBinding = {
3355
+ bound: addBindings.bound.map(({ code, actionCode }) => ({ code, actionCode })),
3356
+ ...(firstPublish ? {} : { firstPublish: false }),
3357
+ note: addBindings.bound.length > 0
3358
+ ? firstPublish
3359
+ ? "首次发布已把本模型各列表视图的 add 动作绑到本流程;删流程前先 listview.configure 清 actions 或用 workflow.delete 的 nextCommand"
3360
+ : "列表视图的 add 动作已绑定本流程(本次不是首次发布,绑定沿用既有配置);删流程前先 listview.configure 清 actions 或用 workflow.delete 的 nextCommand"
3361
+ : addBindings.readable
3362
+ ? "无隐式绑定"
3363
+ : "列表视图读取失败,未能确认 add 绑定;删流程前先 listview.get 复核",
3364
+ ...(addBindings.bound.length > 0
3365
+ ? {
3366
+ beforeWorkflowDelete: "删流程前先解绑:用 listview.configure 清掉该视图 add 动作(actions:[] + replaceActions:true),否则 workflow.delete 会撞 workflow-bound-to-listview(303024,列表还绑着流程);多个视图绑定时逐视图处理。",
3367
+ ...(unbindCommand !== undefined ? { unbindCommand } : {}),
3368
+ }
3369
+ : {}),
3370
+ };
3371
+ return { performed: { errcode: performed.errcode }, readback: { workflowCode: args.code, published: isPublished, workflowVersion: data.workflowVersion ?? null, listviewBinding, ...(strippedEmptyConditionGroups > 0 ? { strippedEmptyConditionGroups, strippedEmptyConditionGroupsNote: "调用方连线里有 N 条带平台存量写法 ruleConditionGroup:[](=无条件);工具写前已剥离该键,未上送" } : {}), ...(warnings.length ? { warnings } : {}), ...(participantWarnings.length ? { participantWarnings } : {}), ...(rejectWarnings.length || originatorWarnings.length ? { workflowWarnings: [...rejectWarnings, ...originatorWarnings] } : {}), workflowRenderCompat: workflowRenderCompat(data) } };
3332
3372
  },
3333
3373
  preflight: (args) => {
3334
3374
  assertTemplateNotMinimal(args.template ?? {}, "workflow.publish");
@@ -4239,6 +4279,56 @@ export function registerWorkflowLane(tools) {
4239
4279
  // Publishing a flow creates NO permission row, so a freshly published flow is
4240
4280
  // unusable by anyone who is not a platform admin.
4241
4281
  const permissionRows = async (session, workflowCode) => wireRows((await wireCall(session, { path: ENDPOINTS.workflowListPermission, query: { workflowCode } })).data);
4282
+ /**
4283
+ * F10(0.8.6):workflow.publish 的隐式绑定回执。平台首次发布后会把该模型
4284
+ * 各列表视图 `add` 动作的 relativeType 改成 WORKFLOW、relativeCode 改成流程码
4285
+ * (8.6.26 WorkflowTemplateController.publish:805 → updateBizQueryAddAction:830-846;
4286
+ * 2.1.5 publish:695-711 → :741-761)。列表面只回 code/name,故需 1 次 list +
4287
+ * 每视图 1 次 get;读失败时 readable=false,回执不得谎称「无绑定」。
4288
+ */
4289
+ async function listviewAddBindings(session, schemaCode, workflowCode) {
4290
+ const bound = [];
4291
+ let readable = false;
4292
+ try {
4293
+ const listed = wireRows((await wireCall(session, { path: ENDPOINTS.listQueryList, query: { schemaCode, clientType: "PC" } })).data);
4294
+ readable = true;
4295
+ for (const row of listed) {
4296
+ const code = String(row.code ?? "");
4297
+ if (!code)
4298
+ continue;
4299
+ try {
4300
+ const got = await wireCall(session, { path: ENDPOINTS.listQueryGet, query: { schemaCode, code, clientType: "PC" } });
4301
+ const model = (got.data ?? null);
4302
+ const actions = model !== null && Array.isArray(model.queryActions) ? model.queryActions : [];
4303
+ const hit = actions.some((action) => {
4304
+ if (String(action.actionCode ?? "") !== "add")
4305
+ return false;
4306
+ const association = action.queryActionRelativeType ?? action.associationType;
4307
+ const associationCode = String(action.relativeCode ?? action.associationCode ?? "");
4308
+ const isWorkflow = association === 1 ||
4309
+ association === "1" ||
4310
+ String(association ?? "").toUpperCase() === "WORKFLOW";
4311
+ return isWorkflow && (associationCode === workflowCode || associationCode === "");
4312
+ });
4313
+ if (hit) {
4314
+ // Reuse the SAME query/get response for the unbind command's
4315
+ // fieldCodes — no extra wire round-trip at publish time.
4316
+ const fieldCodes = (model !== null && Array.isArray(model.queryColumns) ? model.queryColumns : [])
4317
+ .map((column) => String(column.propertyCode ?? ""))
4318
+ .filter((column) => column.length > 0);
4319
+ bound.push({ code, actionCode: "add", fieldCodes });
4320
+ }
4321
+ }
4322
+ catch {
4323
+ readable = false;
4324
+ }
4325
+ }
4326
+ }
4327
+ catch {
4328
+ readable = false;
4329
+ }
4330
+ return { bound, readable };
4331
+ }
4242
4332
  /** Best-effort: which list views still bind this workflow (303024 recovery). */
4243
4333
  async function findListviewsBoundToWorkflow(session, schemaCode, workflowCode) {
4244
4334
  const bound = [];
@@ -361,7 +361,7 @@ export async function cmdModelPurge(args) {
361
361
  }
362
362
  : {
363
363
  note: "已清理:流程实例逐个删除 → model.delete 级联带走流程模板/列表视图/字段/表单/业务规则。" +
364
- "model.delete 的异步级联约 40-60s,稍后仍能读到模型记录属正常残留,重跑本命令即可(幂等)。" +
364
+ "model.delete 是平台异步任务(建删除历史后立即返回,级联时长不定),稍后仍能读到模型记录属正常残留,重跑本命令即可(幂等)。" +
365
365
  "**这就是 r12–r14 三次脏沙盒的根治**:实例先走,就不会留下指向空模板的待办。",
366
366
  }),
367
367
  };
@@ -22,7 +22,7 @@ import { CLI_EXIT_CODES, classifyResult, envelope, refusalText, requestId } from
22
22
  import { writeEnvelope } from "./cli-output.js";
23
23
  import { assertSafeInputPath } from "./artifacts.js";
24
24
  import { readFileSync } from "node:fs";
25
- import { resolve } from "node:path";
25
+ import { join, resolve } from "node:path";
26
26
  /** Validate the caller's `--fields` payload (fail before any write). */
27
27
  export function validateScaffoldFields(fields) {
28
28
  const problems = [];
@@ -98,12 +98,15 @@ export async function cmdModelScaffold(args) {
98
98
  return invalid("--fields-file 不能与 --fields/--fields-json 同时使用");
99
99
  let inputJson = fieldsJson;
100
100
  if (fieldsFile !== undefined) {
101
+ const root = resolve(process.env.OMC_CONFIG_HOME ?? process.cwd());
101
102
  try {
102
- const root = resolve(process.env.OMC_CONFIG_HOME ?? process.cwd());
103
103
  inputJson = readFileSync(assertSafeInputPath(root, fieldsFile, "--fields-file"), "utf8");
104
104
  }
105
105
  catch (error) {
106
- return invalid(`--fields-file 读取失败:${error instanceof Error ? error.message : String(error)}`);
106
+ const detail = error instanceof Error ? error.message : String(error);
107
+ // F2(0.8.6):越界报错要能直接照做——旧文案只说「必须在配置根内」,
108
+ // 不给路径。与 --args-file(cli.ts)同配方:给根内示例文件路径。
109
+ return invalid(`--fields-file 读取失败:${detail}${/must be inside the configuration root/.test(detail) ? `。把参数文件放到 ${root} 之下(如 ${join(root, "args.json")}),再用 --fields-file 引用` : ""}`);
107
110
  }
108
111
  }
109
112
  if (inputJson === undefined)
@@ -19,6 +19,11 @@ const configureFormRecipe = Object.freeze({
19
19
  * 这里给一个**最小可抄**的两列 + 末行整宽样例;形状由 `form-layout.ts`
20
20
  * 的 validateFormLayout 把关(rows 必须是二维字符串数组、attrs 与 rows 覆盖一致、
21
21
  * 控件 options 必须是对象而不是 JSON 字符串)。
22
+ *
23
+ * 探针 B F1/F3(2.1.5 真机):控件 `type` 是**表单控件枚举**,与字段
24
+ * `propertyType` 不同源(关联单选 80 vs WORK_SHEET 9);且本配方只摆业务字段,
25
+ * 直接覆盖既有表单会丢掉系统控件、在 form.publish 撞 form-publish-degrade。
26
+ * 配方因此明确:既有表单先取 publishedAttributesJson 作基线。
22
27
  */
23
28
  const formDraftTwoColumn = Object.freeze({
24
29
  id: "two-column-layout",
@@ -36,25 +41,47 @@ const formDraftTwoColumn = Object.freeze({
36
41
  draftViewJson: '[[\"visitNo\",\"customer\"],[\"remark\"]]',
37
42
  draftAttributesJson: JSON.stringify({
38
43
  visitNo: { key: "visitNo", type: 1, options: { name: "拜访单号", span: 12 } },
39
- customer: { key: "customer", type: 9, options: { name: "客户", span: 12 } },
44
+ // customer 字段是 WORK_SHEET(propertyType 9) → 表单控件「关联单选」=80。
45
+ // 写成 9 是附件控件:平台照存、回读不报错,渲染时才坏。
46
+ customer: { key: "customer", type: 80, options: { name: "客户", span: 12 } },
40
47
  remark: { key: "remark", type: 1, options: { name: "备注", span: 24 } },
41
48
  }, null, 0),
42
49
  },
43
- preconditions: ["visitNo/customer/remark 三个字段已 field.publish(布局只能引用已发布字段)", "两段 JSON 都是**字符串**(tool 参数是 string,不是对象)"],
50
+ preconditions: [
51
+ "visitNo/customer/remark 三个字段已 field.publish(布局只能引用已发布字段)",
52
+ "两段 JSON 都是**字符串**(tool 参数是 string,不是对象)",
53
+ "**改既有表单**:先 `form.get full:true` 取 `publishedAttributesJson` 作基线(含 Title/Group/creater/createdTime/sequenceNo 系统控件),只改行分组与 span,不要把本配方的三字段最小布局直接盖上去。判据:`form.get full:true` 返回非空 publishedAttributesJson(或 published:true)→ 既有表单,受 form-publish-degrade 约束;无表单行 / publishedAttributesJson 为空或 \"{}\" → 新建表单,本配方可直接用。",
54
+ ],
44
55
  conditionalRequirements: [
45
56
  "**列数由行分组决定,不由 span 决定**:一行放几个 code 就是几列;span 只控制控件在行内的 24 栅格宽度,且必须与行分组自洽(两列 span:12+12,整宽 span:24)",
46
57
  "draftAttributesJson 的每个控件的 `options` 必须是**对象**,不能是 JSON 字符串(否则运行时写 options.name_i18n 抛错、整页空白)",
47
- "控件 type 与 field propertyType 数字同源(WORK_SHEET=9)",
58
+ "**控件 type 是表单控件枚举,不是字段 propertyType**:1=单行文本, 2=多行文本, 3=日期, 4=数值, 5=单选, 6=复选, 7=下拉, 8=逻辑, 80=关联单选, 81=关联多选, 201=子表 …;对应 propertyType 0/1/3/2/12/13/14/4/9/11/8。错枚举默认拒 `form-control-type-mismatch`(逃生 allowTypeMismatch:true)",
59
+ "本配方只摆 3 个业务字段,**没有系统控件**;对既有表单直接发布会被 form.publish 的降级门拒(form-publish-degrade),恢复见 refusalRecovery",
48
60
  "rows 与 attrs 的 code 集合必须一致,否则 `layout_coverage_mismatch`",
49
61
  "改列数就改行分组、重写 attrs 的 span —— 不要只改 span",
50
62
  ],
51
- priorToolReferences: [{ tool: "field.list", args: { environment, schemaCode: model, published: true }, purpose: "确认要摆的字段已发布" }],
52
- dryRun: { supported: true, command: `omc call form.draft --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 会跑 validateFormLayout,形状不合规当场拒绝" },
53
- expectedReadback: { performed: { hasDraft: true }, readback: { next: ["form.publish", "form.get full:true 验布局"] } },
63
+ priorToolReferences: [
64
+ { tool: "field.list", args: { environment, schemaCode: model, published: true }, purpose: "确认要摆的字段已发布(同时给 propertyType,用于核对控件 type)" },
65
+ { tool: "form.get", args: { environment, schemaCode: model, full: true }, purpose: "改既有表单时取 publishedAttributesJson 作基线(保留系统控件)" },
66
+ ],
67
+ dryRun: { supported: true, command: `omc call form.draft --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 会跑 validateFormLayout 与控件 type 交叉校验(读 field.list),形状/枚举不对当场拒绝" },
68
+ expectedReadback: {
69
+ performed: { hasDraft: true },
70
+ readback: { next: ["form.publish", "form.get full:true 验布局"] },
71
+ publishCheck: "form.publish 前核对草稿控件数 ≥ publishedAttributesJson 的控件数(系统控件不在本配方里,别直接覆盖既有表单)",
72
+ },
54
73
  refusalRecovery: [
55
74
  { code: "layout_coverage_mismatch", action: "把 draftViewJson 里出现的每个 code 都补进 draftAttributesJson(反之亦然)" },
56
75
  { code: "control_options_not_object", action: "把控件 options 从 JSON 字符串改成对象" },
76
+ {
77
+ code: "form-control-type-mismatch",
78
+ action: "按回执 mismatches 的 expectedType 改控件 type(关联单选=80、子表=201、单行文本=1…);或改既有表单时先 `form.get full:true` 取 publishedAttributesJson 作基线只改 rows/span,不要手拼控件 type。确属平台模板要求的特殊控件才传 allowTypeMismatch:true",
79
+ },
57
80
  { code: "form-field-not-published", action: "先 field.publish 再排布局" },
81
+ {
82
+ code: "form-publish-degrade",
83
+ action: "本配方只有业务字段,覆盖既有表单会丢系统控件。恢复:① `omc call form.get --args '{\"schemaCode\":\"<model>\",\"full\":true}'` 取 publishedAttributesJson;② 以它为基线只改 rows/span(保留 Title/Group/creater/createdTime/sequenceNo 与其它控件)重写草稿;③ 再 form.publish。纯新建表单(publishedAttributesJson 为空)不触发此门。不要把 allowDegrade:true 当默认解法",
84
+ },
58
85
  ...commonRecovery,
59
86
  ],
60
87
  requiresEnvironmentDerivedIds: false,
@@ -34,7 +34,7 @@ const plainSubmit = Object.freeze({
34
34
  args: { environment, schemaCode: model, formData: { name: "正式记录" } },
35
35
  preconditions: ["模型无已发布流程(有流程走 workflow-backed-data-submit)", "模型+表单已发布"],
36
36
  conditionalRequirements: [
37
- "**不带 bizObjectId 即新建并提交**(工具内部建稿+直提,一次调用 COMPLETED);已有草稿要直提时才带 data.save 读回的 bizObjectId;不要手造 id",
37
+ "**不带 bizObjectId 即新建并提交**(工具内部建稿+直提,一次调用 COMPLETED);已有草稿要直提时才带 data.save 读回的 bizObjectId;不要手造 id。**带 bizObjectId 时 formData 可省略**(载荷=读回行 ⊕ formData,省略 ≡ 传 {},给了则覆盖),新建(无 id)才必须给 formData",
38
38
  "**目标模型已发布流程时行为不同(r36 实证)**:无 workItemId 的 data.submit = 一调新建并**启动流程**(PROCESSING,读回返回首审批待办 workItemId)——合法路径非错误;要『先草稿后提交/中途改稿』用两段式 data.save(草稿读回三元身份)→ data.submit(workItemId)",
39
39
  ],
40
40
  priorToolReferences: [],
@@ -0,0 +1,28 @@
1
+ import { RESERVED_CODE_GROUPS } from "./code-rules.js";
2
+ /**
3
+ * F1(0.8.7 探针 B):保留字清单此前只在 `src/code-rules.ts` 里,报错只给
4
+ * `code_reserved` 分类,`omc help omc-write-hazards` 只有 SQL 关键字——探针
5
+ * 只能靠撞本地门发现 `owner` / `ownerName` 被拒。本函数是**同一张表**的只读
6
+ * 投影(`RESERVED_CODE_GROUPS` 由校验用的 Set 派生),零环境接触、零写入。
7
+ *
8
+ * 边界写清楚:这是本地 dry-lint 的清单,不是平台全量保留字清单;平台最终门
9
+ * 仍是 301014(属性 code 冲突)与 10033(SQL 关键字)。
10
+ */
11
+ export function reservedCodeReport() {
12
+ return {
13
+ status: "ok",
14
+ scope: "本地 code dry-lint(model.create / field.create / configure_model 使用同一张表);不是平台全量保留字清单",
15
+ rule: "业务模型 / 字段 code 不要使用下列编码;平台最终门:属性冲突 301014、SQL 关键字 10033",
16
+ total: RESERVED_CODE_GROUPS.reduce((sum, group) => sum + group.codes.length, 0),
17
+ groups: RESERVED_CODE_GROUPS.map((group) => ({
18
+ id: group.id,
19
+ title: group.title,
20
+ appliesTo: group.appliesTo,
21
+ count: group.codes.length,
22
+ codes: group.codes,
23
+ ...(group.note !== undefined ? { note: group.note } : {}),
24
+ })),
25
+ nextCommand: "omc help omc-write-hazards",
26
+ };
27
+ }
28
+ //# sourceMappingURL=reserved.js.map
package/dist/residue.js CHANGED
@@ -133,7 +133,7 @@ export async function scanResidues(session, prefix, options = {}) {
133
133
  coverage: { report: "not-scanned(用 report.tree + report.get 判,BI 残留看 readback.biResidue)", workflow: "模板跟模型走(模型删即删)" },
134
134
  ...(systemPresetCount > 0 ? { systemPresetCount } : {}),
135
135
  ...(pendingCascade ? { pendingCascade: true } : {}),
136
- note: pendingCascade ? "模型已不存在但仍有级联面命中:级联窗口内,等 40-60s 重跑,幂等" : "clean 仅指已扫描面;report 面未扫描——报表残留判定用 report.tree(树)+ report.get(BI 残留看 biResidue)",
136
+ note: pendingCascade ? "模型已不存在但仍有级联面命中:平台删除为异步任务、时长不定,稍后重跑,幂等" : "clean 仅指已扫描面;report 面未扫描——报表残留判定用 report.tree(树)+ report.get(BI 残留看 biResidue)",
137
137
  };
138
138
  }
139
139
  export async function cmdResidue(prefix, options, transport) {
@@ -103,6 +103,7 @@ const TOOL_INPUT_ALIASES = Object.freeze({
103
103
  "field.create": Object.freeze({ code: ["propertyCode"] }),
104
104
  "field.update": Object.freeze({ code: ["propertyCode"] }),
105
105
  "field.delete": Object.freeze({ code: ["propertyCode"] }),
106
+ "field.get": Object.freeze({ code: ["propertyCode"] }),
106
107
  // data.load's row id: callers habitually send `id` (bench67 wasted a round on
107
108
  // `bizObjectId: Required`). On this tool `id` unambiguously names the same
108
109
  // business object, so fill the canonical key rather than fail.
@@ -49,6 +49,25 @@ const FAMILY_GAPS = [
49
49
  evidence: "r27 真机 2026-11-05(1.1.25,reporter 未起):biInit:failed;r63/r65 真机(同 1.1.25,reporter 已起):biInitialized:true、bi.present:true——族级结论已被实测推翻,needsReconfirm",
50
50
  },
51
51
  ];
52
+ /**
53
+ * 按版本族登记的**差异清单指针**(`kind: "family-delta"`)。
54
+ *
55
+ * 与 `FAMILY_GAPS` 的区别:那里登记的是「该族缺这个端点」,这里登记的是
56
+ * 「该族与锚点有**逐条清单**的差异」——既有新增/收紧,也有同形契约。2.1 属于后者:
57
+ * 它的差异分散在列表视图删除门(306103)、查看态按钮拆分、物理删除异步完成面等
58
+ * 多条上,逐条写在文档里。调用方**先读 `doc` 再下结论**;未登记的条目不要臆断
59
+ * 「与 8.6 同形」或「都变了」——两句话都是无证据断言。
60
+ */
61
+ const FAMILY_DELTAS = [
62
+ {
63
+ id: "ai-platform 2.1 族差异(非缺席,逐条清单)",
64
+ kind: "family-delta",
65
+ families: ["2.1"],
66
+ doc: "docs/platform-contracts/2.1-delta.md",
67
+ fallback: "先读 docs/platform-contracts/2.1-delta.md(§2.11 通用契约、§2.12 2.1 新增,逐条带 file:line)再动手;已知项含 2.1 新增的列表视图删除门(306103:至少各留一个 PC/MOBILE 可见视图)。清单未覆盖的面按平台实测为准",
68
+ evidence: "launcher-2.1.5 反编译对照 launcher-8.6.26(2.1-delta.md §2.11/§2.12 的 file:line);探针 A 2026-11-26 双版本核实;客户口径 8.8 = AI-Platform 2.1.x(同文档标题)",
69
+ },
70
+ ];
52
71
  /** r28k F9 — 固定文案,doctor / get_status 共用,避免两义。 */
53
72
  export const KNOWN_GAPS_CLAIM_MEANING = "只列已知缺口;未列 ≠ 已验证可用——跨版本面一律先 scouting / 看 coverage.manifest";
54
73
  function familyOf(version) {
@@ -60,14 +79,15 @@ function familyOf(version) {
60
79
  * `version` 为 undefined(无版本证据)时返回全部家族条目——保守方向:
61
80
  * 调用方宁可多看到一条,也不要漏掉一个会 404 的端点。
62
81
  *
63
- * 族判定用 `partitionVersion`(version-partition.ts);FAMILY_GAPS 里的
64
- * `families` 仍是 **X.Y 端点族**(8.0/8.1、1.0/1.1),因为缺口是端点级而不是
82
+ * 族判定用 `partitionVersion`(version-partition.ts);`FAMILY_GAPS` / `FAMILY_DELTAS`
83
+ * 里的 `families` 仍是 **X.Y 端点族**(8.0/8.1、1.0/1.1、2.1),因为缺口是端点级而不是
65
84
  * 整个分区级的——分区级能力差异看 `CAPABILITIES`。
66
85
  */
67
86
  export function unsupportedCapabilities(manifest, version) {
68
87
  const partition = partitionVersion(version);
69
88
  const family = version === undefined ? undefined : familyOf(version);
70
89
  const applicable = FAMILY_GAPS.filter((gap) => family === undefined || gap.families === undefined || gap.families.includes(family));
90
+ const deltas = FAMILY_DELTAS.filter((delta) => family === undefined || delta.families === undefined || delta.families.includes(family));
71
91
  return {
72
92
  completeness: "known-gaps-only",
73
93
  coverageClaim: "known-gaps-only",
@@ -76,7 +96,8 @@ export function unsupportedCapabilities(manifest, version) {
76
96
  inAnchorFamily: version === undefined ? null : partition.family === "anchor-8.6" || version.startsWith(`${manifest.version_family}.`),
77
97
  partition: { family: partition.family, confidence: partition.confidence, matched: partition.matched },
78
98
  // 锚点族内部无缺口时也别回空数组造成"没有限制"的错觉——platform-absent 永远在。
79
- capabilities: [...applicable, ...PLATFORM_ABSENCES],
99
+ // 族差异指针排在最前:调用方先看到「这一族有逐条清单」,再读具体缺口。
100
+ capabilities: [...deltas, ...applicable, ...PLATFORM_ABSENCES],
80
101
  };
81
102
  }
82
103
  /**
@@ -90,16 +111,22 @@ export function formatDoctorHumanSummary(input) {
90
111
  if (input.warnCount <= 0 && caps.length === 0) {
91
112
  return `${head}——逐项明细与冷启动指引在 stdout 的 result`;
92
113
  }
114
+ // `family-delta` 是「这一族有逐条差异清单」的指针,不是「不可用」:
115
+ // 混进「不可用:」会读成能力缺失(2.1 的多数差异是新增/收紧)。
116
+ const deltas = caps.filter((cap) => cap.kind === "family-delta");
117
+ const unavailableCaps = caps.filter((cap) => cap.kind !== "family-delta");
93
118
  const versionBit = typeof input.detectedVersion === "string" && input.detectedVersion.length > 0
94
119
  ? `版本 ${input.detectedVersion}`
95
120
  : input.unsupported?.detectedVersion
96
121
  ? `版本 ${input.unsupported.detectedVersion}`
97
122
  : undefined;
98
- const shortIds = caps.slice(0, 6).map((cap) => shortCapabilityId(cap.id));
123
+ const shortIds = unavailableCaps.slice(0, 6).map((cap) => shortCapabilityId(cap.id));
99
124
  const unavailable = shortIds.length > 0
100
- ? `不可用:${shortIds.join("、")}${caps.length > shortIds.length ? ` 等${caps.length}项` : ""}`
125
+ ? `不可用:${shortIds.join("、")}${unavailableCaps.length > shortIds.length ? ` 等${unavailableCaps.length}项` : ""}`
101
126
  : undefined;
102
- const detail = [versionBit, unavailable].filter(Boolean).join(";");
127
+ const docs = [...new Set(deltas.map((cap) => cap.doc).filter((doc) => typeof doc === "string" && doc.length > 0))];
128
+ const deltaBit = docs.length > 0 ? `族差异清单:${docs.join("、")}` : undefined;
129
+ const detail = [versionBit, unavailable, deltaBit].filter(Boolean).join(";");
103
130
  return detail.length > 0
104
131
  ? `${head}——${detail}(详见 result.unsupportedCapabilities)`
105
132
  : `${head}——逐项明细、冷启动指引与 unsupportedCapabilities 都在 stdout 的 result(stderr 不重复)`;
package/dist/write.js CHANGED
@@ -22,7 +22,7 @@ import { capabilityArg, confirmProductionArg, environmentArg, WRITE_PROTOCOL } f
22
22
  import { plannableArgsRaw } from "./plan.js";
23
23
  import { defineTool, ToolRefusalError } from "./tool-types.js";
24
24
  import { assertFieldFamilyAllowed } from "./field-families.js";
25
- import { validateBusinessCode } from "./code-rules.js";
25
+ import { validateBusinessCode, validateFieldEntryCodes } from "./code-rules.js";
26
26
  import { hardLayoutViolations, validateFormLayout } from "./form-layout.js";
27
27
  import { prepareRuleGraph, validateRuleNodeGraph } from "./lanes/rule-graph.js";
28
28
  import { assertRuleNamePlatformAcceptable } from "./rule-support.js";
@@ -421,15 +421,48 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
421
421
  * has not proven its write. "Called without error" must never be stamped
422
422
  * DELIVERED (live 2026-10-17: model.create returned errcode 0 + present:false
423
423
  * while the menu row was orphaned; the AI read DELIVERED as success).
424
+ *
425
+ * Deletion receipts use the mirror key: `readback.absent`. The platform's
426
+ * physically_delete is an async task (AppPackageController.java:1351-1358 /
427
+ * 8.6.26 :1423 → AppIntegrationFacadeImpl.syncDeletePhysicalResources
428
+ * :1112-1131 creates `AppDeleteHistory(TaskStatus.RUN)` and returns
429
+ * immediately), so `absent:false` means "cascade still running", NOT success.
430
+ * Without this branch the same receipt was stamped DELIVERED (0.8.5 live).
424
431
  */
425
432
  export function deliveryStateFor(readback) {
426
- const presentFalse = readback !== null && typeof readback === "object" && readback.present === false;
427
- return presentFalse
428
- ? {
433
+ const record = readback !== null && typeof readback === "object" ? readback : undefined;
434
+ // The platform's async delete task itself failed (AppIntegrationFacadeImpl
435
+ // 8.6.26 :1348-1355: catch → message + TaskStatus.FAIL; read back through
436
+ // AppPackageController /delete/history). The record face still answers (the
437
+ // cascade aborted), so this must be checked FIRST — a FAIL can never be
438
+ // DELIVERED, and the platform text is the only real cause.
439
+ const rawDeleteTask = record?.deleteTask;
440
+ const deleteTask = rawDeleteTask !== null && typeof rawDeleteTask === "object" ? rawDeleteTask : undefined;
441
+ if (deleteTask?.taskStatus === "FAIL")
442
+ return {
443
+ deliveryState: "WRITE_UNVERIFIED",
444
+ readbackWarning: `未删除:平台删除任务失败(taskId=${String(deleteTask.taskId ?? "?")},平台原文:${String(deleteTask.message ?? "未返回 message")})——删除未完成,按平台原文拆引用/清残留后重试`,
445
+ };
446
+ if (record?.present === false)
447
+ return {
429
448
  deliveryState: "WRITE_UNVERIFIED",
430
449
  readbackWarning: "读回显示目标不存在(readback.present=false):平台接受了请求但权威面查不到——不要当作最终一致性豁免,按失败排查(模型挂载/路径/权限)",
431
- }
432
- : { deliveryState: "DELIVERED" };
450
+ };
451
+ // `absent:false` on a deletion receipt = the authoritative record face still
452
+ // returns the target. The platform accepted the request but the async delete
453
+ // has not completed; never read that as "deleted".
454
+ if (record?.absent === false)
455
+ return {
456
+ deliveryState: "WRITE_UNVERIFIED",
457
+ readbackWarning: "目标是删除级联中:平台 async 任务未完成(readback.absent=false,权威面仍查得到目标),勿当成功——以记录面 absent=true 且应用树无节点为准,稍后重跑本工具(幂等)复核",
458
+ };
459
+ // model.deleteMany reports the same fact per target: `allAbsent:false`.
460
+ if (record?.allAbsent === false)
461
+ return {
462
+ deliveryState: "WRITE_UNVERIFIED",
463
+ readbackWarning: "目标是删除级联中:平台 async 任务未完成(readback.allAbsent=false,见 perCode 逐项),勿当成功——稍后重跑本工具(幂等)复核",
464
+ };
465
+ return { deliveryState: "DELIVERED" };
433
466
  }
434
467
  /**
435
468
  * Single source of truth for requestId replay enum strings (r30a F1).
@@ -561,9 +594,14 @@ export function writeTool(definition) {
561
594
  if (name === "field.create")
562
595
  assertFieldFamilyAllowed(args);
563
596
  // CFG-naming: reject an invalid business code BEFORE the write permission
564
- // gate and any wire call (length / style / reserved system codes).
597
+ // gate and any wire call (length / style / reserved system codes). For
598
+ // CHILD_TABLE this also lints its sub-column codes: child columns are
599
+ // properties on the sub-schema, so the platform applies the same
600
+ // DefaultPropertyType/ExtendType checks plus DefaultSubPropertyType.
565
601
  if (name === "model.create" || name === "field.create") {
566
- const violations = validateBusinessCode(String(args.code ?? ""), { kind: name === "model.create" ? "model" : "field" });
602
+ const violations = name === "model.create"
603
+ ? validateBusinessCode(String(args.code ?? ""), { kind: "model" })
604
+ : validateFieldEntryCodes(args);
567
605
  if (violations.length > 0)
568
606
  throw new ToolRefusalError({ status: "refused", blocker: "business-code-invalid", message: "code 未过出门前校验;按 validation 修正(长度/风格/保留字)", validation: violations });
569
607
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stalfh233/omc-cli",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
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.5",
61
+ "omc-core": "0.8.7",
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.5"
79
+ "@stalfh233/omc-fake-platform": "0.8.7"
80
80
  }
81
81
  }