bpmax-cli 0.2.1-beta.19 → 0.2.1-beta.20

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 (93) hide show
  1. package/dist/bin.js +699 -34
  2. package/dist/bin.js.map +1 -1
  3. package/package.json +1 -1
  4. package/skills/bpmax-api-platform-editor/SKILL.md +24 -31
  5. package/skills/bpmax-api-platform-editor/agents/openai.yaml +2 -2
  6. package/skills/bpmax-api-platform-editor/references/platform-api-map.md +2 -2
  7. package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +3 -3
  8. package/skills/bpmax-builder-shared/template_script_hard_rules.py +3 -1
  9. package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +16 -0
  10. package/skills/bpmax-console-template-editor/SKILL.md +109 -523
  11. package/skills/bpmax-console-template-editor/agents/openai.yaml +2 -2
  12. package/skills/bpmax-console-template-editor/references/full-detail-guide.md +45 -0
  13. package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +13 -12
  14. package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +65 -78
  15. package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +86 -30
  16. package/skills/bpmax-dataset-field-template-editor/SKILL.md +124 -594
  17. package/skills/bpmax-dataset-field-template-editor/references/full-detail-guide.md +570 -0
  18. package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +1 -1
  19. package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +11 -77
  20. package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +4 -57
  21. package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +2 -0
  22. package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +4 -78
  23. package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +3 -89
  24. package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +14 -0
  25. package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +2 -0
  26. package/skills/bpmax-dataset-template-editor/SKILL.md +112 -778
  27. package/skills/bpmax-dataset-template-editor/references/full-detail-guide.md +753 -0
  28. package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +1 -0
  29. package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +2 -2
  30. package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +8 -1
  31. package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +9 -90
  32. package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +8 -1
  33. package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +8 -1
  34. package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +1 -2
  35. package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +8 -1
  36. package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +8 -1
  37. package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +6 -40
  38. package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +8 -4
  39. package/skills/bpmax-e2e-flow-test-operator/SKILL.md +111 -552
  40. package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +11 -3
  41. package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +6 -5
  42. package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +563 -0
  43. package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +4 -4
  44. package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +1 -1
  45. package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +3 -1
  46. package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +7 -5
  47. package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +2 -2
  48. package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +5 -1
  49. package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +71 -0
  50. package/skills/bpmax-filter-template-editor/SKILL.md +110 -551
  51. package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +18 -18
  52. package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +29 -26
  53. package/skills/bpmax-filter-template-editor/references/full-detail-guide.md +56 -0
  54. package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +10 -9
  55. package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +7 -57
  56. package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +4 -48
  57. package/skills/bpmax-flow-template-editor/SKILL.md +109 -1151
  58. package/skills/bpmax-flow-template-editor/agents/openai.yaml +2 -2
  59. package/skills/bpmax-flow-template-editor/references/diff-strategy.md +3 -3
  60. package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +9 -9
  61. package/skills/bpmax-flow-template-editor/references/full-detail-guide.md +1155 -0
  62. package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +1 -1
  63. package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +3 -3
  64. package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +7 -7
  65. package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +2 -2
  66. package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +2 -2
  67. package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +7 -23
  68. package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +1 -1
  69. package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +19 -75
  70. package/skills/bpmax-form-template-editor/SKILL.md +111 -1151
  71. package/skills/bpmax-form-template-editor/agents/openai.yaml +2 -2
  72. package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +51 -51
  73. package/skills/bpmax-form-template-editor/references/full-detail-guide.md +1108 -0
  74. package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +4 -4
  75. package/skills/bpmax-form-template-editor/references/payload-checklist.md +1 -1
  76. package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +8 -0
  77. package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +42 -19
  78. package/skills/bpmax-list-template-editor/SKILL.md +110 -466
  79. package/skills/bpmax-list-template-editor/agents/openai.yaml +2 -2
  80. package/skills/bpmax-list-template-editor/references/full-detail-guide.md +454 -0
  81. package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +6 -9
  82. package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +1 -1
  83. package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +9 -78
  84. package/skills/bpmax-nav-config-editor/SKILL.md +13 -17
  85. package/skills/bpmax-nav-config-editor/agents/openai.yaml +2 -2
  86. package/skills/bpmax-nav-config-editor/references/api-workflow.md +2 -2
  87. package/skills/bpmax-nav-config-editor/references/runtime-probing.md +11 -12
  88. package/skills/bpmax-project/SKILL.md +1 -0
  89. package/skills/bpmax-project-detail-template-editor/SKILL.md +11 -33
  90. package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +2 -2
  91. package/skills/bpmax-role-editor/SKILL.md +7 -30
  92. package/skills/bpmax-user-mock-operator/SKILL.md +1 -1
  93. package/skills/bpmax-user-mock-operator/agents/openai.yaml +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmax-cli",
