@stalfh233/omc-cli 0.8.9 → 0.8.11
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 +8 -1
- package/dist/goal-routes.js +59 -3
- package/dist/human-summary.js +30 -7
- package/dist/intent/capabilities/field.js +77 -3
- package/dist/intent/plan-apply.js +13 -1
- package/dist/lanes/field-contract.js +1 -1
- package/dist/lanes/field.js +92 -9
- package/dist/lanes/list-view-contract.js +2 -2
- package/dist/lanes/list-view-shapes.js +46 -0
- package/dist/lanes/list-view.js +179 -123
- package/dist/lanes/model-references.js +22 -6
- package/dist/lanes/model.js +6 -3
- package/dist/lanes/runtime-data.js +43 -19
- package/dist/model-purge.js +2 -2
- package/dist/read.js +12 -1
- package/dist/recipes/datarule.js +1 -1
- package/dist/recipes/field.js +11 -4
- package/dist/recipes/online-js.js +2 -2
- package/dist/recipes/runtime-data.js +31 -1
- package/dist/write.js +7 -2
- package/package.json +3 -3
- package/skills/omc-backend-online-coding.md +3 -0
- package/skills/omc-refusals.md +3 -0
- package/skills/omc-requirement-vocabulary.md +2 -1
package/dist/recipes/datarule.js
CHANGED
|
@@ -124,7 +124,7 @@ const dataruleChildColumn = Object.freeze({
|
|
|
124
124
|
tool: "datarule.create",
|
|
125
125
|
args: {
|
|
126
126
|
environment,
|
|
127
|
-
schemaCode: "
|
|
127
|
+
schemaCode: "<子表父字段 code,如 items>",
|
|
128
128
|
propertyCode: "amount",
|
|
129
129
|
dataRuleType: 2,
|
|
130
130
|
options: {
|
package/dist/recipes/field.js
CHANGED
|
@@ -215,15 +215,15 @@ const childTable = Object.freeze({
|
|
|
215
215
|
},
|
|
216
216
|
preconditions: ["目标模型已存在;父字段 code 和子列 codes 尚未存在;父模型字段发布后再配置表单"],
|
|
217
217
|
conditionalRequirements: [
|
|
218
|
-
"
|
|
218
|
+
"**父字段 `code` = 子 schema code = 子列 field.create/update 的 schemaCode(同一个值)**;平台要求全局唯一,跨模型撞名就加前缀(如 `<model>_items`),撞名时只回 errcode 40000「调用数据库发生异常」(实测);",
|
|
219
219
|
"子表列不得是 CHILD_TABLE、OCR、ELECTRONIC_SIGN、RELEVANCE_DATA 或 FORMULA;关系列必须另带 relativeCode 与 options;子列 NUMERICAL 同样必须带 options.scale",
|
|
220
220
|
],
|
|
221
221
|
priorToolReferences: [],
|
|
222
222
|
dryRun: { supported: true, command: `omc call field.create --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 验证 subFields 并跳过环境写入" },
|
|
223
|
-
expectedReadback: { readback: { field: { code: "
|
|
223
|
+
expectedReadback: { readback: { field: { code: "<model>_items", propertyType: "CHILD_TABLE", subSchema: { properties: ["itemName", "itemQty"] } } }, next: ["field.publish", "form.draft", "form.publish"] },
|
|
224
224
|
refusalRecovery: [
|
|
225
225
|
{ code: "capability-out-of-coverage", action: "补齐 subFields,并移除不支持的嵌套/高级子列族" },
|
|
226
|
-
{ code: "child-table-update-unsupported", action: "子列用 schemaCode
|
|
226
|
+
{ code: "child-table-update-unsupported", action: "子列用 schemaCode=<父字段 code>(本配方即 <model>_items)的 field.create/update;不要向父字段 update 传 options/choices/subFields" },
|
|
227
227
|
...commonRecovery,
|
|
228
228
|
],
|
|
229
229
|
requiresEnvironmentDerivedIds: false,
|
|
@@ -241,6 +241,11 @@ const childTable = Object.freeze({
|
|
|
241
241
|
* `BizPropertyController.java:1138-1146` 用 `getAppFunctionByCodeIgnoreDelete`
|
|
242
242
|
* 取顶层 app function,子表没有该行);F9 映射正确性读面在 `field.get` 的
|
|
243
243
|
* `options.mappings` 与 `mappingRuntimeNote`,不必等到 `data.save`。
|
|
244
|
+
*
|
|
245
|
+
* 探针 F(0.8.11):`schemaCode` 曾经写 `<model>_items` 约定名,真机 2.1.5 上
|
|
246
|
+
* 子表子 schema code 就是**父模型 CHILD_TABLE(8) 字段的 code**(父字段叫 `items`
|
|
247
|
+
* 就是 `items`;`BizPropertyManagerImpl.java:197` 用 `bizProperty.getCode()` 建子
|
|
248
|
+
* schema),按约定名建列 → 300004「数据模型不存在!」。
|
|
244
249
|
*/
|
|
245
250
|
const childTableParentFieldFill = Object.freeze({
|
|
246
251
|
id: "child-map-fill",
|
|
@@ -250,7 +255,7 @@ const childTableParentFieldFill = Object.freeze({
|
|
|
250
255
|
tool: "field.create",
|
|
251
256
|
args: {
|
|
252
257
|
environment,
|
|
253
|
-
schemaCode: "
|
|
258
|
+
schemaCode: "<子表父字段 code>",
|
|
254
259
|
code: "refParent",
|
|
255
260
|
name: "关联",
|
|
256
261
|
propertyType: "WORK_SHEET",
|
|
@@ -263,11 +268,13 @@ const childTableParentFieldFill = Object.freeze({
|
|
|
263
268
|
},
|
|
264
269
|
},
|
|
265
270
|
preconditions: [
|
|
271
|
+
"**子表子 schema code = 父模型 CHILD_TABLE(8) 字段的 code**(父字段 code 为 `items` 时 schemaCode 就是 `items`),不是 `<model>_items` 约定名:`omc call field.list --args '{\"schemaCode\":\"<父模型>\"}'` 找 type:8 字段的 code;同一口径见 `omc contract field-families` 的 `childTableSubSchema`。",
|
|
266
272
|
"子表 code 全局唯一;先建并发布快照标量列,再建关联列。",
|
|
267
273
|
"**发布用父模型 code**:`field.publish {\"schemaCode\":\"<父模型>\"}`——子表 code 会被拒(300004 → `field-publish-child-schema`);模型级一次发全部草稿字段,子表列随父模型发。",
|
|
268
274
|
],
|
|
269
275
|
conditionalRequirements: [
|
|
270
276
|
"映射只在门户选值时回填:CLI data.save(/api/runtime/form/save)不跑 options.mappings,快照列需调用方自填;配置正确性以字段行 options.mappings 为准。",
|
|
277
|
+
"schemaCode 填子表(=父字段 code),发布填父模型 code——两者不是同一个 code,别互相套用。",
|
|
271
278
|
"关联列必须带 relativeCode(=options.schemaCode=主模型);source=主模型字段、target=本子表列,均裸 code。",
|
|
272
279
|
"关联列不能是 CHILD_TABLE/OCR/ELECTRONIC_SIGN/MULT_WORK_SHEET/RELEVANCE_DATA/FORMULA。",
|
|
273
280
|
],
|
|
@@ -17,7 +17,7 @@ const onlinejsHighlightScript = Object.freeze({
|
|
|
17
17
|
],
|
|
18
18
|
conditionalRequirements: [
|
|
19
19
|
"事件模型:`form.on('onRendered', …)` 初始化 + `<控件>.valueChange.subscribe(function(change){ change.value })` 监听;改样式用 `control.options.style`",
|
|
20
|
-
"**脚本含引号/较长时不要塞 --args 内联**——写 JSON 参数文件走 `--args-file
|
|
20
|
+
"**脚本含引号/较长时不要塞 --args 内联**——写 JSON 参数文件走 `--args-file <配置根内的相对路径,如 ./compose.json>`(配置根外一律拒绝),或 `--args -` 从 stdin 读(shell 引号拆参 r38 实证)",
|
|
21
21
|
"深入教学面:`.claude/skills/form-online-js/references/`(lifecycle-api/control-api)",
|
|
22
22
|
],
|
|
23
23
|
priorToolReferences: [{ tool: "form.get", args: { environment, schemaCode: model }, purpose: "确认表单已发布与控件编码" }],
|
|
@@ -34,7 +34,7 @@ export const ONLINEJS_METADATA = Object.freeze({
|
|
|
34
34
|
tool: "onlinejs.compose",
|
|
35
35
|
args: { environment, schemaCode: model, sheetCode: "<默认表单 code == 模型 code>", replace: true, source: "(function(form){ h3form.axios.get(config.apiHost + '/api/organization/user/info', {params:{id:'<userId>'}}).then(function(res){ var dept = {id:res.data.departmentId, name:res.data.departmentName}; return h3form.axios.get(config.apiHost + '/api/organization/department/users', {params:{deptId:dept.id,page:0,size:300,filterType:'admin'}}); }).then(function(res){ var members = res.data.content || []; }); })" },
|
|
36
36
|
preconditions: ["门户取证:GET /api/organization/user/info 回 data.departmentId/departmentName;GET /api/organization/department/users 回 data.content,成员含 id/name"],
|
|
37
|
-
conditionalRequirements: ["这是已实证的门户请求形状;userId、schemaCode、字段使用前替换为真实值", "脚本含引号/较长时用 --args-file"],
|
|
37
|
+
conditionalRequirements: ["这是已实证的门户请求形状;userId、schemaCode、字段使用前替换为真实值", "脚本含引号/较长时用 --args-file <配置根内相对路径,如 ./compose.json> 或 --args -"],
|
|
38
38
|
refusalRecovery: [{ code: "onlinejs-source-invalid", action: "完整外壳改 `replace:true`(六元素模板保留,仅整体替换 customScript)" }],
|
|
39
39
|
priorToolReferences: [{ tool: "form.get", args: { environment, schemaCode: model }, purpose: "确认表单已发布与控件编码" }],
|
|
40
40
|
dryRun: { supported: true, command: `omc call onlinejs.compose --env ${environment} --dry-run --args-file compose.json`, notes: "dry-run 校验外壳/合并模式,不写平台" },
|
|
@@ -26,6 +26,36 @@ const workflowSave = Object.freeze({
|
|
|
26
26
|
requiresEnvironmentDerivedIds: true,
|
|
27
27
|
prerequisiteData: { source: "workflow.get_published; data.save authoritative readback", fields: ["workflow.code", "bizObjectId", "workflowInstanceId", "workItemId"] },
|
|
28
28
|
});
|
|
29
|
+
// F6(0.8.11 探针 F):`describe data.save --example basic` 此前 not-found——
|
|
30
|
+
// 唯一的配方是 workflow-backed-data-save,纯草稿保存的调用者得先猜 id 再改。
|
|
31
|
+
// 这里给最小可抄形状:标量字段草稿落库,不推进流程、不带 workflowCode/子表;
|
|
32
|
+
// 子表/关联映射的注意事项指回 workflow-backed-data-save(不复制正文)。
|
|
33
|
+
const basicDraftSave = Object.freeze({
|
|
34
|
+
id: "basic",
|
|
35
|
+
title: "最小草稿保存(无流程、纯标量字段)",
|
|
36
|
+
status: "offline-valid",
|
|
37
|
+
tool: "data.save",
|
|
38
|
+
args: { environment, schemaCode: model, formData: { name: "草稿示例" } },
|
|
39
|
+
preconditions: [
|
|
40
|
+
"模型与默认表单已发布;schemaCode 换成你自己的模型 code(formData 的键=已发布字段 code)",
|
|
41
|
+
"formData 只放标量字段,不带 id(带 id 是更新既有记录的语义)",
|
|
42
|
+
],
|
|
43
|
+
conditionalRequirements: [
|
|
44
|
+
"纯草稿保存:不带 workflowCode / submit——行落为 DRAFT,不推进流程,也不触发 Create/Update 规则(DRAFT 行跳过规则分发)",
|
|
45
|
+
"子表数组、关联/人员字段形状、流程草稿走 `omc describe data.save --example workflow-backed-data-save`;正式数据一调完成态用 data.submit",
|
|
46
|
+
],
|
|
47
|
+
priorToolReferences: [
|
|
48
|
+
{ tool: "model.list", args: { environment }, purpose: "确认 schemaCode(models[].schemaCode)" },
|
|
49
|
+
{ tool: "field.list", args: { environment, schemaCode: model, published: true }, purpose: "确认 formData 里的字段 code 已发布" },
|
|
50
|
+
],
|
|
51
|
+
dryRun: { supported: true, command: `omc call data.save --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 只校验输入与治理;落库与读回要真写后才权威" },
|
|
52
|
+
expectedReadback: { performed: { bizObjectId: "<data.save.performed.bizObjectId>" }, readback: { authoritative: { sequenceStatus: "DRAFT" }, next: "data.load 核对字段值 / data.submit 提交为正式数据" } },
|
|
53
|
+
refusalRecovery: [
|
|
54
|
+
{ code: "save-update-target-absent", action: "formData.id 指向不存在的行——新建请省略 id" },
|
|
55
|
+
...commonRecovery,
|
|
56
|
+
],
|
|
57
|
+
requiresEnvironmentDerivedIds: false,
|
|
58
|
+
});
|
|
29
59
|
const plainSubmit = Object.freeze({
|
|
30
60
|
id: "plain-data-submit",
|
|
31
61
|
title: "无流程模型:新建并提交一调完成(COMPLETED,触发 Create 规则)——正式数据的标准路径",
|
|
@@ -167,7 +197,7 @@ const dataDeleteSweep = Object.freeze({
|
|
|
167
197
|
requiresEnvironmentDerivedIds: false,
|
|
168
198
|
});
|
|
169
199
|
export const RUNTIME_DATA_METADATA = Object.freeze({
|
|
170
|
-
"data.save": Object.freeze({ recipes: [workflowSave], relatedTools: ["workflow.get_published", "data.submit", "workitem.list", "data.update"] }),
|
|
200
|
+
"data.save": Object.freeze({ recipes: [workflowSave, basicDraftSave], relatedTools: ["workflow.get_published", "data.submit", "workitem.list", "data.update"] }),
|
|
171
201
|
"data.update": Object.freeze({ recipes: [childRowsUpsert], relatedTools: ["data.load", "data.save", "data.submit"] }),
|
|
172
202
|
"data.submit": Object.freeze({ recipes: [plainSubmit, workflowSubmit], relatedTools: ["data.save", "workitem.list", "data.load"] }),
|
|
173
203
|
"data.list": Object.freeze({ recipes: [dataListFilter, reportChartVerifyNumericRecipe], relatedTools: ["data.load", "data.delete", "listview.configure", "field.list"] }),
|
package/dist/write.js
CHANGED
|
@@ -169,8 +169,13 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
169
169
|
status: "refused",
|
|
170
170
|
blocker: `wire-${error.kind}`,
|
|
171
171
|
errcode: 300004,
|
|
172
|
-
|
|
173
|
-
|
|
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",
|
|
174
179
|
diagnostic: "omc call rulelog.search --args '{\"schemaCode\":\"<model>\",\"includeNodes\":true}';再用 rule.get 检查最近改动规则,隔离法是暂时删/禁规则后重试",
|
|
175
180
|
};
|
|
176
181
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.11",
|
|
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.11",
|
|
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.11"
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -221,6 +221,9 @@ omc call programming.save --env <env> --args-file save.json
|
|
|
221
221
|
omc call programming.publish --env <env> --args-file publish.json
|
|
222
222
|
```
|
|
223
223
|
|
|
224
|
+
> `save.json` / `publish.json` 必须位于**配置根内**(相对路径即可;根外文件一律拒绝);
|
|
225
|
+
> 根外内容改走 `--args -`(stdin)或先拷进配置根。
|
|
226
|
+
|
|
224
227
|
### 工作区(多规则、可 review,推荐)
|
|
225
228
|
|
|
226
229
|
```bash
|
package/skills/omc-refusals.md
CHANGED
|
@@ -75,6 +75,9 @@ Model present + form published yet submit says `300004 数据模型不存在`? O
|
|
|
75
75
|
rule-node exception in disguise (r44b): `rulelog.search {schemaCode,includeNodes:true}`
|
|
76
76
|
→ `EXCEPTION`/`ROLLBACK` nodes → `rule.get` the changed rule; disable/delete it to
|
|
77
77
|
isolate. Never recreate a healthy model.
|
|
78
|
+
Rule out the child-schema case first: a child column's `schemaCode` is the parent
|
|
79
|
+
model's CHILD_TABLE(8) **field code** (`items`, never `<model>_items`);
|
|
80
|
+
`field.list <父模型>` → `type:8` field's code. Then the rulelog branch below.
|
|
78
81
|
Line up the model's field-level config first: an `AGGREGATION` FORMULA field whose
|
|
79
82
|
`aggregation.schemaCode` points at a **child-table schema** publishes fine and then
|
|
80
83
|
makes every `data.submit`/`data.update` on that model 40000 (r18 2026-10-26 live;
|
|
@@ -45,7 +45,8 @@ capability's coverage/tools/boundaries from `omc-capabilities`.
|
|
|
45
45
|
|
|
46
46
|
1. 先在子表 schema 建快照标量列(如 `repairNoSnapshot` SHORT_TEXT)并发布。
|
|
47
47
|
2. 再建关联列,形状照抄配方 `omc describe field.create --example child-map-fill`:
|
|
48
|
-
`field.create {schemaCode:"
|
|
48
|
+
`field.create {schemaCode:"<子表父字段 code>", code:"refParent", propertyType:"WORK_SHEET", relativeCode:"<model>", options:{schemaCode:"<model>", queryCode:"<model>", displayField:"<父字段>", mappings:[{source:"<父字段>",target:"<快照列>"}]}}`。
|
|
49
|
+
子表子 schema code **就是父模型的 CHILD_TABLE(8) 字段 code**(父字段叫 `items` 就是 `items`,不是 `<model>_items`);`omc call field.list --args '{"schemaCode":"<父模型>"}'` 找 type:8 字段的 code。
|
|
49
50
|
3. `field.publish`(整模型一次)→ `field.get` 读回核对 `options.mappings`。
|
|
50
51
|
|
|
51
52
|
- **字段映射**的事实源是字段行 `options.mappings`(`source`=关联目标/父模型字段,`target`=本子表列,都是裸 code);改表单控件属性里的映射会被平台按字段重算覆盖。
|