@stalfh233/omc-cli 0.6.100 → 0.8.0

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.
Files changed (53) hide show
  1. package/conformance/README.md +267 -0
  2. package/conformance/frontend-behavior-probe.mjs +1986 -0
  3. package/conformance/frontend-scenarios/calc-visibility.json +22 -0
  4. package/conformance/frontend-scenarios/form-buttons.json +19 -0
  5. package/conformance/frontend-scenarios/list-buttons.json +28 -0
  6. package/conformance/frontend-scenarios/onlinejs.json +19 -0
  7. package/coverage/m1-coverage-manifest-v1.json +88 -2
  8. package/dist/capability-overview.js +16 -4
  9. package/dist/cli-stdout.js +4 -0
  10. package/dist/cli.js +190 -7
  11. package/dist/contract-resources.js +2 -0
  12. package/dist/coverage-registry.js +4 -0
  13. package/dist/coverage.js +16 -2
  14. package/dist/endpoints.js +65 -0
  15. package/dist/environment-policy.js +15 -1
  16. package/dist/field-change.js +9 -2
  17. package/dist/field-families.js +27 -6
  18. package/dist/governed-execution.js +18 -12
  19. package/dist/human-summary.js +8 -0
  20. package/dist/intent/capabilities/field.js +6 -0
  21. package/dist/lanes/environment.js +3 -0
  22. package/dist/lanes/field-contract.js +117 -6
  23. package/dist/lanes/file-contract.js +69 -0
  24. package/dist/lanes/file-coverage.js +16 -0
  25. package/dist/lanes/file.js +257 -0
  26. package/dist/lanes/lane-ids.js +1 -0
  27. package/dist/lanes/list-view-contract.js +3 -3
  28. package/dist/lanes/list-view-shapes.js +56 -0
  29. package/dist/lanes/list-view.js +40 -5
  30. package/dist/lanes/meta.js +4 -3
  31. package/dist/lanes/model.js +8 -4
  32. package/dist/lanes/org-query-contract.js +62 -0
  33. package/dist/lanes/org-query-coverage.js +27 -0
  34. package/dist/lanes/org-query.js +610 -0
  35. package/dist/lanes/organization.js +44 -11
  36. package/dist/lanes/runtime-data.js +228 -59
  37. package/dist/lanes/workflow-contract.js +100 -1
  38. package/dist/lanes/workflow-coverage.js +13 -0
  39. package/dist/lanes/workflow.js +615 -15
  40. package/dist/package.js +3 -1
  41. package/dist/read-shapes.js +3 -3
  42. package/dist/recipes/runtime-data.js +8 -6
  43. package/dist/refusal-guidance.js +1 -1
  44. package/dist/rule-support.js +15 -17
  45. package/dist/session.js +16 -1
  46. package/dist/tool-types.js +15 -1
  47. package/dist/tools.js +7 -0
  48. package/dist/version-family-gaps.js +8 -1
  49. package/dist/version-partition.js +633 -0
  50. package/dist/wire.js +8 -2
  51. package/dist/write.js +11 -2
  52. package/package.json +6 -4
  53. package/skills/omc-capabilities.md +8 -1
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "calc-visibility",
3
+ "description": "计算规则 + 字段显隐前台验证:填「数量」「单价」后「金额」应被计算规则算出 15;勾选「显示明细」后明细块显示、「隐藏字段」仍隐藏;「编码」只读、「名称」必填。\n\n占位符:所有 label 的文本都要换成你模型里的**字段显示名**(不是 code);显隐切换用的复选框字段也要用显示名。若计算结果是小数,把 step#4 的 valueEquals 换成 valueMatches(step#5 就是示例)。\n\n说明:valueEquals 会先等最多 withinMs,等计算规则生效再比;千分位逗号和首尾空白会被忽略,纯数字还会做数值比较(15 与 15.00 视为相等)。",
4
+ "login": true,
5
+ "steps": [
6
+ { "action": "goto", "path": "/portal-page/<替换为你的表单URL>" },
7
+ { "action": "waitForText", "text": "<替换为表单标题>", "timeoutMs": 30000 },
8
+ { "action": "fill", "label": "<替换为数量字段显示名>", "value": "3" },
9
+ { "action": "fill", "label": "<替换为单价字段显示名>", "value": "5" },
10
+ { "action": "assert", "kind": "valueEquals", "label": "<替换为金额字段显示名>", "expected": "15", "withinMs": 8000 },
11
+ { "action": "assert", "kind": "valueMatches", "label": "<替换为金额字段显示名>", "expected": "^1[0-9](\\.[0-9]+)?$", "optional": true },
12
+
13
+ { "action": "check", "label": "<替换为显隐开关字段显示名>" },
14
+ { "action": "assert", "kind": "visible", "label": "<替换为条件显示的字段显示名>" },
15
+ { "action": "uncheck", "label": "<替换为显隐开关字段显示名>" },
16
+ { "action": "assert", "kind": "hidden", "label": "<替换为条件显示的字段显示名>" },
17
+
18
+ { "action": "assert", "kind": "readonly", "label": "<替换为只读字段显示名>" },
19
+ { "action": "assert", "kind": "required", "label": "<替换为必填字段显示名>" },
20
+ { "action": "assert", "kind": "noConsoleErrors" }
21
+ ]
22
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "form-buttons",
3
+ "description": "表单按钮前台验证:流程表单(带 workItemId)底部工具栏渲染自定义表单按钮,点击发出 runtime/form/executeCustomButton 且 errcode=0,SCRIPT 按钮的脚本在浏览器里执行(console.log 可被探针捕获),页面无新的 console error。\n\n为什么必须走 workItem URL:普通表单页(/form/detail?...&isWorkFlow=false)只渲染平台内置按钮,FORM 位置的按钮可见性由「当前流程节点」的 buttonPermission.customBtns[].enabled 控制(设计器「表单操作」勾选),所以必须①表单按钮已随 form.publish 生成 h_biz_button(triggerType=FORM),②workflow.setButtons 在该节点勾选,③用带 workItemId 的表单 URL 打开。已发布节点配置是运行时读取的(把节点按钮关掉再发布,已打开过的实例刷新后按钮也消失),因此顺序应是 setButtons 先、起实例后。\n\n怎么拿 workItemId(二选一,推荐第一种):\nA) 草稿留在发起节点:omc call data.save --args '{\"schemaCode\":\"<模型code>\",\"workflowCode\":\"<流程code>\",\"formData\":{...}}' → 读 performed.workItemId / performed.workflowInstanceId / performed.bizObjectId,行是 DRAFT、当前节点就是第一个 {Originator} 填写节点,按钮勾在这个节点最直观。\nB) 已提交单的下一节点:omc call data.submit --args '{\"schemaCode\":\"<模型code>\",\"formData\":{...}}' → readback.workItemId 是**下一个**待办节点(发起节点的待办在提交时已自动过掉);此时按钮要勾在 readback.nextWorkItems[0].activityCode 那个节点上。\nURL 形状(已真机验证,直接开,不必经门户):/form/detail?schemaCode=<模型code>&objectId=<bizObjectId>&workItemId=<workItemId>&workflowInstanceId=<workflowInstanceId>&perms=edit&isMobile=false\n\n占位符:\n- <模型code> / <流程code> / <按钮显示名>;URL 里的 <bizObjectId>/<workItemId>/<workflowInstanceId> 来自上面的回执。\n- 本场景按「两个按钮」验证:一个 bindAction=SCRIPT(断言脚本日志),一个 bindAction=BUSINESS_RULE(断言服务端请求)。只建了服务端动作按钮时,删掉第 4/5 步;只建 SCRIPT 按钮时,SCRIPT 是纯前端执行、**不发** executeCustomButton,第 7 步会失败(这不是缺陷)。\n- 按钮 script 里写 console.log('omc-probe-button'),与第 5 步的 text 对齐。\n\n已知坑:\n- 提交型 data.submit 会把发起节点一次过掉;想停在发起节点用 data.save(DRAFT)。\n- 在按钮启用前就已创建/走到位的旧待办可能仍不显示按钮(节点定义按实例创建时的版本绑定);不要排查页面缓存,直接按上面的顺序新建一条实例。\n- 平台 1.1.25/1.1.30 的表单页是英文 UI(Submit/Save/Print…),自定义按钮按 name 原文渲染,click/text 用按钮显示名即可。",
4
+ "login": true,
5
+ "steps": [
6
+ {
7
+ "action": "goto",
8
+ "path": "/form/detail?schemaCode=<模型code>&objectId=<bizObjectId>&workItemId=<workItemId>&workflowInstanceId=<workflowInstanceId>&perms=edit&isMobile=false",
9
+ "waitMs": 3000
10
+ },
11
+ { "action": "wait", "ms": 1000 },
12
+ { "action": "waitForText", "text": "<SCRIPT按钮显示名>", "timeoutMs": 30000 },
13
+ { "action": "click", "text": "<SCRIPT按钮显示名>" },
14
+ { "action": "assert", "kind": "probeLogContains", "text": "omc-probe-button" },
15
+ { "action": "click", "text": "<BUSINESS_RULE按钮显示名>" },
16
+ { "action": "assert", "kind": "request", "path": "runtime/form/executeCustomButton", "errcode": 0, "withinMs": 20000 },
17
+ { "action": "assert", "kind": "noConsoleErrors" }
18
+ ]
19
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "list-buttons",
3
+ "description": "列表视图自定义按钮(BizButtonModel)前台验证:点「视图 SCRIPT 按钮」后,脚本到底在哪执行、有没有 HTTP 请求。\n\n按钮配置形状(listview.configure 的 buttons[],t248 真机验证通过):\n{ code:\"probeListBtn\", name:\"列表探针\", useLocation:\"LIST\", bindAction:\"SCRIPT\", operateType:\"WITH_OUT_VIEW\", script:\"console.log('omc-probe-list-button')\" }\n等价 wire:actionConfig = {\"scriptData\":\"console.log('omc-probe-list-button')\"}(JSON 字符串)。平台运行期只读 actionConfig.scriptData,不需要 buttonType/params/scriptType/showInNewForm。\n\n两种 operateType 的语义完全不同(都验证过):\n- WITH_OUT_VIEW:点按钮 → 浏览器内 new Function(\"scriptData\",\"rowIndex\", scriptData) 在**列表页**立即执行,随后 goForm 提前 return(不取表单 URL、不跳转、**不发任何请求**)。本场景第一段就是它:断言 console 日志,且不会出现 runtime/form/get_form_url。不要求选行。\n- WITH_VIEW:脚本不在列表页执行,而是把 scriptData 塞进 sessionStorage.scriptData 并给表单 URL 加 scriptOpen=true,打开该行表单后由表单页 eval。**必须恰好选中 1 行**,0 行只弹「请选择数据」提示(无请求、无日志),多行弹「只能选择一条数据」。本场景第二段:选行 → 点击 → 断言请求 scriptOpen=true(命中 GET /runtime/form/load?...&scriptOpen=true)。\n\n前置(踩过的坑,缺一个就会「点了没反应」):\n1) 按钮必须真的渲染在工具栏 #list-actions 里。工具栏按宽度切分:放不下时自定义按钮被挪进右侧「…」浮层(.list-actions-more),此时 #list-actions 里找不到它;选中行后工具栏会追加删除/批量按钮,可能把它挤进「…」——这正是「选中行后按钮被工具栏替换/消失」的原因。最省事的做法是 listview.configure 传 replaceActions:true + actions:[] 把内置按钮清掉,再放 1 个自定义按钮。\n2) 首次进应用右上角有「Click here to enter the admin backend…」引导浮层,会盖住工具栏右端;被盖住时 Playwright/人手点击都点不到按钮(无日志无请求无报错)。本场景点的是左侧靠前的位置,若按钮落在右端被盖住,先关掉该浮层。\n3) SCRIPT 按钮跑完后平台会调 onCustomActionDone → this.eventHooksHandler.exec(...),而模型没有「视图级在线 JS」时 eventHooksHandler 为 null,必抛 pageerror(平台 bug,与其他调用点的 null 判断不一致)。已在 ignoreConsole 里忽略。\n4) about:srcdoc 沙箱 iframe 的 console error 是平台自身的,也已忽略。\n\n占位符:\n- 列表页 path:登录后打开目标视图,把地址栏 /application/ 之后的路径填进来(形如 /application/<appCode>/application-list/<schemaCode>?code=<schemaCode>)。\n- 视图标题:视图名(本场景用 waitForText 等它出现)。\n- 不选行按钮的 code / 显示名:WITH_OUT_VIEW 那个 SCRIPT 按钮。\n- 选行按钮的 code / 显示名:WITH_VIEW 那个 SCRIPT 按钮。\n- 脚本里的 console 片段:要和按钮 script 里的 console.log 文本一致(示例 omc-probe-list-button)。\n\nt248 实测(AI-Platform 1.1.30,模型 lbtnProbe,1 条已提交数据):14 步全 PASS;点 WITH_OUT_VIEW 按钮只出 console 日志、零请求;选行后点 WITH_VIEW 按钮出 GET /api/api/runtime/form/get_form_url 与 GET /api/api/runtime/form/load?...&scriptOpen=true&_viewCode=<viewCode>,errcode 0。",
4
+ "login": true,
5
+ "ignoreConsole": [
6
+ "Cannot read properties of null (reading 'exec')",
7
+ "Blocked script execution in 'about:srcdoc'",
8
+ "allow-scripts' permission is not set"
9
+ ],
10
+ "steps": [
11
+ { "action": "goto", "path": "/application/<替换为appCode>/application-list/<替换为schemaCode>?code=<替换为schemaCode>" },
12
+ { "action": "assert", "kind": "request", "path": "runtime/query/list", "errcode": 0, "withinMs": 20000 },
13
+ { "action": "waitForText", "text": "<替换为列表视图标题>", "timeoutMs": 30000 },
14
+
15
+ { "action": "assert", "kind": "visible", "selector": "#list-actions button.list-action-<替换为列表按钮code>" },
16
+ { "action": "click", "selector": "#list-actions button.list-action-<替换为列表按钮code>" },
17
+ { "action": "assert", "kind": "probeLogContains", "text": "omc-probe-list-button" },
18
+ { "action": "assert", "kind": "noConsoleErrors" },
19
+
20
+ { "action": "goto", "path": "/application/<替换为appCode>/application-list/<替换为schemaCode>?code=<替换为schemaCode>" },
21
+ { "action": "waitForText", "text": "<替换为列表视图标题>", "timeoutMs": 30000 },
22
+ { "action": "wait", "ms": 2500 },
23
+ { "action": "eval", "script": "(function(){var all=[].slice.call(document.querySelectorAll('.ant-checkbox-input')).filter(function(el){return !el.closest('.table-head-row');});if(!all.length){return 'no-row-checkbox';}all[0].click();return 'row-selected';})()" },
24
+ { "action": "click", "selector": "#list-actions button.list-action-<替换为选行按钮code>" },
25
+ { "action": "assert", "kind": "request", "path": "scriptOpen=true", "withinMs": 20000 },
26
+ { "action": "assert", "kind": "noConsoleErrors" }
27
+ ]
28
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "onlinejs",
3
+ "description": "在线 JS 前台验证:确认表单页真的注册并触发了生命周期事件(onLoad/onAdd/onSubmit),保存按钮真的发出 runtime/form/save 请求且 errcode=0,页面没有新的 console error。\n\n路径怎么取:登录后从门户打开目标表单的新增页,把浏览器地址栏里 `.../portal-page/` 之后到 `#` 之前的完整路径复制到下面的 path(例如 /portal-page/defaultPortal/form/xxxx)。如果打开的是列表页再点「新建」,就把列表页地址写进 step#0,再保留 step#2 的点击「新建」。\n\n标签文本(label)要换成你模型里的显示名;按钮文本(text)要换成你表单上实际的按钮名(保存/提交/确定)。\n\n注意:1.1.25 的在线 JS 里 `form` 是闭包参数,页面不暴露 `window.form`,所以 `eventFired/eventRegistered` 只能作为 optional;主断言请用脚本里的 console.log + `probeLogContains`(示例:form.on('onLoad', function(){ console.log('omc-probe-onLoad'); }))。",
4
+ "login": true,
5
+ "steps": [
6
+ { "action": "goto", "path": "/portal-page/<替换为你的表单URL>", "waitMs": 1000 },
7
+ { "action": "waitForText", "text": "<替换为页面标题或“新建”>", "timeoutMs": 30000 },
8
+ { "action": "click", "text": "新建" },
9
+ { "action": "assert", "kind": "probeLogContains", "text": "omc-probe-onLoad" },
10
+ { "action": "assert", "kind": "eventFired", "event": "onLoad", "optional": true },
11
+ { "action": "fill", "label": "<替换为必填字段显示名>", "value": "<占位值>" },
12
+ { "action": "click", "text": "保存" },
13
+ { "action": "assert", "kind": "request", "path": "runtime/form/save", "errcode": 0, "withinMs": 20000 },
14
+ { "action": "assert", "kind": "probeLogContains", "text": "omc-probe-onSubmit" },
15
+ { "action": "assert", "kind": "eventFired", "event": "onSubmit", "optional": true },
16
+ { "action": "assert", "kind": "probeLogContains", "text": "<你脚本里 console.log 的片段>", "optional": true },
17
+ { "action": "assert", "kind": "noConsoleErrors" }
18
+ ]
19
+ }
@@ -453,6 +453,42 @@
453
453
  "workflow participant resolution"
