bpmax-cli 0.2.1-beta.22 → 0.2.1-beta.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/bin.js +7075 -5936
  2. package/dist/bin.js.map +1 -1
  3. package/package.json +3 -1
  4. package/skills/bpmax-e2e-flow-test-operator/SKILL.md +19 -9
  5. package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +82 -7
  6. package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +5 -4
  7. package/skills/bpmax-builder-shared/__pycache__/base_url.cpython-313.pyc +0 -0
  8. package/skills/bpmax-builder-shared/__pycache__/template_script_hard_rules.cpython-313.pyc +0 -0
  9. package/skills/bpmax-dataset-template-editor/scripts/__pycache__/dataset_editor_common.cpython-313.pyc +0 -0
  10. package/skills/bpmax-dataset-template-editor/tests/__pycache__/test_dataset_editor.cpython-313.pyc +0 -0
  11. package/skills/bpmax-e2e-flow-test-operator/scripts/__pycache__/bpmax_session.cpython-313.pyc +0 -0
  12. package/skills/bpmax-e2e-flow-test-operator/scripts/__pycache__/e2e_state.cpython-313.pyc +0 -0
  13. package/skills/bpmax-e2e-flow-test-operator/scripts/__pycache__/flow_api_matrix.cpython-313.pyc +0 -0
  14. package/skills/bpmax-e2e-flow-test-operator/scripts/__pycache__/flow_filter_fields.cpython-313.pyc +0 -0
  15. package/skills/bpmax-e2e-flow-test-operator/scripts/__pycache__/flow_form_runtime.cpython-313.pyc +0 -0
  16. package/skills/bpmax-e2e-flow-test-operator/scripts/__pycache__/flow_test_profile.cpython-313.pyc +0 -0
  17. package/skills/bpmax-e2e-flow-test-operator/tests/__pycache__/test_negative_sale_api_tools.cpython-313.pyc +0 -0
  18. package/skills/bpmax-flow-template-editor/scripts/__pycache__/flow_template_editor_common.cpython-313.pyc +0 -0
  19. package/skills/bpmax-flow-template-editor/scripts/__pycache__/submit_flow_template.cpython-313.pyc +0 -0
  20. package/skills/bpmax-flow-template-editor/tests/__pycache__/test_flow_template_editor.cpython-313.pyc +0 -0
  21. package/skills/bpmax-form-template-editor/scripts/__pycache__/form_template_editor_common.cpython-313.pyc +0 -0
  22. package/skills/bpmax-form-template-editor/scripts/__pycache__/submit_form_template.cpython-313.pyc +0 -0
  23. package/skills/bpmax-form-template-editor/tests/__pycache__/test_form_template_editor.cpython-313.pyc +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmax-cli",
3
- "version": "0.2.1-beta.22",
3
+ "version": "0.2.1-beta.23",
4
4
  "description": "CLI for BPMAX environments with multi-profile config and local login callback flow",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,6 +10,8 @@
10
10
  "dist",
11
11
  "scripts/install-skills.mjs",
12
12
  "skills",
13
+ "!skills/**/__pycache__/**",
14
+ "!skills/**/*.py[cod]",
13
15
  "README.md"
14
16
  ],
