@stalfh233/omc-cli 0.8.15 → 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/cli.js +25 -9
- package/dist/form-support.js +159 -13
- package/dist/human-summary.js +4 -2
- package/dist/lanes/form.js +1 -1
- package/dist/lanes/list-view-contract.js +1 -1
- package/dist/lanes/list-view.js +51 -0
- package/dist/lanes/model-references.js +22 -3
- package/dist/lanes/runtime-data.js +97 -17
- package/dist/lanes/workflow.js +97 -14
- package/dist/model-purge.js +89 -34
- package/dist/recipes/form.js +2 -2
- package/dist/residue.js +13 -2
- package/dist/tool-types.js +19 -0
- package/dist/wire-refusal.js +171 -0
- package/dist/write.js +25 -173
- package/package.json +3 -3
- package/skills/omc-glossary.md +22 -0
package/dist/recipes/form.js
CHANGED
|
@@ -53,7 +53,7 @@ const formDraftTwoColumn = Object.freeze({
|
|
|
53
53
|
"**改既有表单**:优先用 `layout:{rows,...}`(见下,增量改行分组/span、不必回传整包 attrs);若要手写整包,先 `form.get full:true` 取 `publishedAttributesJson` 作基线(含 Title/Group/creater/createdTime/sequenceNo 系统控件),只改行分组与 span,不要把本配方的三字段最小布局直接盖上去。判据:`form.get full:true` 返回非空 publishedAttributesJson(或 published:true)→ 既有表单,受 form-publish-degrade 约束;无表单行 / publishedAttributesJson 为空或 \"{}\" → 新建表单,本配方可直接用。",
|
|
54
54
|
],
|
|
55
55
|
conditionalRequirements: [
|
|
56
|
-
"**改既有表单可用增量布局(不必回传整包 attrs)**:`form.draft {layout:{rows:[[\"visitNo\",\"customer\"],[\"remark\"]], spans:{visitNo:12,customer:12,remark:24}}}`
|
|
56
|
+
"**改既有表单可用增量布局(不必回传整包 attrs)**:`form.draft {layout:{rows:[[\"visitNo\",\"customer\"],[\"remark\"]], spans:{visitNo:12,customer:12,remark:24}}}` 以当前草稿为基线(草稿为空时退回已发布),只改这些控件的行分组与 span——其它控件/属性/HTML 逐键保留;未列入 rows 的控件(含 Title/Group/creater/createdTime/sequenceNo 等系统控件)保留原行,系统控件要移动须显式 `includeSystem:true`。layout 与 draftViewJson/draftAttributesJson/rebuild/fieldCodes/childColumns/refreshFromFields/fromReadback 互斥。列数仍由行分组决定,spans 省略时按行均分 24",
|
|
57
57
|
"**列数由行分组决定,不由 span 决定**:一行放几个 code 就是几列;span 只控制控件在行内的 24 栅格宽度,且必须与行分组自洽(两列 span:12+12,整宽 span:24)",
|
|
58
58
|
"draftAttributesJson 的每个控件的 `options` 必须是**对象**,不能是 JSON 字符串(否则运行时写 options.name_i18n 抛错、整页空白)",
|
|
59
59
|
"**控件 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)",
|
|
@@ -85,7 +85,7 @@ const formDraftTwoColumn = Object.freeze({
|
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
code: "form-layout-param-conflict",
|
|
88
|
-
action: "layout 与 draftViewJson/draftAttributesJson/rebuild/fieldCodes/childColumns/refreshFromFields/fromReadback 互斥:只改行分组与 span 用 layout;整表重搭或整包回写才用 draft*Json/rebuild。要加子表列的正确顺序:① 先 `form.
|
|
88
|
+
action: "layout 与 draftViewJson/draftAttributesJson/rebuild/fieldCodes/childColumns/refreshFromFields/fromReadback 互斥:只改行分组与 span 用 layout;整表重搭或整包回写才用 draft*Json/rebuild。要加子表列的正确顺序:① 先 `form.draft {childColumns}` 把子表列绑进草稿;② 再 `form.draft {layout}`(以草稿为基线,不动刚绑的列);③ 再 `form.publish`。整表重建(rebuild:true)也会带上子表列,但会丢手工布局",
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
code: "form-publish-degrade",
|
package/dist/residue.js
CHANGED
|
@@ -116,6 +116,10 @@ export async function scanResidues(session, prefix, options = {}) {
|
|
|
116
116
|
faces.push({ face: "report", count: -1, items: [], note: "not-scanned——报表残留判定用 report.tree(树)+ report.get(BI 残留看 readback.biResidue)" });
|
|
117
117
|
}
|
|
118
118
|
const compact = options.allFaces === true ? faces : nonZeroFaces;
|
|
119
|
+
// 探针 J F9:report 面至今没有扫描入口(platform/lane 都只有清单读),
|
|
120
|
+
// 所以每次 residue 都存在未扫描面。将来接上 report 扫描时移除这一项即可
|
|
121
|
+
// ——三个键按 unscannedFaces 是否为空成组出现。
|
|
122
|
+
const unscannedFaces = ["report"];
|
|
119
123
|
return {
|
|
120
124
|
prefix,
|
|
121
125
|
faces: compact,
|
|
@@ -129,11 +133,18 @@ export async function scanResidues(session, prefix, options = {}) {
|
|
|
129
133
|
cleanWithinScannedFaces: userResidues === 0 && !pendingCascade,
|
|
130
134
|
// r70 探针01-F7:真残留存在时顶层 clean:true 仍误导(coverage 在深处,首屏只看
|
|
131
135
|
// clean)——caveat 常驻顶层,紧贴 clean 键。
|
|
132
|
-
cleanCaveat: "clean
|
|
136
|
+
cleanCaveat: "clean 仅指已扫描面(scanned faces only);report 面未扫描(报表资源残留用 report.tree + report.get 判)",
|
|
137
|
+
...(unscannedFaces.length > 0
|
|
138
|
+
? {
|
|
139
|
+
cleanScope: "scanned-faces",
|
|
140
|
+
unscannedFaces,
|
|
141
|
+
reportCheckCommand: `omc call report.tree --args '{}'`,
|
|
142
|
+
}
|
|
143
|
+
: {}),
|
|
133
144
|
coverage: { report: "not-scanned(用 report.tree + report.get 判,BI 残留看 readback.biResidue)", workflow: "模板跟模型走(模型删即删)" },
|
|
134
145
|
...(systemPresetCount > 0 ? { systemPresetCount } : {}),
|
|
135
146
|
...(pendingCascade ? { pendingCascade: true } : {}),
|
|
136
|
-
note: pendingCascade ? "
|
|
147
|
+
note: pendingCascade ? "scanned faces only——模型已不存在但仍有级联面命中:平台删除为异步任务、时长不定,稍后重跑,幂等" : "scanned faces only——clean 仅指已扫描面;report 面未扫描——报表残留判定用 report.tree(树)+ report.get(BI 残留看 biResidue)",
|
|
137
148
|
};
|
|
138
149
|
}
|
|
139
150
|
export async function cmdResidue(prefix, options, transport) {
|
package/dist/tool-types.js
CHANGED
|
@@ -291,6 +291,25 @@ const SIBLING_TOOL_KEY_HINTS = Object.freeze({
|
|
|
291
291
|
// 两边零字符串相似度,最近匹配只能报「无相近键」。
|
|
292
292
|
"rule.run": Object.freeze({ bizObjectId: "rule.run 的记录标识是 ids(字符串数组,如 ids:[\"<bizObjectId>\"])" }),
|
|
293
293
|
});
|
|
294
|
+
export const TOOL_KEY_ALTERNATIVES = Object.freeze({
|
|
295
|
+
// `all:true` 是其他读面的分页开关(data.list 等);model.list 的跨应用开关
|
|
296
|
+
// 叫 allApplications,语义是「枚举租户全部应用」,不是「取全部页」。
|
|
297
|
+
"model.list": Object.freeze({
|
|
298
|
+
all: Object.freeze({
|
|
299
|
+
replaceWith: "allApplications",
|
|
300
|
+
hint: "跨应用枚举用 allApplications:true;all 不是本工具参数,本工具没有分页开关",
|
|
301
|
+
nextCommand: `omc call model.list --args '{"allApplications":true}'`,
|
|
302
|
+
}),
|
|
303
|
+
}),
|
|
304
|
+
// workflow.list 以应用树为索引:只能按 applicationCode 缩小范围,平台没有
|
|
305
|
+
// 「按模型列流程」的清单端点(点查用 workflow.get_draft / get_published)。
|
|
306
|
+
"workflow.list": Object.freeze({
|
|
307
|
+
schemaCode: Object.freeze({
|
|
308
|
+
hint: "本工具按应用扫描,不能按模型过滤;看单个模型的流程请用 workflow.get_draft/get_published 的 schemaCode",
|
|
309
|
+
nextCommand: `omc call workflow.list --args '{"applicationCode":"<应用code>"}'`,
|
|
310
|
+
}),
|
|
311
|
+
}),
|
|
312
|
+
});
|
|
294
313
|
function closestSchemaKey(key, schemaKeys) {
|
|
295
314
|
if (schemaKeys.has(key))
|
|
296
315
|
return key;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { optionPublishMessages } from "./wire.js";
|
|
2
|
+
/**
|
|
3
|
+
* 单一错误翻译表:把平台 `WireError` 映射成受治理拒绝回执。
|
|
4
|
+
*
|
|
5
|
+
* 这里保存的是**全部**已知平台错误码的指引(300004 子表/rulelog 分叉、409200
|
|
6
|
+
* 隐藏字段、40000 双成因、480000、36102/36104、401/403 @AdminOnly 等)。
|
|
7
|
+
* `governedWrite` 的写失败路径与 `data.save` 的 submit-leg 共用同一张表——
|
|
8
|
+
* 后者原来自己拼 `{blocker:"wire-business",message}`,把指引丢了(w132 复核)。
|
|
9
|
+
* 新增错误码只改这里,任何调用面都自动获得同一文案。
|
|
10
|
+
*/
|
|
11
|
+
export function refusalFromWireError(error) {
|
|
12
|
+
// F3: rule-node runtime failures are masked by the platform as 300004.
|
|
13
|
+
if (error.errcode === 300004) {
|
|
14
|
+
// T20(2026-11-24):2.1.5 的树形自定义下拉发布门把「选项非法」包成
|
|
15
|
+
// 外层 300004「数据模型不存在!」+ data 里的逐项 301013「…数据项的
|
|
16
|
+
// 选项设置有误」(BizSchemaCheckServiceImpl :60-66)。payload 命中时
|
|
17
|
+
// 必须比业务规则运行时异常的解释更优先,否则用户会去查 rulelog。
|
|
18
|
+
const platformMessages = optionPublishMessages(error.payload);
|
|
19
|
+
if (platformMessages.length > 0) {
|
|
20
|
+
return {
|
|
21
|
+
status: "refused",
|
|
22
|
+
blocker: "field-options-publish-invalid",
|
|
23
|
+
errcode: 300004,
|
|
24
|
+
platformMessages,
|
|
25
|
+
message: `平台在发布时拒绝了字段选项(外层 300004「数据模型不存在!」只是外壳,明细 301013):${platformMessages.join(";")}。` +
|
|
26
|
+
"这是 2.1.5+ 的树形自定义下拉发布门,不是模型缺失或业务规则运行时异常:optionsSet.optionsType=\"custom\" + optionStructure=\"tree\" 时," +
|
|
27
|
+
"每个节点的 code(平台内部叫选项编码,口语叫 key)与 value(显示值)必须非空,且 code 全树唯一(RadioOptionsModel.validateCustomTreeOptions,launcher-2.1.5 .../bizmodel/RadioOptionsModel.java:130-142)。" +
|
|
28
|
+
"8.6/8.7 不查;平铺自定义/字典/业务模型下拉也不查。",
|
|
29
|
+
nextCommand: "omc call field.list --args '{\"schemaCode\":\"<model>\",\"published\":false}'",
|
|
30
|
+
nextAction: "核对报错字段的 optionsSet.custom 树,用 field.update 补非空 code/value;不需要层级就把 optionStructure 改成 \"flat\" 后重发",
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
status: "refused",
|
|
35
|
+
blocker: `wire-${error.kind}`,
|
|
36
|
+
errcode: 300004,
|
|
37
|
+
// 探针 F(0.8.11):真机 2.1.5 上子表子 schema code = 父模型的
|
|
38
|
+
// CHILD_TABLE(8) 字段 code(`BizPropertyManagerImpl.java:197` 用
|
|
39
|
+
// `bizProperty.getCode()` 建子 schema),不是 `<model>_items`
|
|
40
|
+
// 约定名。先分叉再查 rulelog,否则 agent 会去翻不存在的规则。
|
|
41
|
+
message: `${error.message}——先分叉:① 若 schemaCode 是子表列,子表的子 schema code = 父模型的 CHILD_TABLE(8) 字段 code(不是 \`<model>_items\`),先 field.list 父模型找 type:8 字段的 code;② 若 modelPresent:true 且 form 已发布,这个 300004 大概率是业务规则节点运行时异常,不是模型缺失;先查 rulelog 的 EXCEPTION/ROLLBACK,再看最近改动的规则。`,
|
|
42
|
+
nextCommand: "omc call field.list --args '{\"schemaCode\":\"<父模型>\"}'",
|
|
43
|
+
nextAction: "在回执里找 type:8(CHILD_TABLE)字段的 code——父字段 code 就是子 schema code;用它对子列重试。确认不是子表问题后,再按 diagnostic 查 rulelog 的 EXCEPTION/ROLLBACK",
|
|
44
|
+
diagnostic: "omc call rulelog.search --args '{\"schemaCode\":\"<model>\",\"includeNodes\":true}';再用 rule.get 检查最近改动规则,隔离法是暂时删/禁规则后重试",
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
// authine-orm Serializer.update/delete throws "Object <id> is not
|
|
48
|
+
// serialized." when the entity handle was never loaded from the store.
|
|
49
|
+
// That is a PLATFORM object-state error, not a shape error — reported as
|
|
50
|
+
// `wire-business` the caller reads "my JSON is wrong" and retries the
|
|
51
|
+
// wrong thing (r12 A6: rule.save on a preset Create row, self-healed by
|
|
52
|
+
// delete+rebuild). Name the state and the two recoveries.
|
|
53
|
+
if (/is not serialized|does not serialized/i.test(error.message))
|
|
54
|
+
return {
|
|
55
|
+
status: "refused",
|
|
56
|
+
blocker: "orm-object-state",
|
|
57
|
+
errcode: error.errcode,
|
|
58
|
+
message: `${error.message}——这是平台 ORM 的对象状态错误(Serializer.update/delete 要求实体先被装载),不是入参或规则图的形状问题。` +
|
|
59
|
+
"同一份入参再保存一次通常即恢复。持续复现就换行:rule.delete 后重建(rule.save 会铸新记录),或用 rule.get 读回完整行再 rule.node.update 改一处——不要继续重试同一份 payload。",
|
|
60
|
+
};
|
|
61
|
+
// r30a F10:errcode 40000「调用数据库发生异常」曾单向判「平台侧故障,勿改参数」。
|
|
62
|
+
// 线上 #38(摩擦 B,詹记 8.6.26)实证反向成因:创建类写入缺非空列时平台同样
|
|
63
|
+
// 回 40000(rule.save 的 methodMapping 缺 serviceName/serviceMethodName/methodCode;
|
|
64
|
+
// form.draft/publish 的 button 缺 triggerCode/triggerType/showPermCode/showPermType),
|
|
65
|
+
// 照「勿改参数硬重试」引导原地打转。引导必须双向:先分叉成因再动手。
|
|
66
|
+
if (error.errcode === 40000 || /调用数据库发生异常/.test(error.message))
|
|
67
|
+
return {
|
|
68
|
+
status: "refused",
|
|
69
|
+
blocker: `wire-${error.kind}`,
|
|
70
|
+
errcode: error.errcode,
|
|
71
|
+
"platform-fault": true,
|
|
72
|
+
message: `${error.message}——40000「调用数据库发生异常」是无明细掩码,两种常见成因(线上 #38 实证):` +
|
|
73
|
+
"① 真·平台故障(DB/ORM 层,重试/查平台日志);" +
|
|
74
|
+
"② 创建类写入缺非空列——rule.save 的 methodMapping 缺 serviceName/serviceMethodName/methodCode、form.draft/publish 的 button 缺 triggerCode/triggerType/showPermCode/showPermType 时同样回 40000(照 recipe 最小示例形状新建必炸;对照已成功落库的同族配置补齐字段后一次成功)。",
|
|
75
|
+
nextAction: "先分叉:本次是照示例新建/改配置吗?是→按成因②对照一条已成功配置(rule.get/form.get 读回)补齐非空列字段再重试;否→按成因①稍后重试同一请求,持续复现查平台 DB/ORM 日志",
|
|
76
|
+
...(error.diagnostic ? { diagnostic: error.diagnostic } : {}),
|
|
77
|
+
};
|
|
78
|
+
// 2.1.5(AI-Platform v2.1.5)提交新增「隐藏字段」校验:规则引用的隐藏字段
|
|
79
|
+
// 也必须出现在 payload 里,否则 409200。8.6/8.7 没有这一道,旧调用方按
|
|
80
|
+
// 「只传可见字段」构造会被拒。
|
|
81
|
+
if (error.errcode === 409200)
|
|
82
|
+
return {
|
|
83
|
+
status: "refused",
|
|
84
|
+
blocker: `wire-${error.kind}`,
|
|
85
|
+
errcode: 409200,
|
|
86
|
+
"platform-version": "2.1.5+",
|
|
87
|
+
message: `${error.message}——2.1.5 起提交会校验**隐藏字段**(409200 HIDDEN_PROPERTY_SUBMIT_FAIL):数据规则引用的字段即使表单不可见,也必须出现在 formData/bizObject.data 里;8.6/8.7 不做这道校验。`,
|
|
88
|
+
nextAction: "先 data.load/form.get 读回该记录(隐藏字段有真值),把缺失字段补进 payload 再提交;不要靠删字段绕过——规则仍会命中",
|
|
89
|
+
nextCommand: "omc call data.load --args '{\"schemaCode\":\"<model>\",\"bizObjectId\":\"<id>\"}'",
|
|
90
|
+
};
|
|
91
|
+
// 2.1.5 起新增的「格式/长度/维护锁」错误码(8.6 这些场景回 10005/40000/50000,
|
|
92
|
+
// 没有可读码)。不改变判定,只把码翻成人话 + 下一步。
|
|
93
|
+
if (error.errcode === 309056 || error.errcode === 309057) {
|
|
94
|
+
const kind = error.errcode === 309056 ? "名称" : "code";
|
|
95
|
+
return {
|
|
96
|
+
status: "refused",
|
|
97
|
+
blocker: `wire-${error.kind}`,
|
|
98
|
+
errcode: error.errcode,
|
|
99
|
+
"platform-version": "2.1.5+",
|
|
100
|
+
message: `${error.message}——2.1.5 起平台统一用 309056/309057 校验${kind}格式(8.6 是零散的 10005):名称 1–60 字符且不能以空格开头;code 必须字母开头、≤60、只含 A-Za-z0-9_。`,
|
|
101
|
+
nextAction: `按上述规则改 ${kind}后重试;不要靠换中文/特殊字符绕过`,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
if (error.errcode === 601016 || error.errcode === 601019)
|
|
105
|
+
return {
|
|
106
|
+
status: "refused",
|
|
107
|
+
blocker: "schema-maintenance-locked",
|
|
108
|
+
errcode: error.errcode,
|
|
109
|
+
"platform-version": "2.1.5+",
|
|
110
|
+
message: `${error.message}——模型正在做表结构变更/层级路径维护(2.1.5 新增 601016/601019),期间不接收写入;这是**暂时锁**,不是参数错。`,
|
|
111
|
+
nextAction: "等维护结束(或联系平台管理员确认迁移任务)后重试同一请求;不要改参数硬重试",
|
|
112
|
+
};
|
|
113
|
+
if (error.errcode === 700000)
|
|
114
|
+
return {
|
|
115
|
+
status: "refused",
|
|
116
|
+
blocker: "value-length-out-of-bounds",
|
|
117
|
+
errcode: 700000,
|
|
118
|
+
"platform-version": "2.1.5+",
|
|
119
|
+
message: `${error.message}——列长度溢出首次被翻译成 700000(8.6 只会回 40000/50000);先核对该字段的库列长度或 options 限制。`,
|
|
120
|
+
nextAction: "缩短该字段值,或改字段长度(field.update → field.publish)后重试",
|
|
121
|
+
};
|
|
122
|
+
if (error.errcode === 550038)
|
|
123
|
+
return {
|
|
124
|
+
status: "refused",
|
|
125
|
+
blocker: "inherited-rule-readonly",
|
|
126
|
+
errcode: 550038,
|
|
127
|
+
"platform-version": "2.1.5+",
|
|
128
|
+
message: `${error.message}——该业务规则继承自父级(2.1.5 新增继承机制),不能直接改/删/发布/启停。`,
|
|
129
|
+
nextAction: "到父级模型改规则,或用 rule.references 确认继承来源后再决定",
|
|
130
|
+
};
|
|
131
|
+
if (error.errcode === 401085)
|
|
132
|
+
return {
|
|
133
|
+
status: "refused",
|
|
134
|
+
blocker: "workflow-activity-name-invalid",
|
|
135
|
+
errcode: 401085,
|
|
136
|
+
"platform-version": "2.1.5+",
|
|
137
|
+
message: `${error.message}——2.1.5 的流程发布新增节点名校验:非空且 ≤80 字符单位(中文按 2 计),ERROR 级会让 publish 整体不发布。`,
|
|
138
|
+
nextAction: "workflow.get_draft 读回 activities[].name,缩短超长/补齐空名后重新 publish",
|
|
139
|
+
};
|
|
140
|
+
if (error.errcode === 480000)
|
|
141
|
+
return {
|
|
142
|
+
status: "refused",
|
|
143
|
+
blocker: "current-task-suspended",
|
|
144
|
+
errcode: 480000,
|
|
145
|
+
"platform-version": "2.1.5+",
|
|
146
|
+
message: `${error.message}——当前任务被挂起(2.1.5 新增:前置/串行任务未完成),不是提交参数错。`,
|
|
147
|
+
nextAction: "workitem.list 看同一实例的前置任务状态;前置完成后重试提交",
|
|
148
|
+
};
|
|
149
|
+
// 子表超限:8.6 = 36102,8.7/2.1.5 = 36104(同义)。
|
|
150
|
+
if (error.errcode === 36102 || error.errcode === 36104)
|
|
151
|
+
return {
|
|
152
|
+
status: "refused",
|
|
153
|
+
blocker: "child-table-data-over-limit",
|
|
154
|
+
errcode: error.errcode,
|
|
155
|
+
message: `${error.message}——子表查询结果超限(8.6 回 36102,8.7/2.1.5 回 36104,同一语义)。收窄 filters/时间窗,或分页读 list_child;不要靠调大 size 硬拉。`,
|
|
156
|
+
nextCommand: "omc call data.list --args '{\"schemaCode\":\"<child>\",\"size\":20,\"page\":0}'",
|
|
157
|
+
};
|
|
158
|
+
// 2.1.5 起管理面统一 @AdminOnly(8.6 是 @RequireAdmin):401/403 往往不是
|
|
159
|
+
// 「token 坏了」,而是该端点在新版要求管理员。
|
|
160
|
+
if (error.kind === "http-status" && (error.diagnostic?.httpStatus === 401 || error.diagnostic?.httpStatus === 403))
|
|
161
|
+
return {
|
|
162
|
+
status: "refused",
|
|
163
|
+
blocker: `wire-${error.kind}`,
|
|
164
|
+
errcode: error.errcode,
|
|
165
|
+
message: `${error.message}——HTTP ${error.diagnostic?.httpStatus}:先确认账号;2.1.5 起管理端点(programming.*、workflow.publish/update、license/info 等)统一为 @AdminOnly(8.6 是 @RequireAdmin),普通应用管理员可能不再放行。`,
|
|
166
|
+
nextAction: "换管理员账号复验;仍 403 就区分「端点要求管理员」与「平台未开该功能」",
|
|
167
|
+
...(error.diagnostic ? { diagnostic: error.diagnostic } : {}),
|
|
168
|
+
};
|
|
169
|
+
return { status: "refused", blocker: `wire-${error.kind}`, errcode: error.errcode, message: error.message, ...(error.diagnostic ? { diagnostic: error.diagnostic } : {}) };
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=wire-refusal.js.map
|
package/dist/write.js
CHANGED
|
@@ -16,6 +16,7 @@ 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";
|
|
@@ -26,7 +27,7 @@ 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
|
|
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.
|
|
@@ -170,166 +171,8 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
170
171
|
};
|
|
171
172
|
if (error instanceof ToolRefusalError)
|
|
172
173
|
throw error;
|
|
173
|
-
if (error instanceof WireError)
|
|
174
|
-
|
|
175
|
-
if (error.errcode === 300004) {
|
|
176
|
-
// T20(2026-11-24):2.1.5 的树形自定义下拉发布门把「选项非法」包成
|
|
177
|
-
// 外层 300004「数据模型不存在!」+ data 里的逐项 301013「…数据项的
|
|
178
|
-
// 选项设置有误」(BizSchemaCheckServiceImpl :60-66)。payload 命中时
|
|
179
|
-
// 必须比业务规则运行时异常的解释更优先,否则用户会去查 rulelog。
|
|
180
|
-
const platformMessages = optionPublishMessages(error.payload);
|
|
181
|
-
if (platformMessages.length > 0) {
|
|
182
|
-
return {
|
|
183
|
-
status: "refused",
|
|
184
|
-
blocker: "field-options-publish-invalid",
|
|
185
|
-
errcode: 300004,
|
|
186
|
-
platformMessages,
|
|
187
|
-
message: `平台在发布时拒绝了字段选项(外层 300004「数据模型不存在!」只是外壳,明细 301013):${platformMessages.join(";")}。` +
|
|
188
|
-
"这是 2.1.5+ 的树形自定义下拉发布门,不是模型缺失或业务规则运行时异常:optionsSet.optionsType=\"custom\" + optionStructure=\"tree\" 时," +
|
|
189
|
-
"每个节点的 code(平台内部叫选项编码,口语叫 key)与 value(显示值)必须非空,且 code 全树唯一(RadioOptionsModel.validateCustomTreeOptions,launcher-2.1.5 .../bizmodel/RadioOptionsModel.java:130-142)。" +
|
|
190
|
-
"8.6/8.7 不查;平铺自定义/字典/业务模型下拉也不查。",
|
|
191
|
-
nextCommand: "omc call field.list --args '{\"schemaCode\":\"<model>\",\"published\":false}'",
|
|
192
|
-
nextAction: "核对报错字段的 optionsSet.custom 树,用 field.update 补非空 code/value;不需要层级就把 optionStructure 改成 \"flat\" 后重发",
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
return {
|
|
196
|
-
status: "refused",
|
|
197
|
-
blocker: `wire-${error.kind}`,
|
|
198
|
-
errcode: 300004,
|
|
199
|
-
// 探针 F(0.8.11):真机 2.1.5 上子表子 schema code = 父模型的
|
|
200
|
-
// CHILD_TABLE(8) 字段 code(`BizPropertyManagerImpl.java:197` 用
|
|
201
|
-
// `bizProperty.getCode()` 建子 schema),不是 `<model>_items`
|
|
202
|
-
// 约定名。先分叉再查 rulelog,否则 agent 会去翻不存在的规则。
|
|
203
|
-
message: `${error.message}——先分叉:① 若 schemaCode 是子表列,子表的子 schema code = 父模型的 CHILD_TABLE(8) 字段 code(不是 \`<model>_items\`),先 field.list 父模型找 type:8 字段的 code;② 若 modelPresent:true 且 form 已发布,这个 300004 大概率是业务规则节点运行时异常,不是模型缺失;先查 rulelog 的 EXCEPTION/ROLLBACK,再看最近改动的规则。`,
|
|
204
|
-
nextCommand: "omc call field.list --args '{\"schemaCode\":\"<父模型>\"}'",
|
|
205
|
-
nextAction: "在回执里找 type:8(CHILD_TABLE)字段的 code——父字段 code 就是子 schema code;用它对子列重试。确认不是子表问题后,再按 diagnostic 查 rulelog 的 EXCEPTION/ROLLBACK",
|
|
206
|
-
diagnostic: "omc call rulelog.search --args '{\"schemaCode\":\"<model>\",\"includeNodes\":true}';再用 rule.get 检查最近改动规则,隔离法是暂时删/禁规则后重试",
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
// authine-orm Serializer.update/delete throws "Object <id> is not
|
|
210
|
-
// serialized." when the entity handle was never loaded from the store.
|
|
211
|
-
// That is a PLATFORM object-state error, not a shape error — reported as
|
|
212
|
-
// `wire-business` the caller reads "my JSON is wrong" and retries the
|
|
213
|
-
// wrong thing (r12 A6: rule.save on a preset Create row, self-healed by
|
|
214
|
-
// delete+rebuild). Name the state and the two recoveries.
|
|
215
|
-
if (/is not serialized|does not serialized/i.test(error.message))
|
|
216
|
-
return {
|
|
217
|
-
status: "refused",
|
|
218
|
-
blocker: "orm-object-state",
|
|
219
|
-
errcode: error.errcode,
|
|
220
|
-
message: `${error.message}——这是平台 ORM 的对象状态错误(Serializer.update/delete 要求实体先被装载),不是入参或规则图的形状问题。` +
|
|
221
|
-
"同一份入参再保存一次通常即恢复。持续复现就换行:rule.delete 后重建(rule.save 会铸新记录),或用 rule.get 读回完整行再 rule.node.update 改一处——不要继续重试同一份 payload。",
|
|
222
|
-
};
|
|
223
|
-
// r30a F10:errcode 40000「调用数据库发生异常」曾单向判「平台侧故障,勿改参数」。
|
|
224
|
-
// 线上 #38(摩擦 B,詹记 8.6.26)实证反向成因:创建类写入缺非空列时平台同样
|
|
225
|
-
// 回 40000(rule.save 的 methodMapping 缺 serviceName/serviceMethodName/methodCode;
|
|
226
|
-
// form.draft/publish 的 button 缺 triggerCode/triggerType/showPermCode/showPermType),
|
|
227
|
-
// 照「勿改参数硬重试」引导原地打转。引导必须双向:先分叉成因再动手。
|
|
228
|
-
if (error.errcode === 40000 || /调用数据库发生异常/.test(error.message))
|
|
229
|
-
return {
|
|
230
|
-
status: "refused",
|
|
231
|
-
blocker: `wire-${error.kind}`,
|
|
232
|
-
errcode: error.errcode,
|
|
233
|
-
"platform-fault": true,
|
|
234
|
-
message: `${error.message}——40000「调用数据库发生异常」是无明细掩码,两种常见成因(线上 #38 实证):` +
|
|
235
|
-
"① 真·平台故障(DB/ORM 层,重试/查平台日志);" +
|
|
236
|
-
"② 创建类写入缺非空列——rule.save 的 methodMapping 缺 serviceName/serviceMethodName/methodCode、form.draft/publish 的 button 缺 triggerCode/triggerType/showPermCode/showPermType 时同样回 40000(照 recipe 最小示例形状新建必炸;对照已成功落库的同族配置补齐字段后一次成功)。",
|
|
237
|
-
nextAction: "先分叉:本次是照示例新建/改配置吗?是→按成因②对照一条已成功配置(rule.get/form.get 读回)补齐非空列字段再重试;否→按成因①稍后重试同一请求,持续复现查平台 DB/ORM 日志",
|
|
238
|
-
...(error.diagnostic ? { diagnostic: error.diagnostic } : {}),
|
|
239
|
-
};
|
|
240
|
-
// 2.1.5(AI-Platform v2.1.5)提交新增「隐藏字段」校验:规则引用的隐藏字段
|
|
241
|
-
// 也必须出现在 payload 里,否则 409200。8.6/8.7 没有这一道,旧调用方按
|
|
242
|
-
// 「只传可见字段」构造会被拒。
|
|
243
|
-
if (error.errcode === 409200)
|
|
244
|
-
return {
|
|
245
|
-
status: "refused",
|
|
246
|
-
blocker: `wire-${error.kind}`,
|
|
247
|
-
errcode: 409200,
|
|
248
|
-
"platform-version": "2.1.5+",
|
|
249
|
-
message: `${error.message}——2.1.5 起提交会校验**隐藏字段**(409200 HIDDEN_PROPERTY_SUBMIT_FAIL):数据规则引用的字段即使表单不可见,也必须出现在 formData/bizObject.data 里;8.6/8.7 不做这道校验。`,
|
|
250
|
-
nextAction: "先 data.load/form.get 读回该记录(隐藏字段有真值),把缺失字段补进 payload 再提交;不要靠删字段绕过——规则仍会命中",
|
|
251
|
-
nextCommand: "omc call data.load --args '{\"schemaCode\":\"<model>\",\"bizObjectId\":\"<id>\"}'",
|
|
252
|
-
};
|
|
253
|
-
// 2.1.5 起新增的「格式/长度/维护锁」错误码(8.6 这些场景回 10005/40000/50000,
|
|
254
|
-
// 没有可读码)。不改变判定,只把码翻成人话 + 下一步。
|
|
255
|
-
if (error.errcode === 309056 || error.errcode === 309057) {
|
|
256
|
-
const kind = error.errcode === 309056 ? "名称" : "code";
|
|
257
|
-
return {
|
|
258
|
-
status: "refused",
|
|
259
|
-
blocker: `wire-${error.kind}`,
|
|
260
|
-
errcode: error.errcode,
|
|
261
|
-
"platform-version": "2.1.5+",
|
|
262
|
-
message: `${error.message}——2.1.5 起平台统一用 309056/309057 校验${kind}格式(8.6 是零散的 10005):名称 1–60 字符且不能以空格开头;code 必须字母开头、≤60、只含 A-Za-z0-9_。`,
|
|
263
|
-
nextAction: `按上述规则改 ${kind}后重试;不要靠换中文/特殊字符绕过`,
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
if (error.errcode === 601016 || error.errcode === 601019)
|
|
267
|
-
return {
|
|
268
|
-
status: "refused",
|
|
269
|
-
blocker: "schema-maintenance-locked",
|
|
270
|
-
errcode: error.errcode,
|
|
271
|
-
"platform-version": "2.1.5+",
|
|
272
|
-
message: `${error.message}——模型正在做表结构变更/层级路径维护(2.1.5 新增 601016/601019),期间不接收写入;这是**暂时锁**,不是参数错。`,
|
|
273
|
-
nextAction: "等维护结束(或联系平台管理员确认迁移任务)后重试同一请求;不要改参数硬重试",
|
|
274
|
-
};
|
|
275
|
-
if (error.errcode === 700000)
|
|
276
|
-
return {
|
|
277
|
-
status: "refused",
|
|
278
|
-
blocker: "value-length-out-of-bounds",
|
|
279
|
-
errcode: 700000,
|
|
280
|
-
"platform-version": "2.1.5+",
|
|
281
|
-
message: `${error.message}——列长度溢出首次被翻译成 700000(8.6 只会回 40000/50000);先核对该字段的库列长度或 options 限制。`,
|
|
282
|
-
nextAction: "缩短该字段值,或改字段长度(field.update → field.publish)后重试",
|
|
283
|
-
};
|
|
284
|
-
if (error.errcode === 550038)
|
|
285
|
-
return {
|
|
286
|
-
status: "refused",
|
|
287
|
-
blocker: "inherited-rule-readonly",
|
|
288
|
-
errcode: 550038,
|
|
289
|
-
"platform-version": "2.1.5+",
|
|
290
|
-
message: `${error.message}——该业务规则继承自父级(2.1.5 新增继承机制),不能直接改/删/发布/启停。`,
|
|
291
|
-
nextAction: "到父级模型改规则,或用 rule.references 确认继承来源后再决定",
|
|
292
|
-
};
|
|
293
|
-
if (error.errcode === 401085)
|
|
294
|
-
return {
|
|
295
|
-
status: "refused",
|
|
296
|
-
blocker: "workflow-activity-name-invalid",
|
|
297
|
-
errcode: 401085,
|
|
298
|
-
"platform-version": "2.1.5+",
|
|
299
|
-
message: `${error.message}——2.1.5 的流程发布新增节点名校验:非空且 ≤80 字符单位(中文按 2 计),ERROR 级会让 publish 整体不发布。`,
|
|
300
|
-
nextAction: "workflow.get_draft 读回 activities[].name,缩短超长/补齐空名后重新 publish",
|
|
301
|
-
};
|
|
302
|
-
if (error.errcode === 480000)
|
|
303
|
-
return {
|
|
304
|
-
status: "refused",
|
|
305
|
-
blocker: "current-task-suspended",
|
|
306
|
-
errcode: 480000,
|
|
307
|
-
"platform-version": "2.1.5+",
|
|
308
|
-
message: `${error.message}——当前任务被挂起(2.1.5 新增:前置/串行任务未完成),不是提交参数错。`,
|
|
309
|
-
nextAction: "workitem.list 看同一实例的前置任务状态;前置完成后重试提交",
|
|
310
|
-
};
|
|
311
|
-
// 子表超限:8.6 = 36102,8.7/2.1.5 = 36104(同义)。
|
|
312
|
-
if (error.errcode === 36102 || error.errcode === 36104)
|
|
313
|
-
return {
|
|
314
|
-
status: "refused",
|
|
315
|
-
blocker: "child-table-data-over-limit",
|
|
316
|
-
errcode: error.errcode,
|
|
317
|
-
message: `${error.message}——子表查询结果超限(8.6 回 36102,8.7/2.1.5 回 36104,同一语义)。收窄 filters/时间窗,或分页读 list_child;不要靠调大 size 硬拉。`,
|
|
318
|
-
nextCommand: "omc call data.list --args '{\"schemaCode\":\"<child>\",\"size\":20,\"page\":0}'",
|
|
319
|
-
};
|
|
320
|
-
// 2.1.5 起管理面统一 @AdminOnly(8.6 是 @RequireAdmin):401/403 往往不是
|
|
321
|
-
// 「token 坏了」,而是该端点在新版要求管理员。
|
|
322
|
-
if (error.kind === "http-status" && (error.diagnostic?.httpStatus === 401 || error.diagnostic?.httpStatus === 403))
|
|
323
|
-
return {
|
|
324
|
-
status: "refused",
|
|
325
|
-
blocker: `wire-${error.kind}`,
|
|
326
|
-
errcode: error.errcode,
|
|
327
|
-
message: `${error.message}——HTTP ${error.diagnostic?.httpStatus}:先确认账号;2.1.5 起管理端点(programming.*、workflow.publish/update、license/info 等)统一为 @AdminOnly(8.6 是 @RequireAdmin),普通应用管理员可能不再放行。`,
|
|
328
|
-
nextAction: "换管理员账号复验;仍 403 就区分「端点要求管理员」与「平台未开该功能」",
|
|
329
|
-
...(error.diagnostic ? { diagnostic: error.diagnostic } : {}),
|
|
330
|
-
};
|
|
331
|
-
return { status: "refused", blocker: `wire-${error.kind}`, errcode: error.errcode, message: error.message, ...(error.diagnostic ? { diagnostic: error.diagnostic } : {}) };
|
|
332
|
-
}
|
|
174
|
+
if (error instanceof WireError)
|
|
175
|
+
return refusalFromWireError(error);
|
|
333
176
|
throw error;
|
|
334
177
|
}
|
|
335
178
|
// A write tool that runs a step chain (field.update cascadeRepublish) may
|
|
@@ -352,7 +195,7 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
352
195
|
const artifactRef = writeArtifact(ctx, `${tool.name}-${randomUUID().slice(0, 8)}.json`, artifact);
|
|
353
196
|
return { status: executed.status, steps: executed.steps, failedStep: executed.failedStep, ...executed.envelope, ...(args.requestId ? { requestId: args.requestId } : {}), artifactFingerprint: artifactRef.detailSha256 };
|
|
354
197
|
}
|
|
355
|
-
const { performed, readback, steps, halfSuccess, irreversible, rollbackReceipt, runtimeVerification, ruleStatus, serviceStatus, status: producedStatus, blocker: producedBlocker, message: producedMessage, nextCommand: producedNextCommand, nextAction: producedNextAction, retryable: producedRetryable } = 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;
|
|
356
199
|
// Readback gate (live 2026-10-17): a tool that reports `readback.present:false`
|
|
357
200
|
// has NOT proven its own write — the platform accepted the request but the
|
|
358
201
|
// object is absent from the authoritative face. "Called without error" must
|
|
@@ -362,18 +205,23 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
362
205
|
// tool could not establish that the target belonged to the requested model
|
|
363
206
|
// (e.g. data.delete with a wrong schemaCode). Keep the gate's text when it
|
|
364
207
|
// already says something, otherwise use the producer's own diagnosis.
|
|
365
|
-
const writeStatus = producedStatus === "uncertain" ? "uncertain" : "ok";
|
|
366
|
-
const deliveryState = writeStatus === "
|
|
208
|
+
const writeStatus = producedStatus === "uncertain" ? "uncertain" : producedStatus === "partial" ? "partial" : "ok";
|
|
209
|
+
const deliveryState = writeStatus === "ok" ? readbackGate.deliveryState : "WRITE_UNVERIFIED";
|
|
367
210
|
// P1 复核:执行面的显式 uncertain 不能继承 `deliveryStateFor` 的 async 级联
|
|
368
211
|
// 文案——批量混合删除的 readback.absent=false 会被说成「删除级联中,稍后重跑」,
|
|
369
|
-
// 而真实结论是 delete-target-not-in-schema。生产者 blocker 优先。
|
|
212
|
+
// 而真实结论是 delete-target-not-in-schema。生产者 blocker 优先。partial 同理:
|
|
213
|
+
// 首段写已落,但复合目标未完成,必须用生产者自己的结论。
|
|
370
214
|
const producedWarning = producedStatus === "uncertain"
|
|
371
215
|
? (producedBlocker !== undefined
|
|
372
216
|
? `本次调用未建立成功结论(${producedBlocker}):按 blocker/message/nextCommand 核对,勿当作已清理`
|
|
373
217
|
: producedMessage)
|
|
374
|
-
:
|
|
375
|
-
|
|
376
|
-
|
|
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 继续,勿当作全部完成"))
|
|
377
225
|
: readbackGate.readbackWarning;
|
|
378
226
|
// Every production write echoes the explicit acknowledgement into the audit
|
|
379
227
|
// trail, so the record can always answer "was this a confirmed production
|
|
@@ -388,6 +236,8 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
388
236
|
...(steps !== undefined ? { steps } : {}),
|
|
389
237
|
...(ruleStatus !== undefined ? { ruleStatus } : {}),
|
|
390
238
|
...(serviceStatus !== undefined ? { serviceStatus } : {}),
|
|
239
|
+
...(producedSubmitRefused !== undefined ? { submitRefused: producedSubmitRefused } : {}),
|
|
240
|
+
...(producedSubmitOutcome !== undefined ? { submitOutcome: producedSubmitOutcome } : {}),
|
|
391
241
|
...(productionConfirmed ? { productionConfirmed: true } : {}),
|
|
392
242
|
...(reason !== undefined ? { reason } : {}),
|
|
393
243
|
...(tool.rollback
|
|
@@ -436,11 +286,13 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
436
286
|
return {
|
|
437
287
|
status: writeStatus,
|
|
438
288
|
deliveryState,
|
|
439
|
-
...(writeStatus
|
|
440
|
-
...(writeStatus
|
|
441
|
-
...(writeStatus
|
|
442
|
-
...(writeStatus
|
|
443
|
-
...(writeStatus
|
|
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 } : {}),
|
|
444
296
|
...((typeof performed.applicationCode === "string" ? { applicationCode: performed.applicationCode } : typeof readback.applicationCode === "string" ? { applicationCode: readback.applicationCode } : {})),
|
|
445
297
|
...(readOnlyEscapeNote !== undefined ? { readOnlyEscape: readOnlyEscapeNote } : {}),
|
|
446
298
|
performed,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.8.
|
|
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.
|
|
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.
|
|
79
|
+
"@stalfh233/omc-fake-platform": "0.8.16"
|
|
80
80
|
}
|
|
81
81
|
}
|
package/skills/omc-glossary.md
CHANGED
|
@@ -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.
|