3
- "version": "0.2.1-beta.19",
3
+ "version": "0.2.1-beta.20",
4
4
  "description": "CLI for BPMAX environments with multi-profile config and local login callback flow",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "bpmax-api-platform-editor"
3
- description: "用于在 BPMAX 的系统集成页面中创建或编辑集成平台、实例配置和 API 代理配置,并通过系统 API 文档页完成标准调试闭环。只要用户提到“新建集成平台”“编辑集成平台”“编辑实例配置”“编辑接口代理”“调试系统API”“改 link_system 配置”“调试 api-docs/system_api”“构造 api_platform / api_platform_instance / api_proxy 数据”或等价表达,就应使用这个 skill。它优先复用当前浏览器登录态和真实页面请求骨架,结合本地 think_api_platform / think_api_proxy 镜像与线上页面事实,完成平台、实例、API、实体绑定相关配置的读取、修改、保存回读和文档页调试验证。"
3
+ description: "用于通过 bpmax-cli typed config 创建或编辑 BPMAX 集成平台、实例配置和 API 代理配置,并完成系统 API 标准调试闭环。只要用户提到“新建集成平台”“编辑集成平台”“编辑实例配置”“编辑接口代理”“调试系统API”“改 link_system 配置”“调试 api-docs/system_api”“构造 api_platform / api_platform_instance / api_proxy 数据”或等价表达,就应使用这个 skill。它以 typed CLI profile、线上接口回读、本地 think_api_platform / think_api_proxy 镜像和调试证据为依据,完成平台、实例、API、实体绑定相关配置的读取、修改、保存回读和验证。"
4
4
  ---
5
5
 
6
6
  # BPMAX API Platform Editor
@@ -19,13 +19,13 @@ description: "用于在 BPMAX 的系统集成页面中创建或编辑集成平
19
19
  - 不得以历史脏配置、顺手修复、统一风格、编辑器自动补字段、方便调试为理由修改需求外配置。
20
20
 
21
21
  ## 何时使用
22
- - 用户已经在浏览器打开 BPMAX 系统集成页面、实例编辑页、API 编辑页或系统 API 文档调试页。
22
+ - 用户需要通过 bpmax-cli typed config 管理 BPMAX 系统集成平台、实例、API 或代理配置。
23
23
  - 用户要新增、编辑或核对集成平台、实例、API 代理、响应映射。
24
- - 用户希望直接复用当前登录态和页面上下文,不手动找鉴权。
24
+ - 用户需要使用当前 CLI profile、capability 和线上回读结果完成配置闭环。
25
25
  - 用户要求把接口配置完后再在系统 API 文档页完成真实调试。
26
26
 
27
27
  ## 前置条件
28
- - 用户必须先打开以下任一页面:
28
+ - 先通过 CLI profile/capability 和目标参数确认以下任一对象:
29
29
  - `.../w:<workspace>/link_system`
30
30
  - `.../w:<workspace>/link_system/detail?system=<platform_key>`
31
31
  - `.../w:<workspace>/link_system/instance/edit?system=<platform_key>&id=<id>`
@@ -42,7 +42,7 @@ description: "用于在 BPMAX 的系统集成页面中创建或编辑集成平
42
42
 
43
43
  ## 脚本化闭环(第二阶段)
44
44
  - 当前 skill 已补齐最小脚本化闭环,临时工件统一放在 `.codex/tmp/api-platform-editor/`:
45
- - `contracts/`:浏览器 `copy as fetch/curl` 或 HAR 导出的真实写契约
45
+ - `contracts/`:typed CLI adapter 的 operation plan、capability 和 readback 契约
46
46
  - `raw/`、`work/`、`meta/`:导出线上对象、人工编辑工作副本、确认状态
47
47
  - `submit/`:最终提交包
48
48
  - `result/`:提交响应、回读、verify、doc-debug 验收记录
@@ -55,9 +55,8 @@ description: "用于在 BPMAX 的系统集成页面中创建或编辑集成平
55
55
  5. 先 dry-run:`bpmax-cli config api-platform submit --id <same-id> --payload <submit-file> --profile <profile> --format json`
