@stalfh233/omc-cli 0.6.50 → 0.6.52

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.
@@ -649,7 +649,8 @@ export function executableCapabilityBundle(registry, id) {
649
649
  * `--compact` keeps the mid-width shape (id/lane/intent/coverage/toolCount) it
650
650
  * has had since HANDOFF §三.3-7, so existing callers do not move.
651
651
  *
652
- * `legacy` (OMC_LEGACY_DISCOVERY=1) restores the pre-M2 default exactly.
652
+ * (r61)`legacy`(OMC_LEGACY_DISCOVERY)回滚档已按计划移除——M2 面经 R60
653
+ * 三路探针真机验证后退役。
653
654
  */
654
655
  export function compactCapabilities(registry, options = {}) {
655
656
  const index = capabilityRouteIndex(registry);
@@ -658,7 +659,7 @@ export function compactCapabilities(registry, options = {}) {
658
659
  // `omc capability <id>` 按需取。压缩档因此把 tools 换成 toolCount,并**明说**
659
660
  // 省略了工具名,不让读者误以为该能力没有工具。
660
661
  const compact = options.compact === true;
661
- const full = options.full === true || options.legacy === true || compact;
662
+ const full = options.full === true || compact;
662
663
  if (!full) {
663
664
  // Lean index. A single `id:toolCount` line instead of 18 objects: the
664
665
  // decision this face answers is "which family do I need", and the family's
package/dist/cli.js CHANGED
@@ -1297,7 +1297,7 @@ function cmdDiscovery(kind, transport, value, options = {}) {
1297
1297
  // catalogue must be requested with `commands --json` (round-9 heavy-task: an
1298
1298
  // agent paid 4×54 KB on the default face before any hint could land).
1299
1299
  if (options.json !== true && options.compact !== true && !scoped) {
1300
- result = commandIndex(registry, { legacy: legacyDiscovery() });
1300
+ result = commandIndex(registry);
1301
1301
  return emitProjectedResult({ status: "ok", ...result }, transport, options.jq);
1302
1302
  }
1303
1303
  const inventory = commandInventory(registry, { compact: options.compact === true });
@@ -1445,7 +1445,7 @@ function cmdDiscovery(kind, transport, value, options = {}) {
1445
1445
  }
1446
1446
  }
1447
1447
  else {
1448
- result = describeTool(registry, value ?? "", { legacy: legacyDiscovery() });
1448
+ result = describeTool(registry, value ?? "");
1449
1449
  // r28b 账本(2026-10-28):describe rule.save×11 / form.publish×9——firstCall 教学后
1450
1450
  // 仍反复全量 describe。同参数近期已 ok 时附降载提示,引导 --param/--example 精准取。
1451
1451
  // 无项目 ledger(golden/repo 测试/一次性运行)时 priorIdenticalSuccess 返回
@@ -1629,20 +1629,9 @@ async function cmdPlan(goal, options, transport) {
1629
1629
  * the tool registry, the coverage manifest, and the intent capability registry.
1630
1630
  */
1631
1631
  function cmdCapabilities(transport, options = {}, jq) {
1632
- const result = compactCapabilities(buildToolRegistry(), { ...options, legacy: legacyDiscovery() });
1632
+ const result = compactCapabilities(buildToolRegistry(), options);
1633
1633
  return emitProjectedResult({ status: "ok", ...result }, transport, jq);
1634
1634
  }
1635
- /**
1636
- * `OMC_LEGACY_DISCOVERY=1` — the 0.6.48 rollback switch (EXECUTION-PLAN §十).
1637
- *
1638
- * It restores the pre-M2 default faces byte-for-byte: bare `commands` with all
1639
- * rows, `capabilities` with the full projection, and the wide `describe`. The
1640
- * explicit flags (`--json`, `--full`, `--capability`) are unaffected — only the
1641
- * defaults move, so a caller that names what it wants never sees a difference.
1642
- */
1643
- function legacyDiscovery() {
1644
- return process.env.OMC_LEGACY_DISCOVERY === "1";
1645
- }
1646
1635
  function cmdCapability(id, transport, executable = false, jq) {
1647
1636
  const registry = buildToolRegistry();
1648
1637
  const resolved = resolveCapabilityId(id);
@@ -1766,7 +1755,7 @@ function intentDigest(intent) {
1766
1755
  };
1767
1756
  }
1768
1757
  /** Ticket 118 — `omc intent plan <file> --env <env>`: read-only baseline -> compile -> immutable plan. */
1769
- async function cmdIntentPlan(file, environment, planOut, transport) {
1758
+ async function cmdIntentPlan(file, environment, planOut, transport, summary = false) {
1770
1759
  const read = readIntentOrInvalid(file, transport);
1771
1760
  if (read.kind === "exit")
1772
1761
  return read.code;
@@ -1778,7 +1767,30 @@ async function cmdIntentPlan(file, environment, planOut, transport) {
1778
1767
  return emitInvalid(transport, { message: error instanceof Error ? error.message : String(error) });
1779
1768
  }
1780
1769
  }
1781
- return emitResult(await planIntent(read.intent, environment, planOut), transport);
1770
+ const result = await planIntent(read.intent, environment, planOut);
1771
+ // a-F12(r60a-F12,r61):--summary 档只回决策字段 + 逐项变更(tool+reason+资源
1772
+ // 键,去 args/baselineFingerprint)。内联完整 plan 一个真实需求 ~20KB、含基线
1773
+ // 50–60KB——探针只要「会改什么」时被整块计费。要 apply 仍用完整 plan(不带
1774
+ // --summary,或 --plan-out 写复核文件)。
1775
+ if (summary) {
1776
+ const plan = result.plan;
1777
+ if (plan !== undefined && Array.isArray(plan.changes)) {
1778
+ // r62c-F3(P0-4):resource 用编译器的资源标识(`field:model.code`),不从
1779
+ // args 猜——猜会降级成模型 code,3 个 field.create 无法区分(探针真机撞上)。
1780
+ return emitResult({
1781
+ ...result,
1782
+ plan: undefined,
1783
+ changesBrief: plan.changes.map((change) => ({
1784
+ tool: change.tool,
1785
+ ...(change.reason !== undefined ? { reason: change.reason } : {}),
1786
+ ...(change.resource !== undefined ? { resource: change.resource } : {}),
1787
+ })),
1788
+ summaryNote: "--summary 只回变更清单(去 args/基线);apply 用完整 plan(不带 --summary 或 --plan-out <file>)",
1789
+ }, transport);
1790
+ }
1791
+ // 已外置/已写文件的分支本就是决策字段面——原样返回。
1792
+ }
1793
+ return emitResult(result, transport);
1782
1794
  }
1783
1795
  /** Ticket 120 — `omc intent readback <file> --env <env>`: decode the live baseline back into intent shape and verify equivalence. */
1784
1796
  async function cmdIntentReadback(file, environment, transport) {
@@ -2858,8 +2870,8 @@ async function main() {
2858
2870
  const intentCommand = command.command("intent");
2859
2871
  intentCommand.command("schema").option("--example [id]").action((options) => { commandExitCode = cmdIntentSchema({ request, maxOutputBytes: CLI_DEFAULT_OUTPUT_BYTES }, typeof options.example === "string" ? options.example : undefined, options.example !== undefined); });
2860
2872
  intentCommand.command("validate <file>").option("--show-intent").action((file, options) => { commandExitCode = cmdIntentValidate(file, { request, maxOutputBytes: CLI_DEFAULT_OUTPUT_BYTES }, options.showIntent === true); });
2861
- intentCommand.command("plan <file>").option("--env <environment>").option("--plan-out <file>").option("--max-output-bytes <bytes>").action(async (file, options) => {
2862
- commandExitCode = await withTransport(options, request, (transport) => cmdIntentPlan(file, options.env, options.planOut, transport));
2873
+ intentCommand.command("plan <file>").option("--env <environment>").option("--plan-out <file>").option("--summary", "只回变更清单(tool+reason+资源键,去 args/基线)——复核用;apply 仍需完整 plan").option("--max-output-bytes <bytes>").action(async (file, options) => {
2874
+ commandExitCode = await withTransport(options, request, (transport) => cmdIntentPlan(file, options.env, options.planOut, transport, options.summary === true));
2863
2875
  });
2864
2876
  intentCommand.command("apply <file>").option("--env <environment>").option("--dry-run").option("--no-verify").option("--confirm-production").option("--wait <milliseconds>", "写锁冲突时的有界排队毫秒数(同 `omc call --wait`,默认 0=立刻拒绝)").option("--max-output-bytes <bytes>").action(async (file, options) => {
2865
2877
  const waitRaw = options.wait === undefined ? 0 : Number(options.wait);
package/dist/discovery.js CHANGED
@@ -111,24 +111,15 @@ export function commandInventory(registry, options = {}) {
111
111
  export function filterTools(registry, query) {
112
112
  return scoreTools(registry, query).map(({ name, via, score }) => ({ name, via, score }));
113
113
  }
114
- export function commandIndex(registry, options = {}) {
114
+ export function commandIndex(registry) {
115
115
  const byLane = new Map();
116
116
  for (const tool of registry) {
117
117
  const lane = tool.lane ?? "(unbound)";
118
118
  byLane.set(lane, (byLane.get(lane) ?? 0) + 1);
119
119
  }
120
120
  const lanes = [...byLane.entries()].sort((left, right) => left[0].localeCompare(right[0]));
121
- // `OMC_LEGACY_DISCOVERY=1` restores the pre-M2 face byte-for-byte (patch
122
- // rollback for 0.6.48, removed in 0.6.50 — EXECUTION-PLAN §十).
123
- if (options.legacy === true) {
124
- return {
125
- discovery: { authoritative: DISCOVERY_AUTHORITY.authoritative, route: DISCOVERY_AUTHORITY.route },
126
- toolCount: registry.length,
127
- lanes: lanes.map(([lane, tools]) => ({ lane, tools })),
128
- tools: registry.map((tool) => ({ name: tool.name, lane: tool.lane ?? null, kind: tool.kind })),
129
- hint: "裸 `commands` 是有界索引(name/lane/kind)。全量行用 `omc commands --json`;单能力用 `omc commands --json --compact --lane <lane>`;关键词用 `--filter <word>`;目标→路线优先 `omc next \"<目标>\"`。",
130
- };
131
- }
121
+ // (r61)`OMC_LEGACY_DISCOVERY` 回滚开关已按计划移除——M2 新面经 R60 三路探针
122
+ // 真机验证(plan 第一跳 8 次 / 全量目录 0 次),pre-M2 面不再保留。
132
123
  const routeCount = capabilityRouteIndex(registry).routes.length;
133
124
  return {
134
125
  discovery: { authoritative: DISCOVERY_AUTHORITY.authoritative, route: DISCOVERY_AUTHORITY.route },
@@ -507,7 +498,7 @@ const DATA_PARAMETER_NAMES = [
507
498
  * a missing param NAME costs an invalid_input round, and the R2 gate says bytes
508
499
  * must never be bought with rounds.
509
500
  */
510
- export function describeTool(registry, name, options = {}) {
501
+ export function describeTool(registry, name) {
511
502
  const tool = registry.find((entry) => entry.name === name);
512
503
  if (!tool)
513
504
  return undefined;
@@ -515,8 +506,6 @@ export function describeTool(registry, name, options = {}) {
515
506
  const { required, params } = compactParams(schema);
516
507
  const hasRecipe = (tool.executionMetadata?.recipes.length ?? 0) > 0;
517
508
  const firstCall = firstCallFor(tool);
518
- if (options.legacy === true)
519
- return legacyDescribeTool(tool, required, params, hasRecipe, firstCall);
520
509
  const recipes = tool.executionMetadata?.recipes ?? [];
521
510
  // Titles are how a caller picks among recipes; keep them while the list is
522
511
  // short, because above that the title text alone is the payload.
@@ -595,29 +584,6 @@ function leanFirstCall(firstCall) {
595
584
  readMore: firstCall.readMore,
596
585
  };
597
586
  }
598
- /** `OMC_LEGACY_DISCOVERY=1`: the pre-M2 default face, byte-for-byte. */
599
- function legacyDescribeTool(tool, required, params, hasRecipe, firstCall) {
600
- return {
601
- name: tool.name,
602
- lane: tool.lane ?? null,
603
- kind: tool.kind,
604
- summary: summarizeDescription(tool.description),
605
- required,
606
- params,
607
- examples: exampleList(tool),
608
- ...(firstCall !== undefined ? { firstCall } : {}),
609
- ...(hasRecipe ? { exampleHint: `可运行参数用 --example <id>(~1–2KB);单参数用 --param <name>;仅当二者都缺形状才 --full` } : {}),
610
- ...(!hasRecipe ? { exampleHint: `无静态 recipe:required + params 已够常规调用;单参数说明用 --param <name>;仅当需要全部参数注释/拒绝形状才 --full(5–20KB)` } : {}),
611
- ...(documentedParamNames(tool).length > 0
612
- ? { paramDocs: { available: documentedParamNames(tool), read: largeParamDocsHint(tool) } }
613
- : {}),
614
- ...(tool.paramEnums !== undefined ? { paramEnums: tool.paramEnums } : {}),
615
- ...(returnsFace(tool.name) ?? {}),
616
- ...(tool.kind === "write" ? { writeLock: "写锁=环境级:同一环境的并发写,后到的直接回 write-lock-held(不排队)。可带 --wait <ms> 让 CLI 内部排队(CLI 开关,不是本工具参数);不要写 shell 重试循环" } : {}),
617
- ...(tool.name.startsWith("data.") ? { parameterNames: DATA_PARAMETER_NAMES } : {}),
618
- full: `omc describe ${tool.name} --full(5–20KB;先试 --example/--param)`,
619
- };
620
- }
621
587
  /** Param names whose schema entry carries a `.describe()` (documented params). */
622
588
  function documentedParamNames(tool) {
623
589
  const shape = (tool.inputSchema ?? {});
package/dist/goal-plan.js CHANGED
@@ -82,6 +82,27 @@ async function planReadAsk(registry, goal, environment, options, base, match, ca
82
82
  });
83
83
  continue;
84
84
  }
85
+ // c-F12(r60c-F12,r61):点名对象在环境里**不存在**(rows 有但全不匹配)——
86
+ // 这是「替代口径需人裁决」的岔路,不是「从清单里选一个」。非交互 agent
87
+ // 没有提问通道,blocker 必须自带可复制的问句 + 互斥选项,让它能被当
88
+ // 「待裁决项」交回(探针 r60c-Q5 曾被迫两条路都跑:76 次 rule.list)。
89
+ if (hint.trim() !== "") {
90
+ // 问句短语截到「这类/的」为止(「差旅申请这类模型的单据…」→「差旅申请」),
91
+ // 问句要可辨识,不要整句复读。
92
+ const namedPhrase = hint.trim().replace(/(?:这类|这种|这些|一样的).*$/, "").replace(/的.*$/, "").slice(0, 16) || hint.trim().slice(0, 16);
93
+ blockers.push({
94
+ type: "needs-decision",
95
+ param: key,
96
+ reason: `目标句点名的「${namedPhrase}」在本环境不匹配任何模型(现有 ${rows.length} 个)——替代口径需人裁决`,
97
+ question: `「${namedPhrase}」在本环境不存在。要怎么处理?`,
98
+ options: [
99
+ `按最接近的现有模型替代回答(候选:${rows.slice(0, 3).map((row) => row.code).join("、")})`,
100
+ `全量扫 ${rows.length} 个模型的对应面(逐模型调用,输出全集)`,
101
+ `就报「不存在」,不做替代`,
102
+ ],
103
+ });
104
+ continue;
105
+ }
85
106
  ambiguities.push({ param: key, candidates: rows.slice(0, 10), question: "目标句里没有能对上平台的模型,选哪个?" });
86
107
  continue;
87
108
  }
@@ -105,7 +126,13 @@ async function planReadAsk(registry, goal, environment, options, base, match, ca
105
126
  if (statesCondition && !hasFilterValue) {
106
127
  const target = ["filter", "filters", "filterGroup"].find((key) => key in tool.inputSchema);
107
128
  if (target !== undefined) {
108
- const conditionWindow = goal.match(/[^;;,,。]{0,20}(大于|小于|等于|超过|低于|介于|不等|包含|为空|不为空|>|<|>=|<=|=)[^;;,,。]{0,12}/);
129
+ // P0-4b(r60c-F5 复验发现):20 字符前置窗口**硬截会把 token 撕裂**——
130
+ // 「crm_contract 里 contract_amount 大于」回显成「t 里 contract_amount 大于」,
131
+ // 谜语回显等于没回显。先试「分隔符定界」形(短语以空白/标点边界开始,
132
+ // 取到完整 token),无分隔符的纯中文短句再回退自由形。尾窗排除「的」,
133
+ // 让「…的单据有哪些」不进窗口(.replace 兜底保留)。
134
+ const conditionWindow = goal.match(/[\s;;,,。、((][^\s;;,,。、((]{1,24}\s*(?:大于|小于|等于|超过|低于|介于|不等|包含|为空|不为空)[^;;,,。的]{0,12}/) ??
135
+ goal.match(/[^;;,,。]{0,20}(?:大于|小于|等于|超过|低于|介于|不等|包含|为空|不为空|>|<|>=|<=|=)[^;;,,。的]{0,12}/);
109
136
  const conditionEcho = conditionWindow !== null ? conditionWindow[0].trim().replace(/\s*的.*$/u, "") : "问句里的筛选条件";
110
137
  const rangeOp = /大于|超过|>|>=|低于|小于|</.test(conditionEcho);
111
138
  missing[target] = {
@@ -913,6 +940,9 @@ export async function planGoal(registry, goal, options = {}) {
913
940
  const blockers = [];
914
941
  const probes = [];
915
942
  let probeFailure;
943
+ // b-F1(r60b-F1):问句点名「建模型 X」而 X 不存在时,建模不是拦路 blocker 而
944
+ // 是计划的第一步——s0 脚手架(model.create + field.publish),后续步骤照常用 X。
945
+ let scaffold;
916
946
  // ---- resolve one slot at a time -------------------------------------------------
917
947
  for (const [key, value] of Object.entries(rawArgs)) {
918
948
  // The environment is never a probe: `--env` already is the answer, and the
@@ -1021,6 +1051,24 @@ export async function planGoal(registry, goal, options = {}) {
1021
1051
  if (!needsValue) {
1022
1052
  ambiguities.push({ param: key, candidates: rows.slice(0, 10), question: `配方示例值「${hints[0]}」在本环境不存在,选哪个 ${key}?` });
1023
1053
  }
1054
+ else if (key === "schemaCode" && outcome.reason === "model-not-found" && scaffold === undefined &&
1055
+ /(?:建|新建|创建|搭建).{0,8}模型/.test(goal) &&
1056
+ scaffoldCodeFrom(goal) !== undefined) {
1057
+ // b-F1:多步链路的发现成本不能全落在人身上——「建 X 并配 Y」被 Y 的配方
1058
+ // 命中而 X 不存在时,老行为只回 blocker(探针被迫另起两轮找建模入口)。
1059
+ // 插 s0 建模脚手架,主步骤照常编译;字段清单是需求本体(needs-authoring
1060
+ // 语义),计划不猜——warning 指路 field.create。code 取问句里的 ASCII
1061
+ // 标识(hintCandidates 只出中文短语,认不出 r60b_leave 这类 code)。
1062
+ const scaffoldCode = scaffoldCodeFrom(goal);
1063
+ scaffold = { code: scaffoldCode };
1064
+ args[key] = scaffoldCode;
1065
+ // r62a-F1(P0-3):s0→s0p 中间没有字段步骤——发布的是**空模型**。
1066
+ // 计划看起来完整、实际中间是空的(探针真机:得自己插 CREATE 才能跑通)。
1067
+ // 字段清单是需求本体(needs-authoring),计划不猜;但必须明说空心,
1068
+ // 并指路 intent(一次编译全链,含字段)。
1069
+ warnings.push(`schemaCode: 目标模型 ${scaffoldCode} 尚不存在——已排 s0 建模脚手架,但 s0p 此刻发布的是**空模型**(本计划不替你猜字段清单):要么先补 field.create 再发布,要么整包需求改走声明式面(omc intent schema → validate → plan --env),字段/规则/流程一次编译`);
1070
+ continue;
1071
+ }
1024
1072
  else {
1025
1073
  blockers.push({ type: "blocked", param: key, reason: outcome.reason ?? "平台无匹配" });
1026
1074
  }
@@ -1082,7 +1130,7 @@ export async function planGoal(registry, goal, options = {}) {
1082
1130
  kind: tool.kind === "write" ? "write" : "read",
1083
1131
  purpose: recipe.title,
1084
1132
  args,
1085
- dependsOn: [...dependencies],
1133
+ dependsOn: scaffold !== undefined ? [...dependencies, "s0p"] : [...dependencies],
1086
1134
  validated,
1087
1135
  dryRun: dryRunFor(tool.name, args, tool),
1088
1136
  ...(() => {
@@ -1098,7 +1146,36 @@ export async function planGoal(registry, goal, options = {}) {
1098
1146
  const uncertain = probeFailure !== undefined;
1099
1147
  // Uncertain ⇒ NOTHING executable. The risk the review called out: a plan that
1100
1148
  // half-resolved ids still looks runnable, and a write lands against the wrong model.
1101
- const compiled = uncertain ? [] : [...priorCompiled.steps, mainStep];
1149
+ // b-F1(r60b-F1):scaffold 在最前——model.create(命名沿用问句原词)→ field.publish
1150
+ // (模型级一次发布),主步骤与 priors 的 dependsOn 声明指向 s0。
1151
+ const modelCreateTool = registry.find((entry) => entry.name === "model.create");
1152
+ const fieldPublishTool = registry.find((entry) => entry.name === "field.publish");
1153
+ const scaffoldStepCreate = scaffold === undefined || modelCreateTool === undefined
1154
+ ? undefined
1155
+ : {
1156
+ id: "s0",
1157
+ tool: "model.create",
1158
+ kind: "write",
1159
+ purpose: "b-F1 前置链:问句点名新建的模型不存在——建模是计划第一步(字段清单按需求补 field.create)",
1160
+ args: { ...(environment !== null ? { environment } : {}), name: scaffold.code, code: scaffold.code },
1161
+ dependsOn: [],
1162
+ validated: { ok: true, issues: [] },
1163
+ dryRun: { supported: true, command: `omc call model.create --dry-run --args '{"name":"${scaffold.code}","code":"${scaffold.code}"}'` },
1164
+ };
1165
+ const scaffoldStepPublish = scaffold === undefined || fieldPublishTool === undefined
1166
+ ? undefined
1167
+ : {
1168
+ id: "s0p",
1169
+ tool: "field.publish",
1170
+ kind: "write",
1171
+ purpose: "b-F1 前置链:模型级发布——注意此刻模型是空的(r62a-F1):字段清单是需求本体,先补 field.create 再发布,或改走 intent 声明式面一次编译全链",
1172
+ args: { ...(environment !== null ? { environment } : {}), schemaCode: scaffold.code },
1173
+ dependsOn: ["s0"],
1174
+ validated: { ok: true, issues: [] },
1175
+ dryRun: { supported: true, command: `omc call field.publish --dry-run --args '{"schemaCode":"${scaffold.code}"}'` },
1176
+ };
1177
+ const scaffoldSteps = [scaffoldStepCreate, scaffoldStepPublish].filter((step) => step !== undefined);
1178
+ const compiled = uncertain ? [] : [...scaffoldSteps, ...priorCompiled.steps, mainStep];
1102
1179
  // M4-2: dependencies are declared, so the order must be PROVEN, not assumed.
1103
1180
  const sorted = topoSort(compiled);
1104
1181
  if (sorted.cycle !== undefined) {
@@ -1223,6 +1300,19 @@ function hintFromGoal(goal, rawArgs) {
1223
1300
  * Several candidates are returned because the ask may name the object loosely;
1224
1301
  * the caller tries each against the platform's rows and takes the first unique hit.
1225
1302
  */
1303
+ /**
1304
+ * b-F1(r60b-F1):从问句提取「点名要新建的模型 code」。hintCandidates 只出
1305
+ * 中文短语,认不出 `r60b_leave` 这类 ASCII code——这里取问句里最长的 ASCII
1306
+ * 标识词,排除配方占位(omc_recipe_*)。无 ASCII 标识 → undefined(不成脚手架)。
1307
+ */
1308
+ export function scaffoldCodeFrom(goal) {
1309
+ const codes = [...goal.matchAll(/[A-Za-z][A-Za-z0-9_]{2,39}/g)]
1310
+ .map((match) => match[0])
1311
+ .filter((code) => !code.startsWith("omc_recipe_"));
1312
+ if (codes.length === 0)
1313
+ return undefined;
1314
+ return codes.reduce((best, code) => (code.length > best.length ? code : best));
1315
+ }
1226
1316
  export function hintCandidates(goal) {
1227
1317
  const quoted = goal.match(/[「"]([^」"]{2,20})[」"]/);
1228
1318
  const out = [];
@@ -12,7 +12,7 @@ import { listSkills, readSkillSection } from "./skills.js";
12
12
  */
13
13
  const SCOUT_CUES = ["能不能", "能不能够", "能否", "是否支持", "支持吗", "支持不支持", "可不可以", "有没有办法", "有没有可能", "怎么实现", "如何实现", "怎么写", "怎么配置"];
14
14
  const MODIFY_CUES = ["修改", "调整", "更新", "重命名", "改名", "编辑", "删除", "去掉", "移除", "改为", "改成"];
15
- const READ_CUES = ["查看", "读回", "盘点", "现状", "列出", "有哪些", "有没有", "检查", "审计", "导出", "只读", "看看", "看下", "查一下", "查询一下", "查一查", "梳理", "清点", "给我一份", "哪些", "是什么", "是否", "是否正确", "现有", "已有", "条数", "多少条", "数一下"];
15
+ const READ_CUES = ["查看", "读回", "盘点", "现状", "列出", "有哪些", "有没有", "检查", "审计", "导出", "只读", "看看", "看下", "查一下", "查询一下", "查一查", "梳理", "清点", "给我一份", "哪些", "是什么", "是否", "是否正确", "现有", "已有", "条数", "多少条", "数一下", "有几条", "几条", "有几个", "几个", "几笔", "多少个", "名单", "分布"];
16
16
  const BUILD_CUES = ["新建", "创建", "搭建", "从零", "从无到有", "做", "建", "加", "实现", "生成", "新增", "保存", "启用", "录入", "添加", "造", "填报", "打卡", "录"];
17
17
  /** Whole-application asks — a single-model atom is the wrong shape for these. */
18
18
  const WHOLE_APP_CUES = ["应用", "系统", "整套", "从零", "从无到有", "端到端", "一条龙", "一整套", "业务应用", "平台"];
@@ -749,7 +749,7 @@ function goalRouteInner(registry, goal) {
749
749
  // 聚合/计数问句的正确答案:data 能力**没有 group-by 工具**,诚实指路
750
750
  // data.list 拉全量 + `--jq` 投影自行计数;跨模型/大结果集才涉及报表章节。
751
751
  // 放在能力打分前,聚合词不再落进任何写阶梯(cue「分组」已从 app 移除)。
752
- if (readish && /(统计|分组|汇总|聚合|计数|条数|多少条|数一下)/.test(goal) && !WRITE_DESTINATION.test(goal)) {
752
+ if (readish && /(统计|分组|汇总|聚合|计数|条数|多少条|有几条|数一下)/.test(goal) && !WRITE_DESTINATION.test(goal)) {
753
753
  const dataRoute = routeById.get("data");
754
754
  if (dataRoute !== undefined) {
755
755
  const readTools = readToolsInLane(registry, dataRoute.lane);
@@ -951,7 +951,18 @@ function goalRouteInner(registry, goal) {
951
951
  // 会把真别名路由也拦掉(bizservice-recipes 别名测试实证)。
952
952
  if (!readish && !WHOLE_APP_CUES.some((cue) => goal.includes(cue))) {
953
953
  const aliasHit = bestAliasRecipe(registry, goal);
954
- if (aliasHit) {
954
+ // r62b-F1(真机复现,P0-1 第三层防御):「合同里金额大于50万的单据有几条」
955
+ // 被配方别名「金额大于」抢到 workflow 写配方——纯读问句拿到写工具,照做
956
+ // 会改生产流程。cue 词表(detectMode)是第一层,但问法无穷(「有几条/
957
+ // 名单/分布/给我拉一份」都可能是漏网的新词)。别名分支自身再判一次:
958
+ // 命中的配方是写工具、而问句带读尾缀时,别名不抢——落回正常能力阶梯
959
+ // (readish 路径会给读工具 + 聚合护栏的诚实指路)。
960
+ const READ_TAIL = /(几条|几个|几笔|多少|哪些|名单|分布|给我|拉一份|导出|统计|汇总|计数|条数)/;
961
+ const aliasToolKind = aliasHit === undefined ? undefined : registry.find((tool) => tool.name === aliasHit.tool)?.kind;
962
+ if (aliasHit && aliasToolKind === "write" && READ_TAIL.test(goal)) {
963
+ // fall through:读意图问句不带写别名路由
964
+ }
965
+ else if (aliasHit) {
955
966
  const action = `omc describe ${aliasHit.tool} --example ${aliasHit.recipe}`;
956
967
  return {
957
968
  status: "ok",
@@ -4,7 +4,7 @@ import { capabilityArg, environmentArg } from "../args.js";
4
4
  import { governedRead } from "../read.js";
5
5
  import { writeTool } from "../write.js";
6
6
  import { decodeJsonColumn, JSON_COLUMN_NULL_COALESCE } from "../json-column.js";
7
- import { applicationResolutionOf, applicationScopeHint, flattenTreeRows, resolveApplicationScope } from "../support.js";
7
+ import { applicationResolutionOf, applicationScopeHint, flattenTreeRows, resolveApplicationScope, suggestModelNames } from "../support.js";
8
8
  import { executeRuleSaveWrite, ruleNodeGraphArg } from "../rule-support.js";
9
9
  import { defineTool, ToolInputError, ToolRefusalError } from "../tool-types.js";
10
10
  import { resolveRuleRowId } from "../identity.js";
@@ -117,11 +117,20 @@ export function registerBusinessRuleLane(tools) {
117
117
  // 直接回 modelPresent:false + rules:[],**不发 list 请求**。
118
118
  const modelRecord = await readModelRecord(session, args.schemaCode);
119
119
  if (modelRecord === null) {
120
+ // r62b-F2(P1-5):带近名候选 + 可转发问句(plan 面 needs-decision 的
121
+ // call 面同款)——探针此前得自己翻 model.list 编问句。
122
+ const suggested = await suggestModelNames(session, args.schemaCode);
120
123
  return {
121
124
  schemaCode: args.schemaCode,
122
125
  modelPresent: false,
123
126
  rules: [],
124
127
  rulesCount: 0,
128
+ ...(suggested !== null
129
+ ? {
130
+ suggestedModels: suggested,
131
+ needsDecision: `未找到「${args.schemaCode}」,是否指 ${suggested.map((model) => `${model.code}(${model.name ?? model.code})`).join(" / ")}?`,
132
+ }
133
+ : {}),
125
134
  hint: "模型不存在(bizmodels/get_all 空)——未发 rule.list 请求(避免补建 7 条不可删预置);判定模型面用 model.inspect",
126
135
  };
127
136
  }
@@ -10,6 +10,7 @@ import { defineTool } from "../tool-types.js";
10
10
  import { resolveDataRuleRow } from "../identity.js";
11
11
  import { wireCall, wireRows, WireError } from "../wire.js";
12
12
  import { runtimeWriteWithAppMapping } from "../runtime-support.js";
13
+ import { suggestModelNames } from "../support.js";
13
14
  import { DATARULE_LANE_CONTRACT, DATARULE_TYPE_OPTION_KEYS } from "./datarule-contract.js";
14
15
  import { normalizeAggregationFormula } from "../field-families.js";
15
16
  import { CONDITION_PROTOCOL_EXAMPLES, dataRuleOptionsShapeError } from "./datarule-protocol.js";
@@ -809,12 +810,20 @@ export function registerDataRuleLane(tools) {
809
810
  // 不把平台 601003 原样 refused(三种读面反应不一致)。
810
811
  const modelRecord = await readModelRecord(session, args.schemaCode);
811
812
  if (modelRecord === null) {
813
+ // r62b-F2(P1-5):与 rule.list 同款近名候选 + 可转发问句。
814
+ const suggested = await suggestModelNames(session, args.schemaCode);
812
815
  return {
813
816
  schemaCode: args.schemaCode,
814
817
  dataRuleType: args.dataRuleType ?? null,
815
818
  modelPresent: false,
816
819
  rules: [],
817
820
  rulesCount: 0,
821
+ ...(suggested !== null
822
+ ? {
823
+ suggestedModels: suggested,
824
+ needsDecision: `未找到「${args.schemaCode}」,是否指 ${suggested.map((model) => `${model.code}(${model.name ?? model.code})`).join(" / ")}?`,
825
+ }
826
+ : {}),
818
827
  hint: "模型不存在(bizmodels/get_all 空)——空规则不是「已清干净的证据」也不是错误;判定模型面用 model.inspect",
819
828
  };
820
829
  }
@@ -865,7 +874,7 @@ export function registerDataRuleLane(tools) {
865
874
  writeTool({
866
875
  tools,
867
876
  name: "datarule.create",
868
- search: { intents: ["字段级校验", "给字段加校验", "给金额字段加校验", "校验规则", "提交校验", "字段校验", "金额校验"] },
877
+ search: { intents: ["字段级校验", "给字段加校验", "给金额字段加校验", "校验规则", "提交校验", "字段校验", "金额校验", "必填才能提交", "必须填", "不填不让提交"] },
869
878
  lane: DATARULE_LANE,
870
879
  scope: DATARULE_TOOLS["datarule.create"].scope,
871
880
  description: DATARULE_TOOLS["datarule.create"].description,
@@ -333,6 +333,12 @@ export function registerFieldLane(tools) {
333
333
  inputSchema: { environment: environmentArg, schemaCode: z.string(), published: z.boolean().default(false), code: z.string().optional(), fields: z.array(z.string()).optional(), full: z.boolean().optional().describe("行内联完整 options/subSchema;默认清单面只有 code/name/type/typeName(+conditions 信号/shapeWarning),验证 options 用 code/fields 选择器或 full:true;平台读面带回 propertyEmpty 时一并输出(不回则省略,不塞 false)"), all: z.boolean().optional().describe("默认只返业务字段(过滤 SYSTEM_FIELD_CODES 的 13 个平台字段:id/name/sequenceNo/createdTime/creater/sequenceStatus/…);true 连系统字段一起返"), capability: capabilityArg },
334
334
  handler: async (ctx, args, self) => governedRead(ctx, self, args, async (session) => {
335
335
  const rows = wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.schemaCode, isPublish: args.published ? "true" : "false" } })).data);
336
+ // r61 a-F9(r60a-F9):draft 面此前不报字段的发布态,行级缺 published 键
337
+ // 被读成「未发布」(null 三态歧义:未发布 vs 本面不返回)。多拉一次发布面
338
+ // code 集做行级双面比对——agent 一次清单就能回答「这个字段发布了吗」,
339
+ // 不必再跑 published:true 交叉核对。
340
+ const publishedCodes = new Set(wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.schemaCode, isPublish: "true" } })).data)
341
+ .map((row) => String(row.code ?? row.propertyCode)));
336
342
  const mapped = rows.map((row) => {
337
343
  const type = Number(row.type ?? row.propertyType);
338
344
  const typeLabel = fieldTypeLabel(row.type ?? row.propertyType);
@@ -345,6 +351,9 @@ export function registerFieldLane(tools) {
345
351
  return {
346
352
  code: fieldCode,
347
353
  name: row.name,
354
+ // r61 a-F9:行级发布态(双面比对)——true=已出现在发布面;false=仅草稿。
355
+ // 面级 `face` 是查询面选择器,与此行级键不同义。
356
+ published: publishedCodes.has(String(fieldCode)),
348
357
  ...(redundantNameI18n(row.name_i18n, row.name) ? {} : typeof row.name_i18n === "string" ? { name_i18n: row.name_i18n } : {}),
349
358
  type: row.type ?? row.propertyType,
350
359
  ...(typeLabel !== undefined ? { typeName: typeLabel } : {}),
@@ -411,6 +420,9 @@ export function registerFieldLane(tools) {
411
420
  type: field.type,
412
421
  ...(field.typeName !== undefined ? { typeName: field.typeName } : {}),
413
422
  ...(field.name !== undefined ? { name: field.name } : {}),
423
+ // r61 a-F9:inventory 面也带行级发布态(双面比对真值,一次清单
424
+ // 回答「这个字段发布了吗」)。
425
+ ...(field.published !== undefined ? { published: field.published } : {}),
414
426
  // Inventory answers "which columns did I author?" — system
415
427
  // columns are reported as a count, not mixed into the list.
416
428
  ...(businessCodes !== undefined ? { subColumnCodes: businessCodes } : {}),
@@ -434,6 +446,9 @@ export function registerFieldLane(tools) {
434
446
  // r45: 这是"本次查询的面选择器"回显(draft/published),不是字段发布状态——
435
447
  // 曾被误读为"字段未发布"。改名 face 消歧义;要查发布态用 field.publish 回读或详情面。
436
448
  face: args.published === true ? "published" : "draft",
449
+ // r61 a-F9:行级 `published`(true/false)是双面比对出的**字段发布态**;
450
+ // `face` 只是本次查询的面选择器——两键不同义,别再拿 face 推断发布态。
451
+ publishedNote: "行级 published=该字段是否已出现在发布面(双面比对);face=本次查询面(draft/published),不是字段发布态",
437
452
  ...(selector.length > 0 ? { selected: selector } : {}),
438
453
  ...(args.all !== true ? { businessOnly: true } : {}),
439
454
  fields: projected,
@@ -490,6 +505,8 @@ export function registerFieldLane(tools) {
490
505
  type: field.type,
491
506
  ...(field.typeName !== undefined ? { typeName: field.typeName } : {}),
492
507
  ...(field.name !== undefined ? { name: field.name } : {}),
508
+ // r61 a-F9:选择器面同样保留行级发布态(双面比对真值)。
509
+ ...(field.published !== undefined ? { published: field.published } : {}),
493
510
  ...(Array.isArray(field.subColumns) ? { subColumns: field.subColumns } : {}),
494
511
  ...(conditions.length > 0 ? { conditions } : {}),
495
512
  ...(field.shapeWarning !== undefined ? { shapeWarning: field.shapeWarning } : {}),
@@ -17,6 +17,26 @@ import { assertListViewConfigureShape, decodeActionRow, decodeButtonRow, decodeC
17
17
  export { assertListViewConfigureShape } from "./list-view-shapes.js";
18
18
  const LIST_VIEW_LANE = LIST_VIEW_LANE_CONTRACT.lane;
19
19
  const LIST_VIEW_TOOLS = LIST_VIEW_LANE_CONTRACT.tools;
20
+ /**
21
+ * r62a-F5 / r61 a-F14:列汇总(sumType)真值在呈现层 queryPresentation.columnsJson
22
+ * ——queryColumns 列树不回它。listview.get 与 listview.configure 的读回共用这个
23
+ * 合并映射,任何读面对同一配置给同一个答案(双面一致)。
24
+ */
25
+ function sumTypeByCodeFromPresentation(model) {
26
+ const out = new Map();
27
+ const rawPresentation = model.queryPresentation;
28
+ if (!rawPresentation || typeof rawPresentation !== "object")
29
+ return out;
30
+ const decodedColumns = decodePresentation(rawPresentation).columnsJson;
31
+ if (!Array.isArray(decodedColumns))
32
+ return out;
33
+ for (const column of decodedColumns) {
34
+ if (column && typeof column === "object" && typeof column.propertyCode === "string" && typeof column.sumType === "number") {
35
+ out.set(String(column.propertyCode), column.sumType);
36
+ }
37
+ }
38
+ return out;
39
+ }
20
40
  function fieldOptions(options) {
21
41
  if (typeof options === "string") {
22
42
  try {
@@ -284,11 +304,16 @@ export function registerListViewLane(tools) {
284
304
  return { schemaCode: args.schemaCode, code, present: false, note: "视图不存在(query/get 空或 302025);先 listview.create 或 listview.configure" };
285
305
  if (args.full === true)
286
306
  return { schemaCode: args.schemaCode, code, present: true, data: model };
307
+ // r62a-F5(P0-2):queryColumns 列树不含 sumType(恒 null/缺键),列汇总
308
+ // 真值在呈现层 queryPresentation.columnsJson——与 listview.configure 的
309
+ // 读回同规则合并,get 面不再逼探针翻 full 原始报文。
310
+ const sumTypeByCode = sumTypeByCodeFromPresentation(model);
287
311
  const columns = readArray(model, "queryColumns").map((column) => ({
288
312
  propertyCode: column.propertyCode,
289
313
  propertyType: column.propertyType,
290
314
  displayFormat: column.displayFormat,
291
315
  visible: column.visible,
316
+ sumType: sumTypeByCode.get(String(column.propertyCode)) ?? column.sumType ?? null,
292
317
  }));
293
318
  // Direction is decoded to the enum NAME (ASC/DESC) — the same shape
294
319
  // `listview.configure` reads back, so a get→configure round-trip does not
@@ -814,12 +839,17 @@ export function registerListViewLane(tools) {
814
839
  }
815
840
  const after = await wireCall(session, { path: ENDPOINTS.listQueryGet, query: { schemaCode: args.schemaCode, code, clientType: "PC" } });
816
841
  const afterModel = (after.data ?? {});
842
+ // r61 a-F14(r60a-F14 真机定性)+ r62a-F5(P0-2):`queryColumns` 列树**不回
843
+ // sumType**(投影恒 null),列汇总真值在呈现层 `queryPresentation.columnsJson`
844
+ // ——写入面也是它。两面各说各话曾让探针为对账「合计配上了吗」拉全量
845
+ // presentation(26KB artifact 的根因)。get 与 configure 共用合并映射。
846
+ const sumTypeByCode = sumTypeByCodeFromPresentation(afterModel);
817
847
  const afterCols = readArray(afterModel, "queryColumns").map((c) => ({
818
848
  propertyCode: c.propertyCode,
819
849
  propertyType: c.propertyType,
820
850
  displayFormat: c.displayFormat ?? null,
821
851
  visible: c.visible ?? null,
822
- sumType: c.sumType ?? null,
852
+ sumType: sumTypeByCode.get(String(c.propertyCode)) ?? c.sumType ?? null,
823
853
  }));
824
854
  const sorts = readArray(afterModel, "querySorts")
825
855
  .map(decodeSortRow)
@@ -289,7 +289,7 @@ export function registerPermLane(tools) {
289
289
  return { userId: args.userId, appCode: args.appCode, adminBypass, ...(adminBypass ? { adminNotice: "管理员会话恒通过,不代表普通用户;本回执是管理员旁路标记。" } : {}), app: { visible: bool(first(data, "visible", "appVisible")), administrator: bool(first(data, "administrator", "isAdministrator")), allVisible: bool(first(data, "allVisible")) }, models: authSummary(data).models, fields: args.schemaCode ? authSummary(data).fields : [], rowLevel: authSummary(data).rowLevel, layers: { configResolvable: true, runtimeSessionRequired: "真实 load/write 判定受对象权限/业务调用/临时流程授权影响——本工具拒绝单值 allow/deny;验证走目标用户会话或 data.load 双读" } };
290
290
  }) }));
291
291
  writeTool({ tools, name: "perm.assign", lane: PERM_LANE, scope: PERM_TOOLS["perm.assign"].scope, description: PERM_TOOLS["perm.assign"].description, search: { intents: ["把部门加到权限组", "授权权限组", "给权限组加成员"] }, inputSchema: { appCode: z.string().min(1), groupId: z.string().min(1), units: z.array(z.object({ type: z.enum(["DEPT", "ROLE", "USER"]), id: z.string().min(1), name: z.string().optional() })).min(1), mode: z.enum(["assign", "revoke"]) }, execute: async (session, args) => { const unitType = { DEPT: 1, ROLE: 2, USER: 3 }[args.units[0].type]; const units = args.units.map((u) => ({ unitId: u.id, unitType: { DEPT: 1, ROLE: 2, USER: 3 }[u.type], name: u.name ?? "", corpId: session.enterpriseId(), appCode: args.appCode, groupId: args.groupId })); const body = args.mode === "assign" ? { permissionGroupUnits: units, permGroupInfos: [{ appCode: args.appCode, permGroupId: args.groupId }] } : { permGroupIds: [args.groupId], unitIds: args.units.map((u) => u.id), permissionGroupUnits: units, permGroupInfos: [{ appCode: args.appCode, permGroupId: args.groupId }] }; const before = (await wireCall(session, { path: ENDPOINTS.permissionGroup, method: "GET", query: { id: args.groupId, appCode: args.appCode } })).data; const performed = await wireCall(session, { path: args.mode === "assign" ? ENDPOINTS.permissionAssign : ENDPOINTS.permissionRevoke, method: "POST", body }); const after = (await wireCall(session, { path: ENDPOINTS.permissionGroup, method: "GET", query: { id: args.groupId, appCode: args.appCode } })).data; const listAfter = (await wireCall(session, { path: ENDPOINTS.permissionGroupUnits, method: "POST", body: { ...units[0], unitType, appCode: args.appCode, corpId: session.enterpriseId() } })).data; return { performed: { errcode: performed.errcode, mode: args.mode }, readback: { groups: permissionGroupRows(listAfter).map(groupView), source: "post-write listPermissionGroups readback (not write echo)", diff: { before: projectMembers(before), after: projectMembers(after) } } }; } });
292
- writeTool({ tools, name: "perm.auth", lane: PERM_LANE, scope: PERM_TOOLS["perm.auth"].scope, description: PERM_TOOLS["perm.auth"].description, search: { intents: ["配模型权限", "设行级权限", "配数据权限"] }, inputSchema: { appCode: z.string().min(1), groupId: z.string().min(1), grants: z.array(z.object({ schemaCode: z.string().min(1), visible: z.object({ pc: z.boolean(), mobile: z.boolean() }).optional(), rowLevel: z.object({ type: z.number().int().min(1).max(6).describe("1=全部可见,2=本部门,3=仅自己,4=自定义(须 conditions),5=角色管理范围,6=均不可见"), conditions: z.array(z.array(z.unknown())).optional() }).optional(), properties: z.array(z.object({ propertyCode: z.string().optional(), schemaCode: z.string().optional().describe("可省略,继承 grants.schemaCode"), visible: z.boolean().optional(), writeAble: z.boolean().optional(), decryptAble: z.boolean().optional() })).optional(), actions: z.object({ view: z.array(z.string()).optional(), form: z.array(z.string()).optional() }).optional() })).min(1), mode: z.enum(["merge"]).default("merge") }, preflight: (args) => validateGrants(args.grants), execute: async (session, args) => { const group = (await wireCall(session, { path: ENDPOINTS.permissionGroup, method: "GET", query: { id: args.groupId, appCode: args.appCode } })).data; const existing = permissionRecords(group); const mergedRecords = []; const beforeRecords = []; for (const grant of args.grants) {
292
+ writeTool({ tools, name: "perm.auth", lane: PERM_LANE, scope: PERM_TOOLS["perm.auth"].scope, description: PERM_TOOLS["perm.auth"].description, search: { intents: ["配模型权限", "设行级权限", "配数据权限", "只能看自己的", "别让他看到", "只能看到自己提的"] }, inputSchema: { appCode: z.string().min(1), groupId: z.string().min(1), grants: z.array(z.object({ schemaCode: z.string().min(1), visible: z.object({ pc: z.boolean(), mobile: z.boolean() }).optional(), rowLevel: z.object({ type: z.number().int().min(1).max(6).describe("1=全部可见,2=本部门,3=仅自己,4=自定义(须 conditions),5=角色管理范围,6=均不可见"), conditions: z.array(z.array(z.unknown())).optional() }).optional(), properties: z.array(z.object({ propertyCode: z.string().optional(), schemaCode: z.string().optional().describe("可省略,继承 grants.schemaCode"), visible: z.boolean().optional(), writeAble: z.boolean().optional(), decryptAble: z.boolean().optional() })).optional(), actions: z.object({ view: z.array(z.string()).optional(), form: z.array(z.string()).optional() }).optional() })).min(1), mode: z.enum(["merge"]).default("merge") }, preflight: (args) => validateGrants(args.grants), execute: async (session, args) => { const group = (await wireCall(session, { path: ENDPOINTS.permissionGroup, method: "GET", query: { id: args.groupId, appCode: args.appCode } })).data; const existing = permissionRecords(group); const mergedRecords = []; const beforeRecords = []; for (const grant of args.grants) {
293
293
  const prior = existing.find((record) => String(first(record, "schemaCode", "functionCode") ?? "") === grant.schemaCode);
294
294
  if (!prior)
295
295
  throw new ToolRefusalError({ status: "refused", blocker: "permission-target-model-unknown", message: `权限组中不存在模型 ${grant.schemaCode};候选:${existing.map((record) => String(first(record, "schemaCode", "functionCode") ?? "")).filter(Boolean).join(", ")}` });
@@ -645,15 +645,20 @@ async function personFieldShapeViolations(session, schemaCode, formData) {
645
645
  */
646
646
  async function portalRequiredViolations(session, schemaCode, sheetCode, formData) {
647
647
  const sheet = ((await wireCall(session, { path: ENDPOINTS.sheetGet, query: { schemaCode, sheetCode } })).data ?? {});
648
- const face = typeof sheet.publishedAttributesJson === "string" ? sheet.publishedAttributesJson : typeof sheet.draftAttributesJson === "string" ? sheet.draftAttributesJson : undefined;
648
+ // r61 a-F15(r60a-F15):空数组有三态歧义——「表单无必填」「必填面读不到」
649
+ // 「必填但都填了」全回 []。探测面不可得时明说,别让 agent 把「读不到」
650
+ // 当「无必填」而跳过校验。
651
+ const publishedJson = typeof sheet.publishedAttributesJson === "string" ? sheet.publishedAttributesJson : undefined;
652
+ const draftJson = typeof sheet.draftAttributesJson === "string" ? sheet.draftAttributesJson : undefined;
653
+ const face = publishedJson ?? draftJson;
649
654
  if (!face)
650
- return { requiredFields: [], missingRequired: [] };
655
+ return { requiredFields: [], missingRequired: [], requiredFace: "unavailable" };
651
656
  let parsed;
652
657
  try {
653
658
  parsed = JSON.parse(face);
654
659
  }
655
660
  catch {
656
- return { requiredFields: [], missingRequired: [] };
661
+ return { requiredFields: [], missingRequired: [], requiredFace: "unavailable" };
657
662
  }
658
663
  const requiredFields = Object.entries(parsed)
659
664
  .filter(([, control]) => control?.options?.required === true || typeof control?.options?.requiredFormula === "string")
@@ -662,7 +667,7 @@ async function portalRequiredViolations(session, schemaCode, sheetCode, formData
662
667
  const value = formData[code];
663
668
  return value === null || value === undefined || (typeof value === "string" && value.trim() === "");
664
669
  });
665
- return { requiredFields, missingRequired };
670
+ return { requiredFields, missingRequired, requiredFace: publishedJson !== undefined ? "published" : "draft" };
666
671
  }
667
672
  /** 提交面:formData 里出现任何非空人员字段值即返回(issue#10:两种形状都可能 50000,可靠链路是提交省略)。 */
668
673
  async function staffFieldsPresent(session, schemaCode, formData) {
@@ -1060,7 +1065,7 @@ async function diagnoseDbException(session, schemaCode, error) {
1060
1065
  export function registerRuntimeDataLane(tools) {
1061
1066
  tools.push(defineTool({
1062
1067
  name: "data.list",
1063
- search: { intents: ["查业务数据", "查询数据", "查数据", "查记录", "查单据"] },
1068
+ search: { intents: ["查业务数据", "查询数据", "查数据", "查记录", "查单据", "统计数据", "汇总数据", "分组统计", "数条数", "总条数", "导出数据", "多少条", "有几条"] },
1064
1069
  layer: "low",
1065
1070
  kind: "read",
1066
1071
  lane: RUNTIME_LANE,
@@ -1855,7 +1860,7 @@ export function registerRuntimeDataLane(tools) {
1855
1860
  writeTool({
1856
1861
  tools,
1857
1862
  name: "data.update",
1858
- search: { intents: ["改一条记录", "编辑单据", "更新业务数据"] },
1863
+ search: { intents: ["改一条记录", "编辑单据", "更新业务数据", "改数据", "录错了改回来", "修正数据"] },
1859
1864
  lane: RUNTIME_LANE,
1860
1865
  scope: RUNTIME_TOOLS["data.update"].scope,
1861
1866
  description: RUNTIME_TOOLS["data.update"].description,
@@ -2200,7 +2205,7 @@ export function registerRuntimeDataLane(tools) {
2200
2205
  `确要在提交携带人员字段(个别平台构建接受),显式带 allowStaffOnSubmit:true 自担。`,
2201
2206
  });
2202
2207
  }
2203
- const validation = await portalRequiredViolations(session, args.schemaCode, sheetCode, args.formData ?? {}).catch(() => ({ requiredFields: [], missingRequired: [] }));
2208
+ const validation = await portalRequiredViolations(session, args.schemaCode, sheetCode, args.formData ?? {}).catch(() => ({ requiredFields: [], missingRequired: [], requiredFace: "unavailable" }));
2204
2209
  // Directive: a workflow-backed model's submit must START the workflow, not
2205
2210
  // merely save a sheet row. When the caller names no workflow params, detect
2206
2211
  // the model's workflow and start it (formType=1 + workflowCode); a model
@@ -2420,6 +2425,8 @@ export function registerRuntimeDataLane(tools) {
2420
2425
  schemaCode: typeof performedData.schemaCode === "string" ? performedData.schemaCode : args.schemaCode,
2421
2426
  formCode: typeof performedData.formCode === "string" ? performedData.formCode : sheetCode,
2422
2427
  sequenceStatus,
2428
+ // r62a-F7:无流程模型不存在待办——显式说明,null 不再歧义。
2429
+ workItemState: "none-no-workflow",
2423
2430
  ...(sequenceStatus === null ? { missingSequenceStatus: true } : {}),
2424
2431
  // r28b F2(真机 2026-11-05 复现):模型没配业务流水号时,平台把
2425
2432
  // `sequenceNo` 直接回填成 objectId 本身——32 位 hex 长得像单号,
@@ -2429,6 +2436,21 @@ export function registerRuntimeDataLane(tools) {
2429
2436
  ? { sequenceNoSource: "object-id", sequenceNoNote: "本模型未配置业务流水号:sequenceNo 回填的是 objectId 本身(不是生成的单号)。要单号请在模型上配序列号字段。" }
2430
2437
  : {}),
2431
2438
  submittedData: projectReadbackRecord(record, args),
2439
+ // r62a-F10(P1-9):无流程分支的 name 覆盖检测(与 approval 分支同款)——
2440
+ // 真机实证无流程模型也会把传入 name 换成「发起人+模型名+时间」标题。
2441
+ ...(() => {
2442
+ const wanted = (formData ?? {});
2443
+ const wantedName = typeof wanted.name === "string" && wanted.name.trim() !== "" ? wanted.name : null;
2444
+ const landedNameRaw = typeof record.name === "string"
2445
+ ? record.name
2446
+ : typeof (record.fields ?? {}).name === "string"
2447
+ ? String(record.fields.name)
2448
+ : null;
2449
+ const landedName = landedNameRaw !== null && landedNameRaw.trim() !== "" ? landedNameRaw : null;
2450
+ if (wantedName === null || landedName === null || landedName === wantedName)
2451
+ return {};
2452
+ return { nameOverridden: { wanted: wantedName, landed: landedName, note: "name 是平台数据标题(自动生成优先):传入值被覆盖,业务字段请用自有 code(如 title/subject)" } };
2453
+ })(),
2432
2454
  ...(serialGenerationFailed.length > 0
2433
2455
  ? { serialGenerationFailed, serialGenerationWarning: SERIAL_GENERATION_FAILURE_NOTE }
2434
2456
  : {}),
@@ -2479,8 +2501,32 @@ export function registerRuntimeDataLane(tools) {
2479
2501
  // The submit response often has no workItemId; when the engine created
2480
2502
  // the next todo, its first item is the authoritative continuation id.
2481
2503
  workItemId: typeof performedData.workItemId === "string" ? performedData.workItemId : null,
2504
+ // r62a-F7(P1-8):workItemId 裸 null 有三态歧义——「没有待办」「待办
2505
+ // 不在我名下(真答案曾只藏在 flowWarning 文案里)」「流程已走完」。
2506
+ // workItemState 显式判别,null 时读这个键。
2507
+ workItemState: sequenceStatus === "COMPLETED" ? "none-flow-completed"
2508
+ : hasWorkItem ? "consumed-by-this-submit"
2509
+ : "pending-or-none",
2482
2510
  sequenceStatus,
2483
2511
  submittedData: approvalDelta ? projectApprovalReadback(loadedRecord, Object.keys(formData ?? {})) : projectReadbackRecord(loadedRecord, args),
2512
+ // r62a-F10(P1-9):formData.name 是平台数据标题的**建议值**——引擎按
2513
+ // 「发起人+模型名+时间」生成标题时,传的 name 被静默替换且无告警(探针
2514
+ // 传「r62a_差旅-短程」得到「付文彬的差旅申请 2026-11-13 …」)。检测
2515
+ // 覆盖并点名,别让调用方以为标题没生效是 bug。
2516
+ ...(() => {
2517
+ const wanted = (formData ?? {});
2518
+ const landed = (loadedRecord ?? {});
2519
+ // data.load 的行形状 name 可能平铺或在 fields.name——两形都认。
2520
+ const landedFields = (landed.fields ?? {});
2521
+ const wantedName = typeof wanted.name === "string" && wanted.name.trim() !== "" ? wanted.name : null;
2522
+ const landedNameRaw = typeof landed.name === "string" ? landed.name : typeof landedFields.name === "string" ? landedFields.name : null;
2523
+ const landedName = landedNameRaw !== null && landedNameRaw.trim() !== "" ? landedNameRaw : null;
2524
+ if (wantedName === null || landedName === null || landedName === wantedName)
2525
+ return {};
2526
+ return {
2527
+ nameOverridden: { wanted: wantedName, landed: landedName, note: "name 是平台数据标题(自动生成优先):传入值被覆盖,业务字段请用自有 code(如 title/subject),不要用 name 承载业务语义" },
2528
+ };
2529
+ })(),
2484
2530
  ...(approvalDelta
2485
2531
  ? { readbackShape: "approval-delta", readbackHint: "审批提交默认只回 sequenceStatus + 本次提交的字段;要整条记录(含子表/系统字段)加 full:true,要指定字段加 fields:[...]" }
2486
2532
  : {}),
@@ -2565,6 +2611,8 @@ export function registerRuntimeDataLane(tools) {
2565
2611
  .map((person) => person.name ?? person.id)
2566
2612
  .filter((value) => typeof value === "string" && value.length > 0);
2567
2613
  const holders = holderNames.length > 0 ? holderNames.join("、") : "(参与人未回显)";
2614
+ // r62a-F7:主键同步——「待办在别处」从 flowWarning 文案提升为主键判别值。
2615
+ readback.workItemState = "pending-elsewhere";
2568
2616
  if (rejected) {
2569
2617
  readback.returnedTo = { activityCode: first.activityCode, activityName: first.activityName };
2570
2618
  readback.nextSubmit = {
@@ -2580,6 +2628,9 @@ export function registerRuntimeDataLane(tools) {
2580
2628
  activityCode: first.activityCode,
2581
2629
  activityName: first.activityName,
2582
2630
  participants: first.participants,
2631
+ // r62a-F7:主键 workItemState 同步改写——探针读主键就能判「在别处」,
2632
+ // 不必解析 warning 文案。
2633
+ workItemState: "pending-elsewhere",
2583
2634
  checks: [
2584
2635
  `omc call workflow.instanceActivity --args '{"workflowInstanceId":"${effectiveInstanceId}"}'`,
2585
2636
  `omc call workitem.list --args '{"workflowInstanceId":"${effectiveInstanceId}","participant":"<持有人 id>"}'`,
@@ -2702,11 +2753,26 @@ export function registerRuntimeDataLane(tools) {
2702
2753
  portalRulesNote: "portalRulesExecuted 只指门户客户端的必填/控件校验未在 REST 提交时执行;服务端业务规则(含流程 end 规则)照常运行。",
2703
2754
  requiredFields: validation.requiredFields,
2704
2755
  missingRequired: validation.missingRequired,
2756
+ requiredFace: validation.requiredFace,
2757
+ ...(validation.requiredFace === "unavailable"
2758
+ ? {
2759
+ requiredFieldsNote: "requiredFields:[] 是「必填面读不到」(sheetGet 未回 published/draftAttributesJson——模型未配自定义表单时常态),**不是「无必填」**:平台门户必填可能仍拦截运行时提交。要真值用 form.get --controls 读表单面。",
2760
+ }
2761
+ : {}),
2705
2762
  ...(validation.missingRequired.length > 0
2706
2763
  ? {
2707
2764
  portalValidationWarning: `已提交但**未执行门户必填校验**:${validation.missingRequired.join("、")} 在发布表单里是必填,本次 formData 为空/缺省。REST runtime/form/submit 不跑门户客户端校验;如需真正阻断,请在提交前自行校验,或在服务端规则里加必填约束。`,
2708
2765
  }
2709
2766
  : {}),
2767
+ // r61 a-F16(r60a-F16):无 id 提交=平台隐式 INSERT 新行——回执此前不
2768
+ // 区分「新建了一行」和「推进已有行」,对账(期望 N 条 vs 实际 N+1 条)
2769
+ // 只能靠 data.list 复核。显式点名新建路径,新行 id 就在 readback.objectId。
2770
+ ...(!hasWorkItem && args.bizObjectId === undefined
2771
+ ? {
2772
+ createdRow: true,
2773
+ createdNote: "无 id/workItem 提交=新建并提交(一调完成):本次 INSERT 了新记录行,readback.objectId 即新行 id。更新已有行用 data.save(带 id)或审批链 data.submit(带 workItemId)。",
2774
+ }
2775
+ : {}),
2710
2776
  // Round 16b (dogfood R1-R3): a submit can leave BOTH a draft row and a
2711
2777
  // committed row, and deleting only the committed id leaves the draft
2712
2778
  // behind (data.list still counts it). Name both ids so cleanup does not
@@ -2695,6 +2695,9 @@ export function registerWorkflowLane(tools) {
2695
2695
  });
2696
2696
  const body = await mergedTemplateBody(session, args.schemaCode, args.code, template, merge);
2697
2697
  validateWorkflowRender(body, "workflow.update");
2698
+ // r62a-F2(P1-6):条件枚举校验必须在 dry-run 同门跑——GE/GT= 这类直觉
2699
+ // 缩写此前只有真写才拒,dry-run 假绿(wouldChange:true 无 issues)。
2700
+ validateWorkflowRouteConditions(body, "workflow.update");
2698
2701
  const edgeKeys = (rules) => (Array.isArray(rules) ? rules : []).map((rule) => `${String(rule.preActivityCode ?? "")}->${String(rule.postActivityCode ?? "")}`);
2699
2702
  const beforeEdges = edgeKeys(draft.rules);
2700
2703
  const afterEdges = edgeKeys(body.rules);
@@ -3216,6 +3219,11 @@ export function registerWorkflowLane(tools) {
3216
3219
  .optional()
3217
3220
  .describe("可选:发布后绑定业务规则;每项 {handler?,ruleCodes[]},handler 取 start|cancel|activate|end(缺省 end)"),
3218
3221
  },
3222
+ // r62a-F2(P1-6):条件枚举校验进 preflight——semanticGate 在 dry-run 与真写
3223
+ // 都跑(r29c F1b 同门原则),GE/GT= 这类直觉缩写此前 dry-run 假绿、真写才拒。
3224
+ preflight: (args) => {
3225
+ validateWorkflowRouteConditions((args.template ?? {}), "configure_workflow");
3226
+ },
3219
3227
  plan: (args) => {
3220
3228
  const actions = [
3221
3229
  { tool: "workflow.create", args: { schemaCode: args.schemaCode, name: args.name, code: args.code } },
package/dist/plan.js CHANGED
@@ -27,8 +27,11 @@ export function planFingerprint(plan) {
27
27
  /**
28
28
  * r28g F8(真机 2026-11-05):dry-run 的 `*Summary` 只给键名 + sha256,把**最该
29
29
  * 自查的那段**(三层转义后的条件串)整个遮住——校验通过的结论看得见,被校验的
30
- * 内容看不见。这里补一个 `*Preview`:把**小**的字符串叶子原样列出(总长 ≤400B),
30
+ * 内容看不见。这里补一个 `*Preview`:把**小**的标量叶子原样列出(总长 ≤400B),
31
31
  * 超了就不给(还是回到摘要)。目的是"可自查形状",不是把正文搬回来。
32
+ * r62a-F10(P1-9):只收 string 会把数值/布尔叶子吞掉——探针 dry-run 提交
33
+ * {days:2, amount:1200.5} 时 formDataPreview 只见字符串字段,提交前无法核对
34
+ * 数值解析。扩展为全部标量(string/number/boolean)。
32
35
  */
33
36
  function smallStringPreview(value) {
34
37
  if (value === null || typeof value !== "object" || Array.isArray(value))
@@ -36,9 +39,9 @@ function smallStringPreview(value) {
36
39
  const out = {};
37
40
  let budget = 400;
38
41
  for (const [key, entry] of Object.entries(value)) {
39
- if (typeof entry !== "string")
42
+ if (typeof entry !== "string" && typeof entry !== "number" && typeof entry !== "boolean")
40
43
  continue;
41
- const bytes = Buffer.byteLength(entry, "utf8");
44
+ const bytes = Buffer.byteLength(String(entry), "utf8");
42
45
  if (bytes > budget)
43
46
  continue;
44
47
  budget -= bytes;
package/dist/read.js CHANGED
@@ -169,6 +169,23 @@ function compactReadback(result) {
169
169
  compact[key] = value.map(activityOfEntry).filter((entry) => entry !== undefined);
170
170
  compact[`${key}Count`] = value.length;
171
171
  }
172
+ else if (key === "rules" && Array.isArray(value)) {
173
+ // r62b-F3(P1-10):rules 折叠成 `rules:[]`+artifact 曾逼探针二次取回——
174
+ // 9 条规则连名字都看不到。瘦身版 [{code,name,enabled,defaultRule}] ~40B/条,
175
+ // **≤12 条**内联(~500B,回答「配了哪些规则/几条自建几条预置」);更大的
176
+ // 清单保持外置语义(readback-diet 的 token 经济不变),正文仍在 artifact。
177
+ if (value.length <= 12) {
178
+ const slim = value
179
+ .map((rule) => ({
180
+ code: typeof rule.code === "string" ? rule.code : null,
181
+ name: typeof rule.name === "string" ? rule.name : null,
182
+ ...(rule.enabled !== undefined ? { enabled: rule.enabled } : {}),
183
+ ...(rule.defaultRule !== undefined ? { defaultRule: rule.defaultRule } : {}),
184
+ }));
185
+ compact[key] = slim;
186
+ }
187
+ compact[`${key}Count`] = value.length;
188
+ }
172
189
  else if (BULKY_READ_KEYS.has(key)) {
173
190
  compact[`${key}Count`] = Array.isArray(value) ? value.length : value && typeof value === "object" ? Object.keys(value).length : 0;
174
191
  }
package/dist/support.js CHANGED
@@ -165,4 +165,55 @@ export async function mapBounded(items, limit, worker) {
165
165
  await Promise.all(runners);
166
166
  return results;
167
167
  }
168
+ /**
169
+ * r62b-F2(P1-5):call 面判定「模型不存在」时的近名候选(top3)。
170
+ * plan 面已有 needs-decision blocker(c-F12),call 面(rule.list / datarule.list
171
+ * 的 modelPresent:false)此前只回一句判定——探针为编一个可转发的问句得自己翻
172
+ * model.list 清单。计分用双向子串 + 共享 2-gram(不引编辑距离库,call 面只需
173
+ * 「最接近的几个」)。候选是加分项:树拉不到就回 null,绝不阻塞主判定。
174
+ */
175
+ export async function suggestModelNames(session, asked) {
176
+ try {
177
+ const scope = await resolveApplicationScope(session);
178
+ const tree = flattenTreeRows(wireRows((await wireCall(session, { path: ENDPOINTS.applicationTree, query: { appCode: scope.code } })).data));
179
+ const models = tree
180
+ .filter((row) => row.type === "BizModel" && typeof row.code === "string" && row.code)
181
+ .map((row) => ({ code: String(row.code), name: typeof row.name === "string" ? row.name : typeof row.text === "string" ? row.text : null }));
182
+ const needle = asked.trim().toLowerCase();
183
+ if (needle === "" || models.length === 0)
184
+ return null;
185
+ const bigrams = (text) => {
186
+ const normalized = text.toLowerCase();
187
+ const out = new Set();
188
+ for (let i = 0; i + 2 <= normalized.length; i++)
189
+ out.add(normalized.slice(i, i + 2));
190
+ return out;
191
+ };
192
+ const askedBigrams = bigrams(asked);
193
+ const scored = models
194
+ .map((model) => {
195
+ const haystack = `${model.code} ${model.name ?? ""}`.toLowerCase();
196
+ let score = 0;
197
+ if (haystack.includes(needle))
198
+ score += 10;
199
+ if (model.name !== null && needle.includes(model.name.toLowerCase()) && model.name.length >= 2)
200
+ score += 8;
201
+ const modelBigrams = bigrams(`${model.code}${model.name ?? ""}`);
202
+ let shared = 0;
203
+ for (const gram of askedBigrams)
204
+ if (modelBigrams.has(gram))
205
+ shared++;
206
+ score += shared;
207
+ return { model, score };
208
+ })
209
+ .filter((entry) => entry.score >= 2)
210
+ .sort((left, right) => right.score - left.score)
211
+ .slice(0, 3)
212
+ .map((entry) => entry.model);
213
+ return scored.length > 0 ? scored : null;
214
+ }
215
+ catch {
216
+ return null;
217
+ }
218
+ }
168
219
  //# sourceMappingURL=support.js.map
@@ -91,6 +91,13 @@ const TOOL_INPUT_ALIASES = Object.freeze({
91
91
  // 没有自己的 `code` 参数,无歧义)。
92
92
  "workflow.get_draft": Object.freeze({ workflowCode: ["code"] }),
93
93
  "workflow.get_published": Object.freeze({ workflowCode: ["code"] }),
94
+ // r62a-F4(P1-7):workflow.validate 是同族读面——写面(update/publish)用
95
+ // `code`、读面用 `workflowCode`,从 update 抄参数过来就被 unknown-keys 拒。
96
+ "workflow.validate": Object.freeze({ workflowCode: ["code"] }),
97
+ // r62c-F6(P1-7):模型 code 的键名分裂——model-purge 收 `--code`、
98
+ // model.delete/model.list 收 `schemaCode`、model.inspect 也收 `schemaCode`。
99
+ // 同一个概念(模型的 code)在读写面间换了名字,读面归一。
100
+ "model.inspect": Object.freeze({ schemaCode: ["code"] }),
94
101
  // field family: the platform's own column key is `propertyCode`; the tool's is
95
102
  // `code`. Same field, so the alias is safe either direction.
96
103
  "field.create": Object.freeze({ code: ["propertyCode"] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stalfh233/omc-cli",
3
- "version": "0.6.50",
3
+ "version": "0.6.52",
4
4
  "description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "commander": "14.0.3",
59
- "omc-core": "0.6.50",
59
+ "omc-core": "0.6.52",
60
60
  "proper-lockfile": "4.1.2",
61
61
  "write-file-atomic": "6.0.0",
62
62
  "zod": "^3.23.8",
@@ -74,6 +74,6 @@
74
74
  "directory": "packages/omc-cli"
75
75
  },
76
76
  "optionalDependencies": {
77
- "@stalfh233/omc-fake-platform": "0.6.50"
77
+ "@stalfh233/omc-fake-platform": "0.6.52"
78
78
  }
79
79
  }
@@ -1,27 +0,0 @@
1
- import { claim, declareLaneCoverage } from "./coverage-declaration.js";
2
- import { LANES } from "./lane-ids.js";
3
- /**
4
- * Organization writes (role group / role / members / management scope) sit on
5
- * the same live-proven template lane; the scopes below are claimed here so the
6
- * runtime gate can resolve them without a second manifest item.
7
- */
8
- export const ORGANIZATION_COVERAGE = declareLaneCoverage(LANES.workflow, [
9
- {
10
- capability: "W7 S29 greenfield workflow authoring",
11
- evidence: [
12
- "packages/omc-cli/src/lanes/organization.ts",
13
- "OpenAPI /api/v3/api-docs (1.1.25): organization/role/add_role, add_role_user, update_ouscope",
14
- ],
15
- tools: [
16
- claim("org.role.users", "organization role member read (role/users)"),
17
- claim("org.role.userScope", "organization role member management scope read (role/get_ouscope)"),
18
- claim("org.roleGroup.create", "organization role group create (role/add_role_group)"),
19
- claim("org.role.create", "organization role create (role/add_role)"),
20
- claim("org.role.update", "organization role update (role/modify_role)"),
21
- claim("org.role.addUsers", "organization role member add (role/add_role_user)"),
22
- claim("org.role.removeUsers", "organization role member remove (role/strike_out_role_user)"),
23
- claim("org.role.setUserScope", "organization role member scope update (role/update_ouscope)"),
24
- ],
25
- },
26
- ]);
27
- //# sourceMappingURL=organization-coverage.js.map