bpmax-cli 0.1.44-beta.13 → 0.1.44-beta.15

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 +286 -47
  2. package/dist/bin.js.map +1 -1
  3. package/package.json +1 -1
  4. package/skills/bpmax-ai-taskbook/SKILL.md +125 -0
  5. package/skills/bpmax-approval-matrix/SKILL.md +80 -0
  6. package/skills/bpmax-cli/SKILL.md +3 -0
  7. package/skills/bpmax-dataset-template-editor/references/pre-process-script-example-catalog.md +8 -8
  8. package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +21 -0
  9. package/skills/bpmax-e2e-flow-test-operator/SKILL.md +4 -3
  10. package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale.json +4 -4
  11. package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_final_v2.json +4 -4
  12. package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_main.json +4 -4
  13. package/skills/bpmax-e2e-flow-test-operator/profiles/negative_sale_region.json +4 -4
  14. package/skills/bpmax-e2e-flow-test-operator/references/filter-field-discovery.md +2 -2
  15. package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +3 -3
  16. package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +6 -4
  17. package/skills/bpmax-e2e-flow-test-operator/scripts/flow_test_profile.py +11 -11
  18. package/skills/bpmax-flow-template-editor/SKILL.md +1 -1
  19. package/skills/bpmax-flow-template-editor/references/lessons-from-price-plan-flow.md +3 -3
  20. package/skills/bpmax-flow-template-editor/references/matrix-flow-form-nav-collaboration.md +7 -4
  21. package/skills/bpmax-form-template-editor/SKILL.md +14 -9
  22. package/skills/bpmax-project/SKILL.md +4 -1
  23. package/skills/form-control-library/references/form-controls.md +37 -37
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmax-cli",
3
- "version": "0.1.44-beta.13",
3
+ "version": "0.1.44-beta.15",
4
4
  "description": "CLI for BPMAX environments with multi-profile config and local login callback flow",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: "bpmax-ai-taskbook"
