@stalfh233/omc-cli 0.8.30 → 0.8.32
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/approval-flow.js +26 -1
- package/dist/cli.js +10 -1
- package/dist/discovery.js +10 -0
- package/dist/field-add.js +2 -1
- package/dist/form-support.js +4 -2
- package/dist/goal-routes.js +29 -3
- package/dist/lanes/runtime-data-contract.js +1 -1
- package/dist/lanes/runtime-data.js +40 -6
- package/dist/model-scaffold.js +3 -1
- package/dist/path-projection.js +27 -6
- package/dist/recipes/runtime-data.js +9 -6
- package/package.json +3 -3
- package/skills/omc-business-configuration.md +2 -1
- package/skills/omc-start-here.md +1 -1
- package/skills/omc-write-hazards.md +2 -2
package/dist/approval-flow.js
CHANGED
|
@@ -266,6 +266,24 @@ export async function cmdApprovalFlow(args) {
|
|
|
266
266
|
const crossAccountApproval = "unsupported: single-session CLI";
|
|
267
267
|
const linearOnlyNote = "本工具只做线性审批;条件分支用 omc describe workflow.update --example workflow-conditional-branch。" +
|
|
268
268
|
"workflow.permissions 只设谁能发起,不是行级可见范围(行级数据权限当前工具面不支持)。";
|
|
269
|
+
// 探针 W F5(0.8.31):回执把「哪些是我配的业务节点、哪些是平台系统节点」直接
|
|
270
|
+
// 摊开。此前只给 activities 全表,调用方把 START/END 也算进审批级数(真机反馈
|
|
271
|
+
// 「我配了 2 级为什么显示 3 个节点」)。业务节点 = PARTICIPANT(含平台强制的
|
|
272
|
+
// {Originator} 发起填写节点,它是平台校验要求,不是审批级)。
|
|
273
|
+
const businessNodes = compiled.activities.filter((activity) => activity.activityType === "PARTICIPANT");
|
|
274
|
+
const nodeSummary = {
|
|
275
|
+
businessNodeCount: businessNodes.length,
|
|
276
|
+
businessNodes: businessNodes.map((activity) => String(activity.activityName ?? activity.activityCode ?? "")),
|
|
277
|
+
systemNodeCount: compiled.activities.filter((activity) => activity.activityType === "START" || activity.activityType === "END").length,
|
|
278
|
+
};
|
|
279
|
+
// 未显式改名时点明默认名与改名开关;发起节点是平台 Originator 校验要求。
|
|
280
|
+
const originatorNodeInfo = originatorNode
|
|
281
|
+
? {
|
|
282
|
+
name: originatorName ?? DEFAULT_ORIGINATOR_NAME,
|
|
283
|
+
source: originatorName !== undefined ? "option" : "default",
|
|
284
|
+
...(originatorName === undefined ? { renameHint: "--originator-name <名> 可改显示名(既有节点可能钉回首建名)" } : {}),
|
|
285
|
+
}
|
|
286
|
+
: undefined;
|
|
269
287
|
if (!apply) {
|
|
270
288
|
const compiledParticipantNotes = participantNotes(steps, environment);
|
|
271
289
|
const roleChecks = await roleMemberChecks(steps, environment, request, roleMemberLookup, schema);
|
|
@@ -275,6 +293,8 @@ export async function cmdApprovalFlow(args) {
|
|
|
275
293
|
status: "dry-run",
|
|
276
294
|
schemaCode: schema,
|
|
277
295
|
...compiled,
|
|
296
|
+
...nodeSummary,
|
|
297
|
+
...(originatorNodeInfo !== undefined ? { originatorNode: originatorNodeInfo } : {}),
|
|
278
298
|
...(originatorName !== undefined ? { originatorName, originatorNameNote: ORIGINATOR_NAME_NOTE } : {}),
|
|
279
299
|
dryRun: true,
|
|
280
300
|
crossAccountApproval,
|
|
@@ -376,10 +396,15 @@ export async function cmdApprovalFlow(args) {
|
|
|
376
396
|
schemaCode: schema,
|
|
377
397
|
workflowCode: compiled.workflowCode,
|
|
378
398
|
steps: steps.length,
|
|
399
|
+
...nodeSummary,
|
|
400
|
+
...(originatorNodeInfo !== undefined ? { originatorNode: originatorNodeInfo } : {}),
|
|
379
401
|
// 探针 O F7(0.8.21):apply 回执直接给本次提交的节点显示名,并给一条读回命令;
|
|
380
402
|
// 显示名是否被平台改写以 workflow.get_published 为准(不在写回执里假装已验)。
|
|
381
403
|
activities: compiled.activities.map((activity) => ({ code: activity.activityCode, name: activity.activityName, type: activity.activityType })),
|
|
382
|
-
|
|
404
|
+
// 探针 W 复核(0.8.31):workflow.update 是 merge 语义,计数只描述**本次提交**
|
|
405
|
+
// 的模板;既有模板里的旧节点仍存活,不在这里假装全图。
|
|
406
|
+
businessNodesNote: "businessNodeCount/businessNodes/systemNodeCount 只描述本次提交的模板;workflow.update 是 merge,既有模板的其它节点仍存活——存活图以 workflow.get_published 为准。",
|
|
407
|
+
activityNamesNote: `name 是本次提交的编译值;apply 后以 workflow.get_published 的 activities[].name 为准${originatorNode ? `(平台可能把发起节点钉回首建名${originatorName !== undefined ? ",见 originatorNameNote" : ""})` : ""}。START/END 是平台系统节点(systemNodeCount),不计业务节点${originatorNode ? ";发起填写节点是平台 Originator 校验要求的 PARTICIPANT,不是审批级" : ""}。`,
|
|
383
408
|
verifyCommand: `omc call workflow.get_published --env ${environment ?? "<env>"} --args '${JSON.stringify({ schemaCode: schema, workflowCode: compiled.workflowCode })}'`,
|
|
384
409
|
...(originatorName !== undefined ? { originatorName, originatorNameNote: ORIGINATOR_NAME_NOTE } : {}), ...(roleChecks.length > 0 ? { participantChecks: roleChecks } : {}), crossAccountApproval, ...preexistingSection, publish: publishOutcome.result
|
|
385
410
|
}, request, classified.error));
|
package/dist/cli.js
CHANGED
|
@@ -3362,6 +3362,7 @@ function onboardingHelp() {
|
|
|
3362
3362
|
"读面不做跨调用结果去重:同一读面同参数连跑 N 次就是 N 次真实读(不会回 unchanged,也没有 dedupe 开关)。要省就 --jq 定向取值或把结果落到自己的变量里复用;`unchanged:true` 只出现在写面回读缓存那一条路径。",
|
|
3363
3363
|
"工具发现:omc commands(路由索引)→ omc commands --capability <id>(工具名+brief+recipe)→ omc describe <tool>(参数/必填/firstCall)→ --example/--full;omc commands --json 是全量目录(回退面)。能力面:omc capabilities(id+工具数)· omc capabilities --full(id/lane/aliases/tools/依赖顺序)· omc capability <id> --executable(单能力完整执行包)。应用参数矩阵:omc help app-scope。",
|
|
3364
3364
|
"单工具/契约:omc describe <tool>(schema+recipe+能力路由)· omc contract <lane>(wire 契约+能力路由);环境就绪:omc call discover_environment --env <env> --args '{}'。",
|
|
3365
|
+
"环境选择:解析序 --env > OMC_ENV > .omc-env > 默认。可见环境≥2 时,写操作或目标是生产 → 先问用户选哪个,不要猜;只读且未绑定时也先确认。单环境可省 --env。",
|
|
3365
3366
|
"写入两道门:对话层草稿确认(omc help omc-config-draft-review)+ 环境 writable 开关;生产环境每笔写需在 args 里带 confirmProduction:true。",
|
|
3366
3367
|
].join("\n");
|
|
3367
3368
|
}
|
|
@@ -3842,8 +3843,14 @@ async function main() {
|
|
|
3842
3843
|
const configRoot = dirname(paths.configPath);
|
|
3843
3844
|
const projectRoot = dirname(paths.projectEnvPath);
|
|
3844
3845
|
const binding = { configRoot, projectRoot, bindingFiles: { ".omc-env": paths.projectEnvPath, ".omc-envs": paths.projectEnvsPath }, note: "环境集合由「项目根」的 .omc-env/.omc-envs + 配置根的 omc.config.json 共同决定;换目录会换集合" };
|
|
3846
|
+
// 2026-12-01:可见环境 ≥2 时必须显式说「该问用户」——CLI 不交互提问
|
|
3847
|
+
// (stdout 单 JSON / 非 TTY / stdin 契约),选择责任在 agent。
|
|
3848
|
+
// 只有一个可见环境时输出逐字节不变。
|
|
3849
|
+
const selectionHint = rows.length > 1
|
|
3850
|
+
? `可见环境 ${rows.length} 个:写操作、或目标是生产 → 先问用户选哪个;只读且未绑定时也先确认。可用 --env 显式指定。`
|
|
3851
|
+
: undefined;
|
|
3845
3852
|
if (options.json)
|
|
3846
|
-
process.stdout.write(JSON.stringify({ ok: true, configRoot, projectRoot, environments: rows, binding, ...(scopeNote ?? {}) }, null, 2) + "\n");
|
|
3853
|
+
process.stdout.write(JSON.stringify({ ok: true, configRoot, projectRoot, environments: rows, binding, ...(selectionHint !== undefined ? { selectionHint } : {}), ...(scopeNote ?? {}) }, null, 2) + "\n");
|
|
3847
3854
|
else if (rows.length === 0)
|
|
3848
3855
|
console.error(`(none configured; run omc setup)\n配置根:${configRoot}\n项目根:${projectRoot}`);
|
|
3849
3856
|
// A5(GitLab #15):credential: missing 的环境列得出、调不通(auth-config)——
|
|
@@ -3856,6 +3863,8 @@ async function main() {
|
|
|
3856
3863
|
// 700+ 字符坏 3 次——正道 `env export` 在所有 skill/文档里零露出。列环境时顺手
|
|
3857
3864
|
// 指路(CLI 自更新直达存量项目,比 AGENTS.md 重装传播可靠)。
|
|
3858
3865
|
console.error(`联调/token/headers 一律走 omc env export --env <env> --example curl|node(CLI 自己登录;凭据只从这条取)`);
|
|
3866
|
+
if (selectionHint !== undefined)
|
|
3867
|
+
console.error(selectionHint);
|
|
3859
3868
|
if (scopeNote !== undefined)
|
|
3860
3869
|
console.error(scopeNote.hint);
|
|
3861
3870
|
}
|
package/dist/discovery.js
CHANGED
|
@@ -322,6 +322,16 @@ export function terseType(node, depth = 0) {
|
|
|
322
322
|
// F4(0.8.6):超预算时**弃类型不弃键名**——旧实现整块退回 "object",调用方连
|
|
323
323
|
// 成员键都看不到(`sorts` 四项展开约 93 字符,`buttons` 较短才显示)。键名长度
|
|
324
324
|
// 仍超预算才退回 "object"。
|
|
325
|
+
//
|
|
326
|
+
// 探针 W F2(0.8.31):只留键名把嵌套枚举一起吞了——`sorts` 的
|
|
327
|
+
// `direction:ASC|DESC` 是调用方必须知道的合法值(写 `desc` 会被 zod 拒),
|
|
328
|
+
// 而它只占 8 字符。回退阶梯因此是「键名 + 枚举值」(60 字符)→「只键名」→
|
|
329
|
+
// `object`;非枚举键仍省略类型,体积与旧口径同量级。
|
|
330
|
+
const keysWithEnums = `object{${Object.entries(node.properties ?? {})
|
|
331
|
+
.map(([key, child]) => (child && Array.isArray(child.enum) && child.enum.length > 0 ? `${key}:${child.enum.map((value) => String(value)).join("|")}` : key))
|
|
332
|
+
.join(",")}}`;
|
|
333
|
+
if (keysWithEnums.length <= 80)
|
|
334
|
+
return keysWithEnums;
|
|
325
335
|
const keys = `object{${Object.keys(node.properties ?? {}).join(",")}}`;
|
|
326
336
|
return keys.length <= 80 ? keys : "object";
|
|
327
337
|
}
|
package/dist/field-add.js
CHANGED
|
@@ -185,7 +185,8 @@ export async function cmdFieldAdd(args, contextForTest) {
|
|
|
185
185
|
inputJson = readFileSync(assertSafeInputPath(root, fieldsFile, "--fields-file"), "utf8");
|
|
186
186
|
}
|
|
187
187
|
catch (error) {
|
|
188
|
-
|
|
188
|
+
// F1(0.8.32):与 --args-file / model-scaffold 同语气——先给 stdin。
|
|
189
|
+
return invalid(`--fields-file 读取失败:${error instanceof Error ? error.message : String(error)}${/must be inside the configuration root/.test(error instanceof Error ? error.message : String(error)) ? "。免落盘替代:`--fields -` 从 stdin 读 JSON(--fields - < <文件>);或把参数文件放到配置根内(如配置根/args.json)再用 --fields-file 引用" : ""}`);
|
|
189
190
|
}
|
|
190
191
|
}
|
|
191
192
|
if (inputJson === undefined)
|
package/dist/form-support.js
CHANGED
|
@@ -1356,15 +1356,17 @@ export async function childColumnsMissingFromForm(session, args) {
|
|
|
1356
1356
|
return missing;
|
|
1357
1357
|
}
|
|
1358
1358
|
/** 发布面缺子表列时的一句诊断(write 与 dry-run 同一句)。 */
|
|
1359
|
-
export const CHILD_COLUMNS_NOT_IN_FORM_NOTE = "
|
|
1359
|
+
export const CHILD_COLUMNS_NOT_IN_FORM_NOTE = "子表字段已发布,表单 Sheet201 columns 无此列——页面不可见(成功≠可见)。form.publish 加 bindNewChildColumns:true 一步绑定后发布(不动其它控件/布局);补 fieldCodes/布局才用 configure_form";
|
|
1360
1360
|
/** 发布面缺子表列时的回执片段(写路径 / already-published 短路 / dry-run 共用一份形状)。 */
|
|
1361
1361
|
function childColumnsGapReadback(gaps, schemaCode, sheetCode) {
|
|
1362
1362
|
if (gaps === undefined || gaps.length === 0)
|
|
1363
1363
|
return {};
|
|
1364
|
+
// F3(0.8.32):form.publish 自己就能一步绑定(bindNewChildColumns:true,与
|
|
1365
|
+
// field.publish 的教学一致),旧 nextCommand 指向 configure_form 的两次调用。
|
|
1364
1366
|
return {
|
|
1365
1367
|
childColumnsNotInForm: gaps,
|
|
1366
1368
|
childColumnsNote: CHILD_COLUMNS_NOT_IN_FORM_NOTE,
|
|
1367
|
-
nextCommand: `omc call
|
|
1369
|
+
nextCommand: `omc call form.publish --args '${JSON.stringify({ schemaCode, ...(sheetCode !== schemaCode ? { sheetCode } : {}), bindNewChildColumns: true })}'`,
|
|
1368
1370
|
};
|
|
1369
1371
|
}
|
|
1370
1372
|
/**
|
package/dist/goal-routes.js
CHANGED
|
@@ -1294,12 +1294,38 @@ function goalRouteInner(registry, goal) {
|
|
|
1294
1294
|
};
|
|
1295
1295
|
}
|
|
1296
1296
|
if (/批量导入|批量写入|批量删除|导入数据/.test(goal)) {
|
|
1297
|
-
|
|
1297
|
+
// 探针 W 复核(0.8.31):删除不是「批量写入」——`--args-list` 的信封是 N 次
|
|
1298
|
+
// 调用的通用摘要,没有逐条删除读回;data.delete 原生 `bizObjectIds` 才是逐条
|
|
1299
|
+
// 删 + 逐条回读(deleted[]/undeletedIds/deletionVerified,全部版本放行)。
|
|
1300
|
+
// 旧路由把「批量删除」也指到 `--args-list --preflight`,照抄等于放弃回读。
|
|
1301
|
+
if (/批量删除/.test(goal)) {
|
|
1302
|
+
const deletePreview = `omc call data.delete --dry-run --args '{"schemaCode":"<code>","bizObjectIds":["<id1>","<id2>"]}'`;
|
|
1303
|
+
const deleteRun = `omc call data.delete --args '{"schemaCode":"<code>","bizObjectIds":["<id1>","<id2>"]}'`;
|
|
1304
|
+
return {
|
|
1305
|
+
status: "ok", goal, confident: true, mode: "modify", write: true,
|
|
1306
|
+
match: { kind: "capability", ref: "data", title: "运行数据批量删除(bizObjectIds 逐条删+逐条回读)" },
|
|
1307
|
+
route: {
|
|
1308
|
+
capability: "data", lane: "runtime-data",
|
|
1309
|
+
note: "多条删除用 data.delete 的 bizObjectIds(单次 ≤200):工具逐条删+逐条回读,回执给 deleted[]/undeletedIds/deletionVerified,不按版本拒绝;先 --dry-run 预览。",
|
|
1310
|
+
readiness: DISCOVERY_AUTHORITY.readiness,
|
|
1311
|
+
firstCommands: [deletePreview, deleteRun],
|
|
1312
|
+
write: true,
|
|
1313
|
+
},
|
|
1314
|
+
firstAnswer: {
|
|
1315
|
+
state: "needs-input",
|
|
1316
|
+
question: `目标模型 schemaCode 和要删的 bizObjectId 清单是什么?(先 data.list 取 id)示例:${deletePreview}`,
|
|
1317
|
+
action: LIST_MODELS_ACTION,
|
|
1318
|
+
pendingCommand: deletePreview,
|
|
1319
|
+
why: "批量删除用 bizObjectIds(逐条删+逐条回读);先 --dry-run 预览,再真删;成功判据是 undeletedIds 与 notInSchema 为空",
|
|
1320
|
+
},
|
|
1321
|
+
};
|
|
1322
|
+
}
|
|
1323
|
+
const action = "data.save";
|
|
1298
1324
|
return {
|
|
1299
1325
|
status: "ok", goal, confident: true, mode: "modify", write: true,
|
|
1300
1326
|
match: { kind: "capability", ref: "data", title: "运行数据批量写入(--args-list)" },
|
|
1301
|
-
route: { capability: "data", lane: "runtime-data", note: "
|
|
1302
|
-
firstAnswer: { state: "needs-input", question: "目标模型 schemaCode 和输入文件/JSON 数组是什么?示例:omc call data.save --args-list '<file|stdin>' --preflight", action: LIST_MODELS_ACTION, pendingCommand: `omc call ${action} --args-list '<file|stdin>'`, why: "
|
|
1327
|
+
route: { capability: "data", lane: "runtime-data", note: "运行数据批量写入逐条执行,失败继续;先用 --preflight 做零写入形状校验", readiness: DISCOVERY_AUTHORITY.readiness, firstCommands: [`omc call ${action} --args-list '<file|stdin>' --preflight`, `omc call ${action} --args-list '<file|stdin>'`], write: true },
|
|
1328
|
+
firstAnswer: { state: "needs-input", question: "目标模型 schemaCode 和输入文件/JSON 数组是什么?示例:omc call data.save --args-list '<file|stdin>' --preflight", action: LIST_MODELS_ACTION, pendingCommand: `omc call ${action} --args-list '<file|stdin>'`, why: "批量导入/写入使用 --args-list;先预检形状,再逐条执行" },
|
|
1303
1329
|
};
|
|
1304
1330
|
}
|
|
1305
1331
|
// Cross-application model moves/copies are not an intent migration. There
|
|
@@ -5,7 +5,7 @@ export { RUNTIME_DATA_WIRE, RUNTIME_QUERY_OPERATORS, ENGINE_OWNED_KEYS, SUBMIT_S
|
|
|
5
5
|
import { RUNTIME_DATA_WIRE } from "omc-core/wire-facts";
|
|
6
6
|
export function dataListDescription() {
|
|
7
7
|
const wire = RUNTIME_DATA_WIRE;
|
|
8
|
-
return `按简化过滤 DSL 查询业务对象(runtime/query/list);DSL 在 CLI 内翻译为平台 queryCondition(${wire.dslShape}),并按发布字段元数据为每个条件注入 propertyType(未知过滤字段将被拒绝,可用 rawCondition 逃生;op 大小写不敏感);响应行在 items[],业务字段在 items[].fields.<code>(不是 rows[],也不是 item 顶层——--jq 常用 items[].fields.sku
|
|
8
|
+
return `按简化过滤 DSL 查询业务对象(runtime/query/list);DSL 在 CLI 内翻译为平台 queryCondition(${wire.dslShape}),并按发布字段元数据为每个条件注入 propertyType(未知过滤字段将被拒绝,可用 rawCondition 逃生;op 大小写不敏感);响应行在 items[],业务字段在 items[].fields.<code>(不是 rows[],也不是 item 顶层——--jq 常用 items[].fields.sku);空模型返回空列表;列表只投影视图列:**显式选列只能收窄、不能扩列**(视图外且无值 code 进 columnsOutsideView,扩列用 data.load);**已判定未投影的列会从 items[].fields 省略键**(items[].unprojected 点名;不是数据丢失——data.load 有值;有视图列证据时系统列如 sequenceNo 同判;全 null 时 readback 追加 projectionHint,先 listview.configure 配置视图列或用 data.load 读单条)。键缺席=字段不存在或该行已判定未投影(见 items[].unprojected);键在且值 null=真空值(未投影或真空值不再同形;nullSemantics 说明口径)。`;
|
|
9
9
|
}
|
|
10
10
|
export function dataAggregateDescription() {
|
|
11
11
|
return `临时计数与数值聚合(纯读)。count:runtime/query/list size:1 读 totalElements(服务端精确、不受 cap 影响;带 filter +1 field.list)。sum/avg/min/max:field 必填且已发布 propertyType=2(NUMERICAL);无 GET_LIST 改源时优先 /sum ALL_DATA(coverage.mode=server-aggregate,全量精确),否则/失败/键不符回退本地折叠(strategyFallback;size:200 翻页至 cap 1000,null 不进聚合、avg=sum/非 null 行数,nonNullCount=0→value:null)。complete 看 rowsScanned>=total,否则 missingCount+capNotice,绝不外推。groupBy 单列:count 值域可枚举(options/字典)→值域×count(V+3 wire),分桶并发窗口 4(限流退化 2,见 wire.concurrency),桶序稳定;按 count 降序取 topN(默认 10/上限 20),截断给 truncatedBuckets/bucketsTruncatedCount,null 单列 nullBucket;不可枚举或数值指标→本地扫描(coverage.mode=paged-local-scan/local-scan),数值桶 {key,count,nonNullCount,value} 按 value 降序、并列按 key,null 行进 nullBucket。filter.draftPolicy:count+groupBy 默认 includeDrafts:false 注入 sequenceStatus≠DRAFT;数值指标不默认排除;count 省略=平台默认(无条件含草稿、带条件排草稿);显式 false 强制排除。边界:临时问句用本工具;持久图表/看板用 report.chartdata,视图汇总列用 sumType,写时计算用 datarule type2。子表计数/求和用 child(主表 schemaCode + childSchemaCode/bizObjectId)。`;
|
|
@@ -457,8 +457,23 @@ export const DATA_LIST_COLUMNS_NARROWING_NOTE = "只能选视图列;扩列用
|
|
|
457
457
|
* 空 `queryColumns` 不参与本判定:那种形状已由 `projectionHint` /
|
|
458
458
|
* `viewProjectionOnly`(全 null 业务列)覆盖,避免把「fake 默认无视图」误报成
|
|
459
459
|
* 「超列」。系统列由 completeSystemFields 恒投影,不判。
|
|
460
|
+
*
|
|
461
|
+
* F4b(0.8.32,真机 P2):**任一行该 code 有非 null 值** = 平台确实返回了它,
|
|
462
|
+
* 就不是「视图外」。子表列(CHILD_TABLE)是典型反例:视图 queryColumns 里没有
|
|
463
|
+
* 它,但行数据照常带子表数组(2.1.5 `BizObjectFacadeImpl.java:614` 的
|
|
464
|
+
* `assemblySubTableBizObject` → `SubBizObjectLoader.java:65,71-78` 遍历的是
|
|
465
|
+
* 模型的**全部已发布子表属性**、子列集来自子表 schema,与主表视图列集无关),
|
|
466
|
+
* 旧判据只看 `!view.has(code)` 于是把 `pb_repair_items` 报成「不会返回值」——
|
|
467
|
+
* 与同一行 `items[].fields.pb_repair_items` 的 2 行数据自相矛盾。用现有证据
|
|
468
|
+
* (不额外 wire),只有「无值且不在视图」才点名。
|
|
469
|
+
*
|
|
470
|
+
* 残余边界(未解,别当成已全解):
|
|
471
|
+
* - ① 子表 **0 行**时平台不返回该子表键(无值证据),该 code 仍可能被报
|
|
472
|
+
* 「视图外」——此时「不会返回值」在字面上成立,但不是「列不在视图」的意思。
|
|
473
|
+
* - ② 只看**本次读到的行**:`all:false` 只观测当前页,某 code 可能在别页有值;
|
|
474
|
+
* `all:true` 也只扫到 1000 行上限。跨页有值而本页为 null/缺键时仍可能误报。
|
|
460
475
|
*/
|
|
461
|
-
export function columnsOutsideViewOf(requested, viewColumnCodes, projectionMiss) {
|
|
476
|
+
export function columnsOutsideViewOf(requested, viewColumnCodes, projectionMiss, observedNonNullCodes) {
|
|
462
477
|
if (requested === undefined || requested.length === 0)
|
|
463
478
|
return [];
|
|
464
479
|
const view = viewColumnCodes !== undefined && viewColumnCodes.length > 0 ? new Set(viewColumnCodes) : undefined;
|
|
@@ -468,11 +483,24 @@ export function columnsOutsideViewOf(requested, viewColumnCodes, projectionMiss)
|
|
|
468
483
|
return [...new Set(requested)].filter((code) => {
|
|
469
484
|
if (code.length === 0 || RUNTIME_SYSTEM_FIELD_CODES.has(code) || code.endsWith("_") || code.endsWith("_key"))
|
|
470
485
|
return false;
|
|
486
|
+
if (observedNonNullCodes?.has(code) === true)
|
|
487
|
+
return false;
|
|
471
488
|
if (missed?.has(code) === true)
|
|
472
489
|
return true;
|
|
473
490
|
return view !== undefined && !view.has(code);
|
|
474
491
|
});
|
|
475
492
|
}
|
|
493
|
+
/** 结果行里真的有非 null 值的 code(columnsOutsideViewOf 的「不是视图外」证据)。 */
|
|
494
|
+
function observedNonNullCodesOf(items) {
|
|
495
|
+
const codes = new Set();
|
|
496
|
+
for (const item of items) {
|
|
497
|
+
for (const [code, value] of Object.entries(item.fields)) {
|
|
498
|
+
if (value !== null && value !== undefined)
|
|
499
|
+
codes.add(code);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
return codes;
|
|
503
|
+
}
|
|
476
504
|
/**
|
|
477
505
|
* F10(w63,2026-11-26 真机):DATE 字段读回固定 `YYYY-MM-DD HH:mm:ss`
|
|
478
506
|
* (0.8.8 只在 describe 写了,探针仍在回执里按 `options.format` 断言而踩)。
|
|
@@ -2127,10 +2155,16 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2127
2155
|
filters: z.array(z.record(z.string(), z.unknown())).optional().describe("clauses combined with AND; a malformed clause is refused with blocker invalid-filter-DSL"),
|
|
2128
2156
|
filterGroup: z.record(z.string(), z.unknown()).optional().describe('nested group { op:"and"|"or", clauses:[clause|group] }'),
|
|
2129
2157
|
rawCondition: z.unknown().optional(),
|
|
2130
|
-
displayFields: z.array(z.string().min(1)).optional().describe("
|
|
2158
|
+
displayFields: z.array(z.string().min(1)).optional().describe("列投影(**本地裁剪**:平台只取视图 queryColumns,不认 displayFields;**只能收窄不能扩列**,视图外且无值 code 进 columnsOutsideView)"),
|
|
2131
2159
|
columns: z.array(z.string().min(1)).optional().describe("列投影别名(=displayFields)"),
|
|
2132
2160
|
// r29b F9: data.load/save/update 都叫 fields;list 面原先只有 displayFields/columns。
|
|
2133
|
-
|
|
2161
|
+
// F4a(0.8.32):旧描述说「与 data.load 的 fields 同语义」是错的——list 的
|
|
2162
|
+
// fields 只做**结果本地收窄**(body 不发 displayFields,见下方 body 构造;
|
|
2163
|
+
// 平台按视图 queryColumns 取列:BizObjectFacadeImpl.java:2216 的 columns =
|
|
2164
|
+
// handleQueryColumn(...),1830-1866 在 display=false 时只取
|
|
2165
|
+
// bizQueryColumnService.getListByQueryId(queryId) 的视图列;这些列再经
|
|
2166
|
+
// BizFilter.java:60-72 变成 SELECT 列表)。真值用 data.load。
|
|
2167
|
+
fields: z.array(z.string().min(1)).optional().describe("=displayFields;只收窄不扩列,视图外且无值 code 进 columnsOutsideView;真值用 data.load"),
|
|
2134
2168
|
// r73 #4(GitLab #40 P1):只读查询的排序 fallback 首选曾是写操作(listview.configure
|
|
2135
2169
|
// 会改线上视图、影响所有用户)。顺序反转——本地排序第一,视图级写操作殿后并注明代价。
|
|
2136
2170
|
// r86(retro issue 16):wire 侧其实有服务端排序(QueryDataVO.orders,真机 1.1.25
|
|
@@ -2555,7 +2589,7 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2555
2589
|
const unprojectedCodes = unprojectedFieldCodes(itemsFinal);
|
|
2556
2590
|
const anyNullField = itemsFinal.some((item) => Object.values(item.fields).some((value) => value === null));
|
|
2557
2591
|
// F5(w63,P1):columns 只能收窄视图列;视图外的 code 点名。
|
|
2558
|
-
const columnsOutsideView = columnsOutsideViewOf(fields, viewEvidence?.viewColumnCodes, projectionMissAll);
|
|
2592
|
+
const columnsOutsideView = columnsOutsideViewOf(fields, viewEvidence?.viewColumnCodes, projectionMissAll, observedNonNullCodesOf(items));
|
|
2559
2593
|
// F10(w63):结果里真有 DATE 形状的值时才读一次元数据确认类型。
|
|
2560
2594
|
const dateCandidates = [...new Set(itemsFinal.flatMap((item) => dateLikeCodes(item.fields)))];
|
|
2561
2595
|
let dateReadbackNote;
|
|
@@ -2807,7 +2841,7 @@ export function registerRuntimeDataLane(tools) {
|
|
|
2807
2841
|
const unprojectedCodes = unprojectedFieldCodes(itemsFinal);
|
|
2808
2842
|
const anyNullField = itemsFinal.some((item) => Object.values(item.fields).some((value) => value === null));
|
|
2809
2843
|
// F5(w63,P1):columns 只能收窄视图列;视图外的 code 点名。
|
|
2810
|
-
const columnsOutsideView = columnsOutsideViewOf(fields, viewEvidence?.viewColumnCodes, projectionMissPaged);
|
|
2844
|
+
const columnsOutsideView = columnsOutsideViewOf(fields, viewEvidence?.viewColumnCodes, projectionMissPaged, observedNonNullCodesOf(items));
|
|
2811
2845
|
// F10(w63):结果里真有 DATE 形状的值时才读一次元数据确认类型。
|
|
2812
2846
|
const dateCandidates = [...new Set(itemsFinal.flatMap((item) => dateLikeCodes(item.fields)))];
|
|
2813
2847
|
let dateReadbackNote;
|
|
@@ -4511,7 +4545,7 @@ export function registerRuntimeDataLane(tools) {
|
|
|
4511
4545
|
undeletedIds,
|
|
4512
4546
|
message: `批量删除回执为成功但删后回读仍能读到 ${undeletedIds.length} 条(典型=1.1.25 批量假成功:DELIVERED/true 但行仍在)。不要把本回执当成功。`,
|
|
4513
4547
|
nextCommand: `omc call data.delete --args '${JSON.stringify({ schemaCode: args.schemaCode, bizObjectId: undeletedIds[0] })}'`,
|
|
4514
|
-
retry: "
|
|
4548
|
+
retry: "改单条 bizObjectId 逐条重试,或把未删 id 收成新的 bizObjectIds 重发(回执逐条给 deleted[],一次 ≤200);每条删完 data.load 确认 exists:false,最后 data.list 复核 total。",
|
|
4515
4549
|
}
|
|
4516
4550
|
: undefined;
|
|
4517
4551
|
// `deleted`/`count` ride `readback` — the write envelope surfaces only
|
package/dist/model-scaffold.js
CHANGED
|
@@ -132,7 +132,9 @@ export async function cmdModelScaffold(args) {
|
|
|
132
132
|
const detail = error instanceof Error ? error.message : String(error);
|
|
133
133
|
// F2(0.8.6):越界报错要能直接照做——旧文案只说「必须在配置根内」,
|
|
134
134
|
// 不给路径。与 --args-file(cli.ts)同配方:给根内示例文件路径。
|
|
135
|
-
|
|
135
|
+
// F1(0.8.32):与 --args-file 同语气——**先给免落盘的 stdin**,再给根内
|
|
136
|
+
// 落盘路径。旧顺序把「放到根下」放前面,读者照做后还要再想一步。
|
|
137
|
+
return invalid(`--fields-file 读取失败:${detail}${/must be inside the configuration root/.test(detail) ? `。免落盘替代:\`--fields -\` 从 stdin 读 JSON(--fields - < <文件>);或把参数文件放到 ${root} 之下(如 ${join(root, "args.json")})再用 --fields-file 引用` : ""}`);
|
|
136
138
|
}
|
|
137
139
|
}
|
|
138
140
|
if (inputJson === undefined)
|
package/dist/path-projection.js
CHANGED
|
@@ -1059,12 +1059,33 @@ export function projectResultExtract(result, paths, keysOnly, retry, explain = f
|
|
|
1059
1059
|
* F7(0.8.12)与 C6(0.8.4)的边界:默认 pathMiss 仍只留「在哪断 + 最接近的键 +
|
|
1060
1060
|
* 教程指针」(≤300B,无 available/hint);full 面独占键只允许带一条**能装进
|
|
1061
1061
|
* 300B** 的 `nextCommand`,装不下就留给 `--explain`。
|
|
1062
|
+
*
|
|
1063
|
+
* F2(0.8.32):`skills/omc-refusals.md` 一直写「miss 给 correctPath + nextCommand
|
|
1064
|
+
* (能验证才给)」,但默认面只在 --explain 给。现在**唯一可验证**的纠错
|
|
1065
|
+
* (`reason === undefined`:一个候选且已在真实结果树上解析通过)也进默认面——
|
|
1066
|
+
* 它是结论,不是排查载荷;多候选(reason 点名其余位置)仍只走 --explain,不猜。
|
|
1067
|
+
* 300B 装不下时按优先级退:先保 correctPath(结论),再丢 nextCommand。
|
|
1062
1068
|
*/
|
|
1063
|
-
const compactMissExtra = (
|
|
1064
|
-
|
|
1069
|
+
const compactMissExtra = (entry, fullFace, correction, retryCommand) => {
|
|
1070
|
+
const uniquePath = correction !== undefined && correction.reason === undefined ? correction.correctPath : undefined;
|
|
1071
|
+
const extras = {};
|
|
1072
|
+
if (uniquePath !== undefined)
|
|
1073
|
+
extras.correctPath = uniquePath;
|
|
1074
|
+
// full 面独占键的重试命令优先(form.get 的 full:true);否则用纠错路径拼的重跑命令。
|
|
1075
|
+
const nextCommand = fullFace?.nextCommand ?? (uniquePath !== undefined ? retryCommand : undefined);
|
|
1076
|
+
if (nextCommand !== undefined)
|
|
1077
|
+
extras.nextCommand = nextCommand;
|
|
1078
|
+
const fits = (candidate) => Buffer.byteLength(JSON.stringify({ ...entry, ...candidate }), "utf8") <= 300;
|
|
1079
|
+
if (Object.keys(extras).length === 0)
|
|
1065
1080
|
return {};
|
|
1066
|
-
|
|
1067
|
-
|
|
1081
|
+
if (fits(extras))
|
|
1082
|
+
return extras;
|
|
1083
|
+
// 装不下:correctPath 是结论,nextCommand 是便利——先丢后者。
|
|
1084
|
+
if (extras.correctPath !== undefined) {
|
|
1085
|
+
const onlyPath = { correctPath: extras.correctPath };
|
|
1086
|
+
return fits(onlyPath) ? onlyPath : {};
|
|
1087
|
+
}
|
|
1088
|
+
return {};
|
|
1068
1089
|
};
|
|
1069
1090
|
out.extract = paths.map((path) => {
|
|
1070
1091
|
// F8:拒绝态下载荷字段不是值——回拒绝摘要而不是默认 0/[]/null。
|
|
@@ -1130,7 +1151,7 @@ export function projectResultExtract(result, paths, keysOnly, retry, explain = f
|
|
|
1130
1151
|
...(readFromArtifact ? resultLayerNote(result, path, projectionSource, fan.at) ?? {} : {}),
|
|
1131
1152
|
hint: fullFace?.hint ?? missHintFor(fan.at, fan.available, correction),
|
|
1132
1153
|
}
|
|
1133
|
-
: compactMissExtra(
|
|
1154
|
+
: compactMissExtra(baseMiss, fullFace, correction, nextCommand)),
|
|
1134
1155
|
};
|
|
1135
1156
|
}
|
|
1136
1157
|
return {
|
|
@@ -1185,7 +1206,7 @@ export function projectResultExtract(result, paths, keysOnly, retry, explain = f
|
|
|
1185
1206
|
...(readFromArtifact ? resultLayerNote(result, path, projectionSource, single.at) ?? {} : {}),
|
|
1186
1207
|
hint: fullFace?.hint ?? missHintFor(single.at, single.available, correction),
|
|
1187
1208
|
}
|
|
1188
|
-
: compactMissExtra(
|
|
1209
|
+
: compactMissExtra(baseMiss, fullFace, correction, nextCommand)),
|
|
1189
1210
|
};
|
|
1190
1211
|
}
|
|
1191
1212
|
const singleValue = single.value ?? null;
|
|
@@ -169,24 +169,27 @@ const dataDeleteSweep = Object.freeze({
|
|
|
169
169
|
// 批量删除不按版本拒绝(多版本兼容优先):1.1.25 有已知假成功(r30),
|
|
170
170
|
// 2.1.5 实测真实生效;所有版本都放行,主防线是删后逐条回读——仍能读到的 id
|
|
171
171
|
// 进 readback.batchDeleteIneffective / undeletedIds,提示改单条重试。
|
|
172
|
-
// recipe.args
|
|
172
|
+
// recipe.args 给单条形状;批量直接传 bizObjectIds(工具内部逐条删+逐条回读,
|
|
173
|
+
// 与 --args-list 的通用摘要不同:deleted[]/undeletedIds/deletionVerified 都在回执里)。
|
|
173
174
|
args: { environment, schemaCode: model, bizObjectId: "<data.list 一条 id>" },
|
|
174
175
|
preconditions: [
|
|
175
176
|
"先 data.list 取全量 ids(`all:true` 才含 DRAFT;翻页取全),清理对象按 data.list 全量",
|
|
176
177
|
"**行数以 data.list total 为准,别按「N 提交=2N 行」外推**:带流程的 submit 原地推进同一行(r28b 实测 3→3);双行只在平台另起草稿行时出现(r30 的 5→10)",
|
|
177
178
|
],
|
|
178
179
|
conditionalRequirements: [
|
|
179
|
-
"批量 `bizObjectIds` 所有版本都放行(单次上限 200,超限分块串行),但必须看删后回读:成功判据是 `undeletedIds` 与 `notInSchema` 均为空(`deletionVerified:true`),**不是** `remainingRows`/`clean`(整表状态,删一部分时 clean:false 正常)。出现 `undeletedIds`/`batchDeleteIneffective`(1.1.25 已知批量假成功:回执成功但行仍在)→
|
|
180
|
+
"批量 `bizObjectIds` 所有版本都放行(单次上限 200,超限分块串行),但必须看删后回读:成功判据是 `undeletedIds` 与 `notInSchema` 均为空(`deletionVerified:true`),**不是** `remainingRows`/`clean`(整表状态,删一部分时 clean:false 正常)。出现 `undeletedIds`/`batchDeleteIneffective`(1.1.25 已知批量假成功:回执成功但行仍在)→ 把未删 id 收成新的 `bizObjectIds` 重发(单次 ≤200;回执同样逐条给 `deleted[]`,`--args-list` 只是通用摘要,不必再用)",
|
|
180
181
|
"删完逐条 `data.load` 确认 `exists:false`(`absent:true` / `modelResidue.total` 递减都不是删除成功的证明);最后再 `data.list` 复验 total:0。批量回执的 deletedCount/已删条数、alreadyAbsentCount/本来不存在条数与 notInSchema/不属于该模型条数要能对上",
|
|
181
182
|
"删前读不到该 id 默认回 `uncertain` + `delete-target-not-in-schema`(零删除 wire,可能 schemaCode 写错);确认并发已删、要做幂等重复清理时必须显式 `allowAlreadyAbsent:true`,并自行保证 schemaCode 正确",
|
|
182
183
|
],
|
|
183
184
|
priorToolReferences: [
|
|
184
|
-
{ tool: "data.list", args: { environment, schemaCode: model }, purpose: "取全量 ids(含 DRAFT
|
|
185
|
+
{ tool: "data.list", args: { environment, schemaCode: model }, purpose: "取全量 ids(含 DRAFT 行),收成 bizObjectIds 数组" },
|
|
185
186
|
],
|
|
186
187
|
dryRun: {
|
|
187
188
|
supported: true,
|
|
188
|
-
|
|
189
|
-
|
|
189
|
+
// 探针 W 复核(0.8.31):dry-run 示例必须真的带 --dry-run——照抄上面这条是
|
|
190
|
+
// 预览,照抄下面真删那条才是执行(写面配方 53/56 都带,本配方曾漏)。
|
|
191
|
+
command: `omc call data.delete --env ${environment} --dry-run --args '{"schemaCode":"${model}","bizObjectIds":["<id1>","<id2>"]}'`,
|
|
192
|
+
notes: "多条用 bizObjectIds(所有版本放行,单次上限 200;工具内部逐条删并逐条 data.load 回读,回执给 deleted[]/undeletedIds/deletionVerified;dry-run 回执给 estimatedWireCalls≈3N+1)。若回执报 batch-delete-ineffective/undeletedIds,把未删 id 收成新的 bizObjectIds 重发(一次 ≤200)。成功判据是 undeletedIds 与 notInSchema 均为空,不是 remainingRows/clean;删前读不到默认 uncertain,幂等重复清理需显式 allowAlreadyAbsent:true",
|
|
190
193
|
},
|
|
191
194
|
expectedReadback: {
|
|
192
195
|
readback: { deleted: true, exists: false },
|
|
@@ -196,7 +199,7 @@ const dataDeleteSweep = Object.freeze({
|
|
|
196
199
|
],
|
|
197
200
|
},
|
|
198
201
|
refusalRecovery: [
|
|
199
|
-
{ code: "batch-delete-ineffective", action: "列出 undeletedIds
|
|
202
|
+
{ code: "batch-delete-ineffective", action: "列出 undeletedIds 收成新的 bizObjectIds 重发(回执逐条给 deleted[],一次 ≤200),每条删完 data.load 确认 exists:false" },
|
|
200
203
|
{ code: "wire-business", action: "模型须已创建且有已发布字段;运行面 50000 时先 model.inspect modelPresent 判存在" },
|
|
201
204
|
],
|
|
202
205
|
requiresEnvironmentDerivedIds: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.32",
|
|
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.
|
|
61
|
+
"omc-core": "0.8.32",
|
|
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.
|
|
79
|
+
"@stalfh233/omc-fake-platform": "0.8.32"
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -163,7 +163,7 @@ rules:
|
|
|
163
163
|
|
|
164
164
|
- **两条路**:模型+表单+流程一揽子交付走**意图**(`intent` 的 `workflow` 能力,声明式一次 apply);只动流程或想逐步控制走**低层链** `workflow.create → workflow.update(权限/节点)→ workflow.publish`,标准链配方见 `omc describe workflow.update`(含多级审批/participant 三形态/自动回填说明)。流程权限细节见下节。
|
|
165
165
|
- 一个模型只能有一个流程;已有流程的模型直接 `workflow.update`,不要另建。
|
|
166
|
-
-
|
|
166
|
+
- **清理测试数据走 `data.delete`**:批量传 `bizObjectIds`(≤200;工具逐条删+逐条回读,回执给 `deleted[]`/`undeletedIds`/`deletionVerified`;1.1.x 假成功标 `batchDeleteIneffective`)。判据是 `undeletedIds` 与 `notInSchema` 皆空,不是 `remainingRows`/`clean`;`--args-list` 无逐条读回,别当删除主路径(见 `describe data.delete --example sweep-all-readback`)。
|
|
167
167
|
- **「聚合计算」是字段能力,不是规则节点**:FORMULA(计算公式)字段的 `options.formulaConfig.formulaType="AGGREGATION"` 就是 UI 里的「配置方式 → 聚合计算」。**只能汇总另一个模型**(跨模型),**同模型/自己的子表会 305003**(`field.publish` 时 `publishFormula` 把相对码改写成子表父模型 = 本模型,`checkCycleOfAggregation:1032` 判成环;工具已写前拒绝 `aggregation-self-schema-cycle`)。可直接抄 `omc describe field.create --example formula-aggregation-cross-model`。形状:
|
|
168
168
|
`options = {persistent:true, formulaConfig: JSON字符串({resultType:2, formulaType:"AGGREGATION", aggregation: JSON字符串({schemaCode:"<来源模型>", dataItemCode:"<来源列>", calculateType:"SUM", formula:"SUM({<来源模型>.<列>})", queryConditions:[[{propertyCode:"<来源模型字段>", currentPropertyCode:"<目标模型字段>", operatorType:1, valueType:"DYNAMIC"}]]})})}`。
|
|
169
169
|
- **`queryConditions` 不能为空**:它是反向过滤器的唯一输入,空数组时回算日志照打但目标字段恒 0(r17 实测)。
|
|
@@ -350,6 +350,7 @@ BIZ_ACTION:
|
|
|
350
350
|
|
|
351
351
|
- **数据 → 流程 → 模型**:先 `data.delete`;删流程前先清列表视图 `add` 绑定(首次 `workflow.publish` 自动绑;撞 `workflow-bound-to-listview`/303024 时用回执里的 `listviewBinding.unbindCommand`)。
|
|
352
352
|
- **视图随模型级联**:`listview.delete` 只用于替换视图;最后一条可见视图不可单删(2.1 回 306103)——要清视图就删模型。
|
|
353
|
+
- **子表列指回本模型时 `model.delete` 零写入拒绝**(平台自递归),改用 `omc model-purge --code <code> --apply`。
|
|
353
354
|
- 完整恢复路径与 8.6/2.1 源码行号:`omc help omc-playbook --section cleanup`。
|
|
354
355
|
|
|
355
356
|
浏览器不是常规验收步骤;只有用户报告 UI 回归时才做专项诊断。
|
package/skills/omc-start-here.md
CHANGED
|
@@ -31,7 +31,7 @@ be treated as a second source. Read this, then follow the topics it names.
|
|
|
31
31
|
|
|
32
32
|
1c. **写后端 Java 源码(在线开发)走工作区而不是一条条 call**:`omc programming pull --env <env> --app <appCode>` 把业务规则源码拉进 `.omc-programming/`(git 可管),改文件后 `omc programming status` → `omc programming apply [--publish]`(逐文件走编程面治理);图形化规则转编码用 `omc programming adopt --schema <s> --rule <r>`;验证用 `omc programming test --schema <s> --rule <r>`(fixture 驱动:compile→publish→触发→断言→清理)。**平台运行时只执行已发布版**:只 save 不 publish 等于没改;publish 内部会编译并把规则切 CODING+enable。包路径/类名不得改。
|
|
33
33
|
2. 写前只需读 `omc-config-draft-review`(人审门)与 `omc-five-piece-flow`(发现→草稿→权限→执行→回读);`omc-business-configuration` 按命中的能力分节读(见 `next` 的 `readSections`),不要整篇预取。
|
|
34
|
-
3.
|
|
34
|
+
3. 环境:以 `omc doctor` 的「环境=」或 `.omc-env` 为准(序 `--env` > `OMC_ENV` > `.omc-env` > default)。自然语言标签**不要**拼成 `--env`。单环境省 `--env`;可见环境 ≥2 先 `omc env list`/`omc doctor`:**写、或目标是生产 → 先问用户**,读面不明确也问。发现面按下面档位表从小到大取;`describe` 带 `exampleHint`/`recipeHint` 时优先 `--example`。
|
|
35
35
|
5. 键名按对象不同:模型 `schemaCode`、默认表单 `sheetCode`(可省略,默认 == 模型 code)、流程 `workflowCode`/`code`——报错会提示同义键;字段族名认不出会给「最接近的族」。
|
|
36
36
|
6. **写操作串行**:同一环境不要并发写(含多个 `omc call` 并行进程——环境写锁互斥,r31 实证并行 field.create 2/3 被拒);多个写合并为一条 `omc script` 逐行跑(进程内自动串行);`write-lock-held` 是瞬态:**优先在发起时就排队**——`omc call <tool> --wait 5000`(或 `omc intent apply ... --wait 5000`)让 CLI 内部有界重试,不必自己再花一轮。
|
|
37
37
|
7. **单个对象优先高阶编排工具**:模型+字段用 `configure_model`(一次含全部字段),表单用 `configure_form`,列表用 `listview.configure`(**默认视图已存在,省略 code 即配置它,不要 `listview.create`**)。原子工具留给单点修改。
|
|
@@ -85,7 +85,7 @@ omc help omc-write-hazards
|
|
|
85
85
|
|
|
86
86
|
## 删除链
|
|
87
87
|
|
|
88
|
-
`model.delete` 带走:默认表单/在线 JS/流程/列表视图/平台预置规则与数据规则;**不带走**:自定义业务规则、业务数据(须先删)。顺序:`onlinejs` → `data.delete` 逐条清数据 → 删自定义规则 → `omc model-purge --code <schema>`(依赖倒序,默认 dry-run)。漏传 `bizObjectId(s)` 会被 `tool-input-invalid` 拒绝并指路 `data.list` 取 id
|
|
88
|
+
`model.delete` 带走:默认表单/在线 JS/流程/列表视图/平台预置规则与数据规则;**不带走**:自定义业务规则、业务数据(须先删)。顺序:`onlinejs` → `data.delete` 逐条清数据 → 删自定义规则 → `omc model-purge --code <schema>`(依赖倒序,默认 dry-run)。漏传 `bizObjectId(s)` 会被 `tool-input-invalid` 拒绝并指路 `data.list` 取 id——无「漏传=全删」暗门;批量用 `bizObjectIds`(≤200,逐条删+逐条回读)。清完 `data.load` 复核。
|
|
89
89
|
|
|
90
90
|
## 按钮
|
|
91
91
|
|
|
@@ -119,7 +119,7 @@ omc call field.publish --env local --args '{"schemaCode":"expense"}'
|
|
|
119
119
|
- **PowerShell 的 `--args`**:不能照抄 POSIX 单引号;非法 JSON = exit 10、零请求。改用 `--args-file '<配置根>/args.json'` 或 `--args -`(stdin)。
|
|
120
120
|
|
|
121
121
|
- **同一 `<env>` 的写调用必须串行发起**:`write-lock-held` 不只在"并行重放失败请求"时出现,也会在**并行发起两个无关写**时触发(实测:并行两条无关写各失败一次)。读可并行,写不要。并发用 `--wait <ms>` 让 CLI 排队,别在 shell 里重试。并发语义(写锁/patch/翻页/删除幂等)见 `omc help concurrency`。
|
|
122
|
-
- **`data.delete`
|
|
122
|
+
- **`data.delete` 批量 1.1.25 假成功**(r30 真机):平台回 `DELIVERED`+`absent:true` 但行仍在——工具已逐条删+逐条回读(`batchDeleteIneffective`/`undeletedIds`,`WRITE_UNVERIFIED`)。纪律不变:删后 `data.load exists:false` 复核,`absent:true` 不是证明;未删 id 用新 `bizObjectIds` 重发。
|
|
123
123
|
|
|
124
124
|
## 审批提交的真实形状(r18b 2026-10-26 真机,1.1.25)
|
|
125
125
|
|