@stalfh233/omc-cli 0.6.68 → 0.6.70

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.
@@ -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
- data: ["运行数据", "提交数据", "保存记录", "查记录", "造数据", "测试数据", "测试单据", "造单据", "造单", "录数据", "填数据", "模拟数据", "业务数据", "造几条", "造两张", "造几张", "验数据", "批量导入", "批量写入", "批量删除", "导入数据"],
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.js CHANGED
@@ -24,7 +24,7 @@ import { beginWriteFace, configureOutput, endWriteFace, humanSummary, maybeWarnM
24
24
  import { beginUsage, completeUsage, currentUsageArgsDigest, ensureProjectIgnore, priorIdenticalSuccess, recordUsageOutput, usageReport } from "./usage-log.js";
25
25
  import { artifactFetchHint, artifactRoot, boundResult, emitInvalid, emitResult, emitThrown, emitTransportResult, outputBudget, readArtifact, withTransport, } from "./command-transport.js";
26
26
  import { CLI_DEFAULT_OUTPUT_BYTES, assertSafeOutputPath, pruneArtifacts } from "./artifacts.js";
27
- import { artifactPathMissHint, nullProjectionHint, partialPathMissHint, projectJsonPath, projectJsonPathFanout, projectResultExtract } from "./path-projection.js";
27
+ import { artifactPathMissHint, nullProjectionHint, partialPathMissHint, pathMissDidYouMean, projectJsonPath, projectJsonPathFanout, projectResultExtract, shapeOf, SHAPE_MAX_DEPTH } from "./path-projection.js";
28
28
  import { basename, join, resolve } from "node:path";
29
29
  import { existsSync, readFileSync, writeFileSync, chmodSync } from "node:fs";
30
30
  import { buildToolRegistry } from "./tools.js";
@@ -944,12 +944,12 @@ function projectArtifactPath(value, path) {
944
944
  if (!path.includes("[]")) {
945
945
  const projected = projectJsonPath(value, path);
946
946
  return projected.missed
947
- ? { missed: true, ...(projected.at !== undefined ? { at: projected.at } : {}), ...(projected.available !== undefined ? { available: projected.available } : {}) }
947
+ ? { 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 } : {}) }
948
948
  : { missed: false, content: projected.value ?? null };
949
949
  }
950
950
  const fanout = projectJsonPathFanout(value, path);
951
951
  return fanout.missed
952
- ? { missed: true, ...(fanout.at !== undefined ? { at: fanout.at } : {}), ...(fanout.available !== undefined ? { available: fanout.available } : {}) }
952
+ ? { missed: true, ...(fanout.at !== undefined ? { at: fanout.at } : {}), ...(fanout.available !== undefined ? { available: fanout.available } : {}), ...(fanout.availableAll !== undefined ? { availableAll: fanout.availableAll } : {}), ...(fanout.availableTruncated !== undefined ? { availableTruncated: fanout.availableTruncated } : {}) }
953
953
  : { missed: false, content: fanout.values, mapped: fanout.values.length, ...(fanout.missedEntries > 0 ? { missedEntries: fanout.missedEntries } : {}), nullEntries: fanout.nullEntries };
954
954
  }
955
955
  /** Preserve source completeness/count facts on every artifact projection. */
@@ -1009,8 +1009,21 @@ function extractArtifactGetOutFlag(argv) {
1009
1009
  }
1010
1010
  return undefined;
1011
1011
  }