3
+ description: "Use when BPMAX configuration work needs an AI implementation taskbook, AI任务方案, 任务书, 任务拆解, subagent dispatch prompts, progress CSV, or object-lock review before editing flows, templates, datasets, roles, navigation, workspaces, or E2E assets."
4
+ ---
5
+
6
+ # BPMAX AI Taskbook
7
+
8
+ ## Core Rule
9
+
10
+ Use a taskbook before dispatching broad BPMAX implementation work. The taskbook is a local planning and safety gate; it is not a BPMAX configuration write path.
11
+
12
+ ## When To Use
13
+
14
+ - The user asks for an AI task plan, taskbook, implementation task table, subagent split, or progress tracking.
15
+ - 用户要求 AI任务方案、任务书、任务拆解、实施任务表、subagent 分工、进度表或 P0/P1 review。
16
+ - The work spans multiple BPMAX objects such as flow, form, dataset, list, filter, detail, dashboard, role, navigation, workspace, or E2E cases.
17
+ - The work may use subagents or parallel review.
18
+ - A new flow/app/workspace may be created and the real platform-generated ID must be fed back into later tasks.
19
+ - The user asks for P0/P1 review before commit or before continuing configuration.
20
+
21
+ Do not use this for a single narrow read-only query, one-field edit, or pure CLI auth/setup task.
22
+
23
+ ## Commands
24
+
25
+ Create the taskbook:
26
+
27
+ ```bash
28
+ bpmax-cli taskbook init --out .codex/tmp/TASKBOOK.md
29
+ ```
30
+
31
+ Lint the taskbook before execution:
32
+
33
+ ```bash
34
+ bpmax-cli taskbook lint --source .codex/tmp/TASKBOOK.md
35
+ ```
36
+
37
+ For taskbooks that do not create or edit flows, keep the same content gates but skip the generated `flow_type` rule:
38
+
39
+ ```bash
40
+ bpmax-cli taskbook lint --source .codex/tmp/TASKBOOK.md --allow-generated-flow-type-missing
41
+ ```
42
+
43
+ Lint each subagent or handoff prompt before dispatch:
44
+
45
+ ```bash
46
+ bpmax-cli taskbook lint-prompt --prompt-source .codex/tmp/TASK_PROMPT.md
47
+ ```
48
+
49
+ Initialize progress tracking:
50
+
51
+ ```bash
52
+ bpmax-cli taskbook progress init --source .codex/tmp/TASKBOOK.md --out .codex/tmp/taskbook-progress.csv
53
+ ```
54
+
55
+ ## Required Content
56
+
57
+ The taskbook must include:
58
+
59
+ - `目标与边界`
60
+ - `并行拆解硬规则`
61
+ - `阶段总览`
62
+ - `对象锁表`
63
+ - `AI 最小任务单元`
64
+ - `验收门禁`
65
+ - `停机点`
66
+ - `进度 CSV`
67
+
68
+ Every AI task row must include:
69
+
70
+ - `business_goal`: concrete business outcome, not just a technical object name.
71
+ - `required_skills`: concrete BPMAX skills such as `bpmax-flow-template-editor`, `bpmax-form-template-editor`, `bpmax-list-template-editor`, `bpmax-e2e-flow-test-operator`, or `bpmax-memory-protocol`.
72
+ - `object_lock`: one lock per mutable BPMAX object, for example `flow:<flow_type>`, `form-template:<id>`, `dataset:<id>`, `workspace:<key>`, or `new-flow:<name>`.
73
+ - `subagent_mode`: one of `none`, `readonly`, `draft-only`, or `exclusive-write`.
74
+ - `dependencies`: upstream task IDs required before execution.
75
+ - `evidence`: expected proof such as readback hash, browser screenshot, test report, or lint result.
76
+
77
+ ## Object Lock Rules
78
+
79
+ - Duplicate object locks must not be edited in parallel.
80
+ - Read-only tasks may run in parallel, but must not save, publish, or submit payloads.
81
+ - UUID values are forbidden in BPMAX configuration taskbooks and subagent prompts. BPMAX 配置 ID 只能使用平台返回的数字 ID 或 `flow<number>`;新建前只能使用 `new-flow:<name>` 这种逻辑锁。
82
+ - Do not use UUIDs for form-template, dataset, dataset-field, page-template, role, workspace, flow_type, temporary ids, object locks, or examples.
83
+ - Approval matrix work must use separate tasks and object locks for: creating the matrix app, creating matrix rule records, filling real approver users, and connecting business flow `matrix_owner` / `cc_matrix`. Do not mark "matrix created" complete until both app configuration and rule data are verified.
84
+ - New flows must use `new-flow:<name>` until BPMAX returns a real `flow<number>`.
85
+ - After creation, replace the lock with `flow:<generated flow_type>` before dependent write tasks continue.
86
+ - Publishing, final sync, and cross-object integration must be single-threaded.
87
+
88
+ ## Prompt Gate
89
+
90
+ Before dispatching any subagent prompt, run `lint-prompt`. The prompt must explicitly include:
91
+
92
+ - `业务目标场景`
93
+ - `required_skills`
94
+ - `对象锁`
95
+ - `subagent_mode`
96
+ - `允许操作`
97
+ - `不得修改`
98
+ - `输入依赖`
99
+ - `输出物`
100
+ - `验收方式`
101
+ - `进度 CSV`
102
+
103
+ If `lint-prompt` fails, revise the prompt. Do not dispatch a vague prompt and rely on the subagent to infer scope.
104
+
105
+ ## Execution Gate
106
+
107
+ Only after taskbook lint and prompt lint pass:
108
+
109
+ 1. Run the latest configuration sync required by the target workspace.
110
+ 2. Execute tasks according to object locks and dependencies.
111
+ 3. Use typed `bpmax-cli config ...` commands for all BPMAX writes.
112
+ 4. Update the progress CSV after each task.
113
+ 5. Stop on capability gaps, baseline drift, object-lock conflict, failed lint, or failed browser/runtime verification.
114
+
115
+ 不得把 taskbook 当作 BPMAX 配置写入命令。Taskbook commands are local file gates; they do not write BPMAX configuration and do not replace typed adapters.
116
+
117
+ ## Memory
118
+
119
+ Start non-trivial taskbooks by consulting `bpmax-memory-protocol` or:
120
+
121
+ ```bash
122
+ bpmax-cli memory search --scope all --query "<workspace> <flow_type> taskbook implementation plan" --format json
123
+ ```
124
+
125
+ After verified completion, write only reusable `decision`, `task_learning`, `anti_pattern`, or `session_state` memory. Do not write API keys, passwords, cookies, tokens, verification codes, phone numbers, full payloads, or large raw API responses.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: "bpmax-approval-matrix"
3
+ description: "Use when BPMAX work involves approval matrix, role matrix, department matrix, matrix_owner, cc_matrix, matrix rule records, approver mapping, seed rules, or connecting a business flow to matrix-based owners or CC users."
4
+ ---
5
+
6
+ # BPMAX Approval Matrix
7
+
8
+ ## Core Boundary
9
+
10
+ 审批矩阵不是一个单一配置项。必须把生命周期拆成四段:
11
+
12
+ 1. 创建矩阵应用:矩阵流程、表单、列表、筛选器、工作区绑定和导航入口。
13
+ 2. 创建矩阵规则记录:在线上矩阵流程中创建项目记录。
14
+ 3. 填充真实审批人:规则记录里的用户字段必须是真实用户对象或用户 ID,不得是示例文本、空值或本地占位。
15
+ 4. 主流程接入矩阵:业务流程节点配置 `matrix_owner` 或 `cc_matrix`,并验证命中规则后能返回审批人。
16
+
17
+ 只有第 1 段完成时,不能宣称“审批矩阵已可用”。
18
+
19
+ ## Required Skills
20
+
21
+ - 先用 `bpmax-ai-taskbook` 拆任务和对象锁。
22
+ - 矩阵应用配置用 `bpmax-e2e-flow-config-orchestrator`、`bpmax-flow-template-editor`、`bpmax-form-template-editor`、`bpmax-list-template-editor`、`bpmax-filter-template-editor`。
23
+ - 规则记录创建用 `bpmax-project`,默认走 `bpmax-cli project create --json ...` 的安全引导或 handoff。
24
+ - 浏览器验证用 `bpmax-e2e-flow-test-operator`。
25
+
26
+ ## Hard Rules
27
+
28
+ - UUID 禁止用于任何矩阵配置 ID、规则记录 ID、表单模板 ID、数据集 ID、页面模板 ID 或临时 object lock。
29
+ - 矩阵流程必须是 `category = "matrix"`。
30
+ - 矩阵录入表单挂在 `flow.data.meta.form_template`,不是普通节点 `node.form_template`。
31
+ - `flow-app create` 只创建矩阵应用配置,不会创建矩阵规则记录。
32
+ - `seed-rules.json` 只是本地规则种子,不代表线上已有规则数据。
33
+ - seed 缺少真实审批人用户值时,不允许进入主流程接入验收。
34
+ - `workspace-flow` 是全量替换接口;提交前必须重新 export 当前绑定并 merge,不能复用旧 dry-run payload。
35
+
36
+ ## Minimal Workflow
37
+
38
+ 1. Baseline:
39
+
40
+ ```bash
41
+ bpmax-cli config latest pull <env> --profile <profile> --format json
42
+ bpmax-cli taskbook lint --source .codex/tmp/TASKBOOK.md
43
+ ```
44
+
45
+ 2. Matrix app:
46
+
47
+ ```bash
48
+ bpmax-cli config flow-app create --workspace <workspace> --form-work <matrix-form-work> --flow-work <matrix-flow-work> --name "<matrix name>"
49
+ bpmax-cli config flow-app create --workspace <workspace> --form-work <matrix-form-work> --flow-work <matrix-flow-work> --name "<matrix name>" --confirm "create flow-app <matrix name> in <workspace>"
50
+ ```
51
+
52
+ 3. Matrix rule records:
53
+
54
+ ```bash
55
+ bpmax-cli matrix seed <matrix_flow_type> --profile <profile> --rules @seed-rules.json --approver-field <owner_field> --format json
56
+ bpmax-cli project create --profile <profile> --flow-type <matrix_flow_type> --json '{"form":{...}}' --format json
57
+ ```
58
+
59
+ `matrix seed` 只做本地校验和输出 `project create` checklist,不写线上项目记录。If CLI returns `handoff: true`, use the returned page link. Do not force `--no-interactive` unless the form is proven safe for direct create.
60
+
61
+ 4. Business flow consumption:
62
+
63
+ - Owner: set `node.auto_range_type = "matrix"` and configure `node.matrix_owner.flow` plus `node.matrix_owner.script`.
64
+ - CC: set `node.cc_type = "matrix"` and configure `node.cc_matrix.flow` plus `node.cc_matrix.script`.
65
+ - Scripts must return user objects, user IDs, or arrays of them.
66
+
67
+ 5. Verification:
68
+
69
+ - Matrix app is visible in the target workspace.
70
+ - Matrix rule project exists online with real approver fields.
71
+ - Business flow create/submit reaches the matrix-owned step.
72
+ - Runtime owner/CC resolves to the expected user.
73
+
74
+ ## Stop Conditions
75
+
76
+ - Any required ID is UUID-shaped.
77
+ - Matrix app exists but no rule records exist.
78
+ - Rule records exist but approver fields are empty or not real BPMAX users.
79
+ - `project create --no-interactive` returns 500; switch to CLI handoff diagnostics instead of raw API.
80
+ - Business flow `matrix_owner.flow` points to a flow that is not `category = "matrix"`.
@@ -41,11 +41,14 @@ bpmax-cli init --agent <agent> --channel feishu --url "<BPMAX_URL>" --name local
41
41
  - 刷新配置库、同步最新配置、latest pull:读 `../bpmax-config-latest/SKILL.md`