454
454
  ]
455
455
  },
456
+ {
457
+ "capability": "organization lightweight queries (search/visible/tree/users)",
458
+ "status": "executable",
459
+ "scope": "Read-only organization directory faces on the session controller API (the openapi v3 twins require an OAuth2 client id the CLI does not have): POST /api/api/organization/user/searchDepartments {wd} -> DepartmentModel[] (name contains, unpaged), GET /api/api/organization/department/search_dept_detail?deptId= -> data.scopeModel (selection visibility scope; 8.6 stores deptVisibleScope/staffVisibleScope as JSON strings, 2.1.5 adds specialStaffVisibleRules), GET /api/api/organization/department/tree?deptIds= -> direct children only (roots when empty), POST /api/api/organization/user/searchCondiction {userName,deptIds,roleIds,userIds,page,size} -> pageable ignored server-side (UserService.listUsersByIdsAndName drops the Pageable; empty conditions short-circuit to empty). Used to resolve a name / department / mobile into platform-known unit and user ids before building a participant, owner or department scope; pagination is enforced by the CLI (local slicing) so a large tenant never inlines an unbounded list.",
460
+ "version_family": "8.6",
461
+ "anchor_version": "8.6.26",
462
+ "evidence": [
463
+ {
464
+ "path": "packages/omc-cli/src/lanes/org-query.ts",
465
+ "anchor": "org.searchUnits / org.department.search / org.visibleDepartments / org.departmentTree / org.users"
466
+ },
467
+ {
468
+ "path": "packages/omc-cli/src/lanes/org-query-contract.ts",
469
+ "anchor": "session endpoints; openapi v3 rejected (OpenapiPermissionAspect clientId gate)"
470
+ },
471
+ {
472
+ "path": "packages/omc-cli/test/org-query.test.ts",
473
+ "anchor": "fake-harness coverage: paging boundaries, error passthrough, mobile fallback"
474
+ }
475
+ ],
476
+ "lane": "W7-S29-greenfield",
477
+ "tools": [
478
+ "org.searchUnits",
479
+ "org.department.search",
480
+ "org.visibleDepartments",
481
+ "org.departmentTree",
482
+ "org.users"
483
+ ],
484
+ "scopes": [
485
+ "org directory read: search users and departments by name",
486
+ "org directory read: search departments by name (paged)",
487
+ "org directory read: department selection visibility scope",
488
+ "org directory read: direct child departments of a parent",
489
+ "org directory read: in-service user paging (simple/detailed projection)"
490
+ ]
491
+ },
456
492
  {
457
493
  "capability": "W7 S29 residual workflow OQs",
458
494
  "status": "partial",
@@ -1573,12 +1609,28 @@
1573
1609
  "tools": [
1574
1610
  "workflow.transfer",
1575
1611
  "workflow.activate",
1576
- "workflow.finish"
1612
+ "workflow.finish",
1613
+ "workflow.reject",
1614
+ "workflow.forward",
1615
+ "workflow.adjust",
1616
+ "workflow.assist",
1617
+ "workflow.circulate",
1618
+ "workflow.revoke",
1619
+ "workflow.abort",
1620
+ "workflow.rejectActivities"
1577
1621
  ],
1578
1622
  "scopes": [
1579
1623
  "runtime workflow admin adjust participant",
1580
1624
  "runtime workflow admin activate activity",
1581
- "runtime workflow admin finish instance"
1625
+ "runtime workflow admin finish instance",
1626
+ "runtime workflow approval action reject",
1627
+ "runtime workflow approval action forward",
1628
+ "runtime workflow approval action add-sign",
1629
+ "runtime workflow approval action assist",
1630
+ "runtime workflow approval action circulate",
1631
+ "runtime workflow approval action revoke",
1632
+ "runtime workflow approval action abort instance",
1633
+ "runtime workflow approval action reject-target lookup"
1582
1634
  ],
1583
1635
  "revision_note": "r64(2026-11-14)新增:用户需求的流程运维三件套,真机全链实证(workflow_operation approval 对象形状 / adjust_workItem=加签面 / finish=正常完结语义)。定位=测试提速:运维过的实例不能用于真实流程/权限验证。"
1584
1636
  },