1012
+ /** artifact 面 pathMiss 的 didYouMean/截断计数附加字段(r75:与 call 面一致)。 */
1013
+ function artifactMissExtras(projected) {
1014
+ const didYouMean = pathMissDidYouMean(projected.at, projected.available, projected.availableAll);
1015
+ return {
1016
+ ...(projected.availableTruncated !== undefined ? { availableTruncated: projected.availableTruncated } : {}),
1017
+ ...(didYouMean !== undefined ? { didYouMean } : {}),
1018
+ };
1019
+ }
1012
1020
  async function cmdArtifactGet(id, transport, options = {}) {
1013
1021
  try {
1022
+ if (options.depth !== undefined && (!Number.isInteger(options.depth) || options.depth < 1 || options.depth > SHAPE_MAX_DEPTH)) {
1023
+ const parsed = errorEnvelope(new Error(`--depth 必须是 1-${SHAPE_MAX_DEPTH} 的整数(默认 2;再深就成了正文复刻,字节失控)`), "artifact-depth-invalid", CLI_EXIT_CODES.invalidInput, transport.request);
1024
+ writeEnvelope(parsed.envelope);
1025
+ return parsed.exitCode;
1026
+ }
1014
1027
  const artifact = readArtifact(artifactRoot(), id);
1015
1028
  let content;
1016
1029
  try {
@@ -1043,6 +1056,35 @@ async function cmdArtifactGet(id, transport, options = {}) {
1043
1056
  // command instead, which is the portable way to reach the body.
1044
1057
  if (options.pathOnly)
1045
1058
  return emitTransportResult({ status: "ok", artifactId: id, sha256: artifact.sha256, fetch: artifactFetchHint(id) }, transport);
1059
+ // r75 调查C:`--shape [path]` 回执形状先验——深度受限骨架(默认 2,--depth 可
1060
+ // 到 4)。--summary 是预算事实(多大/会不会截断),--shape 是导航图(嵌套骨架
1061
+ // 到哪层有哪些键);>8KB 默认 outline 与本分支共用同一份 shapeOf(单一真相源,
1062
+ // 防 r25「两面雷同」复发)。显式 --shape 优先于 --summary/--keys/--jq。
1063
+ if (options.shape !== undefined) {
1064
+ const depth = options.depth ?? 2;
1065
+ if (typeof options.shape === "string" && options.shape.trim() !== "") {
1066
+ // `--shape <path>`:在命中的子树上出骨架(同 --jq 的路径 DSL,含 [] 与 [code=X])。
1067
+ const projected = projectArtifactPath(artifact.content.toString("utf8") === "" ? undefined : content, options.shape);
1068
+ if (projected.missed) {
1069
+ return emitTransportResult({ status: "ok", artifactId: id, sha256: artifact.sha256, ...artifactProjectionMetadata(content), path: options.shape, content: null, pathMiss: true, missedAt: projected.at, available: projected.available, ...artifactMissExtras(projected), unanswered: true, hint: artifactPathMissHint(projected.at) }, transport);
1070
+ }
1071
+ return emitTransportResult({ status: "ok", artifactId: id, sha256: artifact.sha256, bytes: artifact.content.length, path: options.shape, depth, shape: shapeOf(projected.content, depth), fetch: artifactFetchHint(id) }, transport);
1072
+ }
1073
+ // 裸 `--shape`:整棵根的骨架。<8KB 的产物正本默认整体内联,骨架无增益——
1074
+ // 明确劝退(r38 模式:别为已经免费的东西花第二轮)。
1075
+ const smallBody = artifact.content.length <= ARTIFACT_INLINE_CEILING_BYTES;
1076
+ return emitTransportResult({
1077
+ status: "ok",
1078
+ artifactId: id,
1079
+ sha256: artifact.sha256,
1080
+ bytes: artifact.content.length,
1081
+ depth,
1082
+ shape: shapeOf(content, depth),
1083
+ ...(smallBody
1084
+ ? { shapeNote: `产物 ${artifact.content.length}B 未超过内联上限 ${ARTIFACT_INLINE_CEILING_BYTES}B:默认 get 本就整体内联正文,--shape 无增益;直接取正文或 --jq <path> 定向取值`, defaultCommand: `omc artifact get ${id}` }
1085
+ : { fetch: artifactFetchHint(id) }),
1086
+ }, transport);
1087
+ }
1046
1088
  // `--summary` / `--keys` (round 4): inspect a large artifact without pulling
1047
1089
  // its whole body. Reproduced benchmark: agents fetched 30–75 KB workflow
1048
1090
  // bodies just to look at the node list.
@@ -1067,7 +1109,7 @@ async function cmdArtifactGet(id, transport, options = {}) {
1067
1109
  // 一层 `projection:{path,content}`——`artifact get --jq` 与 `--summary --jq`
1068
1110
  // 因此同形(顶层 path/content),换读面不用重新探根键。
1069
1111
  return emitTransportResult(projected.missed
1070
- ? { status: "ok", artifactId: id, sha256: artifact.sha256, bytes: artifact.content.length, ...artifactProjectionMetadata(content), keys, path: options.jq, content: null, projections: [{ path: options.jq, content: null, pathMiss: true, missedAt: projected.at, available: projected.available }], pathMiss: true, missedAt: projected.at, available: projected.available, unanswered: true, hint: artifactPathMissHint(projected.at) }
1112
+ ? { status: "ok", artifactId: id, sha256: artifact.sha256, bytes: artifact.content.length, ...artifactProjectionMetadata(content), keys, path: options.jq, content: null, projections: [{ path: options.jq, content: null, pathMiss: true, missedAt: projected.at, available: projected.available, ...artifactMissExtras(projected) }], pathMiss: true, missedAt: projected.at, available: projected.available, ...artifactMissExtras(projected), unanswered: true, hint: artifactPathMissHint(projected.at) }
1071
1113
  : {
1072
1114
  status: "ok",
1073
1115
  artifactId: id,
@@ -1119,14 +1161,14 @@ async function cmdArtifactGet(id, transport, options = {}) {
1119
1161
  const projections = jqPaths.map((path) => {
1120
1162
  const projected = projectArtifactPath(artifactContent, path);
1121
1163
  return projected.missed
1122
- ? { path, content: null, pathMiss: true, missedAt: projected.at, available: projected.available }
1164
+ ? { path, content: null, pathMiss: true, missedAt: projected.at, available: projected.available, ...artifactMissExtras(projected) }
1123
1165
  : { path, content: projected.content ?? null, ...(projected.mapped !== undefined ? { mapped: projected.mapped } : {}), ...(projected.missedEntries !== undefined ? { missedEntries: projected.missedEntries } : {}), ...(projected.nullEntries !== undefined && projected.nullEntries > 0 ? { nullEntries: projected.nullEntries } : {}), ...(artifactNullHint(projected.content, projected.nullEntries) !== undefined ? { hint: artifactNullHint(projected.content, projected.nullEntries) } : {}) };
1124
1166
  });
1125
1167
  return emitTransportResult({ status: "ok", artifactId: id, sha256: artifact.sha256, ...artifactProjectionMetadata(content), projections, ...(projections.some((entry) => entry.pathMiss) ? { unanswered: true, hint: partialPathMissHint() } : {}) }, transport);
1126
1168
  }
1127
1169
  const projected = projectArtifactPath(artifactContent, options.jq);
1128
1170
  return emitTransportResult(projected.missed
1129
- ? { status: "ok", artifactId: id, sha256: artifact.sha256, ...artifactProjectionMetadata(content), path: options.jq, content: null, pathMiss: true, missedAt: projected.at, available: projected.available, unanswered: true, hint: artifactPathMissHint(projected.at) }
1171
+ ? { status: "ok", artifactId: id, sha256: artifact.sha256, ...artifactProjectionMetadata(content), path: options.jq, content: null, pathMiss: true, missedAt: projected.at, available: projected.available, ...artifactMissExtras(projected), unanswered: true, hint: artifactPathMissHint(projected.at) }
1130
1172
  : { status: "ok", artifactId: id, sha256: artifact.sha256, ...artifactProjectionMetadata(content), path: options.jq, projections: [{ path: options.jq, content: projected.content ?? null, ...(projected.mapped !== undefined ? { mapped: projected.mapped } : {}), ...(projected.missedEntries !== undefined ? { missedEntries: projected.missedEntries } : {}), ...(projected.nullEntries !== undefined && projected.nullEntries > 0 ? { nullEntries: projected.nullEntries } : {}) }], ...(projected.mapped !== undefined ? { mapped: projected.mapped } : {}), ...(projected.missedEntries !== undefined ? { missedEntries: projected.missedEntries } : {}), ...(projected.nullEntries !== undefined && projected.nullEntries > 0 ? { nullEntries: projected.nullEntries } : {}), ...(artifactNullHint(projected.content, projected.nullEntries) !== undefined ? { hint: artifactNullHint(projected.content, projected.nullEntries) } : {}) }, transport);
1131
1173
  }
1132
1174
  // r6-onboarding 2026-10-21: 47 artifact fetches, 0 used a projection; the 10
@@ -1136,26 +1178,22 @@ async function cmdArtifactGet(id, transport, options = {}) {
1136
1178
  // advisory and did not change behaviour.
1137
1179
  //
1138
1180
  // 0.4.80: shape first, the same rule as `omc help`. Above the inline ceiling
1139
- // the default is the outline (top-level keys + their sizes) plus runnable
1140
- // projections; `--full` returns the whole body exactly as before. Explicit
1141
- // projections (--summary/--keys/--jq/--path-only) are handled above and are
1181
+ // the default is the depth-2 skeleton (same shapeOf as `--shape`; r75 调查C:
1182
+ // 两面共用一份实现——顶层键表请走 --summary,此处不再第二张雷同面);
1183
+ // `--full` returns the whole body exactly as before. Explicit projections
1184
+ // (--shape/--summary/--keys/--jq/--path-only) are handled above and are
1142
1185
  // never affected.
1143
1186
  if (options.full !== true && artifact.content.length > ARTIFACT_INLINE_CEILING_BYTES) {
1144
- const record = content && typeof content === "object" && !Array.isArray(content) ? content : undefined;
1145
- const keys = record
1146
- ? Object.entries(record)
1147
- .map(([key, value]) => ({ key, bytes: Buffer.byteLength(JSON.stringify(value) ?? "null", "utf8"), kind: Array.isArray(value) ? `array[${value.length}]` : value === null ? "null" : typeof value }))
1148
- .sort((left, right) => right.bytes - left.bytes)
1149
- : [];
1187
+ const depth = options.depth ?? 2;
1150
1188
  return emitTransportResult({
1151
1189
  status: "ok",
1152
1190
  artifactId: id,
1153
1191
  sha256: artifact.sha256,
1154
1192
  bytes: artifact.content.length,
1155
1193
  outline: true,
1156
- ...(record ? { keys } : { kind: typeof content }),
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 限额)。`,
1158
- keysCommand: keys.length > 0 ? `omc artifact get ${id} --keys ${keys.slice(0, 3).map((entry) => entry.key).join(",")}` : `omc artifact get ${id} --summary`,
1194
+ depth,
1195
+ shape: shapeOf(content, depth),
1196
+ hint: `正文 ${Math.round(artifact.content.length / 1024)}KB 超过内联上限 ${ARTIFACT_INLINE_CEILING_BYTES}B,默认只回深度 ${depth} 骨架(键/类型/数组长度/示例值)。加深:--depth ≤${SHAPE_MAX_DEPTH};子树骨架:--shape <path>;要某几个键:--keys <a,b>;要某个路径:--jq '<path>'(支持 .rules[code=Create].name 这类数组选择器);确实需要整包:--full,或 --out <配置根内路径> 整包落盘(不走 stdout 限额)。`,
1159
1197
  fullCommand: `omc artifact get ${id} --full`,
1160
1198
  }, transport);
1161
1199
  }
@@ -1413,6 +1451,14 @@ function cmdDiscovery(kind, transport, value, options = {}) {
1413
1451
  // Zero hits: minimal envelope + up to three nearest candidates with an
1414
1452
  // exact next command — NOT the full catalogue to re-read (r18: the empty
1415
1453
  // match plus governance prose pushed the agent back to the 20 KB face).
1454
+ // r73 探针01-P2(2026-11-17):`--lane read` 这类不存在的 lane 回
1455
+ // tools:[] 且没有任何下一步——列合法 lane 清单,别让调用方全量拉再自己汇总。
1456
+ if (matched.length === 0 && options.lane !== undefined && semantic === undefined) {
1457
+ const availableLanes = [...new Set(registry.map((tool) => tool.lane).filter((lane) => typeof lane === "string").map((lane) => String(lane)))].sort();
1458
+ inventory.filtered.availableLanes = availableLanes;
1459
+ inventory.note = `--lane "${options.lane}" 没有工具(lane 名不区分大小写但必须是完整 id,形如 B1-businessrule / W1-list-view / M2-runtime-data)。合法 lane:${availableLanes.join("、")};能力→lane 映射用 omc capabilities(或 --filter <能力词> 按语义找)`;
1460
+ inventory.nextCommand = "omc capabilities";
1461
+ }
1416
1462
  if (matched.length === 0 && semantic !== undefined) {
1417
1463
  delete inventory.governance;
1418
1464
  // r59 Step 1: candidates are CAPABILITIES, not tool names. The old
@@ -1904,7 +1950,7 @@ async function cmdGraphPull(environment, concurrency, transport, path, applicati
1904
1950
  scope: data.meta.scope,
1905
1951
  coverage: { applicationCodes: data.meta.coverage.applicationCodes, ...(data.meta.coverage.tenantApplications ? { tenantApplications: data.meta.coverage.tenantApplications } : {}) },
1906
1952
  freshness: data.gaps.length === 0 ? "complete" : "partial",
1907
- scanned: { models: data.scanned.models, rules: data.scanned.rules, datarules: data.scanned.datarules, views: data.scanned.views, ...(data.scanned.parseFailures > 0 ? { parseFailures: data.scanned.parseFailures } : {}) },
1953
+ scanned: { models: data.scanned.models, rules: data.scanned.rules, datarules: data.scanned.datarules, views: data.scanned.views, workflows: data.scanned.workflows, forms: data.scanned.forms, ...(data.scanned.parseFailures > 0 ? { parseFailures: data.scanned.parseFailures } : {}) },
1908
1954
  edges: edgesByKind,
1909
1955
  ...(data.gaps.length > 0 ? { gaps: { count: data.gaps.length, byKind: gapsByKind } } : {}),
1910
1956
  dbBytes: data.dbBytes,
@@ -2877,7 +2923,7 @@ async function main() {
2877
2923
  console.error(`已清理 ${result.removed} 个读回产物,释放 ${formatBytes(result.freedBytes)};保留 ${result.kept} 个(${formatBytes(result.keptBytes)})`);
2878
2924
  commandExitCode = CLI_EXIT_CODES.ok;
2879
2925
  });
2880
- 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) => {
2926
+ 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("--shape [path]", "回执形状先验:深度受限骨架(键/类型/数组长度/≤40 字符示例值),一次看全嵌套路径图再 --jq;裸 --shape = 整棵根,--shape <path> = 命中子树(同 --jq 的路径 DSL);与 >8KB 默认 outline 同一实现").option("--depth <n>", "骨架深度 1-4(默认 2;--shape 与 >8KB 默认 outline 消费)").option("--summary").option("--keys [a,b]").option("--full", "整包返回正文(默认:正文超过 8KB 时只回深度 2 骨架 outline,按需 --shape/--jq/--keys 定向取值)").option("--out <path>", "把 artifact 原始正文全量写到配置根内文件(0600;写文件不走 stdout 限额,大对象一次落盘备份;回执只给 {out,bytes,sha256} 不回正文)").option("--max-output-bytes <bytes>").action(async (id, options) => {
2881
2927
  // A bare `--jq`/`--keys` is a key-inventory request, not a missing argument:
2882
2928
  // commander's "argument missing" (invalid-input + retry) is a dead end the
2883
2929
  // caller cannot fix without already knowing the flag takes a value (r11
@@ -2891,8 +2937,17 @@ async function main() {
2891
2937
  ...(typeof options.extract === "string" ? [options.extract] : []),
2892
2938
  ];
2893
2939
  const bareJq = options.jq === true;
2894
- 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,
2895
- pureKeys: (options.keys === true || bareJq) && options.summary !== true, ...(typeof options.keys === "string" ? { keys: options.keys } : {}), full: options.full === true, ...(artifactGetOutPath !== undefined ? { out: artifactGetOutPath } : {}) }));
2940
+ // r75:显式 --shape 优先于 --summary/--keys/--jq(形状先验在取值之前)。
2941
+ const depthValue = options.depth === undefined ? undefined : Number(options.depth);
2942
+ const shapeValue = options.shape === true ? true : typeof options.shape === "string" ? options.shape : undefined;
2943
+ commandExitCode = await withTransport(options, request, (transport) => cmdArtifactGet(id, transport, {
2944
+ ...(jqPaths.length > 0 ? { jq: jqPaths.join(",") } : {}),
2945
+ pathOnly: options.pathOnly === true,
2946
+ ...(shapeValue !== undefined ? { shape: shapeValue } : {}),
2947
+ ...(depthValue !== undefined ? { depth: depthValue } : {}),
2948
+ summary: options.summary === true || options.keys === true || bareJq,
2949
+ pureKeys: (options.keys === true || bareJq) && options.summary !== true, ...(typeof options.keys === "string" ? { keys: options.keys } : {}), full: options.full === true, ...(artifactGetOutPath !== undefined ? { out: artifactGetOutPath } : {})
2950
+ }));
2896
2951
  });
2897
2952
  command.command("bench").option("--live-sample").option("--env <environment>").action(async (options) => { commandExitCode = await cmdBench([...(options.liveSample ? ["--live-sample"] : []), ...(options.env ? ["--env", options.env] : [])]); });
2898
2953
  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)); });
@@ -85,17 +85,18 @@ export function boundResult(result, budget) {
85
85
  }
86
86
  /** The retrieval command an agent should run for a spilled/compacted readback. */
87
87
  export function artifactFetchHint(artifactId) {
88
- // Summary-first: the complex benchmark showed agents pulling 43–75 KB bodies
89
- // raw. `--summary` shows the key/size map so they fetch only what they need.
90
- // Kept terse on purpose: this line rides EVERY write and every spilled read
91
- // (2026-09-25 cost pass — the parenthetical prose was 80 B of the 133 B).
88
+ // Shape-first: the complex benchmark showed agents pulling 43–75 KB bodies
89
+ // raw. r75 调查C:--shape(深度 2 嵌套骨架)一次给全路径图,深层键不再靠
90
+ // pathMiss 逐层猜;--jq 仍是指名取值的那一跳。Kept terse on purpose: this
91
+ // line rides EVERY write and every spilled read (2026-09-25 cost pass — the
92
+ // parenthetical prose was 80 B of the 133 B).
92
93
  //
93
94
  // GitLab #18 P0-1: the old wording said `原调用加 --extract <path> /
94
95
  // --extract-keys`, which reads as an `artifact get` option — `artifact get`
95
- // has NO --extract (only --jq/--keys/--summary/--path-only/--full), so a
96
- // caller following it always died on `unknown option '--extract'`. Name the
97
- // owning face explicitly; the flags stay the same, just correctly routed.
98
- return `omc artifact get ${artifactId} --summary(再 --keys/--jq);或回到产生它的那次 omc call 加 --extract <path> / --extract-keys(artifact get 没有 --extract,那里同义的是 --jq)`;
96
+ // has NO --extract (only --jq/--keys/--shape/--summary/--path-only/--full),
97
+ // so a caller following it always died on `unknown option '--extract'`. Name
98
+ // the owning face explicitly; the flags stay the same, just correctly routed.
99
+ return `omc artifact get ${artifactId} --shape(深度 2 嵌套骨架;--shape <path> 可切子树;取值用 --jq <path>);或回到产生它的那次 omc call 加 --extract <path> / --extract-keys(artifact get 没有 --extract,那里同义的是 --jq)`;
99
100
  }
100
101
  /** Replace local paths with a redaction marker (never leak the host layout). */
101
102
  function sanitizePaths(value) {
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
  }
@@ -552,6 +555,12 @@ export function describeTool(registry, name) {
552
555
  // 撞上之前没有任何发现面说过"写是环境级串行"——describe 的 params 里没有 wait
553
556
  // (它是 omc call 的 CLI 开关,不在工具 schema),capability notes 是空的。
554
557
  ...(tool.kind === "write" ? { writeLock: "写锁=环境级串行:并发写后到的回 write-lock-held(不排队,勿 shell 重试);CLI 可 --wait <ms> 排队" } : {}),
558
+ // R75-B(2026-11-18):写工具的 dry-run 到底覆盖到哪一层——full=与真写同门、
559
+ // partial=部分门、plan=只回 plan。回执里同样的 lintScope/unchecked 字段落地,
560
+ // 调用方在跑 dry-run 前就能知道「绿灯」意味着什么。
561
+ // 默认面只给一句话(full/partial/plan);未跑门类在 dry-run 回执的 unchecked
562
+ // 里给全。默认 describe 有 1,950B 天花板(data.submit 已贴边),详情不进默认面。
563
+ ...(tool.kind === "write" && tool.lintScope !== undefined ? { dryRunCoverage: tool.lintScope } : {}),
555
564
  };
556
565
  }
557
566
  /** Clamp to `limit` characters, ellipsis included — never cut mid-grapheme. */
@@ -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
- const ladder = ordered.map((id) => {
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: `${ordered.join("→")}${ordered.includes("businessrule") && /累加|联动|审计|规则触发|自动累加|自动回写/.test(goal) ? "(规则面不在本阶梯)" : ""}`, capabilities: ordered },
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 }