42
42
  - 流程列表、流程选项、流程详情:读 `../bpmax-flow/SKILL.md`
43
43
  - 项目列表、项目详情、我的待办、最小创建:读 `../bpmax-project/SKILL.md`
44
+ - 审批矩阵、矩阵规则 seed、matrix_owner / cc_matrix:读 `../bpmax-approval-matrix/SKILL.md`
44
45
  - 环节推进、审批通过/拒绝、完成 step:读 `../bpmax-project/SKILL.md`,必须使用 `step context/actions/requirements/submit` 的安全链路
45
46
  - 系统内页面 URL 生成:先读 `../bpmax-shared/SKILL.md` 的“系统内 URL 生成”
46
47
  - 本地 schema manifest:读 `../bpmax-schema/SKILL.md`
47
48
  - 服务端能力白名单:先用 `capabilities status/refresh` 查看当前 profile 已授权 capability,不要绕过白名单手写 raw API
48
49
  - BPMAX Business Skills 查询、同步、安装、更新、卸载:读 `../bpmax-business-skill/SKILL.md`
50
+ - AI 任务方案、任务书、任务拆解、subagent 分工、实施任务表、进度 CSV:读 `../bpmax-ai-taskbook/SKILL.md`
51
+ - 审批矩阵、角色矩阵、矩阵规则记录、`matrix_owner`、`cc_matrix`、规则 seed、审批人映射:读 `../bpmax-approval-matrix/SKILL.md`
49
52
 
50
53
  ## 规则
51
54
 
@@ -9,7 +9,7 @@
9
9
  - 项目选择器或弹窗选择场景,不适合继续沿用默认列表组合逻辑。
10
10
  - 代表样例:
11
11
  - `business_policy` 数据集,`flow143372620`
12
- - [sysconfig-example 样例](../../../../think_data_set/uuid'11e6cc59-cc73-4b30-a60e-a19e2319d77b___is_del'0/data_set.pre_process_script)
12
+ - [sysconfig-example 样例](../../../../think_data_set/<local-mirror-data-set-dir>/data_set.pre_process_script)
13
13
  - 做法:
14
14
  - 检查 `ctx.clientPayload.query.is_project_select`
15
15
  - 直接用 `ctx.clientFormatQuery` 重写 `ctx.body.query`
@@ -19,7 +19,7 @@
19
19
  - 默认 `__all_owner_ids` 不符合业务,想改成关注人、跟进人等视角。
20
20
  - 代表样例:
21
21
  - `matrix` 数据集,`flow938235363`
22
- - [sysconfig-example 样例](../../../../think_data_set/uuid'f29b5603-e33f-477d-835d-04958c3496d6___is_del'0/data_set.pre_process_script)
22
+ - [sysconfig-example 样例](../../../../think_data_set/<local-mirror-data-set-dir>/data_set.pre_process_script)
23
23
  - 做法:
24
24
  - 定位默认 `bool.should` 里的 `match.__all_owner_ids`
25
25
  - 替换成 `nested followUser.id = 当前用户`
@@ -29,7 +29,7 @@
29
29
  - 不同角色看不同问题、任务、项目集合。
30
30
  - 代表样例:
31
31
  - `BPMAX 问题管理(flow138055947)` 的 `IssueManagement`