56
56
  6. 用户确认后再执行 `--confirm "submit api-platform <same-id>"`
57
57
  7. 如果是实例或 API 变更,再执行文档页真实调试验收
58
- - 当前仍必须保留浏览器参与的环节:
59
- - 抓真实保存请求
60
- - 在系统 API 文档页点击“发送请求”
58
+ - 当前仍必须保留页面参与的环节:
59
+ - 在系统 API 文档页点击“发送请求”做真实调试
61
60
  - 最终页面刷新验收
62
61
  - `doc-debug` 层只负责导出上下文和记录验收结果,不替代浏览器真实调试。
63
62
 
@@ -80,8 +79,8 @@ description: "用于在 BPMAX 的系统集成页面中创建或编辑集成平
80
79
  - 如果停在“已改配置但未完成文档页调试”或“调试失败待排查”,结束前写 `session_state`。
81
80
 
82
81
  ## 核心原则
83
- - 优先复用当前浏览器页面的同域授权上下文,不要先假设有独立 API Key。
84
- - 浏览器实时线上页面、实时接口返回、当前页面真实请求体优先于本地 `think_api_platform`、`think_api_proxy` 镜像;本地配置只作为候选和结构参考,不能覆盖线上事实。
82
+ - 优先使用 bpmax-cli typed config 的当前 profile/auth/capability,不得把页面会话凭据作为配置读取或写入凭据。
83
+ - typed CLI 线上回读、实时接口返回和只读页面验收优先于本地 `think_api_platform`、`think_api_proxy` 镜像;本地配置只作为候选和结构参考,不能覆盖线上事实。
85
84
  - 平台、实例、API、实体绑定必须分层处理,不要把它们混成一份“总配置”。
86
85
  - 已验证的读取接口优先级:
87
86
  - 平台:`GET /api/api_platform`、`GET /api/api_platform/by_key/:platform_key`
@@ -92,7 +91,7 @@ description: "用于在 BPMAX 的系统集成页面中创建或编辑集成平
92
91
  - `/w:<workspace>/api-docs/system_api/<apiId>?system=<platform_key>`
93
92
  - 不把 API 编辑页里的调试区作为标准验收路径
94
93
  - 只要涉及实例脚本、签名、`request_schema`、响应映射或示例变更,就必须在文档调试页复测。
95
- - 实施保存时,先抓当前页面真实保存请求并落到 `contracts/<layer>.<mode>.json`,再用脚本 build/submit;不要预先硬编码未验证的写接口形状。
94
+ - 实施保存时,先通过 typed CLI adapter 的 operation plan、capability 和 readback 契约确认写入范围,再 build/submit;不要预先硬编码未验证的写接口形状。
96
95
  - 除非用户明确要求,线上验证结果不手动回写本地配置镜像;本地仓库只更新 skill 和文档。
97
96
 
98
97
  ## 工作流
@@ -106,14 +105,11 @@ description: "用于在 BPMAX 的系统集成页面中创建或编辑集成平
106
105
  - 如果是 `/api-docs/system_api/<id>?system=...`,按文档调试页处理。
107
106
  - 进入配置构造前,先按平台、实例、API 和调试目标检索一次 Mem0。
108
107
 
109
- ### 2. 获取授权上下文
110
- - 浏览器页面上下文只用于只读检查、抓取真实写契约和最终页面验收;真实远端写入必须回到 `bpmax-cli config api-platform submit`。
111
- - 必要时读取:
112
- - `document.cookie`
113
- - `localStorage`
114
- - `sessionStorage`
115
- - 当前页面最近的同域接口请求头
116
- - 不得用页面内同域请求直接保存配置,也不得退化成终端 `curl` 手搓写请求。
108
+ ### 2. 获取 CLI 上下文
109
+ - 使用当前 `bpmax-cli` profile、capability 和线上 readback 作为授权与事实来源。
110
+ - 浏览器页面只用于只读检查和最终页面验收;真实远端写入必须回到 `bpmax-cli config api-platform submit`。
111
+ - 不读取或复用浏览器 Cookie、浏览器存储、手工请求头或旧脚本环境变量。
112
+ - 不得用页面会话请求直接保存配置,也不得退化成终端手搓写请求。
117
113
 
118
114
  ### 3. 检索本地候选
119
115
  - 只要需求涉及已有平台或已有 API,先检索本地镜像:
