bpmax-cli 0.2.1-beta.1 → 0.2.1-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -1
- package/dist/bin.js +1547 -255
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
- package/skills/bpmax-ai-taskbook/SKILL.md +5 -1
- package/skills/bpmax-approval-matrix/SKILL.md +4 -1
- package/skills/bpmax-blueprint-doc-workflow/SKILL.md +87 -0
- package/skills/bpmax-blueprint-doc-workflow/agents/openai.yaml +4 -0
- package/skills/bpmax-blueprint-doc-workflow/references/blueprint-structure.md +60 -0
- package/skills/bpmax-blueprint-doc-workflow/references/per-flow-required-structure.md +98 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-forbidden-term.xml +12 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-mermaid-codeblock.xml +12 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-boundary.xml +10 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-whiteboard.xml +10 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-pass.xml +55 -0
- package/skills/bpmax-blueprint-doc-workflow/scripts/lint_blueprint_doc.py +257 -0
- package/skills/bpmax-dataset-field-template-editor/SKILL.md +6 -3
- package/skills/bpmax-dataset-template-editor/SKILL.md +12 -2
- package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +25 -1
- package/skills/bpmax-e2e-flow-test-operator/SKILL.md +13 -0
- package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +25 -3
- package/skills/bpmax-flow-template-editor/SKILL.md +81 -5
- package/skills/bpmax-form-template-editor/SKILL.md +47 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Lint BPMAX blueprint Feishu Docx fetch output or XML.
|
|
3
|
+
|
|
4
|
+
The checker is intentionally structural. It does not try to prove business
|
|
5
|
+
correctness; it blocks the recurring blueprint failures that make a document
|
|
6
|
+
unusable for BPMAX implementation.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import argparse
|
|
12
|
+
import json
|
|
13
|
+
import re
|
|
14
|
+
import sys
|
|
15
|
+
from dataclasses import dataclass, field
|
|
16
|
+
from pathlib import Path
|
|
17
|
+
from typing import Iterable
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
DEFAULT_FORBID_TERMS = ["TODO", "待补充", "略", "后续完善", "代码块流程图"]
|
|
21
|
+
DEFAULT_REQUIRED_TERMS = [
|
|
22
|
+
"BPMAX 配置可实现",
|
|
23
|
+
"配置 + 脚本/API/现有插件",
|
|
24
|
+
"需定制插件/外部服务",
|
|
25
|
+
]
|
|
26
|
+
CORE_CHAPTER_TERMS = [
|
|
27
|
+
"蓝图定位与目标",
|
|
28
|
+
"BPMAX 实施总规则",
|
|
29
|
+
"总体业务架构",
|
|
30
|
+
"公共支撑配置",
|
|
31
|
+
"实现边界",
|
|
32
|
+
]
|
|
33
|
+
ACCEPTANCE_TERMS = ["验收", "风险", "待确认"]
|
|
34
|
+
FLOW_REQUIRED_TERMS = {
|
|
35
|
+
"业务目标与适用场景": ["业务目标与适用场景"],
|
|
36
|
+
"流程模板": ["流程模板"],
|
|
37
|
+
"开始节点": ["开始节点", "开始:", "创建"],
|
|
38
|
+
"创建表单": ["创建表单", "创建环节", "创建申请", "创建或导入", "初始表单"],
|
|
39
|
+
"环节配置": ["环节配置", "环节", "节点配置"],
|
|
40
|
+
"表单模板": ["表单模板", "字段"],
|
|
41
|
+
"流程数据集": ["流程数据集", "数据集", "写回"],
|
|
42
|
+
"视图入口": ["列表", "筛选", "详情", "看板", "入口", "视图"],
|
|
43
|
+
"自动化与 AI/agent": ["自动化", "AI", "agent", "Agent"],
|
|
44
|
+
"办结口径与下游联动": ["办结", "下游联动", "归档", "完成条件"],
|
|
45
|
+
"BPMAX 实现边界": DEFAULT_REQUIRED_TERMS,
|
|
46
|
+
}
|
|
47
|
+
AI_REQUIRED_TERMS = ["触发", "输入", "输出", "人工确认", "异常兜底"]
|
|
48
|
+
AI_FORBIDDEN_PATTERNS = [
|
|
49
|
+
r"AI[^。;\n]{0,30}自动(?:最终)?确认",
|
|
50
|
+
r"AI[^。;\n]{0,30}自动通过",
|
|
51
|
+
r"AI[^。;\n]{0,30}自动结案",
|
|
52
|
+
r"AI[^。;\n]{0,30}自动认证",
|
|
53
|
+
r"AI[^。;\n]{0,30}自动对账",
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@dataclass
|
|
58
|
+
class Finding:
|
|
59
|
+
level: str
|
|
60
|
+
code: str
|
|
61
|
+
message: str
|
|
62
|
+
flow: str | None = None
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
@dataclass
|
|
66
|
+
class FlowSection:
|
|
67
|
+
title: str
|
|
68
|
+
content: str
|
|
69
|
+
whiteboards: int = 0
|
|
70
|
+
mermaid_code_blocks: int = 0
|
|
71
|
+
missing: list[str] = field(default_factory=list)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def read_content(path: Path) -> str:
|
|
75
|
+
raw = path.read_text(encoding="utf-8")
|
|
76
|
+
stripped = raw.lstrip()
|
|
77
|
+
if stripped.startswith("{"):
|
|
78
|
+
data = json.loads(raw)
|
|
79
|
+
try:
|
|
80
|
+
return data["data"]["document"]["content"]
|
|
81
|
+
except KeyError as exc:
|
|
82
|
+
raise SystemExit(f"JSON input does not look like lark-cli docs +fetch output: missing {exc}") from exc
|
|
83
|
+
return raw
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def plain_text(xml: str) -> str:
|
|
87
|
+
text = re.sub(r"<[^>]+>", " ", xml)
|
|
88
|
+
text = text.replace("<", "<").replace(">", ">").replace("&", "&")
|
|
89
|
+
return re.sub(r"\s+", " ", text)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def has_any(text: str, terms: Iterable[str]) -> bool:
|
|
93
|
+
return any(term in text for term in terms)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def contains_forbidden_term(text: str, term: str) -> bool:
|
|
97
|
+
if term == "略":
|
|
98
|
+
return bool(re.search(r"(?<![\u4e00-\u9fffA-Za-z0-9])略(?![\u4e00-\u9fffA-Za-z0-9])", text))
|
|
99
|
+
return term in text
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def has_ai_final_decision_violation(text: str, pattern: str) -> bool:
|
|
103
|
+
for match in re.finditer(pattern, text):
|
|
104
|
+
snippet = match.group(0)
|
|
105
|
+
if any(negation in snippet for negation in ["不自动", "不能", "不得", "不会", "不可", "不直接"]):
|
|
106
|
+
continue
|
|
107
|
+
return True
|
|
108
|
+
return False
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def extract_title(xml: str) -> str:
|
|
112
|
+
match = re.search(r"<title(?:\s[^>]*)?>(.*?)</title>", xml, re.S)
|
|
113
|
+
return plain_text(match.group(1)).strip() if match else ""
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def extract_flows(xml: str) -> list[FlowSection]:
|
|
117
|
+
heading_re = re.compile(r"<h([1-3])[^>]*>(.*?)</h\1>", re.S)
|
|
118
|
+
matches = list(heading_re.finditer(xml))
|
|
119
|
+
flow_matches = []
|
|
120
|
+
for match in matches:
|
|
121
|
+
title = plain_text(match.group(2)).strip()
|
|
122
|
+
if re.search(r"流程[一二三四五六七八九十\d]+[::]", title):
|
|
123
|
+
flow_matches.append((match, title))
|
|
124
|
+
|
|
125
|
+
flows = []
|
|
126
|
+
for index, (match, title) in enumerate(flow_matches):
|
|
127
|
+
start = match.start()
|
|
128
|
+
end = flow_matches[index + 1][0].start() if index + 1 < len(flow_matches) else len(xml)
|
|
129
|
+
content = xml[start:end]
|
|
130
|
+
flows.append(
|
|
131
|
+
FlowSection(
|
|
132
|
+
title=title,
|
|
133
|
+
content=content,
|
|
134
|
+
whiteboards=len(re.findall(r"<whiteboard\b", content)),
|
|
135
|
+
mermaid_code_blocks=len(re.findall(r"<pre[^>]*lang=[\"']mermaid[\"']", content, re.I)),
|
|
136
|
+
)
|
|
137
|
+
)
|
|
138
|
+
return flows
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def add_error(findings: list[Finding], code: str, message: str, flow: str | None = None) -> None:
|
|
142
|
+
findings.append(Finding("error", code, message, flow))
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def lint(xml: str, require_terms: list[str], forbid_terms: list[str]) -> tuple[list[Finding], list[FlowSection]]:
|
|
146
|
+
findings: list[Finding] = []
|
|
147
|
+
text = plain_text(xml)
|
|
148
|
+
|
|
149
|
+
if not extract_title(xml):
|
|
150
|
+
add_error(findings, "DOC_TITLE_MISSING", "Document must contain a <title> block.")
|
|
151
|
+
|
|
152
|
+
for term in CORE_CHAPTER_TERMS:
|
|
153
|
+
if term not in text:
|
|
154
|
+
add_error(findings, "DOC_CORE_CHAPTER_MISSING", f"Missing core blueprint chapter term: {term}")
|
|
155
|
+
if not any(term in text for term in ACCEPTANCE_TERMS):
|
|
156
|
+
add_error(findings, "DOC_ACCEPTANCE_MISSING", "Missing acceptance/risk/confirmation chapter wording.")
|
|
157
|
+
|
|
158
|
+
for term in require_terms:
|
|
159
|
+
if term not in text:
|
|
160
|
+
add_error(findings, "REQUIRED_TERM_MISSING", f"Required term not found: {term}")
|
|
161
|
+
|
|
162
|
+
for term in forbid_terms:
|
|
163
|
+
if contains_forbidden_term(text, term):
|
|
164
|
+
add_error(findings, "FORBIDDEN_TERM_PRESENT", f"Forbidden term found: {term}")
|
|
165
|
+
|
|
166
|
+
for pattern in AI_FORBIDDEN_PATTERNS:
|
|
167
|
+
if has_ai_final_decision_violation(text, pattern):
|
|
168
|
+
add_error(findings, "AI_AUTO_FINAL_DECISION", f"AI final-decision wording matched pattern: {pattern}")
|
|
169
|
+
|
|
170
|
+
if re.search(r"<pre[^>]*lang=[\"']mermaid[\"']", xml, re.I):
|
|
171
|
+
add_error(findings, "MERMAID_CODE_BLOCK", "Final blueprint must use whiteboard blocks, not Mermaid code blocks.")
|
|
172
|
+
|
|
173
|
+
flows = extract_flows(xml)
|
|
174
|
+
if not flows:
|
|
175
|
+
add_error(findings, "FLOW_SECTION_MISSING", "No flow sections matching 流程X: were found.")
|
|
176
|
+
|
|
177
|
+
for flow in flows:
|
|
178
|
+
flow_text = plain_text(flow.content)
|
|
179
|
+
if flow.whiteboards < 1:
|
|
180
|
+
add_error(findings, "FLOW_WHITEBOARD_MISSING", "Flow section has no <whiteboard> diagram.", flow.title)
|
|
181
|
+
flow.missing.append("whiteboard")
|
|
182
|
+
if flow.mermaid_code_blocks:
|
|
183
|
+
add_error(findings, "FLOW_MERMAID_CODE_BLOCK", "Flow section contains Mermaid code block.", flow.title)
|
|
184
|
+
flow.missing.append("no mermaid code block")
|
|
185
|
+
|
|
186
|
+
for label, terms in FLOW_REQUIRED_TERMS.items():
|
|
187
|
+
if not has_any(flow_text, terms):
|
|
188
|
+
add_error(findings, "FLOW_REQUIRED_CONTENT_MISSING", f"Missing per-flow content: {label}", flow.title)
|
|
189
|
+
flow.missing.append(label)
|
|
190
|
+
|
|
191
|
+
if "AI" in flow_text or "agent" in flow_text or "Agent" in flow_text:
|
|
192
|
+
for term in AI_REQUIRED_TERMS:
|
|
193
|
+
if term not in flow_text:
|
|
194
|
+
add_error(findings, "FLOW_AI_DETAIL_MISSING", f"AI/agent section missing term: {term}", flow.title)
|
|
195
|
+
flow.missing.append(f"AI {term}")
|
|
196
|
+
|
|
197
|
+
return findings, flows
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def build_report(findings: list[Finding], flows: list[FlowSection], source: Path) -> dict:
|
|
201
|
+
errors = [f for f in findings if f.level == "error"]
|
|
202
|
+
return {
|
|
203
|
+
"ok": not errors,
|
|
204
|
+
"source": str(source),
|
|
205
|
+
"error_count": len(errors),
|
|
206
|
+
"flow_count": len(flows),
|
|
207
|
+
"flows": [
|
|
208
|
+
{
|
|
209
|
+
"title": flow.title,
|
|
210
|
+
"whiteboards": flow.whiteboards,
|
|
211
|
+
"mermaid_code_blocks": flow.mermaid_code_blocks,
|
|
212
|
+
"missing": flow.missing,
|
|
213
|
+
}
|
|
214
|
+
for flow in flows
|
|
215
|
+
],
|
|
216
|
+
"findings": [finding.__dict__ for finding in findings],
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def main() -> int:
|
|
221
|
+
parser = argparse.ArgumentParser(description="Lint BPMAX blueprint Feishu Docx content.")
|
|
222
|
+
parser.add_argument("--source", required=True, help="Path to lark-cli fetch JSON output or XML content.")
|
|
223
|
+
parser.add_argument("--json-report", help="Optional path to write a JSON lint report.")
|
|
224
|
+
parser.add_argument("--require-term", action="append", default=[], help="Additional required term. Repeatable.")
|
|
225
|
+
parser.add_argument("--forbid-term", action="append", default=[], help="Additional forbidden term. Repeatable.")
|
|
226
|
+
args = parser.parse_args()
|
|
227
|
+
|
|
228
|
+
source = Path(args.source)
|
|
229
|
+
xml = read_content(source)
|
|
230
|
+
require_terms = DEFAULT_REQUIRED_TERMS + args.require_term
|
|
231
|
+
forbid_terms = DEFAULT_FORBID_TERMS + args.forbid_term
|
|
232
|
+
findings, flows = lint(xml, require_terms, forbid_terms)
|
|
233
|
+
report = build_report(findings, flows, source)
|
|
234
|
+
|
|
235
|
+
if args.json_report:
|
|
236
|
+
Path(args.json_report).write_text(json.dumps(report, ensure_ascii=False, indent=2), encoding="utf-8")
|
|
237
|
+
|
|
238
|
+
status = "PASS" if report["ok"] else "FAIL"
|
|
239
|
+
print(f"BPMAX blueprint lint: {status}")
|
|
240
|
+
print(f"Source: {source}")
|
|
241
|
+
print(f"Flows: {report['flow_count']}")
|
|
242
|
+
for flow in report["flows"]:
|
|
243
|
+
missing = ", ".join(flow["missing"]) if flow["missing"] else "none"
|
|
244
|
+
print(f"- {flow['title']}: whiteboards={flow['whiteboards']}, missing={missing}")
|
|
245
|
+
if report["findings"]:
|
|
246
|
+
print("Findings:")
|
|
247
|
+
for finding in report["findings"]:
|
|
248
|
+
prefix = f"[{finding['level']}] {finding['code']}"
|
|
249
|
+
if finding.get("flow"):
|
|
250
|
+
prefix += f" ({finding['flow']})"
|
|
251
|
+
print(f"- {prefix}: {finding['message']}")
|
|
252
|
+
|
|
253
|
+
return 0 if report["ok"] else 1
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
if __name__ == "__main__":
|
|
257
|
+
sys.exit(main())
|
|
@@ -404,6 +404,8 @@ return JSON.parse(ctx.value);
|
|
|
404
404
|
|
|
405
405
|
### 7. 提交与回读
|
|
406
406
|
- 当前版本 `dataset-field` adapter 支持编辑、新建和删除单个字段。复制或批量生成字段必须拆分成可审查的单字段 work 文件、lint 结果和 submit payload,再通过 typed CLI 的 create/submit/delete 路径逐项执行;尚未提供批量快捷命令时,不得改用旧脚本直提。
|
|
407
|
+
- 新建字段提交前必须由 CLI 本地 preflight 阻断缺字段,不要把低质量 payload 打到服务端:`payload.flow_type`、`payload.data_set_id`、`payload.source_table`、`payload.source_field`、`payload.source_fk` 都必须非空。若报错出现这些 `payload.*` 路径,先修 work/meta,不要把服务端“流程类型不能为空/来源表不能为空”当成远端问题。
|
|
408
|
+
- 批量 runner 或脚本包装 typed create 时,必须按“逐条独立状态”执行:每个字段单独记录 `field_key`、`work_file`、`submit_file`、`response_file`、`status`、`error`、`created_id`;支持 `--continue-on-error` 或等价策略继续处理后续 ready 字段,最后统一返回失败并保留成功/失败清单。不得因为第一条失败就丢失当前批次上下文。
|
|
407
409
|
|
|
408
410
|
- 旧 `submit_dataset_field.py` 只保留为结构参考,默认会硬失败;不得用它直写线上字段配置。
|
|
409
411
|
- 只有满足以下条件才允许真正执行提交请求:
|
|
@@ -413,8 +415,8 @@ return JSON.parse(ctx.value);
|
|
|
413
415
|
- `submitBuiltAt` 不早于最近一次 `workConfirmedAt`
|
|
414
416
|
- 只要 `work/<id>.json` 或 `submit/<id>.json` 被改动,已有确认默认失效,需要重新确认。
|
|
415
417
|
- 提交接口:
|
|
416
|
-
-
|
|
417
|
-
- 编辑:`
|
|
418
|
+
- 新建:`bpmax-cli config dataset-field create --id create:dataset-field --payload <submit.json> --confirm "submit dataset-field create:dataset-field" --response-out <response.json>`
|
|
419
|
+
- 编辑:`bpmax-cli config dataset-field submit --id <id> --payload <submit.json> --confirm "submit dataset-field <id>" --response-out <response.json>`
|
|
418
420
|
- 新建字段提交成功后,脚本必须先从响应里提取真实字段 `id`,回填到 `meta/<artifact-id>.json`,然后再执行 `GET /bpmax/data-set-field/:id` 做回读验证。
|
|
419
421
|
- 提交脚本会输出:
|
|
420
422
|
- `result/<id>.response.json`:提交响应
|
|
@@ -592,7 +594,8 @@ bpmax-cli config dataset-field export --id <id> --out .codex/tmp/dataset-field-e
|
|
|
592
594
|
bpmax-cli config dataset-field lint --work .codex/tmp/dataset-field-editor/work/<file>.json
|
|
593
595
|
bpmax-cli config dataset-field build --work .codex/tmp/dataset-field-editor/work/<file>.json --meta .codex/tmp/dataset-field-editor/meta/<file>.meta.json --out .codex/tmp/dataset-field-editor/submit/<file>.json
|
|
594
596
|
bpmax-cli config dataset-field submit --id <id> --payload .codex/tmp/dataset-field-editor/submit/<file>.json
|
|
595
|
-
bpmax-cli config dataset-field submit --id <id> --payload .codex/tmp/dataset-field-editor/submit/<file>.json --confirm "submit dataset-field <id>"
|
|
597
|
+
bpmax-cli config dataset-field submit --id <id> --payload .codex/tmp/dataset-field-editor/submit/<file>.json --confirm "submit dataset-field <id>" --response-out .codex/tmp/dataset-field-editor/result/<file>.response.json
|
|
598
|
+
bpmax-cli config dataset-field create --id create:dataset-field --payload .codex/tmp/dataset-field-editor/submit/<create-file>.json --confirm "submit dataset-field create:dataset-field" --response-out .codex/tmp/dataset-field-editor/result/<create-file>.response.json
|
|
596
599
|
bpmax-cli config dataset-field verify --id <id> --expect .codex/tmp/dataset-field-editor/work/<file>.json
|
|
597
600
|
```
|
|
598
601
|
|
|
@@ -7,7 +7,7 @@ description: "用于在 BPMAX 的数据集页面中创建、编辑、发布、
|
|
|
7
7
|
|
|
8
8
|
## 写入路径硬约束
|
|
9
9
|
- 执行前必须先运行 `bpmax-cli config adapters --format json` 核对 `dataset`;只有 `build_status` 和 `submit_status` 都是 `supported` 时才允许进入 build/submit。当前 typed CLI 通过 huanpingtong `/api/data_set*` 代理访问 bpmax-server `/data-set*` 运行态接口;若 adapter 显示 `blocked`,只能导出、编辑 work、lint 和形成变更建议,不得提交。
|
|
10
|
-
- 当前 bpmax-cli typed adapter 支持数据集的 `dataset export/lint/build/submit/verify`,编辑提交路径为 huanpingtong `/api/data_set/relationFields/:id`,新建提交路径为 huanpingtong `/api/data_set`,均代理到 bpmax-server
|
|
10
|
+
- 当前 bpmax-cli typed adapter 支持数据集的 `dataset export/lint/build/submit/verify`,编辑提交路径为 huanpingtong `/api/data_set/relationFields/:id`,新建提交路径为 huanpingtong `/api/data_set`,均代理到 bpmax-server 运行态接口。relationFields 也可以用显式子命令 `bpmax-cli config dataset relation-fields submit/readback`。发布、暂停、取消刷新和索引刷新必须使用 `bpmax-cli config dataset publish|pause|cancel-refresh|refresh|reindex`,不得把旧脚本、raw API、页面 fetch 当作替代提交路径。
|
|
11
11
|
- 旧来源脚本 `scripts/submit*.py` 只保留为结构参考,默认会硬失败;不得用它们直调 BPMAX API。
|
|
12
12
|
- 不得用 `bpmax-cli api POST/PUT/DELETE /data_set*` 或其它 raw API 绕过 typed config submit。
|
|
13
13
|
|
|
@@ -54,7 +54,17 @@ description: "用于在 BPMAX 的数据集页面中创建、编辑、发布、
|
|
|
54
54
|
- 浏览器实时线上页面、实时接口返回、当前页面真实请求体优先级高于本地仓库里的 `think_data_set` / `think_data_set_field` 镜像;本地配置只作为候选、检索和回放参考,不能覆盖线上事实。
|
|
55
55
|
- 优先从真实页面和真实接口返回抽取 payload 骨架,不从零臆造。
|
|
56
56
|
- 优先检索现有数据集,再决定是否新建;优先判断当前流程下是否已有同语义可复用数据集。
|
|
57
|
-
- 当前默认走“线上详情导出到本地临时文件 -> 修改 work 文件 -> lint -> build submit -> 二次确认 -> typed CLI submit -> verify”。只有 `bpmax-cli config adapters` 显示 `dataset` 的 `build_status/submit_status` 为 `supported` 时,才允许进入提交闭环。
|
|
57
|
+
- 当前默认走“线上详情导出到本地临时文件 -> 修改 work 文件 -> lint -> build submit -> 二次确认 -> typed CLI submit -> verify/readback”。只有 `bpmax-cli config adapters` 显示 `dataset` 的 `build_status/submit_status` 为 `supported` 时,才允许进入提交闭环。
|
|
58
|
+
- 数据集 relationFields 编辑优先使用:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
bpmax-cli config dataset relation-fields submit --id <dataset_id> --payload <submit.json> --confirm "submit dataset <dataset_id>" --response-out <response.json> --format json
|
|
62
|
+
bpmax-cli config dataset relation-fields readback --id <dataset_id> --format json
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- 批量迁移多个数据集或字段时,优先生成 batch manifest 并使用 `bpmax-cli config batch submit/readback`。manifest 每行必须写 `domain`、`id`、`payload`、`confirm`、`response_out`;不要为每个字段临时写 collector 解析不同 response shape。
|
|
66
|
+
- 直接执行 typed submit/create 时,要读取响应顶层标准字段 `id`、`key`、`readback_hint`;如果还需要兼容旧字段,只能作为 fallback,不能把旧 response shape 当主路径。
|
|
67
|
+
- 通过 `bpmax-cli config batch submit/readback` 执行时,`response_out` 是行级 envelope:顶层读取 `ok`、`domain`、`id`、`action`,真实 typed 响应在 `response` 下,创建 ID 和回读提示读取 `response.id`、`response.key`、`response.readback_hint`。若某行停在 dry-run,必须把 `response.required_confirm` 写回 manifest 的 `confirm` 后重跑。
|
|
58
68
|
- 提交前硬门禁:必须先跑数据集 lint;`basicTableAudit` blocker 或脚本位点里把 ES dataset 查询入口写成 `data_set_id` 时,直接阻断提交。
|
|
59
69
|
- 脚本类查询默认口径:
|
|
60
70
|
- 前端验数或调试样例默认优先 `raw-es-search`
|
|
@@ -38,10 +38,31 @@ description: "用于按 BPMAX 完整流程配置需求先调研、再出计划
|
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
bpmax-cli config flow-app create --workspace <workspace> --form-work <form-work-file> --flow-work <flow-work-file> --name <name>
|
|
41
|
-
bpmax-cli config flow-app create --workspace <workspace> --form-work <form-work-file> --flow-work <flow-work-file> --name <name> --confirm "create flow-app <name> in <workspace>"
|
|
41
|
+
bpmax-cli config flow-app create --workspace <workspace> --form-work <form-work-file> --flow-work <flow-work-file> --name <name> --confirm "create flow-app <name> in <workspace>" --evidence-out .codex/tmp/target-context.csv --response-out .codex/tmp/flow-app-create.response.json
|
|
42
42
|
```
|
|
43
43
|
|
|
44
44
|
- `flow-app create` 的 dry-run 必须展示完整 operation plan:创建表单、发布表单、创建流程壳、绑定 `data.meta.form_template=<published_id>`、保存/发布流程、绑定工作区、回读验证。缺任何关键步骤都不得确认执行。
|
|
45
|
+
- 确认文本不得猜:dry-run JSON 必须包含 `required_confirm`,真实执行时直接复制该值;若确认文本不匹配,必须视为失败,不得把 dry-run JSON 当成功结果。
|
|
46
|
+
- 确认执行必须同时保留 `--response-out` 和 `--evidence-out`:前者保存完整响应、created IDs 和恢复上下文,后者保存给后续配置面复用的 target context。不得只保留 shell 重定向输出。
|
|
47
|
+
- 新建或迁移流程进入 dataset/list/filter/nav 任一后续阶段前,必须先取得 target context evidence:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
bpmax-cli config flow-app context --workspace <workspace> --flow <flow_type_or_key_or_name> --evidence-out .codex/tmp/target-context.csv --format json
|
|
51
|
+
bpmax-cli config readback flow-template --id <flow_type> --format json
|
|
52
|
+
bpmax-cli config readback form-template --id <form_template_id> --format json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
- 迁移工具只读回收证据统一使用 `bpmax-cli config readback <domain> --id <id> --format json`,不要生成 `bpmax-cli api GET ...` 或按 domain 手写 export/readback 差异。
|
|
56
|
+
- 批量提交或批量回读必须优先使用 batch manifest:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
bpmax-cli config batch submit --manifest .codex/tmp/config-batch.json --continue-on-error --format json
|
|
60
|
+
bpmax-cli config batch readback --manifest .codex/tmp/config-readback-batch.json --continue-on-error --format json
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
- batch manifest 每行必须保留 `domain`、`id`、`payload`(submit 时)、`confirm` 和 `response_out`;失败项要进入最终 summary,不能因为一条失败丢失前面成功项和剩余待处理项。
|
|
64
|
+
- `target_context.evidence_status` 必须是 `verified`,且 `missing_context` 必须为空;否则停止在 target context 修复阶段,不得继续生成 dataset、列表、导航或 E2E 任务。
|
|
65
|
+
- `target-context.csv/json` 是后续迁移 apply-ready evidence:至少包含 `flow_type`、`flow_template_id`、`form_template_id`、`form_template_draft_id`、`workspace_key`、`workspace_readback_hash`。不得让 subagent 重新猜这些 ID。
|
|
45
66
|
- `flow-app create` 的 flow work 必须预置表单驱动发起默认基线:隐藏 `project.name` / `project.brief` / `project.plan_end_time`,启用 `meta.use_template_project_name = true`,并提供非空 `meta.project_name_template`。这是 typed CLI 写入前 gate,不是可选建议。
|
|
46
67
|
- 工作区绑定必须走 `PUT /workspace/workspace_flow` typed adapter,并在 `/workspace/by_key?key=<workspace>` 回读中确认新 `(flow_type, flow_key)` 存在。回读失败时不能宣布创建成功。
|
|
47
68
|
- 若用户选择“完整流程配置”,默认依次评估:
|
|
@@ -125,6 +146,8 @@ bpmax-cli taskbook lint-prompt --prompt-source .codex/tmp/TASK_PROMPT.md
|
|
|
125
146
|
- 如果用户要求“没有就新建”,计划中必须显式写出:
|
|
126
147
|
- 是否先检索并复用已有表单/流程
|
|
127
148
|
- 若没有可复用对象,是否使用 `flow-app create`
|
|
149
|
+
- 是否会执行 `bpmax-cli config flow-app context --workspace <workspace> --flow <flow> --evidence-out ...`
|
|
150
|
+
- `evidence_status=verified` 后才允许进入 dataset/list/filter/nav 配置
|
|
128
151
|
- 目标工作区绑定是否属于本次 `requested` 或 `required-collateral`
|
|
129
152
|
- 是否需要导航入口;没有明确要求菜单入口时,不默认写 nav-config
|
|
130
153
|
|
|
@@ -170,6 +193,7 @@ bpmax-cli taskbook lint-prompt --prompt-source .codex/tmp/TASK_PROMPT.md
|
|
|
170
193
|
- 若流程或表单需求依赖控件能力判断,先用 [$form-control-library](../form-control-library/SKILL.md)。
|
|
171
194
|
- 若某一步要求浏览器已打开特定页面,而当前页面不对,必须先让用户打开到正确页面,不要盲目继续。
|
|
172
195
|
- `flow-app create` 完成后,必须再执行工作区视角的只读验证:
|
|
196
|
+
- `bpmax-cli config flow-app context --workspace <workspace> --flow <flow_type> --evidence-out .codex/tmp/target-context.csv --format json`
|
|
173
197
|
- `bpmax-cli flow list --workspace <workspace> --format json`
|
|
174
198
|
- 结果中应能看到新建流程
|
|
175
199
|
- 打开目标工作区创建页确认表单加载
|
|
@@ -161,12 +161,18 @@ bpmax-cli e2e cache refresh --flow-id <flow_id> --profile <profile> --format jso
|
|
|
161
161
|
- `unresolved.P0` 和 `unresolved.P1` 必须都是 `0`。
|
|
162
162
|
- `cases.csv` 字段必须固定为:`case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_result,test_data,roles,evidence_required,tags,status,updated_at`。
|
|
163
163
|
- `config_basis` 必须指向真实存在的配置或能力依据,并说明覆盖原因。配置仓库使用 `think_*`、`.ai_test/`、`.codex/skills/`;`bpmax-cli` 包内能力可引用 `skills/`。
|
|
164
|
+
- 每条正式 E2E 用例的 `prep_data` 必须包含执行前置证据:`precondition_check=`、`browser_tool=`、`live_draft=`、`state_file=` 或 `report_run=`。没有 `precondition_check` 记录时,只能进入准备阶段,不能写正式执行结论。
|
|
165
|
+
- 用例内容必须可读,`title`、`preconditions`、`config_basis`、`prep_data`、`steps`、`expected_result`、`test_data` 不得出现乱码、异常编码片段、`???`、`xxx`、`占位`、`待补`、`暂无`、`略` 这类空洞内容;`steps` 必须是可执行步骤,不得是一句泛泛备注。
|
|
166
|
+
- 负向、边界、异常、错误提示、扫码错误 SN 等用例必须在 `expected_result`、`steps` 或 `evidence_required` 中写明 `expected_error_text` 或 `error_capture_required`,并要求真实错误提示截图。没拿到提示文案时,结论写“提示文案未取到”,不要直接判业务失败。
|
|
167
|
+
- 涉及人工介入、手工补救、续跑、`dirty_resumed` 的用例,必须在 `prep_data` 或步骤中声明 `resume_policy=full_rerun|checkpoint|evidence_only`,并说明是从头重跑、检查点重跑还是仅补证据;局部续跑只能给局部结论。
|
|
168
|
+
- 多角色用例必须在 `prep_data`/`roles`/`evidence_required` 中记录 `login_profile`、`mock_user`、`unmock_done` 或 `bpmax-user-mock-operator`,并要求每个角色单独截图,不能复用一个角色的截图。
|
|
164
169
|
- `test_data` 不是占位字段,必须说明客户真实业务场景和业务逻辑,且必须写成结构化 `key=value`:
|
|
165
170
|
- `业务场景=`:说明客户实际会发生的业务动作或业务对象,例如客户换货、采购审批、库存调拨、费用报销。
|
|
166
171
|
- `业务逻辑=`:说明这组数据为什么能验证流程逻辑,例如一退一发、金额分级审批、库存占用后释放、审批矩阵命中。
|
|
167
172
|
- `样本数据=`:说明可复测样本的真实业务属性,不得写 `sample`、`test`、`mock`、`xxx`、`占位`、`待补`。
|
|
168
173
|
- `合理性=`:说明这组样本为什么符合客户业务规则、权限边界、主数据关系或上下游约束。
|
|
169
174
|
- `bpmax-cli test-suite lint` 会硬检查 `test_data` 是否包含 `业务场景=`、`业务逻辑=`、`样本数据=`、`合理性=`,且 `样本数据=` 不得是泛化占位值,不得包含 token、cookie、手机号、密码、Authorization 或完整 payload。
|
|
175
|
+
- `bpmax-cli test-suite lint` 还会硬检查前置证据、错误提示截图要求、人工介入续跑策略、多角色证据隔离和内容乱码/占位文本。新增 lint 文案使用中文说明,机器字段仍保持稳定英文 code/rule_id。
|
|
170
176
|
- 如果 `test_data` 语义对齐失败,先运行 `bpmax-cli test-suite lint --explain ...`,再按 CLI 输出的 title/preconditions/steps/expected 关键词重写 `业务场景=`。不要为了过 lint 把无关业务词塞进 `test_data`。
|
|
171
177
|
- 生成或更新用例必须先落到 `.ai_test/suite_draft/`,执行 lint 并向用户概要说明后,得到用户确认才允许 promote 到 `.ai_test/suite/`。
|
|
172
178
|
- 从正式用例复制到草稿,或从草稿 promote 到正式用例时,如果目标场景目录已经存在,第一次 `--replace` 只生成 copy diff preview,不覆盖目标;必须审阅 diff 后第二次显式追加 `--diff-reviewed`。
|
|
@@ -187,6 +193,13 @@ bpmax-cli test-suite lint-report --root .ai_test/report
|
|
|
187
193
|
|
|
188
194
|
`test-suite` 的 JSON 错误输出应使用稳定英文 `code/rule_id/path`,用户可见 `message/suggestion` 使用中文;普通文本输出也应可直接给实施人员阅读。
|
|
189
195
|
|
|
196
|
+
### 报告完整性门禁
|
|
197
|
+
- 单次执行报告必须位于 `.ai_test/report/<YYYYMMDD-NNN>/`,截图必须位于同一 run 的 `screenshots/` 下;`.codex/docs/` 只放复盘、长周期总结或交付版文档,并引用 `run_id` 和原始报告路径。
|
|
198
|
+
- 场景报告必须写 `planned_cases:`、`executed_cases:`、`precondition_check:`、`state_file:`、`browser_tool:`。`planned_cases` 与 `executed_cases` 必须逐条对账;有未执行用例时只能写阶段/局部结论,不能写完整通过。
|
|
199
|
+
- 报告出现 `not run`、`未执行`、`跳过` 时,`result:` 必须降级为 `partial`、`stage`、`blocked` 或明确“阶段/局部/不完整”。没有用户确认缩小范围时,不得把跳过用例合并进完整结论。
|
|
200
|
+
- 没有合规浏览器工具或页面证据时,必须使用浏览器阻塞模板:`browser_status: blocked`,并写“页面结论停止”;不得用 API/readback 证据冒充页面验证。
|
|
201
|
+
- 报告里写“页面通过 / 浏览器回归完成 / 真实页面已验证 / 完整链路通过”时,必须同时有 `browser_tool:` 和本 run 的本地截图证据。
|
|
202
|
+
|
|
190
203
|
### 测试资产与真实页面回归边界
|
|
191
204
|
- 更新 `.ai_test/suite_draft`、通过 lint、完成 review、promote 到 `.ai_test/suite`,只能证明“测试资产已更新”,不等于已经完成真实页面回归。
|
|
192
205
|
- 真实页面回归必须另行记录:浏览器 URL、当前用户/模拟用户、关键操作、截图、项目 ID/step ID、接口或数据回读证据。
|
|
@@ -75,7 +75,7 @@ case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_
|
|
|
75
75
|
- `title`:短标题。
|
|
76
76
|
- `preconditions`:前置数据和环境。
|
|
77
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`:结构化前置数据准备,至少包含
|
|
78
|
+
- `prep_data`:结构化前置数据准备,至少包含 `账号=`、`入口=`、`样本=`、`准备操作=`、`预期=`、`precondition_check=`、`browser_tool=`、`live_draft=`,并提供 `state_file=` 或 `report_run=`。
|
|
79
79
|
- `steps`:可读步骤,用 ` > ` 分隔。
|
|
80
80
|
- `expected_result`:明确可判定结果。
|
|
81
81
|
- `test_data`:客户真实业务测试数据说明,不写 token、cookie、手机号、密码或完整 payload。必须使用英文分号分隔的 `key=value`,至少包含 `业务场景=`、`业务逻辑=`、`样本数据=`、`合理性=`。
|
|
@@ -89,7 +89,7 @@ case_id,priority,type,title,preconditions,config_basis,prep_data,steps,expected_
|
|
|
89
89
|
|
|
90
90
|
```csv
|
|
91
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
|
|
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/20260618-001;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
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
## latest gate
|
|
@@ -121,7 +121,11 @@ C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"t
|
|
|
121
121
|
## 前置数据规则
|
|
122
122
|
|
|
123
123
|
- `prep_data` 是执行前必须先完成的准备清单,不是备注。
|
|
124
|
-
- 最少写明
|
|
124
|
+
- 最少写明 `账号=`、`入口=`、`样本=`、`准备操作=`、`预期=`、`precondition_check=`、`browser_tool=`、`live_draft=`,并提供 `state_file=` 或 `report_run=`。
|
|
125
|
+
- `precondition_check=` 必须指向本轮执行前置检查记录;没有该记录时只能进入准备阶段,不能写正式执行结论。
|
|
126
|
+
- `browser_tool=` 必须写明真实页面通道,例如 `Chrome DevTools`、`Playwright` 或 `AppleScript fallback`;如果没有可用浏览器工具,报告必须走 browser blocked 模板。
|
|
127
|
+
- `live_draft=` 必须写清本轮测的是 `live` 发布态还是 `draft` 草稿态。
|
|
128
|
+
- `state_file=` 或 `report_run=` 必须能定位本轮状态/报告证据。
|
|
125
129
|
- `准备操作=` 必须写正式执行步骤前要做的具体动作,例如打开入口、创建或搜索样本、确认主数据、确认权限、确认自动化发布状态。
|
|
126
130
|
- `预期=` 必须写准备完成的可判定结果,例如样本可用、样本不存在、审批人可达、字段可选、自动生成的下游项目已存在。
|
|
127
131
|
- 复杂业务应补 `主数据=`、`权限=`、`自动化=`、`依赖流程=`、`清理策略=`。
|
|
@@ -129,6 +133,10 @@ C001,P0,positive,正常客户换货主链路,有可用旧机SN和新机库存,"t
|
|
|
129
133
|
- 当用例验证自动贯通、子流程或下游对象时,必须补 `定位规则=`,说明按列表 URL、`flow_type`、搜索字段、根项目关系或详情 URL 定位对象。
|
|
130
134
|
- `prep_data` 用英文分号 `;` 分隔字段,每一段都必须是 `key=value`;同一字段内多个值用英文逗号 `,` 分隔。
|
|
131
135
|
- 全流程自动贯通用例必须写清自动触发依据,不能用人工直接创建的下游项目冒充自动贯通。
|
|
136
|
+
- 负向、边界、异常、错误提示、扫码错误 SN 等用例必须写 `expected_error_text` 或 `error_capture_required`,并要求错误提示截图;没截到提示时写“提示文案未取到”,不要直接判业务失败。
|
|
137
|
+
- 人工介入、手工补救、续跑、`dirty_resumed` 用例必须写 `resume_policy=full_rerun|checkpoint|evidence_only`,并说明局部/完整结论边界。
|
|
138
|
+
- 多角色用例必须写 `login_profile`、`mock_user`、`unmock_done` 或 `bpmax-user-mock-operator`,并要求每个角色单独截图。
|
|
139
|
+
- 用例内容不得出现乱码、异常编码、`???`、`xxx`、`占位`、`待补`、`暂无`、`略` 等空洞文本;`steps` 必须是可执行步骤。
|
|
132
140
|
|
|
133
141
|
## 真实业务测试数据规则
|
|
134
142
|
|
|
@@ -300,6 +308,12 @@ source_suite: .ai_test/suite/customer-exchange-main-flow
|
|
|
300
308
|
result: pass
|
|
301
309
|
tested_at: 2026-06-18
|
|
302
310
|
|
|
311
|
+
planned_cases: C001,C002,C003
|
|
312
|
+
executed_cases: C001,C002,C003
|
|
313
|
+
precondition_check: .codex/tmp/e2e_states/customer-exchange.json
|
|
314
|
+
state_file: .codex/tmp/e2e_states/customer-exchange.json
|
|
315
|
+
browser_tool: Chrome DevTools
|
|
316
|
+
|
|
303
317
|
## 1. 测试范围
|
|
304
318
|
|
|
305
319
|
## 2. 执行环境
|
|
@@ -331,3 +345,11 @@ Codex 桌面本地预览优先使用截图的绝对本地路径,图片文件
|
|
|
331
345
|
```bash
|
|
332
346
|
bpmax-cli test-suite lint-report --root .ai_test/report
|
|
333
347
|
```
|
|
348
|
+
|
|
349
|
+
报告 lint 会硬检查:
|
|
350
|
+
- `planned_cases:` 和 `executed_cases:` 必须存在且逐条对账;planned 中未出现在 executed 的用例必须有 blocked/not run 原因,报告结论降级为阶段/局部。
|
|
351
|
+
- `precondition_check:`、`state_file:`、`browser_tool:` 必须存在。
|
|
352
|
+
- 页面/浏览器结论(页面通过、浏览器回归通过、完整链路通过)必须有 `browser_tool` 证据和截图;接口/回读证据不能冒充页面验证。
|
|
353
|
+
- 出现 `not run` 但 `result: pass` 的报告必须降级为 `partial` 或 `stage`。
|
|
354
|
+
- 浏览器 blocked 报告必须使用 `browser_status: blocked` 模板并停止页面结论。
|
|
355
|
+
- 报告中的乱码/空洞步骤会通过用例内容 lint 拦截。
|