32
- - [sysconfig-cltxtest 样例](../../../../../sysconfig-cltxtest/think_data_set/uuid'f3f12a09-9496-4d26-9a61-1ceb36a4b6bf___is_del'0/data_set.pre_process_script)
32
+ - [sysconfig-cltxtest 样例](../../../../../sysconfig-cltxtest/think_data_set/<local-mirror-data-set-dir>/data_set.pre_process_script)
33
33
  - 做法:
34
34
  - `pm` 角色先查 `BPMAX 项目立项(flow160679070)` 的 `matrix`
35
35
  - 把命中的项目 id 塞回问题列表的 `project_id`
@@ -40,7 +40,7 @@
40
40
  - 非管理员只能看自己任务,且列表默认排序需要稳定。
41
41
  - 代表样例:
42
42
  - `BPMAX 项目执行任务(flow671032636)` 的 `plan_task`
43
- - [sysconfig-cltxtest 样例](../../../../../sysconfig-cltxtest/think_data_set/uuid'dd4105ee-85b1-4cad-8d4e-7a5216f196b2___is_del'0/data_set.pre_process_script)
43
+ - [sysconfig-cltxtest 样例](../../../../../sysconfig-cltxtest/think_data_set/<local-mirror-data-set-dir>/data_set.pre_process_script)
44
44
  - 做法:
45
45
  - 非管理员追加 `__owner_id = 当前用户`
46
46
  - 无自定义排序时,按业务状态脚本排序,再按更新时间倒序
@@ -50,7 +50,7 @@
50
50
  - 权限写在元数据或主数据里,不在角色点位上。
51
51
  - 代表样例:
52
52
  - `采购申请(flow71669656)`
53
- - [sysconfig-xingmai 样例](../../../../../sysconfig-xingmai/think_data_set/uuid'2384c6c4-33b0-46b7-b7de-c76f7019edb4___is_del'0/data_set.pre_process_script)
53
+ - [sysconfig-xingmai 样例](../../../../../sysconfig-xingmai/think_data_set/<local-mirror-data-set-dir>/data_set.pre_process_script)
54
54
  - 做法:
55
55
  - 先查 `采购大类-采购类别元数据(flow558104702)` 的 `procurement_info`
56
56
  - 根据采购员身份判断当前人负责哪些产品线
@@ -61,7 +61,7 @@
61
61
  - 当前用户要映射到 OA / 飞书 / 导入人姓名等多套身份字段。
62
62
  - 代表样例:
63
63
  - `合同审批(flow48198545)`
64
- - [sysconfig-xingmai 样例](../../../../../sysconfig-xingmai/think_data_set/uuid'a999c45f-57de-4298-8cfc-717af4caa312___is_del'0/data_set.pre_process_script)
64
+ - [sysconfig-xingmai 样例](../../../../../sysconfig-xingmai/think_data_set/<local-mirror-data-set-dir>/data_set.pre_process_script)
65
65
  - 做法:
66
66
  - 先用 SQL 查 `think_platform_user`
67
67
  - 再把 `feishu_user_id`、`contract_owner_id`、`import_data_owner_names` 追加到 `should`
@@ -71,7 +71,7 @@
71
71
  - 前端筛的是“月份”,ES 存的是起止区间。
72
72
  - 代表样例:
73
73
  - `营销项目预算申请(flow168700401)` 的 `yx_budget`
74
- - [sysconfig-xingmai 样例](../../../../../sysconfig-xingmai/think_data_set/uuid'05d60d70-1c7c-4cd6-bf37-3615a59c2e90___is_del'0/data_set.pre_process_script)
74
+ - [sysconfig-xingmai 样例](../../../../../sysconfig-xingmai/think_data_set/<local-mirror-data-set-dir>/data_set.pre_process_script)
75
75
  - 做法:
76
76
  - 把 `budget_month=YYYY-MM` 改写成 `budget_start_month <= 月份 <= budget_end_month`
77
77
  - 再叠加 `budget_owner_id = 当前用户`
@@ -81,7 +81,7 @@
81
81
  - 数据权限不变,但列表必须稳定排序。
82
82
  - 代表样例:
83
83
  - `质量阀交付物模板(flow381001006)`
84
- - [sysconfig-cltxtest 样例](../../../../../sysconfig-cltxtest/think_data_set/uuid'663cc61e-9559-4c5e-b50a-e046848f86d4___is_del'0/data_set.pre_process_script)
84
+ - [sysconfig-cltxtest 样例](../../../../../sysconfig-cltxtest/think_data_set/<local-mirror-data-set-dir>/data_set.pre_process_script)
85
85
  - 做法:
86
86
  - 只改 `ctx.body.sort`
87
87
  - 不碰查询条件
@@ -12,6 +12,7 @@ description: "用于按 BPMAX 完整流程配置需求先调研、再出计划
12
12
  - `required-collateral` 必须逐项解释“不改会坏/会失真/会不闭合”的原因并取得确认;`out-of-scope` 一律不得提交或顺手混入。
13
13
  - 不得以历史脏配置、顺手修复、统一风格、编辑器自动补字段、方便调试为理由修改需求外配置。
14
14
  - 所有远端写入必须走 `bpmax-cli config ...` typed adapter。没有相关流程且用户要求创建时,优先评估 `config flow-app create`;如果当前 profile 缺 `config.flow_app.create`、`config.form_template.create`、`config.flow_template.create` 或 `config.workspace_flow.submit`,必须停止并要求补授权/升级 CLI,不得改用 raw API、页面 fetch 或旧 submit 脚本。
15
+ - 大型、多对象、需要 subagent 或需要 P0/P1 review 的配置任务,必须先进入 [$bpmax-ai-taskbook](../bpmax-ai-taskbook/SKILL.md),生成并 lint AI 任务书,再开始分发执行;不得直接口头拆任务后写配置。
15
16
 
16
17
  ## 何时使用
17
18
  - 用户要做一整套 BPMAX 流程相关配置,而不是单改某一个模板。