@@ -1609,6 +1661,40 @@
1609
1661
  "scopes": [
1610
1662
  "draft published face semantic diff (workflow|form)"
1611
1663
  ]
1664
+ },
1665
+ {
1666
+ "capability": "Runtime file transfer (multipart upload refId ↔ local path download)",
1667
+ "status": "executable",
1668
+ "scope": "Upload a local file through the platform multipart `upload_file` face (plain-string refId) and download it back by refId into a local path (attachment channel or the raw storage-key channel used by upload_file), returning path/size/sha256 without inlining binary bytes. Writable gate + confirmProduction apply to upload; download is a read. RefId is potentially one-shot (consuming delete=true flows remove the refId→filename cache).",
1669
+ "version_family": "8.6",
1670
+ "anchor_version": "8.6.26",
1671
+ "evidence": [
1672
+ {
1673
+ "path": "cp-sources/backend/decompiled-full/launcher-8.6.26/.../QueryRuntimeController.java",
1674
+ "anchor": "2415-2428,2868-2890"
1675
+ },
1676
+ {
1677
+ "path": "cp-sources/backend/decompiled-full/launcher-8.6.26/.../FileServerController.java",
1678
+ "anchor": "78-113"
1679
+ },
1680
+ {
1681
+ "path": "packages/omc-cli/src/lanes/file.ts",
1682
+ "anchor": "file.upload/file.download registration"
1683
+ },
1684
+ {
1685
+ "path": "packages/omc-cli/test/file-transfer.test.ts",
1686
+ "anchor": "file transfer upload/download/one-shot/governance"
1687
+ }
1688
+ ],
1689
+ "lane": "file-transfer",
1690
+ "tools": [
1691
+ "file.upload",
1692
+ "file.download"
1693
+ ],
1694
+ "scopes": [
1695
+ "file upload (multipart → refId)",
1696
+ "file download (refId → local path)"
1697
+ ]
1612
1698
  }
