@stalfh233/omc-cli 0.6.81 → 0.6.82

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.
@@ -340,6 +340,7 @@
340
340
  "workflow.update",
341
341
  "workflow.publish",
342
342
  "workflow.bindRule",
343
+ "workflow.unbindRule",
343
344
  "workflow.setButtons",
344
345
  "workflow.delete",
345
346
  "workflow.permissions",
@@ -1130,7 +1131,8 @@
1130
1131
  "service.dbconnpool.delete",
1131
1132
  "service.adapter_config",
1132
1133
  "service.table_list",
1133
- "service.table_sql"
1134
+ "service.table_sql",
1135
+ "servicelog.search"
1134
1136
  ],
1135
1137
  "scopes": [
1136
1138
  "readback",
@@ -1142,7 +1144,8 @@
1142
1144
  "method update readback",
1143
1145
  "method delete readback",
1144
1146
  "create readback",
1145
- "delete readback"
1147
+ "delete readback",
1148
+ "log readback"
1146
1149
  ]
1147
1150
  },
1148
1151
  {
package/dist/artifacts.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createHash, randomUUID } from "node:crypto";
2
2
  import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
3
- import { isAbsolute, join, relative, resolve } from "node:path";
3
+ import { basename, isAbsolute, join, relative, resolve } from "node:path";
4
4
  export const CLI_DEFAULT_OUTPUT_BYTES = 64 * 1024;
5
5
  export const CLI_MAX_OUTPUT_BYTES = 4 * 1024 * 1024;