@@ -55,6 +56,23 @@ bpmax-cli config flow-app create --workspace <workspace> --form-work <form-work-
55
56
  - 计划第一步固定先进入 `bpmax-config-latest` 并执行当前配置环境的 `bpmax-cli config latest pull <env>`;全部配置和验证结束后,最后一步固定再通过 `bpmax-config-latest` 执行一次同一环境的 latest pull。
56
57
  - 若首次同步因本地脏工作区失败,默认下一步尝试追加 `--allow-dirty` 重试;若重试任一步失败,立即停下并向用户说明冲突点,由用户决定是否继续。
57
58
 
59
+ ## AI 任务书门禁
60
+ - 当本次配置跨 2 个以上配置面、会创建新流程/工作区、需要 subagent 并行、或用户明确要求 review P0/P1 时,先调用 [$bpmax-ai-taskbook](../bpmax-ai-taskbook/SKILL.md)。
61
+ - 任务书必须先通过:
62
+
63
+ ```bash
64
+ bpmax-cli taskbook lint --source .codex/tmp/TASKBOOK.md
65
+ ```
66
+
67
+ - 每个 subagent prompt 必须先通过:
68
+
69
+ ```bash
70
+ bpmax-cli taskbook lint-prompt --prompt-source .codex/tmp/TASK_PROMPT.md
71
+ ```
72
+
73
+ - 任务书里必须声明对象锁、`required_skills`、`subagent_mode`、依赖和验收证据;对象锁冲突、prompt lint 失败、或真实 `flow_type` 未回填时不得分发写任务。
74
+ - `bpmax-cli taskbook progress init --source .codex/tmp/TASKBOOK.md --out .codex/tmp/taskbook-progress.csv` 生成的进度 CSV 是执行状态来源;不得直接改飞书文档当作进度事实。
75
+
58
76
  ## Mem0 协议
59
77
  - 编排开始前先调用 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md),检索词至少包含:
60
78
  - 业务名 / 流程名
@@ -98,6 +116,7 @@ bpmax-cli config flow-app create --workspace <workspace> --form-work <form-work-
98
116
  - 列表模板
99
117
  - 筛选器模板
100
118
  - 导航配置
119
+ - 如果配置面超过 2 个,或存在新建/发布/多角色验收,计划中必须加入 `bpmax-ai-taskbook` 前置任务书步骤。
101
120
  - 如果用户说“全部都做”,按完整流程配置处理。
102
121
  - 如果用户只做一部分,只编排对应子 skill,不强行扩展到其他无关面。
103
122
  - 如果用户要求“没有就新建”,计划中必须显式写出:
@@ -125,6 +144,7 @@ bpmax-cli config flow-app create --workspace <workspace> --form-work <form-work-
125
144
  - 计划中要显式说明:
126
145
  - 哪些配置面属于本次范围
127
146
  - 哪些子 skill 会被调用
147
+ - 是否需要 `bpmax-ai-taskbook`,以及任务书 lint、prompt lint、进度 CSV 的路径
128
148
  - 哪些页面必须先在浏览器中打开
129
149
  - 哪些地方以浏览器实时配置为准
130
150
  - 新建场景使用哪个 typed create 命令、确认文本是什么、失败后停止在哪一步
@@ -141,6 +161,7 @@ bpmax-cli config flow-app create --workspace <workspace> --form-work <form-work-
141
161
  - 导航:[$bpmax-nav-config-editor](../bpmax-nav-config-editor/SKILL.md)
142
162
  - 控件选型:[$form-control-library](../form-control-library/SKILL.md)
143
163
  - 最新配置同步:[$bpmax-config-latest](../bpmax-config-latest/SKILL.md)
164
+ - AI 任务书:[$bpmax-ai-taskbook](../bpmax-ai-taskbook/SKILL.md)
144
165
  - 若流程或表单需求依赖控件能力判断,先用 [$form-control-library](../form-control-library/SKILL.md)。
145
166
  - 若某一步要求浏览器已打开特定页面,而当前页面不对,必须先让用户打开到正确页面,不要盲目继续。
146
167
  - `flow-app create` 完成后,必须再执行工作区视角的只读验证:
@@ -86,11 +86,12 @@ bpmax-cli test-suite lint-report --root .ai_test/report
86
86
  ## 负卖配置样板流程
87
87
  - 工作区:`store_mgr`
88
88
  - `flow_type`:`flow288204142`
89
- - 数据集:`ae03f918-023f-41e3-87f4-6c93658b6e69`
90
- - 列表模板:`44a20c27-7195-40b2-b351-604960c4ef2e`
91
- - 筛选模板:`fc132a7a-11aa-4d54-a767-ab7a01d9e135`
89
+ - 数据集:从 profile 的 `data_set_local_ref` 定位本地镜像;真实远端配置必须使用数字 ID 或 `data_set_key`
90
+ - 列表模板:从 profile 的 `list_template_local_ref` 定位本地镜像;真实远端配置必须使用数字页面模板 ID
91
+ - 筛选模板:从 profile 的 `filter_template_local_ref` 定位本地镜像;真实远端配置必须使用数字页面模板 ID
92
92
  - 表单模板:`负卖配置表`
93
93
  - 审批链:`经销商负责人审批 -> 修改配置 -> 区域经理审批 -> 零售业务部审批 -> 生效中`
94
+ - `*_local_ref` 只用于 E2E 脚本读取本地 sysconfig 镜像,不得作为 BPMAX 配置 ID 提交。
94
95
 
95
96
  ## 最小工作流
96
97
 
@@ -3,10 +3,10 @@
3
3
  "workspace": "store_mgr",
4
4
  "flow_type": "flow288204142",
5
5
  "flow_name": "负卖配置",