1613
1699
  ]
1614
1700
  }
@@ -141,11 +141,11 @@ 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/unbindRule(绑定与解绑)、delete、workitem.list;**症状排查先 config.diff**(草稿↔发布双面差异:活动/连线/三类绑定,domain 另支持 form 表单布局双面)。**含组织/部门/角色/权限范围(org.* 工具)**:部门树、角色组/角色、用户搜索、成员与管理范围(userScope)——流程参与人/可见性的候选来源。",
145
- operations: ["diff", "list", "create", "update", "publish", "bindRule", "unbindRule", "delete"],
144
+ description: "流程模板生命周期:workflow.list(应用内流程清单)、get_draft/get_published、create、update、publish、bindRule/unbindRule(绑定与解绑)、delete、workitem.list;**症状排查先 config.diff**(草稿↔发布双面差异:活动/连线/三类绑定,domain 另支持 form 表单布局双面)。**审批动作**(平台内置 MCP 同源面):workflow.reject(驳回)/forward(转办)/adjust(加签)/assist(协办)/circulate(传阅)/revoke(撤回)/abort(作废)+ 只读 workflow.rejectActivities(可驳回节点)。**含组织/部门/角色/权限范围(org.* 工具)**:部门树、角色组/角色、用户搜索、成员与管理范围(userScope)——流程参与人/可见性的候选来源。",
145
+ operations: ["diff", "list", "create", "update", "publish", "bindRule", "unbindRule", "delete", "reject", "forward", "adjust", "assist", "circulate", "revoke", "abort"],
146
146
  requires: ["model"],
147
- intent: { level: "partial", note: "声明式支持 workflow.create/update/publish 与 bindRules(事件处理器规则绑定,merge/ensure-present);runtime workitem(提交/审批)仍走 escape hatch。" },
148
- notes: "greenfield 首版;publish/bindRule 不得在 ValidateMessage[] 拒绝时报告成功。组织读写(org.*)挂在本能力下,别名 org/organization/organisation。r64 起含**流程运维三件套**(workflow.transfer 换审批人 / workflow.activate 跳转节点 / workflow.finish 手动结束·end 规则照常触发)——测试提速定位:运维过的实例权限语义已变,不能用于真实流程/权限验证。",
147
+ intent: { level: "partial", note: "声明式支持 workflow.create/update/publish 与 bindRules(事件处理器规则绑定,merge/ensure-present);runtime workitem(提交/审批/驳回/转办等审批动作)仍走 escape hatch。" },
148
+ notes: "greenfield 首版;publish/bindRule 不得在 ValidateMessage[] 拒绝时报告成功。组织读写(org.*)挂在本能力下,别名 org/organization/organisation。r64 起含**流程运维三件套**(workflow.transfer 替换节点参与者 / workflow.activate 跳转节点 / workflow.finish 手动结束·end 规则照常触发)——测试提速定位:运维过的实例权限语义已变,不能用于真实流程/权限验证。t17 起含 **OpenAPI v2 审批动作七件套**(reject/forward/adjust/assist/circulate/revoke/abort):走 `/api/openapi/v2/runtime/workflow/*`(单层 /api,userId 头认人),平台对失败也回 errcode 0 + data:false(工具按 data 判成败);forward 只认第一个接收人,rejectActivities 只回实例走过的节点。",
149
149
  },
150
150
  {
151
151
  id: "onlinejs",
@@ -195,6 +195,14 @@ const SURFACES = [
195
195
  requires: ["field"],
196
196
  intent: { level: "none", note: "未覆盖;用 omc call data.*。" },
197
197
  },
198
+ {
199
+ id: "file",
200
+ title: "文件传输",
201
+ lane: LANES.file,
202
+ description: "本地文件上传取平台 refId;按 refId 下载到本地路径(表单附件通道或 upload_file 临时对象通道),回执 path/size/sha256。",
203
+ operations: ["upload", "download"],
204
+ intent: { level: "none", note: "运行期工具,未进 intent 声明式面;用 omc call file.*。" },
205
+ },
198
206
  ];
199
207
  const COVERAGE_RANK = { executable: 4, partial: 3, "static-only": 2, blocked: 1, unsupported: 0 };
