bpmax-cli 0.1.44-beta.12 → 0.1.44-beta.13
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 +30 -0
- package/dist/bin.js +1452 -94
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
- package/skills/bpmax-e2e-flow-test-operator/SKILL.md +24 -0
- package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +321 -0
- package/skills/bpmax-flow-template-editor/SKILL.md +1 -0
- package/skills/bpmax-flow-template-editor/references/script-review-hard-rules.md +1 -0
- package/skills/bpmax-workspace-editor/SKILL.md +78 -0
- package/skills/bpmax-workspace-editor/agents/openai.yaml +4 -0
package/package.json
CHANGED
|
@@ -60,6 +60,29 @@ description: "用于在 BPMAX 中做全链路流程测试、场景回归、前
|
|
|
60
60
|
- 默认样板:`profiles/negative_sale.json`
|
|
61
61
|
- 通用脚本优先读 `--profile <name>`;若场景还未收进目录,改用 `--profile-file <path>`
|
|
62
62
|
|
|
63
|
+
## `.ai_test` 用例资产管理
|
|
64
|
+
- 可复用测试用例统一放在项目目录 `.ai_test/`,运行状态仍放在 `.codex/tmp/e2e_states/`;不要把二者混用。
|
|
65
|
+
- 生成、检查、更新用例资产前,必须先运行当前仓库对应的 `latest-*` 并显式使用 `ALLOW_DIRTY=1`,再把证明写入 `.codex/tmp/ai_test_suite/latest-<repo>-proof.json`。缺少 `--latest-proof` 时,CLI 必须拒绝 lint/index/draft-update/promote。
|
|
66
|
+
- 固定目录:
|
|
67
|
+
- 正式用例:`.ai_test/suite/<scenario_id>/`
|
|
68
|
+
- 待确认草稿:`.ai_test/suite_draft/<scenario_id>/`
|
|
69
|
+
- 执行报告:`.ai_test/report/<YYYYMMDD-NNN>/`
|
|
70
|
+
- 每个场景目录必须包含 `README.md` 和 `cases.csv`;promote 前还必须包含合格 `review.json`,证明已完成多视角 review 且未解决 P0/P1 为 0。
|
|
71
|
+
- `cases.csv` 字段必须固定为:`case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_result,test_data,roles,evidence_required,tags,status,updated_at`。
|
|
72
|
+
- `config_basis` 必须指向真实存在的配置或能力依据,并说明覆盖原因。配置仓库使用 `think_*`、`.ai_test/`、`.codex/skills/`;`bpmax-cli` 包内能力可引用 `skills/`。
|
|
73
|
+
- 生成或更新用例必须先落到 `.ai_test/suite_draft/`,执行 lint 并向用户概要说明后,得到用户确认才允许 promote 到 `.ai_test/suite/`。
|
|
74
|
+
- 从正式用例复制到草稿,或从草稿 promote 到正式用例时,如果目标场景目录已经存在,第一次 `--replace` 只生成 copy diff preview,不覆盖目标;必须审阅 diff 后第二次显式追加 `--diff-reviewed`。
|
|
75
|
+
- 优先使用 `bpmax-cli test-suite` 原生命令:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
bpmax-cli test-suite lint --root .ai_test/suite_draft --latest-proof .codex/tmp/ai_test_suite/latest-yaditest-proof.json
|
|
79
|
+
bpmax-cli test-suite index --root .ai_test/suite --latest-proof .codex/tmp/ai_test_suite/latest-yaditest-proof.json
|
|
80
|
+
bpmax-cli test-suite draft-update --scenario customer-exchange-main-flow --replace --latest-proof .codex/tmp/ai_test_suite/latest-yaditest-proof.json
|
|
81
|
+
bpmax-cli test-suite promote --scenario customer-exchange-main-flow --replace --latest-proof .codex/tmp/ai_test_suite/latest-yaditest-proof.json
|
|
82
|
+
bpmax-cli test-suite next-report-dir --root .ai_test/report --create
|
|
83
|
+
bpmax-cli test-suite lint-report --root .ai_test/report
|
|
84
|
+
```
|
|
85
|
+
|
|
63
86
|
## 负卖配置样板流程
|
|
64
87
|
- 工作区:`store_mgr`
|
|
65
88
|
- `flow_type`:`flow288204142`
|
|
@@ -402,3 +425,4 @@ PYTHON_BIN=./venv/bin/python
|
|
|
402
425
|
- 浏览器保留点:`references/browser-only-checkpoints.md`
|
|
403
426
|
- 筛选字段发现规则:`references/filter-field-discovery.md`
|
|
404
427
|
- 经验教训覆盖矩阵:`references/skill-experience-coverage-matrix.md`
|
|
428
|
+
- `.ai_test` 用例资产规范:`references/ai-test-suite.md`
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
# `.ai_test` 用例资产规范
|
|
2
|
+
|
|
3
|
+
## 目录结构
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
.ai_test/
|
|
7
|
+
suite/
|
|
8
|
+
<scenario_id>/
|
|
9
|
+
README.md
|
|
10
|
+
cases.csv
|
|
11
|
+
review.json
|
|
12
|
+
.copy_diff/
|
|
13
|
+
last.diff
|
|
14
|
+
last.json
|
|
15
|
+
suite_draft/
|
|
16
|
+
<scenario_id>/
|
|
17
|
+
README.md
|
|
18
|
+
cases.csv
|
|
19
|
+
review.json
|
|
20
|
+
.copy_diff/
|
|
21
|
+
last.diff
|
|
22
|
+
last.json
|
|
23
|
+
report/
|
|
24
|
+
<YYYYMMDD-NNN>/
|
|
25
|
+
summary.md
|
|
26
|
+
<scenario_id>.md
|
|
27
|
+
screenshots/
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`suite` 是正式用例库,`suite_draft` 是 AI 生成或更新后的待确认草稿,`report` 是每次运行的证据目录。
|
|
31
|
+
|
|
32
|
+
`.copy_diff/` 是覆盖同名场景目录时自动生成的覆盖审计证据,只在 `draft-update --replace` 或 `promote --replace` 的目标目录已存在时出现。
|
|
33
|
+
|
|
34
|
+
## README 模板
|
|
35
|
+
|
|
36
|
+
```markdown
|
|
37
|
+
# 客户换货主链路
|
|
38
|
+
|
|
39
|
+
scenario_id: customer-exchange-main-flow
|
|
40
|
+
workspace: store_mgr
|
|
41
|
+
flow_type: flow451422190
|
|
42
|
+
core: true
|
|
43
|
+
status: active
|
|
44
|
+
owner_skill: bpmax-e2e-flow-test-operator
|
|
45
|
+
|
|
46
|
+
## 场景简介
|
|
47
|
+
|
|
48
|
+
覆盖客户换货补录从发起、审批、库存联动到终态展示的主链路。
|
|
49
|
+
|
|
50
|
+
## 适用范围
|
|
51
|
+
|
|
52
|
+
- PC 创建页:`https://yaditest.yitaiyitai.com/w:store_mgr/project/create?flow_type=flow451422190`
|
|
53
|
+
- 列表页:`https://yaditest.yitaiyitai.com/w:store_mgr/project?flow_type=flow451422190`
|
|
54
|
+
- 详情页:`https://yaditest.yitaiyitai.com/w:store_mgr/project_detail/<detail_template_id>/<project_id>`
|
|
55
|
+
- 待办处理页:`https://yaditest.yitaiyitai.com/w:store_mgr/projectContinue?id=<project_id>&step_id=<step_id>`
|
|
56
|
+
|
|
57
|
+
## 选择规则
|
|
58
|
+
|
|
59
|
+
当任务涉及客户换货、补录、库存联动、审批终态时,测试前必须优先加载本场景。
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## cases.csv 字段
|
|
63
|
+
|
|
64
|
+
字段必须完全一致:
|
|
65
|
+
|
|
66
|
+
```csv
|
|
67
|
+
case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_result,test_data,roles,evidence_required,tags,status,updated_at
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
字段说明:
|
|
71
|
+
|
|
72
|
+
- `case_id`:场景内唯一,建议 `C001`。
|
|
73
|
+
- `priority`:`P0`、`P1`、`P2`。
|
|
74
|
+
- `type`:`positive`、`negative`、`boundary`、`permission`、`data_consistency`、`regression`。
|
|
75
|
+
- `title`:短标题。
|
|
76
|
+
- `preconditions`:前置数据和环境。
|
|
77
|
+
- `config_basis`:每条用例依据的配置位置和覆盖原因,必须至少包含一个可定位位置,例如 `think_flow/...`、`think_form_template/...`、`think_data_set/...`、`think_data_set_field/...`、`think_flow_page_template/...`、`think_configuration/...`、`think_role/...`、`think_category/...`、`think_api_platform/...`、`think_api_proxy/...`、`think_workspace/...`、`.ai_test/...`、`skills/...` 或 `.codex/skills/...`,并说明为什么这条用例要覆盖该配置点。
|
|
78
|
+
- `prep_data`:结构化前置数据准备,至少包含 `账号=`、`入口=`、`样本=`、`准备操作=`、`预期=`。
|
|
79
|
+
- `steps`:可读步骤,用 ` > ` 分隔。
|
|
80
|
+
- `expected_result`:明确可判定结果。
|
|
81
|
+
- `test_data`:样本占位,不写 token、cookie、手机号、密码或完整 payload。
|
|
82
|
+
- `roles`:涉及角色,用逗号分隔。
|
|
83
|
+
- `evidence_required`:例如 `screenshot+project_detail`、`api+dataset`。
|
|
84
|
+
- `tags`:用于 AI 检索。
|
|
85
|
+
- `status`:`active`、`deprecated`、`draft`。
|
|
86
|
+
- `updated_at`:`YYYY-MM-DD`。
|
|
87
|
+
|
|
88
|
+
示例:
|
|
89
|
+
|
|
90
|
+
```csv
|
|
91
|
+
case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_result,test_data,roles,evidence_required,tags,status,updated_at
|
|
92
|
+
C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"think_flow/flow_type'flow451422190___key'___status'1___is_del'0/flow 校验主流程节点和审批链; think_data_set/.../data_set 覆盖库存联动落库依据","账号=store_staff,dealer_owner;入口=https://yaditest.yitaiyitai.com/w:store_mgr/project?flow_type=flow451422190;样本=新建换货样本;准备操作=确认旧机SN和新机库存可用并打开创建入口;预期=旧机SN和新机库存可被选择且审批人可达;主数据=旧机SN和新机库存",发起换货 > 填写旧机 > 填写新机 > 提交 > 审批通过,旧机入库,新机出库,项目终态正确,old_sn=sample;new_sn=sample,store_staff,dealer_owner,screenshot+project_detail,"core,inventory,approval",active,2026-06-18
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## latest gate
|
|
96
|
+
|
|
97
|
+
- 生成、检查、更新 `.ai_test` 用例前,都必须先调用当前仓库对应的 `latest-*` 更新方法,并带 `ALLOW_DIRTY=1`。
|
|
98
|
+
- yaditest 仓库优先使用 `/latest-yaditest`;脚本等价命令必须显式设置 `ALLOW_DIRTY=1`。
|
|
99
|
+
- latest 后记录:命令、`ALLOW_DIRTY=1`、更新前后 `git rev-parse HEAD`、`git status --short` 摘要。
|
|
100
|
+
- latest 后必须写 `.codex/tmp/ai_test_suite/latest-<repo>-proof.json`,至少包含 `method`、`allow_dirty`、`before`、`after`、`head`、`status_short`。
|
|
101
|
+
- `bpmax-cli test-suite lint/index/draft-update/promote` 必须传 `--latest-proof <path>`;缺失或 proof 不合格时命令拒绝执行。
|
|
102
|
+
- latest 失败或远端基线无法确认时,不得继续生成、检查、更新或 promote 用例。
|
|
103
|
+
|
|
104
|
+
## 配置依据规则
|
|
105
|
+
|
|
106
|
+
- 每条用例都必须填写 `config_basis`。
|
|
107
|
+
- `config_basis` 不是泛泛备注,必须同时满足:
|
|
108
|
+
- 至少一个可定位且当前仓库真实存在的配置位置,例如 `think_flow/.../flow`、`think_form_template/.../form_template`、`think_data_set/.../data_set`、`think_data_set_field/...`、`think_flow_page_template/...`、`think_configuration/.../configuration.content`、`think_role/...`、`think_category/...`、`think_api_platform/...`、`think_api_proxy/...`、`think_workspace/...`、`.ai_test/...`、`skills/...` 或 `.codex/skills/...`。
|
|
109
|
+
- 说明覆盖原因,例如“校验审批链”“覆盖字段显隐”“验证数据集落库”“对应列表展示列”“因为该节点存在自动创建子流程脚本”。
|
|
110
|
+
- `bpmax-cli test-suite lint` 会硬检查 `config_basis` 非空、包含可定位配置位置、路径真实存在、包含覆盖原因。
|
|
111
|
+
- 检查用例是否与配置一致时,必须逐行读取 `config_basis` 指向的位置,确认配置仍支持该用例;不能只看用例标题或历史报告。
|
|
112
|
+
|
|
113
|
+
## 配置一致性检查规则
|
|
114
|
+
|
|
115
|
+
- 每次检查前必须先过 latest gate。
|
|
116
|
+
- 对 `cases.csv` 每条用例逐条给出判断:`正确`、`需更新`、`需废弃`、`需拆分` 或 `blocked`。
|
|
117
|
+
- 判断依据必须来自最新配置位置、运行态页面证据、接口回读或用户确认,不能只引用旧记忆。
|
|
118
|
+
- 除了检查已有用例,还必须反向扫最新配置是否有未覆盖内容:新增节点、条件分支、字段、校验、列表列、筛选字段、数据集落库、副作用、权限边界、自动化、子流程和消息。
|
|
119
|
+
- 如果发现应补充的新用例,必须走 `.ai_test/suite_draft/`、lint、用户确认、promote 流程;不能只在报告中留下建议。
|
|
120
|
+
|
|
121
|
+
## 前置数据规则
|
|
122
|
+
|
|
123
|
+
- `prep_data` 是执行前必须先完成的准备清单,不是备注。
|
|
124
|
+
- 最少写明 `账号=`、`入口=`、`样本=`、`准备操作=`、`预期=`。
|
|
125
|
+
- `准备操作=` 必须写正式执行步骤前要做的具体动作,例如打开入口、创建或搜索样本、确认主数据、确认权限、确认自动化发布状态。
|
|
126
|
+
- `预期=` 必须写准备完成的可判定结果,例如样本可用、样本不存在、审批人可达、字段可选、自动生成的下游项目已存在。
|
|
127
|
+
- 复杂业务应补 `主数据=`、`权限=`、`自动化=`、`依赖流程=`、`清理策略=`。
|
|
128
|
+
- 当 `入口=` 包含 `<project_id>`、`<step_id>` 等占位符时,必须补 `绑定解析=`,说明如何取得真实运行态 ID。
|
|
129
|
+
- 当用例验证自动贯通、子流程或下游对象时,必须补 `定位规则=`,说明按列表 URL、`flow_type`、搜索字段、根项目关系或详情 URL 定位对象。
|
|
130
|
+
- `prep_data` 用英文分号 `;` 分隔字段,每一段都必须是 `key=value`;同一字段内多个值用英文逗号 `,` 分隔。
|
|
131
|
+
- 全流程自动贯通用例必须写清自动触发依据,不能用人工直接创建的下游项目冒充自动贯通。
|
|
132
|
+
|
|
133
|
+
## 多 subagent review gate
|
|
134
|
+
|
|
135
|
+
转正式执行或 promote 前,每个场景目录必须有 `review.json`。该文件证明本场景至少经过一次按 SKILL 要求的多 subagent review,并且没有未解决的 P0/P1。
|
|
136
|
+
|
|
137
|
+
最小结构:
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"scenario_id": "customer-exchange-main-flow",
|
|
142
|
+
"reviewed_at": "2026-06-18",
|
|
143
|
+
"status": "fixed",
|
|
144
|
+
"latest_proof": {
|
|
145
|
+
"method": "latest-yaditest",
|
|
146
|
+
"allow_dirty": true,
|
|
147
|
+
"before": "73a8dbb6a06f1c804ae8f7c911e608e392d0c035",
|
|
148
|
+
"after": "73a8dbb6a06f1c804ae8f7c911e608e392d0c035",
|
|
149
|
+
"head": "73a8dbb6a06f1c804ae8f7c911e608e392d0c035",
|
|
150
|
+
"status_short": "dirty worktree allowed for ai_test update"
|
|
151
|
+
},
|
|
152
|
+
"perspectives": [
|
|
153
|
+
{"name": "structure_lint", "reviewer": "subagent-structure", "status": "fixed", "summary": "结构与lint通过"},
|
|
154
|
+
{"name": "business_coverage", "reviewer": "subagent-business", "status": "fixed", "summary": "覆盖主链路和关键分支"},
|
|
155
|
+
{"name": "execution_operability", "reviewer": "subagent-execution", "status": "fixed", "summary": "入口、前置数据和证据可执行"},
|
|
156
|
+
{
|
|
157
|
+
"name": "config_consistency",
|
|
158
|
+
"reviewer": "subagent-config",
|
|
159
|
+
"status": "fixed",
|
|
160
|
+
"summary": "逐条核对配置依据",
|
|
161
|
+
"case_judgments": [
|
|
162
|
+
{
|
|
163
|
+
"case_id": "C001",
|
|
164
|
+
"status": "correct",
|
|
165
|
+
"config_basis_checked": ["think_flow/flow_type'flow614117990___key'___status'1___is_del'0/flow"],
|
|
166
|
+
"evidence": "配置路径存在,流程节点仍支持该用例"
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
"missing_case_review": {"needed": false, "summary": "未发现必须补充的新用例"}
|
|
170
|
+
}
|
|
171
|
+
],
|
|
172
|
+
"unresolved": {"P0": 0, "P1": 0, "P2": 1},
|
|
173
|
+
"fixes": ["修复 P1 lint 和执行性问题"]
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
要求:
|
|
178
|
+
|
|
179
|
+
- `perspectives` 必须至少包含 `structure_lint`、`business_coverage`、`execution_operability`、`config_consistency`。
|
|
180
|
+
- 每个 perspective 必须写 `summary`。
|
|
181
|
+
- `latest_proof` 必须记录 latest 方法、`ALLOW_DIRTY=1` 和基线 SHA。
|
|
182
|
+
- `config_consistency` 必须写 `case_judgments` 和 `missing_case_review`;每条用例必须有 `case_id`、判断状态、已检查配置位置和证据。
|
|
183
|
+
- `unresolved.P0` 和 `unresolved.P1` 必须为 `0`。
|
|
184
|
+
- `fixes` 不能为空;如果 review 无问题,也要写明“未发现 P0/P1,确认无需修复”。
|
|
185
|
+
- `promote` 命令会硬检查 `review.json`,缺失或不合格会拒绝转正式库。
|
|
186
|
+
|
|
187
|
+
## 覆盖 diff gate
|
|
188
|
+
|
|
189
|
+
从正式库复制到草稿,或从草稿 promote 到正式库时,如果目标场景目录已经存在,必须先 diff 源目录和目标目录,避免错误覆盖同名场景。
|
|
190
|
+
|
|
191
|
+
CLI 行为:
|
|
192
|
+
|
|
193
|
+
- `draft-update --replace`:目标草稿目录存在时,覆盖前比较正式目录和草稿目录。
|
|
194
|
+
- `promote --replace`:目标正式目录存在时,覆盖前比较草稿目录和正式目录。
|
|
195
|
+
- 覆盖完成后,目标目录会包含:
|
|
196
|
+
- `.copy_diff/last.diff`:覆盖前目标文件到源文件的 unified diff。
|
|
197
|
+
- `.copy_diff/last.json`:操作类型、场景 ID、源目录、目标目录、生成时间、增删改摘要和文件 hash。
|
|
198
|
+
|
|
199
|
+
执行要求:
|
|
200
|
+
|
|
201
|
+
- 命令输出 `copy diff: .../.copy_diff/last.diff` 时,必须查看 diff 摘要。
|
|
202
|
+
- 如果 diff 中出现非预期删除、大范围覆盖、跨场景内容或与本任务无关的变更,必须停止 promote。
|
|
203
|
+
- `lint` 会校验 `.copy_diff/last.json` 和 `.copy_diff/last.diff`;如果 `.copy_diff/` 存在但结构缺失或损坏,场景不合格。
|
|
204
|
+
|
|
205
|
+
## 浏览器入口规则
|
|
206
|
+
|
|
207
|
+
- 用例用于浏览器执行时,执行入口必须写成可打开的浏览器 URL 或运行态路由。
|
|
208
|
+
- 不要用表单 UUID、数据集 UUID、模板 ID 或配置文件路径作为执行入口。
|
|
209
|
+
- PC 端发起页必须使用 `/w:<workspace>/project/create?flow_type=<flow_type>`;`/pages/projectCreate/projectCreate` 只允许作为移动端或消息内嵌入口的明确场景。
|
|
210
|
+
- 对 YBS 工作区,详情页优先写列表模板实际跳转的 `https://yaditest.yitaiyitai.com/w:ybs/project_detail/0/<project_id>`;不要使用未验证的固定详情模板数字 ID。
|
|
211
|
+
- `evidence_required` 包含 `screenshot`、`project_detail` 或 `list` 的用例,`preconditions`、`steps` 或 `expected_result` 中必须出现 URL/路由。
|
|
212
|
+
|
|
213
|
+
## 生成和确认
|
|
214
|
+
|
|
215
|
+
生成新用例时,确认前只允许运行 lint:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
bpmax-cli test-suite lint \
|
|
219
|
+
--root .ai_test/suite_draft \
|
|
220
|
+
--latest-proof .codex/tmp/ai_test_suite/latest-yaditest-proof.json
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
用户明确确认后,先完成多 subagent review gate,写入合格 `review.json`,再把 `README.md` 的 `status` 调整为 `active` 或 `deprecated`,最后运行 promote:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
bpmax-cli test-suite promote \
|
|
227
|
+
--scenario customer-exchange-main-flow \
|
|
228
|
+
--replace \
|
|
229
|
+
--latest-proof .codex/tmp/ai_test_suite/latest-yaditest-proof.json
|
|
230
|
+
# 若目标已存在,先审阅 preview diff,再二次执行:
|
|
231
|
+
bpmax-cli test-suite promote \
|
|
232
|
+
--scenario customer-exchange-main-flow \
|
|
233
|
+
--replace \
|
|
234
|
+
--diff-reviewed \
|
|
235
|
+
--latest-proof .codex/tmp/ai_test_suite/latest-yaditest-proof.json
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
不要把 lint 和 promote 连续执行成一个无确认命令块。
|
|
239
|
+
|
|
240
|
+
更新已有用例时,确认前只允许运行 draft-update 和 lint:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
bpmax-cli test-suite draft-update \
|
|
244
|
+
--scenario customer-exchange-main-flow \
|
|
245
|
+
--replace \
|
|
246
|
+
--latest-proof .codex/tmp/ai_test_suite/latest-yaditest-proof.json
|
|
247
|
+
|
|
248
|
+
# 若目标草稿已存在,先审阅 preview diff,再二次执行:
|
|
249
|
+
bpmax-cli test-suite draft-update \
|
|
250
|
+
--scenario customer-exchange-main-flow \
|
|
251
|
+
--replace \
|
|
252
|
+
--diff-reviewed \
|
|
253
|
+
--latest-proof .codex/tmp/ai_test_suite/latest-yaditest-proof.json
|
|
254
|
+
|
|
255
|
+
bpmax-cli test-suite lint \
|
|
256
|
+
--root .ai_test/suite_draft \
|
|
257
|
+
--latest-proof .codex/tmp/ai_test_suite/latest-yaditest-proof.json
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
如果 draft-update 输出 `copy diff preview: .../.copy_diff/last.diff`,概要中必须说明 diff 摘要和是否符合预期;未加 `--diff-reviewed` 前不会覆盖目标草稿。
|
|
261
|
+
|
|
262
|
+
用户明确确认更新概要后,才运行 promote:
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
bpmax-cli test-suite promote \
|
|
266
|
+
--scenario customer-exchange-main-flow \
|
|
267
|
+
--replace \
|
|
268
|
+
--latest-proof .codex/tmp/ai_test_suite/latest-yaditest-proof.json
|
|
269
|
+
|
|
270
|
+
# 若目标正式库已存在,先审阅 preview diff,再二次执行:
|
|
271
|
+
bpmax-cli test-suite promote \
|
|
272
|
+
--scenario customer-exchange-main-flow \
|
|
273
|
+
--replace \
|
|
274
|
+
--diff-reviewed \
|
|
275
|
+
--latest-proof .codex/tmp/ai_test_suite/latest-yaditest-proof.json
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
promote 前必须让用户确认概要,包括场景名、核心/一般、用例数量、优先级分布、类型分布、关键前置数据、copy diff 摘要和缺失依据。promote 输出 `copy diff preview: .../.copy_diff/last.diff` 时,必须确认 diff 符合预期并二次带 `--diff-reviewed` 后才算正式发布完成。
|
|
279
|
+
|
|
280
|
+
## 报告模板
|
|
281
|
+
|
|
282
|
+
```markdown
|
|
283
|
+
# 客户换货主链路测试报告
|
|
284
|
+
|
|
285
|
+
run_id: 20260618-001
|
|
286
|
+
scenario_id: customer-exchange-main-flow
|
|
287
|
+
source_suite: .ai_test/suite/customer-exchange-main-flow
|
|
288
|
+
result: pass
|
|
289
|
+
tested_at: 2026-06-18
|
|
290
|
+
|
|
291
|
+
## 1. 测试范围
|
|
292
|
+
|
|
293
|
+
## 2. 执行环境
|
|
294
|
+
|
|
295
|
+
## 3. 用例执行结果
|
|
296
|
+
|
|
297
|
+
| case_id | title | result | sample | evidence |
|
|
298
|
+
|---|---|---|---|---|
|
|
299
|
+
|
|
300
|
+
## 4. 截图证据
|
|
301
|
+
|
|
302
|
+

|
|
303
|
+
|
|
304
|
+
Codex 桌面本地预览优先使用截图的绝对本地路径,图片文件仍必须位于本次运行目录的 `screenshots/` 下。普通 Markdown 阅读器可使用 `./screenshots/...`;飞书/外发版应先把本地图片上传并替换为可访问 URL。
|
|
305
|
+
|
|
306
|
+
## 5. 接口 / 数据回读证据
|
|
307
|
+
|
|
308
|
+
## 6. 发现问题
|
|
309
|
+
|
|
310
|
+
## 7. 用例资产反馈
|
|
311
|
+
|
|
312
|
+
- 是否发现用例缺失
|
|
313
|
+
- 是否发现用例过期
|
|
314
|
+
- 是否建议更新或废弃
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
报告 lint:
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
bpmax-cli test-suite lint-report --root .ai_test/report
|
|
321
|
+
```
|
|
@@ -179,6 +179,7 @@ export BPMAX_BASE_URL='https://<your-bpmax-host>'
|
|
|
179
179
|
- `return (async () => { ... })();`
|
|
180
180
|
- `message_config_mode = code` / `cc_message_config_mode = code` 的消息模板同样由 `parseEvalFunction()` 执行,不能填写普通中文文案或 `${step...}` 字面量 URL:
|
|
181
181
|
- `message_template` / `cc_message_template` 必须是 JS 函数体脚本,例如 `return "请处理...";`
|
|
182
|
+
- 空 `message_template` 会触发后端默认消息外发;主流程编排节点、系统等待节点或其它不应外发消息的节点,必须在 code 模式下显式写 `return "";`,不能留空。
|
|
182
183
|
- `message_template_simple.actions[].url` / `m_url` 如需拼接 `step.project_id`、`step.id`,必须写成 `return '/projectContinue?id=' + step.project_id + '&step_id=' + step.id;`
|
|
183
184
|
- typed CLI lint 已将该规则设为 hard error,不得用 `--allow-preexisting-lint-errors` 豁免。
|
|
184
185
|
- 创建链路中 `meta.project_create_validator` 在单号/流水号生成之后执行。它可以拒绝缺失或不一致的数据,不能在不消耗流水号的前提下修复已经生成的单号;涉及 `sn_number.field_reference` 的问题,应优先在表单侧通过 `ctx.$setValueByKeyToValue(...)` 触发前端订阅刷新,流程级创建校验只做后端兜底拒绝。
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
- 已把“填写订单信息”下沉到开始节点 `meta.form_template`,脚本却还在按旧节点 id 或旧节点表单取值
|
|
40
40
|
- 表单字段前端查重把“查询”写成未确认后端已实现的 `POST /api/.../search`,结果命中 `BaseRest.postAction` 直接新增资源
|
|
41
41
|
- `message_config_mode = code` / `cc_message_config_mode = code` 时,把普通中文文案写进 `message_template` / `cc_message_template`
|
|
42
|
+
- code-mode `message_template` 留空以为能阻止外发;实际会触发后端默认消息,必须显式写 `return "";`
|
|
42
43
|
- code-mode 消息卡片按钮 URL 写成 `/projectContinue?id=${step?.project_id}&step_id=${step?.id}`,而不是 `return '/projectContinue?id=' + step.project_id + '&step_id=' + step.id;`
|
|
43
44
|
|
|
44
45
|
## 前端失焦查重专项核查
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "bpmax-workspace-editor"
|
|
3
|
+
description: "用于在 BPMAX 中创建、编辑、导出、验证或删除平台工作区。只要用户提到“创建工作区”“编辑工作区配置”“workspace 配置”“工作区入口路径”“工作区管理员/白名单/icon/logo/背景图”“删除工作区”或等价表达,就应使用这个 skill。它要求 Codex 使用 bpmax-cli 的 typed `config workspace` adapter 完成 export、lint、build、submit、verify/delete 闭环,不得把它和本地配置库 `config workspace init <env>` 或流程绑定 `config workspace-flow` 混用。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# BPMAX Workspace Editor
|
|
7
|
+
|
|
8
|
+
## 写入路径硬约束
|
|
9
|
+
- 执行前必须先运行 `bpmax-cli config adapters --format json` 核对 `workspace`;只有 `export_status`、`build_status`、`submit_status`、`create_status`、`delete_status` 都是 `supported` 时,才允许进入真实写入。
|
|
10
|
+
- 当前平台工作区配置只能走 typed CLI:
|
|
11
|
+
- 导出:`bpmax-cli config workspace export --id key:<workspace_key> --profile <profile> --format json`
|
|
12
|
+
- 构建:`bpmax-cli config workspace build --work <work-file> --meta <meta-file> --out <submit-file> --format json`
|
|
13
|
+
- 提交:`bpmax-cli config workspace submit --id <id|key:key> --payload <submit-file> --confirm "submit workspace <workspace_key>" --profile <profile> --format json`
|
|
14
|
+
- 新建:先准备 `mode=create` 的 work/meta,再用 `bpmax-cli config workspace create --id create:workspace --payload <submit-file> --confirm "submit workspace <workspace_key>" --profile <profile> --format json`
|
|
15
|
+
- 删除:`bpmax-cli config workspace delete --id <numeric_id> --confirm "delete workspace <numeric_id>" --profile <profile> --format json`
|
|
16
|
+
- 不得用 `bpmax-cli api POST/PUT/DELETE /workspace*`、浏览器 fetch、curl 或旧脚本绕过 typed adapter。
|
|
17
|
+
- 不要把本 skill 用于配置库目录初始化;配置库 clone/bind 使用 `bpmax-cli config workspace init <env> --workspace-dir <dir>`,对应 skill 是 `bpmax-config-latest`。
|
|
18
|
+
- 不要把本 skill 用于给工作区绑定流程;流程绑定使用 `bpmax-cli config workspace-flow build/submit`,通常由 `bpmax-flow-template-editor` 或 `bpmax-e2e-flow-config-orchestrator` 编排。
|
|
19
|
+
|
|
20
|
+
## 范围门禁
|
|
21
|
+
- 修改前必须明确目标工作区 key、用户要求改哪些字段,以及哪些字段必须保持不变。
|
|
22
|
+
- 只允许改用户明确要求的工作区字段;不得顺手调整 `workspace_flow`、导航、角色、权限点或配置库环境。
|
|
23
|
+
- 对 `entry_path`、`m_entry_path`、`origin`、`white_list`、`admin_ids` 这类可能影响访问入口和权限的字段,提交前必须在 dry-run 中逐项说明变更。
|
|
24
|
+
- 删除工作区是高风险操作;必须确认 numeric id,且只在用户明确要求删除时执行。
|
|
25
|
+
|
|
26
|
+
## Mem0 协议
|
|
27
|
+
- 开始前先调用 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md),检索词至少包含:
|
|
28
|
+
- `workspace`
|
|
29
|
+
- 工作区 key / 名称
|
|
30
|
+
- `entry_path` / `admin_ids` / `white_list` / `icon` / `logo` 等本次相关字段
|
|
31
|
+
- 回读验证通过后,只写可复用结论:
|
|
32
|
+
- `decision`:工作区 key 命名、入口路径、管理员模型选择
|
|
33
|
+
- `task_learning`:某类工作区字段的稳定配置方式
|
|
34
|
+
- `anti_pattern`:误把平台工作区和配置库 workspace init 混用、raw API 绕过 typed adapter
|
|
35
|
+
- 不写 API Key、Authorization、密码、手机号、验证码、cookie、完整 payload 或大段接口响应。
|
|
36
|
+
|
|
37
|
+
## 标准闭环
|
|
38
|
+
1. 确认 profile 和能力:
|
|
39
|
+
```bash
|
|
40
|
+
bpmax-cli auth status --profile <profile> --format json
|
|
41
|
+
bpmax-cli capabilities refresh --profile <profile> --format json
|
|
42
|
+
bpmax-cli config adapters --format json
|
|
43
|
+
```
|
|
44
|
+
2. 编辑现有工作区:
|
|
45
|
+
```bash
|
|
46
|
+
bpmax-cli config workspace export --id key:<workspace_key> --profile <profile> --out .codex/tmp/workspace-editor --format json
|
|
47
|
+
bpmax-cli config workspace lint --work .codex/tmp/workspace-editor/work/workspace-key-<workspace_key>.json --format json
|
|
48
|
+
bpmax-cli config workspace build --work <work-file> --meta <meta-file> --out <submit-file> --format json
|
|
49
|
+
bpmax-cli config workspace submit --id key:<workspace_key> --payload <submit-file> --profile <profile> --format json
|
|
50
|
+
bpmax-cli config workspace submit --id key:<workspace_key> --payload <submit-file> --confirm "submit workspace <workspace_key>" --profile <profile> --format json
|
|
51
|
+
```
|
|
52
|
+
3. 新建工作区:
|
|
53
|
+
- work 文件必须包含 `mode: "create"`、`name`、`key`、`entry_path`。
|
|
54
|
+
- `key` 必须 2-20 位,字母开头,只能包含字母、数字、`_`、`-`。
|
|
55
|
+
- `entry_path` 默认可用 `/myProject`,但必须确认是否符合业务入口。
|
|
56
|
+
```bash
|
|
57
|
+
bpmax-cli config workspace build --work <create-work-file> --meta <create-meta-file> --out <submit-file> --format json
|
|
58
|
+
bpmax-cli config workspace create --id create:workspace --payload <submit-file> --profile <profile> --format json
|
|
59
|
+
bpmax-cli config workspace create --id create:workspace --payload <submit-file> --confirm "submit workspace <workspace_key>" --profile <profile> --format json
|
|
60
|
+
```
|
|
61
|
+
4. 验证:
|
|
62
|
+
```bash
|
|
63
|
+
bpmax-cli config workspace export --id key:<workspace_key> --profile <profile> --format json
|
|
64
|
+
```
|
|
65
|
+
必须确认回读中的 `name`、`key`、`entry_path`、`m_entry_path`、`origin`、`admin_ids`、`white_list` 与预期一致。
|
|
66
|
+
|
|
67
|
+
## 字段约束
|
|
68
|
+
- `name`:2-20 字符。
|
|
69
|
+
- `key`:2-20 位,字母开头,只能包含字母、数字、`_`、`-`。命令输入可写 `w:<key>` 或 `key:<key>`,提交 payload 会规范成纯 key。
|
|
70
|
+
- `entry_path`:必填,决定 PC 默认入口。
|
|
71
|
+
- `m_entry_path`:移动端入口;不确定时保持原值或空字符串。
|
|
72
|
+
- `is_system_admin`、`admin_ids`、`white_list`:权限相关字段,必须按用户要求或导出现状保守保留。
|
|
73
|
+
- `logo`、`bg_img`、`icon`、`description`、`origin`:只在需求明确时修改。
|
|
74
|
+
|
|
75
|
+
## 验收
|
|
76
|
+
- dry-run 输出必须显示 endpoint、method、payload 和 diff。
|
|
77
|
+
- confirmed submit 后必须有 readback hash。
|
|
78
|
+
- 浏览器验收时打开 `.../w:<workspace_key>/workspaceConfiguration/<workspace_key>` 或当前平台对应工作区配置页,确认名称、入口、图标和管理员范围显示正确。
|