6
- "data_set_uuid": "ae03f918-023f-41e3-87f4-6c93658b6e69",
7
- "list_template_uuid": "44a20c27-7195-40b2-b351-604960c4ef2e",
8
- "filter_template_uuid": "fc132a7a-11aa-4d54-a767-ab7a01d9e135",
9
- "form_template_uuid": "6a69e591-8ccc-4cb1-af9b-4238e3895486",
6
+ "data_set_local_ref": "ae03f918-023f-41e3-87f4-6c93658b6e69",
7
+ "list_template_local_ref": "44a20c27-7195-40b2-b351-604960c4ef2e",
8
+ "filter_template_local_ref": "fc132a7a-11aa-4d54-a767-ab7a01d9e135",
9
+ "form_template_local_ref": "6a69e591-8ccc-4cb1-af9b-4238e3895486",
10
10
  "form_template_name": "负卖配置表",
11
11
  "default_qualification": "兴盛",
12
12
  "default_status": 0,
@@ -3,10 +3,10 @@
3
3
  "workspace": "store_mgr",
4
4
  "flow_type": "flow288204142",
5
5
  "flow_name": "负卖配置",
6
- "data_set_uuid": "ae03f918-023f-41e3-87f4-6c93658b6e69",
7
- "list_template_uuid": "44a20c27-7195-40b2-b351-604960c4ef2e",
8
- "filter_template_uuid": "fc132a7a-11aa-4d54-a767-ab7a01d9e135",
9
- "form_template_uuid": "6a69e591-8ccc-4cb1-af9b-4238e3895486",
6
+ "data_set_local_ref": "ae03f918-023f-41e3-87f4-6c93658b6e69",
7
+ "list_template_local_ref": "44a20c27-7195-40b2-b351-604960c4ef2e",
8
+ "filter_template_local_ref": "fc132a7a-11aa-4d54-a767-ab7a01d9e135",
9
+ "form_template_local_ref": "6a69e591-8ccc-4cb1-af9b-4238e3895486",
10
10
  "form_template_name": "负卖配置表",
11
11
  "default_qualification": "兴盛",
12
12
  "default_status": 0,
@@ -3,10 +3,10 @@
3
3
  "workspace": "store_mgr",
4
4
  "flow_type": "flow260273915",
5
5
  "flow_name": "全国负卖额度主流程",
6
- "data_set_uuid": "c96d6a86-9da7-4c1b-8a5b-859c04503ecb",
7
- "list_template_uuid": "409d1340-e618-42ec-9614-d4433f706f19",
8
- "filter_template_uuid": "268864fd-1c6b-4aca-b641-8c6dc04fd659",
9
- "form_template_uuid": "0134a90d-f0a0-4294-b9bf-b8fc3a05485b",
6
+ "data_set_local_ref": "c96d6a86-9da7-4c1b-8a5b-859c04503ecb",
7
+ "list_template_local_ref": "409d1340-e618-42ec-9614-d4433f706f19",
8
+ "filter_template_local_ref": "268864fd-1c6b-4aca-b641-8c6dc04fd659",
9
+ "form_template_local_ref": "0134a90d-f0a0-4294-b9bf-b8fc3a05485b",
10
10
  "form_template_name": "负卖额度分配主表单",
11
11
  "default_qualification": "兴盛",
12
12
  "default_status": 0,
@@ -3,10 +3,10 @@
3
3
  "workspace": "store_mgr",
4
4
  "flow_type": "flow465815201",
5
5
  "flow_name": "大区下经销商额度分配流程",
6
- "data_set_uuid": "8b38f09c-7289-4c72-8acd-3cd82c6e9acb",
7
- "list_template_uuid": "5c3e078f-3df2-43e5-ae8e-0e1b24e7a7f0",
8
- "filter_template_uuid": "19ce66bd-32ac-4e1e-86f4-ae10ee31e3d0",
9
- "form_template_uuid": "9fec0483-7933-4d4f-9d72-c9d2f03734ed",
6
+ "data_set_local_ref": "8b38f09c-7289-4c72-8acd-3cd82c6e9acb",
7
+ "list_template_local_ref": "5c3e078f-3df2-43e5-ae8e-0e1b24e7a7f0",
8
+ "filter_template_local_ref": "19ce66bd-32ac-4e1e-86f4-ae10ee31e3d0",
9
+ "form_template_local_ref": "9fec0483-7933-4d4f-9d72-c9d2f03734ed",
10
10
  "form_template_name": "大区负卖额度开始表单",
11
11
  "default_qualification": "兴盛",
12
12
  "default_status": 0,
@@ -3,7 +3,7 @@
3
3
  负卖配置筛选字段按三层取证:
4
4
 
5
5
  ## 1. 数据集字段
6
- - 来源:`think_data_set/uuid'ae03f918-023f-41e3-87f4-6c93658b6e69___is_del'0/...`
6
+ - 来源:profile `data_set_local_ref` 对应的本地 `think_data_set` 镜像目录
7
7
  - 作用:给出“理论上可被列表查询”的字段全集
8
8
  - 当前关键字段:
9
9
  - `name`
@@ -17,7 +17,7 @@
17
17
  - `effectiveEndDate`
18
18
 
19
19
  ## 2. 筛选模板字段
20
- - 来源:`think_flow_page_template/uuid'fc132a7a-11aa-4d54-a767-ab7a01d9e135/flow_page_template.content`
20
+ - 来源:profile `filter_template_local_ref` 对应的本地 `think_flow_page_template` 镜像目录
21
21
  - 作用:给出“当前页面实际暴露”的筛选项
22
22
  - 当前生效项:
23
23
  - 项目名称 `name`
@@ -8,9 +8,9 @@
8
8
  适用样板流程:
9
9
  - 工作区:`store_mgr`
10
10
  - `flow_type`:`flow288204142`