200
208
  const CAPABILITY_ALIASES = Object.freeze({
@@ -218,6 +226,7 @@ const CAPABILITY_ALIASES = Object.freeze({
218
226
  bizservice: ["bizservices", "B2-registration"],
219
227
  report: ["reports", "R1-report"],
220
228
  data: ["runtime-data", "M2-runtime-data"],
229
+ file: ["file-transfer", "files", "文件传输"],
221
230
  });
222
231
  /**
223
232
  * r59 Step 1 — scenario phrases for `commands --filter` ONLY.
@@ -251,6 +260,7 @@ export const CAPABILITY_SCENARIOS = Object.freeze({
251
260
  "连数据库取数", "配SQL数据源", "把数据推送到别的系统", "同步到另一个系统", "同步到别的系统",
252
261
  "回调", "外部系统回调我们"],
253
262
  data: ["造数据", "录数据"],
263
+ file: ["上传文件", "下载文件", "文件传输", "把文件传上去", "取回附件"],
254
264
  });
255
265
  /**
256
266
  * Requirement cues per capability (round 3): the Chinese phrases a requirement
@@ -318,6 +328,7 @@ export const CAPABILITY_CUES = Object.freeze({
318
328
  // 此前只命中 listview 的「列表」→ 路由给视图配置面(用户想查数据却拿到视图读写工具)。
319
329
  // 复合词(不裸配「列表/数据」)避免抢「列表视图/视图列」;评分按 cue 长度,长词胜出。
320
330
  data: ["运行数据", "提交数据", "保存记录", "查记录", "造数据", "测试数据", "测试单据", "造单据", "造单", "录数据", "填数据", "模拟数据", "业务数据", "造几条", "造两张", "造几张", "验数据", "批量导入", "批量写入", "批量删除", "导入数据", "列表数据", "数据列表", "查数据", "数据查询", "拉数据", "拉一份数据", "看看数据", "查一下数据", "数据明细", "取数据", "数据的列表", "数据列表页", "数据记录"],
331
+ file: ["上传文件", "文件上传", "下载文件", "文件下载", "附件下载", "文件传输", "refId"],
321
332
  // r18 (2026-10-26): "造数据 / 造测试单据 / 录数据" is the RUN-DATA capability, but
322
333
  // the goal usually also says 子表/明细 (field cues) — without these compound
323
334
  // cues the router sent the probe to `field` in read mode (write:false), so it
@@ -411,6 +422,7 @@ const CAPABILITY_TOPICS = Object.freeze({
411
422
  bizservice: ["omc-business-configuration", "omc-write-hazards"],
412
423
  report: ["omc-business-configuration", "omc-write-hazards"],
413
424
  data: ["omc-business-configuration", "omc-refusals"],
425
+ file: ["omc-write-hazards", "omc-refusals"],
414
426
  });
415
427
  /** Strongest coverage status across the lane's manifest items. */
416
428
  function coverageOf(manifest, lane) {
@@ -56,6 +56,10 @@ export const CLI_STDOUT_OWNERS = {
56
56
  "workflow-update-publish": "envelope",
57
57
  // 原始输出
58
58
  env: "raw",
59
+ // `frontend probe` 把仓库内探针作为子进程继承 stdio:stdout 是探针自己的
60
+ // 报告/日志,不是信封。主流程再补一个信封会变成「第二个答案」,失败时还会
61
+ // 谎报「以退出码 N 结束但没有写出结果信封」。退出码由子进程透传。
62
+ frontend: "raw",
59
63
  // MCP stdio 服务器:stdout 是 JSON-RPC 帧流,补一个信封会直接污染协议。
60
64
  "mcp-graph": "raw",
61
65
  "--version": "raw",
package/dist/cli.js CHANGED
@@ -2,8 +2,10 @@
2
2
  // T04:SQLite 警告过滤器必须保持第一个 import(先于任何拉起 omc-core/node:sqlite 的模块)。
3
3
  import "./sqlite-warning-filter.js";
4
4
  import { argvValue } from "./args.js";
5
- import { spawnSync } from "node:child_process";
5
+ import { spawn, spawnSync } from "node:child_process";
6
6
  import { createInterface } from "node:readline/promises";
7
+ import { fileURLToPath } from "node:url";
8
+ import { homedir } from "node:os";
7
9
  import { stdin, argv } from "node:process";
8
10
  import { createRequire } from "node:module";
9
11
  import { Command, CommanderError, Option } from "commander";
@@ -28,7 +30,7 @@ import { sessionAccountForEnvironment } from "./session-account.js";
28
30
  import { closeWritableWindow, openWritableWindow, parseWritableTtl, sweepWritableWindowsAtStartup, validateWritableReason, writableWindowStatus, WRITABLE_WINDOW_DEFAULT_TTL_MINUTES, WRITABLE_WINDOW_LOG, WRITABLE_WINDOW_MAX_TTL_MINUTES, WritableWindowInputError } from "./writable-window.js";
29
31
  import { artifactPathMissHint, nullProjectionHint, PATH_MISS_HELP_REF, partialPathMissHint, pathMissCopyableHint, pathMissCopyablePaths, pathMissCrossFaceCorrection, pathMissDidYouMean, projectJsonPath, projectJsonPathFanout, projectResultExtract, shapeOf, SHAPE_MAX_DEPTH, unwrapSinglePathProjection } from "./path-projection.js";
30
32
  import { basename, dirname, join, resolve } from "node:path";
31
- import { existsSync, readFileSync, writeFileSync, chmodSync } from "node:fs";
33
+ import { existsSync, readFileSync, writeFileSync, chmodSync, mkdirSync } from "node:fs";
32
34
  import { buildToolRegistry } from "./tools.js";
33
35
  import { parseDurationMs } from "./duration.js";
34
36
  import { acquireWriteLock, writeLockHeldFace } from "./write-lock.js";
@@ -190,8 +192,9 @@ async function cmdDoctor(store, environment, serviceCode) {
190
192
  const manifest = loadCoverageManifest();
191
193
  const steps = [];
192
194
  let ok = true;
193
- // 版本族缺口(§三.3-9):没有版本证据时也要照实说「无证据 → 写 fail closed」,
194
- // 所以用 undefined 而不是拼一个默认值。
195
+ // 版本族缺口(§三.3-9):没有版本证据时也要照实说「无证据 → 按兼容模式放行、
196
+ // 平台是最终门」(2026-11-24 口径;不再是 fail closed),所以用 undefined
197
+ // 而不是拼一个默认值。
195
198
  let detectedVersion;
196
199
  // r45 Windows 实测:PowerShell 管道按 GBK(936) 解码 CLI 的 UTF-8 输出 → 全屏乱码,
197
200
  // 且用户常误判为「OMC 输出坏了」。doctor 是入口体检,顺手检测活动代码页。
@@ -242,7 +245,7 @@ async function cmdDoctor(store, environment, serviceCode) {
242
245
  const version = session.detectedVersion();
243
246
  detectedVersion = version;
244
247
  if (!version) {
245
- steps.push(`版本 WARN 无版本证据;写入将保守拒绝(fail closed)`);
248
+ steps.push(`版本 WARN 无版本证据;写入按兼容模式放行(versionEvidence=absent),平台是最终门`);
246
249
  }
247
250
  else {
248
251
  const notice = versionFamilyNotice(manifest, version);
@@ -1015,8 +1018,14 @@ function resolvedDefaultEnvironment(store) {
1015
1018
  * template re-read three times is 81 KB of the session.
1016
1019
  */
1017
1020
  const ARTIFACT_INLINE_CEILING_BYTES = 8192;
1018
- /** commands --json 的上下文预算;当前目录约 31.5KiB,留出兼容窗口。 */
1019
- const COMMANDS_JSON_INLINE_CEILING_BYTES = 32 * 1024;
1021
+ /**
1022
+ * commands --json 的上下文预算。2026-11-24(审批动作 / MCP 对齐批):32KiB →
1023
+ * 40KiB——裸目录已到 32.8KB(workflow 审批动作七件套 + 可驳回节点查询 8 行),
1024
+ * 越过旧 32KiB 门会让 `commands --json` 外置成 artifact 指针(artifactId 随机,
1025
+ * golden master 当场漂移),而目录本身仍应内联可读。文本门与本体门同批抬到
1026
+ * 40,000/340,000(见 test/context-cost-budgets.test.ts)。
1027
+ */
1028
+ const COMMANDS_JSON_INLINE_CEILING_BYTES = 40 * 1024;
1020
1029
  /** 超过这个体积就提醒走更窄的面(不改变返回值)。 */
1021
1030
  const COMMANDS_JSON_HINT_BYTES = 16 * 1024;
1022
1031
  /**
@@ -2763,6 +2772,156 @@ function joinSplitFlagValues(raw, flags) {
2763
2772
  }
2764
2773
  /** r60b-F7:最近一次 commander 帮助输出(configureOutput 的写通道暂存)。 */
2765
2774
  let lastHelpChunk = "";
2775
+ const FRONTEND_CACHE_DIR = join(homedir(), ".omc", "frontend-probe");
2776
+ /** 与探针共用:`omc frontend setup` 把 playwright-core 装到 <cache>/node_modules。 */
2777
+ function resolveFrontendPlaywrightRoot() {
2778
+ const root = join(FRONTEND_CACHE_DIR, "node_modules");
2779
+ return existsSync(join(root, "playwright")) || existsSync(join(root, "playwright-core")) ? root : undefined;
2780
+ }
2781
+ function detectFrontendChromium() {
2782
+ const explicit = process.env.PW_EXECUTABLE_PATH ?? process.env.CHROME_PATH ?? process.env.PUPPETEER_EXECUTABLE_PATH;
2783
+ if (explicit)
2784
+ return existsSync(explicit) ? explicit : null;
2785
+ const candidates = [
2786
+ "/usr/bin/chromium", "/usr/bin/chromium-browser", "/usr/bin/google-chrome",
2787
+ "/usr/bin/google-chrome-stable", "/opt/google/chrome/chrome", "/snap/bin/chromium",
2788
+ "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
2789
+ "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
2790
+ "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
2791
+ ];
2792
+ return candidates.find((candidate) => existsSync(candidate)) ?? null;
2793
+ }
2794
+ function spawnCapture(command, args, env = process.env) {
2795
+ return new Promise((done) => {
2796
+ const child = spawn(command, args, { stdio: ["ignore", "pipe", "pipe"], env });
2797
+ let stdout = "";
2798
+ let stderr = "";
2799
+ child.stdout?.on("data", (chunk) => { stdout += chunk.toString("utf8"); });
2800
+ child.stderr?.on("data", (chunk) => { stderr += chunk.toString("utf8"); });
2801
+ child.on("error", (error) => done({ code: CLI_EXIT_CODES.internal, stdout, stderr: `${stderr}${error.message}` }));
2802
+ child.on("close", (code) => done({ code: code ?? CLI_EXIT_CODES.internal, stdout, stderr }));
2803
+ });
2804
+ }
2805
+ /**
2806
+ * `omc frontend setup`:方案 A —— 只装 `playwright-core`(几 MB,不下载浏览器),
2807
+ * 用系统 Chromium/Chrome;装到 OMC 自己的缓存目录,不污染全局 node_modules。
2808
+ * `--check` 只诊断,不联网。
2809
+ */
2810
+ async function runFrontendSetup(options) {
2811
+ const chromium = detectFrontendChromium();
2812
+ const playwrightRoot = resolveFrontendPlaywrightRoot();
2813
+ if (options.check === true) {
2814
+ console.log(JSON.stringify({
2815
+ ok: playwrightRoot !== undefined && chromium !== null,
2816
+ cacheDir: FRONTEND_CACHE_DIR,
2817
+ playwrightRoot: playwrightRoot ?? null,
2818
+ chromium,
2819
+ installCommand: playwrightRoot === undefined ? `npm install --prefix ${FRONTEND_CACHE_DIR} playwright-core` : null,
2820
+ envHint: chromium === null ? "设置 PW_EXECUTABLE_PATH 指向 Chromium/Chrome,或安装系统浏览器" : null,
2821
+ }, null, 2));
2822
+ return CLI_EXIT_CODES.ok;
2823
+ }
2824
+ mkdirSync(FRONTEND_CACHE_DIR, { recursive: true });
2825
+ console.error(`[omc frontend] 安装 playwright-core → ${FRONTEND_CACHE_DIR}(不下载浏览器,使用系统 Chromium)`);
2826
+ const npm = process.platform === "win32" ? "npm.cmd" : "npm";
2827
+ const installed = await spawnCapture(npm, [
2828
+ "install", "--prefix", FRONTEND_CACHE_DIR, "playwright-core",
2829
+ "--no-audit", "--no-fund", "--loglevel=error",
2830
+ ...(options.force === true ? ["--force"] : []),
2831
+ ]);
2832
+ if (installed.code !== 0) {
2833
+ console.error(`[omc frontend] playwright-core 安装失败(exit ${installed.code}):${installed.stderr.trim().slice(-800)}`);
2834
+ return installed.code;
2835
+ }
2836
+ const root = resolveFrontendPlaywrightRoot();
2837
+ if (root === undefined) {
2838
+ console.error(`[omc frontend] 安装命令成功但 ${join(FRONTEND_CACHE_DIR, "node_modules")} 下仍找不到 playwright-core`);
2839
+ return CLI_EXIT_CODES.internal;
2840
+ }
2841
+ if (chromium === null) {
2842
+ console.error("[omc frontend] playwright-core 已装好,但未找到 Chromium/Chrome;请安装系统浏览器或设置 PW_EXECUTABLE_PATH。");
2843
+ return CLI_EXIT_CODES.authConfig;
2844
+ }
2845
+ console.log(JSON.stringify({ ok: true, cacheDir: FRONTEND_CACHE_DIR, playwrightRoot: root, chromium }, null, 2));
2846
+ return CLI_EXIT_CODES.ok;
2847
+ }
2848
+ /**
2849
+ * `omc frontend probe`:把仓库内的 Playwright 前台探针(conformance/
2850
+ * frontend-behavior-probe.mjs)作为 CLI 子命令跑起来。它不是 `call` 工具,
2851
+ * 不进 tools/list;只负责解析环境/凭据并以子进程继承 stdio,退出码透传。
2852
+ *
2853
+ * 凭据从配置根读取后经环境变量注入子进程(不落盘);手跑场景仍可用 CREDS。
2854
+ * Playwright/Chromium 不是硬依赖:缺了由探针给出 PW_ROOT/PW_EXECUTABLE_PATH 指引。
2855
+ */
2856
+ async function runFrontendProbe(options) {
2857
+ const probePath = fileURLToPath(new URL("../conformance/frontend-behavior-probe.mjs", import.meta.url));
2858
+ if (!existsSync(probePath)) {
2859
+ console.error(`[omc frontend] 探针脚本不存在:${probePath}(当前安装包未包含 conformance/;请从源码仓库运行,或升级到含该文件的版本)`);
2860
+ return CLI_EXIT_CODES.internal;
2861
+ }
2862
+ const args = [probePath];
2863
+ if (options.selfTest === true)
2864
+ args.push("--self-test");
2865
+ else if (options.validate !== undefined)
2866
+ args.push("--validate", options.validate);
2867
+ else if (options.scenario !== undefined)
2868
+ args.push("--scenario", options.scenario);
2869
+ else {
2870
+ console.error("用法:omc frontend probe --scenario <file> [--env <name>] [--report-dir <dir>] [--headed] [--fail-fast] [--trace]\n omc frontend probe --validate <file>\n omc frontend probe --self-test");
2871
+ return CLI_EXIT_CODES.invalidInput;
2872
+ }
2873
+ if (options.reportDir !== undefined)
2874
+ args.push("--out", options.reportDir);
2875
+ if (options.headed === true)
2876
+ args.push("--headed");
2877
+ if (options.failFast === true)
2878
+ args.push("--fail-fast");
2879
+ if (options.trace === true)
2880
+ args.push("--trace");
2881
+ if (options.screenshots === true)
2882
+ args.push("--screenshots");
2883
+ if (options.timeout !== undefined)
2884
+ args.push("--timeout", options.timeout);
2885
+ const env = { ...process.env };
2886
+ if (env.PW_ROOT === undefined) {
2887
+ const cached = resolveFrontendPlaywrightRoot();
2888
+ if (cached !== undefined)
2889
+ env.PW_ROOT = cached;
2890
+ }
2891
+ if (options.selfTest !== true && options.validate === undefined) {
2892
+ try {
2893
+ const store = new ConfigStore(defaultPaths());
2894
+ const resolved = store.resolveEnvironment(options.env);
2895
+ const baseUrl = (options.baseUrl ?? resolved.profile.baseUrl).replace(/\/+$/, "");
2896
+ args.push("--base-url", baseUrl);
2897
+ env.OMC_ENV = resolved.name;
2898
+ env.BASE_URL = baseUrl;
2899
+ try {
2900
+ const credential = store.readCredential(resolved.name);
2901
+ env.OMC_PROBE_USERNAME = credential.username;
2902
+ env.OMC_PROBE_PASSWORD = credential.password;
2903
+ }
2904
+ catch {
2905
+ // 凭据不在配置根时,退回探针的 CREDS 文件路径(手跑场景)。
2906
+ }
2907
+ }
2908
+ catch (error) {
2909
+ if (options.baseUrl === undefined) {
2910
+ console.error(`[omc frontend] 无法解析环境:${error instanceof Error ? error.message : String(error)}`);
2911
+ return CLI_EXIT_CODES.invalidInput;
2912
+ }
2913
+ args.push("--base-url", options.baseUrl);
2914
+ }
2915
+ }
2916
+ return await new Promise((resolve) => {
2917
+ const child = spawn(process.execPath, args, { stdio: "inherit", env });
2918
+ child.on("error", (error) => {
2919
+ console.error(`[omc frontend] 探针启动失败:${error.message}`);
2920
+ resolve(CLI_EXIT_CODES.internal);
2921
+ });
2922
+ child.on("close", (code) => resolve(code ?? CLI_EXIT_CODES.internal));
2923
+ });
2924
+ }
2766
2925
  async function main() {
2767
2926
  let commandExitCode = 0;
2768
2927
  // r73 #7:artifact get 的 --out 值(在 configureOutput 之前截获,见下)。全局
@@ -3058,6 +3217,30 @@ async function main() {
3058
3217
  // landed in the argParser slot and silently dropped every --steps value
3059
3218
  // (live 2026-10-18: `--steps "审批@role:x"` answered "至少一个 --steps").
3060
3219
  const collectValues = (value, previous = []) => [...previous, value];
3220
+ const frontendCommand = command.command("frontend").description("前台运行时验证(Playwright):omc frontend probe --scenario <file> --env <name>(在线 JS / 表单按钮 / 列表按钮 / 计算规则 / 字段显隐)");
3221
+ frontendCommand
3222
+ .command("setup")
3223
+ .description("一次性安装 playwright-core 到 OMC 缓存(不下载浏览器,使用系统 Chromium/Chrome)")
3224
+ .option("--check", "只诊断(输出 JSON,不联网安装)")
3225
+ .option("--force", "强制重装 playwright-core")
3226
+ .addHelpText("after", "\n等价手工命令:npm install --prefix " + FRONTEND_CACHE_DIR + " playwright-core\n探针会自动优先从该缓存加载;也可设 PW_ROOT 指向已有 playwright 的 node_modules、PW_EXECUTABLE_PATH 指向浏览器。\n")
3227
+ .action(async (options) => { commandExitCode = await runFrontendSetup(options); });
3228
+ frontendCommand
3229
+ .command("probe")
3230
+ .description("跑前台行为探针;产出 probe-report.json(默认不截图)")
3231
+ .option("--scenario <file>", "场景 JSON(模板见 conformance/frontend-scenarios/)")
3232
+ .option("--env <environment>", "环境名(决定 baseUrl 与登录凭据;--base-url 可覆盖地址)")
3233
+ .option("--base-url <url>", "覆盖环境 baseUrl")
3234
+ .option("--report-dir <dir>", "探针输出目录(报告 + 截图;默认 ./frontend-probe-out)。注意:全局 `--out <file>` 是 stdout 信封落盘,与此无关")
3235
+ .option("--headed", "显示浏览器")
3236
+ .option("--fail-fast", "首个失败即停")
3237
+ .option("--timeout <ms>", "单步/等待超时")
3238
+ .option("--screenshots", "逐步骤截图(默认不截图;失败也不自动截图)")
3239
+ .option("--trace", "写 Playwright trace.zip")
3240
+ .option("--self-test", "用内联 HTML 验证探针自身(不连环境)")
3241
+ .option("--validate <file>", "离线校验场景 JSON")
3242
+ .addHelpText("after", "\n需要 Playwright + Chromium:默认从 PW_ROOT 的 node_modules 取 playwright、PW_EXECUTABLE_PATH 或 /usr/bin/chromium 启浏览器;缺失时探针会给出安装指引。凭据从 OMC 配置根读取,也可用 CREDS 文件。\n默认**不写截图**(--screenshots 开启)。stdout 只有探针自己的输出(无 CLI 信封),退出码透传:0 全通过 · 1 断言/步骤失败 · 2 场景非法 · 3 harness/登录/浏览器错误。\n场景提交/保存数据成功后会打印 `DATA-LINK <url>`,可直接点开该单据。\n示例:omc frontend probe --scenario calc-visibility.json --env t248 --report-dir /tmp/probe-out --headed\n")
3243
+ .action(async (options) => { commandExitCode = await runFrontendProbe(options); });
3061
3244
  command.command("rule-when").option("--schema <schemaCode>").option("--schema-code <schemaCode>").option("--on <trigger>", "触发时机:create | update(**没有 submit**——提交后执行请用 create 或 update,按平台触发面语义选)").addOption(new Option("--when <condition>", "条件,可重复").argParser(collectValues).default([])).addOption(new Option("--then <action>", "动作,可重复").argParser(collectValues).default([])).option("--name <name>").option("--env <environment>").option("--environment <environment>").option("--apply").addHelpText("after", "\n条件-动作规则拼装器:--when 条件(可多个 AND)→ --then set:字段=值/引用/公式。编译为设计器验证形状(预置触发+UPDATE filter/赋值)。默认 dry-run,--apply 保存并发布;前台生效按输出清单人工验证。\n触发时机只有 create / update 两个(无 submit):\"提交后/审批前\"这类需求在平台侧没有独立触发点,用 create(新建即触发)或 update(更新即触发)表达;要按状态过滤,把条件写进 --when。\n").action(async (options) => {
3062
3245
  const rest = ["rule-when", ...(options.schema ? ["--schema", options.schema] : []), ...(options.schemaCode ? ["--schema-code", options.schemaCode] : []), ...(options.on ? ["--on", options.on] : []), ...(Array.isArray(options.when) ? options.when.flatMap((w) => ["--when", w]) : []), ...(Array.isArray(options.then) ? options.then.flatMap((a) => ["--then", a]) : []), ...(options.name ? ["--name", options.name] : []), ...(options.env ? ["--env", options.env] : []), ...(options.environment ? ["--environment", options.environment] : []), ...(options.apply ? ["--apply"] : [])];
3063
3246
  commandExitCode = await cmdRuleWhen(rest);
@@ -17,6 +17,7 @@ import { RULE_LIFECYCLE_LANE_CONTRACT } from "./lanes/rule-lifecycle-contract.js
17
17
  import { REPORT_LANE_CONTRACT } from "./lanes/report-contract.js";
18
18
  import { RUNTIME_DATA_LANE_CONTRACT } from "./lanes/runtime-data-contract.js";
19
19
  import { WORKFLOW_LANE_CONTRACT } from "./lanes/workflow-contract.js";
20
+ import { FILE_LANE_CONTRACT } from "./lanes/file-contract.js";
20
21
  export const LANE_CONTRACTS = Object.freeze([
21
22
  APP_LANE_CONTRACT,
22
23
  B2_LANE_CONTRACT,
@@ -37,6 +38,7 @@ export const LANE_CONTRACTS = Object.freeze([
37
38
  REPORT_LANE_CONTRACT,
38
39
  RUNTIME_DATA_LANE_CONTRACT,
39
40
  WORKFLOW_LANE_CONTRACT,
41
+ FILE_LANE_CONTRACT,
40
42
  ]);
41
43
  export function contractMarkdown(contract) {
42
44
  const tools = Object.entries(contract.tools).map(([name, tool]) => `- ${name} — ${tool.scope}\n ${tool.description}`).join("\n");
@@ -14,8 +14,10 @@ import { PROGRAMMING_COVERAGE } from "./lanes/programming-coverage.js";
14
14
  import { RULE_LIFECYCLE_COVERAGE } from "./lanes/rule-lifecycle-coverage.js";
15
15
  import { RUNTIME_DATA_COVERAGE } from "./lanes/runtime-data-coverage.js";
16
16
  import { WORKFLOW_COVERAGE } from "./lanes/workflow-coverage.js";
17
+ import { ORG_QUERY_COVERAGE } from "./lanes/org-query-coverage.js";
17
18
  import { REPORT_COVERAGE } from "./lanes/report-coverage.js";
18
19
  import { PERM_COVERAGE } from "./lanes/perm-coverage.js";
20
+ import { FILE_COVERAGE } from "./lanes/file-coverage.js";
19
21
  /**
20
22
  * Every lane's structured capability declaration, gathered in one frozen
21
23
  * registry. This is the source the runtime coverage gate consults, and the
@@ -34,12 +36,14 @@ const DECLARATIONS = Object.freeze([
34
36
  ...RULE_LIFECYCLE_COVERAGE,
35
37
  ...RUNTIME_DATA_COVERAGE,
36
38
  ...WORKFLOW_COVERAGE,
39
+ ...ORG_QUERY_COVERAGE,
37
40
  ...ONLINE_JS_COVERAGE,
38
41
  ...PROGRAMMING_COVERAGE,
39
42
  ...B2_COVERAGE,
40
43
  ...LIST_VIEW_COVERAGE,
41
44
  ...REPORT_COVERAGE,
42
45
  ...PERM_COVERAGE,
46
+ ...FILE_COVERAGE,
43
47
  ]);
44
48
  export function laneCoverageDeclarations() {
45
49
  return DECLARATIONS;
package/dist/coverage.js CHANGED
@@ -118,8 +118,9 @@ function citationFor(item, requestedScope) {
118
118
  * outside the anchored family is ACCEPTED and this returns the notice to surface
119
119
  * (omc is built on 8.6; other products/versions run in compatibility mode and
120
120
  * some faces may not apply). Returns undefined when the version is inside the
121
- * family, or when there is no evidence to judge (the caller keeps its own
122
- * fail-closed behavior for missing evidence).
121
+ * family. Missing evidence is NOT a refusal any more (see
122
+ * `versionEvidenceAbsentNotice`): callers still need a notice for that case,
123
+ * so they call the other function instead of relying on this one's undefined.
123
124
  */
124
125
  export function versionFamilyNotice(manifest, detectedVersion) {
125
126
  if (detectedVersion.startsWith(manifest.version_family + "."))
@@ -128,4 +129,17 @@ export function versionFamilyNotice(manifest, detectedVersion) {
128
129
  `(锚点 ${manifest.anchor_version})。OMC 基于 8.6 构建,非 8.6 环境按兼容支持,部分能力面可能不适用。` +
129
130
  `取证口径:以本环境真机实测为准,8.6 文档与反编译结论仅作参考。`);
130
131
  }
132
+ /**
133
+ * 无版本证据时的兼容提示(2026-11-24 产品口径)。
134
+ *
135
+ * 版本串探测不到**不再关闭写面**:它挡的从来不是「版本不同」,而是「没有任何
136
+ * 证据」;多版本兼容优先,平台才是最终门。放行的同时必须把这个事实显式带到
137
+ * 回执上(`versionEvidence:"absent"` + 本提示),否则调用方会把它当「已验证
138
+ * 8.6 语义」而误判形状差异。
139
+ */
140
+ export function versionEvidenceAbsentNotice(manifest) {
141
+ return (`未探测到平台版本(versionEvidence=absent):按兼容模式放行,平台是最终门——` +
142
+ `写入若不被本环境接受,平台错误照实回传。OMC 基于 ${manifest.version_family} 构建(锚点 ${manifest.anchor_version}),` +
143
+ `未取证的版本差异不在此预判;需要版本证据时跑 omc doctor / discover_environment(必要时 refresh 刷登录缓存)。`);
144
+ }
131
145
  //# sourceMappingURL=coverage.js.map