bpmax-cli 0.2.1-beta.52 → 0.2.1-beta.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +13319 -4654
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
- package/scripts/install-skills.mjs +25 -59
- package/skills/bpmax-ai-taskbook/SKILL.md +10 -0
- package/skills/bpmax-ai-taskbook/references/blueprint-taskbook-gates.md +120 -0
- package/skills/bpmax-ai-taskbook/references/taskbook-template.md +41 -1
- package/skills/bpmax-blueprint-doc-workflow/SKILL.md +15 -2
- package/skills/bpmax-blueprint-doc-workflow/references/blueprint-structure.md +8 -0
- package/skills/bpmax-blueprint-doc-workflow/references/per-flow-required-structure.md +13 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-modeling-review.xml +23 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-paragraph-flow-details.xml +27 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-pass.xml +45 -28
- package/skills/bpmax-blueprint-doc-workflow/references/source-traceability-and-flow-modeling.md +115 -0
- package/skills/bpmax-blueprint-doc-workflow/scripts/lint_blueprint_doc.py +386 -5
- package/skills/bpmax-e2e-flow-test-operator/SKILL.md +48 -27
- package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +41 -17
- package/skills/bpmax-e2e-flow-test-operator/references/browser-action-dsl.md +71 -9
- package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +2 -1
- package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +25 -12
- package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +11 -9
- package/skills/bpmax-e2e-flow-test-operator-v2/SKILL.md +56 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/agents/openai.yaml +7 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/automation-generation-pipeline.md +33 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/batch-generation-and-execution.md +17 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/browser-action-runner.md +15 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/browser-recording-and-replay.md +69 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/form-script-generation.md +41 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/identity-and-failure-routing.md +74 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/multi-request-mutation.md +9 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/scenario-coverage-generation.md +17 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/scoped-execution.md +13 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/step-restartability-and-state.md +17 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/test-assets-and-evidence.md +9 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/test-data-and-selector-contract.md +28 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/test-preflight-and-confirmation.md +32 -0
- package/skills/bpmax-user-mock-operator/scripts/chrome_identity_bridge.mjs +79 -12
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
README.md
|
|
10
10
|
cases.csv
|
|
11
11
|
case_steps.csv
|
|
12
|
+
automation.json
|
|
12
13
|
review.json
|
|
13
14
|
.copy_diff/
|
|
14
15
|
last.diff
|
|
@@ -17,6 +18,8 @@
|
|
|
17
18
|
<scenario_id>/
|
|
18
19
|
README.md
|
|
19
20
|
cases.csv
|
|
21
|
+
case_steps.csv
|
|
22
|
+
automation.json
|
|
20
23
|
review.json
|
|
21
24
|
.copy_diff/
|
|
22
25
|
last.diff
|
|
@@ -29,7 +32,7 @@
|
|
|
29
32
|
screenshots/
|
|
30
33
|
```
|
|
31
34
|
|
|
32
|
-
`suite` 是正式用例库,`suite_draft`
|
|
35
|
+
`suite` 是正式用例库,`suite_draft` 是生成或更新后的待确认草稿,`report` 是每次运行的证据目录。`automation init/compile` 只能修改 `suite_draft`;正式 `suite` 中的 `automation.json` 只能来自 lint/review 后的 promote。
|
|
33
36
|
|
|
34
37
|
正式用例设计必须使用 `bpmax-functional-test-design`;本轮页面体验审计必须使用 `bpmax-ui-ux-audit`。场景报告必须包含:
|
|
35
38
|
|
|
@@ -102,16 +105,16 @@ case_id,priority,type,title,preconditions,config_basis,prep_data,expected_result
|
|
|
102
105
|
|
|
103
106
|
```csv
|
|
104
107
|
case_id,step_id,step_no,actor,runner,action,target,input_data,expected_result,evidence_required
|
|
105
|
-
C001,S001,1,store_staff,
|
|
106
|
-
C001,S002,2,store_staff,
|
|
107
|
-
C001,S003,3,store_staff,
|
|
108
|
+
C001,S001,1,store_staff,browser_action,打开客户换货创建页面,客户换货创建页,无,页面展示换货表单,screenshot+url+dom
|
|
109
|
+
C001,S002,2,store_staff,browser_action,填写客户换货字段,换货表单旧机和新机字段,真实旧机SN和新机SN,页面显示真实业务数据,screenshot+dom
|
|
110
|
+
C001,S003,3,store_staff,browser_action,点击提交客户换货申请,创建页提交按钮,无,项目创建成功并进入审批链,screenshot+project_detail
|
|
108
111
|
C001,S004,4,store_staff,identity,切换测试身份,当前浏览器会话,目标用户ID,会话切换为目标审批人,identity+mock+readback
|
|
109
|
-
C001,S005,5,dealer_owner,
|
|
112
|
+
C001,S005,5,dealer_owner,browser_action,审批通过客户换货申请,经销商负责人审批环节,审批意见为同意,审批完成并进入终态,screenshot+step_context+submit+readback
|
|
110
113
|
```
|
|
111
114
|
|
|
112
115
|
规则:
|
|
113
116
|
|
|
114
|
-
- `runner` 只能是 `
|
|
117
|
+
- 正式 `runner` 只能是 `browser_action`、`identity`、`observe`。draft 首次准备时可暂用 `browser` 标记待编译页面步骤;旧 `e2e_create_page`、`e2e_step_run` 只能作为 automation init/compile 的迁移输入,不能通过正式 lint/review/promote。身份 status/mock/unmock 必须使用 `identity`,在 `input_data` 声明 `identity_transport=chrome_bridge`。mock 前要有 status,每个 mock 后要有 unmock。`observe` 只能核对同一 run 更早步骤已经登记的 evidence,`input_data` 必须声明 `source_case_step_id=<case_id>/<step_id>`,禁止页面操作、确认动作、身份切换、数据写入和任意未登记文件引用。
|
|
115
118
|
- `step_no` 从 1 开始连续递增;`step_id` 在 case 内唯一。
|
|
116
119
|
- `actor` 必须属于 cases.csv 的 roles,系统观察步骤可写 `system`。
|
|
117
120
|
- `action` 一行只能有一个动作,禁止 `>`、连续编号和“然后/接着/再然后”;上传附件是合法单一步骤,必须写清具体附件和目标控件。
|
|
@@ -123,15 +126,30 @@ C001,S005,5,dealer_owner,e2e_step_run,审批通过客户换货申请,经销商
|
|
|
123
126
|
bpmax-cli test-suite steps migrate --scenario <scenario_id> --draft-root .ai_test/suite_draft --latest-proof <proof.json> --format json
|
|
124
127
|
```
|
|
125
128
|
|
|
126
|
-
|
|
129
|
+
正式执行前必须先生成并审查确定性脚本:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
bpmax-cli test-suite automation init --scenario <scenario_id> --root .ai_test/suite_draft --out .codex/tmp/<scenario_id>-automation-input.json --latest-proof <proof.json> --format json
|
|
133
|
+
bpmax-cli test-suite automation compile --scenario <scenario_id> --root .ai_test/suite_draft --source .codex/tmp/<scenario_id>-automation-input.json --latest-proof <proof.json> --format json
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
`automation init` 之后优先读取平台源码;必要时只用 Chrome Control 做不触发业务 mutation 的页面结构探索。编译输入绑定当前场景快照,编译结果同时绑定编译后的 case assets 和 automation 内容哈希;`README.md`、`cases.csv`、`case_steps.csv`、actions 或 expected checks 变化后必须重新生成并 review。场景文件写入与 compile 共用进程锁;陈旧的死亡进程锁可自动恢复,活动写入期间 migrate、draft-update、lint、promote 和 run start 都必须停止。完成 scoped lint/review/promote 后,CLI 会在正式场景写入 promotion receipt;缺少 receipt 或 promote 后资产漂移时不得启动 execution manifest:
|
|
127
137
|
|
|
128
138
|
```bash
|
|
129
139
|
bpmax-cli test-suite run start --scenario <scenario_id> --case-id <case_id> --profile <profile> --latest-proof <proof.json> --format json
|
|
130
|
-
bpmax-cli test-suite run next --manifest .ai_test/report/<run_id>/execution-manifest.json --format json
|
|
131
|
-
bpmax-cli test-suite run record --manifest .ai_test/report/<run_id>/execution-manifest.json --case-id <case_id> --case-step-id <step_id> --result pass --evidence <path> --format json
|
|
132
140
|
```
|
|
133
141
|
|
|
134
|
-
|
|
142
|
+
`run start` 只创建本轮隔离空间,不直接授权执行。CLI 同时生成 pending 的 `precondition-<run_id>.json`。核对真实样本、身份、入口、主数据和依赖状态后,在本轮报告目录写结构化 evidence,再登记:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
bpmax-cli test-suite run precondition --manifest <execution-manifest.json> --evidence <current-run-precondition-evidence.json> --profile <profile> --format json
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
evidence 必须声明 `kind=bpmax_e2e_precondition_evidence`、当前 `run_id/evidence_nonce/scenario_id/case_id/profile`、`precondition_verified=true`,并包含至少一条有名称且 `passed=true` 的 `checks`。CLI 会把 evidence 和 canonical record 的 SHA-256 锚定进 manifest。未通过、目录外、旧时间戳、身份不匹配或登记后被修改时,`next`、正式 record 和场景执行都会在页面/mutation 前阻断。
|
|
149
|
+
|
|
150
|
+
稳定浏览器步骤使用 `runner=browser_action`,并在场景目录维护覆盖完整场景所有 active case 的 `automation.json`。只编译当前选中的 case 不足以启动正式 run。前置检查登记通过后,正式执行只能使用 `run start` 返回的 run-scoped automation 副本,由一次 `bpmax-cli e2e scenario execute` 连续读取 manifest、操作真实页面并自动记录本轮证据。共享 suite、draft 或外部 automation 不能直接驱动本轮执行。
|
|
151
|
+
|
|
152
|
+
`automation.json` 必须声明确定性 `operation_flow`。一个 case step 最多包含一个远端 mutation;多个提交必须拆成多个步骤。每个 mutation 必须同时有 `resolution_checks.committed` 和 `resolution_checks.not_committed`,并分别包含强只读检查,两组检查不能语义等价。所有正式 `browser_action` 只能通过 `scenario execute` 运行,直接 `browser-run` 必须阻断,避免无 mutation 步骤也被拆成 Agent 逐步循环。mutation 前异常由 CLI 保存 repair request;页面/脚本漂移只在 reviewed draft 中改当前或未来步骤,runner、控件或环境问题可以修兼容层。重新 compile 并刷新 review asset snapshot 后,执行 `test-suite automation repair --checkpoint <checkpoint> --automation <draft automation.json>`;CLI 先在 manifest 的 `automation_repair_guard` 锚定 checkpoint、source automation、review、completed step、旧新脚本和不可变 receipt hash,再更新本轮副本。中断恢复只能完成这笔已锚定 repair,resume 必须消费该 receipt 并更新 manifest automation hash。禁止直接改本轮副本或共享 suite。mutation 点击前先持久化绑定目标 checkpoint 的 manifest `mutation_attempt_guard`,再保存 operation checkpoint,并让 `mutation-state.json` 使用同一 attempt ID;这只代表 `mutation_attempted`,只有观察到匹配目标写请求后才能记录 `mutation_request_observed=true` 和 `remote_submitted=true`。删除 checkpoint 不会解除 manifest guard,同一 scenario/case/profile 即使换 report root 也不能新建 run 绕过。execute、resolve、repair 对同一 manifest 共用 operation lock,不受自定义 checkpoint 路径影响。结果不确定时,`scenario resolve` 在两个独立页面分别运行 committed/not_committed 的只读检查,并要求恰好一个分支通过;未观察到写请求时,not_committed 可以用 `mutation.assert_no_request` 核对本轮网络证据,但仍必须配合实时页面强检查。调用方 outcome 只能作为预期校验。确定性 Playwright runner 生成 source evidence、`resolution-receipt.json` 和 `evidence-files.json`,再把三者 SHA-256 锚定到 manifest;证据还要绑定当前 run nonce、checkpoint revision、mutation attempt ID、case/step 和同一 `automation_step_sha256`,手写或仅文件内自洽的 bundle 不能清除 guard。已完成 manifest 不允许 resume,重新运行必须 `run start` 新建 run。
|
|
135
153
|
|
|
136
154
|
完整 DSL、页面指纹、mutation 和缓存边界见 [browser-action-dsl.md](browser-action-dsl.md)。
|
|
137
155
|
|
|
@@ -149,6 +167,8 @@ bpmax-cli test-suite run record --manifest .ai_test/report/<run_id>/execution-ma
|
|
|
149
167
|
|
|
150
168
|
```json
|
|
151
169
|
{
|
|
170
|
+
"run_id": "20260801-001",
|
|
171
|
+
"evidence_nonce": "<由 CLI 生成并写入>",
|
|
152
172
|
"case_id": "C001",
|
|
153
173
|
"case_step_id": "S001",
|
|
154
174
|
"browser_verified": true,
|
|
@@ -161,11 +181,13 @@ bpmax-cli test-suite run record --manifest .ai_test/report/<run_id>/execution-ma
|
|
|
161
181
|
}
|
|
162
182
|
```
|
|
163
183
|
|
|
184
|
+
`evidence_nonce` 是当前 run 的内部隔离标识,应由 CLI/runner 在证据生成时写入,不要求人类手工填写,也不得在登记旧文件时补写。缺少当前 run/case/step 绑定的证据不能进入 formal pass。
|
|
185
|
+
|
|
164
186
|
证据必须位于本轮 report 目录。仅写 `browser_verified: true`、引用历史截图、复用前一步相同截图、断言为空/失败,或在要求 DOM 时缺少 `dom_snapshot`,都不能记录为 pass。
|
|
165
187
|
|
|
166
188
|
`runtime_scope` 规则:`page` 证明首页、列表、搜索等页面,不要求项目 ID;`project` 必须提供数字 `project_id`;`step` 必须同时提供数字 `project_id` 和业务 `step_id`。禁止用 `case_steps.csv.step_no` 填业务 `step_id`。
|
|
167
189
|
|
|
168
|
-
`runtime_environment=profile` 时,`runtime_url` origin 必须与 run start 固化的 `profile_origin` 一致。源码本地浏览器测试使用 `runtime_environment=local-browser`,并且只允许 loopback URL。manifest 只能由 CLI record/append 更新;禁止手工回滚,禁止多个 agent
|
|
190
|
+
`runtime_environment=profile` 时,`runtime_url` origin 必须与 run start 固化的 `profile_origin` 一致。源码本地浏览器测试使用 `runtime_environment=local-browser`,并且只允许 loopback URL。manifest 只能由 CLI record/append 更新;禁止手工回滚,禁止多个 agent 同时读写同一 manifest,也不得删除或重建 manifest 相邻的 state、journal、transaction、suite 根目录的 `.bpmax-active-runs/` lease 以及 report root 下 `.bpmax-run-integrity/` 高水位文件。即使 manifest/state/journal 一起恢复到旧的一致前缀,也必须按 rollback 阻断。run start 还会固定 E2E Skill 完整 bundle 的内容哈希,包括 `SKILL.md`、references、scripts、profiles 和其他分发文件;bundle 内禁止符号链接。安装过程有任一 adapter 失败时不得更新 `skills.stamp`,运行中 Skill bundle 变化必须重新开始正式 run。
|
|
169
191
|
|
|
170
192
|
最后一步 record 后 CLI 会从 manifest 自动同步 `<scenario_id>.md`。需要重试时使用:
|
|
171
193
|
|
|
@@ -175,13 +197,13 @@ bpmax-cli test-suite run report-sync --manifest .ai_test/report/<run_id>/executi
|
|
|
175
197
|
|
|
176
198
|
`execution_plan_generated`、`browser_execution_pending`、`bootstrap_required` 表示尚未形成正式执行证据;只有真实提交或正式记录后才能出现 `execution_evidence_recorded`。不得依据 plan/template/dry-run 状态推进用例结论。
|
|
177
199
|
|
|
178
|
-
报告同步只更新执行状态,不会替代理解页面并完成 UX
|
|
200
|
+
报告同步只更新执行状态,不会替代理解页面并完成 UX 审计。`scenario execute` 的 `status=functional_complete` 和 manifest 的 `result=pass` 只表示功能步骤完成;此时报告在 UX 审计未完成时仍为 `result=partial`,命令明确返回 `formal_conclusion_ready=false`。必须基于本轮证据更新 `ux-findings.json` 和场景报告,再运行 `bpmax-cli test-suite lint-report`;lint 通过后才能对外给正式 E2E 结论。
|
|
179
201
|
|
|
180
202
|
旧版聚合示例已废弃;以下是用例级示例:
|
|
181
203
|
|
|
182
204
|
```csv
|
|
183
205
|
case_id,priority,type,title,preconditions,config_basis,prep_data,expected_result,test_data,roles,evidence_required,tags,status,updated_at
|
|
184
|
-
C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"think_flow/.../flow 校验主流程节点和审批链; think_data_set/.../data_set 覆盖库存联动落库依据","账号=store_staff,dealer_owner;入口=https://yaditest.yitaiyitai.com/w:store_mgr/project?flow_type=flow451422190;样本=新建换货样本;准备操作=确认真实库存;预期=审批链可达;precondition_check=.
|
|
206
|
+
C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"think_flow/.../flow 校验主流程节点和审批链; think_data_set/.../data_set 覆盖库存联动落库依据","账号=store_staff,dealer_owner;入口=https://yaditest.yitaiyitai.com/w:store_mgr/project?flow_type=flow451422190;样本=新建换货样本;准备操作=确认真实库存;预期=审批链可达;precondition_check=.ai_test/report/<run_id>/precondition-<run_id>.json;browser_tool=Chrome Control;live_draft=live;state_file=.ai_test/report/<run_id>/execution-manifest.json;report_run=.ai_test/report/<run_id>;resume_policy=full_rerun",旧机入库且新机出库并完成审批,"业务场景=客户换货补录;业务逻辑=旧机回收入库且新机出库;样本数据=真实旧机和新机库存;合理性=符合客户一退一发规则","store_staff,dealer_owner",screenshot+project_detail,"core,inventory,approval",active,2026-06-18
|
|
185
207
|
```
|
|
186
208
|
|
|
187
209
|
## latest gate
|
|
@@ -226,7 +248,7 @@ C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"t
|
|
|
226
248
|
- `prep_data` 是执行前必须先完成的准备清单,不是备注。
|
|
227
249
|
- 最少写明 `账号=`、`入口=`、`样本=`、`准备操作=`、`预期=`、`precondition_check=`、`browser_tool=`、`live_draft=`,并提供 `state_file=` 或 `report_run=`。
|
|
228
250
|
- `precondition_check=` 必须指向本轮执行前置检查记录;没有该记录时只能进入准备阶段,不能写正式执行结论。
|
|
229
|
-
- `browser_tool=` 必须写明本轮实际执行的真实页面通道,只允许 `Chrome Control`、`chrome:control-chrome`、`Chrome DevTools`、`DevTools`、`Playwright` 或 `AppleScript
|
|
251
|
+
- `browser_tool=` 必须写明本轮实际执行的真实页面通道,只允许 `Chrome Control`、`chrome:control-chrome`、`Chrome DevTools`、`DevTools`、`Playwright` 或 `AppleScript`。首次只读探索和异常诊断优先 `Chrome Control`,稳定 `browser_action` 正式执行使用 `Playwright`;如果没有可用浏览器工具,报告必须走 browser blocked 模板,不能在工具名后写 unavailable 仍声明通过。
|
|
230
252
|
- `live_draft=` 必须写清本轮测的是 `live` 发布态还是 `draft` 草稿态。
|
|
231
253
|
- `state_file=` 或 `report_run=` 必须能定位本轮状态/报告证据。
|
|
232
254
|
- `准备操作=` 必须写正式执行步骤前要做的具体动作,例如打开入口、创建或搜索样本、确认主数据、确认权限、确认自动化发布状态。
|
|
@@ -409,6 +431,7 @@ run_id: 20260618-001
|
|
|
409
431
|
scenario_id: customer-exchange-main-flow
|
|
410
432
|
source_suite: .ai_test/suite/customer-exchange-main-flow
|
|
411
433
|
result: pass
|
|
434
|
+
functional_result: pass
|
|
412
435
|
rerun_policy: full_rerun
|
|
413
436
|
tested_at: 2026-06-18
|
|
414
437
|
started_at: 2026-06-18T10:00:00+08:00
|
|
@@ -419,8 +442,8 @@ executed_cases: C001,C002,C003
|
|
|
419
442
|
planned_steps: C001/S001,C001/S002,C002/S001,C003/S001
|
|
420
443
|
executed_steps: C001/S001,C001/S002,C002/S001,C003/S001
|
|
421
444
|
execution_manifest: execution-manifest.json
|
|
422
|
-
precondition_check: .
|
|
423
|
-
state_file: .
|
|
445
|
+
precondition_check: .ai_test/report/20260618-001/precondition-20260618-001.json
|
|
446
|
+
state_file: .ai_test/report/20260618-001/execution-manifest.json
|
|
424
447
|
report_run: .ai_test/report/20260618-001
|
|
425
448
|
browser_tool: Chrome Control
|
|
426
449
|
runtime_url: https://yaditest.yitaiyitai.com/w:store_mgr/project_detail/0/<project_id>
|
|
@@ -465,12 +488,13 @@ bpmax-cli test-suite lint-report --root .ai_test/report
|
|
|
465
488
|
- `planned_cases:` / `executed_cases:` 与 `planned_steps:` / `executed_steps:` 必须存在并逐条对账;`execution_manifest:` 必须指向本轮报告目录中的 manifest。任何未登记步骤、跳步或缺证据步骤都会阻断完整通过。
|
|
466
489
|
- `run_id:` 必须等于当前 `.ai_test/report/<YYYYMMDD-NNN>/` 目录名。
|
|
467
490
|
- `precondition_check:`、`state_file:`、`report_run:`、`browser_tool:`、`rerun_policy:` 必须存在。
|
|
491
|
+
- `precondition_check:` 必须与 execution manifest 锚定的本轮 canonical record 完全一致;完整结论要求其状态为 `passed`,evidence/checks 绑定当前 run/scenario/case/profile 且文件哈希未变化。文件名带本轮日期但记录不存在或仍为 pending 不能通过。
|
|
468
492
|
- `rerun_policy: full_rerun` 表示本轮重新运行,不能直接引用旧结果、旧报告、旧状态文件或旧截图填充本轮 `executed_cases` 和 pass 结论。
|
|
469
493
|
- `full_rerun` 下 `state_file:`、`precondition_check:`、`report_run:` 必须指向本轮 run 或本轮日期;截图必须位于本轮 `screenshots/`,且文件修改时间落在 `started_at:` / `finished_at:` 时间窗内。没有时间窗时按 run 日期校验。
|
|
470
494
|
- 每个 `executed_cases` 里的通过用例都必须有本轮 case evidence:结果表 evidence、截图 alt/path、项目 ID、step ID 或本轮证据路径需能定位该 case。
|
|
471
495
|
- 页面/浏览器结论(页面通过、浏览器回归通过、完整链路通过)必须有 `browser_tool`、本轮截图和结构化运行态证据:`runtime_url:`、`runtime_user:` 或 `runtime_profile:`、`browser_action_log:`、`visible_assertions:`、`project_id:` 或 `step_id:`。
|
|
472
496
|
- `result:` 使用受支持枚举:`pass` / `pass-with-warnings`、`partial` / `stage` / `blocked` / `diagnostic`、`fail`;不得使用 `all_green` 等未定义同义词。完整通过时 `runtime_url:` 必须是 BPMAX 页面路由且与声明的 project/step id 对齐,动作与断言不得是 TODO、接口回读或 JSON 响应占位文本。
|
|
473
|
-
-
|
|
497
|
+
- 截图必须是本轮生成、可解析、至少 100x80,且内容 MIME 与扩展名一致的 PNG 或 JPEG;文本改后缀、损坏图片和空白占位文件不算页面证据。Chrome identity bridge 的规范 JPEG 可以直接用于同一步 record,不得改名或转换成伪 PNG。
|
|
474
498
|
- 接口回读、缓存命中、状态矩阵只能作为辅助证据;如果报告用这些作为通过依据却缺少真实浏览器动作日志和可见断言,只能写 `diagnostic` / `partial`,不能写完整通过。
|
|
475
499
|
- 出现 `not run` 但 `result: pass` 的报告必须降级为 `partial` 或 `stage`。
|
|
476
500
|
- 浏览器 blocked 报告必须使用 `browser_status: blocked` 模板并停止页面结论。
|
|
@@ -12,6 +12,12 @@ Browser Action Runner V2 把稳定、重复的真实页面步骤变成可审计
|
|
|
12
12
|
{
|
|
13
13
|
"version": 1,
|
|
14
14
|
"scenario": "procurement-main",
|
|
15
|
+
"operation_flow": {
|
|
16
|
+
"mode": "deterministic",
|
|
17
|
+
"on_repairable_failure": "pause_for_script_repair",
|
|
18
|
+
"resume_from": "step_start",
|
|
19
|
+
"on_write_state_unknown": "require_readback_resolution"
|
|
20
|
+
},
|
|
15
21
|
"steps": {
|
|
16
22
|
"C001/S001": {
|
|
17
23
|
"runner": "browser_action",
|
|
@@ -34,13 +40,22 @@ Browser Action Runner V2 把稳定、重复的真实页面步骤变成可审计
|
|
|
34
40
|
"type": "button.click",
|
|
35
41
|
"target": { "role": "button", "name": "提交" },
|
|
36
42
|
"mutation": true,
|
|
37
|
-
"retry": "never"
|
|
43
|
+
"retry": "never",
|
|
44
|
+
"url_pattern": "/project"
|
|
38
45
|
}
|
|
39
46
|
],
|
|
40
47
|
"expected_checks": [
|
|
41
48
|
{ "type": "wait.route", "route": "/projectContinue" },
|
|
42
49
|
{ "type": "page.assert_step", "expected": "部门审批" }
|
|
43
|
-
]
|
|
50
|
+
],
|
|
51
|
+
"resolution_checks": {
|
|
52
|
+
"committed": [
|
|
53
|
+
{ "type": "page.assert_step", "expected": "部门审批" }
|
|
54
|
+
],
|
|
55
|
+
"not_committed": [
|
|
56
|
+
{ "type": "page.assert_step", "expected": "创建申请" }
|
|
57
|
+
]
|
|
58
|
+
}
|
|
44
59
|
}
|
|
45
60
|
}
|
|
46
61
|
}
|
|
@@ -49,13 +64,39 @@ Browser Action Runner V2 把稳定、重复的真实页面步骤变成可审计
|
|
|
49
64
|
## 支持动作
|
|
50
65
|
|
|
51
66
|
- 页面与等待:`navigation.open`、`wait.visible`、`wait.network`、`wait.route`。
|
|
52
|
-
- 主表单:`form.set_value`、`form.select_option`、`form.assert_value`。
|
|
67
|
+
- 主表单:`form.set_value`、`form.set_date_range`、`form.select_option`、`form.assert_value`。
|
|
53
68
|
- 明细表:`detail.add_row`、`detail.set_value`、`detail.assert_rows`。
|
|
54
69
|
- 命令动作:`button.click`、`dialog.confirm`。
|
|
55
70
|
- 上下文与断言:`context.extract`、`page.assert_step`、`list.assert_record`、`evidence.capture`。
|
|
71
|
+
- 消息送达:`message.open`、`message.assert_delivery`。
|
|
72
|
+
|
|
73
|
+
`message.open` 是受控的附带写入动作:消息抽屉加载 `GET message` 后会把未读消息通过 `PUT message/read` 标记为已读。脚本必须显式声明 `collateral_mutation: "message.read"`、`list_url_pattern` 和已读 `url_pattern`;不得声明主业务 `mutation`。runner 在点击前同时安装 GET/PUT response wait,记录各自的 response cursor、method/status,只把消息 ID、收件人 ID、标题、正文和业务 URL 的脱敏投影放入当前步骤 context。未声明附带写入、缺少任一网络模式或未观察到对应 GET/PUT 时 hard fail,不能把打开消息抽屉伪装为 `observe`。
|
|
74
|
+
|
|
75
|
+
`form.upload_file` 是受控附件上传动作,不是主业务提交。文件必须位于当前场景 `fixtures/` 目录,且 action 为每个文件声明 `path`、`sha256`、`mime`、`size`,同时声明 `collateral_mutation: "file.upload"` 和附件接口 `url_pattern`。runner 校验 realpath、普通文件、非符号链接、内容 MIME、大小和哈希后才调用 `setInputFiles`,再核对原生 `input.files` 和本轮附件接口响应。证据分别记录 `local_selection_confirmed=true`、`remote_upload_confirmed=true`、`business_submission_confirmed=false`;附件成功不能代替后续表单提交 mutation。
|
|
76
|
+
|
|
77
|
+
`message.assert_delivery` 必须声明 `title`、`content`、`url_pattern`、当前 run 的 `recipient_id`、`project_id`,需要环节绑定时再声明 `step_id`,并固定 `count: 1`。断言要求唯一消息同时匹配收件人、标题/正文、业务链接以及当前 project/step;零条、重复消息、错误收件人或链接绑定不一致均失败。证据只保留所选消息的脱敏字段,不保存完整消息接口 payload。
|
|
78
|
+
|
|
79
|
+
`wait.network` 默认只接受紧邻前一个 action 开始后产生的新响应。runner 会在每个 action 开始时记录 response cursor;同 URL、同 method、同 status 的历史响应不能被复用。筛选或查询场景必须把触发查询的 `button.click mutation=false` 与对应 `wait.network` 紧邻编排,再执行 `list.assert_record` 或其他强断言;连续两次查询必须各自等待各自的新响应。
|
|
80
|
+
|
|
81
|
+
日期区间控件使用 `form.set_date_range`,通过一个语义 target 定位同一表单项中的两个可见输入框,`value` 固定为 `[start,end]` 两个非空字符串。例如:`{"type":"form.set_date_range","target":{"label":"申请日期"},"value":["2026-08-02","2026-08-02"]}`。不要用两个带 `nth` 的 `form.set_value` 猜测日期区间内部 DOM 顺序。
|
|
82
|
+
|
|
83
|
+
`list.assert_record` 默认断言至少有一条可见匹配记录;可选 `count` 用于精确计数。`count: 1` 证明唯一匹配,`count: 0` 证明同一业务键不存在,适用于 mutation 的 committed/not_committed 互斥探针。计数优先使用当前列表页中包含目标文本的可见数据行;如果表格组件只暴露隐藏的镜像行,则回退到可见文本匹配。使用前必须先在同一步按唯一业务键执行查询,避免分页或未筛选结果削弱证据。
|
|
84
|
+
|
|
85
|
+
`resolution_checks` 可以包含自包含的只读探针序列:`navigation.open`、`form.set_value` / `form.set_date_range` / `form.select_option`、明确 `mutation: false` 的筛选查询按钮,以及等待和强断言。两条分支会在独立页面中分别执行;禁止 `mutation: true`、`dialog.confirm`、上传、明细写入、身份切换或任意脚本。典型模式是两边都重新打开列表、按同一唯一业务键查询,再分别用 `list.assert_record count: 1` 和 `count: 0` 证明已提交与未提交互斥。只有 `not_committed` 分支可以增加 `{ "type": "mutation.assert_no_request", "url_pattern": "/project" }`,用于核对本轮 manifest 绑定的 attempt evidence 确实没有观察到目标写请求;它必须与实时 `wait.route`、`page.assert_step` 或 `list.assert_record` 同时使用,不能单独形成未提交结论。
|
|
56
86
|
|
|
57
87
|
一个 `case_steps.csv` 行只能描述一个业务动作,但该动作可以包含多个技术原子动作。
|
|
58
88
|
|
|
89
|
+
## 步骤起点重建
|
|
90
|
+
|
|
91
|
+
每个 `browser_action` 都必须能从新的 Playwright 进程恢复到自己的步骤起点,不能假设上一步留下的标签页、DOM、输入值或 `context.extract` 仍存在。
|
|
92
|
+
|
|
93
|
+
- 推荐把 `navigation.open` 作为第一个动作。
|
|
94
|
+
- 如果本步正常连续执行时应保留当前页面,可在 `page_fingerprint.route` 声明恢复路由;CLI 只在新页面或路由不匹配时自动恢复。
|
|
95
|
+
- 恢复路由可以使用当前 run 明确提供的 `{{data.*}}`,不得使用上一浏览器进程才存在的 `{{context.*}}`。
|
|
96
|
+
- 如果本步依赖此前填写的字段,本步 `actions` 必须重新包含这些幂等前置填值/选择动作,再执行本步业务动作。已通过步骤不会被重新记录或回放。
|
|
97
|
+
|
|
98
|
+
缺少可恢复路由时,lint 返回 `test_suite.automation.step_start_route_missing`;跨进程依赖 `{{context.*}}` 时返回 `test_suite.automation.step_start_context_volatile`。
|
|
99
|
+
|
|
59
100
|
## 定位规则
|
|
60
101
|
|
|
61
102
|
优先使用 `field`、`label`、`role + name`、`text`、`test_id`。CSS 只允许稳定 id、`name`、`aria-label` 或 `data-*` 属性。
|
|
@@ -67,21 +108,42 @@ Browser Action Runner V2 把稳定、重复的真实页面步骤变成可审计
|
|
|
67
108
|
所有 `button.click` 必须声明 `mutation=true|false`。会远端提交的点击和确认动作必须使用:
|
|
68
109
|
|
|
69
110
|
```json
|
|
70
|
-
{ "mutation": true, "retry": "never" }
|
|
111
|
+
{ "mutation": true, "retry": "never", "url_pattern": "/project" }
|
|
71
112
|
```
|
|
72
113
|
|
|
73
|
-
CLI 在 mutation
|
|
114
|
+
`url_pattern` 用于锁定本次写请求。每个 case step 最多只能有一个 `mutation=true` 动作;需要两个写请求时拆成两个独立步骤。CLI 在 mutation 前验证页面指纹和证据目录,在点击前先把尝试与目标 checkpoint 写入 execution manifest `mutation_attempt_guard`,再保存 operation-flow checkpoint,runner evidence 同时写入同一 attempt ID 的 `mutation-state.json=attempted_unconfirmed`。此时只设置 `mutation_attempted=true`;只有 Playwright 的 request 事件实际观察到匹配模式的 POST/PUT/PATCH/DELETE,才设置 `mutation_request_observed=true` 和 `remote_submitted=true`。匹配响应返回 4xx/5xx 时立即失败。mutation 后必须使用 `wait.route`、`page.assert_step` 或 `list.assert_record` 做强回读,`wait.visible` 只能作为辅助断言。
|
|
115
|
+
|
|
116
|
+
每个 mutation 步骤必须同时提供 `resolution_checks.committed` 和 `resolution_checks.not_committed`。两组检查都只能执行只读动作,并至少包含一个 `wait.route`、`page.assert_step` 或 `list.assert_record`,分别证明“已经写入”和“没有写入”;不能用同一条模糊可见性断言覆盖两个结果。
|
|
117
|
+
|
|
118
|
+
写入和强回读确认后,`mutation-state.json` 更新为 `confirmed`,并和截图、DOM、动作 trace、步骤 evidence 一起写入 `evidence-files.json`,每个文件记录 SHA-256。进程在点击后中断时,持久化的 `attempted_unconfirmed` 会阻止自动重放。
|
|
119
|
+
|
|
120
|
+
## 操作流程与断点
|
|
121
|
+
|
|
122
|
+
正式场景由 `scenario execute` 一次运行到完成或受控暂停。`run start` 先把 promote 后的 automation 复制到本轮报告目录;execute 只接受 manifest 绑定的 run-scoped 文件。所有正式 `browser_action` 都不得直接调用 `browser-run`,因为只有 orchestrator 能保证整段流程不会退化成 Agent 逐步骤循环,并在 mutation dispatch 前持久化 manifest guard 和 checkpoint。execute、resolve 和 automation repair 对同一 execution manifest 共用 `<execution-manifest>.operation.lock`;调用方即使指定不同 checkpoint,也不能并行进入执行、写入或恢复链路。CLI 在同一目录维护 `operation-flow-state.json`,记录脚本绑定、已通过步骤哈希、当前步骤和 mutation 状态;execution manifest 还保存正式步骤顺序、最终结果和未确认 mutation guard,不能手工编辑。删除 checkpoint 不能解除 guard,必须通过匹配本轮 nonce、revision、attempt ID 和步骤哈希的 resolve 闭环。
|
|
123
|
+
|
|
124
|
+
- `paused_repairable`:异常发生在 mutation 之前。CLI 保存截图、DOM、Console/Network、动作 trace 和 `repair-request.json`,当前步骤保持 `planned`。页面、选择器或脚本漂移只允许在 draft 修改当前或未来步骤;重新 init/compile、刷新 review asset snapshot 后,必须通过 `test-suite automation repair` 应用到本轮副本。该命令与 execute/resolve 共用 manifest operation lock,先在 manifest 写 `automation_repair_guard`,锚定 checkpoint/source/review/旧新脚本 hash 和不可变 receipt hash,再替换本轮脚本。guard 已写但 run automation 尚未替换时,resume 必须停止且不能启动浏览器;崩溃恢复只能完成同一笔已锚定 repair。
|
|
125
|
+
- `paused_external_action`:当前是身份桥或其他已注册的非浏览器 runner。CLI 返回一个完整外部动作,不返回逐个页面点击。外部动作完成并产生本轮证据后续跑。
|
|
126
|
+
- `paused_write_state_unknown`:mutation intent 已记录但结果未确认。禁止 resume、脚本改写、自动重试或换 report root 新建同 scenario/case/profile run。若 `mutation_request_observed=false`,状态仍保持未决,但不得伪报 `remote_submitted=true`。`scenario resolve` 在两个独立页面分别运行 committed/not_committed 两组只读 `resolution_checks`,只有唯一命中才形成结论;调用方不能选择 outcome。对已发生的无请求第三态,如果 attempt evidence 证明未观察到目标写请求,且当前页面仍匹配尝试步骤已审核的起点 route 和提交按钮 fingerprint,runner 可以生成 `mutation.no_request_page_fingerprint` 受控断言,不要求事后修改已哈希锁定的 automation。确定性 Playwright runner 会生成截图、DOM、trace、source evidence、`resolution-receipt.json` 和 `evidence-files.json`;CLI 将 receipt、source evidence 和 file manifest 的 SHA-256 锚定到 manifest guard 后才接受结果。resolution evidence 必须匹配当前 run nonce、checkpoint revision、mutation attempt ID、case/step,且 `automation_step_sha256` 等于实际尝试步骤的哈希;手写或仅文件内自洽的 JSON bundle 不能独立清除 guard。
|
|
127
|
+
- `pass`:全部步骤和证据闭环。再次运行必须创建新的 full-rerun manifest,不能复用该 checkpoint。
|
|
128
|
+
|
|
129
|
+
断点固定在步骤边界。续跑会创建新的浏览器上下文,并通过当前步骤自己的首个 `navigation.open` 或 `page_fingerprint.route` 恢复页面;当前步骤 mutation 尚未尝试时,可安全重放该步骤的导航、等待、填值和断言。已通过步骤不能修改或重放,CLI 会比较其稳定哈希,发现变化立即阻断。
|
|
74
130
|
|
|
75
131
|
## 运行与重跑
|
|
76
132
|
|
|
77
|
-
|
|
133
|
+
正式运行前先完成 `test-suite automation init`、只读来源审查和 `test-suite automation compile`,确保所有页面步骤都已变为 `runner=browser_action`;之后创建新的 test-suite run,登记 manifest 锚定的本轮 passed precondition checks,再以 `scenario execute` 作为唯一正式入口。公开 `browser-run` 只保留兼容命令名并硬阻断直接执行;页面探索和异常诊断使用 `chrome:control-chrome`,不得由 Agent 编排单步 runner 形成正式结果。`scenario execute` 返回 `functional_complete` 后仍需 UX 审计和 `lint-report`,不能直接等同正式 pass。`--resume` 只继续同一个未完成 run;已完成 run 必须新建,历史 pass 不得让本轮 case 被跳过。
|
|
78
134
|
|
|
79
135
|
每轮重新解析动态 ID,并生成新的截图、DOM、Console/Network、动作 trace 和 manifest 记录。缓存只包含动作和页面语义。
|
|
80
136
|
|
|
81
|
-
|
|
137
|
+
`runner=observe` 只允许读取同一 run 中更早通过步骤已经登记的 evidence。`input_data` 必须声明 `source_case_step_id=<case_id>/<step_id>`,observe evidence 必须回写相同字段;来源步骤必须在同一 case 中更早且已经 pass。打开、点击、填写、提交、搜索、确认、身份切换或引用未登记文件都必须 hard fail,不能借 observe 形成 pass。
|
|
138
|
+
|
|
139
|
+
## 首次脚本生成
|
|
82
140
|
|
|
83
|
-
|
|
141
|
+
首次正式运行前,先在 `.ai_test/suite_draft` 由 `test-suite automation init` 生成待审编译输入。init/compile 均拒绝直接修改 `.ai_test/suite`。优先读取平台源码;仍需确认页面结构时,使用 `chrome:control-chrome` 复用当前 Chrome 标签页和登录态做只读探索,不得提交、审批、驳回或执行其他业务 mutation。不要默认启动独立 Playwright 或 Chrome DevTools 来探索页面;只有 Chrome Control 不可用或按其排障流程处理后仍失败时才降级 Chrome DevTools。
|
|
84
142
|
|
|
85
|
-
|
|
143
|
+
在编译输入中为每个步骤填写 `source_basis`、`page_fingerprint`、`actions` 和 `expected_checks`,review 后运行 `test-suite automation compile` 写入 `automation.json` 并把对应步骤改为 `runner=browser_action`。编译元数据会绑定 case assets、actions 和 expected checks,任何后改都必须重新 compile。`source_basis` 每一项必须使用 `platform_source:`、`chrome_control_read_only:`、`reviewed_pattern:` 或 `business_requirement:` 前缀并写清具体依据。确定性执行后的 `browser-action-trace.json` 和 `record-from-evidence --automation-out ...` 只能在 `.codex/tmp` 生成待审候选;候选不能直接作为场景 `automation.json`,必须重新进入 compile/review/promote,或在受控暂停时经 review 后通过 automation repair 应用到当前 run。
|
|
144
|
+
|
|
145
|
+
如果页面动作和 manifest 记录已经成功,只是报告同步失败,操作流程器会暂停在 `report_sync_failed`,当前步骤指向下一待执行步骤。恢复时只同步报告;CLI 会重新校验证据的 realpath、mtime、run nonce 和 case/step 绑定,再从 manifest 当前步骤继续。不得修改或回放已通过步骤。
|
|
86
146
|
|
|
87
147
|
`cache_stale`、不支持控件或 lint 失败时,不得直接改成宽泛 CSS 绕过;应优先用 `chrome:control-chrome` 重新录制语义定位并 review。
|
|
148
|
+
|
|
149
|
+
修复脚本时必须保留场景、manifest 和已通过步骤。允许增加兼容选择器、等待、控件分支和稳定断言;禁止直接编辑报告目录中的 automation、修改 completed step、写死本轮动态 ID、删除 mutation 后置断言或把 `retry=never` 改成可重试。
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
## 浏览器工具优先级
|
|
6
6
|
- 已有稳定 `browser_action`:使用 bpmax-cli Browser Action Runner V2 的 Playwright 执行。
|
|
7
|
-
-
|
|
7
|
+
- 首次正式运行前的脚本准备:优先读取平台源码;必要时使用 `chrome:control-chrome` 复用当前 Chrome 标签页和登录态做只读页面结构探索,禁止提前执行业务 mutation。
|
|
8
|
+
- `cache_stale`、未支持控件或执行异常:优先使用 `chrome:control-chrome` 定位并修复当前/未来脚本或 runner 兼容层。
|
|
8
9
|
- Chrome Control 不可用或按其排障流程处理后仍失败:降级 Chrome DevTools;DevTools 再失败才允许使用 AppleScript。
|
|
9
10
|
- 报告必须记录实际使用的工具,不能把 Chrome Control 探索证据写成 Playwright 自动执行证据。
|
|
10
11
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
- 线上完整链路:页面优先,必须走真实运行页真实操作;接口与脚本只做辅助,不替代用户路径
|
|
28
28
|
- 非完整链路或离线摸底:接口优先,可用于列表查询、项目创建、详情回读、步骤审批/驳回、筛选字段发现
|
|
29
29
|
- 页面兜底:导航入口可见性、页面真实文案/按钮、截图取证、首次抓真实请求骨架
|
|
30
|
-
-
|
|
30
|
+
- 首次脚本编译前的只读探索、页面指纹变化、未支持控件或异常诊断时,优先使用 `chrome:control-chrome`,复用用户当前 Chrome 的标签页、登录态和扩展能力;正式 run 前禁止业务 mutation,不要默认先用 Chrome DevTools 或独立 Playwright 探索页面。
|
|
31
31
|
- `chrome:control-chrome` 不可用,或按其浏览器连接/Chrome 扩展排障流程处理后仍失败时,才允许降级到 Chrome DevTools。Chrome DevTools 再出现 `Network.enable timed out`、快照长期不可用或页面通道挂住时,允许切换到 AppleScript 作为真实浏览器 E2E 备用通道;备用通道只能做 DOM 文本读取、按钮点击、输入框填写、截图和页面提交,不得改用接口直调替代页面动作。
|
|
32
32
|
- 使用 AppleScript 备用通道时仍必须记录:
|
|
33
33
|
- 触发兜底的 DevTools 错误
|
|
@@ -67,13 +67,15 @@
|
|
|
67
67
|
|
|
68
68
|
## 重复操作加速模式
|
|
69
69
|
- E2E 加速分两层:`bpmax-cli e2e` 提供稳定、可复用、可审计的执行能力;本 skill 负责把这些能力编排成标准打法。不要每次靠 Agent 临场拼 shell、临场写浏览器点击步骤。
|
|
70
|
-
- 首次运行一条流程或一个复杂 step
|
|
70
|
+
- 首次运行一条流程或一个复杂 step 前,必须先生成、审查并编译覆盖完整场景的 `automation.json`;`scenario plan`、`data profile` 和 reusable step template 只作为补充资产,不能替代正式脚本。
|
|
71
71
|
- 哪怕本轮只跑一次,也要把 handoff、step-run、浏览器截图、DOM/URL、console/network、submit/readback 证据落到稳定目录,便于下一次直接复用或从失败点恢复。
|
|
72
|
-
- `bpmax-cli test-suite lint`
|
|
73
|
-
- 稳定浏览器步骤应升级为 `runner=browser_action`,场景目录提供 `automation.json`。lint 会逐步校验动作映射、页面指纹、语义选择器、断言、动态 ID
|
|
74
|
-
-
|
|
72
|
+
- `bpmax-cli test-suite lint` 会检查每条非 deprecated E2E 用例是否具备正式运行所需的确定性脚本覆盖;仍存在 `browser` 或缺少 automation 映射时,不要直接判业务失败,而是读取输出中的 `e2e_acceleration.bootstrap_required=true` 和 `missing_cases`。`e2e_create_page`、`e2e_step_run` 已退出正式 schema,只允许 automation init/compile 读取旧草稿并迁为 `browser_action`。
|
|
73
|
+
- 稳定浏览器步骤应升级为 `runner=browser_action`,场景目录提供 `automation.json`。lint 会逐步校验动作映射、页面指纹、语义选择器、断言、动态 ID、mutation 重试策略和 `operation_flow` 的修复/续跑策略,并输出 `automation_coverage`。
|
|
74
|
+
- 正常复跑只使用一次 `bpmax-cli e2e scenario execute` 作为场景主入口;公开 `browser-run` 直接调用会硬阻断,任何正式页面步骤都不能由 Agent 组合成逐步执行循环。每个 case step 最多一个远端 mutation。首次脚本准备、`cache_stale`、未支持控件和异常诊断优先使用 `chrome:control-chrome`。
|
|
75
|
+
- mutation 前异常会写 operation-flow checkpoint 和 repair request,manifest 当前步骤保持 `planned`。真正 dispatch mutation 前,CLI 先把同一尝试和目标 checkpoint 写入 manifest `mutation_attempt_guard`,再保存 checkpoint,并让 runner 的 `mutation-state.json` 使用同一 attempt ID;checkpoint 或 evidence 被删除也不能绕过该 guard。每个 mutation 步骤必须为 committed/not_committed 分别声明强 `resolution_checks`。每个浏览器步骤必须以首个 `navigation.open` 或 `page_fingerprint.route` 提供可在新进程恢复的步骤起点,并把恢复本步所需的幂等前置动作写进当前步骤;不得依赖上一进程的 `{{context.*}}`。在 draft 修复当前或未来脚本并重新 compile/review 后,先用 `test-suite automation repair` 应用到本轮副本;CLI 会先把 source/review/checkpoint/旧新脚本和 receipt hash 写入 manifest repair guard,再替换脚本,因此进程中断只能恢复同一笔修复。execute、resolve、repair 共用 manifest operation lock,已通过步骤由哈希锁定,不能修改或重放。
|
|
76
|
+
- mutation intent 已记录但结果不确定时禁止 resume,也不能通过更换 report root 新建同 scenario/case/profile run。证据必须区分 `mutation_attempted`、`mutation_request_observed` 和 `remote_submitted`,不能因为写入 guard 已建立就声称远端已提交。`e2e scenario resolve` 使用两个独立页面分别执行 committed/not_committed 的只读 `resolution_checks`,必须且只能有一个分支通过;未观察到目标写请求时,可以在 not_committed 分支用 `mutation.assert_no_request` 核对本轮网络证据,但还必须有实时路由、环节或列表记录检查。`--outcome` 只用于核对预期,不能选择最终结论。CLI 生成本轮截图、DOM、trace、source evidence、`resolution-receipt.json` 和 `evidence-files.json`,并把 receipt/source/file-manifest SHA-256 锚定到 manifest guard。证据必须绑定当前 run nonce、checkpoint revision、mutation attempt ID、case/step 和 automation step hash;手写或仅文件内自洽的 resolution bundle 不能形成结论。只有明确 `not_committed` 才能重试,明确 `committed` 则由正式证据推进步骤。
|
|
75
77
|
- `--resume` 仅继续当前未完成 run。用户要求重新运行、全量重跑或当前 manifest 已完成时,必须新建 run;历史 pass、status matrix 或缓存不能跳过本轮 case。
|
|
76
|
-
- 发现 `bootstrap_required=true`
|
|
78
|
+
- 发现 `bootstrap_required=true` 时,先执行 `test-suite automation init`,依据平台源码和 Chrome Control 只读探索补齐脚本,再执行 `test-suite automation compile`。不得先手工跑一次正式用例;`record-from-evidence` 只用于确定性运行后细化 reusable step template。
|
|
77
79
|
- 缓存执行不是无条件信任旧模板。每个 reusable step template 必须包含 `expected_checks`,复用时 `bpmax-cli e2e step-run --data-profile @...` 会先检查当前运行态模式是否仍符合预期,例如处理人可处理、step 未结束、必填字段集合、缺失字段范围、动作仍存在。
|
|
78
80
|
- 处理人判定必须优先使用当前有效 owner/assignee;`step.user_id` 只能作为辅助字段。若它与 owner 冲突,或只有 `user_id` 没有权威 owner 证明,step-run 必须阻断,不能生成可提交计划。
|
|
79
81
|
- 如果 `expected_checks` 缺失、失败,或没有拿到预期范围内的结果,必须把该 step 判为 `cache_stale`,停止继续提交后续步骤;不要把缓存失效误判为业务失败,也不要继续用旧 payload 硬推。
|
|
@@ -123,18 +125,28 @@ bpmax-cli e2e create-page-submit \
|
|
|
123
125
|
```
|
|
124
126
|
|
|
125
127
|
- `e2e create-page-submit` / `e2e browser-template create-form` 生成的是页面自动化模板,不是 raw API 创建。必须执行生成的 Playwright 脚本或等价真实浏览器操作,并保存截图、URL、DOM 摘要、console/network 错误和 `project_id` 解析结果,才能写“页面回归通过”。
|
|
126
|
-
-
|
|
128
|
+
- `test-suite run start` 后先核对真实样本、测试身份、入口、主数据和依赖状态,把至少一条命名明确且 `passed=true` 的检查写入本轮结构化 precondition evidence,再运行 `test-suite run precondition`。只有返回 `state=passed` 才能开始正式页面执行;文件名含本轮 run 但记录不存在、仍为 pending、引用旧证据或登记后哈希变化都必须阻断。
|
|
129
|
+
- 批量场景优先声明 `.codex/e2e-plans/<scenario>.json`,前置检查通过后再运行:
|
|
127
130
|
|
|
128
131
|
```bash
|
|
129
132
|
bpmax-cli e2e scenario execute \
|
|
130
133
|
--plan .codex/e2e-plans/<scenario>.json \
|
|
131
|
-
--automation .ai_test/
|
|
134
|
+
--automation .ai_test/report/<run>/automation.json \
|
|
132
135
|
--execution-manifest .ai_test/report/<run>/execution-manifest.json \
|
|
133
|
-
--resume \
|
|
134
|
-
--until-blocked \
|
|
135
136
|
--format json
|
|
136
137
|
```
|
|
137
138
|
|
|
139
|
+
其中 automation 路径必须直接使用 `test-suite run start` 返回的本轮副本,不得改回 suite/draft 文件。命令返回 `functional_complete` 只表示功能步骤完成,正式结论仍需 UX 审计和 `lint-report`;`formal_conclusion_ready=false` 时不得宣布通过。命令返回 `paused_repairable` 时,先在 reviewed draft 完成修复,再执行:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
bpmax-cli test-suite automation repair \
|
|
143
|
+
--checkpoint .ai_test/report/<run>/operation-flow-state.json \
|
|
144
|
+
--automation .ai_test/suite_draft/<scenario>/automation.json \
|
|
145
|
+
--format json
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
确认返回 `repair_receipt` 后,才对同一 execute 命令增加 `--resume`。`paused_external_action` 需先完成对应外部动作;`paused_write_state_unknown` 必须先 resolve,不能直接 repair 或 resume。
|
|
149
|
+
|
|
138
150
|
- 旧 `scenario run` 只保留 dry-run/status matrix 兼容用途,不能执行页面,也禁止使用 `--resume` 表示真实复跑。
|
|
139
151
|
- 确定性 runner 仍必须逐步骤产生本轮真实截图和运行态证据;没有这些证据时不得把执行计划当成完整链路通过。
|
|
140
152
|
- 对表单 schema、字段 options、step requirements 反复探测时,先使用 runtime cache:
|
|
@@ -167,7 +179,7 @@ bpmax-cli e2e cache refresh --flow-id <flow_id> --profile <profile> --format jso
|
|
|
167
179
|
- `cases.csv` 字段必须固定为:`case_id,priority,type,title,preconditions,config_basis,prep_data,expected_result,test_data,roles,evidence_required,tags,status,updated_at`。
|
|
168
180
|
- `case_steps.csv` 字段必须固定为:`case_id,step_id,step_no,actor,runner,action,target,input_data,expected_result,evidence_required`。禁止把多个动作聚合在一行。
|
|
169
181
|
- `config_basis` 必须指向真实存在的配置或能力依据,并说明覆盖原因。配置仓库使用 `think_*`、`.ai_test/`、`.codex/skills/`;`bpmax-cli` 包内能力可引用 `skills/`。
|
|
170
|
-
- 每条正式 E2E 用例的 `prep_data` 必须包含执行前置证据:`precondition_check=`、`browser_tool=`、`live_draft=`、`state_file=` 或 `report_run=`,并必须声明 `resume_policy=full_rerun|checkpoint|evidence_only`。默认重新运行使用 `resume_policy=full_rerun
|
|
182
|
+
- 每条正式 E2E 用例的 `prep_data` 必须包含执行前置证据:`precondition_check=`、`browser_tool=`、`live_draft=`、`state_file=` 或 `report_run=`,并必须声明 `resume_policy=full_rerun|checkpoint|evidence_only`。默认重新运行使用 `resume_policy=full_rerun`;`precondition_check` 必须最终落到 `run start` 生成且 manifest 锚定的本轮 canonical record,没有记录、记录 pending 或 checks 未全部通过时不能执行正式步骤。
|
|
171
183
|
- `state_file=` / `report_run=` 不得写死历史 run 或历史日期。正式用例模板应使用 `<run_id>` / `<date>` 占位,执行时再生成本轮独立状态文件和报告目录;历史状态、历史报告、历史截图只能作为“历史对照”,不能作为本轮 pass evidence。
|
|
172
184
|
- 用例内容必须可读,`title`、`preconditions`、`config_basis`、`prep_data`、`steps`、`expected_result`、`test_data` 不得出现乱码、异常编码片段、`???`、`xxx`、`占位`、`待补`、`暂无`、`略` 这类空洞内容;`steps` 必须是可执行步骤,不得是一句泛泛备注。
|
|
173
185
|
- 负向、边界、异常、错误提示、扫码错误 SN 等用例必须在 `expected_result`、`steps` 或 `evidence_required` 中写明 `expected_error_text` 或 `error_capture_required`,并要求真实错误提示截图。没拿到提示文案时,结论写“提示文案未取到”,不要直接判业务失败。
|
|
@@ -207,6 +219,7 @@ bpmax-cli test-suite lint-report --root .ai_test/report
|
|
|
207
219
|
- 用 `bpmax-functional-test-design` 固化功能覆盖,用 `bpmax-ui-ux-audit` 审计本轮页面;报告必须引用同目录 `ux-findings.json`。UX 审计未完成时只能写 `partial` 或 `blocked`。
|
|
208
220
|
- 所有确认体验问题都按 BUG 管理:未解决 P0/P1 强制 `fail`;只有未解决 P2/P3 时用 `pass-with-warnings`;无未解决 UX BUG 且功能与证据门禁都通过才允许 `pass`。`verified` 必须保留原始证据和晚于原始证据的本轮 `retest_evidence`。
|
|
209
221
|
- 场景报告必须写 `planned_cases:`、`executed_cases:`、`planned_steps:`、`executed_steps:`、`execution_manifest:`、`precondition_check:`、`state_file:`、`report_run:`、`browser_tool:`、`rerun_policy:`。case 与 step 都必须逐条对账;有未执行步骤时只能写阶段/局部结论。
|
|
222
|
+
- `precondition_check:` 必须引用 execution manifest 锚定的本轮结构化记录,并校验 record/evidence SHA-256、run/scenario/case/profile 和全量 passed checks;仅靠路径文字、日期或旧状态文件不能通过。
|
|
210
223
|
- 报告出现 `not run`、`未执行`、`跳过` 时,`result:` 必须降级为 `partial`、`stage`、`blocked` 或明确“阶段/局部/不完整”。没有用户确认缩小范围时,不得把跳过用例合并进完整结论。
|
|
211
224
|
- 没有合规浏览器工具或页面证据时,必须使用浏览器阻塞模板:`browser_status: blocked`,并写“页面结论停止”;不得用 API/readback 证据冒充页面验证。
|
|
212
225
|
- 报告里写“页面通过 / 浏览器回归完成 / 真实页面已验证 / 完整链路通过”时,必须同时有 `browser_tool:`、本 run 的本地截图证据和结构化运行态字段:`runtime_url:`、`runtime_user:` 或 `runtime_profile:`、`browser_action_log:`、`visible_assertions:`、`project_id:` 或 `step_id:`。
|
|
@@ -274,7 +287,7 @@ bpmax-cli test-suite lint-report --root .ai_test/report
|
|
|
274
287
|
|
|
275
288
|
### 1.6 多角色浏览器身份切换
|
|
276
289
|
- 这一节只适用于浏览器 E2E 页面测试。不要把模拟用户身份用于 API Key、CLI 远端命令或非页面路径结论。
|
|
277
|
-
- 正式 `case_steps.csv`
|
|
290
|
+
- 正式 `case_steps.csv` 只允许 `browser_action`、`identity`、`observe`;身份 status/mock/unmock 步骤必须使用 `runner=identity`,并在 `input_data` 声明 `identity_transport=chrome_bridge`。旧 `e2e_create_page`、`e2e_step_run` 只能在 draft 中作为待迁移输入,不能通过正式 lint/review/promote。
|
|
278
291
|
- 多角色场景必须先列出角色矩阵:
|
|
279
292
|
- 原始管理账号
|
|
280
293
|
- 目标角色
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
# 最小测试回路
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
稳定页面步骤必须先执行 `test-suite automation init`,依据平台源码和 Chrome Control 只读探索生成、review 并 compile 整个场景的 `automation.json`;完成 scoped lint/review/promote 后,才由 `test-suite run start` 创建本轮 run,并复制、绑定本轮专用 automation。先准备真实样本并用 `test-suite run precondition` 登记 manifest 锚定的本轮 passed checks,随后才用一次 `e2e scenario execute` 执行确定性操作流程。每个步骤最多一个远端 mutation,mutation 必须分别声明 committed/not_committed 的强 `resolution_checks`,并要能用自己的导航或页面路由在新浏览器进程中重建起点,不依赖上一进程的临时 context。Agent 不得反复读取 next step 后临场点击;所有正式 `browser_action` 都不得直接调用 `browser-run`。execute、resolve 和 automation repair 对同一 manifest 共用 operation lock。页面指纹失效或 mutation 前异常时停在当前步骤,只能在 reviewed draft 修脚本并通过 `test-suite automation repair` 应用到本轮副本;CLI 先在 manifest 锚定修复来源、旧新脚本和不可变 receipt,再更新本轮副本,异常中断后只恢复同一笔 repair。`functional_complete` 仍不是正式通过,必须完成 UX 审计并通过 `lint-report`。已完成 manifest 不得 resume,重新运行必须创建新 run 和新证据;但存在未决 mutation guard 时,必须先 resolve,不能新建 run 绕过。
|
|
4
4
|
|
|
5
5
|
每个 BPMAX 场景默认按这个顺序走:
|
|
6
6
|
|
|
7
7
|
1. 查记忆
|
|
8
|
-
2. 读当前 live/draft
|
|
9
|
-
3.
|
|
10
|
-
4.
|
|
11
|
-
5.
|
|
12
|
-
6.
|
|
13
|
-
7.
|
|
14
|
-
8.
|
|
15
|
-
9.
|
|
8
|
+
2. 读当前 live/draft 与平台源码,必要时只读探索浏览器页
|
|
9
|
+
3. 生成、review、compile 确定性脚本并通过 scoped lint/review/promote
|
|
10
|
+
4. 创建新的正式 run,确认前置数据
|
|
11
|
+
5. 若场景涉及多角色,由操作流程器在对应 identity 步骤暂停并完成受控身份切换
|
|
12
|
+
6. 一次执行场景操作流程,直到完成或受控暂停
|
|
13
|
+
7. 记录样本 ID、关键接口、当前环节、业务字段、当前角色
|
|
14
|
+
8. 判定 `pass / fail / blocked`
|
|
15
|
+
9. 多角色场景使用 Chrome Control 身份桥;mock 前先 status,结束后在 finally 中 unmock,并验证恢复原始身份和 lease released
|
|
16
|
+
10. 如果是 mutation 前可修复异常,按 repair request 修改当前/未来脚本,或修复 runner/控件/环境兼容,通过 manifest 锚定 receipt 后再从步骤断点续跑;如果 mutation 结果不确定,分别运行 committed/not_committed 两组只读检查并要求唯一命中,再生成 Playwright readback 和 manifest 锚定的 resolution receipt,禁止手写证据、调用方指定结论、直接重试或换 report root 新建同用例 run
|
|
17
|
+
11. 只有不可修复错误或明确 blocker 才终止 manifest;完整结束后再做报告 lint
|
|
16
18
|
|
|
17
19
|
判定优先级:
|
|
18
20
|
- 运行时真实行为
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bpmax-e2e-flow-test-operator-v2
|
|
3
|
+
description: "仅在用户显式调用时,用已审查脚本执行 BPMAX 端到端流程测试。用于先预检用例与线上配置、等待确认、隔离执行指定用例并保存本轮证据。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# BPMAX E2E Flow Test Operator V2
|
|
7
|
+
|
|
8
|
+
只在用户显式要求使用 V2 时执行。本 Skill 与 V1 并行,绝不修改或替代 V1。
|
|
9
|
+
|
|
10
|
+
## 固定流程
|
|
11
|
+
1. 读取线上最新 live/draft 配置和当前 `.ai_test` 资产;先读取 `references/test-preflight-and-confirmation.md`。
|
|
12
|
+
2. 输出测试用例预检:可复用用例、计划范围、失效或缺失步骤、排除项与资产动作。
|
|
13
|
+
3. 先运行 automation status,将 selected steps 分为 `reusable`、`regenerate_required` 和 `blocked`;展示复用项、需更新项、warning 和排除项。
|
|
14
|
+
4. `reusable` 保持现有已 promote automation,不重复录制或回放。只对需更新步骤按 `references/browser-recording-and-replay.md` 录制、生成候选并在全新 browser context 回放。
|
|
15
|
+
5. 只对 changed steps 在 `suite_draft` 完成最小 diff、scoped lint 和 review;修完 P0/P1 后冻结候选。warning 和 UX 建议不阻断业务执行。
|
|
16
|
+
6. 向用户展示最终 case、排除项、资产 diff 和执行动作。用户明确确认后,仅在有资产变化时 promote,再按 `references/scoped-execution.md` 创建 scoped run;同一范围不重复确认。
|
|
17
|
+
7. 正式执行中的页面导航、读取、截图、输入、点击、提交、审批、登录、身份切换和验证必须由已审查 automation 脚本执行。表单步骤必须先按最新版表单生成表单契约并覆盖全部必填字段;数据和选择器按 `references/test-data-and-selector-contract.md` 绑定。优先使用本轮有效 Cookie/storage state 或目标 CDP context;Playwright 认证探测失败时停止并要求用户复制完整 Cookie,认证成功前不得开始业务步骤。读取 `references/browser-action-runner.md`、`references/step-restartability-and-state.md` 和 `references/identity-and-failure-routing.md`。
|
|
18
|
+
8. 涉及一次交互产生多个写请求时读取 `references/multi-request-mutation.md`;批量场景按 `references/batch-generation-and-execution.md` 分批熔断和隔离发布。
|
|
19
|
+
9. 逐步骤保存本轮证据、完成 UX 审计和报告 lint;读取 `references/test-assets-and-evidence.md`。
|
|
20
|
+
10. 出现身份、环境、脚本或产品异常时,按 `references/identity-and-failure-routing.md` 分流并如实报告。
|
|
21
|
+
|
|
22
|
+
## 不可绕过的门禁
|
|
23
|
+
- 新建或修复 automation 时的受控录制是唯一例外;正式执行不得手工操作浏览器。不得通过 Chrome Control、DevTools 或 AppleScript 直接执行正式测试或绕过脚本诊断,录制动作必须完整进入 trace 和 `recording_only` 报告。
|
|
24
|
+
- 需录制时必须使用 `Chrome` 插件直接操作并由 Agent 结构化记录;不得使用 Record & Replay、`event_stream` 或其他事件流录制器。
|
|
25
|
+
- 可使用 Chrome 插件发现已登录会话,并将与当前 profile 匹配的认证数据交接给 Playwright context;具体规则见身份 reference。
|
|
26
|
+
- 不得使用 `runner=browser`;正式页面步骤必须使用已审查的 `browser_action` automation。
|
|
27
|
+
- 不得用 raw API、控制台请求或修改请求体替代页面路径。
|
|
28
|
+
- `--diagnostic` 仅可用于非页面的配置、接口或日志诊断;不得生成页面结论或正式通过证据。
|
|
29
|
+
- 不得从“继续”“看一下”“可以”等模糊回复推断用户已确认执行;必须收到明确的范围确认。
|
|
30
|
+
- 不得在聊天输出、测试报告、截图证据或完整环境变量转储中暴露 Cookie、token 或 Authorization;认证数据可以在 Chrome 与 Playwright 之间受控交接。
|
|
31
|
+
- 用户发送 Cookie 后不得复述、引用或写入 memory、automation、manifest、报告和 Git 文件;只允许写入权限为 `0600` 的本轮临时认证文件,并在测试收口时清理。
|
|
32
|
+
- 不得按浏览器标签页顺序选择页面,也不得将遗留 `/login` 页面当作业务页面;登录 bootstrap 失败时必须 `blocked`,不得创建或重试业务数据。
|
|
33
|
+
- 不得假定 `browser.contexts()[0]` 是认证 context,也不得仅按候选 URL 判定登录有效;认证 context 不唯一或导入后认证探测失败时必须在业务动作前阻断。
|
|
34
|
+
- 不得因为 Chrome 插件看到了已登录页面,就假定指定 CDP endpoint 属于同一浏览器进程;必须以 Playwright 对目标 route 的认证探测为准。
|
|
35
|
+
- 身份操作必须绑定实际执行页面动作的浏览器:录制阶段在 Chrome Control 当前录制标签页 mock/unmock;回放和正式运行阶段在对应 Playwright context 中 mock/unmock。Playwright 未登录时必须打开有界的非 headless 登录窗口,认证回读通过后才能继续。
|
|
36
|
+
- 既有 case 不足或与配置不一致时,默认建立最小隔离 draft 场景;只有用户明确要求,才修改共享主场景。
|
|
37
|
+
|
|
38
|
+
## 结论边界
|
|
39
|
+
- `pass`:确认范围内的每个必需步骤都由本轮脚本完成,当前 run 证据和业务断言完整;若只覆盖部分 active case,场景级结论只能是 `partial`。
|
|
40
|
+
- `partial`:仅执行 selected cases 或未覆盖完整场景。UX findings 独立报告,不改变已证明的业务步骤结论。
|
|
41
|
+
- `blocked`:确认前、环境/权限阻塞、脚本未审查、证据或写入状态无法确认。每次必须输出已完成边界、解除条件、下一责任方和一条可直接继续对话的提示词;具体格式见身份 reference。
|
|
42
|
+
|
|
43
|
+
## Reference 路由
|
|
44
|
+
- 预检内容、确认语句与状态机:`references/test-preflight-and-confirmation.md`
|
|
45
|
+
- selected case、隔离场景与 scoped run:`references/scoped-execution.md`
|
|
46
|
+
- automation 编译、原子提交、修复与续跑:`references/browser-action-runner.md`
|
|
47
|
+
- 表单契约、必填字段覆盖和批量脚本熔断:`references/form-script-generation.md`
|
|
48
|
+
- 业务场景覆盖矩阵与 PC/H5 建模:`references/scenario-coverage-generation.md`
|
|
49
|
+
- 多来源生成、canonicalization 与 publishability:`references/automation-generation-pipeline.md`
|
|
50
|
+
- 真实浏览器录制、录制报告和独立回放:`references/browser-recording-and-replay.md`
|
|
51
|
+
- 本轮数据、fixture 与 selector 主数据契约:`references/test-data-and-selector-contract.md`
|
|
52
|
+
- 独立步骤重建、上下文提取和断点状态:`references/step-restartability-and-state.md`
|
|
53
|
+
- 单次交互的主写入与伴随写入:`references/multi-request-mutation.md`
|
|
54
|
+
- 多流程批量生成、隔离 lint/review/promote 与熔断:`references/batch-generation-and-execution.md`
|
|
55
|
+
- 用例资产、逐步骤证据、报告与重跑:`references/test-assets-and-evidence.md`
|
|
56
|
+
- 身份桥、环境证据、失败归因与 issue:`references/identity-and-failure-routing.md`
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "BPMAX E2E Flow Test Operator V2"
|
|
3
|
+
short_description: "Confirm scope then run BPMAX E2E with reviewed scripts"
|
|
4
|
+
default_prompt: "Use $bpmax-e2e-flow-test-operator-v2 to preflight and run a confirmed BPMAX E2E test scope."
|
|
5
|
+
|
|
6
|
+
policy:
|
|
7
|
+
allow_implicit_invocation: false
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# 自动化生成流水线
|
|
2
|
+
|
|
3
|
+
## Canonical 输入
|
|
4
|
+
|
|
5
|
+
多 Agent、录制器或历史资产的输出只能作为候选材料,不能直接 promote。统一映射到 CLI 生成的 `bpmax_e2e_automation_compile_input`,逐步骤保留 case 快照、来源、publishability、数据契约和 automation。
|
|
6
|
+
|
|
7
|
+
不得让不同 Agent 自定义三套 JSON 结构。CLI 生成的 compile input 是唯一可编译结构;未知字段、孤立步骤或过期 case 快照必须阻断。
|
|
8
|
+
|
|
9
|
+
## 生成顺序
|
|
10
|
+
|
|
11
|
+
1. 从线上最新配置和已审核用例生成步骤清单,并运行 automation status。
|
|
12
|
+
2. `reusable` 步骤直接保留;仅对 `regenerate_required` 步骤由 LLM 使用 `Chrome` 插件受控录制,禁止使用 Record & Replay 或 `event_stream`。
|
|
13
|
+
3. 对新录制步骤生成 `recording_only` 报告和 review-required 候选;平台源码和线上配置用于补充校验。
|
|
14
|
+
4. 生成 `surface`、页面指纹、动作、断言、数据契约和写入回读。
|
|
15
|
+
5. 在全新 browser context 独立回放,修复后重新回放,直到脚本稳定。
|
|
16
|
+
6. 执行语义 lint,而非只检查 JSON 结构。
|
|
17
|
+
7. 标记 publishability,完成 review 后再 compile。
|
|
18
|
+
|
|
19
|
+
新生成页面步骤建议保留 `browser_recording_report:<path>#sha256=<hash>`。缺少或格式不完整时输出 warning;报告始终只能声明 `recording_only`,不能声明正式通过。
|
|
20
|
+
|
|
21
|
+
## 最小必要 Lint
|
|
22
|
+
|
|
23
|
+
Hard lint 只保护页面动作安全、mutation 防重、身份边界、必填字段、核心断言、资产哈希和本轮证据真实性。来源措辞、时间格式、缺省 PC surface、未使用 binding 和 UX 完整性进入 warning 或 review。
|
|
24
|
+
|
|
25
|
+
## Publishability
|
|
26
|
+
|
|
27
|
+
`ready` 表示身份、样本、selector、路由、权限、控件、下载和 DOM 均可确定执行,且 `blocked_reasons` 为空。
|
|
28
|
+
|
|
29
|
+
任何未解决项必须标记 `blocked` 并列出结构化原因。`issue_count=0` 只说明结构正确,不代表可发布;blocked step 不能 compile、review 为通过或 promote。
|
|
30
|
+
|
|
31
|
+
## 批量熔断
|
|
32
|
+
|
|
33
|
+
发现连续的标题-only 脚本、相同 selector 缺失、相同路由猜测或相同身份阻塞时,立即停止批次。先修生成规则,再重新初始化受影响步骤,避免继续扩大错误资产。
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# 批量生成与执行
|
|
2
|
+
|
|
3
|
+
## 隔离单元
|
|
4
|
+
|
|
5
|
+
批量任务按 scenario 或 flow 分成独立单元。每个单元分别执行 init、生成、lint、review、promote 和 scoped run;另一个流程的 case、脚本或阻塞项不得阻断本单元。
|
|
6
|
+
|
|
7
|
+
共享输出只能作为候选输入。多 Agent 结果必须由主流程 canonicalize、去重、核对 case 快照和 publishability 后才能进入 CLI compile。
|
|
8
|
+
|
|
9
|
+
## 批次状态
|
|
10
|
+
|
|
11
|
+
批次矩阵至少记录:场景、case 数、脚本数、ready 数、blocked 数、阻塞原因、PC/H5 覆盖、lint、review、promote 和 run 状态。不能用总 `issue_count=0` 覆盖场景级 blocked。
|
|
12
|
+
|
|
13
|
+
## 熔断与恢复
|
|
14
|
+
|
|
15
|
+
同类生成缺陷连续出现时停止剩余生成,修复规则并回归一个代表场景后再恢复。已生成但未 review 的资产全部重新 lint;不得只修最后一个失败场景。
|
|
16
|
+
|
|
17
|
+
批量执行仍为每个 scoped run 创建独立 manifest、lease、data profile、automation snapshot 和证据目录。历史通过不构成本轮跳过条件;用户要求重跑时必须执行选中 case 的全部步骤。
|