11
- - 数据集:`ae03f918-023f-41e3-87f4-6c93658b6e69`
12
- - 列表模板:`44a20c27-7195-40b2-b351-604960c4ef2e`
13
- - 筛选模板:`fc132a7a-11aa-4d54-a767-ab7a01d9e135`
11
+ - 数据集:profile `data_set_local_ref` 仅用于定位本地镜像;提交时必须使用远端数字 ID 或 `data_set_key`
12
+ - 列表模板:profile `list_template_local_ref` 仅用于定位本地镜像;提交时必须使用远端数字页面模板 ID
13
+ - 筛选模板:profile `filter_template_local_ref` 仅用于定位本地镜像;提交时必须使用远端数字页面模板 ID
14
14
  - 表单模板:`负卖配置表`
15
15
 
16
16
  ## 节点链路
@@ -5,13 +5,15 @@ Profile 目录默认在 `.codex/skills/bpmax-e2e-flow-test-operator/profiles/`
5
5
  ## 必填字段
6
6
  - `workspace`
7
7
  - `flow_type`
8
- - `data_set_uuid`
9
- - `list_template_uuid`
10
- - `filter_template_uuid`
11
- - `form_template_uuid`
8
+ - `data_set_local_ref`
9
+ - `list_template_local_ref`
10
+ - `filter_template_local_ref`
11
+ - `form_template_local_ref`
12
12
 
13
13
  缺少任一必填字段时,`flow_test_profile.py` 会直接报错退出。
14
14
 
15
+ `*_local_ref` 只用于 E2E 脚本定位本地 sysconfig 镜像。它不是 BPMAX 远端配置 ID,不能写入 form-template、dataset、page-template、flow-template 或 workspace-flow 的提交 payload。旧 profile 中的 `*_uuid` 字段仍被脚本兼容读取,但新 profile 不再使用该命名。
16
+
15
17
  ## 常用可选字段
16
18
  - `name`
17
19
  - `flow_name`
@@ -11,12 +11,12 @@ ROOT = Path(__file__).resolve().parents[4]
11
11
  SKILL_DIR = Path(__file__).resolve().parents[1]
12
12
  PROFILE_DIR = SKILL_DIR / "profiles"
13
13
  REQUIRED_PROFILE_KEYS = (
14
- "workspace",
15
- "flow_type",
16
- "data_set_uuid",
17
- "list_template_uuid",
18
- "filter_template_uuid",
19
- "form_template_uuid",
14
+ ("workspace",),
15
+ ("flow_type",),
16
+ ("data_set_uuid", "data_set_local_ref"),
17
+ ("list_template_uuid", "list_template_local_ref"),
18
+ ("filter_template_uuid", "filter_template_local_ref"),
19
+ ("form_template_uuid", "form_template_local_ref"),
20
20
  )
21
21
 
22
22
 
@@ -48,10 +48,10 @@ class FlowTestProfile:
48
48
  workspace=str(payload.get("workspace") or ""),
49
49
  flow_type=str(payload.get("flow_type") or ""),
50
50
  flow_name=str(payload.get("flow_name") or ""),
51
- data_set_uuid=str(payload.get("data_set_uuid") or ""),
52
- list_template_uuid=str(payload.get("list_template_uuid") or ""),
53
- filter_template_uuid=str(payload.get("filter_template_uuid") or ""),
54
- form_template_uuid=str(payload.get("form_template_uuid") or ""),
51
+ data_set_uuid=str(payload.get("data_set_uuid") or payload.get("data_set_local_ref") or ""),
52
+ list_template_uuid=str(payload.get("list_template_uuid") or payload.get("list_template_local_ref") or ""),
53
+ filter_template_uuid=str(payload.get("filter_template_uuid") or payload.get("filter_template_local_ref") or ""),
54
+ form_template_uuid=str(payload.get("form_template_uuid") or payload.get("form_template_local_ref") or ""),
55
55
  form_template_name=str(payload.get("form_template_name") or ""),
56
56
  default_qualification=str(payload.get("default_qualification") or ""),
57
57
  default_status=int(payload.get("default_status", 0) or 0),
@@ -112,7 +112,7 @@ def load_profile_mapping(path: Path) -> Dict[str, Any]:
112
112
 
113
113
 
114
114
  def validate_profile_mapping(payload: Dict[str, Any], *, source: str) -> None:
115
- missing = [key for key in REQUIRED_PROFILE_KEYS if not payload.get(key)]
115
+ missing = ["/".join(keys) for keys in REQUIRED_PROFILE_KEYS if not any(payload.get(key) for key in keys)]
116
116
  if missing:
117
117
  raise SystemExit(f"profile missing required keys from {source}: {', '.join(missing)}")
118
118
 
@@ -141,7 +141,7 @@ export BPMAX_BASE_URL='https://<your-bpmax-host>'
141
141
  - 当前环境已验证:当 `draft=1` 接口空壳且退回 `runtime_fallback` 时,导出脚本应继续从已发布 live `/api/flow` 补齐 `name` 和 `updateTime`,否则后续提交会因为缺少顶层字段而失真。
142
142
  - 当前环境已验证:`document.cookie` 往往拿不到 httpOnly 登录态;脚本鉴权优先复用同域真实请求头里的完整 `cookie` header,而不是只靠页面脚本读 cookie。
143
143
  - 当前页面已验证:节点跳转字段 `approve_to_step` / `approve_fail` 默认使用节点 `id`;脚本校验应以节点 `id` 优先,节点名兼容。