@@ -155,7 +151,7 @@ description: "用于在 BPMAX 的系统集成页面中创建或编辑集成平
155
151
  - API:`api_key`、`name`、`method`、`path`、`request_schema`、`response_schema`、`request_example`、`response_example`
156
152
 
157
153
  ### 5. 构造目标 payload
158
- - 以当前页面真实返回体或真实保存请求骨架为基准,不要从零伪造全量 schema。
154
+ - 以 typed CLI export/readback 的线上返回体和 build 输出为基准,不要从零伪造全量 schema。
159
155
  - 平台层只改用户明确要求的字段:
160
156
  - 名称
161
157
  - `platform_key`
@@ -193,18 +189,15 @@ description: "用于在 BPMAX 的系统集成页面中创建或编辑集成平
193
189
  - 不要把实例特有逻辑硬塞进单条 API 定义里
194
190
 
195
191
  ### 6. 提交方式
196
- - 平台、实例、API 的最终保存接口与 payload 形状,必须以当前页面真实保存请求为准。
197
- - 写契约抓取脚本:
198
- - `scripts/capture_write_contract.py`
199
- - 对 `api` 层,如果同时改了 `api_proxy_entity_binding`,必须额外提供 binding 保存请求或 HAR 片段
200
- - 在没有抓到真实保存请求前:
201
- - 可以读取
202
- - 可以分析
203
- - 可以构造候选改动
204
- - 但不要在 skill 文档里提前硬编码未验证写链路
192
+ - 平台、实例、API 的最终保存接口与 payload 形状,必须以 typed CLI adapter 的 build 输出、operation plan、capability 和回读结果为准。
205
193
  - 标准保存链路必须走 typed CLI:
206
194
  - `bpmax-cli config api-platform build/submit/verify`
207
195
  - 提交前必须确认 submit payload 的 operation plan 只包含本次范围内的 platform / instance / api / response_binding 操作。
196
+ - 在 typed CLI adapter 不能给出明确写入计划前:
197
+ - 可以读取
198
+ - 可以分析
199
+ - 可以构造候选改动
200
+ - 但不得用页面会话请求、网络抓包或手工接口调用替代 typed CLI 写入链路
208
201
  - API 创建且带响应映射时,执行顺序固定为:
209
202
  - `api_proxy -> binding -> readback`
210
203
 
@@ -234,7 +227,7 @@ description: "用于在 BPMAX 的系统集成页面中创建或编辑集成平
234
227
  - 响应映射
235
228
  - 文档调试
236
229
  - 明确告诉用户本次读到的核心接口。
237
- - 如果抓到了真实保存请求,要明确说明保存是通过哪条真实页面链路完成的。
230
+ - 明确说明本次 typed CLI submit 的 operation plan、确认文本、回读 hash 和 verify 结果。
238
231
  - 如果做了文档页调试,要明确说明:
239
232
  - 用的是哪条文档页 URL
240
233
  - 选择了哪个实例环境
@@ -246,7 +239,7 @@ description: "用于在 BPMAX 的系统集成页面中创建或编辑集成平
246
239
  - 在 API 编辑页看到调试区就直接把它当唯一验收页。
247
240
  - 跳过文档调试页,不验证实例脚本是否真正参与请求。
248
241
  - 只改本地镜像,不核对线上真实对象。
249
- - 未抓真实保存请求,就先假设写接口路径和请求体形状。
242
+ - 绕过 typed CLI adapter 的 operation plan,就先假设写接口路径和请求体形状。
250
243
  - 只提交 `api_proxy`,却不提交或不回读 `api_proxy_entity_binding`。
251
244
  - 把实例专属签名、认证、包装逻辑直接写死进 API schema。
252
245
  - 只改 `response_schema`,却不核对 `api_proxy_entity_binding`。
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "BPMAX API Platform Editor"
3
- short_description: "在浏览器里创建或编辑 BPMAX 集成平台、实例和 API 配置"
4
- default_prompt: "使用 $bpmax-api-platform-editor 根据当前浏览器系统集成页或系统 API 文档页,创建或编辑 BPMAX 集成平台、实例配置和 API 代理,并通过文档页完成调试验证。"
3
+ short_description: "通过 bpmax-cli typed config 创建或编辑 BPMAX 集成平台、实例和 API 配置"
4
+ default_prompt: "使用 $bpmax-api-platform-editor 通过 bpmax-cli typed config 创建或编辑 BPMAX 集成平台、实例配置和 API 代理,并通过线上接口回读完成调试验证。"
@@ -48,5 +48,5 @@
48
48
  - API 文档页:`/w:store_mgr/api-docs/system_api/18?system=dynamic`