15
17
  "scripts": {
@@ -45,9 +45,11 @@ description: "用于在 BPMAX 中做全链路流程测试、场景回归、前
45
45
 
46
46
  ## `.ai_test` 资产门禁
47
47
  - 可复用测试用例统一放在 `.ai_test/`;运行状态放在 `.codex/tmp/e2e_states/`;不要混用。
48
+ - 每个场景必须同时有 `cases.csv` 和 `case_steps.csv`:前者只保存用例级元数据,后者必须让每个测试步骤独占一行。禁止继续把打开、填写、提交、审批和验证聚合到一个 `steps` 单元格。
49
+ - `case_steps.csv` 每行只能有一个用户动作,并写清 actor、runner、action、target、input_data、即时 expected_result 和 evidence_required;不能用“然后/接着/再”把多步塞进一行。
48
50
  - 生成、检查、更新用例资产前,必须先 latest sync,并把证明写入 `.codex/tmp/ai_test_suite/latest-<env>-proof.json`。缺少 `--latest-proof` 时,CLI 必须拒绝 lint/index/draft-update/promote。
49
51
  - `.ai_test` suite 的 lint、review init/repair/explain、draft-update、promote 都使用 `bpmax-cli test-suite` 的 TypeScript 实现;不要新增或调用旧 Python suite 脚本作为主路径。
50
- - 每个场景目录必须有 `README.md`、`cases.csv`;promote 前必须有合格 `review.json`,且 `unresolved.P0=0`、`unresolved.P1=0`。
52
+ - 每个场景目录必须有 `README.md`、`cases.csv`、`case_steps.csv`;promote 前必须有合格 `review.json`,`execution_operability.step_judgments` 覆盖全部 active step,且 `unresolved.P0=0`、`unresolved.P1=0`。
51
53
  - `cases.csv` 字段、review schema、copy diff、promote 流程见 `references/ai-test-suite.md`;不要凭记忆手写 `review.json`,优先用 `bpmax-cli test-suite review explain/init/repair`。
52
54
  - 正式 E2E 用例的 `prep_data` 必须包含 `precondition_check=`、`browser_tool=`、`live_draft=`、`state_file=` 或 `report_run=`,并声明 `resume_policy=full_rerun|checkpoint|evidence_only`。
53
55
  - `state_file=` / `report_run=` 不得写死历史 run 或历史日期;历史状态、历史报告、历史截图只能作为历史对照,不能作为本轮 pass evidence。
@@ -57,7 +59,7 @@ description: "用于在 BPMAX 中做全链路流程测试、场景回归、前
57
59
 
58
60
  ## 报告与重跑隔离
59
61
  - 单次执行报告必须在 `.ai_test/report/<YYYYMMDD-NNN>/`,截图必须在同一 run 的 `screenshots/` 下;`.codex/docs/` 只放复盘、长周期总结或交付版文档。
60
- - 报告必须写 `planned_cases:`、`executed_cases:`、`precondition_check:`、`state_file:`、`report_run:`、`browser_tool:`、`rerun_policy:`,并逐条对账 planned 与 executed。
62
+ - 报告必须写 `planned_cases:`、`executed_cases:`、`planned_steps:`、`executed_steps:`、`execution_manifest:`、`precondition_check:`、`state_file:`、`report_run:`、`browser_tool:`、`rerun_policy:`,并逐条对账 planned 与 executed。
61
63
  - `result:` 只能使用明确状态:完整通过用 `pass` / `pass-with-warnings`,未完整执行用 `partial` / `stage` / `blocked` / `diagnostic`,失败用 `fail`;不得自造 `all_green` 等同义词绕过门禁。
62
64
  - `browser_tool:` 只能写本轮实际可用且执行过的 `Chrome DevTools`、`DevTools`、`Playwright` 或 `AppleScript`,不能写“浏览器工具”、`unavailable`、`not Playwright` 等模糊或否定文本。
63
65
  - 完整页面结论的 `runtime_url:` 必须是本轮真实 BPMAX 页面路由,不能是 `/api`、`/bpmax` 或示例域名;URL 中存在 project/step id 时必须与 `project_id:` / `step_id:` 一致。动作与可见断言不得写 TODO、API readback 或 JSON response 占位文本。
@@ -66,16 +68,24 @@ description: "用于在 BPMAX 中做全链路流程测试、场景回归、前
66
68
  - 用户明确要求“重新运行测试用例”“全量重跑”“重新回归”时,报告必须写 `rerun_policy: full_rerun` 并逐 case 重新执行。禁止直接查找旧结果、旧报告、旧状态文件或旧截图来填充本轮 `executed_cases`、pass 结论或页面证据。
67
69
  - `full_rerun` 报告的 `run_id:` 必须等于当前报告目录名;`state_file:`、`precondition_check:`、`report_run:` 必须指向本轮 run 或本轮日期;截图文件必须位于本轮 `screenshots/` 且修改时间落在 `started_at` / `finished_at` 时间窗内。
68
70
  - 本轮截图必须是可解析且尺寸至少 100x80 的真实 PNG;改后缀的文本文件、空白占位图或损坏图片不能作为 pass evidence。
71
+ - 正式 browser 步骤的 evidence JSON 必须写当前 `case_id`、`case_step_id`、`browser_verified: true`、`runtime_scope: page|project|step`、真实 `runtime_url`、本轮 PNG 的 `screenshot` 路径和非空 `assertions`,且所有 assertion 都是 `passed: true`;要求 DOM 时还必须写可定位的 `dom_snapshot`。仅自声明 `browser_verified: true` 不算证据。
72
+ - `runtime_scope=page` 用于首页、列表、搜索等非项目页面,不要求业务 ID;`project` 必须有数字 `project_id`;`step` 必须同时有数字 `project_id` 和业务 `step_id`。测试用例的 `step_no` 绝不能冒充业务 step ID。
73
+ - evidence 必须声明 `runtime_environment: profile|local-browser`。`profile` 模式下 `runtime_url` origin 必须等于 manifest 的 `profile_origin`;源码本地联调必须显式使用 `local-browser`,且 URL 只能是 localhost/127.0.0.1/::1,不能把远端 profile 名伪装成本地页面身份。
74
+ - execution manifest 由 CLI 单写者管理,禁止 agent 手工覆盖、恢复或编辑 JSON。并发 record 会触发 `test_suite.run.concurrent_write`,回滚旧 manifest 会触发 `test_suite.run.manifest_rollback`。
75
+ - 每一步必须重新截图;同一 run 内不同 browser 步骤的截图内容完全相同会被视为截图复用并阻断。无视觉变化的检查应改成有明确 source evidence 的 `observe` 步骤。
69
76
  - `checkpoint` / `evidence_only` 只能给局部或对照结论。每个 `executed_cases` 中的通过用例,都必须在结果表、截图 alt/path、项目 ID、step ID 或本轮证据路径中能定位到当前 case。
70
77
 
71
78
  ## 标准执行流
72
- 1. 查 memory:搜索业务名、`flow_type`、模板、数据集、上次状态和已知坑点;不要把完整 JSON 贴给用户。
73
- 2. 准备真实业务样本:确认业务对象、主数据关系、边界值、审批人、权限、页面入口和预期业务后果。
74
- 3. 判断路径:完整链路走真实页面;非完整链路或离线摸底可接口优先,但必须标明证据边界。
75
- 4. 初始化/续写状态:优先用 `references/state-schema.md` 定义的字段,记录项目 ID、step ID、样本、证据、问题和下一步。
76
- 5. 跑场景:记录 `pass` / `fail` / `blocked`,失败先分清配置、环境、旧样本、权限、缓存或测试资产问题。
77
- 6. 修复闭环:修配置回到对应 skill,不在本 skill 重复实现细节;修完用新样本或已发布 live 重新回归。
78
- 7. 输出报告:显式区分 `已更新测试资产`、`已执行浏览器回归`、`发现需配置修复但尚未执行`。
79
+ 1. 查 memory:搜索业务名、`flow_type`、模板、数据集、上次状态和已知坑点;不要把完整 JSON 贴给用户。CLI 出现 skills out-of-sync notice 时,源码验证必须显式读取当前仓库 skill,正式分发前必须 update/install skills 消除版本差异。
80
+ 2. 强制从用例启动:运行 `bpmax-cli test-suite run start --scenario <id> --case-id <id> ...` 生成本轮 execution manifest。不得先临场打开浏览器或直接运行正式 `bpmax-cli e2e`。源码联调必须额外传 `--source-skill <repo>/skills/bpmax-e2e-flow-test-operator/SKILL.md`;分发版默认硬检查安装 skill stamp 与 CLI 版本一致。
81
+ `run start` 会同时生成 `<scenario_id>.md` 报告草稿;执行过程中必须持续更新该文件,不要另找历史报告套用。
82
+ 3. 执行当前步骤:只执行 `test-suite run next` 返回的当前 `case_id/case_step_id`;正式 `e2e` 命令必须带 `--execution-manifest --case-id --case-step-id`。
83
+ 4. 准备真实业务样本:确认业务对象、主数据关系、边界值、审批人、权限、页面入口和预期业务后果。
84
+ 5. 逐步记录:每完成一个步骤立即运行 `test-suite run record`,写入本轮证据后才能获取下一步;不得跳步或补写旧证据。record 会按 manifest 自动同步场景报告;若返回 `report_sync.ok=false`,必须执行返回的 `test-suite run report-sync` 修复命令,不得手工提前写 pass。
85
+ 6. 失败闭环:记录 `fail` / `blocked` 后停止后续步骤,先分清配置、环境、旧样本、权限、缓存或测试资产问题;修配置回到对应 skill。
86
+ 7. 输出报告:报告必须引用本轮 `execution-manifest.json`,逐条对账 planned/executed case 和 step,并显式区分测试资产、浏览器回归与未完成修复。
87
+
88
+ 排障只能显式使用 `--diagnostic`。该模式可以不带 manifest,但输出不能进入正式 pass evidence,也不能用来绕过用例链路。
79
89
 
80
90
  ## 配置修复路由
81
91
  - 流程节点、脚本、条件跳转、消息、自由打回:读 [$bpmax-flow-template-editor](../bpmax-flow-template-editor/SKILL.md)。
@@ -8,6 +8,7 @@
8
8
  <scenario_id>/
9
9
  README.md
10
10
  cases.csv
11
+ case_steps.csv
11
12
  review.json
12
13
  .copy_diff/
13
14
  last.diff
@@ -61,10 +62,10 @@ owner_skill: bpmax-e2e-flow-test-operator
61
62
 
62
63
  ## cases.csv 字段
63
64
 
64
- 字段必须完全一致:
65
+ `cases.csv` 只保存用例级元数据,字段必须完全一致:
65
66
 
66
67
  ```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
+ case_id,priority,type,title,preconditions,config_basis,prep_data,expected_result,test_data,roles,evidence_required,tags,status,updated_at
68
69
  ```
69
70
 
70
71
  字段说明:
@@ -76,7 +77,6 @@ case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_
76
77
  - `preconditions`:前置数据和环境。
77
78
  - `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
79
  - `prep_data`:结构化前置数据准备,至少包含 `账号=`、`入口=`、`样本=`、`准备操作=`、`预期=`、`precondition_check=`、`browser_tool=`、`live_draft=`,并提供 `state_file=` 或 `report_run=`。
79
- - `steps`:可读步骤,用 ` > ` 分隔。
80
80
  - `expected_result`:明确可判定结果。
81
81
  - `test_data`:客户真实业务测试数据说明,不写 token、cookie、手机号、密码或完整 payload。必须使用英文分号分隔的 `key=value`,至少包含 `业务场景=`、`业务逻辑=`、`样本数据=`、`合理性=`。
82
82
  - `roles`:涉及角色,用逗号分隔。
@@ -85,11 +85,83 @@ case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_
85
85
  - `status`:`active`、`deprecated`、`draft`。
86
86
  - `updated_at`:`YYYY-MM-DD`。
87
87
 
88
- 示例:
88
+ `case_steps.csv` 每行只能描述一个测试步骤:
89
89
 
90
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和新机库存;precondition_check=.codex/tmp/e2e_states/customer-exchange.json;browser_tool=Chrome DevTools;live_draft=live;state_file=.codex/tmp/e2e_states/customer-exchange.json;report_run=.ai_test/report/<run_id>;resume_policy=full_rerun;login_profile=store_staff,dealer_owner;mock_user=store_staff后切dealer_owner;unmock_done=测试结束恢复管理员",发起换货 > 填写旧机 > 填写新机 > 提交 > 审批通过,旧机入库,新机出库,项目终态正确,"业务场景=客户换货补录;业务逻辑=旧机SN应回收入库且新机库存应出库并进入审批链;样本数据=旧机SN为已售可回收库存,新机SN为当前门店可用库存;合理性=符合客户退换货业务中一退一发和经销商负责人审批逻辑",store_staff,dealer_owner,screenshot+project_detail+每个角色独立截图,"core,inventory,approval",active,2026-06-18
91
+ case_id,step_id,step_no,actor,runner,action,target,input_data,expected_result,evidence_required
92
+ C001,S001,1,store_staff,browser,打开客户换货创建页面,客户换货创建页,无,页面展示换货表单,screenshot+url+dom
93
+ C001,S002,2,store_staff,browser,填写客户换货字段,换货表单旧机和新机字段,真实旧机SN和新机SN,页面显示真实业务数据,screenshot+dom
94
+ C001,S003,3,store_staff,e2e_create_page,点击提交客户换货申请,创建页提交按钮,无,项目创建成功并进入审批链,screenshot+project_detail
95
+ C001,S004,4,dealer_owner,e2e_step_run,审批通过客户换货申请,经销商负责人审批环节,审批意见为同意,审批完成并进入终态,step_context+submit+readback
96
+ ```
97
+
98
+ 规则:
99
+
100
+ - `runner` 只能是 `browser`、`e2e_create_page`、`e2e_step_run`、`observe`。
101
+ - `step_no` 从 1 开始连续递增;`step_id` 在 case 内唯一。
102
+ - `actor` 必须属于 cases.csv 的 roles,系统观察步骤可写 `system`。
103
+ - `action` 一行只能有一个动作,禁止 `>`、连续编号和“然后/接着/再然后”。
104
+ - `target`、`input_data`、即时 `expected_result`、`evidence_required` 都必须明确;无输入写“无”。
105
+
106
+ 旧聚合格式使用以下命令迁移到 draft,生成的 `REVIEW_REQUIRED` 字段必须逐行补齐:
107
+
108
+ ```bash
109
+ bpmax-cli test-suite steps migrate --scenario <scenario_id> --draft-root .ai_test/suite_draft --latest-proof <proof.json> --format json
110
+ ```
111
+
112
+ 正式执行必须先启动 execution manifest:
113
+
114
+ ```bash
115
+ bpmax-cli test-suite run start --scenario <scenario_id> --case-id <case_id> --profile <profile> --latest-proof <proof.json> --format json
116
+ bpmax-cli test-suite run next --manifest .ai_test/report/<run_id>/execution-manifest.json --format json
117
+ 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
118
+ ```
119
+
120
+ 源码 CLI 联调时显式增加:
121
+
122
+ ```bash
123
+ --source-skill <bpmax-cli-repo>/skills/bpmax-e2e-flow-test-operator/SKILL.md
124
+ ```
125
+
126
+ 不传该参数时,`run start` 会硬检查已安装 skill stamp 必须与当前 CLI 版本一致;出现 `test_suite.run.skills_out_of_sync` 时先执行 `bpmax-cli update`,不得混用旧 skill。
127
+
128
+ 正式 `bpmax-cli e2e` 命令必须带 manifest/case/step;只有排障可显式使用 `--diagnostic`,且不能形成通过结论。
129
+
130
+ 正式 browser step 的证据 JSON 最小结构:
131
+
132
+ ```json
133
+ {
134
+ "case_id": "C001",
135
+ "case_step_id": "S001",
136
+ "browser_verified": true,
137
+ "runtime_scope": "page",
138
+ "runtime_environment": "profile",
139
+ "runtime_url": "https://example.com/w:workspace/project/123",
140
+ "screenshot": "../../screenshots/C001-S001.png",
141
+ "assertions": [{ "name": "page_loaded", "passed": true }],
142
+ "dom_snapshot": "dom.txt"
143
+ }
144
+ ```
145
+
146
+ 证据必须位于本轮 report 目录。仅写 `browser_verified: true`、引用历史截图、复用前一步相同截图、断言为空/失败,或在要求 DOM 时缺少 `dom_snapshot`,都不能记录为 pass。
147
+
148
+ `runtime_scope` 规则:`page` 证明首页、列表、搜索等页面,不要求项目 ID;`project` 必须提供数字 `project_id`;`step` 必须同时提供数字 `project_id` 和业务 `step_id`。禁止用 `case_steps.csv.step_no` 填业务 `step_id`。
149
+
150
+ `runtime_environment=profile` 时,`runtime_url` origin 必须与 run start 固化的 `profile_origin` 一致。源码本地浏览器测试使用 `runtime_environment=local-browser`,并且只允许 loopback URL。manifest 只能由 CLI record/append 更新;禁止手工回滚,禁止多个 agent 同时写同一 manifest。
151
+
152
+ 最后一步 record 后 CLI 会从 manifest 自动同步 `<scenario_id>.md`。需要重试时使用:
153
+
154
+ ```bash
155
+ bpmax-cli test-suite run report-sync --manifest .ai_test/report/<run_id>/execution-manifest.json --format json
156
+ ```
157
+
158
+ `execution_plan_generated`、`browser_execution_pending`、`bootstrap_required` 表示尚未形成正式执行证据;只有真实提交或正式记录后才能出现 `execution_evidence_recorded`。不得依据 plan/template/dry-run 状态推进用例结论。
159
+
160
+ 旧版聚合示例已废弃;以下是用例级示例:
161
+
162
+ ```csv
163
+ case_id,priority,type,title,preconditions,config_basis,prep_data,expected_result,test_data,roles,evidence_required,tags,status,updated_at
164
+ 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=.codex/tmp/e2e_states/customer-exchange.json;browser_tool=Chrome DevTools;live_draft=live;state_file=.codex/tmp/e2e_states/customer-exchange.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
93
165
  ```
94
166
 
95
167
  ## latest gate
@@ -313,6 +385,9 @@ finished_at: 2026-06-18T11:00:00+08:00
313
385
 
314
386
  planned_cases: C001,C002,C003
315
387
  executed_cases: C001,C002,C003
388
+ planned_steps: C001/S001,C001/S002,C002/S001,C003/S001
389
+ executed_steps: C001/S001,C001/S002,C002/S001,C003/S001
390
+ execution_manifest: execution-manifest.json
316
391
  precondition_check: .codex/tmp/e2e_states/customer-exchange-20260618.json
317
392
  state_file: .codex/tmp/e2e_states/customer-exchange-20260618.json
318
393
  report_run: .ai_test/report/20260618-001
@@ -356,7 +431,7 @@ bpmax-cli test-suite lint-report --root .ai_test/report
356
431
  ```
357
432
 
358
433
  报告 lint 会硬检查:
359
- - `planned_cases:` 和 `executed_cases:` 必须存在且逐条对账;planned 中未出现在 executed 的用例必须有 blocked/not run 原因,报告结论降级为阶段/局部。
434
+ - `planned_cases:` / `executed_cases:` 与 `planned_steps:` / `executed_steps:` 必须存在并逐条对账;`execution_manifest:` 必须指向本轮报告目录中的 manifest。任何未登记步骤、跳步或缺证据步骤都会阻断完整通过。
360
435
  - `run_id:` 必须等于当前 `.ai_test/report/<YYYYMMDD-NNN>/` 目录名。
361
436
  - `precondition_check:`、`state_file:`、`report_run:`、`browser_tool:`、`rerun_policy:` 必须存在。
362
437
  - `rerun_policy: full_rerun` 表示本轮重新运行,不能直接引用旧结果、旧报告、旧状态文件或旧截图填充本轮 `executed_cases` 和 pass 结论。
@@ -146,7 +146,7 @@ bpmax-cli e2e cache refresh --flow-id <flow_id> --profile <profile> --format jso
146
146
  - 正式用例:`.ai_test/suite/<scenario_id>/`
147
147
  - 待确认草稿:`.ai_test/suite_draft/<scenario_id>/`
148
148
  - 执行报告:`.ai_test/report/<YYYYMMDD-NNN>/`
149
- - 每个场景目录必须包含 `README.md` 和 `cases.csv`;promote 前还必须包含合格 `review.json`,证明已完成多视角 review 且未解决 P0/P1 为 0。
149
+ - 每个场景目录必须包含 `README.md`、`cases.csv` 和 `case_steps.csv`;`cases.csv` 不再保存聚合 steps,`case_steps.csv` 必须一行一个动作。promote 前还必须包含合格 `review.json`,且 execution_operability 逐步 review、未解决 P0/P1 为 0。
150
150
  - `review.json` 不要凭记忆手写结构。优先运行:
151
151
  - `bpmax-cli test-suite review explain --format json` 查看完整 schema。
152
152
  - `bpmax-cli test-suite review init --scenario <scenario_id> --draft-root .ai_test/suite_draft --latest-proof <proof.json> --format json` 生成最小合法草稿。
@@ -156,7 +156,8 @@ bpmax-cli e2e cache refresh --flow-id <flow_id> --profile <profile> --format jso
156
156
  - `perspectives` 必须有 `structure_lint`、`business_coverage`、`execution_operability`、`config_consistency`。
157
157
  - `config_consistency` 必须有 `case_judgments` 和 `missing_case_review`;每条 judgment 必须含 `case_id`、`status`、`config_basis_checked`、`evidence`。
158
158
  - `unresolved.P0` 和 `unresolved.P1` 必须都是 `0`。
159
- - `cases.csv` 字段必须固定为:`case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_result,test_data,roles,evidence_required,tags,status,updated_at`。
159
+ - `cases.csv` 字段必须固定为:`case_id,priority,type,title,preconditions,config_basis,prep_data,expected_result,test_data,roles,evidence_required,tags,status,updated_at`。
160
+ - `case_steps.csv` 字段必须固定为:`case_id,step_id,step_no,actor,runner,action,target,input_data,expected_result,evidence_required`。禁止把多个动作聚合在一行。
160
161
  - `config_basis` 必须指向真实存在的配置或能力依据,并说明覆盖原因。配置仓库使用 `think_*`、`.ai_test/`、`.codex/skills/`;`bpmax-cli` 包内能力可引用 `skills/`。
161
162
  - 每条正式 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` 记录时,只能进入准备阶段,不能写正式执行结论。
162
163
  - `state_file=` / `report_run=` 不得写死历史 run 或历史日期。正式用例模板应使用 `<run_id>` / `<date>` 占位,执行时再生成本轮独立状态文件和报告目录;历史状态、历史报告、历史截图只能作为“历史对照”,不能作为本轮 pass evidence。
@@ -193,7 +194,7 @@ bpmax-cli test-suite lint-report --root .ai_test/report
193
194
 
194
195
  ### 报告完整性门禁
195
196
  - 单次执行报告必须位于 `.ai_test/report/<YYYYMMDD-NNN>/`,截图必须位于同一 run 的 `screenshots/` 下;`.codex/docs/` 只放复盘、长周期总结或交付版文档,并引用 `run_id` 和原始报告路径。
196
- - 场景报告必须写 `planned_cases:`、`executed_cases:`、`precondition_check:`、`state_file:`、`report_run:`、`browser_tool:`、`rerun_policy:`。`planned_cases` 与 `executed_cases` 必须逐条对账;有未执行用例时只能写阶段/局部结论,不能写完整通过。
197
+ - 场景报告必须写 `planned_cases:`、`executed_cases:`、`planned_steps:`、`executed_steps:`、`execution_manifest:`、`precondition_check:`、`state_file:`、`report_run:`、`browser_tool:`、`rerun_policy:`。case 与 step 都必须逐条对账;有未执行步骤时只能写阶段/局部结论。
197
198
  - 报告出现 `not run`、`未执行`、`跳过` 时,`result:` 必须降级为 `partial`、`stage`、`blocked` 或明确“阶段/局部/不完整”。没有用户确认缩小范围时,不得把跳过用例合并进完整结论。
198
199
  - 没有合规浏览器工具或页面证据时,必须使用浏览器阻塞模板:`browser_status: blocked`,并写“页面结论停止”;不得用 API/readback 证据冒充页面验证。
199
200
  - 报告里写“页面通过 / 浏览器回归完成 / 真实页面已验证 / 完整链路通过”时,必须同时有 `browser_tool:`、本 run 的本地截图证据和结构化运行态字段:`runtime_url:`、`runtime_user:` 或 `runtime_profile:`、`browser_action_log:`、`visible_assertions:`、`project_id:` 或 `step_id:`。
@@ -417,7 +418,7 @@ PYTHON_BIN=./venv/bin/python
417
418
  - 再导入飞书文档
418
419
  - 最后按用户指定手机号或邮箱授权
419
420
 
420
- 旧 `scripts/e2e_doc.py` 只允许生成接口/脚本诊断草稿,不能作为重新运行报告或完整 E2E 通过报告。正式报告必须创建 `.ai_test/report/<YYYYMMDD-NNN>/`,补齐 `run_id`、`rerun_policy`、`planned_cases`、`executed_cases`、`started_at`、`finished_at`、本轮 `screenshots/`,并运行 `bpmax-cli test-suite lint-report`。
421
+ 旧 `scripts/e2e_doc.py` 只允许生成接口/脚本诊断草稿,不能作为重新运行报告或完整 E2E 通过报告。正式报告必须创建 `.ai_test/report/<YYYYMMDD-NNN>/`,补齐 `run_id`、`rerun_policy`、case/step planned-executed 对账、`execution_manifest`、`started_at`、`finished_at`、本轮 `screenshots/`,并运行 `bpmax-cli test-suite lint-report`。
421
422
 
422
423
  ## 强制约束
423
424
  - 不要一开始就同时打开太多配置面;按“流程/表单/数据集/列表/筛选器/导航/测试”最小闭环推进。