144
- - 当前环境已验证:本地 `think_flow_page_template` 里的 `uuid` 只适合离线检索;真正提交到 `/api/flow` 的 `node.step_detail_id` / `meta.step_detail_id` 要使用线上远端数字 `id`。例如“开始和环节表单”在本地是 `uuid'45fd9d71-6140-4690-ac17-57d9c04ee56a`,在线上实际提交值是 `954572656`。
144
+ - 当前环境已验证:本地 `think_flow_page_template` 里的 UUID 目录名只适合离线检索;真正提交到 `/api/flow` 的 `node.step_detail_id` / `meta.step_detail_id` 要使用线上远端数字 `id`。不要把任何 UUID 目录名、`uuid'...'` 路径片段或本地镜像 ID 写入提交 payload。
145
145
  - 当前页面已验证:`data.group` 在线上真实返回和运行时中观测为 `array`;编辑场景应保留真实形态,不做归一化。
146
146
  - `data.group` 现在视为硬门禁字段:`work`/`submit`/草稿回读里都必须是 `array`。不要再接受“后端能存、前端再说”的 `{}`
147
147
  - 判断“流程是不是被改坏了”时,至少交叉核对三处事实:编辑器画布、页面运行时 `getSubmitData()`、`GET /api/flow?draft=1`。三者不一致时,默认先以浏览器当前编辑器和运行时为准,不要只盯着草稿接口下结论。
@@ -29,7 +29,7 @@
29
29
  - 页面真实请求最终保存的是 `meta.form_template = 990702239`,也就是远端表单模板数字 `id`。
30
30
  - `GET /api/form_template/990702239` 返回:
31
31
  - `name = 价格方案表`
32
- - `uuid = 63adcdad-069e-40f1-bd30-08dab4874bc6`
32
+ - `uuid = <local-mirror-template-ref>`,仅用于定位本地镜像,不得作为配置 ID 提交
33
33
  - `origin_template_id = 990702238`
34
34
  - 结论:
35
35
  - 本地目录负责找“是什么模板”
@@ -143,5 +143,5 @@
143
143
  - `meta.table_list_template = 954573606`
144
144
  - `meta.table_filter_template = 954573605`
145
145
  - 对应本地锚点分别是:
146
- - `uuid'7b6d753b-1ee5-4e74-8a7b-5dd1175892ed`
147
- - `uuid'69976886-2d0c-4d2b-8b47-5fed26b53835`
146
+ - `<local-mirror-list-template-ref>`
147
+ - `<local-mirror-filter-template-ref>`
@@ -8,6 +8,7 @@
8
8
  - 业务流程消费点:把矩阵数据转成负责人或抄送
9
9
  - 工作区与导航:把矩阵流程暴露给用户
10
10
  - 当前环境主样例优先看 `flow511341945 / 审批流角色`。
11
+ - 创建矩阵应用不等于创建矩阵规则数据。矩阵应用/流程/表单/list/filter 只是承载规则的配置壳;真实可命中的审批矩阵还必须有线上项目记录,且记录中的审批人字段必须是真实用户值。
11
12
 
12
13
  ## 主样例:`flow511341945 / 审批流角色`
13
14
  - 来源配置:
@@ -17,9 +18,8 @@
17
18
  - `sysconfig-cltxtest/think_configuration/type'navmenu___workspace'project_management/configuration.content`
18
19
  - 已确认事实:
19
20
  - `category = "matrix"`
20
- - `meta.form_template = "is_del'0___origin_template_id'!0___uuid'1bab98e0-925e-400f-b0b0-5a191cf27ca4"`
21
- - `meta.table_list_template = "uuid'6252e0bf-bdc0-4871-917d-4d77ce920543"`
22
- - `meta.table_filter_template = "uuid'93ae35b6-9b53-4827-953c-1ee451a36d07"`
21
+ - 本地镜像里可能显示 `uuid'...'` 形式的模板引用;这些只能作为镜像定位线索,不能作为 typed CLI submit/export/verify 的 ID
22
+ - 真实提交必须先从线上流程读取发布态数字 ID,再由 CLI 定位草稿数字 ID
23
23
  - `workspace_flow` 把它挂到 `project_management` 工作区
24
24
  - `navmenu` 里存在入口:
25
25
  - `name = "审批流角色"`
@@ -34,12 +34,13 @@
34
34
  - 节点上没有典型审批链配置,`auto_range_type`、`approve_to_step` 之类不是主角
35
35
  - 这类流程最终被下游消费时,消费点读的是矩阵 ES 数据集,而不是直接读这个流程节点本身。
36
36
  - 如果目标是新搭一套矩阵能力,优先先判断它是不是“矩阵数据维护流程”,而不是先按审批流思路补节点。
37
+ - `flow-app create` 只能创建矩阵应用配置;它不会自动 seed 矩阵规则记录,也不会凭本地 `seed-rules.json` 写线上项目。
37
38
 
38
39
  ## 2. 矩阵表单怎么挂
39
40
  - 矩阵流程的创建/编辑表单优先挂在 `data.meta.form_template`,不是节点 `node.form_template`。
40
41
  - `flow511341945` 的矩阵表单就是:
41
42
  - `审批流角色矩阵`
42
- - 本地引用值:`uuid 1bab98e0-925e-400f-b0b0-5a191cf27ca4`
43
+ - 本地镜像引用可能是 UUID,但真实编辑必须改用线上数字草稿 ID
43
44
  - 同一条矩阵管理链路里,通常还会同时存在:
44
45
  - `meta.table_list_template`
45
46
  - `meta.table_filter_template`
@@ -163,3 +164,5 @@
163
164
  - 负责人:`auto_range_type = "matrix"` + `matrix_owner`
164
165
  - 抄送:`cc_type = "matrix"` + `cc_matrix`
165
166
  - 矩阵脚本是否真的返回用户对象或用户 id,而不是别的结构
167
+ - 矩阵规则记录是否已真实创建,并且审批人字段不是空值、示例文本或本地占位符
168
+ - 如果只有矩阵应用没有规则记录,业务流程接入 `matrix_owner` 后仍会查不到审批人