49
49
 
50
50
  ## 说明
51
- - 页面读到的线上对象优先级高于本地 `think_api_*` 镜像。
52
- - 写接口未在本参考中硬编码;实际编辑时必须先抓页面真实保存请求。
51
+ - typed CLI 线上回读和只读页面验收优先级高于本地 `think_api_*` 镜像。
52
+ - 写接口未在本参考中硬编码;实际编辑时必须以 typed CLI adapter 的 build 输出、operation plan 和 verify/readback 为准。
@@ -5,7 +5,7 @@
5
5
  2. 检索 Mem0 和本地镜像,找已有平台、实例、API 骨架。
6
6
  3. 读取线上真实对象。
7
7
  4. 明确本次变更落在哪一层。
8
- 5. 以真实返回体或真实保存请求骨架构造改动。
8
+ 5. 以 typed CLI export/readback 的线上对象和 build 输出构造改动。
9
9
  6. 保存后立刻回读线上对象。
10
10
  7. 打开文档调试页完成真实调试。
11
11
  8. 必要时再查看调用日志页补充证据。
@@ -27,6 +27,6 @@
27
27
  - 文档调试页真实请求符合预期
28
28
 
29
29
  ## 暂未固化的内容
30
- - 平台、实例、API 的写接口路径和最终 payload 形状
30
+ - 平台、实例、API 的 typed CLI adapter 写入契约、operation plan 和 readback 字段
31
31
 
32
- 这些内容必须在实际保存动作发生时,从浏览器真实请求中提取,再按事实更新 skill。
32
+ 这些内容必须在 typed CLI build/submit/verify 链路中确认,再按事实更新 skill。不得从页面会话请求、网络抓包或手工接口调用中反推写入路径。
@@ -49,7 +49,9 @@ INVENTORY_AGG_BLOCK_MESSAGE = (
49
49
  SQL_JOIN_PATTERN = re.compile(r"\bselect\b[\s\S]{0,800}\bjoin\b", re.IGNORECASE)
50
50
  ES_QUERY_PATTERN = re.compile(r"raw-es-search|ctx\.\$esQuery", re.IGNORECASE)
51
51
  PROJECT_LIST_PATTERN = re.compile(r"/bpmax/project/list|ESProjectList|esProjectList")
52
- USER_SCOPE_PROJECT_LIST_ALLOW_PATTERN = re.compile(r"bpmax-allow-user-scope-project-list\s*:")
52
+ USER_SCOPE_PROJECT_LIST_ALLOW_PATTERN = re.compile(
53
+ r"bpmax-allow-user-scope-project-list[ \t]*:[ \t]*[^\s\r\n][^\r\n]{2,}"
54
+ )
53
55
  ES_SIZE_PATTERN = re.compile(r"\bsize\s*:\s*(\d{3,})\b")
54
56
  SCRIPT_MATCH_PATTERN = re.compile(r"\.(?:find|filter|some)\s*\(|\.includes\s*\(")
55
57
  FRONTEND_COUNTING_PATTERN = re.compile(r"\b(?:inventoryQty|currentInventory|currentStock|total_count|count)\s*(?:\+\+|\+=\s*1)")
@@ -112,6 +112,22 @@ class TemplateScriptHardRulesTests(unittest.TestCase):
112
112
  self.assertTrue(report["ok"])
113
113
  self.assertEqual(report["findings"], [])
114
114
 
115
+ def test_rejects_empty_user_scope_project_list_waiver(self) -> None:
116
+ report = scan_named_script_surfaces(
117
+ [
118
+ {
119
+ "path": "fields.selector.lambda",
120
+ "script": (
121
+ "// bpmax-allow-user-scope-project-list:\n"
122
+ "return ctx.$axios.post('/bpmax/project/list?page=1', { flow_type: 'flow716' });"
123
+ ),
124
+ }
125
+ ]
126
+ )
127
+
128
+ self.assertFalse(report["ok"])
129
+ self.assertTrue(any(item["rule"] == "project_list_forbidden" for item in report["findings"]))
130
+
115
131
  def test_blocks_root_user_es_project_list_helper(self) -> None:
116
132
  report = scan_named_script_surfaces(
117
133
  [