@stalfh233/omc-cli 0.6.81 → 0.6.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/endpoints.js CHANGED
@@ -43,6 +43,16 @@ export const ENDPOINTS = {
43
43
  * answers 40007 请求方法不正确. There is no per-app or per-asset filter.
44
44
  */
45
45
  environmentLifeCycleExport: "/api/api/lifeCycle/apppackage/lifeCycleExport",
46
+ /**
47
+ * r86(retro issue 17):LicenseController(@RequestMapping("/api/license"),
48
+ * @RequireAdmin)的 GET /info → LicenseInfo{systemVersion(系统版本号),
49
+ * licenseType, expiration, ...}——8.6 族版本面(管理端「关于」页数据源)。
50
+ * 声明字段 buildTime 在该控制器的 info() 里**从不赋值**(反编译
51
+ * LicenseController.java:92-119 没有 setBuildTime),所以按「平台回传才用」处理。
52
+ * **产品线差异**:1.1.x(AI-Platform,真机 1.1.25)不挂载该路径(未认证 401、
53
+ * 管理员会话 404),版本只能回落 public/system/config 的 systemVersion 原串。
54
+ */
55
+ licenseInfo: "/api/license/info",
46
56
  modelList: "/api/api/app/bizmodels/list_schema",
47
57
  modelGet: "/api/api/app/bizmodels/get_all",
48
58
  modelCreate: "/api/api/app/bizmodels/create",
@@ -188,6 +198,18 @@ export const ENDPOINTS = {
188
198
  bizServiceMethodDelete: "/api/api/bizservice/method/delete",
189
199
  bizServiceMethodTest: "/api/api/bizservice/method/service_test",
190
200
  bizServiceMethodList: "/api/api/bizservice/method/list_by_service_code",
201
+ /**
202
+ * 业务服务调用日志(表 h_log_biz_service)。
203
+ * 8.6.26 源码:LogManagerController `@RequestMapping("/api/log")` +
204
+ * `@GetMapping("/list_bizservicelog")`(decompiled-engine/.../system/
205
+ * LogManagerController.java:74,211);8.6 管理端 bundle 调
206
+ * `GET /api/log/list_bizservicelog`(frontend-dist/admin/js/12404.*.js)。
207
+ * 联调 1.1.25 实测该部署把 engine 控制器挂在**双前缀** `/api/api/log/...`
208
+ * (单前缀 404)——与仓库其它 engine 端点同口径,故主路径用双前缀,
209
+ * 单前缀作为 404 下探(wireCallWith404Fallback)。
210
+ */
211
+ bizServiceLogList: "/api/api/log/list_bizservicelog",
212
+ bizServiceLogListSinglePrefix: "/api/log/list_bizservicelog",
191
213
  bizServiceDelete: "/api/api/bizservice/service/delete",
192
214
  bizServiceExport: "/api/api/bizservice/service/export",
193
215
  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",
@@ -66,9 +66,70 @@ const RULE_ROUND_TRIP_FIXES = Object.freeze({
66
66
  });
67
67
  const roundTripFixOf = (code) => RULE_ROUND_TRIP_FIXES[code] ?? "按 message 修正该节点后重存;或不要整图回存:用 rule.node.update 只 patch 目标节点";
68
68
  const RULE_ROUND_TRIP_HINT = "整图原样回存会被这些 hazard 拒(rule.save);备份/恢复请用 rule.node.update 单节点 patch,或先补 gaps。**平台版本差异**:部分版本的读面不回传 CREATE 节点的 originatorValue(8.6.41 实测),本工具不猜值。";
69
+ const CANONICAL_NODE_KEY_BY_LOWER = {
70
+ targetworkflowcode: "targetWorkflowCode",
71
+ };
72
+ function normalizeCasingCollisions(value, nodeCode, path, collisions) {
73
+ if (Array.isArray(value)) {
74
+ return value.map((entry, index) => normalizeCasingCollisions(entry, nodeCode, `${path}[${index}]`, collisions));
75
+ }
76
+ if (value === null || typeof value !== "object")
77
+ return value;
78
+ const source = value;
79
+ const byLower = new Map();
80
+ for (const key of Object.keys(source)) {
81
+ const lower = key.toLowerCase();
82
+ const group = byLower.get(lower);
83
+ if (group)
84
+ group.push(key);
85
+ else
86
+ byLower.set(lower, [key]);
87
+ }
88
+ const output = {};
89
+ const handled = new Set();
90
+ for (const [lower, keys] of byLower) {
91
+ if (keys.length < 2)
92
+ continue;
93
+ const canonical = CANONICAL_NODE_KEY_BY_LOWER[lower];
94
+ const kept = canonical !== undefined && keys.includes(canonical) ? canonical : keys[0];
95
+ // fastjson 文本序最后赋值生效:存活值取组内最后一个键的值。
96
+ const lastKey = keys[keys.length - 1];
97
+ const surviving = source[lastKey];
98
+ const lostValues = keys.filter((key) => JSON.stringify(source[key]) !== JSON.stringify(surviving)).map((key) => source[key]);
99
+ const differ = lostValues.length > 0;
100
+ for (const key of keys)
101
+ handled.add(key);
102
+ collisions.push({
103
+ nodeCode,
104
+ kept,
105
+ dropped: keys.filter((key) => key !== kept).join(","),
106
+ valuesDiffer: differ,
107
+ // 被并掉、不再出现在投影里的值(存活值之外的分歧值)——数据不丢。
108
+ ...(differ ? { droppedValue: lostValues } : {}),
109
+ ...(path !== "" ? { path } : {}),
110
+ });
111
+ output[kept] = normalizeCasingCollisions(surviving, nodeCode, path === "" ? kept : `${path}.${kept}`, collisions);
112
+ }
113
+ for (const key of Object.keys(source)) {
114
+ if (handled.has(key))
115
+ continue;
116
+ output[key] = normalizeCasingCollisions(source[key], nodeCode, path === "" ? key : `${path}.${key}`, collisions);
117
+ }
118
+ return output;
119
+ }
69
120
  function projectRuleGraph(nodes, routes, full) {
121
+ // r86 issue 20:默认面与 --full 深层面同样归一——绝不出「同节点仅大小写
122
+ // 不同的两个键」的 JSON(PowerShell ConvertFrom-Json 会直接拒绝)。
123
+ const collisions = [];
124
+ const normalizedNodes = Array.isArray(nodes)
125
+ ? nodes.map((entry) => {
126
+ if (entry === null || typeof entry !== "object" || Array.isArray(entry))
127
+ return entry;
128
+ return normalizeCasingCollisions(entry, String(entry.nodeCode ?? ""), "", collisions);
129
+ })
130
+ : nodes;
70
131
  if (full)
71
- return { nodes, routes };
132
+ return { nodes: normalizedNodes, routes, casingCollisions: collisions };
72
133
  const strip = (value, keys) => {
73
134
  if (!Array.isArray(value))
74
135
  return value;
@@ -81,7 +142,7 @@ function projectRuleGraph(nodes, routes, full) {
81
142
  return copy;
82
143
  });
83
144
  };
84
- return { nodes: strip(nodes, RULE_NODE_LAYOUT_KEYS), routes: strip(routes, RULE_ROUTE_LAYOUT_KEYS) };
145
+ return { nodes: strip(normalizedNodes, RULE_NODE_LAYOUT_KEYS), routes: strip(routes, RULE_ROUTE_LAYOUT_KEYS), casingCollisions: collisions };
85
146
  }
86
147
  /**
87
148
  * `rule.get` 的默认投影:保住语义图(nodes/routes),只剥确定性布局。
@@ -195,6 +256,76 @@ function ruleSummaryRoundTrip(roundTrip) {
195
256
  gapsHint: "gap 的 message/fix 用 rule.get(不带 summary)取 roundTrip.gaps",
196
257
  };
197
258
  }
259
+ /**
260
+ * r85(retro 2026-11-19 issue 09/11):codeType:7 映射的公式口径注记。
261
+ *
262
+ * - `eqEqParams`:formula 含 `==` —— 服务端(Aviator)规范比较符就是 `==`,
263
+ * `=` 在 IF() 条件内被服务端归一为 `==`(CalculateRuleExecutor.java:704-706),
264
+ * 两种都可在服务端求值;设计器可能对 `==` 标红(已知口径不一致,平台侧)。
265
+ * 工具不改写用户公式,本注记非侵入。
266
+ * - `designerTextParams`:editorText/editorMark 有设计器痕迹(`<field-xxx>` 富
267
+ * 文本,xxx 是设计器随机 nonce)——运行时只读 formula;rule.save 默认保留
268
+ * 这些映射的设计器文本(preservedDesignerText)。
269
+ * - `bareFormulaParams`:只有 formula、无 editorText——设计器以纯文本呈现(可能
270
+ * 标红),运行不受影响。
271
+ */
272
+ const RULE_FORMULA_NOTES_TEXT = "公式口径:服务端(Aviator)规范比较符是 ==;= 在 IF() 条件内被服务端归一后同样可求值(CalculateRuleExecutor.java:704-706),设计器可能对 == 标红(已知不一致,平台侧,工具不改写公式)。editorText 是设计器富文本(<field-xxx>code</field-xxx>;xxx 为设计器随机 nonce,不是字段 id),运行时只读 formula;bareFormulaParams 的映射在设计器以纯文本/标红呈现但运行不受影响,改动它们时 rule.save 默认保留现存设计器文本(preservedDesignerText)";
273
+ function ruleFormulaNotes(nodes) {
274
+ if (!Array.isArray(nodes))
275
+ return undefined;
276
+ const eqEqParams = [];
277
+ const designerTextParams = [];
278
+ const bareFormulaParams = [];
279
+ for (const entry of nodes) {
280
+ if (!entry || typeof entry !== "object" || Array.isArray(entry))
281
+ continue;
282
+ const node = entry;
283
+ const mapping = node.methodMapping;
284
+ if (!mapping || typeof mapping !== "object" || Array.isArray(mapping))
285
+ continue;
286
+ const m = mapping;
287
+ for (const listKey of ["inputMappings", "outputMappings"]) {
288
+ if (!Array.isArray(m[listKey]))
289
+ continue;
290
+ for (const element of m[listKey]) {
291
+ if (!element || typeof element !== "object" || Array.isArray(element))
292
+ continue;
293
+ const row = element;
294
+ if (Number(row.codeType) !== 7 || typeof row.bizCode !== "string")
295
+ continue;
296
+ let expression = null;
297
+ try {
298
+ const parsed = JSON.parse(row.bizCode);
299
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed))
300
+ expression = parsed;
301
+ }
302
+ catch {
303
+ expression = null;
304
+ }
305
+ const formula = expression !== null && typeof expression.formula === "string" ? expression.formula : "";
306
+ if (!formula)
307
+ continue;
308
+ const where = `${String(node.nodeCode ?? "")}/${String(row.serviceMethodParameterCode ?? "")}`;
309
+ if (formula.includes("=="))
310
+ eqEqParams.push(where);
311
+ const editorText = expression !== null && typeof expression.editorText === "string" ? expression.editorText : "";
312
+ const editorMark = expression !== null && typeof expression.editorMark === "string" ? expression.editorMark : "";
313
+ if (editorText.includes("<field-") || editorMark !== "")
314
+ designerTextParams.push(where);
315
+ else
316
+ bareFormulaParams.push(where);
317
+ }
318
+ }
319
+ }
320
+ if (eqEqParams.length === 0 && designerTextParams.length === 0 && bareFormulaParams.length === 0)
321
+ return undefined;
322
+ return {
323
+ eqEqParams,
324
+ designerTextParams,
325
+ bareFormulaParams,
326
+ note: RULE_FORMULA_NOTES_TEXT,
327
+ };
328
+ }
198
329
  /** 摘要面公共体:身份 + 体量 + 节点摘要。正文仍在默认面(nodes/routes)。 */
