bpmax-cli 0.2.1-beta.79 → 0.2.1-beta.80

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bpmax-cli",
3
- "version": "0.2.1-beta.79",
3
+ "version": "0.2.1-beta.80",
4
4
  "description": "CLI for BPMAX environments with multi-profile config and local login callback flow",
5
5
  "type": "module",
6
6
  "bin": {
@@ -80,6 +80,13 @@ description: "用于通过 bpmax-cli typed config 能力创建和编辑 BPMAX
80
80
 
81
81
  ## 核心配置门禁
82
82
  - typed CLI 主路径已覆盖同一硬门禁:`config flow-template lint/build/submit/create` 和 `config flow-app create` 会阻断本地 `uuid`、目录引用或非数字模板引用。
83
+ - 阶段与环节最小结构硬门禁(无豁免):任何一次 `flow-template lint/build/create/submit` 和 `flow-app create` 都要求流程同时具备
84
+ - `data.periods` 至少包含一个非空名称的阶段(阶段);
85
+ - `data.nodes` 至少包含一个 `id` 与非空 `name` 都齐全的环节(环节)。
86
+ - 空数组、纯空白阶段名、缺 `id` 或缺 `name` 的节点都不算数。失败信息为 `flow-template stage/step coverage gate failed: ...` 或 `flow-template refuses an empty flow; data.periods|data.nodes ...`。
87
+ - 该门禁不接受 `bpmax_lint` 豁免、也不走 `--allow-preexisting-lint-errors` 基线折扣:把"没有阶段/没有环节"的流程当已存在基线继续提交,会在远端请求前被阻断。存量流程若本身缺阶段或环节,必须先补齐再提交,不能以"历史就是这样"为由带过。
88
+ - 只想改 `meta`(例如只调创建页文案)也要保留既有阶段和节点;`periods: []` + `nodes: []` 的流程壳不能提交,只能先在 work 里补出至少一个阶段和一个环节。
89
+ - `verify` 只回读不写,因此对历史流程把同样问题作为 `[flow_template_stage_step_coverage]` warning 报告,便于发现存量缺口而不阻断只读验收;修复仍必须回到 work 并重新走 lint/build/submit。
83
90
  - 线上模板引用硬门禁:`meta_form_id`、`data.meta.form_template`、`data.meta.table_list_template`、`data.meta.table_filter_template`、`data.meta.step_detail_id`、`data.nodes[].form_template`、`data.nodes[].step_detail_id` 只允许当前环境远端数字 `id`。
84
91
  - 流程分类引用硬门禁:`flow-template lint/build/create/submit/verify` 会按当前 profile 回读有效 flow category,并校验顶层 `category`。只能从回读得到的 key 中选择;未知、已删除或禁用 key 会在 `$.category` hard fail,CLI 不得根据英文业务语义猜测分类 key。
85
92
  - 环节模板硬门禁:环节详情模板引用在 `flow-template lint/build/create/submit/verify` 中会按当前 profile 回读每个有效 `step_detail_id`,确认远端存在且 `type=6`,并检查节点表单语义;输出中包含 `节点名 -> effective step_detail_id -> 模板名/类型/关键模块 -> 适配结论`。无效 ID、错类型、`enable_relate_project_form=true` 但缺少“关联项目表单”模块均为 hard error。
@@ -657,6 +657,7 @@ bpmax-cli config readback form-template --id <form_template_id> --format json
657
657
  - `meta.form_template = <remote_form_template_id>`
658
658
  - `meta.use_template_project_name = true`
659
659
  - `meta.project_name_template = ...`
660
+ - 即使发起入口完全由 `meta` 承担,`data.periods` 与 `data.nodes` 仍不能都为空:typed CLI 的 `lint/build/create/submit` 都要求至少一个非空阶段和一个 `id`/`name` 齐全的环节。不要在“只改 meta”的重构里把阶段和节点清空,也不要以为 `isMeta = true` 可以替代最小结构。
660
661
  - 对“表单驱动发起”的新流程,除非用户明确要求保留系统项目字段,否则把下面这组视为默认基线:
661
662
  - `meta.hide_fields` 包含:
662
663
  - `project.name`
@@ -8,6 +8,8 @@
8
8
  ## data 结构
9
9
  - `periods` 是否是数组
10
10
  - `nodes` 是否是数组
11
+ - 最小结构硬门禁(无豁免):`periods` 至少一个非空名称的阶段,`nodes` 至少一个 `id` 和非空 `name` 都齐全的环节;否则 `lint/build/create/submit` 会在远端请求前阻断
12
+ - 只改 `meta` 或只改创建页时,是否误把既有阶段和节点清空
11
13
  - 如存在 `meta`、`group`、`settings`,是否被意外删除
12
14
  - `meta` 下已有 `project_name_template`、`object_events`、`hook`、`plugin_*` 是否被误删
13
15
  - `meta` 是否仍保留发起入口语义:
@@ -69,11 +69,30 @@ bpmax-cli config page-template export --id <id> --out <dir> --profile <profile>
69
69
  bpmax-cli config page-template lint --work <dir>/work/<file>.json --profile <profile> --format json
70
70
  bpmax-cli config page-template impact --raw <dir>/raw/<file>.json --work <dir>/work/<file>.json --out <dir>/result/impact.json --profile <profile> --format json
71
71
  bpmax-cli config page-template preview --work <dir>/work/<file>.json --out <dir>/preview --mode mock --format json
72
- bpmax-cli config page-template build --work <dir>/work/<file>.json --meta <dir>/meta/<file>.meta.json --preview-manifest <dir>/preview/preview.manifest.json --out <dir>/submit/<file>.json --profile <profile> --format json
72
+ bpmax-cli config page-template build --work <dir>/work/<file>.json --meta <dir>/meta/<file>.meta.json --preview-manifest <dir>/preview/preview.manifest.json --boundary-manifest <dir>/result/scope.json --out <dir>/submit/<file>.json --profile <profile> --format json
73
73
  bpmax-cli config page-template submit --id <id> --payload <dir>/submit/<file>.json --profile <profile> --format json
74
74
  bpmax-cli config page-template verify --id <id> --expect <dir>/work/<file>.json --profile <profile> --format json
75
75
  ```
76
76
 
77
+ ### 编辑范围门禁(edit 必需)
78
+
79
+ 编辑已有模板时,`build` 必须传 `--boundary-manifest`,声明本次只允许修改的 JSON 路径;新建(`mode: "create"`)不需要。
80
+
81
+ ```json
82
+ {
83
+ "schema_version": 1,
84
+ "change_type": "page-template-scope",
85
+ "allowed_paths": ["/template/render/template"],
86
+ "forbidden_paths": ["/key", "/template/data/queries"],
87
+ "rationale": "只修改页面标题文案"
88
+ }
89
+ ```
90
+
91
+ - 路径为 JSON Pointer;`/a/b` 与 `/a/b/**` 都覆盖其子路径。`/` 和 `/template` 被视为过宽而拒绝;`/id`、`/uuid` 默认禁止修改。
92
+ - build 用导出的 raw 基线(hash 必须等于 `meta.base_hash`)做两层比对:raw→work 的字面修改,和 canonical(raw)→payload 的提交变化。每个变化被分为 `requested`(在 allowed 内)、`required_collateral`(由已请求修改推导出的字段,例如 `render.style` 变化导致的 `render.css`)或 `out_of_scope`。只要存在 `out_of_scope` 或命中 `forbidden_paths`,build 以 `[page_template_scope_exceeded]` 阻断并列出路径。
93
+ - 结果写入 submit 文件的 `page_template_scope`,绑定 `raw_hash` 和 `payload_hash`。非 dry-run 的 edit submit 缺少该产物、产物与 payload 不一致或含越界路径时,以 `[page_template_scope_artifact_required]` 在远端请求前阻断。
94
+ - 越界时先撤回无关修改;确实需要改的字段才加入 `allowed_paths`,不要用放宽路径绕过门禁。
95
+
77
96
  带有 `build --preview-manifest` 生成且仍与 canonical payload hash 匹配的 page-template submit payload,会复用该 manifest 作为确认凭据,因此不再要求重复传入 `--confirm`。显式传入 `--dry-run` 始终只输出计划、不写远端;缺少或过期 manifest 的真实写入会在远端请求前阻断。若额外传入 `--confirm`,其值必须与目标对象匹配,否则在远端请求前拒绝。
78
97
 
79
98
  ## 数据层查询引擎(默认 ES)