@stalfh233/omc-cli 0.6.86 → 0.6.88
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/batch-executor.js +236 -0
- package/dist/capability-overview.js +2 -2
- package/dist/cli.js +65 -14
- 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 +368 -58
- package/dist/intent/compiler.js +11 -5
- 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-contract.js +2 -2
- package/dist/lanes/businessrule.js +167 -10
- package/dist/lanes/config-diff.js +9 -0
- package/dist/lanes/rule-lifecycle.js +37 -4
- package/dist/lanes/runtime-data-contract.js +6 -1
- package/dist/lanes/runtime-data.js +375 -121
- package/dist/lanes/runtime-paging.js +100 -0
- package/dist/package.js +8 -2
- package/dist/path-projection.js +120 -37
- package/dist/read-shapes.js +55 -10
- 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/tool-types.js +5 -0
- package/dist/write.js +5 -1
- package/package.json +3 -3
- package/skills/omc-capabilities.md +1 -1
- package/skills/omc-refusals.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/path-projection.js
CHANGED
|
@@ -239,16 +239,16 @@ export function projectJsonPathFanout(value, path) {
|
|
|
239
239
|
if (marker < 0) {
|
|
240
240
|
const projected = projectJsonPath(value, path);
|
|
241
241
|
return projected.missed
|
|
242
|
-
? { values: [], missed: true, ...(projected.at !== undefined ? { at: projected.at } : {}), ...(projected.available !== undefined ? { available: projected.available } : {}), ...(projected.availableAll !== undefined ? { availableAll: projected.availableAll } : {}), ...(projected.availableTruncated !== undefined ? { availableTruncated: projected.availableTruncated } : {}), missedEntries: 0, nullEntries: 0 }
|
|
243
|
-
: { values: [projected.value], missed: false, missedEntries: 0, nullEntries: projected.value === null ? 1 : 0 };
|
|
242
|
+
? { values: [], missed: true, ...(projected.at !== undefined ? { at: projected.at } : {}), ...(projected.available !== undefined ? { available: projected.available } : {}), ...(projected.availableAll !== undefined ? { availableAll: projected.availableAll } : {}), ...(projected.availableTruncated !== undefined ? { availableTruncated: projected.availableTruncated } : {}), missedEntries: 0, nullEntries: 0, nonNullEntries: 0 }
|
|
243
|
+
: { values: [projected.value], missed: false, missedEntries: 0, nullEntries: projected.value === null ? 1 : 0, nonNullEntries: projected.value === null ? 0 : 1 };
|
|
244
244
|
}
|
|
245
245
|
const before = path.slice(0, marker);
|
|
246
246
|
const after = path.slice(marker + 2).replace(/^[./]+/, "");
|
|
247
247
|
const base = projectJsonPath(value, before);
|
|
248
248
|
if (base.missed)
|
|
249
|
-
return { values: [], missed: true, ...(base.at !== undefined ? { at: base.at } : {}), ...(base.available !== undefined ? { available: base.available } : {}), ...(base.availableAll !== undefined ? { availableAll: base.availableAll } : {}), ...(base.availableTruncated !== undefined ? { availableTruncated: base.availableTruncated } : {}), missedEntries: 0, nullEntries: 0 };
|
|
249
|
+
return { values: [], missed: true, ...(base.at !== undefined ? { at: base.at } : {}), ...(base.available !== undefined ? { available: base.available } : {}), ...(base.availableAll !== undefined ? { availableAll: base.availableAll } : {}), ...(base.availableTruncated !== undefined ? { availableTruncated: base.availableTruncated } : {}), missedEntries: 0, nullEntries: 0, nonNullEntries: 0 };
|
|
250
250
|
if (!Array.isArray(base.value))
|
|
251
|
-
return { values: [], missed: true, at: before || "$", available: `该层不是数组(是 ${base.value === null ? "null" : typeof base.value});[] 只能映射数组,如 items[].fields.planNo`, missedEntries: 0, nullEntries: 0 };
|
|
251
|
+
return { values: [], missed: true, at: before || "$", available: `该层不是数组(是 ${base.value === null ? "null" : typeof base.value});[] 只能映射数组,如 items[].fields.planNo`, missedEntries: 0, nullEntries: 0, nonNullEntries: 0 };
|
|
252
252
|
const values = [];
|
|
253
253
|
let missedEntries = 0;
|
|
254
254
|
let nullEntries = 0;
|
|
@@ -263,9 +263,9 @@ export function projectJsonPathFanout(value, path) {
|
|
|
263
263
|
// array) — report the miss so the caller does not read an empty list as data.
|
|
264
264
|
if (values.length === 0 && missedEntries > 0) {
|
|
265
265
|
const first = projectJsonPathFanout(base.value[0], after);
|
|
266
|
-
return { values: [], missed: true, ...(first.at !== undefined ? { at: `${before}[].${first.at}` } : {}), ...(first.available !== undefined ? { available: first.available } : {}), ...(first.availableAll !== undefined ? { availableAll: first.availableAll } : {}), ...(first.availableTruncated !== undefined ? { availableTruncated: first.availableTruncated } : {}), missedEntries, nullEntries: 0 };
|
|
266
|
+
return { values: [], missed: true, ...(first.at !== undefined ? { at: `${before}[].${first.at}` } : {}), ...(first.available !== undefined ? { available: first.available } : {}), ...(first.availableAll !== undefined ? { availableAll: first.availableAll } : {}), ...(first.availableTruncated !== undefined ? { availableTruncated: first.availableTruncated } : {}), missedEntries, nullEntries: 0, nonNullEntries: 0 };
|
|
267
267
|
}
|
|
268
|
-
return { values, missed: false, ...(missedEntries > 0 ? { missedEntries } : { missedEntries: 0 }), nullEntries };
|
|
268
|
+
return { values, missed: false, ...(missedEntries > 0 ? { missedEntries } : { missedEntries: 0 }), nullEntries, nonNullEntries: values.length - nullEntries };
|
|
269
269
|
}
|
|
270
270
|
/** Collect every value of a repeatable flag (`--extract a --extract b`). */
|
|
271
271
|
function argvValues(args, name) {
|
|
@@ -284,9 +284,13 @@ function argvValues(args, name) {
|
|
|
284
284
|
* (`projectResultExtract` 的 miss、`artifact get --summary --jq`、artifact 裸
|
|
285
285
|
* `--jq`、逗号多路径部分 miss、以及 `artifact get` 的 fetch 提示),改一处忘一处
|
|
286
286
|
* 就会出现"同一个错误两种说法"。现在语法句子只在这里定义,其余地方拼装。
|
|
287
|
+
*
|
|
288
|
+
* F1(retro 22,ticket 138):语法长句**不再内联**进任何 miss 回执——一次
|
|
289
|
+
* pathMiss 曾带 766–870B 教程、一个会话 6+ 次吃掉几 KB 上下文。回执只给
|
|
290
|
+
* `helpRef`(机器可读指针)+ ≤200B 的行动句;完整教程读 help 的权威一节。
|
|
287
291
|
*/
|
|
288
292
|
export const JQ_PATH_SYNTAX = "可用写法:点式 a.b、下标 a[0]、切片 a[0:6]、数组映射 items[].fields.x、按键选择 rules[code=Create] 或 data.activities[code=A1](数组与 index→条目对象都支持;键名可省 activityCode/nodeCode 等别名;返回第一个匹配项)。";
|
|
289
|
-
/** 非 jq 语言 +
|
|
293
|
+
/** 非 jq 语言 + 一次取多列的写法。只在 help 教程里出现,不进回执。 */
|
|
290
294
|
export const JQ_PATH_RULES = "注意:本参数是路径选择器、不是 jq 语言(不支持 | 管道与对象构造);一次取多列用逗号分隔(--jq \"a.b,c.d\")或重复传 --jq。";
|
|
291
295
|
/**
|
|
292
296
|
* `call --extract/--jq` 专有的位置语义:路径相对 **result**,不是整个信封。
|
|
@@ -299,30 +303,37 @@ export const RESULT_RELATIVE_PATH_NOTE = "路径相对 **result**(不要写 re
|
|
|
299
303
|
export const JQ_PATH_TOPIC = "omc-refusals";
|
|
300
304
|
export const JQ_PATH_SECTION = "10. 投影路径(--jq / --extract)";
|
|
301
305
|
export const JQ_PATH_HELP_POINTER = `语法详解:omc help ${JQ_PATH_TOPIC} --section 10(投影路径)。`;
|
|
306
|
+
/**
|
|
307
|
+
* F1(retro 22,ticket 138):miss 回执的**机器可读**教程指针。回执不再内联
|
|
308
|
+
* 766B+ 的语法长句(一次会话 6+ 次 miss 就是几 KB 噪声);要看教程的人/agent
|
|
309
|
+
* 按这个字段取 help 的权威一节。值为可直接执行的命令字符串。
|
|
310
|
+
*/
|
|
311
|
+
export const PATH_MISS_HELP_REF = `omc help ${JQ_PATH_TOPIC} --section 10`;
|
|
302
312
|
/** Shared wording for every projection miss, so every face teaches the same syntax. */
|
|
303
313
|
// r66 ① readbackKeys(c-F2):R65 探针 3 次投影 miss 全靠 available 救回——键名
|
|
304
314
|
// 无处可查。裸 --jq(不带路径)= 键清单这个姿势一直在(cli.ts extractKeys 分支),
|
|
305
315
|
// 但没有任何一面教过它。miss 正是教学时机:撞过一次的人最听得进「先看全键再投影」。
|
|
306
316
|
// r67-03(触达失败复检):R67 探针 4 次 pathMiss 无一注意这句教学——它此前被夹在
|
|
307
|
-
// 语法长句(JQ_PATH_SYNTAX
|
|
308
|
-
//
|
|
309
|
-
//
|
|
310
|
-
export const PATH_MISS_HINT =
|
|
317
|
+
// 语法长句(JQ_PATH_SYNTAX)之后的中段。行动句排在最前。
|
|
318
|
+
// F1(retro 22,ticket 138):压到 ≤200B——结论 + available 判读 + 一条下一步 +
|
|
319
|
+
// helpRef 指针,语法全集只在 help(旧版 766B → 新版 ≤200B,测试钉死上限)。
|
|
320
|
+
export const PATH_MISS_HINT = `路径未命中。available 是该层真实存在的键;下一步先列键:--jq 不带路径重跑 = 全部顶层键一览。语法教程:${PATH_MISS_HELP_REF}。`;
|
|
311
321
|
/**
|
|
312
322
|
* `artifact get` 面:产物内容的投影。区别只在开头——它已经把 miss 落在哪一段
|
|
313
323
|
* (`missedAt`)和可用的键/范围一并返回,所以不必重复「这一层没有该段」。
|
|
324
|
+
* F1(retro 22):语法长句不内联,压成 定位 + 可复制路径 + --keys 教学 + helpRef。
|
|
314
325
|
*/
|
|
315
326
|
export function artifactPathMissHint(at, copyable) {
|
|
316
327
|
const lead = `路径未命中${at !== undefined ? `段 "${at}"` : "(这一层没有该段)"}`;
|
|
317
328
|
// issue 19:命中同名键时先给可整段复制的完整路径(相对产物正文)。
|
|
318
329
|
if (copyable !== undefined) {
|
|
319
|
-
return `${lead}。${copyable}。想一次拿全部顶层键:--keys(或裸 --jq
|
|
330
|
+
return `${lead}。${copyable}。想一次拿全部顶层键:--keys(或裸 --jq)。语法教程:${PATH_MISS_HELP_REF}。`;
|
|
320
331
|
}
|
|
321
|
-
return `${lead}——available
|
|
332
|
+
return `${lead}——available 是该层真实存在的键/范围;想一次拿全部顶层键:--keys(或裸 --jq)。语法教程:${PATH_MISS_HELP_REF}。`;
|
|
322
333
|
}
|
|
323
|
-
/** 逗号多路径里只有部分 miss:给出定位方式 +
|
|
334
|
+
/** 逗号多路径里只有部分 miss:给出定位方式 + helpRef(语法长句不内联)。 */
|
|
324
335
|
export function partialPathMissHint() {
|
|
325
|
-
return `逗号多路径中部分路径未命中(见各 projection.pathMiss/missedAt/available
|
|
336
|
+
return `逗号多路径中部分路径未命中(见各 projection.pathMiss/missedAt/available)。语法教程:${PATH_MISS_HELP_REF}。`;
|
|
326
337
|
}
|
|
327
338
|
/**
|
|
328
339
|
* 逐条 miss 的**短**提示。r27 真机(2026-11-05)实证:一段 695 B 的完整语法在
|
|
@@ -481,12 +492,53 @@ export function pathMissCopyableHint(source, path, at, limit = 3) {
|
|
|
481
492
|
return `这段的完整路径是 ${shown[0]}——可直接复制:${quoted}`;
|
|
482
493
|
return `这段有多个位置——可直接复制其一:${quoted}`;
|
|
483
494
|
}
|
|
495
|
+
const CROSS_FACE_LOAD_REASON = "data.load 平铺在 data.<code>,不套 fields";
|
|
496
|
+
const CROSS_FACE_LIST_REASON = "data.list 列在 items[].fields.<code>";
|
|
497
|
+
export function pathMissCrossFaceCorrection(source, path, at) {
|
|
498
|
+
if (at === undefined || at.length === 0)
|
|
499
|
+
return undefined;
|
|
500
|
+
const clean = path.replace(/^\$\.?/, "").replace(/^[.\/]+/, "");
|
|
501
|
+
// 只处理「首段就 miss」的 retro 21 形态(fields.x / data.x 写到对面根上);
|
|
502
|
+
// 更深层的 miss 由 didYouMean/同名键扫描接手。
|
|
503
|
+
const headMatch = /^([A-Za-z_][\w]*)((?:[.\[\/]).*)?$/.exec(clean);
|
|
504
|
+
if (headMatch === null)
|
|
505
|
+
return undefined;
|
|
506
|
+
const head = headMatch[1];
|
|
507
|
+
if (head !== at)
|
|
508
|
+
return undefined;
|
|
509
|
+
const rest = headMatch[2] ?? "";
|
|
510
|
+
if (head === "fields") {
|
|
511
|
+
const candidate = `data${rest}`;
|
|
512
|
+
if (copyableCandidateResolves(source, candidate))
|
|
513
|
+
return { correctPath: candidate, reason: CROSS_FACE_LOAD_REASON };
|
|
514
|
+
}
|
|
515
|
+
if (head === "data") {
|
|
516
|
+
const candidate = `items[].fields${rest}`;
|
|
517
|
+
if (copyableCandidateResolves(source, candidate))
|
|
518
|
+
return { correctPath: candidate, reason: CROSS_FACE_LIST_REASON };
|
|
519
|
+
}
|
|
520
|
+
return undefined;
|
|
521
|
+
}
|
|
522
|
+
const RETRY_ARGS_MAX_BYTES = 500;
|
|
523
|
+
const shellQuote = (value) => `'${value.replace(/'/g, "'\\''")}'`;
|
|
524
|
+
export function projectionRetryCommand(context, path) {
|
|
525
|
+
if (context === undefined || context.tool === undefined || context.tool.length === 0)
|
|
526
|
+
return undefined;
|
|
527
|
+
if (context.argsJson !== undefined && Buffer.byteLength(context.argsJson, "utf8") > RETRY_ARGS_MAX_BYTES)
|
|
528
|
+
return undefined;
|
|
529
|
+
return [
|
|
530
|
+
`omc call ${context.tool}`,
|
|
531
|
+
...(context.environment !== undefined && context.environment.length > 0 ? [`--env ${context.environment}`] : []),
|
|
532
|
+
...(context.argsJson !== undefined ? [`--args ${shellQuote(context.argsJson)}`] : []),
|
|
533
|
+
`--jq ${shellQuote(path)}`,
|
|
534
|
+
].join(" ");
|
|
535
|
+
}
|
|
484
536
|
/**
|
|
485
|
-
*
|
|
486
|
-
*
|
|
537
|
+
* 多路径一次投影时的**唯一一份**顶层说明。只给位置语义 + helpRef——
|
|
538
|
+
* F1(retro 22):语法长句不内联(教程只在 help)。
|
|
487
539
|
*/
|
|
488
540
|
export function multiPathMissHint() {
|
|
489
|
-
return `${RESULT_RELATIVE_PATH_NOTE}
|
|
541
|
+
return `${RESULT_RELATIVE_PATH_NOTE}语法教程:${PATH_MISS_HELP_REF}。`;
|
|
490
542
|
}
|
|
491
543
|
/**
|
|
492
544
|
* T6(GitLab #17):`mapped` 只是"路径命中的条目数",值为 null 也算命中。
|
|
@@ -651,7 +703,7 @@ function projectPathOnSource(source, path) {
|
|
|
651
703
|
}
|
|
652
704
|
return { ...first };
|
|
653
705
|
}
|
|
654
|
-
export function projectResultExtract(result, paths, keysOnly) {
|
|
706
|
+
export function projectResultExtract(result, paths, keysOnly, retry) {
|
|
655
707
|
const artifactId = typeof result.detailArtifactId === "string" ? result.detailArtifactId : typeof result.artifactId === "string" ? result.artifactId : undefined;
|
|
656
708
|
// Tools hand an in-process artifact as `detailFile` (a local path);
|
|
657
709
|
// command-transport later swaps it for detailArtifactId. Extraction runs
|
|
@@ -723,10 +775,18 @@ export function projectResultExtract(result, paths, keysOnly) {
|
|
|
723
775
|
// r27 真机:多路径时每条 miss 都带 695 B 完整语法 → 3 条 2 KB 说同一件事。
|
|
724
776
|
// 单路径照旧带完整提示(只出现一次,最有用);多路径逐条只给定位,语法放顶层一次。
|
|
725
777
|
const multiPath = paths.length > 1;
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
778
|
+
/**
|
|
779
|
+
* F1(retro 22,ticket 138):miss 的**结论优先**。能推导出已验证的正确路径就
|
|
780
|
+
* 给 `correctPath`(机器字段)+ 首行人话;推导不出才落回 PATH_MISS_HINT。
|
|
781
|
+
* 候选按优先级:①拼写近似(didYouMean,改写后必须真的可解析)②跨面形状
|
|
782
|
+
* 改写(fields↔data,retro 21)③真实结果树里的同名键(issue 19)。
|
|
783
|
+
* 三者都在**真实结果树**上验证过才返回——绝不编造可达路径。
|
|
784
|
+
*/
|
|
785
|
+
const missCorrectionFor = (path, at, available, availableAll) => {
|
|
786
|
+
if (at === undefined)
|
|
787
|
+
return undefined;
|
|
788
|
+
const didYouMean = pathMissDidYouMean(at, available, availableAll);
|
|
789
|
+
if (didYouMean !== undefined) {
|
|
730
790
|
// Replace only the missed segment, retaining array mapping and suffixes.
|
|
731
791
|
const leaf = at.split(/[./\[]/).filter(Boolean).pop();
|
|
732
792
|
if (leaf !== undefined) {
|
|
@@ -736,22 +796,32 @@ export function projectResultExtract(result, paths, keysOnly) {
|
|
|
736
796
|
if (replaced || segment !== leaf || (at !== leaf && prefix !== at))
|
|
737
797
|
return segment;
|
|
738
798
|
replaced = true;
|
|
739
|
-
return
|
|
799
|
+
return didYouMean;
|
|
740
800
|
});
|
|
741
801
|
// A similar key is useful only if the complete proposed path resolves.
|
|
742
802
|
if (corrected !== path && !projectPathOnSource(projectionSource, corrected).projected.missed) {
|
|
743
|
-
|
|
744
|
-
return `路径未命中:在 "${at}" 断开;最接近的是 ${candidate}。可试:--jq '${quoted}'`;
|
|
803
|
+
return { correctPath: corrected };
|
|
745
804
|
}
|
|
746
805
|
}
|
|
747
806
|
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
807
|
+
const crossFace = pathMissCrossFaceCorrection(projectionSource, path, at);
|
|
808
|
+
if (crossFace !== undefined)
|
|
809
|
+
return crossFace;
|
|
810
|
+
const copyable = pathMissCopyablePaths(projectionSource, path, at, 3);
|
|
811
|
+
if (copyable.length === 1)
|
|
812
|
+
return { correctPath: copyable[0] };
|
|
813
|
+
if (copyable.length > 1) {
|
|
814
|
+
return { correctPath: copyable[0], reason: `同名键另有 ${copyable.length - 1} 处:${copyable.slice(1).join("、")}` };
|
|
815
|
+
}
|
|
816
|
+
return undefined;
|
|
817
|
+
};
|
|
818
|
+
const missHintFor = (at, available, correction) => {
|
|
819
|
+
if (correction !== undefined) {
|
|
820
|
+
const quoted = correction.correctPath.replace(/'/g, "'\\''");
|
|
821
|
+
const lead = `正确路径:${correction.correctPath}${correction.reason !== undefined ? `(${correction.reason})` : ""}——可直接复制:--jq '${quoted}'。语法教程:${PATH_MISS_HELP_REF}。`;
|
|
822
|
+
return multiPath ? `${lead}${pathMissEntryHint(at, available)}` : lead;
|
|
753
823
|
}
|
|
754
|
-
return
|
|
824
|
+
return multiPath ? pathMissEntryHint(at, available) : PATH_MISS_HINT;
|
|
755
825
|
};
|
|
756
826
|
out.extract = paths.map((path) => {
|
|
757
827
|
// r28f F2:对象构造 / 函数调用不是 pathMiss——先识别,别伪装成键缺失。
|
|
@@ -777,6 +847,8 @@ export function projectResultExtract(result, paths, keysOnly) {
|
|
|
777
847
|
const fan = projected;
|
|
778
848
|
if (fan.missed) {
|
|
779
849
|
const didYouMean = pathMissDidYouMean(fan.at, fan.available, fan.availableAll);
|
|
850
|
+
const correction = missCorrectionFor(path, fan.at, fan.available, fan.availableAll);
|
|
851
|
+
const nextCommand = correction !== undefined ? projectionRetryCommand(retry, correction.correctPath) : undefined;
|
|
780
852
|
return {
|
|
781
853
|
path,
|
|
782
854
|
content: null,
|
|
@@ -786,14 +858,18 @@ export function projectResultExtract(result, paths, keysOnly) {
|
|
|
786
858
|
...(fan.availableTruncated !== undefined ? { availableTruncated: fan.availableTruncated } : {}),
|
|
787
859
|
missedEntries: fan.missedEntries,
|
|
788
860
|
...(didYouMean !== undefined ? { didYouMean } : {}),
|
|
861
|
+
...(correction !== undefined ? { correctPath: correction.correctPath } : {}),
|
|
862
|
+
helpRef: PATH_MISS_HELP_REF,
|
|
863
|
+
...(nextCommand !== undefined ? { nextCommand } : {}),
|
|
789
864
|
...(readFromArtifact ? resultLayerNote(result, path, projectionSource, fan.at) ?? {} : {}),
|
|
790
|
-
hint: missHintFor(
|
|
865
|
+
hint: missHintFor(fan.at, fan.available, correction),
|
|
791
866
|
};
|
|
792
867
|
}
|
|
793
868
|
return {
|
|
794
869
|
path,
|
|
795
870
|
content: fan.values,
|
|
796
871
|
mapped: fan.values.length,
|
|
872
|
+
nonNullEntries: fan.nonNullEntries,
|
|
797
873
|
...(autoStripped !== undefined ? { autoStripped } : {}),
|
|
798
874
|
...(preferResult ? { from: "result" } : {}),
|
|
799
875
|
...(fan.nullEntries > 0 ? { nullEntries: fan.nullEntries } : {}),
|
|
@@ -815,6 +891,8 @@ export function projectResultExtract(result, paths, keysOnly) {
|
|
|
815
891
|
};
|
|
816
892
|
}
|
|
817
893
|
const didYouMean = pathMissDidYouMean(single.at, single.available, single.availableAll);
|
|
894
|
+
const correction = missCorrectionFor(path, single.at, single.available, single.availableAll);
|
|
895
|
+
const nextCommand = correction !== undefined ? projectionRetryCommand(retry, correction.correctPath) : undefined;
|
|
818
896
|
return {
|
|
819
897
|
path,
|
|
820
898
|
content: null,
|
|
@@ -823,8 +901,11 @@ export function projectResultExtract(result, paths, keysOnly) {
|
|
|
823
901
|
available: single.available,
|
|
824
902
|
...(single.availableTruncated !== undefined ? { availableTruncated: single.availableTruncated } : {}),
|
|
825
903
|
...(didYouMean !== undefined ? { didYouMean } : {}),
|
|
904
|
+
...(correction !== undefined ? { correctPath: correction.correctPath } : {}),
|
|
905
|
+
helpRef: PATH_MISS_HELP_REF,
|
|
906
|
+
...(nextCommand !== undefined ? { nextCommand } : {}),
|
|
826
907
|
...(readFromArtifact ? resultLayerNote(result, path, projectionSource, single.at) ?? {} : {}),
|
|
827
|
-
hint: missHintFor(
|
|
908
|
+
hint: missHintFor(single.at, single.available, correction),
|
|
828
909
|
};
|
|
829
910
|
}
|
|
830
911
|
return {
|
|
@@ -873,19 +954,21 @@ export function projectResultExtract(result, paths, keysOnly) {
|
|
|
873
954
|
// change the exit contract), but the envelope now says so out loud.
|
|
874
955
|
if (extracts.some((entry) => entry.pathMiss === true || entry.unsupportedSyntax === true)) {
|
|
875
956
|
out.unanswered = true;
|
|
876
|
-
//
|
|
957
|
+
// 多路径:说明给一次,不再逐条复制。不支持语法优先于 pathMiss 说明。
|
|
958
|
+
// F1(retro 22):语法长句不内联——顶层只留位置语义 + helpRef。
|
|
877
959
|
if (extracts.some((entry) => entry.unsupportedSyntax === true)) {
|
|
878
960
|
out.hint = UNSUPPORTED_JQ_OBJECT_HINT;
|
|
879
961
|
}
|
|
880
962
|
else if (multiPath) {
|
|
881
|
-
out.
|
|
963
|
+
out.helpRef = PATH_MISS_HELP_REF;
|
|
964
|
+
out.hint = `${RESULT_RELATIVE_PATH_NOTE}逐条定位见 extract[](或 rows[] 列对齐);语法教程:${PATH_MISS_HELP_REF}。`;
|
|
882
965
|
}
|
|
883
966
|
}
|
|
884
967
|
}
|
|
885
968
|
return out;
|
|
886
969
|
}
|
|
887
970
|
const SINGLE_PATH_META_KEYS = ["from", "artifactId", "sha256", "truncated", "truncatedKeys", "itemsCount", "total", "projectionHint"];
|
|
888
|
-
const SINGLE_PATH_ENTRY_META_KEYS = ["mapped", "nullEntries", "missedEntries", "from", "autoStripped", "hint"];
|
|
971
|
+
const SINGLE_PATH_ENTRY_META_KEYS = ["mapped", "nullEntries", "nonNullEntries", "missedEntries", "from", "autoStripped", "hint"];
|
|
889
972
|
export function unwrapSinglePathProjection(projected) {
|
|
890
973
|
const extracts = projected.extract;
|
|
891
974
|
if (!Array.isArray(extracts) || extracts.length !== 1)
|
package/dist/read-shapes.js
CHANGED
|
@@ -42,6 +42,19 @@ const READ_SHAPES = {
|
|
|
42
42
|
},
|
|
43
43
|
"data.list": {
|
|
44
44
|
// items are {id, fields:{<code>: value}} — business columns live under fields.
|
|
45
|
+
// F2(retro 21,ticket 138)locator:同一行业务列在 data.list 是 items[].fields.<code>,
|
|
46
|
+
// 在 data.load 是平铺 data.<code>;行标识在 data.load 的入参叫 bizObjectId。
|
|
47
|
+
// rides resultMeta.locator(信封侧),result 本体与 --jq 路径零改动。
|
|
48
|
+
// 平台证据:列 code 两面同名(list 行本体 BizObjectModel.data.<code>,CLI 包装成
|
|
49
|
+
// fields;load 面 FormDataVO.bizObject.data.<code> 平铺,见 path-projection.ts
|
|
50
|
+
// pathMissCrossFaceCorrection 注释的 file:line)。
|
|
51
|
+
locator: {
|
|
52
|
+
rowIdKey: "items[].id",
|
|
53
|
+
rowIdArg: "bizObjectId",
|
|
54
|
+
columnKey: "items[].fields.<code>",
|
|
55
|
+
peerTool: "data.load",
|
|
56
|
+
peerColumnKey: "data.<code>",
|
|
57
|
+
},
|
|
45
58
|
keys: ["items:array<{id,fields:{<code>:value}}>", "total", "totalPages", "page", "size"],
|
|
46
59
|
// r28i F4: agents try rows[] / items[].sku first; pin the real shape here too.
|
|
47
60
|
notes: [
|
|
@@ -69,12 +82,28 @@ const READ_SHAPES = {
|
|
|
69
82
|
notes: ["page.parentId 常为 null(/custom/get 不回 AppFunction 父节点);看 parentIdNote,落点用 folder.tree 按 code 核对"],
|
|
70
83
|
},
|
|
71
84
|
"data.load": {
|
|
85
|
+
// F2(retro 21,ticket 138)locator:本面业务列平铺在 data.<code>(不套 fields),
|
|
86
|
+
// 与 data.list 的 items[].fields.<code> 是同一事实两种包装;行定位入参 bizObjectId
|
|
87
|
+
// = data.list 的 items[].id。rides resultMeta.locator,result 本体零改动。
|
|
88
|
+
// 平台证据:FormRuntimeController.java:364-365(GET /api/runtime/form/load →
|
|
89
|
+
// FormDataVO)+ FormDataVO.java:27,62(bizObject.data 平铺业务列;CLI
|
|
90
|
+
// normalizeLoadedRecord 只解开 bizObject 包装,键名原样)。
|
|
91
|
+
locator: {
|
|
92
|
+
rowIdArg: "bizObjectId",
|
|
93
|
+
columnKey: "data.<code>",
|
|
94
|
+
peerTool: "data.list",
|
|
95
|
+
peerColumnKey: "items[].fields.<code>",
|
|
96
|
+
peerRowIdKey: "items[].id",
|
|
97
|
+
},
|
|
72
98
|
keys: ["bizObjectId", "exists", "data:{...}"],
|
|
99
|
+
// A1(同义事实对照):同一行业务列在两面包装不同——列表面套 fields,本面平铺。
|
|
100
|
+
// 平台证据:行本体是 FormDataVO.data(GET /runtime/form_data/get_by_id 平铺业务列)。
|
|
101
|
+
notes: ["业务列在 data.<code>(平铺,不套 fields);列表面 data.list 同一行是 items[].fields.<code>——跨面对照别拿错包装键"],
|
|
73
102
|
},
|
|
74
103
|
// r80:计数/分组统计的读回面。notes 只显首条——把陷阱并进第一句。
|
|
75
104
|
"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,concurrency?}", "capNotice?", "note?", "environmentFingerprint"],
|
|
77
|
-
notes: ["计数用 total
|
|
105
|
+
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"],
|
|
106
|
+
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
107
|
},
|
|
79
108
|
"app.list": {
|
|
80
109
|
keys: ["applications:array<{code,name,groupId?,modelCount}>", "applicationsCount", "omitted"],
|
|
@@ -92,11 +121,11 @@ const READ_SHAPES = {
|
|
|
92
121
|
"model.inspect": {
|
|
93
122
|
// Slim/compact face (window diet): field inventory is `fieldCodes`, not fields[].
|
|
94
123
|
keys: ["schemaCode", "applicationCode", "fieldCodes", "form", "listview", "ruleCodes", "datarules", "workflow", "hint"],
|
|
95
|
-
notes: ["slim
|
|
124
|
+
notes: ["slim 面字段清单=fieldCodes:array<string>(只有 code 清单);字段名/类型的行明细在 field.list.fields[].code——同一事实两面,别在 fieldCodes 里找 name;all:true 时 fields/artifact 行含 options"],
|
|
96
125
|
},
|
|
97
126
|
"field.list": {
|
|
98
127
|
keys: ["fields:array<{code,name,type,...}>", "modelPresent?"],
|
|
99
|
-
notes: ["模型不存在时平台可能 refused(300004);存在性判据优先 model.inspect.modelPresent / rule.list.modelPresent"],
|
|
128
|
+
notes: ["字段行键=fields[].code(带 name/type 明细);model.inspect 的 fieldCodes 是同一清单的纯 code 投影——跨面对照别拿错键", "模型不存在时平台可能 refused(300004);存在性判据优先 model.inspect.modelPresent / rule.list.modelPresent"],
|
|
100
129
|
},
|
|
101
130
|
"workitem.list": {
|
|
102
131
|
// Flat rows — no fields bag. Wire id is projected as workItemId.
|
|
@@ -128,16 +157,21 @@ const READ_SHAPES = {
|
|
|
128
157
|
notes: ["无流程的模型 workflowCode:null + exists:false(不是错误);平台无流程清单端点,本面按模型索引(流程-模型一对一惯例,workflowCode 常为 <模型code>_flow)", "ruleBindingCount = flow 级 handler + 节点级事件 + SYSTEM_ACTIVITY 顶层绑定的规则码总数(比 get_published 摘要里的同名键多算节点级)"],
|
|
129
158
|
},
|
|
130
159
|
"workflow.get_published": {
|
|
160
|
+
// A2 locator:模板摘要 activities[].code ↔ 实例/待办 activityCode(Activity.java:26-30
|
|
161
|
+
// 存储面原生键就是 activityCode/activityType/activityName;code/name/type 是摘要投影)。
|
|
162
|
+
locator: { templateActivityKey: "code", instanceKey: "activityCode", workitemKey: "activityCode" },
|
|
131
163
|
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'
|
|
164
|
+
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
165
|
},
|
|
134
166
|
"workflow.get_draft": {
|
|
135
167
|
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
168
|
notes: ["与 workflow.get_published 同形(少了 published 键);节点绑定看 activities[].bizActions、系统活动顶层看 systemBizActions;templateType=DRAFT;深层字段投影写到叶子,完整模板在 data/detailArtifactId"],
|
|
137
169
|
},
|
|
138
170
|
// R88 #1:双面排查面。returnsFace 只显 notes 首条——教学并进首条。
|
|
171
|
+
// A8(r89 契约层):comparison 段钉死对比方向与算法(from=published, to=draft),
|
|
172
|
+
// 并明确 changes[] 不是发布 payload。
|
|
139
173
|
"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"],
|
|
174
|
+
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
175
|
notes: [
|
|
142
176
|
"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
177
|
],
|
|
@@ -157,7 +191,7 @@ const READ_SHAPES = {
|
|
|
157
191
|
// 覆盖——探针只能读回执 coverage 才发现选错了面。对照进 notes[0]:
|
|
158
192
|
// returnsFace 只显首条,默认 describe 面就要能先验选对面,不是打完才知道。
|
|
159
193
|
"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?"],
|
|
194
|
+
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
195
|
notes: [
|
|
162
196
|
"覆盖面对照:本工具=在线实时、仅 businessrule;omc graph references=离线快照、businessrule+datarule+listview 三面(毫秒级,需先 omc graph pull),且已含规则条件叶子(rule.condition 边;本在线面不含,条件引用走 graph);字段消歧 graph 面支持 schema.field 写法",
|
|
163
197
|
"matches:[] 只代表已扫面零命中(coverage.notScanned 是权威,勿当可安全删除);字段 code 跨模型不唯一,建议配 schemaCodes 限范围",
|
|
@@ -183,9 +217,12 @@ const READ_SHAPES = {
|
|
|
183
217
|
],
|
|
184
218
|
},
|
|
185
219
|
"form.get": {
|
|
220
|
+
// A2 locator:控件清单键 ↔ config.diff 的逐控件差异路径(BizFormModel.java:26-32
|
|
221
|
+
// 六列分面存储,diff 按控件 key 对齐,前缀 view/attributes/html/actions)。
|
|
222
|
+
locator: { controlCodes: "publishedControlCodes|draftControlCodes", diffPath: "changes[].path" },
|
|
186
223
|
keys: ["present", "published", "publishedControlCodes", "draftControlCodes", "formButtonCodes?", "formButtons?", "customButtonJson?(full)", "customButtonJsonShapeWarning?"],
|
|
187
224
|
notes: [
|
|
188
|
-
"控件清单键是 publishedControlCodes/draftControlCodes,不是 controls",
|
|
225
|
+
"控件清单键是 publishedControlCodes/draftControlCodes,不是 controls;两面差异的逐控件路径在 config.diff changes[].path(前缀 view/attributes/html/actions,按控件 key 对齐)",
|
|
189
226
|
"表单按钮读 formButtonCodes/formButtons;full:true 另带 customButtonJson 数组原样(库里是字符串脏形时给 customButtonJsonShapeWarning——线上 #38 前端按钮不渲染,重写 buttons 自愈)",
|
|
190
227
|
],
|
|
191
228
|
},
|
|
@@ -229,8 +266,8 @@ const READ_SHAPES = {
|
|
|
229
266
|
},
|
|
230
267
|
// r79-w2b(issue 06):方法清单面——一次 list 拿全部 url(不再 N 次 method.get)。
|
|
231
268
|
"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)"],
|
|
269
|
+
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?"],
|
|
270
|
+
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
271
|
},
|
|
235
272
|
"service.adapter_config": {
|
|
236
273
|
// r28f F5:顶栏 adapterCodes 摘要;compact:true 只回 code/name/description。
|
|
@@ -319,4 +356,12 @@ const READ_SHAPES = {
|
|
|
319
356
|
export function readShapeFor(toolName) {
|
|
320
357
|
return READ_SHAPES[toolName];
|
|
321
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* A2(r89 契约层):`resultMeta.locator` 投影——信封侧元数据,键名对照表由
|
|
361
|
+
* read-shapes 单一声明。没有 locator 的工具零字节。
|
|
362
|
+
*/
|
|
363
|
+
export function locatorMetaFor(toolName) {
|
|
364
|
+
const locator = READ_SHAPES[toolName]?.locator;
|
|
365
|
+
return locator === undefined ? undefined : { locator };
|
|
366
|
+
}
|
|
322
367
|
//# sourceMappingURL=read-shapes.js.map
|