199
330
  function ruleSummaryBody(record, graph, roundTrip) {
200
331
  const nodes = Array.isArray(graph.nodes) ? graph.nodes : [];
@@ -1201,6 +1332,19 @@ export function registerBusinessRuleLane(tools) {
1201
1332
  routes: projected.routes,
1202
1333
  schedulerSetting: parse(record.schedulerSetting),
1203
1334
  renderCompat,
1335
+ // r86(retro issue 20):大小写冲突归一点名。节点内仅大小写不同的键已
1336
+ // 归一并进 casingNormalized(kept/dropped/valuesDiffer;值不同再给
1337
+ // droppedValue)——回执绝不含「同节点仅大小写不同的两个键」的 JSON
1338
+ // (PowerShell ConvertFrom-Json 会拒),无冲突时零噪音。
1339
+ ...(projected.casingCollisions.length > 0
1340
+ ? {
1341
+ casingNormalized: projected.casingCollisions,
1342
+ casingNote: "节点里仅大小写不同的键已归一(platform 双拼写并存:后端 DTO targetWorkFlowCode vs 设计器 targetWorkflowCode,fastjson 大小写不敏感折叠进同一字段);valuesDiffer:true 时存活值取文本序最后一个键(fastjson 最后赋值生效),被并值在 droppedValue",
1343
+ }
1344
+ : {}),
1345
+ // r85(retro 2026-11-19 issue 09/11):codeType:7 公式口径注记(非侵入,
1346
+ // 不改写公式)。无表达式映射时不出现该键。
1347
+ ...((() => { const notes = ruleFormulaNotes(projected.nodes); return notes ? { formulaNotes: notes } : {}; })()),
1204
1348
  ...(semanticFindings ? { semanticFindings } : {}),
1205
1349
  // r73 #2:roundTrip 是显式判定键(safe:true 也在),不是缺键
1206
1350
  ...(roundTrip ? { roundTrip } : {}),
@@ -1277,6 +1421,8 @@ export function registerBusinessRuleLane(tools) {
1277
1421
  nodeGraph: ruleNodeGraphArg,
1278
1422
  publish: z.boolean().optional().describe("also publish the new version in this call (businessrule/publish) so the designer sees it; enabling stays with rule.enable — default false keeps the legacy draft-only save"),
1279
1423
  allowAdvisory: z.boolean().optional().describe("调查逃生口;默认 false"),
1424
+ allowAbsentMappingFields: z.boolean().optional().describe("逃生阀:codeType:1 映射 bizCode 不在来源模型已发布字段时仍保存(回执 absentMappingFieldsAllowed 点名);默认拒 rule-mapping-field-absent(平台侧不保证拦,运行时静默 null→10005)"),
1425
+ allowDesignerTextOverwrite: z.boolean().optional().describe("逃生阀:覆盖映射现存的设计器公式文本(editorText/editorMark);默认保留现存设计器文本只更新 formula(回执 preservedDesignerText 点名)"),
1280
1426
  customTrigger: z.boolean().optional().describe("默认开:自定义 ruleCode + bizRuleType 0(非平台触发码 Create/Update/Delete/GetList/Load/Available/Cancel)即按钮/流程规则,工具在 START 后合成平台标准 CUSTOM_NODE「自定义按钮/流程触发」系统触发节点(nodeCode=ruleCode,live 布局 x558/y233);调用方已写 CUSTOM_NODE 则原样保留;显式 false 退回"),
1281
1427
  },
1282
1428
  execute: async (session, args) => executeRuleSaveWrite(session, args),
@@ -1291,7 +1437,19 @@ export function registerBusinessRuleLane(tools) {
1291
1437
  mode: linted.existing?.id ? "update" : "create",
1292
1438
  nodeCount: linted.nodes.length,
1293
1439
  routeCount: linted.routes.length,
1440
+ // r85(retro 2026-11-19):dry-run 与真写同源注记。
1441
+ ...(linted.routesSource !== undefined ? { routesSource: linted.routesSource, routesNote: "本次未传 routes:将读现行连线沿用(businessrule/get +1 wire)" } : {}),
1442
+ ...(linted.emptyMappings.length > 0 ? { emptyMappings: linted.emptyMappings } : {}),
1443
+ ...(linted.preservedDesignerText.length > 0 ? { preservedDesignerText: linted.preservedDesignerText } : {}),
1444
+ ...(linted.designerTextOverwritten.length > 0 ? { designerTextOverwritten: linted.designerTextOverwritten } : {}),
1445
+ ...(linted.mappingFieldChecks > 0 ? { mappingFieldChecks: linted.mappingFieldChecks } : {}),
1446
+ ...(linted.absentMappingFields !== undefined ? { absentMappingFieldsAllowed: linted.absentMappingFields } : {}),
1294
1447
  publish: args.publish === true,
1448
+ // r86(retro issue 14):dry-run 与真写同答案——发布验证契约先行告知,
1449
+ // 避免「以为没发布成功 → 重复 save → 造新记录」。
1450
+ ...(args.publish === true
1451
+ ? { publishVerifyContract: "真写发布后经 runtime list_by_schemacode 读回验证(+1 wire):publishedVerified/verifiedBy/ruleVersion 只报验证过的事实;latestPublished 仅列表验证成立时出现,否则 latestPublishedUnchecked——不要因它重复 save(每次保存都造新记录 ID)" }
1452
+ : {}),
1295
1453
  customTrigger: linted.customTriggerApplied,
1296
1454
  ...(linted.bizMethodChecks > 0 ? { bizMethodChecks: linted.bizMethodChecks } : {}),
1297
1455
  ...(linted.lintWarnings.length > 0 ? { lintWarnings: linted.lintWarnings } : {}),
@@ -12,6 +12,7 @@ export const ENVIRONMENT_WIRE = Object.freeze({
12
12
  portalVisibility: "group membership decides portal visibility: the portal renders NAMED groups; an app in the fallback group (code === 'all', case-insensitive) or with an unresolvable groupId is flagged portalHidden:true; move it with app.update {code, groupId}",
13
13
  fingerprint: "canonical environment fingerprint (environment, origin, application, enterprise) from the authenticated session; also returns version evidence (detectedVersion/inAnchorFamily/versionSource) shared with discover_environment and doctor",
14
14
  versionEvidence: "detectedVersion + inAnchorFamily + versionSource(=system-config) + versionFamily/anchorVersion [+ versionNotice outside the anchor family]; same face on discover_environment, environment.fingerprint, and doctor",
15
+ platformVersion: "r86(retro issue 17)platform 块:license/info(8.6 族 LicenseInfo.systemVersion;@RequireAdmin,声明字段 buildTime 从未赋值) → public/system-config systemVersion 原串(1.1.x 不挂载 license/info,真机 1.1.25 未认证 401/管理员 404)→ token-cache detectedVersion → versionUnavailable;扩展 build sha 无端点暴露(extensionBuildShaUnavailable);失败不进 readiness blockers、绝不造版本",
15
16
  });
16
17
  export const ENVIRONMENT_LANE_CONTRACT = Object.freeze({
17
18
  lane: LANES.environment,
@@ -22,6 +23,7 @@ export const ENVIRONMENT_LANE_CONTRACT = Object.freeze({
22
23
  applicationGroupList: "applicationGroupList",
23
24
  applicationTree: "applicationTree",
24
25
  modelList: "modelList",
26
+ licenseInfo: "licenseInfo",
25
27
  }),
26
28
  wire: Object.freeze({
27
29
  discoveryReads: ENVIRONMENT_WIRE.discoveryReads,
@@ -30,6 +32,7 @@ export const ENVIRONMENT_LANE_CONTRACT = Object.freeze({
30
32
  portalVisibility: ENVIRONMENT_WIRE.portalVisibility,
31
33
  fingerprint: ENVIRONMENT_WIRE.fingerprint,
32
34
  versionEvidence: ENVIRONMENT_WIRE.versionEvidence,
35
+ platformVersion: ENVIRONMENT_WIRE.platformVersion,
33
36
  }),
34
37
  wireBindings: Object.freeze({
35
38
  discoveryReads: Object.freeze([behaviorBinding("test/discovery-group-visibility.test.ts#discover_environment exposes group membership and flags fallback-group apps", assertEnvironmentContract)]),
@@ -38,6 +41,7 @@ export const ENVIRONMENT_LANE_CONTRACT = Object.freeze({
38
41
  portalVisibility: Object.freeze([behaviorBinding("test/discovery-group-visibility.test.ts#discover_environment fails closed: an unresolvable groupId is portalHidden", assertEnvironmentContract)]),
39
42
  fingerprint: Object.freeze([behaviorBinding("test/lane-contracts.test.ts#environment lane contract pins the discovery/fingerprint wire", assertEnvironmentContract)]),
40
43
  versionEvidence: Object.freeze([behaviorBinding("test/friction-r30f-version-evidence.test.ts#discover_environment and environment.fingerprint return shared version evidence", assertEnvironmentContract)]),
44
+ platformVersion: Object.freeze([behaviorBinding("test/r86-environment-platform-version.test.ts#discover_environment surfaces the platform version block (license/info → system/config → unavailable)", assertEnvironmentContract)]),
41
45
  }),
42
46
  evidence: Object.freeze([
43
47
  "src/dbsweep.ts",
@@ -76,6 +80,10 @@ export function assertEnvironmentContract() {
76
80
  throw new Error("environment contract must pin the fingerprint fields");
77
81
  if (!ENVIRONMENT_WIRE.versionEvidence.includes("detectedVersion"))
78
82
  throw new Error("environment contract must pin shared version evidence");
83
+ if (!ENVIRONMENT_WIRE.platformVersion.includes("platform"))
84
+ throw new Error("environment contract must pin the r86 platform version block face");
85
+ if (!ENVIRONMENT_WIRE.platformVersion.includes("license/info"))
86
+ throw new Error("environment contract must pin the license/info version source and its product-line absence");
79
87
  if (!ENVIRONMENT_WIRE.fingerprint.includes("detectedVersion"))
80
88
  throw new Error("environment fingerprint contract must mention version evidence");
81
89
  }
@@ -22,6 +22,69 @@ function versionEvidenceFor(ctx, session) {
22
22
  ...(notice ? { versionNotice: notice } : {}),
23
23
  });
24
24
  }
25
+ /**
26
+ * r86(retro issue 17)——环境版本面 `platform` 块。数据源优先级(真机 1.1.25 +
27
+ * 8.6.26 反编译实证):
28
+ * 1. GET /api/license/info(LicenseController.info → LicenseInfo{systemVersion,
29
+ * licenseType, expiration})——8.6 族「关于」页数据源,@RequireAdmin,+1 wire;
30
+ * 声明字段 buildTime 在该控制器里从不赋值(LicenseController.java:92-119),
31
+ * 所以只有平台真回 buildTime 时才带;
32
+ * 2. 回落 public/system/config 的 systemVersion **原串**(登录时已取,零新增 wire;
33
+ * detectVersion 只留点号数字段,这里保留 "AI-Platform-v1.1.25" 全串);
34
+ * 3. 都没有 → versionUnavailable(如实说明原因,绝不造版本)。
35
+ * 1.1.x(AI-Platform)不挂载 license/info(真机 1.1.25:未认证 401、管理员 404)——
36
+ * 产品线差异如实进 licenseFaceUnavailable,不阻塞就绪判定。
37
+ * 扩展/前端构件的 build sha 没有任何端点暴露 → extensionBuildShaUnavailable 如实
38
+ * 说明,不用端点存在性反推。
39
+ */
40
+ const EXTENSION_SHA_UNAVAILABLE = "平台没有暴露扩展/前端构件 build sha 的端点(8.6.26 与 1.1.25 反编译 + 真机均无);版本判断只能用 productVersion";
41
+ async function platformVersionBlock(session) {
42
+ try {
43
+ const license = (await wireCall(session, { path: ENDPOINTS.licenseInfo })).data;
44
+ const productVersion = license && typeof license.systemVersion === "string" && license.systemVersion.trim() ? license.systemVersion.trim() : undefined;
45
+ if (productVersion !== undefined)
46
+ return {
47
+ productVersion,
48
+ ...(typeof license.buildTime === "string" && license.buildTime ? { buildTime: license.buildTime } : {}),
49
+ ...(license.licenseType !== undefined && license.licenseType !== null ? { licenseType: license.licenseType } : {}),
50
+ ...(typeof license.expiration === "string" && license.expiration ? { licenseExpiration: license.expiration } : {}),
51
+ source: "license/info",
52
+ extensionBuildShaUnavailable: EXTENSION_SHA_UNAVAILABLE,
53
+ };
54
+ }
55
+ catch {
56
+ // fall through to the system/config face — the license face is 8.6-only
57
+ }
58
+ const raw = session.rawSystemVersion();
59
+ if (raw !== undefined)
60
+ return {
61
+ productVersion: raw,
62
+ source: "public/system-config systemVersion",
63
+ licenseFaceUnavailable: "license/info 不可达(真机 1.1.25:未认证 401、管理员会话 404——该产品线不挂载);buildTime 只在平台回传时才有",
64
+ extensionBuildShaUnavailable: EXTENSION_SHA_UNAVAILABLE,
65
+ };
66
+ // 登录缓存沿用(老缓存只存了点号版本、没有原串):用 detectedVersion 兜底——
67
+ // 它是真实版本证据,只是缺产品线前缀,不能因为缺前缀就说「无版本」。
68
+ const detected = session.detectedVersion();
69
+ if (detected !== undefined)
70
+ return {
71
+ productVersion: detected,
72
+ source: "token-cache detectedVersion(原串缺失:登录缓存早于 rawVersion 字段;refresh:true 重登可取回原串)",
73
+ licenseFaceUnavailable: "license/info 不可达(该产品线不挂载);buildTime 只在平台回传时才有",
74
+ extensionBuildShaUnavailable: EXTENSION_SHA_UNAVAILABLE,
75
+ };
76
+ return { versionUnavailable: "license/info 不可达且 public/system/config 未携带版本键——本环境无法给出 productVersion,勿据端点存在性反推版本" };
77
+ }
78
+ /** Zero-wire variant for the project-card cache hit (keeps the key set stable). */
79
+ function platformVersionBlockFromSession(session) {
80
+ const cached = session.rawSystemVersion();
81
+ if (cached !== undefined)
82
+ return { productVersion: cached, source: "public/system-config systemVersion", extensionBuildShaUnavailable: EXTENSION_SHA_UNAVAILABLE };
83
+ const detected = session.detectedVersion();
84
+ if (detected !== undefined)
85
+ return { productVersion: detected, source: "token-cache detectedVersion(缓存命中面零 wire)", extensionBuildShaUnavailable: EXTENSION_SHA_UNAVAILABLE };
86
+ return { versionUnavailable: "缓存命中面零 wire:license/info 未查,登录缓存也没有版本证据(refresh:true 重查)" };
87
+ }
25
88
  export function registerEnvironmentLane(tools) {
26
89
  tools.push(defineTool({
27
90
  name: "discover_environment",
@@ -58,11 +121,15 @@ export function registerEnvironmentLane(tools) {
58
121
  const perAppCached = cachedExtra.modelsPerApplication;
59
122
  const resolution = cached.applicationResolution;
60
123
  const versionEvidence = versionEvidenceFor(ctx, session);
124
+ // r86(retro issue 17):缓存命中零 wire——platform 块优先用卡里存的
125
+ // (冷路径写入),老卡没有时退 session 原串,键集恒定。
126
+ const platformCached = cachedExtra.platform;
61
127
  return {
62
128
  status: "ok",
63
129
  // r53 场景03 F2:缓存命中与冷路径同面给出 baseUrl(非密)。
64
130
  baseUrl: session.profile.baseUrl,
65
131
  baseUrlHint: "非密运行参数(环境配置的 baseUrl)。拼平台端点用它 + 路径;鉴权凭据不在此面。",
132
+ ...(platformCached !== undefined ? { platform: platformCached } : { platform: platformVersionBlockFromSession(session) }),
66
133
  applications: apps,
67
134
  applicationsCount: apps.length,
68
135
  groups,
@@ -237,6 +304,10 @@ export function registerEnvironmentLane(tools) {
237
304
  tenantModelsCount,
238
305
  modelsPerApplication,
239
306
  };
307
+ // r86(retro issue 17):冷路径 +1 wire 读 license/info(8.6 族版本/构建时
308
+ // 间面;1.1.x 404 回落 system/config 原串)——失败不进 readiness blockers,
309
+ // 且先于项目卡写入(卡里存一份,缓存命中零 wire 同键回放)。
310
+ const platform = await platformVersionBlock(session);
240
311
  // 项目卡写入(软失败):默认形态(无收窄参数)时缓存模型清单,下次会话一次本地读。
241
312
  if (args.applicationCode === undefined && args.modelCode === undefined && args.full !== true) {
242
313
  const envName = String(args.environment ?? session.environmentName ?? "");
@@ -256,12 +327,14 @@ export function registerEnvironmentLane(tools) {
256
327
  // ProjectCard 未声明扩展键;JSON 落盘后由上方 cache 归一读回。
257
328
  tenantModelsCount,
258
329
  modelsPerApplication,
330
+ platform,
259
331
  });
260
332
  }
261
333
  }
262
334
  const versionEvidence = versionEvidenceFor(ctx, session);
263
335
  return {
264
336
  ...discovered,
337
+ platform,
265
338
  // r53 场景03 F2:agent 要拼「端点 = baseUrl + path」(比如外部 invoke 面)时
266
339
  // 只能伸手进凭据目录附近自制过滤读取。baseUrl 是非密运行参数,在这里给掉。
267
340
  baseUrl: session.profile.baseUrl,
@@ -743,8 +743,16 @@ export function prepareRuleGraph(ruleCode, graph, customTrigger, schemaCode) {
743
743
  const literal = row.value !== undefined ? row.value : row.expressionValue;
744
744
  if (literal === undefined)
745
745
  return row;
746
+ const literalText = typeof literal === "string" ? literal : String(literal);
747
+ // r85(issue 04):显式空常量(value:"")归一为 bizCode:""——这是合法的
748
+ // "空映射"形状,不是"值搬移"事件,不告警。
749
+ if (literalText === "") {
750
+ const emptyNext = { ...row, bizCode: "" };
751
+ delete emptyNext.value;
752
+ return emptyNext;
753
+ }
746
754
  changed = true;
747
- const next = { ...row, bizCode: typeof literal === "string" ? literal : String(literal) };
755
+ const next = { ...row, bizCode: literalText };
748
756
  delete next.value;
749
757
  return next;
750
758
  });
@@ -1392,16 +1400,24 @@ export function validateMethodMapping(mapping, nodeCode) {
1392
1400
  blockers.push({ code: "rule-graph-bizaction-mapping-codetype", nodeCode, key: `methodMapping.${listKey}[${index}].codeType`, message: `${listKey}[${index}].codeType 必须是 0-${RULE_CODE_TYPES.length - 1} 的整数(CodeType int 序列化:${RULE_CODE_TYPES.map((t, i) => `${i}=${t}`).join("/")})` });
1393
1401
  if (typeof row.serviceMethodParameterCode !== "string" || !row.serviceMethodParameterCode.trim())
1394
1402
  blockers.push({ code: "rule-graph-bizaction-mapping-param", nodeCode, key: `methodMapping.${listKey}[${index}].serviceMethodParameterCode`, message: `${listKey}[${index}] 缺 serviceMethodParameterCode(集成方法参数 code;quote 以它对账方法参数表)` });
1395
- if (row.codeType === 1 && (typeof row.bizCode !== "string" || !row.bizCode.trim()))
1396
- blockers.push({ code: "rule-graph-bizaction-mapping-bizcode", nodeCode, key: `methodMapping.${listKey}[${index}].bizCode`, message: `${listKey}[${index}].codeType=1(PROPERTY) 必须带 bizCode(RuleBizActionQuoteImpl 只消费 PROPERTY 映射的 bizCode+propertyName)` });
1403
+ // r85(retro 2026-11-19 issue 04):显式留空是合法形状——`bizCode:""`(恰好
1404
+ // 空串)在平台侧是"空映射":保存/发布不校验(RuleQuoteImpl.java:193 跳过
1405
+ // 空白),运行时 MapOps 跳过该映射=参数不传(MapOps.java:490-496)。仍拒:
1406
+ // 键缺席(与显式空串语义可区分)、纯空白串(MapOps isEmpty 不跳过、会按
1407
+ // 字段码 " " 求值成 null)、非字符串。
1408
+ if (row.codeType === 1 && row.bizCode !== "" && (typeof row.bizCode !== "string" || !row.bizCode.trim()))
1409
+ blockers.push({ code: "rule-graph-bizaction-mapping-bizcode", nodeCode, key: `methodMapping.${listKey}[${index}].bizCode`, message: `${listKey}[${index}].codeType=1(PROPERTY) 必须带 bizCode(RuleBizActionQuoteImpl 只消费 PROPERTY 映射的 bizCode+propertyName);可选参数显式留空传 bizCode:""(空映射:运行时参数不传,回执 emptyMappings 点名)` });
1397
1410
  // CONST(0): the literal value must live in `bizCode` by the time it is
1398
1411
  // written (MapOps reads getBizCode for CONST; the designer writes
1399
1412
  // componentValue=bizCode). prepareRuleGraph moves a value found under
1400
1413
  // `value`/`expressionValue` into bizCode, so accept any of the three here
1401
1414
  // and only refuse when the element carries no value at all (which would
1402
1415
  // arrive as literal "null" at runtime).
1403
- if (row.codeType === 0 && !(typeof row.bizCode === "string" && row.bizCode.trim()) && row.value === undefined && row.expressionValue === undefined)
1404
- blockers.push({ code: "rule-graph-bizaction-mapping-const-value", nodeCode, key: `methodMapping.${listKey}[${index}].bizCode`, message: `${listKey}[${index}].codeType=0(CONST) 缺常量值——放 bizCode(或 value,工具会移入 bizCode);平台 CONST 只读 bizCode,缺值运行时会取到字面 null` });
1416
+ // r85(issue 04):显式空常量合法——bizCode:"" / value:"" 是"空映射"(运行时
1417
+ // MapOps 跳过、参数不传),与"忘了给值"区分开:后者仍拒。
1418
+ const explicitEmptyConst = row.bizCode === "" || row.value === "" || row.expressionValue === "";
1419
+ if (row.codeType === 0 && !explicitEmptyConst && !(typeof row.bizCode === "string" && row.bizCode.trim()) && row.value === undefined && row.expressionValue === undefined)
1420
+ blockers.push({ code: "rule-graph-bizaction-mapping-const-value", nodeCode, key: `methodMapping.${listKey}[${index}].bizCode`, message: `${listKey}[${index}].codeType=0(CONST) 缺常量值——放 bizCode(或 value,工具会移入 bizCode);平台 CONST 只读 bizCode,缺值运行时会取到字面 null。可选参数显式留空传 bizCode:""(空映射:运行时参数不传)` });
1405
1421
  // EXPRESSION(7) — 入参「计算规则」:MapOps INPUT 方向对 CodeType.CONST /
1406
1422
  // CodeType.EXPRESSION 都取 `getBizMethodValue`/`getExpressionValue`
1407
1423
  // (MapOps.java:510-541),Mapping.expressionValue 是 Object、平台原样透传。