6
6
  function artifactPath(root, artifactId) {
@@ -79,16 +79,39 @@ export function isWithinRoot(root, candidate) {
79
79
  * assertSafeInputPath's containment rule, but the file need not exist yet).
80
80
  * `omc intent plan --plan-out` uses it so the written plan is readable by
81
81
  * `omc intent apply`, which enforces the same root.
82
+ *
83
+ * Issue 06(retro 2026-11-19):Windows 用户拿系统 temp 被拒后不知道往哪写——
84
+ * ① 越界拒绝时错误直接给出根内**可用的绝对示例路径**(`<root>/artifacts-out/<原名>`),
85
+ * 看一眼错误就知道下一步敲什么;② 根内目标的父目录自动创建(mkdir -p 语义,
86
+ * 仅限根内——越界路径仍然先拒,不建任何根外目录)。
82
87
  */
83
88
  export function assertSafeOutputPath(root, candidate, label) {
89
+ const resolvedRoot = resolve(root);
84
90
  const normalized = resolve(root, candidate);
85
91
  if (!isWithinRoot(root, normalized))
86
- throw new Error(`${label} must be inside the configuration root(配置根 ${resolve(root)};本次解析为 ${normalized})`);
92
+ throw new Error(`${label} must be inside the configuration root(配置根 ${resolvedRoot};本次解析为 ${normalized})。` +
93
+ `可改用根内绝对路径,如 ${join(resolvedRoot, "artifacts-out", basename(normalized))}(父目录会自动创建)`);
87
94
  const parent = resolve(normalized, "..");
88
95
  if (!existsSync(parent))
89
- throw new Error(`${label} parent directory does not exist`);
90
- if (lstatSync(parent).isSymbolicLink())
91
- throw new Error(`${label} cannot be inside a symbolic link`);
96
+ mkdirSync(parent, { recursive: true, mode: 0o700 });
97
+ // 根内逐段查符号链接(与 assertSafeInputPath 同规则):mkdir -p 会穿过指向根外
98
+ // 的符号链接目录,词法包含检查看不见——每段 lstat 才能守住「只在根内写」。
99
+ let current = parent;
100
+ while (current !== resolvedRoot) {
101
+ try {
102
+ if (lstatSync(current).isSymbolicLink())
103
+ throw new Error(`${label} cannot be inside a symbolic link`);
104
+ }
105
+ catch (error) {
106
+ if (error instanceof Error && error.message === `${label} cannot be inside a symbolic link`)
107
+ throw error;
108
+ throw new Error(`${label} does not exist`);
109
+ }
110
+ const up = resolve(current, "..");
111
+ if (up === current)
112
+ throw new Error(`${label} must be inside the configuration root`);
113
+ current = up;
114
+ }
92
115
  if (existsSync(normalized)) {
93
116
  if (lstatSync(normalized).isSymbolicLink())
94
117
  throw new Error(`${label} cannot be a symbolic link`);
@@ -141,8 +141,8 @@ const SURFACES = [
141
141
  id: "workflow",
142
142
  title: "流程模板 + 组织与权限",
143
143
  lane: LANES.workflow,
144
- description: "流程模板生命周期:workflow.list(应用内流程清单)、get_draft/get_published、create、update、publish、bindRule、delete、workitem.list。**含组织/部门/角色/权限范围(org.* 工具)**:部门树、角色组/角色、用户搜索、成员与管理范围(userScope)——流程参与人/可见性的候选来源。",
145
- operations: ["list", "create", "update", "publish", "bindRule", "delete"],
144
+ description: "流程模板生命周期:workflow.list(应用内流程清单)、get_draft/get_published、create、update、publish、bindRule/unbindRule(绑定与解绑)、delete、workitem.list。**含组织/部门/角色/权限范围(org.* 工具)**:部门树、角色组/角色、用户搜索、成员与管理范围(userScope)——流程参与人/可见性的候选来源。",
145
+ operations: ["list", "create", "update", "publish", "bindRule", "unbindRule", "delete"],
146
146
  requires: ["model"],
147
147
  intent: { level: "partial", note: "声明式支持 workflow.create/update/publish 与 bindRules(事件处理器规则绑定,merge/ensure-present);runtime workitem(提交/审批)仍走 escape hatch。" },
148
148
  notes: "greenfield 首版;publish/bindRule 不得在 ValidateMessage[] 拒绝时报告成功。组织读写(org.*)挂在本能力下,别名 org/organization/organisation。r64 起含**流程运维三件套**(workflow.transfer 换审批人 / workflow.activate 跳转节点 / workflow.finish 手动结束·end 规则照常触发)——测试提速定位:运维过的实例权限语义已变,不能用于真实流程/权限验证。",
@@ -171,8 +171,8 @@ const SURFACES = [
171
171
  id: "bizservice",
172
172
  title: "业务集成",
173
173
  lane: LANES.b2,
174
- description: "业务服务与方法注册(RESTFUL/DATA_SQL/DATA_TABLE/SAP/KAFKA/SOAP)、服务清单(按分类/关键词,凭据不回显)、导入导出、设计器测试。",
175
- operations: ["list", "register", "update", "delete", "export", "import", "check", "test"],
174
+ description: "业务服务与方法注册(RESTFUL/DATA_SQL/DATA_TABLE/SAP/KAFKA/SOAP)、服务清单(按分类/关键词,凭据不回显)、导入导出、设计器测试、调用日志(h_log_biz_service 读面:params/result/状态/耗时)。",
175
+ operations: ["list", "register", "update", "delete", "export", "import", "check", "test", "log"],
176
176
  requires: [],
177
177
  intent: { level: "partial", note: "声明式支持新建 service.register(可带一个 method)与既有 service/method 的 update(结构化 config、AES 加密、patch 语义);删除、给既有服务加方法、分类/连接池/IE 仍走 escape hatch。" },
178
178
  notes: "方法 configJson 走 AES-128-ECB;RESTFUL/DATA_SQL 绑定前须带适配器必需配置(否则是注册壳)。",
package/dist/cli.js CHANGED
@@ -24,6 +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 { sessionAccountForEnvironment } from "./session-account.js";
27
28
  import { artifactPathMissHint, nullProjectionHint, partialPathMissHint, pathMissDidYouMean, projectJsonPath, projectJsonPathFanout, projectResultExtract, shapeOf, SHAPE_MAX_DEPTH, unwrapSinglePathProjection } from "./path-projection.js";
28
29
  import { basename, join, resolve } from "node:path";
29
30
  import { existsSync, readFileSync, writeFileSync, chmodSync } from "node:fs";
@@ -392,39 +393,41 @@ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
392
393
  */
393
394
  async function cmdBatchCall(store, toolName, rawList, options) {
394
395
  const request = options.requestValue ?? requestId();
396
+ // issue 07:批量面同款——汇总信封(含 preflight)都带 resultMeta.sessionAccount。
397
+ const accountMeta = () => ({ sessionAccount: sessionAccountForEnvironment(store, options.environment) });
395
398
  let parsed;
396
399
  try {
397
400
  parsed = JSON.parse(rawList);
398
401
  }
399
402
  catch (error) {
400
403
  const message = `--args-list 必须是 JSON 数组:${error instanceof Error ? error.message : String(error)}`;
401
- writeEnvelope(envelope("error", {}, request, { code: "invalid-input", message, retryable: false }));
404
+ writeEnvelope({ ...envelope("error", {}, request, { code: "invalid-input", message, retryable: false }), resultMeta: accountMeta() });
402
405
  return CLI_EXIT_CODES.invalidInput;
403
406
  }
404
407
  if (!Array.isArray(parsed)) {
405
- writeEnvelope(envelope("error", {}, request, { code: "invalid-input", message: "--args-list 必须是 JSON 数组(每条是一个 args 对象)", retryable: false }));
408
+ writeEnvelope({ ...envelope("error", {}, request, { code: "invalid-input", message: "--args-list 必须是 JSON 数组(每条是一个 args 对象)", retryable: false }), resultMeta: accountMeta() });
406
409
  return CLI_EXIT_CODES.invalidInput;
407
410
  }
408
411
  const entries = parsed;
409
412
  const badIndex = entries.findIndex((entry) => entry === null || typeof entry !== "object" || Array.isArray(entry));
410
413
  if (badIndex >= 0) {
411
- writeEnvelope(envelope("error", {}, request, {
412
- code: "invalid-input",
413
- message: `--args-list 第 ${badIndex} 条不是对象(每条必须是 {"字段":值} 形状)`,
414
- retryable: false,
415
- }));
414
+ writeEnvelope({ ...envelope("error", {}, request, {
415
+ code: "invalid-input",
416
+ message: `--args-list 第 ${badIndex} 条不是对象(每条必须是 {"字段":值} 形状)`,
417
+ retryable: false,
418
+ }), resultMeta: accountMeta() });
416
419
  return CLI_EXIT_CODES.invalidInput;
417
420
  }
418
421
  if (entries.length === 0) {
419
- writeEnvelope(envelope("error", {}, request, { code: "invalid-input", message: "--args-list 至少一条", retryable: false }));
422
+ writeEnvelope({ ...envelope("error", {}, request, { code: "invalid-input", message: "--args-list 至少一条", retryable: false }), resultMeta: accountMeta() });
420
423
  return CLI_EXIT_CODES.invalidInput;
421
424
  }
422
425
  if (entries.length > BATCH_MAX_ENTRIES) {
423
- writeEnvelope(envelope("error", {}, request, {
424
- code: "invalid-input",
425
- message: `--args-list 最多 ${BATCH_MAX_ENTRIES} 条(本次 ${entries.length});分批执行或用 omc script 读文件`,
426
- retryable: false,
427
- }));
426
+ writeEnvelope({ ...envelope("error", {}, request, {
427
+ code: "invalid-input",
428
+ message: `--args-list 最多 ${BATCH_MAX_ENTRIES} 条(本次 ${entries.length});分批执行或用 omc script 读文件`,
429
+ retryable: false,
430
+ }), resultMeta: accountMeta() });
428
431
  return CLI_EXIT_CODES.invalidInput;
429
432
  }
430
433
  try {
@@ -432,11 +435,11 @@ async function cmdBatchCall(store, toolName, rawList, options) {
432
435
  validateAgentPaths(entry);
433
436
  }
434
437
  catch (error) {
435
- writeEnvelope(envelope("error", {}, request, {
436
- code: "invalid-input",
437
- message: `--args-list 含越界路径:${error instanceof Error ? error.message : String(error)}`,
438
- retryable: false,
439
- }));
438
+ writeEnvelope({ ...envelope("error", {}, request, {
439
+ code: "invalid-input",
440
+ message: `--args-list 含越界路径:${error instanceof Error ? error.message : String(error)}`,
441
+ retryable: false,
442
+ }), resultMeta: accountMeta() });
440
443
  return CLI_EXIT_CODES.invalidInput;
441
444
  }
442
445
  // Whole-batch shape precheck (issue 2026-10-25 §6): `--args-list --dry-run`
@@ -449,7 +452,7 @@ async function cmdBatchCall(store, toolName, rawList, options) {
449
452
  const registry = buildToolRegistry();
450
453
  const tool = registry.find((definition) => definition.name === toolName);
451
454
  if (!tool) {
452
- writeEnvelope(envelope("error", {}, request, { code: "invalid-input", message: `unknown tool ${toolName};用 omc next 或 omc commands --json --compact --lane <lane> 定位`, retryable: false }));
455
+ writeEnvelope({ ...envelope("error", {}, request, { code: "invalid-input", message: `unknown tool ${toolName};用 omc next 或 omc commands --json --compact --lane <lane> 定位`, retryable: false }), resultMeta: accountMeta() });
453
456
  return CLI_EXIT_CODES.invalidInput;
454
457
  }
455
458
  const failures = [];
@@ -496,7 +499,10 @@ async function cmdBatchCall(store, toolName, rawList, options) {
496
499
  ? unwrapSinglePathProjection(result)
497
500
  : undefined;
498
501
  const envelopeValue = envelope(classified.status, unwrapped !== undefined ? unwrapped.result : result, request, classified.error);
499
- writeEnvelope(unwrapped !== undefined ? { ...envelopeValue, resultMeta: unwrapped.resultMeta } : envelopeValue);
502
+ writeEnvelope({
503
+ ...envelopeValue,
504
+ resultMeta: { sessionAccount: accountMeta().sessionAccount, ...(unwrapped?.resultMeta ?? {}) },
505
+ });
500
506
  return failures.length > 0 ? 1 : 0;
501
507
  }
502
508
  const batched = await runBatchCall({
@@ -507,18 +513,23 @@ async function cmdBatchCall(store, toolName, rawList, options) {
507
513
  requestId: request,
508
514
  });
509
515
  const classified = classifyResult(batched.result);
510
- writeEnvelope(envelope(classified.status, batched.result, request, classified.error));
516
+ writeEnvelope({ ...envelope(classified.status, batched.result, request, classified.error), resultMeta: accountMeta() });
511
517
  return batched.exitCode;
512
518
  }
513
519
  async function cmdCall(store, args) {
514
520
  const request = flag0(args, "--request-id") ?? requestId();
521
+ // issue 07(retro 2026-11-19):每次 omc call 的回执(成功与错误信封)都带
522
+ // resultMeta.sessionAccount——token 解码(0 wire),解不出就回 unavailableReason,
523
+ // 不谎报。环境旗标解析出来之前 callEnvironment 是 undefined,按默认环境解析。
524
+ let callEnvironment;
525
+ const accountMeta = () => ({ sessionAccount: sessionAccountForEnvironment(store, callEnvironment) });
515
526
  let maxOutputBytes;
516
527
  try {
517
528
  maxOutputBytes = outputBudget(args);
518
529
  }
519
530
  catch (error) {
520
531
  const message = error instanceof Error ? error.message : String(error);
521
- writeEnvelope(envelope("error", {}, request, { code: "invalid-input", message, retryable: false }));
532
+ writeEnvelope({ ...envelope("error", {}, request, { code: "invalid-input", message, retryable: false }), resultMeta: accountMeta() });
522
533
  return CLI_EXIT_CODES.invalidInput;
523
534
  }
524
535
  const emit = (status, result, exitCode, extra) => {
@@ -528,7 +539,11 @@ async function cmdCall(store, args) {
528
539
  const envelopeValue = envelope(status, boundResult(result, maxOutputBytes), request, classified.error);
529
540
  // issue 2026-11-18 §05:单路径 --jq 解包后,`result` 是目标节点本体(可能是
530
541
  // 数组/标量,装不进结果对象),路径来源等元信息放信封旁的 `resultMeta`。
531
- writeEnvelope(extra !== undefined ? { ...envelopeValue, ...extra } : envelopeValue);
542
+ // issue 07:sessionAccount 恒在 resultMeta(瘦身影封保留 resultMeta)。
543
+ writeEnvelope({
544
+ ...envelopeValue,
545
+ ...(extra !== undefined ? { ...extra, resultMeta: { sessionAccount: accountMeta().sessionAccount, ...(extra.resultMeta ?? {}) } } : { resultMeta: accountMeta() }),
546
+ });
532
547
  maybeWarnMergedStreams();
533
548
  return exitCode;
534
549
  };
@@ -551,9 +566,10 @@ async function cmdCall(store, args) {
551
566
  console.error("用法:omc call <tool> [--env <环境>] [--args '<json>' | --args - (stdin) | --args-file <配置根内路径(必须位于配置根内;数组批量请改用 --args-list;跨目录临时文件用 --args -(stdin))>] [--extract <path>]... [--jq [path]] [--extract-keys] [--args-list <json数组>(最多 200 条;超出请分批或用 omc script 读文件) [--preflight]]");
552
567
  console.error("输出预算:--max-output-bytes 默认 65536(只约束最终 stdout 信封;读面 diet ~2048 独立外置 detailArtifactId);artifact get 内联上限 8192");
553
568
  console.error("写入:由环境 writable 决定(只读环境拒写);生产环境的写必须在 args 里带 confirmProduction:true。");
569
+ console.error("会话账号:每次回执 resultMeta.sessionAccount(token 解码:id=user_id、username=user_name、name=登录显示名;解不出回 unavailableReason)。报错里的 currentUser 是平台按 username 反查的 id,同名多账号时与 id 不同——排查 not-mine 先看这两个是否同一个人。");
554
570
  return emit(toolName && toolName !== "help" ? "error" : "ok", {}, toolName && toolName !== "help" ? CLI_EXIT_CODES.invalidInput : 0);
555
571
  }
556
- const environment = flag("--env") ?? flag("--environment");
572
+ const environment = (callEnvironment = flag("--env") ?? flag("--environment"));
557
573
  const requestValue = flag("--request-id");
558
574
  // Batch mode: the SAME tool N times, one process (r12: 36 field.create calls).
559
575
  const argsList = flag("--args-list");
@@ -561,7 +577,7 @@ async function cmdCall(store, args) {
561
577
  return cmdBatchCall(store, toolName, argsList, { environment, requestValue, args, preflight: args.includes("--preflight") });
562
578
  if (args.includes("--preflight")) {
563
579
  const message = "--preflight 仅用于 --args-list 批量形状;单次调用没有批量预检语义。请改用 --args-list,或移除 --preflight 后执行单次调用。";
564
- writeEnvelope(envelope("error", {}, request, { code: "invalid-input", message, retryable: false }));
580
+ writeEnvelope({ ...envelope("error", {}, request, { code: "invalid-input", message, retryable: false }), resultMeta: accountMeta() });
565
581
  return CLI_EXIT_CODES.invalidInput;
566
582
  }
567
583
  // 1.2 of issue 2026-10-23: read faces answer {detailArtifactId, sha256} and the
@@ -590,7 +606,7 @@ async function cmdCall(store, args) {
590
606
  waitMs = Number(waitValue);
591
607
  if (!Number.isSafeInteger(waitMs) || waitMs < 0 || waitMs > 600_000) {
592
608
  const message = "--wait must be an integer number of milliseconds from 0 to 600000";
593
- writeEnvelope(envelope("error", {}, request, { code: "invalid-input", message, retryable: false }));
609
+ writeEnvelope({ ...envelope("error", {}, request, { code: "invalid-input", message, retryable: false }), resultMeta: accountMeta() });
594
610
  return CLI_EXIT_CODES.invalidInput;
595
611
  }
596
612
  }
@@ -607,7 +623,7 @@ async function cmdCall(store, args) {
607
623
  }
608
624
  catch (error) {
609
625
  const message = error instanceof Error ? error.message : String(error);
610
- writeEnvelope(envelope("error", {}, request, { code: "invalid-input", message, retryable: false }));
626
+ writeEnvelope({ ...envelope("error", {}, request, { code: "invalid-input", message, retryable: false }), resultMeta: accountMeta() });
611
627
  return CLI_EXIT_CODES.invalidInput;
612
628
  }
613
629
  if (timeoutMs !== undefined)
@@ -661,7 +677,7 @@ async function cmdCall(store, args) {
661
677
  // Keep the REJECTED path on stderr only: the machine envelope must not leak
662
678
  // host layout (ticket 103), so it carries the root plus the bare file name.
663
679
  const rejectedName = typeof argsFile === "string" ? basename(resolve(configRoot, argsFile)) : "";
664
- writeEnvelope(envelope("error", {}, request, { code: "invalid-input", message: outOfRoot ? `--args-file 必须位于配置根内(配置根 ${configRoot}${rejectedName ? `;本次文件 ${rejectedName}` : ""})。免落盘替代:--args - 从 stdin 读 JSON(echo '<json>' | omc call <tool> --args -),或把文件放进配置根后再引用;限制是为了防参数文件携带凭据被收进会话产物` : argsFile !== undefined && /must be a JSON object/.test(detail) ? `${detail};批量数组请改用 --args-list(最多 200 条,可分批执行)` : detail, retryable: false, ...(outOfRoot ? { configurationRoot: configRoot } : {}) }));
680
+ writeEnvelope({ ...envelope("error", {}, request, { code: "invalid-input", message: outOfRoot ? `--args-file 必须位于配置根内(配置根 ${configRoot}${rejectedName ? `;本次文件 ${rejectedName}` : ""})。免落盘替代:--args - 从 stdin 读 JSON(echo '<json>' | omc call <tool> --args -),或把文件放进配置根后再引用;限制是为了防参数文件携带凭据被收进会话产物` : argsFile !== undefined && /must be a JSON object/.test(detail) ? `${detail};批量数组请改用 --args-list(最多 200 条,可分批执行)` : detail, retryable: false, ...(outOfRoot ? { configurationRoot: configRoot } : {}) }), resultMeta: accountMeta() });
665
681
  return CLI_EXIT_CODES.invalidInput;
666
682
  }
667
683
  const registry = buildToolRegistry();
@@ -786,7 +802,7 @@ async function cmdCall(store, args) {
786
802
  waitMs: waitMs > 0 ? waitMs : 30_000,
787
803
  });
788
804
  console.error(`write lock conflict: ${JSON.stringify({ pid: lock.owner?.pid, tool: lock.owner?.tool ?? lock.owner?.command, startedAt: lock.owner?.startedAt })}`);
789
- writeEnvelope(envelope("refused", conflict, request, classifyResult(conflict).error));
805
+ writeEnvelope({ ...envelope("refused", conflict, request, classifyResult(conflict).error), resultMeta: accountMeta() });
790
806
  return CLI_EXIT_CODES.policyRefused;
791
807
  }
792
808
  await sleep(Math.min(200, Math.max(0, deadline - Date.now())));
@@ -1078,13 +1094,22 @@ async function cmdArtifactGet(id, transport, options = {}) {
1078
1094
  // 的大对象(实测 589KB 视图 artifact)此前只能拆 key 取、易漏。这里写的是已过
1079
1095
  // sha256 校验的原文字节;回执只给 {out,bytes,sha256},stdout 不回正文。
1080
1096
  if (options.out !== undefined) {
1097
+ // issue 06(retro 2026-11-19):`--out -` 想把正文直接打到 stdout——铁律是
1098
+ // stdout 恒为恰好一个 JSON envelope,混排正文字节会破坏所有脚本解析,不做。
1099
+ // 错误里给两步替代(根内落盘 + cat),用户照抄即可。
1100
+ if (options.out === "-") {
1101
+ const sample = join(intentConfigRoot(), "artifacts-out", `${id}.json`);
1102
+ const parsed = errorEnvelope(new Error(`artifact get --out - 不支持:stdout 必须恒为恰好一个 JSON envelope(铁律),不能把产物正文字节混排在信封外。一次性提取两步:① omc artifact get ${id} --out ${sample}(父目录会自动创建)② cat ${sample}`), "artifact-out-refused", CLI_EXIT_CODES.invalidInput, transport.request);
1103
+ writeEnvelope(parsed.envelope);
1104
+ return parsed.exitCode;
1105
+ }
1081
1106
  let outPath;
1082
1107
  try {
1083
1108
  outPath = assertSafeOutputPath(intentConfigRoot(), options.out, "artifact output file");
1084
1109
  }
1085
1110
  catch (error) {
1086
1111
  const detail = error instanceof Error ? error.message : String(error);
1087
- const parsed = errorEnvelope(new Error(`artifact get --out 落盘被拒:${detail}。--out 按配置根(OMC_CONFIG_HOME)解析,只允许配置根内的常规文件路径(父目录须已存在)`), "artifact-out-refused", CLI_EXIT_CODES.invalidInput, transport.request);
1112
+ const parsed = errorEnvelope(new Error(`artifact get --out 落盘被拒:${detail}。--out 按配置根(OMC_CONFIG_HOME)解析,只允许配置根内的常规文件路径;根内父目录会自动创建,配置根外(含系统临时目录)一律拒绝`), "artifact-out-refused", CLI_EXIT_CODES.invalidInput, transport.request);
1088
1113
  writeEnvelope(parsed.envelope);
1089
1114
  return parsed.exitCode;
1090
1115
  }
@@ -1234,7 +1259,7 @@ async function cmdArtifactGet(id, transport, options = {}) {
1234
1259
  outline: true,
1235
1260
  depth,
1236
1261
  shape: shapeOf(content, depth),
1237
- 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 限额)。`,
1262
+ 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 限额)。`,
1238
1263
  projectionRule: "投影要写到叶子(数组元素里的字段);写整棵父节点(如 data.activities)会因总量超限再次被外置",
1239
1264
  ...(() => {
1240
1265
  const rec = content && typeof content === "object" && !Array.isArray(content) ? content : undefined;
@@ -1261,7 +1286,11 @@ async function cmdArtifactGet(id, transport, options = {}) {
1261
1286
  .slice(0, 3)
1262
1287
  .map((entry) => entry.key)
1263
1288
  : [];
1264
- return emitTransportResult({
1289
+ // 0.6.82(issue 06 连锁):自愈文案加长后,fullRejected 回执自身可能超过
1290
+ // 顽强的小预算(调用方正用 1024B 这类极限值测试)——被 boundResult 二次
1291
+ // 截断会把 fullRejected 语义键一起截掉。按预算渐进丢弃可选长文案,
1292
+ // 语义键(fullRejected/artifactId/sha256/bytes + 最短出路)永不丢。
1293
+ const fullRejectedReceipt = {
1265
1294
  status: "ok",
1266
1295
  artifactId: id,
1267
1296
  sha256: artifact.sha256,
@@ -1270,10 +1299,17 @@ async function cmdArtifactGet(id, transport, options = {}) {
1270
1299
  reason: `整包 ${Math.round(artifact.content.length / 1024)}KB 超过本通道输出上限 ${transport.maxOutputBytes}B;--full 无法一次返回,再跑一次结果相同`,
1271
1300
  ...(keys.length > 0 ? { keysCommand: `omc artifact get ${id} --keys ${keys.join(",")}`, sampledKeys: keys } : {}),
1272
1301
  jqCommand: `omc artifact get ${id} --jq '<path>'`,
1273
- outCommand: `omc artifact get ${id} --out <配置根内文件路径>(整包落盘,不走 stdout 限额,适合一次性备份)`,
1302
+ outCommand: `omc artifact get ${id} --out <配置根内文件路径>(整包落盘,不走 stdout 限额,适合一次性备份;根内父目录自动创建,越界拒绝的错误里带可用示例路径)`,
1274
1303
  raiseCeilingCommand: `omc artifact get ${id} --full --max-output-bytes ${Math.max(artifact.content.length + 1024, transport.maxOutputBytes * 2)}`,
1275
1304
  hint: "三选一:用 --jq/--keys 取你真正需要的那部分(推荐),整包落盘备份用 --out <配置根内路径>(写文件不受 stdout 限额),或显式抬高 --max-output-bytes",
1276
- }, transport);
1305
+ };
1306
+ const optionalKeys = ["hint", "raiseCeilingCommand", "keysCommand", "sampledKeys"];
1307
+ for (const drop of optionalKeys) {
1308
+ if (Buffer.byteLength(JSON.stringify(fullRejectedReceipt), "utf8") <= transport.maxOutputBytes)
1309
+ break;
1310
+ delete fullRejectedReceipt[drop];
1311
+ }
1312
+ return emitTransportResult(fullRejectedReceipt, transport);
1277
1313
  }
1278
1314
  return emitTransportResult(result, transport);
1279
1315
  }
@@ -2721,7 +2757,7 @@ async function main() {
2721
2757
  nextCommand: "omc setup --list",
2722
2758
  }));
2723
2759
  });
2724
- command.command("env [action] [name]").description("环境清单与联调参数包;`env export` 一键导出 token/headers,免手工从浏览器复制 token").option("--json").option("--env <environment>", "环境名;按与 call 相同的项目范围门解析").option("--format <format>", "export:输出可 source 的 bash 环境变量语句").option("--field <field>", "输出单个裸值:accessToken|baseUrl|enterpriseId|engineCode").option("--example <example>", "追加一个复制即测示例:curl|node;path 换成你的接口(示例内 token 默认占位,真值走 --field accessToken 或管道注入)").option("--reveal-token", "示例里回填真实 accessToken(默认打码;只在本地直接执行时用,别把输出贴进对话/归档)").addHelpText("after", "\n`omc env export` 用于二开联调参数包;`--example curl|node` 追加复制即测示例(把 `<your-api-path>` 换成你的接口),默认 JSON 不带示例。`--format env` 可 source,`--field accessToken` 输出裸 token;`--example` 里的 token 默认占位(`--reveal-token` 才回填真值)。\n").action(async (action, name, options) => {
2760
+ command.command("env [action] [name]").description("环境清单与联调参数包;`env export` 一键导出 token/headers,免手工从浏览器复制 token").option("--json").option("--env <environment>", "环境名;按与 call 相同的项目范围门解析").option("--format <format>", "export:输出可 source 的 bash 环境变量语句").option("--field <field>", "输出单个裸值:accessToken|baseUrl|enterpriseId|engineCode").option("--example <example>", "追加一个复制即测示例:curl|node;path 换成你的接口(示例内 token 默认占位,真值走 --field accessToken 或管道注入)").option("--reveal-token", "示例里回填真实 accessToken(默认打码;只在本地直接执行时用,别把输出贴进对话/归档)").addHelpText("after", "\n`omc env export` 用于二开联调参数包;`--example curl|node` 追加复制即测示例(把 `<your-api-path>` 换成你的接口),默认 JSON 不带示例。`--format env` 可 source,`--field accessToken` 输出裸 token;`--example` 里的 token 默认占位(`--reveal-token` 才回填真值)。\n账号口径(issue 07):`account` 是本次**导出凭据**登录的显示名;`sessionAccount` 是 token 声明的账号(id=user_id、username=user_name)。导出凭据账号 ≠ 之后 call 的会话账号——凭据轮换/token 过期重登/多环境同名账号时两者不同;每次 `omc call` 回执的 resultMeta.sessionAccount 才是当次会话账号(token 解码,解不出回 unavailableReason)。报错里的 currentUser 是平台按 username 反查的 id(同名多账号时可能与 token user_id 不同人)。\n").action(async (action, name, options) => {
2725
2761
  // Read-only inventory of configured environment names. r18: the sandbox
2726
2762
  // guessed names instead of listing them; doctor's wording now points here.
2727
2763
  const store = new ConfigStore(defaultPaths());
@@ -3105,7 +3141,7 @@ async function main() {
3105
3141
  console.error(`已清理 ${result.removed} 个读回产物,释放 ${formatBytes(result.freedBytes)};保留 ${result.kept} 个(${formatBytes(result.keptBytes)})`);
3106
3142
  commandExitCode = CLI_EXIT_CODES.ok;
3107
3143
  });
3108
- 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) => {
3144
+ 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} 不回正文。根内父目录自动创建;配置根外(含系统临时目录)拒绝,拒绝错误里带可用的根内示例路径。stdout 管道提取用两步:--out <根内路径> 后 cat 该文件——`--out -` 会破坏单信封契约,不支持)").option("--max-output-bytes <bytes>").action(async (id, options) => {
3109
3145
  // A bare `--jq`/`--keys` is a key-inventory request, not a missing argument:
3110
3146
  // commander's "argument missing" (invalid-input + retry) is a dead end the
3111
3147
  // caller cannot fix without already knowing the flag takes a value (r11
package/dist/endpoints.js CHANGED
@@ -188,6 +188,18 @@ export const ENDPOINTS = {
188
188
  bizServiceMethodDelete: "/api/api/bizservice/method/delete",
189
189
  bizServiceMethodTest: "/api/api/bizservice/method/service_test",
190
190
  bizServiceMethodList: "/api/api/bizservice/method/list_by_service_code",
191
+ /**
192
+ * 业务服务调用日志(表 h_log_biz_service)。
193
+ * 8.6.26 源码:LogManagerController `@RequestMapping("/api/log")` +
194
+ * `@GetMapping("/list_bizservicelog")`(decompiled-engine/.../system/
195
+ * LogManagerController.java:74,211);8.6 管理端 bundle 调
196
+ * `GET /api/log/list_bizservicelog`(frontend-dist/admin/js/12404.*.js)。
197
+ * 联调 1.1.25 实测该部署把 engine 控制器挂在**双前缀** `/api/api/log/...`
198
+ * (单前缀 404)——与仓库其它 engine 端点同口径,故主路径用双前缀,
199
+ * 单前缀作为 404 下探(wireCallWith404Fallback)。
200
+ */
201
+ bizServiceLogList: "/api/api/log/list_bizservicelog",
202
+ bizServiceLogListSinglePrefix: "/api/log/list_bizservicelog",
191
203
  bizServiceDelete: "/api/api/bizservice/service/delete",
192
204
  bizServiceExport: "/api/api/bizservice/service/export",
193
205
  bizServiceCheck: "/api/api/bizservice/service/check",
@@ -1,4 +1,6 @@
1
+ import { decodeSessionAccount } from "./session-account.js";
1
2
  const EXPORT_NOTE = "token 即登录态(本地缓存 8h,401 自动重登);勿提交版本库/粘贴共享文档;仅本机联调。";
3
+ const ACCOUNT_NOTE = "account=凭据登录的显示名;sessionAccount=token 声明的账号(id=user_id,username=user_name,name=登录面显示名)。两者不同≈凭据已轮换/同名多账号:之后 omc call 的会话账号以回执 resultMeta.sessionAccount 为准(每次调用都带),报错里的 currentUser 是平台按 username 反查的 id,与 token user_id 可能不同。";
2
4
  /** Build the structured local-only credential bundle. */
3
5
  export function exportEnvironment(session, example, revealToken = false) {
4
6
  const token = session.token();
@@ -18,8 +20,10 @@ export function exportEnvironment(session, example, revealToken = false) {
18
20
  expiresAtBasis: "local-ttl-8h",
19
21
  headers,
20
22
  account: maskAccount(account),
23
+ sessionAccount: decodeSessionAccount(token, login.accountIdentity),
21
24
  administrator: session.administrator(),
22
25
  note: EXPORT_NOTE,
26
+ accountNote: ACCOUNT_NOTE,
23
27
  };
24
28
  return example === undefined ? result : { ...result, example: requestExample(result, example, revealToken) };
25
29
  }
@@ -188,6 +188,14 @@ function phraseOf(tool, args, outcome) {
188
188
  return `绑定流程节点事件规则:${stringArg(args, "workflowCode") ?? "?"} 的节点 ${activityCode}.${nodeEvent} ← ${codes}`;
189
189
  return `绑定流程事件规则:${stringArg(args, "workflowCode") ?? "?"} 的 ${stringArg(args, "handler") ?? "end"} 处理器 ← ${codes}`;
190
190
  }
191
+ case "workflow.unbindRule": {
192
+ const codes = Array.isArray(args.ruleCodes) ? args.ruleCodes.join("、") : stringArg(args, "ruleCode") ?? "?";
193
+ const activityCode = stringArg(args, "activityCode");
194
+ const nodeEvent = stringArg(args, "nodeEvent");
195
+ if (activityCode !== undefined && nodeEvent !== undefined)
196
+ return `解绑流程节点事件规则:${stringArg(args, "workflowCode") ?? "?"} 的节点 ${activityCode}.${nodeEvent} ⇢ ${codes}(其余绑定保留)`;
197
+ return `解绑流程事件规则:${stringArg(args, "workflowCode") ?? "?"} 的 ${stringArg(args, "handler") ?? "end"} 处理器 ⇢ ${codes}(其余绑定保留,不自动 disable 规则)`;
198
+ }
191
199
  case "workflow.delete":
192
200
  return `删除流程 ${stringArg(args, "code") ?? "?"}`;
193
201
  case "onlinejs.compose":
@@ -29,6 +29,7 @@ export const B2_WIRE = Object.freeze({
29
29
  discoveryFaces: "ticket 105: /bizservice/service/adapter_config answers a JSON STRING of every registered protocol adapter {code,name,config:{authList,commonList,serviceActionList,methodActionList}} (BizServiceController.java:329-344, AdapterConfigParam.java:16-181; with sqlConfigEnabled the platform removes DATA_SQL/DATA_TABLE — readback verbatim) — the SAME source service.register's adapter preflight enforces, so the faces cannot drift. get_tablename_list / get_table_column (BizServiceMethodController.java:503-560) serve DATA_TABLE services only: a DATA_SQL service answers 501010 业务服务不为DataTable类型 (evidence correction — the research doc's 'DATA_SQL table discovery' reading was wrong), and get_table_column answers GENERATED SQL TEMPLATES (DataTableSqlModel{sql,sqlType ∈ SELECT/INSERT/UPDATE/DELETE/UPSERT}), not column metadata. All strictly read-only (zero POST calls). There is no free-SQL query channel: run a registered read-only method through method.test, read business rows through data.list (GitLab #18 P2-6 — do not use table_sql as a query entry)",
30
30
  ieFaces: "ticket 106: the IE chain is export (POST /bizservice/service/export {serviceCodes:[]} → ZIP stream: manifest.json + version.md, BizServiceIEController.java:110-148), upload (POST /api/runtime/query/upload_file, multipart field `file`, answers a PLAIN STRING refId — QueryRuntimeController.java:2414-2428), check ({fileName,overWrite,modifyServiceCodes} → BizServiceIEMsgModel{modifyServiceCodes[isRepeated],missedDataSourceCodes,missedUserList}), import ({fileName,overWrite,modifyServiceCodes,groupId}). Every refId is ONE-SHOT: downloadFile(...,true) removes the refId→filename cache entry (FileOperateHelper2.java:43-57), so each check/import uploads its own fresh copy. The package carries services[]+methodsMap{} verbatim from the DB (service configJson plaintext incl. auth values; method configJson stored PLAINTEXT — controller decrypts on create/update, BizServiceMethodController.java:142-143; the IE import path never AES-decrypts) and NEVER the connection-pool rows; a repeated code without overwrite/modify refuses 309008 (ErrorCode.java:698) and the rename regex is [a-zA-Z][a-zA-Z0-9_]{0,27} (INVALID_NAME 580001). Version gate truncates to major.minor (8.6.x↔8.6.y pass). Tool boundary: responses echo a secret-free package summary only — auth parameterlist VALUES are masked, the zip stays platform-shaped for round-trip and is referenced by path+sha256, never inlined",
31
31
  testFace: "ticket 107: POST /bizservice/method/service_test {code, serviceCode, testInputParametersMap: Map<String,Object>} (BizServiceMethodController.java:398-412; BizServiceMethodVO.java:14-35) answers {success,msg,data:<adapter result>} (BizServiceFacadeImpl.java:426-464). It is a REAL execution, not a dry-run: BizBusService.invoke dispatches to the service's ProtocolAdapterRuntimeService — RESTFUL fires real HTTP (RestProtocolAdapterRuntimeServiceImpl.java:218-350), DATA_SQL/DATA_TABLE run real JDBC behind the cloudpivot.bizservice.sqlConfig.enabled switch (DataSql…:105-188), SOAP calls for real (Soap…:98-123), INTERNAL reuses the HTTP code path (Internal…:126-230). SAP/KAFKA runtimes are NOT evidenced on this face — refused, never guessed. ZERO config writes: the chain only reads h_biz_service/h_biz_service_method and writes async integration logs (BizBusServiceImpl.java:190-226,403-414). The tool is a governed write (real external side effects), validates testInputParametersMap against the declared parameter face (missing required / unknown key = zero service_test wire), refuses registration shells, and re-reads the method row to prove the config survived untouched. r21 live: the test run does NOT reuse the OMC login session — an endpoint that requires auth must get independent credentials in the service config; even the platform's own endpoints answer 401/needs credentials, surfaced as externalSuccess:false, which is NOT a configuration error",
32
+ logFace: "h_log_biz_service read face: GET /api/log/list_bizservicelog (LogManagerController.java:81 @RequestMapping(\"/api/log\") + :237 @GetMapping(\"/list_bizservicelog\"); 8.6 admin bundle calls the single-prefix path, the live 1.1.25 deployment serves the same controller under the doubled /api/api prefix — the tool tries /api/api/log first and falls through to /api/log only on HTTP 404). Server query keys are code/methodName/dataTitle/startTime/endTime/page/size/status (page is @RequestParam Integer page, 0-based; size default 10; status 1=failure 2=success, other=all) — LogManagerController.java:239-256. Filter semantics live in BizServiceLogServiceImpl.getOrmWhereClause (cloudpivot-biz-integration-8.6.26/.../BizServiceLogServiceImpl.java:131-175): code + methodName are LIKE %x% (comma-separated → IN), dataTitle LIKE, startTime >= startTime and endTime <= endTime on the two date columns, and the order is ALWAYS startTime DESC. There is NO schemaCode/bizObjectId filter parameter — passing them is silently ignored (live 1.1.25 probe: bogus values returned the same rows), even though BizServiceLogModel carries schemaCode/bizObjectId/extensionLog (decompiled-models/.../BizServiceLogModel.java:38-42); the tool matches those two client-side over a bounded number of wire pages and reports the honest scan accounting. The platform truncates params to 2000 chars on save (BizServiceLogServiceImpl.java:64,178-185 PARAMS_LENGTH_LIMIT), so params is evidence of the sent prefix, not always the whole payload. Response rows also carry bizServiceStatus/bizServiceStatusName/usedTime/detail/extensionLog",
32
33
  });
33
34
  const B2_SCOPE = "create readback delete";
34
35
  export const B2_LANE_CONTRACT = Object.freeze({
@@ -58,6 +59,8 @@ export const B2_LANE_CONTRACT = Object.freeze({
58
59
  import: "bizServiceImport",
59
60
  ieUpload: "runtimeQueryUploadFile",
60
61
  methodTest: "bizServiceMethodTest",
62
+ logList: "bizServiceLogList",
63
+ logListSinglePrefix: "bizServiceLogListSinglePrefix",
61
64
  }),
62
65
  wire: Object.freeze({
63
66
  getShape: B2_WIRE.getShape,
@@ -79,6 +82,7 @@ export const B2_LANE_CONTRACT = Object.freeze({
79
82
  discoveryFaces: B2_WIRE.discoveryFaces,
80
83
  ieFaces: B2_WIRE.ieFaces,
81
84
  testFace: B2_WIRE.testFace,
85
+ logFace: B2_WIRE.logFace,
82
86
  }),
83
87
  wireBindings: Object.freeze({
84
88
  getShape: Object.freeze([behaviorBinding("test/b2-method-get-update.test.ts#ticket 94/95: method.get decodes one method", assertB2Contract)]),
@@ -100,6 +104,7 @@ export const B2_LANE_CONTRACT = Object.freeze({
100
104
  discoveryFaces: Object.freeze([behaviorBinding("test/ticket-105-discovery.test.ts#get_tablename_list and get_table_column serve DATA_TABLE services", assertB2Contract)]),
101
105
  ieFaces: Object.freeze([behaviorBinding("test/ticket-106-bizservice-ie.test.ts#contract pins the IE face tokens", assertB2Contract)]),
102
106
  testFace: Object.freeze([behaviorBinding("test/ticket-107-method-test.test.ts#contract pins the test-face tokens", assertB2Contract)]),
107
+ logFace: Object.freeze([behaviorBinding("test/servicelog.test.ts#servicelog.search pages server-side by time desc and hands back a copyable next command", assertB2Contract)]),
103
108
  }),
104
109
  evidence: Object.freeze([
105
110
  ".scratch/omc-route-wayfinder/leg2-closeout.md",
@@ -108,6 +113,7 @@ export const B2_LANE_CONTRACT = Object.freeze({
108
113
  "ticket 35 (live 2026-09-12): service/create with empty adapterCode → 500005 业务服务关联适配器编码为空 (INTERNAL accepted); rule publish dry gate 550018 rejects a parameterless registration shell bound with inputMappings (checkBizRuleIsEnable→filterProertyVo quotes the declared parameter face)",
109
114
  "ticket 92 (8.6.26 source + fwb readback): research/bizservice-integration-backend-face.md (BizServiceController service configJson plaintext; BizServiceMethodController.java:104-105,546-550 + AESUtils.java:18-51 method configJson AES-128-ECB/Base64 entry, plaintext silently NULLs; adapter required keys file:line; URL_VARIABLE runtime 501007); evidence/bizservice-rule-binding-fwb-20260914.md (fwb 8.6.39 authoritative readback: configJson plaintext, integer enums httpType:0/requestBodyType:1, required three-state); s32-restful-contract.ts:20 (live 8.6.26 name-form enums + parameter position); ADR 0001/0002",
110
115
  "ticket 93 (8.6.26 source): BizServiceController.java:103-136 service/update requires id, sets modifiedBy, saves and re-gets; BizServiceHeaderModel carries shared/userIdList; BizServiceModel carries serviceCategoryId — metadata passes through verbatim",
116
+ "business-log read face (8.6.26 source + live 1.1.25 probe): LogManagerController.java:81,237-256 (GET /api/log/list_bizservicelog, page required/0-based); BizServiceLogServiceImpl.java:131-175 (code/methodName LIKE-contains or comma IN, dataTitle LIKE, startTime>= / endTime<=, always startTime DESC) and :64,178-185 (params truncated to 2000 chars on save); BizServiceLogModel.java:38-42 (schemaCode/bizObjectId/extensionLog carried on the row, NOT queryable on this face); live 1.1.25: doubled prefix /api/api/log serves the controller while /api/log 404s, schemaCode/bizObjectId query keys are ignored",
111
117
  ]),
112
118
  tools: Object.freeze({
113
119
  "service.get": Object.freeze({
@@ -210,6 +216,10 @@ export const B2_LANE_CONTRACT = Object.freeze({
210
216
  scope: "test readback",
211
217
  description: "设计器测试面:对已配置的业务集成方法发起一次真实试跑(治理写——会真调用外部系统;**试跑不复用 OMC 登录态——目标端点要求认证时,须在服务配置里给独立认证参数**(认证失败表现为 401/需凭据、externalSuccess:false,不等于配置错误);`/bizservice/method/service_test`,body `{serviceCode, code, testInputParametersMap}`,回显平台内层 `{success,msg,data}`)。testInputParametersMap 按方法声明参数面 fail-closed 校验:缺必填入参/未知参数键/注册壳方法/SAP、KAFKA(该面无运行时证据)一律本地拒绝零试跑调用。试跑**零配置写**(链路只读 h_biz_service/h_biz_service_method,仅异步记集成日志),读回面复核方法 config 原样未动;RESTFUL/DATA_SQL/DATA_TABLE/SOAP/INTERNAL 真执行(DATA_SQL/DATA_TABLE 受平台 sqlConfig 开关限制)。服务级 testBizService 是人员/部门回显测试,不属本面。",
212
218
  }),
219
+ "servicelog.search": Object.freeze({
220
+ scope: "log readback",
221
+ description: "业务服务调用日志读回(表 `h_log_biz_service`,`GET /api/log/list_bizservicelog`):按 startTime 倒序分页(page 从 0 开始,size=limit)。服务端过滤 code(LIKE 包含;逗号分隔=精确 IN)、methodName(同)、dataTitle、startTime/endTime(平台按 startTime>= 且 endTime<= 两列)与 status(1 失败 2 成功);schemaCode/bizObjectId 平台列表端点没有这两个参数,由本工具在有限 wire 页内客户端匹配(rowFilter 记 scannedPages/scannedElements/exhausted,未命中不代表没有)。无过滤条件直接拒绝(fail-closed),默认窗口最近 60 分钟;params/result 单行截断摘要,完整内容超阈值外置 payloadFile。params 平台入库上限 2000 字符;日志异步落库。",
222
+ }),
213
223
  }),
214
224
  });
215
225
  export function assertB2Contract() {
@@ -279,6 +289,7 @@ export function assertB2Contract() {
279
289
  if (!B2_WIRE.ieFaces.includes("connection-pool"))
280
290
  throw new Error("b2 contract must pin that pool rows never travel in the IE package");
281
291
  assertDescriptionCarries(B2_LANE_CONTRACT, "method.test", ["service_test", "testInputParametersMap", "零配置写", "SAP", "参数面"]);
292
+ assertDescriptionCarries(B2_LANE_CONTRACT, "servicelog.search", ["list_bizservicelog", "h_log_biz_service", "客户端匹配", "payloadFile", "fail-closed", "2000"]);
282
293
  if (!B2_WIRE.testFace.includes("REAL execution"))
283
294
  throw new Error("b2 contract must pin the real-execution semantics of the test face");
284
295
  if (!B2_WIRE.testFace.includes("SAP/KAFKA"))
@@ -27,6 +27,7 @@ export const B2_COVERAGE = declareLaneCoverage(B2_LANE_CONTRACT.lane, [
27
27
  claim("service.adapter_config", T["service.adapter_config"].scope),
28
28
  claim("service.table_list", T["service.table_list"].scope),
29
29
  claim("service.table_sql", T["service.table_sql"].scope),
30
+ claim("servicelog.search", T["servicelog.search"].scope),
30
31
  ],
31
32
  },
32
33
  {
@@ -53,7 +53,7 @@ export function ruleNodeGraphDescription() {
53
53
  const wire = RULE_NODE_GRAPH_WIRE;
54
54
  return `rule nodes (array or pre-serialized JSON string). 自动布局:线性图(无 BRANCH)若缺坐标或节点框重叠,工具自动按平台标准单列铺开(x=327,158×40,y=36/116/196…,间距 80);已可正常渲染的布局与分支图原样保留——调用方无需手算几何。Live-proven cross-model UPDATE shape (2026-09-11, tickets 02/09): ${wire.example}. 铁律:inputParam 必须是 "${wire.inputParam}"(RuleExecutorImpl.saveRuleInput 以该名注册触发数据,schemaCode 字面量只过 dry-gate、运行时静默空转);ruleValueType ∈ ${wire.valueTypes};ruleActionType ∈ ${wire.actionTypes};ruleConditionType ∈ ${wire.conditionTypes}(BRANCH 出口叶例外,键见 BRANCH 模板);DYNAMIC 过滤来源必须放 ${wire.dynamicConditionSource},DYNAMIC 赋值来源必须放 ${wire.dynamicActionSource},${wire.dynamicConditionValue};${wire.dynamicActionValue},展示名惯例为 ${wire.dynamicNameKeys};FIXED 值分型:${wire.fixedValueTypes}。${wire.presetSystemNode}。触发分发:${wire.triggerDispatch}。${wire.draftRowNote} nodeType ∈ ${wire.nodeTypes}。${wire.systemNodeFamilies}。${wire.bizMethodMapping}。${wire.bizActionPersistence}。触发条件:${wire.triggerConditions}。${wire.schedulerSetting}。`;
55
55
  }
56
- export const RULE_ROUTES_DESCRIPTION = "edges, e.g. [{preNode:'Start',postNode:'UPDATE_1',points:[..],routeCondition:true,matchType:'ANY'}] (or a JSON string). 工具自动规范化:缺失的 points 由节点边中点(源底边中点→目标顶边中点)推导,缺失的 routeCondition/matchType 补 true/ANY;调用方无需手算坐标。";
56
+ export const RULE_ROUTES_DESCRIPTION = "edges, e.g. [{preNode:'Start',postNode:'UPDATE_1',points:[..],routeCondition:true,matchType:'ANY'}] (or a JSON string). 工具自动规范化:缺失的 points 由节点边中点(源底边中点→目标顶边中点)推导,缺失的 routeCondition/matchType 补 true/ANY;调用方无需手算坐标。更新既有规则可整个省略本键——工具读现行连线沿用(回执 routesSource:\"existing\",+1 wire);新建必须显式给。";
57
57
  export const RULE_BIZ_RULE_TYPE_DESCRIPTION = "rule trigger family; 0 = data operation, 1 = get-list, 2 = timing task (8.6.26 BizRuleType)";
58
58
  /**
59
59
  * Rule-level scheduler shape, emitted as a JSON string into the rule row's
@@ -72,7 +72,9 @@ const RULE_SAVE_DESCRIPTION = describeTool("保存业务规则(upsert):`ru
72
72
  "**条件执行**:单分支→动作节点自身 `filterCondition`(UPDATE/DELETE/ASSIGN 的 `mainConditions`);多路→`BRANCH` 出口叶键 `{currentSchemaDataItem,ruleDataConditionType,ruleValueType,value}`(照抄 `targetSchemaDataItem`+`ruleConditionType` 会 save+publish 过但运行时 50000,`rule-graph-branch-condition-keys`);流程流转用 `ruleConditionGroup`(逐节点语义见 `--param nodeGraph`)。",
73
73
  "**生命周期铁律**:update 只写 DRAFT 工作行,get/list 读 PUBLISH 面因此看不到变化——必须再 `rule.enable`(publish 出新版本 + 翻 DRAFT 启用开关)才会生效;DRAFT 保存不触发,submit(DRAFT→COMPLETED)触发 Create;`publish:true` 可同调发布(仅发布,启用仍走 `rule.enable`),readback 的 `published:false` 表示尚未发布。",
74
74
  "**BizMethod 绑定**:BIZ_ACTION / GET_LIST(BIZ_SERVICE) 的 methodMapping 写前 wire 校验服务+方法真实存在(悬空即 refused `rule-graph-bizmethod-unresolved`——平台只拦服务不拦方法,绝不用注册壳冒充已发布 BizMethod);RESTFUL/DATA_SQL 只有名字/参数面的注册壳 refused `rule-graph-bizmethod-registration-shell`;映射 `required` 以方法参数面为权威镜像(逐键 DTO/codeType/非语义透传见 `--param nodeGraph`)。",
75
- "**入参三选一**:`codeType:0` 常量 / `codeType:1` 字段 / `codeType:7` 计算规则(`bizCode` 必须是含 `formula` 的 JSON 字符串,不是 `expressionValue`、也不是对象);缺失/空串/非 JSON 即拒 `rule-graph-bizaction-expression-missing`(求值语义与映射全键见 `--param nodeGraph`)。",
75
+ "**入参三选一**:`codeType:0` 常量 / `codeType:1` 字段 / `codeType:7` 计算规则(`bizCode` 必须是含 `formula` 的 JSON 字符串,不是 `expressionValue`、也不是对象);缺失/空串/非 JSON 即拒 `rule-graph-bizaction-expression-missing`(求值语义与映射全键见 `--param nodeGraph`)。**可选参数显式留空**:`bizCode:\"\"`(PROPERTY/CONST 均可)=平台空映射,运行时参数不传(MapOps.java:490-496),回执 emptyMappings 点名。",
76
+ "**映射字段预检**:codeType:1 的 bizCode 按映射来源模型(QUERY 上游或本模型)读已发布字段清单核对,缺失 → refused `rule-mapping-field-absent`(带 did-you-mean;逃生阀 `allowAbsentMappingFields`);平台侧不保证拦截(可保存发布但运行时静默 null→10005)。",
77
+ "**公式两份文本与比较符**:codeType:7 的 bizCode JSON 含 formula/editorText/editorMark——运行时只读 formula;设计器痕迹(editorText `<field-…>`)默认保留只更新 formula(回执 preservedDesignerText),显式传 editorText 或 `allowDesignerTextOverwrite:true` 才覆盖(designerTextOverwritten)。比较符服务端规范是 `==`,`=` 在 IF() 条件内被服务端归一后同样可求值;设计器可能对 `==` 标红(平台侧已知不一致,工具不改写公式)。`nodeGraph.routes` 更新时可省略——工具读现行连线沿用(回执 routesSource:existing,+1 wire)。",
76
78
  "**EXPRESSION 值形状**:`ruleValueType:EXPRESSION` 时 `value` 必须是 {\"formula\":\"{字段A}+{字段B}\"}(大括号裸 code);门户设计器的 [code] 方括号式在这里不认。",
77
79
  "**幻影 schema 门**:写前先以 bizmodels/get_all 探测模型存在(缺失 → refused `rule-schema-unresolved`,零规则面 wire 调用)——幻影 schema 的预置行一旦生成 API 不可删除(list 即重灌),必须在写前拒绝。",
78
80
  "**输出回写排序**:BIZ_ACTION 的 outputMappings 由 SYSTEM_CREATE/SYSTEM_UPDATE 持久化节点消费——动作节点必须排在系统节点之前(`Start→BizAction→SYSTEM_CREATE→End`),否则合并结果不落库(echoResult 恒 null);系统节点注入位置见 `--param nodeGraph`。",
@@ -157,7 +159,7 @@ export const BUSINESSRULE_LANE_CONTRACT = Object.freeze({
157
159
  }),
158
160
  "rule.get": Object.freeze({
159
161
  scope: "rule node route readback",
160
- description: "读回一条业务规则的完整定义(businessrule/get?id=),解析并回显 node/route 图 JSON(触发节点、UPDATE/CREATE 动作节点的 targetObjectCode/inputParam/dataActions/filterCondition 等)——规则族读写链的权威读回面,也是对照设计器生成图形的取证入口。**摘要/批量扫图**:`summary:true` 回 `nodeDigests[]`(nodeCode/nodeType/methodMapping 两码;正文仍在 nodes,摘要里没有 nodes 键)+ `bytesOmitted` + `methodMappingCount`;同一 schemaCode 的 `ruleCodes[]`(≤50,须配 `summary:true`)一次 list 解析全部图,回 `rules[]`+`partial`/`failed[]`。",
162
+ description: "读回一条业务规则的完整定义(businessrule/get?id=),解析并回显 node/route 图 JSON(触发节点、UPDATE/CREATE 动作节点的 targetObjectCode/inputParam/dataActions/filterCondition 等)——规则族读写链的权威读回面,也是对照设计器生成图形的取证入口。**摘要/批量扫图**:`summary:true` 回 `nodeDigests[]`(nodeCode/nodeType/methodMapping 两码;正文仍在 nodes,摘要里没有 nodes 键)+ `bytesOmitted` + `methodMappingCount`;同一 schemaCode 的 `ruleCodes[]`(≤50,须配 `summary:true`)一次 list 解析全部图,回 `rules[]`+`partial`/`failed[]`。codeType:7 映射附 formulaNotes。",
161
163
  }),
162
164
  "rule.references": Object.freeze({
163
165
  scope: "cross-rule reference search",