@stalfh233/omc-cli 0.6.85 → 0.6.87
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/README.md +3 -2
- package/dist/batch-executor.js +236 -0
- package/dist/capability-overview.js +2 -2
- package/dist/cli.js +21 -3
- package/dist/discovery.js +50 -1
- package/dist/endpoints.js +16 -0
- package/dist/goal-plan.js +12 -0
- package/dist/goal-routes.js +20 -1
- package/dist/intent/capabilities/bizservice.js +507 -108
- package/dist/intent/cli.js +1 -1
- package/dist/intent/compiler.js +11 -4
- package/dist/intent/plan-apply.js +22 -5
- package/dist/intent/plan-file.js +1 -0
- package/dist/intent/readback.js +78 -1
- package/dist/intent/schema.js +1 -1
- package/dist/lanes/apply-changes.js +134 -252
- package/dist/lanes/b2-registration.js +61 -5
- package/dist/lanes/businessrule.js +8 -3
- package/dist/lanes/config-diff.js +9 -0
- package/dist/lanes/rule-lifecycle.js +37 -4
- package/dist/lanes/runtime-data-contract.js +2 -1
- package/dist/lanes/runtime-data.js +344 -107
- package/dist/lanes/runtime-paging.js +100 -0
- package/dist/package.js +8 -2
- package/dist/read-shapes.js +29 -10
- package/dist/recipes/b2-registration.js +1 -1
- package/dist/rollback.js +71 -20
- package/dist/rule-support.js +43 -1
- package/dist/service-support.js +57 -0
- package/dist/surface-ref.js +37 -0
- package/dist/write.js +5 -1
- package/docs/omc-introduction.md +1 -0
- package/package.json +3 -3
- package/skills/omc-capabilities.md +1 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 0.6.87 D1/D3(批次计划 r89-batch PLAN.md D1/D3;T2 trace §2/§3/§7 M1):runtime 读面共享翻页扫描。
|
|
3
|
+
*
|
|
4
|
+
* 统一 `data.list all:true` 与 `data.aggregate` 数值/本地扫描的翻页语义:
|
|
5
|
+
* - 首页 total 是**唯一基准**(后续页的 total 不采信——平台每页独立 COUNT,
|
|
6
|
+
* `PageVO.java:50-57` / `BizObjectRepository.java:132-155`,无跨请求快照);
|
|
7
|
+
* - 页码序消费:行按 page 0,1,2… 顺序折叠,绝不按完成序;
|
|
8
|
+
* - 空页停止:某页 0 行即停止,不再**消费**其后页(D3 的预取可能已经发出,
|
|
9
|
+
* 但断点之后的行一律丢弃);
|
|
10
|
+
* - 超 total 尾页裁剪:rowCeiling = min(total, cap),越界行丢弃;
|
|
11
|
+
* - total 缺失(面没回 totalElements,如 showTotal:false)→ `total:null`,
|
|
12
|
+
* 扫描只能按 cap/空页停止,`complete` 恒 false——「total 缺失必须 complete:false」,
|
|
13
|
+
* 不得把 0 当 total 静默当全集。
|
|
14
|
+
*
|
|
15
|
+
* D3 分页并发(T2-S2):首页串行取 total 后才预取余页(窗口
|
|
16
|
+
* `DEFAULT_SCAN_CONCURRENCY`);**只按页码序折叠、只消费断点前页**。
|
|
17
|
+
* `rowsScanned` 由调用方按返回的 rows 计算(预取但未消费的页不会进来);
|
|
18
|
+
* `wireCalls` 仍是**逻辑翻页请求数**(含预取越界页,不含限流退避/串行重放——
|
|
19
|
+
* 与 S1 的 wire.calls 口径一致,重试只进 `concurrency.retries`)。
|
|
20
|
+
* 失败语义沿用 S1:非限流直接抛;断点处限流失败串行重放一次,仍失败抛该页;
|
|
21
|
+
* 断点之后的失败一律忽略(串行基线根本不会读到那一页)。
|
|
22
|
+
*
|
|
23
|
+
* 调用方保留各自回执容器:list 仍回 items/itemsCount/pagesFetched/…;aggregate 仍回
|
|
24
|
+
* value/buckets/coverage——本模块只统一翻页/裁剪/覆盖判定,不碰投影。
|
|
25
|
+
*/
|
|
26
|
+
import { DEFAULT_SCAN_CONCURRENCY, isThrottleClassError, mapWithConcurrency } from "../concurrency.js";
|
|
27
|
+
/**
|
|
28
|
+
* 共享翻页扫描(D1/D3 语义,见文件头)。首页串行取 total;计划页数 = ceil(min(total,
|
|
29
|
+
* cap)/pageSize);余页有界并发预取,然后严格按页码序折叠到 rowCeiling / 空页 / 计划耗尽。
|
|
30
|
+
*/
|
|
31
|
+
export async function scanPages(options) {
|
|
32
|
+
const { cap, pageSize, fetchPage } = options;
|
|
33
|
+
const first = await fetchPage(0);
|
|
34
|
+
const total = first.totalKnown ? first.total : null;
|
|
35
|
+
if (first.content.length === 0) {
|
|
36
|
+
return {
|
|
37
|
+
rows: [],
|
|
38
|
+
total,
|
|
39
|
+
pagesConsumed: 0,
|
|
40
|
+
wireCalls: 1,
|
|
41
|
+
stopReason: total === 0 ? "no-data" : "empty-page",
|
|
42
|
+
complete: total === 0,
|
|
43
|
+
truncatedByCap: false,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const rowCeiling = Math.min(total ?? Number.POSITIVE_INFINITY, cap);
|
|
47
|
+
const plannedPages = Math.max(1, Math.ceil(rowCeiling / pageSize));
|
|
48
|
+
const prefetchPages = Array.from({ length: Math.max(0, plannedPages - 1) }, (_unused, index) => index + 1);
|
|
49
|
+
// D3:首页已串行确认 total,余页彼此独立,可有界并发;折叠绝不按完成序。
|
|
50
|
+
const prefetch = prefetchPages.length > 0
|
|
51
|
+
? await mapWithConcurrency(prefetchPages, DEFAULT_SCAN_CONCURRENCY, (page) => fetchPage(page))
|
|
52
|
+
: undefined;
|
|
53
|
+
const rows = [...first.content];
|
|
54
|
+
let pagesConsumed = 1;
|
|
55
|
+
let brokeOnEmpty = false;
|
|
56
|
+
for (let index = 0; index < prefetchPages.length; index += 1) {
|
|
57
|
+
// 只消费断点前页:已到 rowCeiling 就丢弃其余预取结果。
|
|
58
|
+
if (rows.length >= rowCeiling)
|
|
59
|
+
break;
|
|
60
|
+
const outcome = prefetch.outcomes[index];
|
|
61
|
+
let shape;
|
|
62
|
+
if (outcome.ok) {
|
|
63
|
+
shape = outcome.value;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
// S1 失败语义:非限流(业务拒绝等)直接抛断点处错误;限流类在窗口内已
|
|
67
|
+
// 退避重试一次,仍失败则串行重放一次(突发限流串行往往能过),再失败抛。
|
|
68
|
+
if (!isThrottleClassError(outcome.error))
|
|
69
|
+
throw outcome.error;
|
|
70
|
+
shape = await fetchPage(prefetchPages[index]);
|
|
71
|
+
}
|
|
72
|
+
if (shape.content.length === 0) {
|
|
73
|
+
brokeOnEmpty = true;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
rows.push(...shape.content);
|
|
77
|
+
pagesConsumed += 1;
|
|
78
|
+
}
|
|
79
|
+
const clipped = rows.length > rowCeiling ? rows.slice(0, rowCeiling) : rows;
|
|
80
|
+
const complete = total !== null && clipped.length >= total;
|
|
81
|
+
const stopReason = complete
|
|
82
|
+
? "complete"
|
|
83
|
+
: brokeOnEmpty
|
|
84
|
+
? "empty-page"
|
|
85
|
+
: clipped.length >= cap
|
|
86
|
+
? "cap"
|
|
87
|
+
: "short-read";
|
|
88
|
+
return {
|
|
89
|
+
rows: clipped,
|
|
90
|
+
total,
|
|
91
|
+
pagesConsumed,
|
|
92
|
+
// 预取的每一页都真实发过请求(即使断点后没消费)。
|
|
93
|
+
wireCalls: 1 + prefetchPages.length,
|
|
94
|
+
stopReason,
|
|
95
|
+
complete,
|
|
96
|
+
truncatedByCap: total !== null ? clipped.length < total : clipped.length >= cap,
|
|
97
|
+
...(prefetch !== undefined && prefetchPages.length > 1 ? { concurrency: prefetch.stats } : {}),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=runtime-paging.js.map
|
package/dist/package.js
CHANGED
|
@@ -45,6 +45,7 @@ export async function executePackage(ctx, plan, coverage, args, execute) {
|
|
|
45
45
|
steps: executed.steps,
|
|
46
46
|
failedStep: executed.failedStep,
|
|
47
47
|
stop: executed.envelope,
|
|
48
|
+
...(executed.ruleStatus !== undefined ? { ruleStatus: executed.ruleStatus } : {}),
|
|
48
49
|
...(productionConfirmed ? { productionConfirmed: true } : {}),
|
|
49
50
|
...(reason !== undefined ? { reason } : {}),
|
|
50
51
|
deliveryState: "STOPPED",
|
|
@@ -56,21 +57,26 @@ export async function executePackage(ctx, plan, coverage, args, execute) {
|
|
|
56
57
|
steps: executed.steps,
|
|
57
58
|
failedStep: executed.failedStep,
|
|
58
59
|
...executed.envelope,
|
|
60
|
+
// A4:中途失败也要状态段(configure_rule 的 enable 步失败时 save 已落图)。
|
|
61
|
+
...(executed.ruleStatus !== undefined ? { ruleStatus: executed.ruleStatus } : {}),
|
|
59
62
|
artifactFingerprint: artifactRef.detailSha256,
|
|
60
63
|
};
|
|
61
64
|
}
|
|
62
|
-
const { steps, readback, summary } = executed;
|
|
65
|
+
const { steps, readback, summary, ruleStatus } = executed;
|
|
63
66
|
const artifact = {
|
|
64
67
|
plan: boundPlan,
|
|
65
68
|
steps,
|
|
66
69
|
readback,
|
|
70
|
+
...(ruleStatus !== undefined ? { ruleStatus } : {}),
|
|
67
71
|
...(productionConfirmed ? { productionConfirmed: true } : {}),
|
|
68
72
|
...(reason !== undefined ? { reason } : {}),
|
|
69
73
|
deliveryState: "DELIVERED",
|
|
70
74
|
recordedAt: new Date().toISOString(),
|
|
71
75
|
};
|
|
72
76
|
writeArtifact(ctx, `package-${randomUUID().slice(0, 8)}.json`, artifact);
|
|
73
|
-
|
|
77
|
+
// A4(r89 契约层):ruleStatus 透传(configure_rule 等套餐面)——与原子工具
|
|
78
|
+
// (write.ts)同一键、同一构造(rule-support.ts ruleStatusSegment)。
|
|
79
|
+
return { status: "ok", deliveryState: "DELIVERED", steps, readback, ...(ruleStatus !== undefined ? { ruleStatus } : {}), ...(productionConfirmed ? { productionConfirmed: true } : {}), ...(reason !== undefined ? { reason } : {}), ...(summary !== undefined ? { summary } : {}), artifactFingerprint: sha256(artifact) };
|
|
74
80
|
});
|
|
75
81
|
}
|
|
76
82
|
//# sourceMappingURL=package.js.map
|
package/dist/read-shapes.js
CHANGED
|
@@ -70,11 +70,14 @@ const READ_SHAPES = {
|
|
|
70
70
|
},
|
|
71
71
|
"data.load": {
|
|
72
72
|
keys: ["bizObjectId", "exists", "data:{...}"],
|
|
73
|
+
// A1(同义事实对照):同一行业务列在两面包装不同——列表面套 fields,本面平铺。
|
|
74
|
+
// 平台证据:行本体是 FormDataVO.data(GET /runtime/form_data/get_by_id 平铺业务列)。
|
|
75
|
+
notes: ["业务列在 data.<code>(平铺,不套 fields);列表面 data.list 同一行是 items[].fields.<code>——跨面对照别拿错包装键"],
|
|
73
76
|
},
|
|
74
77
|
// r80:计数/分组统计的读回面。notes 只显首条——把陷阱并进第一句。
|
|
75
78
|
"data.aggregate": {
|
|
76
|
-
keys: ["schemaCode", "metric", "field?", "value?", "count", "nonNullCount?", "nullCount?", "groupBy?", "total", "buckets:array<{key,count,nonNullCount?,value?}>", "nullBucket:{count,nonNullCount?,value?}", "truncatedBuckets", "bucketsTruncatedCount", "unaccountedCount?", "coverage:{mode,rowsScanned,cap,complete,missingCount?}", "filter:{draftPolicy,hint}", "wire:{calls,plan}", "capNotice?", "note?", "environmentFingerprint"],
|
|
77
|
-
notes: ["计数用 total
|
|
79
|
+
keys: ["schemaCode", "metric", "field?", "value?", "count", "nonNullCount?", "nullCount?", "groupBy?", "total", "buckets:array<{key,count,nonNullCount?,value?}>", "nullBucket:{count,nonNullCount?,value?}", "truncatedBuckets", "bucketsTruncatedCount", "unaccountedCount?", "shapeWarnings?", "strategyFallback?", "coverage:{mode:server-total|paged-local-scan|local-scan|server-aggregate,rowsScanned,cap:number|null,complete,missingCount?}", "filter:{draftPolicy,hint}", "wire:{calls,plan,concurrency?}", "capNotice?", "note?", "environmentFingerprint"],
|
|
80
|
+
notes: ["计数用 total(totalElements);分组=值域×count,key 是存储值/code,null 单列 nullBucket;分桶 count 并发窗口 4,桶序稳定;数值指标(sum/avg/min/max+field)本地折叠(cap 1000,null 不进聚合、avg 分母排除 null);coverage.mode=server-total/paged-local-scan/local-scan/server-aggregate,/sum 不可用或形状不符回退本地(strategyFallback);complete:false 只覆盖已扫行,勿外推"],
|
|
78
81
|
},
|
|
79
82
|
"app.list": {
|
|
80
83
|
keys: ["applications:array<{code,name,groupId?,modelCount}>", "applicationsCount", "omitted"],
|
|
@@ -92,11 +95,11 @@ const READ_SHAPES = {
|
|
|
92
95
|
"model.inspect": {
|
|
93
96
|
// Slim/compact face (window diet): field inventory is `fieldCodes`, not fields[].
|
|
94
97
|
keys: ["schemaCode", "applicationCode", "fieldCodes", "form", "listview", "ruleCodes", "datarules", "workflow", "hint"],
|
|
95
|
-
notes: ["slim
|
|
98
|
+
notes: ["slim 面字段清单=fieldCodes:array<string>(只有 code 清单);字段名/类型的行明细在 field.list.fields[].code——同一事实两面,别在 fieldCodes 里找 name;all:true 时 fields/artifact 行含 options"],
|
|
96
99
|
},
|
|
97
100
|
"field.list": {
|
|
98
101
|
keys: ["fields:array<{code,name,type,...}>", "modelPresent?"],
|
|
99
|
-
notes: ["模型不存在时平台可能 refused(300004);存在性判据优先 model.inspect.modelPresent / rule.list.modelPresent"],
|
|
102
|
+
notes: ["字段行键=fields[].code(带 name/type 明细);model.inspect 的 fieldCodes 是同一清单的纯 code 投影——跨面对照别拿错键", "模型不存在时平台可能 refused(300004);存在性判据优先 model.inspect.modelPresent / rule.list.modelPresent"],
|
|
100
103
|
},
|
|
101
104
|
"workitem.list": {
|
|
102
105
|
// Flat rows — no fields bag. Wire id is projected as workItemId.
|
|
@@ -128,16 +131,21 @@ const READ_SHAPES = {
|
|
|
128
131
|
notes: ["无流程的模型 workflowCode:null + exists:false(不是错误);平台无流程清单端点,本面按模型索引(流程-模型一对一惯例,workflowCode 常为 <模型code>_flow)", "ruleBindingCount = flow 级 handler + 节点级事件 + SYSTEM_ACTIVITY 顶层绑定的规则码总数(比 get_published 摘要里的同名键多算节点级)"],
|
|
129
132
|
},
|
|
130
133
|
"workflow.get_published": {
|
|
134
|
+
// A2 locator:模板摘要 activities[].code ↔ 实例/待办 activityCode(Activity.java:26-30
|
|
135
|
+
// 存储面原生键就是 activityCode/activityType/activityName;code/name/type 是摘要投影)。
|
|
136
|
+
locator: { templateActivityKey: "code", instanceKey: "activityCode", workitemKey: "activityCode" },
|
|
131
137
|
keys: ["status", "workflowCode", "exists", "published", "workflowSummary:{workflowCode,templateType,activities:array<{index,code,type,name,bizActions?:{<nodeEvent>:[ruleCode]},systemBizActions?:{bizActionType,ruleCodes:[code]}}>,edges:array<{from,to}>,ruleBindings:array<{...}>,nodeRuleBindings?,systemRuleBindings?,ruleBindingCount,originateActivity:{code,type,name,participant}}", "activities:array<{code,name,type,bizActions?,systemBizActions?}>(投影)", "propertyPermissionsCount", "version", "summaryHint", "truncatedKeys?", "omittedKeys?", "truncated?", "data?(外置时 null,完整模板在 detailArtifactId)", "omittedShape?", "omittedNote?", "environmentFingerprint", "detailArtifactId?", "detailSha256?", "fetch?"],
|
|
132
|
-
notes: ["规则绑定三个面:流程级 ruleBindings、节点事件 activities[].bizActions、SYSTEM_ACTIVITY 顶层 activities[].systemBizActions(规则绑在系统活动节点本身、激活时执行)——三个面看完再下「没绑」结论;完整模板在 data(外置 detailArtifactId),要深层字段时投影写到叶子(如 --jq 'data.activities[].bizActions'
|
|
138
|
+
notes: ["规则绑定三个面:流程级 ruleBindings、节点事件 activities[].bizActions、SYSTEM_ACTIVITY 顶层 activities[].systemBizActions(规则绑在系统活动节点本身、激活时执行)——三个面看完再下「没绑」结论;完整模板在 data(外置 detailArtifactId),要深层字段时投影写到叶子(如 --jq 'data.activities[].bizActions')——写整棵父节点会因总量超限再次被外置;activities[] 键=code/name/type,实例/待办面(workflow.instanceActivity、workitem.list)同一概念叫 activityCode/activityName(workitem 行没有 activityType)——跨面对照别拿错键"],
|
|
133
139
|
},
|
|
134
140
|
"workflow.get_draft": {
|
|
135
141
|
keys: ["status", "workflowCode", "exists", "workflowSummary:{workflowCode,templateType,activities:array<{index,code,type,name,bizActions?:{<nodeEvent>:[ruleCode]},systemBizActions?:{bizActionType,ruleCodes:[code]}}>,edges:array<{from,to}>,ruleBindings:array<{...}>,nodeRuleBindings?,systemRuleBindings?,ruleBindingCount,originateActivity:{code,type,name,participant}}", "activities:array<{code,name,type,bizActions?,systemBizActions?}>(投影)", "propertyPermissionsCount", "version", "summaryHint", "truncatedKeys?", "omittedKeys?", "truncated?", "data?(外置时 null,完整模板在 detailArtifactId)", "omittedShape?", "omittedNote?", "environmentFingerprint", "detailArtifactId?", "detailSha256?", "fetch?"],
|
|
136
142
|
notes: ["与 workflow.get_published 同形(少了 published 键);节点绑定看 activities[].bizActions、系统活动顶层看 systemBizActions;templateType=DRAFT;深层字段投影写到叶子,完整模板在 data/detailArtifactId"],
|
|
137
143
|
},
|
|
138
144
|
// R88 #1:双面排查面。returnsFace 只显 notes 首条——教学并进首条。
|
|
145
|
+
// A8(r89 契约层):comparison 段钉死对比方向与算法(from=published, to=draft),
|
|
146
|
+
// 并明确 changes[] 不是发布 payload。
|
|
139
147
|
"config.diff": {
|
|
140
|
-
keys: ["domain:'workflow'|'form'", "target:{schemaCode,workflowCode?|sheetCode?}", "present?:boolean(form:表单槽位是否存在;false 的面缺语义看 verdict=absent)", "draft:{present,controlCount?(form)}", "published:{present,controlCount?(form)}", "changed:boolean|null(null=一面缺失不可比,配 verdict)", "verdict?:'draft-only'|'published-only'|'absent'|'both-empty'", "changes:array<{path,before,after}>(≤limit;before=发布面,after=草稿面)", "totalKnown", "truncated", "remaining?", "shapeWarnings?", "bindingFaces?:{ruleBindings,nodeRuleBindings,systemRuleBindings}(workflow)", "deepScan?:{changed,totalKnown,samplePaths?}(workflow)", "diffArtifactId?", "diffSha256?", "fetch?", "hint"],
|
|
148
|
+
keys: ["domain:'workflow'|'form'", "comparison:{from:'published',to:'draft',algorithm:'deepDiff-v1',note}(读回对比,不是写 payload)", "target:{schemaCode,workflowCode?|sheetCode?}", "present?:boolean(form:表单槽位是否存在;false 的面缺语义看 verdict=absent)", "draft:{present,controlCount?(form)}", "published:{present,controlCount?(form)}", "changed:boolean|null(null=一面缺失不可比,配 verdict)", "verdict?:'draft-only'|'published-only'|'absent'|'both-empty'", "changes:array<{path,before,after}>(≤limit;before=发布面,after=草稿面)", "totalKnown", "truncated", "remaining?", "shapeWarnings?", "bindingFaces?:{ruleBindings,nodeRuleBindings,systemRuleBindings}(workflow)", "deepScan?:{changed,totalKnown,samplePaths?}(workflow)", "diffArtifactId?", "diffSha256?", "fetch?", "hint"],
|
|
141
149
|
notes: [
|
|
142
150
|
"changed:null ≠ 空 diff——一面缺失时看 verdict(draft-only=草稿全未发布);workflow 路径形如 activities[+code]/edges[A->B]/nodeRuleBindings[Activity2.endActivity].ruleCodes[+X],form 路径前缀 view/attributes/html/actions(按控件 key 对齐,不文本 diff);totalKnown 是精确全量计数,全量差异与双面快照在 diffArtifactId",
|
|
143
151
|
],
|
|
@@ -157,7 +165,7 @@ const READ_SHAPES = {
|
|
|
157
165
|
// 覆盖——探针只能读回执 coverage 才发现选错了面。对照进 notes[0]:
|
|
158
166
|
// returnsFace 只显首条,默认 describe 面就要能先验选对面,不是打完才知道。
|
|
159
167
|
"rule.references": {
|
|
160
|
-
keys: ["kind", "code", "scanned:{models,rules,parseFailures?}", "matches:array<{schemaCode,ruleCode,nodeCode,nodeType,via,targetObjectCode?}>", "coverage:{scanned,notScanned,note}", "applicationResolution?", "note?(零命中)", "hint?"],
|
|
168
|
+
keys: ["kind", "code", "scanned:{models,rules,parseFailures?}", "matches:array<{schemaCode,ruleCode,nodeCode,nodeType,via,targetObjectCode?,serviceMethodCode?(kind=service)}>", "coverage:{scanned,notScanned,note}", "applicationResolution?", "note?(零命中)", "hint?"],
|
|
161
169
|
notes: [
|
|
162
170
|
"覆盖面对照:本工具=在线实时、仅 businessrule;omc graph references=离线快照、businessrule+datarule+listview 三面(毫秒级,需先 omc graph pull),且已含规则条件叶子(rule.condition 边;本在线面不含,条件引用走 graph);字段消歧 graph 面支持 schema.field 写法",
|
|
163
171
|
"matches:[] 只代表已扫面零命中(coverage.notScanned 是权威,勿当可安全删除);字段 code 跨模型不唯一,建议配 schemaCodes 限范围",
|
|
@@ -183,9 +191,12 @@ const READ_SHAPES = {
|
|
|
183
191
|
],
|
|
184
192
|
},
|
|
185
193
|
"form.get": {
|
|
194
|
+
// A2 locator:控件清单键 ↔ config.diff 的逐控件差异路径(BizFormModel.java:26-32
|
|
195
|
+
// 六列分面存储,diff 按控件 key 对齐,前缀 view/attributes/html/actions)。
|
|
196
|
+
locator: { controlCodes: "publishedControlCodes|draftControlCodes", diffPath: "changes[].path" },
|
|
186
197
|
keys: ["present", "published", "publishedControlCodes", "draftControlCodes", "formButtonCodes?", "formButtons?", "customButtonJson?(full)", "customButtonJsonShapeWarning?"],
|
|
187
198
|
notes: [
|
|
188
|
-
"控件清单键是 publishedControlCodes/draftControlCodes,不是 controls",
|
|
199
|
+
"控件清单键是 publishedControlCodes/draftControlCodes,不是 controls;两面差异的逐控件路径在 config.diff changes[].path(前缀 view/attributes/html/actions,按控件 key 对齐)",
|
|
189
200
|
"表单按钮读 formButtonCodes/formButtons;full:true 另带 customButtonJson 数组原样(库里是字符串脏形时给 customButtonJsonShapeWarning——线上 #38 前端按钮不渲染,重写 buttons 自愈)",
|
|
190
201
|
],
|
|
191
202
|
},
|
|
@@ -229,8 +240,8 @@ const READ_SHAPES = {
|
|
|
229
240
|
},
|
|
230
241
|
// r79-w2b(issue 06):方法清单面——一次 list 拿全部 url(不再 N 次 method.get)。
|
|
231
242
|
"method.list": {
|
|
232
|
-
keys: ["status", "serviceCode", "adapterCode", "present", "methodsCount", "columnNote", "referencedNote", "methods:array<{code,name,url,httpType,requestBodyType,inParams,outParams,configKeys}>", "keyword?/totalBeforeFilter?", "methodsOmitted?/omittedMethods?", "environmentFingerprint", "detailArtifactId?", "detailSha256?", "fetch?"],
|
|
233
|
-
notes: ["url 恒在(configJson.url;DATA_SQL/DATA_TABLE/SAP/KAFKA/INTERNAL 回 null,不是缺键)——name 是人工显示名,语义可能与 url 相反,判「打到哪个接口」只认 url;detail:true 把 inParams/outParams 从计数换成参数 code 数组(0 额外 wire)"],
|
|
243
|
+
keys: ["status", "serviceCode", "adapterCode", "present", "methodsCount", "columnNote", "referencedNote", "methods:array<{code,name,url,httpType,requestBodyType,inParams,outParams,configKeys,referenced}>", "keyword?/totalBeforeFilter?", "methodsOmitted?/omittedMethods?", "environmentFingerprint", "detailArtifactId?", "detailSha256?", "fetch?"],
|
|
244
|
+
notes: ["url 恒在(configJson.url;DATA_SQL/DATA_TABLE/SAP/KAFKA/INTERNAL 回 null,不是缺键)——name 是人工显示名,语义可能与 url 相反,判「打到哪个接口」只认 url;referenced 来自平台 bizMethodMapping 计数(filterFlag=false 同样置位——F14 真机钉死),只覆盖规则图映射,删方法前用 rule.references kind=service 复核;detail:true 把 inParams/outParams 从计数换成参数 code 数组(0 额外 wire)"],
|
|
234
245
|
},
|
|
235
246
|
"service.adapter_config": {
|
|
236
247
|
// r28f F5:顶栏 adapterCodes 摘要;compact:true 只回 code/name/description。
|
|
@@ -319,4 +330,12 @@ const READ_SHAPES = {
|
|
|
319
330
|
export function readShapeFor(toolName) {
|
|
320
331
|
return READ_SHAPES[toolName];
|
|
321
332
|
}
|
|
333
|
+
/**
|
|
334
|
+
* A2(r89 契约层):`resultMeta.locator` 投影——信封侧元数据,键名对照表由
|
|
335
|
+
* read-shapes 单一声明。没有 locator 的工具零字节。
|
|
336
|
+
*/
|
|
337
|
+
export function locatorMetaFor(toolName) {
|
|
338
|
+
const locator = READ_SHAPES[toolName]?.locator;
|
|
339
|
+
return locator === undefined ? undefined : { locator };
|
|
340
|
+
}
|
|
322
341
|
//# sourceMappingURL=read-shapes.js.map
|
|
@@ -25,7 +25,7 @@ const restfulQueryService = Object.freeze({
|
|
|
25
25
|
"RESTFUL 方法 configJson 必需键:httpType(Post/Get/Put/Patch/Delete)、requestBodyType(Form-urlencoded/JSON/Text)、url、frontEndExtensionEnable(布尔)",
|
|
26
26
|
"RESTFUL 每个输入/输出参数必须带 configJson.position ∈ QUERY_PARAMS/REQUEST_HEADER/REQUEST_BODY/PATH_PARAMS(URL_VARIABLE 被运行时拒 501007)",
|
|
27
27
|
"每个输入/输出参数必须带 bizPropertyType(如 SHORT_TEXT/NUMERICAL)——缺它提交即被 bizservice-parameter-face-invalid 拒(r19-p7 首拒根因,2026-10-26 修正本配方)",
|
|
28
|
-
"
|
|
28
|
+
"一次 service.register 最多建一个方法(methodName 同时作为 code/name);要一次声明多个方法、或给既有服务加方法,用 intent services[].methods[](缺失 plan method.create、漂移 plan method.update),也可直接走低层 method.create",
|
|
29
29
|
],
|
|
30
30
|
priorToolReferences: [
|
|
31
31
|
{ tool: "service.category.list", args: { environment }, purpose: "取服务分类 id(所属目录必填)" },
|
package/dist/rollback.js
CHANGED
|
@@ -11,6 +11,7 @@ import { emitTransportResult, emitInvalid } from "./command-transport.js";
|
|
|
11
11
|
import { acquireWriteLock } from "./write-lock.js";
|
|
12
12
|
import { resolveSinceRef } from "./duration.js";
|
|
13
13
|
import { normalizeWriteReason } from "./write-audit.js";
|
|
14
|
+
import { appendBatchAuditLine, executeGovernedBatch } from "./batch-executor.js";
|
|
14
15
|
/** Invalid `--since`: the CLI maps it to invalid-input (exit 10), never a guessed window. */
|
|
15
16
|
export class SinceRefError extends Error {
|
|
16
17
|
}
|
|
@@ -262,28 +263,74 @@ export async function applyRollback(ref, options, context) {
|
|
|
262
263
|
}
|
|
263
264
|
await new Promise((resolve) => setTimeout(resolve, Math.min(200, Math.max(0, deadline - Date.now()))));
|
|
264
265
|
}
|
|
266
|
+
let progressFile;
|
|
267
|
+
let batchSteps = [];
|
|
265
268
|
try {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
269
|
+
// B1:执行段(串行/首败即停/超时冻结/progressFile)由共享 governed batch
|
|
270
|
+
// executor 承担;本面只负责「怎么重放一次恢复调用」(真实 tool handler +
|
|
271
|
+
// 每次 requestId)和把结果投影回旧回执字段(results/step/status 逐字不变)。
|
|
272
|
+
const executed = await executeGovernedBatch({
|
|
273
|
+
changes: plan.inverse.calls.map((call) => ({ tool: call.tool, args: call.args })),
|
|
274
|
+
mode: "rollback",
|
|
275
|
+
progress: { ctx, summary: restoreReason },
|
|
276
|
+
runTool: async (call, index) => {
|
|
277
|
+
const { exitCode, result } = await runToolCall(call.tool, {
|
|
278
|
+
args: { ...call.args, environment: entry.environment, ...(options.confirmProduction ? { confirmProduction: true } : {}) },
|
|
279
|
+
requestId: `omc-rollback-${entry.seq}-${index + 1}`,
|
|
280
|
+
context: ctx,
|
|
281
|
+
reason: restoreReason,
|
|
282
|
+
print: () => undefined,
|
|
283
|
+
});
|
|
284
|
+
results.push({
|
|
285
|
+
tool: call.tool,
|
|
286
|
+
exitCode,
|
|
287
|
+
status: result.status,
|
|
288
|
+
...(result.deliveryState ? { deliveryState: result.deliveryState } : {}),
|
|
289
|
+
...(result.summary ? { summary: result.summary } : {}),
|
|
290
|
+
// r55: exit-code-only results hid the reason a restore call failed
|
|
291
|
+
// (input-invalid showed as a bare "status=error"). Surface the shape.
|
|
292
|
+
...(exitCode === 0 ? {} : { blocker: result.blocker ?? null, message: result.message ?? null, ...(result.issues !== undefined ? { issues: result.issues } : {}), ...(result.diagnostic !== undefined ? { diagnostic: result.diagnostic } : {}) }),
|
|
293
|
+
});
|
|
294
|
+
if (exitCode !== 0)
|
|
295
|
+
return {
|
|
296
|
+
kind: "stop",
|
|
297
|
+
status: "refused",
|
|
298
|
+
envelope: { message: `恢复调用 ${call.tool} 未成功(status=${result.status});已执行的调用已各自记 journal,可对已完成步骤再 plan` },
|
|
299
|
+
};
|
|
300
|
+
// Same identity projection as apply_changes/intent receipts (step/index/
|
|
301
|
+
// status); the rollback-specific evidence stays in `results[]` below.
|
|
302
|
+
return { kind: "ok", step: { step: call.tool, index, status: result.status } };
|
|
303
|
+
},
|
|
304
|
+
});
|
|
305
|
+
if (executed.kind === "stop") {
|
|
306
|
+
const outcome = executed.outcome;
|
|
307
|
+
// A failed replay call is the legacy "stopped" verdict (exit 1); the
|
|
308
|
+
// executor's own `refused` is its internal classification. A budget /
|
|
309
|
+
// transport freeze stays `uncertain` — never success.
|
|
310
|
+
return {
|
|
311
|
+
status: outcome.status === "uncertain" ? "uncertain" : "stopped",
|
|
312
|
+
rollbackOf: { seq: entry.seq, tool: entry.tool },
|
|
313
|
+
step: outcome.failedStep.index + 1,
|
|
314
|
+
...outcome.envelope,
|
|
315
|
+
results,
|
|
316
|
+
steps: outcome.steps,
|
|
317
|
+
failedStep: outcome.failedStep,
|
|
318
|
+
};
|
|
286
319
|
}
|
|
320
|
+
// Delivered restore batch → one honest `rollbackable:false` audit line
|
|
321
|
+
// (B1/W11C), discoverable with `omc rollback list --tool rollback`. The
|
|
322
|
+
// per-call restore writes were already journaled by their own handlers.
|
|
323
|
+
await appendBatchAuditLine({
|
|
324
|
+
ctx,
|
|
325
|
+
mode: "rollback",
|
|
326
|
+
environmentArg: entry.environment,
|
|
327
|
+
reason: restoreReason,
|
|
328
|
+
steps: executed.steps,
|
|
329
|
+
rollbackOf: { seq: entry.seq, tool: entry.tool },
|
|
330
|
+
progressFile: executed.progressFile,
|
|
331
|
+
});
|
|
332
|
+
progressFile = executed.progressFile;
|
|
333
|
+
batchSteps = executed.steps;
|
|
287
334
|
}
|
|
288
335
|
finally {
|
|
289
336
|
await lock.release();
|
|
@@ -310,6 +357,9 @@ export async function applyRollback(ref, options, context) {
|
|
|
310
357
|
status: "ok",
|
|
311
358
|
rollbackOf: { seq: entry.seq, tool: entry.tool, target: entry.target },
|
|
312
359
|
calls: results,
|
|
360
|
+
// B1: the shared step-identity projection (same shape as apply_changes /
|
|
361
|
+
// intent receipts); the per-call evidence stays in `calls[]`.
|
|
362
|
+
steps: batchSteps,
|
|
313
363
|
verify,
|
|
314
364
|
// R88 #3:恢复写落 journal 时记的 reason(journal 是唯一审计真相源)。
|
|
315
365
|
reason: restoreReason,
|
|
@@ -319,6 +369,7 @@ export async function applyRollback(ref, options, context) {
|
|
|
319
369
|
restoredSha256: restoredSha,
|
|
320
370
|
matchesBefore: verify === "restored",
|
|
321
371
|
recoveredTo: { seq: entry.seq, ts: entry.ts },
|
|
372
|
+
...(progressFile !== undefined ? { progressFile } : {}),
|
|
322
373
|
...(verify === "mismatch" ? { beforeSha, restoredSha, message: "恢复调用已完成但读回与 before 存在值冲突(非默认显式化):立即人工核对目标现态(omc rollback plan <seq> 的 diff 可复看差异)" } : {}),
|
|
323
374
|
hint: "本次恢复的每次调用都走了完整写闸门并已记 journal;恢复本身可再回滚(rollback plan <新 seq>)",
|
|
324
375
|
};
|
package/dist/rule-support.js
CHANGED
|
@@ -1475,7 +1475,47 @@ async function verifyRulePublish(session, schemaCode, ruleCode, publishResponse)
|
|
|
1475
1475
|
},
|
|
1476
1476
|
};
|
|
1477
1477
|
}
|
|
1478
|
-
|
|
1478
|
+
/**
|
|
1479
|
+
* A4(r89 契约层):rule 族统一状态段 `ruleStatus`——三个写入口(rule.save 整图 /
|
|
1480
|
+
* rule.node.update 单节点 patch / configure_rule+rule.enable 保存并启用)与
|
|
1481
|
+
* 「保存≠启用、启用≠发布面」的平台事实一仔回执拼写:
|
|
1482
|
+
*
|
|
1483
|
+
* { operation:"save|patch|save-enable",
|
|
1484
|
+
* target:{schemaCode, ruleCode, nodeCode?},
|
|
1485
|
+
* graph:{saved, nodes},
|
|
1486
|
+
* activation:{published?, enabled?} }
|
|
1487
|
+
*
|
|
1488
|
+
* 平台事实(file:line):
|
|
1489
|
+
* - 保存只写 DRAFT 行,发布才铸 PUBLISH 版本:BusinessRuleFacadeImpl
|
|
1490
|
+
* .publishBusinessRule:337-352(updateBusinessRule 后 businessRuleService.publish
|
|
1491
|
+
* 铸新 ruleVersion)。
|
|
1492
|
+
* - 运行时门读 **DRAFT 行** enabled+status,且要求已发布版本存在:
|
|
1493
|
+
* BusinessRuleTableImpl.getExecutableBySchemaCodeAndCode:83-100(:88 !enabled 或
|
|
1494
|
+
* DISABLED → null;:91-94 无 latestPublished 行 → null)。保存≠启用≠发布。
|
|
1495
|
+
* - 应用列表面服务 DRAFT 行(BusinessRuleFacadeImpl.listViewsBySchemaCode:143-150
|
|
1496
|
+
* → listDraftBySchemaCode);runtime 列表面投影 PUBLISH 行
|
|
1497
|
+
* (BusinessRuleFacadeImpl.listLatestRulesBySchemaCode:153-156;
|
|
1498
|
+
* BusinessRuleRuntimeController.list:71-77)——两面 enabled 语义不同。
|
|
1499
|
+
* - enable 翻 DRAFT 行 status:BusinessRuleController.enable:445-465
|
|
1500
|
+
* (getBusinessRuleOfDraft + changeStatus(ENABLED);已 ENABLED 回
|
|
1501
|
+
* BUSINESS_RULE_ALREADY_ENABLED)。
|
|
1502
|
+
*/
|
|
1503
|
+
export function ruleStatusSegment(input) {
|
|
1504
|
+
return {
|
|
1505
|
+
operation: input.operation,
|
|
1506
|
+
target: { schemaCode: input.schemaCode, ruleCode: input.ruleCode, ...(input.nodeCode !== undefined ? { nodeCode: input.nodeCode } : {}) },
|
|
1507
|
+
graph: { saved: input.saved, nodes: input.nodes, ...(input.graphNote !== undefined ? { note: input.graphNote } : {}) },
|
|
1508
|
+
...(input.published !== undefined || input.enabled !== undefined
|
|
1509
|
+
? {
|
|
1510
|
+
activation: {
|
|
1511
|
+
...(input.published !== undefined ? { published: input.published } : {}),
|
|
1512
|
+
...(input.enabled !== undefined ? { enabled: input.enabled } : {}),
|
|
1513
|
+
},
|
|
1514
|
+
}
|
|
1515
|
+
: {}),
|
|
1516
|
+
};
|
|
1517
|
+
}
|
|
1518
|
+
export async function executeRuleSaveWrite(session, args, origin = { operation: "save" }) {
|
|
1479
1519
|
// 与 dry-run 同源:同一套只读门先跑,然后才写。
|
|
1480
1520
|
const { lintWarnings, lintHazards, bizMethodChecks, existing, customTriggerApplied, isPresetRule, bizRuleType, nodeJson, routeJson, schedulerField, schedulerSetting, nodes, routesSource, emptyMappings, preservedDesignerText, designerTextOverwritten, mappingFieldChecks, absentMappingFields, } = await lintRuleSaveWrite(session, args);
|
|
1481
1521
|
// r85(retro 2026-11-19):dry-run 与真写共用的回执增量(routes 沿用 / 空映射 /
|
|
@@ -1580,6 +1620,7 @@ export async function executeRuleSaveWrite(session, args) {
|
|
|
1580
1620
|
const previousRuleVersion = existing?.ruleVersion;
|
|
1581
1621
|
return {
|
|
1582
1622
|
performed: { errcode: performed.errcode, mode: existing?.id ? "update" : "create", publishRequested: true, ...(bizMethodChecks > 0 ? { bizMethodChecks } : {}) },
|
|
1623
|
+
ruleStatus: ruleStatusSegment({ operation: origin.operation, schemaCode: args.schemaCode, ruleCode: args.ruleCode, ...(origin.nodeCode !== undefined ? { nodeCode: origin.nodeCode } : {}), saved: true, nodes: nodes.length, published, enabled }),
|
|
1583
1624
|
readback: {
|
|
1584
1625
|
rulePresent: true,
|
|
1585
1626
|
published,
|
|
@@ -1623,6 +1664,7 @@ export async function executeRuleSaveWrite(session, args) {
|
|
|
1623
1664
|
const previousRuleVersion = existing?.ruleVersion;
|
|
1624
1665
|
return {
|
|
1625
1666
|
performed: { errcode: performed.errcode, mode: existing?.id ? "update" : "create", ...(bizMethodChecks > 0 ? { bizMethodChecks } : {}) },
|
|
1667
|
+
ruleStatus: ruleStatusSegment({ operation: origin.operation, schemaCode: args.schemaCode, ruleCode: args.ruleCode, ...(origin.nodeCode !== undefined ? { nodeCode: origin.nodeCode } : {}), saved: true, nodes: nodes.length, published: false, enabled }),
|
|
1626
1668
|
readback: {
|
|
1627
1669
|
rulePresent: true,
|
|
1628
1670
|
published: false,
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A5 (r89 契约层) — one unified receipt segment for every biz-service write
|
|
3
|
+
* entry: `service.register` / `service.update` / `method.create` /
|
|
4
|
+
* `method.update` / `method.delete`. The TOOLS stay separate (no merged write
|
|
5
|
+
* surface); only the "what did I just do, and what is the authoritative state"
|
|
6
|
+
* projection is shared — the same shape as `ruleStatusSegment`
|
|
7
|
+
* (rule-support.ts) does for the rule family.
|
|
8
|
+
*
|
|
9
|
+
* Every segment answers, in one place:
|
|
10
|
+
* - which operation ran and on what (service + optional method),
|
|
11
|
+
* - whether the service/method is present after the write,
|
|
12
|
+
* - whether a declared parameter face was verified against the readback.
|
|
13
|
+
* The historical `readback` keys are untouched (additive only).
|
|
14
|
+
*/
|
|
15
|
+
/** Single constructor of the `serviceStatus` top-level segment (write.ts passes it through). */
|
|
16
|
+
export function serviceStatusSegment(input) {
|
|
17
|
+
const { operation, serviceCode, methodCode, servicePresent, methodPresent, parameterFaceVerified } = input;
|
|
18
|
+
return {
|
|
19
|
+
operation,
|
|
20
|
+
target: { serviceCode, ...(methodCode !== undefined ? { methodCode } : {}) },
|
|
21
|
+
service: { present: servicePresent },
|
|
22
|
+
...(methodCode !== undefined && methodPresent !== undefined ? { method: { present: methodPresent } } : {}),
|
|
23
|
+
...(parameterFaceVerified !== undefined ? { parameterFaceVerified } : {}),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/** Parameter codes of a declared/stored parameter face (array, or a JSON string column). */
|
|
27
|
+
function parameterCodes(face) {
|
|
28
|
+
let value = face;
|
|
29
|
+
if (typeof value === "string") {
|
|
30
|
+
try {
|
|
31
|
+
value = JSON.parse(value);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (!Array.isArray(value))
|
|
38
|
+
return [];
|
|
39
|
+
return value
|
|
40
|
+
.filter((entry) => Boolean(entry && typeof entry === "object" && !Array.isArray(entry)))
|
|
41
|
+
.map((entry) => (typeof entry.code === "string" ? entry.code : ""))
|
|
42
|
+
.filter((code) => code !== "");
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Did the declared parameter face survive the write verbatim? Every declared
|
|
46
|
+
* code must appear on the stored face (extra platform-injected parameters are
|
|
47
|
+
* expected and do not fail the check). `undefined` declared face → not
|
|
48
|
+
* applicable, callers omit the flag instead of claiming a verification.
|
|
49
|
+
*/
|
|
50
|
+
export function parameterFaceCovers(stored, declared) {
|
|
51
|
+
const wanted = parameterCodes(declared);
|
|
52
|
+
if (wanted.length === 0)
|
|
53
|
+
return true;
|
|
54
|
+
const actual = new Set(parameterCodes(stored));
|
|
55
|
+
return wanted.every((code) => actual.has(code));
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=service-support.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { firstCallCommandFor, placeholderSourceFor, requiredArgs, shapeRefFor } from "./discovery.js";
|
|
2
|
+
/** 组包一份 surfaceRef;工具不在 registry 时返回 undefined(调用面零字节)。 */
|
|
3
|
+
export function surfaceRefFor(registry, toolName, options = {}) {
|
|
4
|
+
const tool = registry.find((entry) => entry.name === toolName);
|
|
5
|
+
if (tool === undefined)
|
|
6
|
+
return undefined;
|
|
7
|
+
const required = requiredArgs(tool);
|
|
8
|
+
const argsHint = required.length === 0 ? "{}" : required.join(",");
|
|
9
|
+
const firstCall = firstCallCommandFor(tool);
|
|
10
|
+
const recipe = tool.executionMetadata?.recipes?.find((entry) => entry.id === firstCall?.recipeId) ?? tool.executionMetadata?.recipes?.[0];
|
|
11
|
+
const missing = firstCall?.missing ?? [];
|
|
12
|
+
const needs = missing
|
|
13
|
+
.map((name) => ({ name, resolve: placeholderSourceFor(name) ?? "按 inputSchema 或任务要求" }))
|
|
14
|
+
.filter((need) => need.resolve !== "按 inputSchema 或任务要求" || need.name === "environment");
|
|
15
|
+
const onRefusal = (recipe?.refusalRecovery ?? [])
|
|
16
|
+
.slice(0, 3)
|
|
17
|
+
.map((entry) => ({ code: String(entry.code ?? ""), next: String(entry.action ?? "") }))
|
|
18
|
+
.filter((entry) => entry.code !== "" && entry.next !== "");
|
|
19
|
+
return {
|
|
20
|
+
recommended: { tool: tool.name, argsHint, ...(options.via !== undefined ? { via: options.via } : {}) },
|
|
21
|
+
...(options.alternatives !== undefined && options.alternatives.length > 0 ? { alternatives: options.alternatives } : {}),
|
|
22
|
+
...(firstCall !== undefined
|
|
23
|
+
? {
|
|
24
|
+
firstCall: {
|
|
25
|
+
recipeId: firstCall.recipeId,
|
|
26
|
+
...(firstCall.command !== undefined ? { command: firstCall.command } : {}),
|
|
27
|
+
...(firstCall.commandHint !== undefined ? { commandHint: firstCall.commandHint } : {}),
|
|
28
|
+
...(missing.length > 0 ? { missing } : {}),
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
: {}),
|
|
32
|
+
...(needs.length > 0 ? { needs } : {}),
|
|
33
|
+
...(shapeRefFor(tool.name) !== undefined ? { returns: shapeRefFor(tool.name) } : {}),
|
|
34
|
+
...(onRefusal.length > 0 ? { onRefusal } : {}),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=surface-ref.js.map
|
package/dist/write.js
CHANGED
|
@@ -190,7 +190,7 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
190
190
|
const artifactRef = writeArtifact(ctx, `${tool.name}-${randomUUID().slice(0, 8)}.json`, artifact);
|
|
191
191
|
return { status: executed.status, steps: executed.steps, failedStep: executed.failedStep, ...executed.envelope, ...(args.requestId ? { requestId: args.requestId } : {}), artifactFingerprint: artifactRef.detailSha256 };
|
|
192
192
|
}
|
|
193
|
-
const { performed, readback, steps, halfSuccess, irreversible, rollbackReceipt, runtimeVerification } = executed;
|
|
193
|
+
const { performed, readback, steps, halfSuccess, irreversible, rollbackReceipt, runtimeVerification, ruleStatus, serviceStatus } = executed;
|
|
194
194
|
// Readback gate (live 2026-10-17): a tool that reports `readback.present:false`
|
|
195
195
|
// has NOT proven its own write — the platform accepted the request but the
|
|
196
196
|
// object is absent from the authoritative face. "Called without error" must
|
|
@@ -207,6 +207,8 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
207
207
|
performed,
|
|
208
208
|
readback,
|
|
209
209
|
...(steps !== undefined ? { steps } : {}),
|
|
210
|
+
...(ruleStatus !== undefined ? { ruleStatus } : {}),
|
|
211
|
+
...(serviceStatus !== undefined ? { serviceStatus } : {}),
|
|
210
212
|
...(productionConfirmed ? { productionConfirmed: true } : {}),
|
|
211
213
|
...(reason !== undefined ? { reason } : {}),
|
|
212
214
|
...(tool.rollback
|
|
@@ -259,6 +261,8 @@ lintDeclaration = { lintScope: "partial", lintUnchecked: [] }) {
|
|
|
259
261
|
...(readOnlyEscapeNote !== undefined ? { readOnlyEscape: readOnlyEscapeNote } : {}),
|
|
260
262
|
performed,
|
|
261
263
|
readback,
|
|
264
|
+
...(ruleStatus !== undefined ? { ruleStatus } : {}),
|
|
265
|
+
...(serviceStatus !== undefined ? { serviceStatus } : {}),
|
|
262
266
|
...(readbackWarning ? { readbackWarning } : {}),
|
|
263
267
|
...(steps !== undefined ? { steps } : {}),
|
|
264
268
|
...(halfSuccess !== undefined ? { halfSuccess } : {}),
|
package/docs/omc-introduction.md
CHANGED
|
@@ -528,6 +528,7 @@ omc intent readback intent.yaml --env test # 解码回 intent 形状做等价
|
|
|
528
528
|
```
|
|
529
529
|
|
|
530
530
|
- 顶层 `models[]` / `services[]`;`models[].{code,name,fields,datarules,rules,form,listview,workflow,onlinejs}`。
|
|
531
|
+
- 业务集成:`services[].method`(单方法,name 必须等于 code,随 `service.register`)与 `services[].methods[]`(多方法,name 可不同于 code;缺失方法 plan `method.create`、漂移 plan `method.update`,给既有服务加方法也用这里)互斥。
|
|
531
532
|
- `intent apply` 既可以吃 `plan` 文件,也可以直接吃 YAML(`omc intent apply intent.yaml --env <env>`,自动编译);大 plan 会自动外置,回 `planFile`。
|
|
532
533
|
- **幂等收敛**:已达标环境重跑 plan/apply → 零变更、零重复创建。
|
|
533
534
|
- 显式缺席(删除):`models[].absent:true` 删整模型、`fields[].absent:true` 删单字段、`listview.absent:true` 删列表视图、`datarules[].absent:true` 删数据规则;plan 的 `riskClass` 升为 `destructive`,`cleanup` 逐项列出。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.87",
|
|
4
4
|
"description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"commander": "14.0.3",
|
|
59
|
-
"omc-core": "0.6.
|
|
59
|
+
"omc-core": "0.6.87",
|
|
60
60
|
"proper-lockfile": "4.1.2",
|
|
61
61
|
"write-file-atomic": "6.0.0",
|
|
62
62
|
"zod": "^3.23.8",
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
"directory": "packages/omc-cli"
|
|
75
75
|
},
|
|
76
76
|
"optionalDependencies": {
|
|
77
|
-
"@stalfh233/omc-fake-platform": "0.6.
|
|
77
|
+
"@stalfh233/omc-fake-platform": "0.6.87"
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -192,6 +192,7 @@ only the section for the capability you need —
|
|
|
192
192
|
- **能做哪些事**:业务服务与方法注册(RESTFUL/DATA_SQL/DATA_TABLE/SAP/KAFKA/SOAP)、服务清单(按分类/关键词,凭据不回显)、方法增改删、分类/连接池、导入导出、设计器测试、调用日志(`h_log_biz_service`:params/result/状态/耗时,按单据/服务/方法/时间窗查,无过滤 fail-closed)。
|
|
193
193
|
- **工具**:`service.list`、`service.get`、`method.list`、`method.get`、`method.update`、`method.create`、`method.delete`、`service.category.list`、`service.category.create`、`service.category.update`、`service.category.delete`、`service.dbconnpool.list`、`service.dbconnpool.create`、`service.dbconnpool.update`、`service.dbconnpool.delete`、`service.adapter_config`、`service.table_list`、`service.table_sql`、`service.register`、`service.update`、`service.delete`、`service.export`、`service.check`、`service.import`、`method.test`、`servicelog.search`
|
|
194
194
|
- **recipe**:`omc describe service.register --example restful-query-service`
|
|
195
|
+
- **intent**:`services[].method`(单方法,name==code)与 `services[].methods[]`(多方法,name 可不同于 code)互斥;`methods[]` 对缺失方法 plan `method.create`、漂移 plan `method.update`,因此给既有服务加方法无需 escape hatch。删除:`services[].absent:true`(只认 code;平台级联删方法,plan 只发 `service.delete`;服务仍被规则映射引用 → plan 硬拒 `intent-service-referenced`,先解绑规则再删)与 `method(s)[].absent:true`(平台被引用回 500108,plan 给 `method-referenced` warning,带 ruleCode/nodeCode 引用点)。
|
|
195
196
|
- **边界 / 陷阱**:方法 `configJson` 走 AES-128-ECB;**二开接口 = 扩展模块写 REST 接口 + RESTFUL 服务指向它**(页面/规则引用);RESTFUL/DATA_SQL 绑定前须带适配器必需配置(否则是注册壳)。排查「规则到底传了什么参数给接口」用 `servicelog.search`(`bizObjectId`/`schemaCode` 是客户端匹配,`code`/`methodName` 为 LIKE 包含、逗号=精确 IN;params 平台入库上限 2000 字符)。
|
|
196
197
|
|
|
197
198
|
## 报表 `report`
|