@stalfh233/omc-cli 0.6.67 → 0.6.69
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/call.js +12 -1
- package/dist/capability-overview.js +4 -1
- package/dist/cli-contract.js +11 -0
- package/dist/cli.js +72 -5
- package/dist/discovery.js +3 -0
- package/dist/goal-routes.js +7 -2
- package/dist/graph.js +26 -4
- package/dist/lanes/businessrule.js +177 -35
- package/dist/lanes/field.js +31 -0
- package/dist/lanes/list-view-contract.js +3 -3
- package/dist/lanes/list-view-shapes.js +28 -19
- package/dist/lanes/list-view.js +82 -14
- package/dist/lanes/rule-graph.js +2 -2
- package/dist/lanes/runtime-data.js +8 -3
- package/dist/read-shapes.js +3 -0
- package/dist/rule-support.js +118 -79
- package/dist/tool-types.js +13 -0
- package/dist/write.js +6 -0
- package/package.json +3 -3
package/dist/call.js
CHANGED
|
@@ -122,11 +122,22 @@ export async function runToolCall(toolName, options = {}) {
|
|
|
122
122
|
// dictionary.delete) must not read as an OMC gap: name the real recovery
|
|
123
123
|
// path and the documented absence instead of only the nearest tools.
|
|
124
124
|
const absence = absencePointer(toolName);
|
|
125
|
+
// 线上 #40 第 10 条(2026-11-17):`workflow.get` 不是平台缺席,而是 OMC
|
|
126
|
+
// 读面按状态拆成两个工具——「工具不存在」的候选列表看着像拼写错误,
|
|
127
|
+
// 调用方会先怀疑自己再试一遍。直接点名拆分事实与两条命令。
|
|
128
|
+
const SPLIT_FACES = {
|
|
129
|
+
"workflow.get": {
|
|
130
|
+
faces: ["workflow.get_draft", "workflow.get_published"],
|
|
131
|
+
note: "workflow.get 不存在:读面按状态拆分——草稿用 workflow.get_draft,已发布用 workflow.get_published(两面字段不同,不要拿草稿面推断线上形状)",
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
const split = SPLIT_FACES[toolName];
|
|
125
135
|
const result = {
|
|
126
136
|
status: "unknown-tool",
|
|
127
137
|
tool: toolName,
|
|
138
|
+
...(split ? { splitFaces: split.faces, note: split.note, nextCommand: `omc call ${split.faces[split.faces.length - 1]} --args '{"workflowCode":"<流程 code>"}'` } : {}),
|
|
128
139
|
...(candidates.length > 0 ? { candidates } : {}),
|
|
129
|
-
...(didYouMean.length > 0 ? { didYouMean, nextCommand: `omc describe ${didYouMean[0]}` } : {}),
|
|
140
|
+
...(!split && didYouMean.length > 0 ? { didYouMean, nextCommand: `omc describe ${didYouMean[0]}` } : {}),
|
|
130
141
|
...(byText.length > 0 ? { didYouMeanByText: byText } : {}),
|
|
131
142
|
...(absence ? { platformAbsence: absence.replace(/^;/, "") } : {}),
|
|
132
143
|
// 跨族/表意不清时,「猜名字」本身就不该是路径——用目标路由一步到位。
|
|
@@ -314,7 +314,10 @@ export const CAPABILITY_CUES = Object.freeze({
|
|
|
314
314
|
"oauth", "openapi", "client_credentials", "第三方", "外部调用", "外部系统", "invoke", "调用自定义规则", "返回值"],
|
|
315
315
|
bizservice: ["集成", "接口", "服务", "回调", "对接", "外部系统", "datasql", "restful"],
|
|
316
316
|
report: ["报表", "图表", "看板", "bi", "dashboard"],
|
|
317
|
-
|
|
317
|
+
// r73 #3(2026-11-17 复验观察):「列表数据 / 数据列表」是运行面取数的真实说法,
|
|
318
|
+
// 此前只命中 listview 的「列表」→ 路由给视图配置面(用户想查数据却拿到视图读写工具)。
|
|
319
|
+
// 复合词(不裸配「列表/数据」)避免抢「列表视图/视图列」;评分按 cue 长度,长词胜出。
|
|
320
|
+
data: ["运行数据", "提交数据", "保存记录", "查记录", "造数据", "测试数据", "测试单据", "造单据", "造单", "录数据", "填数据", "模拟数据", "业务数据", "造几条", "造两张", "造几张", "验数据", "批量导入", "批量写入", "批量删除", "导入数据", "列表数据", "数据列表", "查数据", "数据查询", "拉数据", "拉一份数据", "看看数据", "查一下数据", "数据明细", "取数据", "数据的列表", "数据列表页", "数据记录"],
|
|
318
321
|
// r18 (2026-10-26): "造数据 / 造测试单据 / 录数据" is the RUN-DATA capability, but
|
|
319
322
|
// the goal usually also says 子表/明细 (field cues) — without these compound
|
|
320
323
|
// cues the router sent the probe to `field` in read mode (write:false), so it
|
package/dist/cli-contract.js
CHANGED
|
@@ -157,6 +157,15 @@ export function requestId() {
|
|
|
157
157
|
* (`business-rule-branch-conditional`) no matter WHICH lint code fired, so a
|
|
158
158
|
* QUERY-shape failure sent the caller to a BRANCH example (2 wasted calls, 0
|
|
159
159
|
* benefit). Route by the first code's prefix and only fall back to the example.
|
|
160
|
+
*
|
|
161
|
+
* r73 P1 (issue #40 §9): the remaining lie was `rule-graph-create*` as a whole
|
|
162
|
+
* pointing at the CROSS-MODEL recipe — a same-model CREATE node missing
|
|
163
|
+
* `originatorValue` (or an illegal `originatorValueType` /
|
|
164
|
+
* `childTriggerConditionType`) is a "what value goes in this node key" error,
|
|
165
|
+
* not a cross-model shape error; the cross-model example sent the caller
|
|
166
|
+
* hunting graph shapes while the fix was one node key. Those three codes route
|
|
167
|
+
* to the nodeGraph param page (node-key reference); the lint message itself
|
|
168
|
+
* carries the DYNAMIC/FIXED fill recipe.
|
|
160
169
|
*/
|
|
161
170
|
export function ruleGraphRecovery(validation) {
|
|
162
171
|
if (!Array.isArray(validation))
|
|
@@ -174,6 +183,8 @@ export function ruleGraphRecovery(validation) {
|
|
|
174
183
|
return "omc compute --help";
|
|
175
184
|
if (first.startsWith("rule-graph-assign-"))
|
|
176
185
|
return "omc describe rule.save --param nodeGraph";
|
|
186
|
+
if (first === "rule-graph-create-originator" || first === "rule-graph-create-originator-value" || first === "rule-graph-child-trigger-condition-type")
|
|
187
|
+
return "omc describe rule.save --param nodeGraph";
|
|
177
188
|
if (first.startsWith("rule-graph-preset-system-node") || first === "rule-graph-system-node")
|
|
178
189
|
return "omc describe rule.save --example standard-business-rule-graph";
|
|
179
190
|
if (first.startsWith("rule-graph-branch") || first.startsWith("rule-graph-condition-"))
|
package/dist/cli.js
CHANGED
|
@@ -26,7 +26,7 @@ import { artifactFetchHint, artifactRoot, boundResult, emitInvalid, emitResult,
|
|
|
26
26
|
import { CLI_DEFAULT_OUTPUT_BYTES, assertSafeOutputPath, pruneArtifacts } from "./artifacts.js";
|
|
27
27
|
import { artifactPathMissHint, nullProjectionHint, partialPathMissHint, projectJsonPath, projectJsonPathFanout, projectResultExtract } from "./path-projection.js";
|
|
28
28
|
import { basename, join, resolve } from "node:path";
|
|
29
|
-
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
29
|
+
import { existsSync, readFileSync, writeFileSync, chmodSync } from "node:fs";
|
|
30
30
|
import { buildToolRegistry } from "./tools.js";
|
|
31
31
|
import { acquireWriteLock, writeLockHeldFace } from "./write-lock.js";
|
|
32
32
|
import { cmdCompute } from "./compute.js";
|
|
@@ -980,6 +980,35 @@ function formatBytes(bytes) {
|
|
|
980
980
|
return `${(bytes / 1024).toFixed(1)}KB`;
|
|
981
981
|
return `${(bytes / 1024 / 1024).toFixed(1)}MB`;
|
|
982
982
|
}
|
|
983
|
+
/**
|
|
984
|
+
* r73 #7(GitLab #40 P1):从 `omc artifact get <id> --out <path>` 的 argv 里截出
|
|
985
|
+
* `--out` 并原地摘除那两个 token,让 configureOutput / stripOutputFlags 的全局
|
|
986
|
+
* 信封重定向语义不再吃掉它。只对 `artifact get` 子命令生效;缺值/flag 形值与
|
|
987
|
+
* configureOutput 同规则拒绝(invalid-input)。返回截得的路径,未出现则 undefined。
|
|
988
|
+
*/
|
|
989
|
+
function extractArtifactGetOutFlag(argv) {
|
|
990
|
+
const tokens = argv.slice(2);
|
|
991
|
+
if (tokens[0] !== "artifact" || tokens[1] !== "get")
|
|
992
|
+
return undefined;
|
|
993
|
+
for (let index = 2; index < argv.length; index += 1) {
|
|
994
|
+
const token = argv[index];
|
|
995
|
+
if (token === "--out") {
|
|
996
|
+
const value = argv[index + 1];
|
|
997
|
+
if (value === undefined || value.startsWith("--"))
|
|
998
|
+
throw new Error("--out requires a file path");
|
|
999
|
+
argv.splice(index, 2);
|
|
1000
|
+
return value;
|
|
1001
|
+
}
|
|
1002
|
+
if (token.startsWith("--out=")) {
|
|
1003
|
+
const value = token.slice("--out=".length);
|
|
1004
|
+
if (value.length === 0)
|
|
1005
|
+
throw new Error("--out requires a file path");
|
|
1006
|
+
argv.splice(index, 1);
|
|
1007
|
+
return value;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
return undefined;
|
|
1011
|
+
}
|
|
983
1012
|
async function cmdArtifactGet(id, transport, options = {}) {
|
|
984
1013
|
try {
|
|
985
1014
|
const artifact = readArtifact(artifactRoot(), id);
|
|
@@ -990,6 +1019,25 @@ async function cmdArtifactGet(id, transport, options = {}) {
|
|
|
990
1019
|
catch {
|
|
991
1020
|
content = artifact.content.toString("utf8");
|
|
992
1021
|
}
|
|
1022
|
+
// r73 #7(GitLab #40 P1,2026-11-17):`--out <配置根内路径>` 把 artifact 原始
|
|
1023
|
+
// 正文**全量落盘**——写文件不走 stdout 限额,`--full` 被上限卡死(fullRejected)
|
|
1024
|
+
// 的大对象(实测 589KB 视图 artifact)此前只能拆 key 取、易漏。这里写的是已过
|
|
1025
|
+
// sha256 校验的原文字节;回执只给 {out,bytes,sha256},stdout 不回正文。
|
|
1026
|
+
if (options.out !== undefined) {
|
|
1027
|
+
let outPath;
|
|
1028
|
+
try {
|
|
1029
|
+
outPath = assertSafeOutputPath(intentConfigRoot(), options.out, "artifact output file");
|
|
1030
|
+
}
|
|
1031
|
+
catch (error) {
|
|
1032
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
1033
|
+
const parsed = errorEnvelope(new Error(`artifact get --out 落盘被拒:${detail}。--out 按配置根(OMC_CONFIG_HOME)解析,只允许配置根内的常规文件路径(父目录须已存在)`), "artifact-out-refused", CLI_EXIT_CODES.invalidInput, transport.request);
|
|
1034
|
+
writeEnvelope(parsed.envelope);
|
|
1035
|
+
return parsed.exitCode;
|
|
1036
|
+
}
|
|
1037
|
+
writeFileSync(outPath, artifact.content, { mode: 0o600 });
|
|
1038
|
+
chmodSync(outPath, 0o600);
|
|
1039
|
+
return emitTransportResult({ status: "ok", artifactId: id, sha256: artifact.sha256, bytes: artifact.content.length, out: options.out, mode: "0600" }, transport);
|
|
1040
|
+
}
|
|
993
1041
|
// `--path-only` deliberately does NOT return the local path: the Agent-facing
|
|
994
1042
|
// CLI contract forbids exposing local filesystem paths. It returns the fetch
|
|
995
1043
|
// command instead, which is the portable way to reach the body.
|
|
@@ -1106,7 +1154,7 @@ async function cmdArtifactGet(id, transport, options = {}) {
|
|
|
1106
1154
|
bytes: artifact.content.length,
|
|
1107
1155
|
outline: true,
|
|
1108
1156
|
...(record ? { keys } : { kind: typeof content }),
|
|
1109
|
-
hint: `正文 ${Math.round(artifact.content.length / 1024)}KB 超过内联上限 ${ARTIFACT_INLINE_CEILING_BYTES}B,本次只回形状(顶层键 + 体积)。要某几个键:--keys <a,b>;要某个路径:--jq '<path>'(支持 .rules[code=Create].name 这类数组选择器);确实需要整包:--full
|
|
1157
|
+
hint: `正文 ${Math.round(artifact.content.length / 1024)}KB 超过内联上限 ${ARTIFACT_INLINE_CEILING_BYTES}B,本次只回形状(顶层键 + 体积)。要某几个键:--keys <a,b>;要某个路径:--jq '<path>'(支持 .rules[code=Create].name 这类数组选择器);确实需要整包:--full,或 --out <配置根内路径> 整包落盘(不走 stdout 限额)。`,
|
|
1110
1158
|
keysCommand: keys.length > 0 ? `omc artifact get ${id} --keys ${keys.slice(0, 3).map((entry) => entry.key).join(",")}` : `omc artifact get ${id} --summary`,
|
|
1111
1159
|
fullCommand: `omc artifact get ${id} --full`,
|
|
1112
1160
|
}, transport);
|
|
@@ -1136,8 +1184,9 @@ async function cmdArtifactGet(id, transport, options = {}) {
|
|
|
1136
1184
|
reason: `整包 ${Math.round(artifact.content.length / 1024)}KB 超过本通道输出上限 ${transport.maxOutputBytes}B;--full 无法一次返回,再跑一次结果相同`,
|
|
1137
1185
|
...(keys.length > 0 ? { keysCommand: `omc artifact get ${id} --keys ${keys.join(",")}`, sampledKeys: keys } : {}),
|
|
1138
1186
|
jqCommand: `omc artifact get ${id} --jq '<path>'`,
|
|
1187
|
+
outCommand: `omc artifact get ${id} --out <配置根内文件路径>(整包落盘,不走 stdout 限额,适合一次性备份)`,
|
|
1139
1188
|
raiseCeilingCommand: `omc artifact get ${id} --full --max-output-bytes ${Math.max(artifact.content.length + 1024, transport.maxOutputBytes * 2)}`,
|
|
1140
|
-
hint: "
|
|
1189
|
+
hint: "三选一:用 --jq/--keys 取你真正需要的那部分(推荐),整包落盘备份用 --out <配置根内路径>(写文件不受 stdout 限额),或显式抬高 --max-output-bytes",
|
|
1141
1190
|
}, transport);
|
|
1142
1191
|
}
|
|
1143
1192
|
return emitTransportResult(result, transport);
|
|
@@ -1364,6 +1413,14 @@ function cmdDiscovery(kind, transport, value, options = {}) {
|
|
|
1364
1413
|
// Zero hits: minimal envelope + up to three nearest candidates with an
|
|
1365
1414
|
// exact next command — NOT the full catalogue to re-read (r18: the empty
|
|
1366
1415
|
// match plus governance prose pushed the agent back to the 20 KB face).
|
|
1416
|
+
// r73 探针01-P2(2026-11-17):`--lane read` 这类不存在的 lane 回
|
|
1417
|
+
// tools:[] 且没有任何下一步——列合法 lane 清单,别让调用方全量拉再自己汇总。
|
|
1418
|
+
if (matched.length === 0 && options.lane !== undefined && semantic === undefined) {
|
|
1419
|
+
const availableLanes = [...new Set(registry.map((tool) => tool.lane).filter((lane) => typeof lane === "string").map((lane) => String(lane)))].sort();
|
|
1420
|
+
inventory.filtered.availableLanes = availableLanes;
|
|
1421
|
+
inventory.note = `--lane "${options.lane}" 没有工具(lane 名不区分大小写但必须是完整 id,形如 B1-businessrule / W1-list-view / M2-runtime-data)。合法 lane:${availableLanes.join("、")};能力→lane 映射用 omc capabilities(或 --filter <能力词> 按语义找)`;
|
|
1422
|
+
inventory.nextCommand = "omc capabilities";
|
|
1423
|
+
}
|
|
1367
1424
|
if (matched.length === 0 && semantic !== undefined) {
|
|
1368
1425
|
delete inventory.governance;
|
|
1369
1426
|
// r59 Step 1: candidates are CAPABILITIES, not tool names. The old
|
|
@@ -2352,6 +2409,9 @@ function joinSplitFlagValues(raw, flags) {
|
|
|
2352
2409
|
let lastHelpChunk = "";
|
|
2353
2410
|
async function main() {
|
|
2354
2411
|
let commandExitCode = 0;
|
|
2412
|
+
// r73 #7:artifact get 的 --out 值(在 configureOutput 之前截获,见下)。全局
|
|
2413
|
+
// 其它命令的 --out 语义不变(stdout 信封重定向)。
|
|
2414
|
+
let artifactGetOutPath;
|
|
2355
2415
|
// stderr is the diagnostics stream: apply the same Windows code-page policy
|
|
2356
2416
|
// as stdout before ANY message is written (banner, doctor, refusals).
|
|
2357
2417
|
installCodePageSafeStderr();
|
|
@@ -2374,6 +2434,11 @@ async function main() {
|
|
|
2374
2434
|
}
|
|
2375
2435
|
};
|
|
2376
2436
|
try {
|
|
2437
|
+
// r73 #7(GitLab #40 P1):`artifact get <id> --out <配置根内路径>` 是**产物正文
|
|
2438
|
+
// 落盘**语义。`--out` 同时是全局 stdout 信封重定向 flag(configureOutput 在
|
|
2439
|
+
// commander 之前消费它),artifact get 场景必须先行截走,否则正文永远到不了
|
|
2440
|
+
// 文件、全局通道只会把小信封写进目标文件。
|
|
2441
|
+
artifactGetOutPath = extractArtifactGetOutFlag(argv);
|
|
2377
2442
|
configureOutput(argv);
|
|
2378
2443
|
}
|
|
2379
2444
|
catch (error) {
|
|
@@ -2820,20 +2885,22 @@ async function main() {
|
|
|
2820
2885
|
console.error(`已清理 ${result.removed} 个读回产物,释放 ${formatBytes(result.freedBytes)};保留 ${result.kept} 个(${formatBytes(result.keptBytes)})`);
|
|
2821
2886
|
commandExitCode = CLI_EXIT_CODES.ok;
|
|
2822
2887
|
});
|
|
2823
|
-
artifactCommand.command("get <id>").addOption(new Option("--jq [path]", "路径选择器(非 jq);支持 [] 映射与逗号多路径;裸 --jq 列顶层键").argParser((value, previous = []) => [...previous, value]).default([])).option("--extract <path>", "同 --jq(与 omc call 的 --extract 同名,省一次命名切换)").option("--path-only").option("--summary").option("--keys [a,b]").option("--full", "整包返回正文(默认:正文超过 8KB 时只回形状 outline + fetch,按需 --jq/--keys 定向取值)").option("--max-output-bytes <bytes>").action(async (id, options) => {
|
|
2888
|
+
artifactCommand.command("get <id>").addOption(new Option("--jq [path]", "路径选择器(非 jq);支持 [] 映射与逗号多路径;裸 --jq 列顶层键").argParser((value, previous = []) => [...previous, value]).default([])).option("--extract <path>", "同 --jq(与 omc call 的 --extract 同名,省一次命名切换)").option("--path-only").option("--summary").option("--keys [a,b]").option("--full", "整包返回正文(默认:正文超过 8KB 时只回形状 outline + fetch,按需 --jq/--keys 定向取值)").option("--out <path>", "把 artifact 原始正文全量写到配置根内文件(0600;写文件不走 stdout 限额,大对象一次落盘备份;回执只给 {out,bytes,sha256} 不回正文)").option("--max-output-bytes <bytes>").action(async (id, options) => {
|
|
2824
2889
|
// A bare `--jq`/`--keys` is a key-inventory request, not a missing argument:
|
|
2825
2890
|
// commander's "argument missing" (invalid-input + retry) is a dead end the
|
|
2826
2891
|
// caller cannot fix without already knowing the flag takes a value (r11
|
|
2827
2892
|
// burned six rounds on `artifact get <id> --jq` before trying `--summary`).
|
|
2828
2893
|
// --extract 是 --jq 的同义别名(r28h F3)。
|
|
2829
2894
|
// 重复 --jq 的多路径合并为逗号路径透传(r34c-F8:此前静默只留最后一个)。
|
|
2895
|
+
// r73 #7:--out 在 configureOutput 之前被 extractArtifactGetOutFlag 截获
|
|
2896
|
+
//(commander 永远收不到它),这里读的是 main() 截下的值。
|
|
2830
2897
|
const jqPaths = [
|
|
2831
2898
|
...(Array.isArray(options.jq) ? options.jq.filter((v) => typeof v === "string") : []),
|
|
2832
2899
|
...(typeof options.extract === "string" ? [options.extract] : []),
|
|
2833
2900
|
];
|
|
2834
2901
|
const bareJq = options.jq === true;
|
|
2835
2902
|
commandExitCode = await withTransport(options, request, (transport) => cmdArtifactGet(id, transport, { ...(jqPaths.length > 0 ? { jq: jqPaths.join(",") } : {}), pathOnly: options.pathOnly === true, summary: options.summary === true || options.keys === true || bareJq,
|
|
2836
|
-
pureKeys: (options.keys === true || bareJq) && options.summary !== true, ...(typeof options.keys === "string" ? { keys: options.keys } : {}), full: options.full === true }));
|
|
2903
|
+
pureKeys: (options.keys === true || bareJq) && options.summary !== true, ...(typeof options.keys === "string" ? { keys: options.keys } : {}), full: options.full === true, ...(artifactGetOutPath !== undefined ? { out: artifactGetOutPath } : {}) }));
|
|
2837
2904
|
});
|
|
2838
2905
|
command.command("bench").option("--live-sample").option("--env <environment>").action(async (options) => { commandExitCode = await cmdBench([...(options.liveSample ? ["--live-sample"] : []), ...(options.env ? ["--env", options.env] : [])]); });
|
|
2839
2906
|
command.command("residue <prefix>").description("跨面前缀残留扫描(model 全租户/folder/custompage;默认 deep 再查命中模型的 rule/datarule/onlinejs)——收尾「删净」一次证明,clean:true 即零残留。清理入口:omc model-purge --code <schemaCode>(按依赖倒序,默认 dry-run)。只读零写入;report 面暂停维护未扫描").option("--env <environment>", "环境名(默认按 cwd 的 .omc-env 解析)").option("--apps <codes>", "all(默认,全租户)或逗号分隔应用码").option("--no-deep", "只扫 model/folder/custompage,不深查命中模型").option("--all-faces", "列出全部应用×面(含 count:0;默认只回非零面+byFace/userResidues 紧凑形)").option("--max-output-bytes <bytes>").addOption(new Option("--jq [path]", "--jq 不是 jq,仅路径选择器(与 call --jq 同 DSL;可逗号多路径;裸 --jq 列顶层键)").argParser((value, previous = []) => [...previous, value]).default([])).action(async (prefix, options) => { commandExitCode = await withTransport(options, request, (transport) => cmdResidue(prefix, { env: options.env, apps: options.apps, ...(options.deep === false ? { noDeep: true } : {}), ...(options.allFaces ? { allFaces: true } : {}), ...(options.jq !== undefined ? { jq: options.jq } : {}) }, transport)); });
|
package/dist/discovery.js
CHANGED
|
@@ -53,6 +53,9 @@ export function commandInventory(registry, options = {}) {
|
|
|
53
53
|
// now a strict subset of the full catalogue.
|
|
54
54
|
return {
|
|
55
55
|
discovery: { authoritative: DISCOVERY_AUTHORITY.authoritative, route: DISCOVERY_AUTHORITY.route },
|
|
56
|
+
// r73 探针01-P2:compact 信封与完整面同形(total 恒在)——自写解析脚本
|
|
57
|
+
// 不该因为「紧凑面少一个计数键」而 KeyError 重试。
|
|
58
|
+
total: rows.length,
|
|
56
59
|
tools: rows,
|
|
57
60
|
};
|
|
58
61
|
}
|
package/dist/goal-routes.js
CHANGED
|
@@ -1241,7 +1241,12 @@ function goalRouteInner(registry, goal) {
|
|
|
1241
1241
|
// one exists) gives the arg SHAPE in ~1–2 KB; the lane bundle remains the
|
|
1242
1242
|
// fallback for tools with no recipe. In read/scout mode the steps list the
|
|
1243
1243
|
// READ tools instead — a read-back ask must not be answered with field.create.
|
|
1244
|
-
|
|
1244
|
+
// r73 #3(2026-11-17 复验观察):「查合同台账的列表数据」命中 listview(列表)+data
|
|
1245
|
+
// (列表数据),但读面阶梯按注册/依赖顺序排 → listview 抢到首步,用户想取数却先看到
|
|
1246
|
+
// 视图配置工具。读意图下各能力之间没有写依赖,按问句相关度(cue 得分)排首步;
|
|
1247
|
+
// 写意图仍按依赖顺序(model→field→form→…)不动。
|
|
1248
|
+
const routeOrder = readish ? [...ordered].sort((a, b) => (scoreMap.get(b) ?? 0) - (scoreMap.get(a) ?? 0)) : ordered;
|
|
1249
|
+
const ladder = routeOrder.map((id) => {
|
|
1245
1250
|
const capability = routeById.get(id);
|
|
1246
1251
|
if (readish) {
|
|
1247
1252
|
return { capability: id, lane: capability.lane, readTools: readToolsInLane(registry, capability.lane), firstCommand: `omc capability ${id}` };
|
|
@@ -1281,7 +1286,7 @@ function goalRouteInner(registry, goal) {
|
|
|
1281
1286
|
goal,
|
|
1282
1287
|
confident: true,
|
|
1283
1288
|
mode: whole ? "whole-package" : mode,
|
|
1284
|
-
match: { kind: readish ? "read-ladder" : "ladder", ref: `${
|
|
1289
|
+
match: { kind: readish ? "read-ladder" : "ladder", ref: `${routeOrder.join("→")}${routeOrder.includes("businessrule") && /累加|联动|审计|规则触发|自动累加|自动回写/.test(goal) ? "(规则面不在本阶梯)" : ""}`, capabilities: routeOrder },
|
|
1285
1290
|
route: {
|
|
1286
1291
|
...(whole ? (intentCoveredOf(ordered)
|
|
1287
1292
|
? { primary: "intent", atomicSupplement }
|
package/dist/graph.js
CHANGED
|
@@ -334,8 +334,16 @@ export function extractReferenceEdges(schemaCode, ruleCode, nodes, routes = [],
|
|
|
334
334
|
if (["CREATE", "UPDATE", "DELETE"].includes(String(node.nodeType ?? ""))) {
|
|
335
335
|
push("model", String(node.targetObjectCode ?? ""), node, "targetObjectCode");
|
|
336
336
|
if (Array.isArray(node.dataActions))
|
|
337
|
-
for (const action of node.dataActions)
|
|
337
|
+
for (const action of node.dataActions) {
|
|
338
338
|
push("field", String(action.targetDataItem ?? ""), node, "dataActions.targetDataItem");
|
|
339
|
+
// r73(r72g 报告遗留的相邻盲区):DYNAMIC 赋值的来源字段
|
|
340
|
+
// (currentDataItemValue)与 EXPRESSION value 里的 `{字段}` 模板同样是
|
|
341
|
+
// 配置里的字段引用——只入承载模型侧(来源就是本行字段),不改变既有
|
|
342
|
+
// targetDataItem 的归属语义。
|
|
343
|
+
push("field", String(action.currentDataItemValue ?? ""), node, "dataActions.currentDataItemValue");
|
|
344
|
+
for (const token of conditionValueTokens(action.value))
|
|
345
|
+
push("field", token, node, "dataActions.value-token");
|
|
346
|
+
}
|
|
339
347
|
}
|
|
340
348
|
if (mapping) {
|
|
341
349
|
push("model", String(mapping.schemaCode ?? ""), node, "methodMapping.schemaCode");
|
|
@@ -1005,8 +1013,8 @@ export const GRAPH_COVERAGE = Object.freeze({
|
|
|
1005
1013
|
answerable: Object.freeze(["businessrule", "datarule", "listview"]),
|
|
1006
1014
|
mustCheckManually: Object.freeze([
|
|
1007
1015
|
{ surface: "form", why: "表单控件关联未扫描,可能仍引用目标字段", how: "omc call form.get --args '{\"schemaCode\":\"<x>\"}'" },
|
|
1008
|
-
{ surface: "workflow.permissions", why: "
|
|
1009
|
-
{ surface: "workflow.bindings", why: "
|
|
1016
|
+
{ surface: "workflow.permissions", why: "流程权限未扫描,无法判断谁能发起/操作(workflow.get 不存在:读已发布面用 get_published)", how: "omc call workflow.get_published --args '{\"workflowCode\":\"<x>\"}'" },
|
|
1017
|
+
{ surface: "workflow.bindings", why: "流程规则绑定未扫描,规则删除可能留下绑定(workflow.get 不存在:草稿/已发布分别用 get_draft/get_published)", how: "omc call workflow.get_published --args '{\"workflowCode\":\"<x>\"}'" },
|
|
1010
1018
|
{ surface: "onlinejs", why: "在线 JS 可能通过字符串引用字段", how: "omc call onlinejs.get --args '{\"schemaCode\":\"<x>\"}'" },
|
|
1011
1019
|
]),
|
|
1012
1020
|
note: "零命中/全零 totals 只代表 scanned 面没有命中;notScanned 面(尤其 form 与 workflow.permissions)未扫描,不可据此判定可安全删除或无影响",
|
|
@@ -1173,7 +1181,21 @@ export function queryGraphReferencesBatch(kind, codes, selector = {}) {
|
|
|
1173
1181
|
try {
|
|
1174
1182
|
const wanted = [...new Set(codes.filter(Boolean))];
|
|
1175
1183
|
const rows = wanted.length === 0 ? [] : db.prepare(`SELECT code, schema_code, rule_code, node_code, node_type, via FROM edges WHERE kind = ? AND code IN (${wanted.map(() => "?").join(",")}) ORDER BY code, schema_code, rule_code, node_code, via`).all(kind, ...wanted);
|
|
1176
|
-
|
|
1184
|
+
// r73 探针03-P2:裸码批量查询不告诉调用方「这个 code 解析到了哪些宿主模型」,
|
|
1185
|
+
// 同名跨模型时要额外抽查才能确认。resolved 汇总每个 code 的宿主 schema 集合,
|
|
1186
|
+
// 跨模型同名直接标 sameCodeAcrossSchemas(消歧用 schemaCode.field 写法)。
|
|
1187
|
+
const resolved = wanted.map((code) => {
|
|
1188
|
+
const schemaCodes = [...new Set(rows.filter((row) => row.code === code).map((row) => row.schema_code))];
|
|
1189
|
+
return { code, schemaCodes, ...(schemaCodes.length > 1 ? { sameCodeAcrossSchemas: true } : {}) };
|
|
1190
|
+
});
|
|
1191
|
+
return {
|
|
1192
|
+
kind,
|
|
1193
|
+
codes: wanted,
|
|
1194
|
+
resolved,
|
|
1195
|
+
matches: rows.map((row) => ({ targetCode: row.code, schemaCode: row.schema_code, ruleCode: row.rule_code, nodeCode: row.node_code ?? "", nodeType: row.node_type ?? "", via: row.via, referrer: { schemaCode: row.schema_code, ruleCode: row.rule_code }, isSelf: row.schema_code === row.code })),
|
|
1196
|
+
index: summary,
|
|
1197
|
+
coverage: GRAPH_COVERAGE,
|
|
1198
|
+
};
|
|
1177
1199
|
}
|
|
1178
1200
|
finally {
|
|
1179
1201
|
db.close();
|