bpmax-cli 0.2.1-beta.2 → 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.
- package/README.md +28 -1
- package/dist/bin.js +2132 -101
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
- package/skills/bpmax-ai-taskbook/SKILL.md +4 -1
- package/skills/bpmax-api-platform-editor/SKILL.md +24 -31
- package/skills/bpmax-api-platform-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-api-platform-editor/references/platform-api-map.md +2 -2
- package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +3 -3
- package/skills/bpmax-blueprint-doc-workflow/SKILL.md +87 -0
- package/skills/bpmax-blueprint-doc-workflow/agents/openai.yaml +4 -0
- package/skills/bpmax-blueprint-doc-workflow/references/blueprint-structure.md +60 -0
- package/skills/bpmax-blueprint-doc-workflow/references/per-flow-required-structure.md +98 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-forbidden-term.xml +12 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-mermaid-codeblock.xml +12 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-boundary.xml +10 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-whiteboard.xml +10 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-pass.xml +55 -0
- package/skills/bpmax-blueprint-doc-workflow/scripts/lint_blueprint_doc.py +257 -0
- package/skills/bpmax-builder-shared/template_script_hard_rules.py +3 -1
- package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +16 -0
- package/skills/bpmax-cli/SKILL.md +30 -0
- package/skills/bpmax-console-template-editor/SKILL.md +109 -523
- package/skills/bpmax-console-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-console-template-editor/references/full-detail-guide.md +45 -0
- package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +13 -12
- package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +65 -78
- package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +86 -30
- package/skills/bpmax-dataset-field-template-editor/SKILL.md +124 -594
- package/skills/bpmax-dataset-field-template-editor/references/full-detail-guide.md +570 -0
- package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +1 -1
- package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +11 -77
- package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +4 -57
- package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +2 -0
- package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +4 -78
- package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +3 -89
- package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +14 -0
- package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +2 -0
- package/skills/bpmax-dataset-template-editor/SKILL.md +112 -768
- package/skills/bpmax-dataset-template-editor/references/full-detail-guide.md +753 -0
- package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +1 -0
- package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +2 -2
- package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +9 -90
- package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +1 -2
- package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +8 -1
- package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +6 -40
- package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +18 -4
- package/skills/bpmax-e2e-flow-test-operator/SKILL.md +112 -533
- package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +43 -4
- package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +6 -5
- package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +563 -0
- package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +4 -4
- package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +1 -1
- package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +3 -1
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +7 -5
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +2 -2
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +5 -1
- package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +71 -0
- package/skills/bpmax-filter-template-editor/SKILL.md +110 -551
- package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +18 -18
- package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +29 -26
- package/skills/bpmax-filter-template-editor/references/full-detail-guide.md +56 -0
- package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +10 -9
- package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +7 -57
- package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +4 -48
- package/skills/bpmax-flow-template-editor/SKILL.md +109 -1084
- package/skills/bpmax-flow-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-flow-template-editor/references/diff-strategy.md +3 -3
- package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +9 -9
- package/skills/bpmax-flow-template-editor/references/full-detail-guide.md +1155 -0
- package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +1 -1
- package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +3 -3
- package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +7 -7
- package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +2 -2
- package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +2 -2
- package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +7 -23
- package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +1 -1
- package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +19 -75
- package/skills/bpmax-form-template-editor/SKILL.md +111 -1104
- package/skills/bpmax-form-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +51 -51
- package/skills/bpmax-form-template-editor/references/full-detail-guide.md +1108 -0
- package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +4 -4
- package/skills/bpmax-form-template-editor/references/payload-checklist.md +1 -1
- package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +8 -0
- package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +42 -19
- package/skills/bpmax-list-template-editor/SKILL.md +110 -466
- package/skills/bpmax-list-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-list-template-editor/references/full-detail-guide.md +454 -0
- package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +6 -9
- package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +1 -1
- package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +9 -78
- package/skills/bpmax-nav-config-editor/SKILL.md +13 -17
- package/skills/bpmax-nav-config-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-nav-config-editor/references/api-workflow.md +2 -2
- package/skills/bpmax-nav-config-editor/references/runtime-probing.md +11 -12
- package/skills/bpmax-project/SKILL.md +1 -0
- package/skills/bpmax-project-detail-template-editor/SKILL.md +11 -33
- package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-role-editor/SKILL.md +7 -30
- package/skills/bpmax-user-mock-operator/SKILL.md +1 -1
- package/skills/bpmax-user-mock-operator/agents/openai.yaml +2 -2
|
@@ -4,32 +4,32 @@
|
|
|
4
4
|
|
|
5
5
|
| 旧经验 / 风险点 | 当前覆盖情况 | 覆盖层 | 覆盖位置 | 人工判定点 / 后续动作 |
|
|
6
6
|
| --- | --- | --- | --- | --- |
|
|
7
|
-
| 列表页可以作为合法起手页 | 已覆盖 |
|
|
8
|
-
| 复杂模板默认按代码模式理解 | 已覆盖 |
|
|
9
|
-
| 页面与 skill 不一致时如何更新规则 | 已覆盖 |
|
|
10
|
-
| 低基数字段先抽样再决定是否改为 `select` | 已覆盖 |
|
|
11
|
-
| 时间范围可能要在 `beforeSearch` 中改写为 `raw range` | 已覆盖 |
|
|
12
|
-
| 强验证 / 弱验证 / 未能验证必须区分 | 已覆盖 |
|
|
13
|
-
| “数据集 id” 不等于模板 `data_set_id` | 已覆盖 |
|
|
14
|
-
| 裸接口成功不等于模板内容真的更新 | 已覆盖 |
|
|
15
|
-
| 页面组件 `save()` 只解决一部分问题,不等于最佳默认闭环 | 已覆盖 |
|
|
16
|
-
| 新建模板不能依赖现有 template id | 已覆盖 |
|
|
17
|
-
| 文档不能把未实现脚本写成现成入口 | 已覆盖 |
|
|
18
|
-
|
|
|
19
|
-
| 提交前必须先通过 lint 检查合法性 | 已覆盖 | lint gate | `SKILL.md`
|
|
7
|
+
| 列表页可以作为合法起手页 | 已覆盖 | 标准闭环 + 只读验收 | `SKILL.md` 的标准闭环、Verify 与 E2E 验收 | 无 |
|
|
8
|
+
| 复杂模板默认按代码模式理解 | 已覆盖 | 结构与生效门禁 | `SKILL.md` 的结构与生效门禁、查询与脚本 lint | 无 |
|
|
9
|
+
| 页面与 skill 不一致时如何更新规则 | 已覆盖 | 历史归档 | `full-detail-guide.md` 的旧规则去向 | 无 |
|
|
10
|
+
| 低基数字段先抽样再决定是否改为 `select` | 已覆盖 | 结构门禁 + 运行态模式 | `SKILL.md` 的结构与生效门禁、`filter-runtime-patterns.md` | 仍需人工判断抽样值是否足够代表真实分布 |
|
|
11
|
+
| 时间范围可能要在 `beforeSearch` 中改写为 `raw range` | 已覆盖 | 结构门禁 + 内容 schema | `SKILL.md` 的结构与生效门禁、`filter-content-schema.md` | 保留一份强验证或高价值弱验证记录 |
|
|
12
|
+
| 强验证 / 弱验证 / 未能验证必须区分 | 已覆盖 | Verify 与 E2E 验收 | `SKILL.md` 的 Verify 与 E2E 验收、输出要求 | 仍需人工判断当前样本是否足以宣告强验证 |
|
|
13
|
+
| “数据集 id” 不等于模板 `data_set_id` | 已覆盖 | 核心配置门禁 | `SKILL.md` 的核心配置门禁、`runtime-verified-filter-page-shape.md` | 若涉及字段池异常,仍需人工核对真实字段池请求 |
|
|
14
|
+
| 裸接口成功不等于模板内容真的更新 | 已覆盖 | Verify/readback blocker | `SKILL.md` 的 Verify 与 E2E 验收 | typed CLI submit 后必须继续 verify/readback |
|
|
15
|
+
| 页面组件 `save()` 只解决一部分问题,不等于最佳默认闭环 | 已覆盖 | 写入路径硬约束 | `SKILL.md` 的写入路径硬约束、`runtime-verified-filter-page-shape.md` | 只能作为历史反例,不得作为 fallback |
|
|
16
|
+
| 新建模板不能依赖现有 template id | 已覆盖 | Work/Submit 边界 + 接口契约 | `SKILL.md` 的 Work/Submit 边界、`filter-request-shape.md` | typed CLI create work 负责固化 create skeleton |
|
|
17
|
+
| 文档不能把未实现脚本写成现成入口 | 已覆盖 | 写入路径硬约束 + reference 说明 | `SKILL.md` 的写入路径硬约束、`filter-request-shape.md`、`runtime-verified-filter-page-shape.md` | 持续用 bpmax-builder-shared audit 防止回退 |
|
|
18
|
+
| 最终配置必须通过 typed CLI 提交 | 已覆盖 | 写入路径硬约束 | `SKILL.md` 的写入路径硬约束、`filter-request-shape.md` 的最终提交口径 | `bpmax-cli config filter-template submit/create/delete` 是唯一写入入口 |
|
|
19
|
+
| 提交前必须先通过 lint 检查合法性 | 已覆盖 | 标准闭环 + lint gate | `SKILL.md` 的标准闭环、查询与脚本 lint、`filter-request-shape.md` | typed CLI lint/build 在 blocker 存在时阻断提交 |
|
|
20
20
|
|
|
21
21
|
## 建议做成未来脚本 blocker 的项
|
|
22
22
|
|
|
23
23
|
- `submit` 与 `readback` 不一致时直接失败,不要口头判定成功
|
|
24
|
-
-
|
|
24
|
+
- 建议落在:typed CLI `config filter-template submit/verify`
|
|
25
25
|
- lint 存在 blocker 时直接失败,不要进入最终提交
|
|
26
|
-
-
|
|
26
|
+
- 建议落在:typed CLI `config filter-template lint/build`
|
|
27
27
|
- `work` 或 `submit` 哈希变化后,已确认状态自动失效
|
|
28
|
-
-
|
|
28
|
+
- 建议落在:typed CLI submit 确认状态或 response evidence
|
|
29
29
|
- create 模式必须基于真实 `POST /api/flow_page_template` 最小 body 初始化,不允许口算 payload
|
|
30
|
-
-
|
|
30
|
+
- 建议落在:typed CLI `config filter-template create/build`
|
|
31
31
|
- 时间范围控件在涉及 `raw range` 改写时,默认要求保留一份强验证或高价值弱验证记录
|
|
32
|
-
-
|
|
32
|
+
- 建议落在:真实用户身份 E2E 列表页强验证记录与 Mem0 结论
|
|
33
33
|
|
|
34
34
|
## 仍依赖人工审查的项
|
|
35
35
|
|
|
@@ -75,6 +75,8 @@ Content-Type: application/json
|
|
|
75
75
|
- 尝试单独修改模板 `data_set_id` 后,字段池请求形态没有随之改变
|
|
76
76
|
|
|
77
77
|
## 新建模板
|
|
78
|
+
以下 HTTP 形态是 typed CLI adapter 背后的平台契约事实,不是 Agent 直接调用入口。
|
|
79
|
+
|
|
78
80
|
```http
|
|
79
81
|
POST /api/flow_page_template
|
|
80
82
|
Content-Type: application/json
|
|
@@ -96,19 +98,20 @@ Content-Type: application/json
|
|
|
96
98
|
create 模式默认初始化规则:
|
|
97
99
|
- 不依赖 `GET /api/flow_page_template/:id`
|
|
98
100
|
- 先按上面的最小 body 生成 create skeleton
|
|
99
|
-
- 再把 skeleton 落到 `.codex/tmp/` 的 raw/work/meta
|
|
101
|
+
- 再把 skeleton 落到 `.codex/tmp/filter-template-editor/` 的 raw/work/meta
|
|
100
102
|
- 若用户明确要求“参考已有模板改一个版本”,允许额外选择 sample template 作为增强版 skeleton,但不是默认前置
|
|
101
103
|
|
|
102
104
|
建议拆开理解 create / edit 的初始化顺序:
|
|
103
105
|
|
|
104
106
|
### create 初始化顺序
|
|
105
|
-
-
|
|
106
|
-
- 生成
|
|
107
|
-
- 导出 `.codex/tmp/` 的 raw/work/meta
|
|
107
|
+
- 按 typed adapter 契约生成 create skeleton,不直接发 `POST`
|
|
108
|
+
- 生成 `.codex/tmp/filter-template-editor/` 下的 raw/work/meta
|
|
108
109
|
- 在本地 work 文件中修改
|
|
109
|
-
-
|
|
110
|
+
- lint/build 通过并第二次确认后,才通过 `bpmax-cli config filter-template create` 发起真实写入
|
|
110
111
|
|
|
111
112
|
## 编辑模板
|
|
113
|
+
以下 HTTP 形态是 typed CLI adapter 背后的平台契约事实,不是 Agent 直接调用入口。
|
|
114
|
+
|
|
112
115
|
```http
|
|
113
116
|
PUT /api/flow_page_template/:id
|
|
114
117
|
Content-Type: application/json
|
|
@@ -128,10 +131,9 @@ Content-Type: application/json
|
|
|
128
131
|
|
|
129
132
|
补充验证:
|
|
130
133
|
- 默认请求顺序应为:
|
|
131
|
-
-
|
|
132
|
-
- 再导出 `.codex/tmp/` 的 raw/work/meta
|
|
134
|
+
- 先用 `bpmax-cli config filter-template export` 导出 raw/work/meta
|
|
133
135
|
- 在本地 work 文件中修改
|
|
134
|
-
-
|
|
136
|
+
- 通过 `bpmax-cli config filter-template lint/build` 生成 submit 文件
|
|
135
137
|
- 第二次确认后才真正发起 `PUT`
|
|
136
138
|
- 裸 `PUT` 返回 `code=0`、页面真实 `PUT` 返回 `affectedRows=1`,都不足以证明模板内容已经更新
|
|
137
139
|
- 必须继续核对:
|
|
@@ -144,16 +146,15 @@ Content-Type: application/json
|
|
|
144
146
|
- `flow_key`
|
|
145
147
|
- `content`
|
|
146
148
|
- `type`
|
|
147
|
-
-
|
|
149
|
+
- 编辑页组件实例直改和页面 `save()` 是历史反例,不得作为 fallback 写入路径;当前必须走 typed CLI work -> lint -> build -> submit -> verify/readback。
|
|
148
150
|
|
|
149
151
|
### edit 初始化顺序
|
|
150
|
-
-
|
|
151
|
-
- 再导出 `.codex/tmp/` 的 raw/work/meta
|
|
152
|
+
- 先用 `bpmax-cli config filter-template export` 导出 `.codex/tmp/` 的 raw/work/meta
|
|
152
153
|
- 在本地 work 文件中修改
|
|
153
|
-
-
|
|
154
|
+
- lint/build 通过并第二次确认后,才通过 typed CLI submit 发起真实写入
|
|
154
155
|
|
|
155
156
|
## 本地工作文件与 submit 文件约定
|
|
156
|
-
- 临时文件统一放在 `.codex/tmp/`
|
|
157
|
+
- 临时文件统一放在 `.codex/tmp/filter-template-editor/`
|
|
157
158
|
- 推荐至少产出:
|
|
158
159
|
- `raw`:接口原始返回
|
|
159
160
|
- `work`:供人工修改的展开结构
|
|
@@ -167,23 +168,23 @@ Content-Type: application/json
|
|
|
167
168
|
- 第一次确认对象是 `work` 文件改动
|
|
168
169
|
- 第二次确认对象是 `submit` 文件内容
|
|
169
170
|
- 提交后必须再生成 readback 或 verify 结果,证明线上内容与 `submit` 一致
|
|
170
|
-
-
|
|
171
|
-
- `
|
|
172
|
-
- `
|
|
173
|
-
- `
|
|
174
|
-
- `
|
|
175
|
-
- `
|
|
176
|
-
|
|
177
|
-
- 当前没有单独的运行态验证脚本;运行态验证由 `submit_filter_template.py` 的 readback / verify 结果和浏览器列表页证据共同完成
|
|
171
|
+
- 当前 typed CLI 入口:
|
|
172
|
+
- `bpmax-cli config filter-template export`
|
|
173
|
+
- `bpmax-cli config filter-template lint`
|
|
174
|
+
- `bpmax-cli config filter-template build`
|
|
175
|
+
- `bpmax-cli config filter-template submit/create/delete`
|
|
176
|
+
- `bpmax-cli config filter-template verify`
|
|
177
|
+
- 当前没有单独的运行态验证脚本;运行态验证由 typed CLI readback/verify 结果和只读列表页证据共同完成
|
|
178
178
|
|
|
179
179
|
## 最终提交口径
|
|
180
180
|
- 最终配置必须经过:
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
181
|
+
- typed CLI lint
|
|
182
|
+
- typed CLI build
|
|
183
|
+
- 用户确认 submit diff
|
|
184
|
+
- typed CLI submit/create/delete
|
|
185
|
+
- typed CLI verify/readback
|
|
185
186
|
- lint 存在 blocker 时,不得执行最终提交。
|
|
186
|
-
-
|
|
187
|
+
- 页面只用于只读展示验收和问题定位;最终提交闭环必须以 typed CLI submit、verify/readback 为准。
|
|
187
188
|
|
|
188
189
|
## 删除模板
|
|
189
190
|
```http
|
|
@@ -211,6 +212,8 @@ GET /api/flow?flow_type=<flow_type>&key=<flow_key>
|
|
|
211
212
|
- 因此“当前流程实际在用哪个筛选器模板”应继续以这个字段为准,而不是模板列表状态列反推
|
|
212
213
|
|
|
213
214
|
## 切换生效模板
|
|
215
|
+
以下 HTTP 形态是平台契约事实;当前 `filter-template` typed domain 不提供直接切换默认模板的子命令。若没有 typed flow/meta 配置能力,必须停止并说明缺能力,不得手写此 raw `PUT`。
|
|
216
|
+
|
|
214
217
|
```http
|
|
215
218
|
PUT /api/flow/configuration/meta?flow_type=<flow_type>&flow_key=<flow_key>
|
|
216
219
|
Content-Type: application/json
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Filter Template Archive Guide
|
|
2
|
+
|
|
3
|
+
> Archive reference for details that used to live in `../SKILL.md`. The active entrypoint is `../SKILL.md`; this file preserves historical decisions, routing notes, and case lessons without weakening the typed CLI write path.
|
|
4
|
+
|
|
5
|
+
## 常驻结论
|
|
6
|
+
- 筛选器模板是 `flow_page_template.type = 3`。
|
|
7
|
+
- 当前流程使用哪个筛选器,由 `flow.data.meta.table_filter_template` 决定。
|
|
8
|
+
- 编辑模板内容和切换默认模板是两个动作,必须分别验证。
|
|
9
|
+
- 字段池通常由 `flow_type + flow_key` 驱动;`data_set_id` 不一定影响字段池。
|
|
10
|
+
- 复杂模板含 `customQuery`、`beforeSearch`、`tabFilters` 时,默认按代码模式审查。
|
|
11
|
+
- 运行态界面只作为只读展示和 E2E 行为验收,不是配置写入入口。
|
|
12
|
+
|
|
13
|
+
## 历史经验
|
|
14
|
+
|
|
15
|
+
### 列表页可以作为起手线索
|
|
16
|
+
筛选器模板列表能定位候选模板、当前使用状态和预览入口。它可以作为只读起点,但正式修改仍从 typed CLI export/readback 开始。
|
|
17
|
+
|
|
18
|
+
### 复杂模板默认按代码模式理解
|
|
19
|
+
出现 `customQuery`、`beforeSearch`、`tabFilters` 或表达式时,不能只按普通 `config[]` 可视化项理解;必须保留查询增强语义并检查脚本 lint。
|
|
20
|
+
|
|
21
|
+
### 低基数字段先抽样
|
|
22
|
+
步骤名、状态名、类型名等字段应先抽样真实唯一值。唯一值少时优先 `select + term`,不要凭字段名直接使用输入框或自动补全。
|
|
23
|
+
|
|
24
|
+
### 时间范围可能需要 beforeSearch 改写
|
|
25
|
+
`date-range + type=range` 不一定命中。若普通 range 不通但 raw range 可用,应保留时间控件,并在 `beforeSearch` 中改写为可命中的 raw 查询。
|
|
26
|
+
|
|
27
|
+
### 强验证与弱验证必须区分
|
|
28
|
+
请求成功不等于筛选真的可用。样本只有单值、无正向命中或数量不变时,只能写弱验证或未验证。
|
|
29
|
+
|
|
30
|
+
### 数据集 id 不一定等于模板 data_set_id
|
|
31
|
+
用户说“给数据集增加筛选”时,先核对字段池请求和当前流程。很多场景真实诉求是给流程当前列表补筛选项,而不是修改模板 `data_set_id`。
|
|
32
|
+
|
|
33
|
+
### 成功回包不代表 content 已更新
|
|
34
|
+
保存或提交后必须做 readback/verify,比较线上 `content` 与 submit 文件。接口成功但 content 仍旧时,不能宣告完成。
|
|
35
|
+
|
|
36
|
+
### 页面组件实例保存是历史反例
|
|
37
|
+
直接改组件实例或调用保存方法曾用于定位问题,但不是当前操作建议。当前配置写入必须走 `bpmax-cli config filter-template ...` typed CLI。
|
|
38
|
+
|
|
39
|
+
## 旧规则去向
|
|
40
|
+
- 请求与 payload 细节:`filter-request-shape.md`
|
|
41
|
+
- 内容结构和字段:`filter-content-schema.md`
|
|
42
|
+
- 查询模式和组件选择:`filter-runtime-patterns.md`
|
|
43
|
+
- 默认模板绑定和字段池关系:`filter-and-flow-binding.md`
|
|
44
|
+
- 只读界面与 E2E 验收入口:`runtime-verified-filter-page-shape.md`
|
|
45
|
+
- 经验覆盖和后续改进:`experience-coverage-matrix.md`
|
|
46
|
+
|
|
47
|
+
## 统一执行入口
|
|
48
|
+
```bash
|
|
49
|
+
bpmax-cli config filter-template export --id <id> --out .codex/tmp/filter-template-editor --profile <profile> --format json
|
|
50
|
+
bpmax-cli config filter-template lint --work .codex/tmp/filter-template-editor/work/<file>.json --profile <profile> --format json
|
|
51
|
+
bpmax-cli config filter-template build --work .codex/tmp/filter-template-editor/work/<file>.json --meta .codex/tmp/filter-template-editor/meta/<file>.meta.json --out .codex/tmp/filter-template-editor/submit/<file>.json --profile <profile> --format json
|
|
52
|
+
bpmax-cli config filter-template submit --id <id> --payload .codex/tmp/filter-template-editor/submit/<file>.json --profile <profile> --confirm "submit filter-template <id>" --format json
|
|
53
|
+
bpmax-cli config filter-template verify --id <id> --expect .codex/tmp/filter-template-editor/work/<file>.json --profile <profile> --format json
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
旧 Python 脚本只保留为本地结构/lint 参考,不是线上写入路径。
|
package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md
CHANGED
|
@@ -67,18 +67,18 @@
|
|
|
67
67
|
- `type: 3`
|
|
68
68
|
- 页面保存成功后默认会返回上一页。
|
|
69
69
|
- 当前默认推荐闭环:
|
|
70
|
-
-
|
|
71
|
-
-
|
|
70
|
+
- 编辑:先通过 `bpmax-cli config filter-template export` 确认真实线上结构并生成 raw/work/meta
|
|
71
|
+
- 新建:先按 typed CLI create work 生成 create skeleton,再生成 raw/work/meta
|
|
72
72
|
- 在 work 文件中修改
|
|
73
|
-
- 通过 `
|
|
73
|
+
- 通过 `bpmax-cli config filter-template lint/build` 生成 submit 文件
|
|
74
74
|
- 双确认后再提交
|
|
75
|
-
-
|
|
75
|
+
- 提交后 typed CLI verify/readback,并补充只读展示验收
|
|
76
76
|
- 当前仓库状态:
|
|
77
|
-
- `bpmax-filter-template-editor`
|
|
78
|
-
-
|
|
79
|
-
- 页面组件实例 `save()`
|
|
80
|
-
-
|
|
81
|
-
-
|
|
77
|
+
- `bpmax-filter-template-editor` 的配置写入主路径是 typed CLI
|
|
78
|
+
- 运行态强验证依赖真实用户身份的列表页请求、结果变化和“使用中”状态证据
|
|
79
|
+
- 页面组件实例 `save()` 是历史反例:
|
|
80
|
+
- 不得作为 fallback 写入路径
|
|
81
|
+
- 页面上下文只用于只读观察、运行态展示验收和问题定位
|
|
82
82
|
- 风险提示:
|
|
83
83
|
- 代码编辑器中的文本不一定已经同步到页面组件状态
|
|
84
84
|
- `PUT` 返回成功不代表最终写入的是目标 `content`
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
## 生效切换
|
|
88
88
|
- 列表页点击 `使用` 走:
|
|
89
89
|
- `PUT /api/flow/configuration/meta`
|
|
90
|
+
- 这是平台运行态契约事实,不是 Agent 直接调用入口;当前 `filter-template` typed domain 没有默认模板切换子命令时,必须停止并转入具备 typed flow/meta 能力的配置路径。
|
|
90
91
|
- 请求体至少包含:
|
|
91
92
|
- `table_filter_template`
|
|
92
93
|
- query 至少包含:
|
|
@@ -4,12 +4,7 @@ from __future__ import annotations
|
|
|
4
4
|
import copy
|
|
5
5
|
import hashlib
|
|
6
6
|
import json
|
|
7
|
-
import ssl
|
|
8
7
|
import sys
|
|
9
|
-
import urllib.error
|
|
10
|
-
import urllib.parse
|
|
11
|
-
import urllib.request
|
|
12
|
-
from dataclasses import dataclass
|
|
13
8
|
from datetime import datetime, timezone
|
|
14
9
|
from difflib import unified_diff
|
|
15
10
|
from pathlib import Path
|
|
@@ -21,9 +16,13 @@ REPO_ROOT = Path(__file__).resolve().parents[4]
|
|
|
21
16
|
SHARED_SKILL_ROOT = Path(__file__).resolve().parents[2] / "bpmax-builder-shared"
|
|
22
17
|
if str(SHARED_SKILL_ROOT) not in sys.path:
|
|
23
18
|
sys.path.insert(0, str(SHARED_SKILL_ROOT))
|
|
24
|
-
from base_url import resolve_base_url
|
|
25
19
|
TMP_ROOT = REPO_ROOT / ".codex" / "tmp" / "filter-template-editor"
|
|
26
20
|
TMP_SUBDIRS = ("raw", "work", "meta", "submit", "diffs", "result")
|
|
21
|
+
LEGACY_NETWORK_DISABLED_MESSAGE = (
|
|
22
|
+
"Legacy filter-template network scripts are disabled in bpmax-cli. "
|
|
23
|
+
"Use `bpmax-cli config filter-template export|lint|build|submit|create|delete|verify` "
|
|
24
|
+
"so profile, capability, dry-run, confirmation, audit, and baseline checks are enforced."
|
|
25
|
+
)
|
|
27
26
|
|
|
28
27
|
from template_script_hard_rules import scan_named_script_surfaces
|
|
29
28
|
|
|
@@ -295,54 +294,5 @@ def ensure_submission_allowed(meta_path: Path, work_path: Path, submit_path: Pat
|
|
|
295
294
|
return meta
|
|
296
295
|
|
|
297
296
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
base_url: str
|
|
301
|
-
workspace: str
|
|
302
|
-
language: str
|
|
303
|
-
cookie_header: str
|
|
304
|
-
timeout: float
|
|
305
|
-
insecure: bool = False
|
|
306
|
-
|
|
307
|
-
def _build_url(self, path: str) -> str:
|
|
308
|
-
suffix = f"$workspace={urllib.parse.quote(self.workspace)}&$language={urllib.parse.quote(self.language)}"
|
|
309
|
-
joiner = "&" if "?" in path else "?"
|
|
310
|
-
return self.base_url.rstrip("/") + path + joiner + suffix
|
|
311
|
-
|
|
312
|
-
def request(self, method: str, path: str, body: Optional[dict] = None) -> dict:
|
|
313
|
-
headers = {"content-type": "application/json", "cookie": self.cookie_header, "accept": "application/json, text/plain, */*"}
|
|
314
|
-
data = None if body is None else json.dumps(body, ensure_ascii=False).encode("utf-8")
|
|
315
|
-
req = urllib.request.Request(self._build_url(path), data=data, headers=headers, method=method)
|
|
316
|
-
context = ssl._create_unverified_context() if self.insecure else None
|
|
317
|
-
with urllib.request.urlopen(req, timeout=self.timeout, context=context) as resp:
|
|
318
|
-
raw = resp.read().decode("utf-8", "replace")
|
|
319
|
-
payload = json.loads(raw)
|
|
320
|
-
if payload.get("code") != 0:
|
|
321
|
-
raise SystemExit(f"API error {path}: {raw}")
|
|
322
|
-
return payload
|
|
323
|
-
|
|
324
|
-
def get_template(self, template_id: int) -> dict:
|
|
325
|
-
return self.request("GET", f"/api/flow_page_template/{template_id}?skip_i18n=true")
|
|
326
|
-
|
|
327
|
-
def create_template(self, payload: dict) -> dict:
|
|
328
|
-
return self.request("POST", "/api/flow_page_template", payload)
|
|
329
|
-
|
|
330
|
-
def update_template(self, template_id: int, payload: dict) -> dict:
|
|
331
|
-
return self.request("PUT", f"/api/flow_page_template/{template_id}", payload)
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
def build_client(args: Any) -> ApiClient:
|
|
335
|
-
workspace = getattr(args, "workspace", None)
|
|
336
|
-
cookie_header = getattr(args, "cookie_header", None)
|
|
337
|
-
if not workspace:
|
|
338
|
-
raise SystemExit("--workspace is required")
|
|
339
|
-
if not cookie_header:
|
|
340
|
-
raise SystemExit("--cookie-header is required")
|
|
341
|
-
return ApiClient(
|
|
342
|
-
base_url=resolve_base_url(getattr(args, "base_url", None)),
|
|
343
|
-
workspace=workspace,
|
|
344
|
-
language=getattr(args, "language", None) or DEFAULT_LANGUAGE,
|
|
345
|
-
cookie_header=cookie_header,
|
|
346
|
-
timeout=float(getattr(args, "timeout", 30)),
|
|
347
|
-
insecure=bool(getattr(args, "insecure", False)),
|
|
348
|
-
)
|
|
297
|
+
def build_client(args: Any) -> None:
|
|
298
|
+
raise SystemExit(LEGACY_NETWORK_DISABLED_MESSAGE)
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
import os
|
|
4
3
|
import sys
|
|
5
4
|
import tempfile
|
|
6
5
|
import unittest
|
|
7
6
|
from pathlib import Path
|
|
8
|
-
from unittest import mock
|
|
9
7
|
|
|
10
8
|
|
|
11
9
|
SCRIPT_DIR = Path(__file__).resolve().parents[1] / "scripts"
|
|
@@ -167,7 +165,7 @@ class FilterTemplateEditorCommonTests(unittest.TestCase):
|
|
|
167
165
|
with self.assertRaises(SystemExit):
|
|
168
166
|
common.ensure_submission_allowed(meta, work, submit)
|
|
169
167
|
|
|
170
|
-
def
|
|
168
|
+
def test_legacy_network_client_is_disabled(self) -> None:
|
|
171
169
|
args = type(
|
|
172
170
|
"Args",
|
|
173
171
|
(),
|
|
@@ -180,51 +178,9 @@ class FilterTemplateEditorCommonTests(unittest.TestCase):
|
|
|
180
178
|
"insecure": False,
|
|
181
179
|
},
|
|
182
180
|
)()
|
|
183
|
-
with
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
self.assertIn("BPMAX_BASE_URL", str(ctx.exception))
|
|
187
|
-
|
|
188
|
-
def test_build_client_keeps_api_endpoint_when_base_url_contains_api_suffix(self) -> None:
|
|
189
|
-
args = type(
|
|
190
|
-
"Args",
|
|
191
|
-
(),
|
|
192
|
-
{
|
|
193
|
-
"base_url": "https://bpmax.example.com/api",
|
|
194
|
-
"workspace": "store_mgr",
|
|
195
|
-
"language": "zhCN",
|
|
196
|
-
"cookie_header": "token=demo",
|
|
197
|
-
"timeout": 30,
|
|
198
|
-
"insecure": False,
|
|
199
|
-
},
|
|
200
|
-
)()
|
|
201
|
-
client = common.build_client(args)
|
|
202
|
-
self.assertEqual(
|
|
203
|
-
client._build_url("/api/flow_page_template/954573388?skip_i18n=true"),
|
|
204
|
-
"https://bpmax.example.com/api/flow_page_template/954573388?skip_i18n=true&$workspace=store_mgr&$language=zhCN",
|
|
205
|
-
)
|
|
206
|
-
|
|
207
|
-
def test_api_client_template_methods_use_api_prefix(self) -> None:
|
|
208
|
-
client = common.ApiClient(
|
|
209
|
-
base_url="https://bpmax.example.com",
|
|
210
|
-
workspace="store_mgr",
|
|
211
|
-
language="zhCN",
|
|
212
|
-
cookie_header="token=demo",
|
|
213
|
-
timeout=30,
|
|
214
|
-
)
|
|
215
|
-
with mock.patch.object(client, "request", return_value={"code": 0}) as request:
|
|
216
|
-
client.get_template(954573388)
|
|
217
|
-
client.create_template({"name": "筛选器模板"})
|
|
218
|
-
client.update_template(954573388, {"name": "筛选器模板"})
|
|
219
|
-
|
|
220
|
-
self.assertEqual(
|
|
221
|
-
[call.args[:2] for call in request.call_args_list],
|
|
222
|
-
[
|
|
223
|
-
("GET", "/api/flow_page_template/954573388?skip_i18n=true"),
|
|
224
|
-
("POST", "/api/flow_page_template"),
|
|
225
|
-
("PUT", "/api/flow_page_template/954573388"),
|
|
226
|
-
],
|
|
227
|
-
)
|
|
181
|
+
with self.assertRaises(SystemExit) as ctx:
|
|
182
|
+
common.build_client(args)
|
|
183
|
+
self.assertIn("Legacy filter-template network scripts are disabled in bpmax-cli", str(ctx.exception))
|
|
228
184
|
|
|
229
185
|
|
|
230
186
|
if __name__ == "__main__":
|