bpmax-cli 0.2.1-beta.5 → 0.2.1-beta.50

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 (152) hide show
  1. package/README.md +13 -5
  2. package/dist/bin.js +25216 -12623
  3. package/dist/bin.js.map +1 -1
  4. package/package.json +10 -5
  5. package/scripts/run-source-cli.mjs +121 -0
  6. package/skills/bpmax-ai-taskbook/SKILL.md +2 -0
  7. package/skills/bpmax-api-platform-editor/SKILL.md +24 -31
  8. package/skills/bpmax-api-platform-editor/agents/openai.yaml +2 -2
  9. package/skills/bpmax-api-platform-editor/references/platform-api-map.md +2 -2
  10. package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +3 -3
  11. package/skills/bpmax-approval-matrix/SKILL.md +54 -2
  12. package/skills/bpmax-blueprint-doc-workflow/SKILL.md +87 -0
  13. package/skills/bpmax-blueprint-doc-workflow/agents/openai.yaml +4 -0
  14. package/skills/bpmax-blueprint-doc-workflow/references/blueprint-structure.md +60 -0
  15. package/skills/bpmax-blueprint-doc-workflow/references/per-flow-required-structure.md +98 -0
  16. package/skills/bpmax-blueprint-doc-workflow/references/sample-forbidden-term.xml +12 -0
  17. package/skills/bpmax-blueprint-doc-workflow/references/sample-mermaid-codeblock.xml +12 -0
  18. package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-boundary.xml +10 -0
  19. package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-whiteboard.xml +10 -0
  20. package/skills/bpmax-blueprint-doc-workflow/references/sample-pass.xml +55 -0
  21. package/skills/bpmax-blueprint-doc-workflow/scripts/lint_blueprint_doc.py +257 -0
  22. package/skills/bpmax-bug-reporting/SKILL.md +72 -0
  23. package/skills/bpmax-builder-shared/SKILL.md +1 -0
  24. package/skills/bpmax-builder-shared/configuration-impact-review.md +76 -0
  25. package/skills/bpmax-builder-shared/template_script_hard_rules.py +3 -1
  26. package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +16 -0
  27. package/skills/bpmax-cli/SKILL.md +43 -0
  28. package/skills/bpmax-config-latest/SKILL.md +4 -0
  29. package/skills/bpmax-console-template-editor/SKILL.md +112 -523
  30. package/skills/bpmax-console-template-editor/agents/openai.yaml +2 -2
  31. package/skills/bpmax-console-template-editor/references/full-detail-guide.md +45 -0
  32. package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +13 -12
  33. package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +299 -78
  34. package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +344 -30
  35. package/skills/bpmax-dataset-field-template-editor/SKILL.md +127 -594
  36. package/skills/bpmax-dataset-field-template-editor/references/full-detail-guide.md +570 -0
  37. package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +1 -1
  38. package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +11 -77
  39. package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +4 -57
  40. package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +2 -0
  41. package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +4 -78
  42. package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +3 -89
  43. package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +14 -0
  44. package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +2 -0
  45. package/skills/bpmax-dataset-template-editor/SKILL.md +116 -778
  46. package/skills/bpmax-dataset-template-editor/references/full-detail-guide.md +753 -0
  47. package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +1 -0
  48. package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +2 -2
  49. package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +8 -1
  50. package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +9 -90
  51. package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +8 -1
  52. package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +8 -1
  53. package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +1 -2
  54. package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +8 -1
  55. package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +8 -1
  56. package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +6 -40
  57. package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +18 -4
  58. package/skills/bpmax-e2e-flow-config-orchestrator/agents/openai.yaml +2 -2
  59. package/skills/bpmax-e2e-flow-config-orchestrator/references/orchestration-matrix.md +13 -9
  60. package/skills/bpmax-e2e-flow-test-operator/SKILL.md +150 -546
  61. package/skills/bpmax-e2e-flow-test-operator/agents/openai.yaml +2 -3
  62. package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +136 -13
  63. package/skills/bpmax-e2e-flow-test-operator/references/browser-action-dsl.md +85 -0
  64. package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +6 -5
  65. package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +576 -0
  66. package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +2 -0
  67. package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +4 -4
  68. package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +1 -1
  69. package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +3 -1
  70. package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +7 -5
  71. package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +2 -2
  72. package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +5 -1
  73. package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +71 -0
  74. package/skills/bpmax-filter-template-editor/SKILL.md +114 -551
  75. package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +18 -18
  76. package/skills/bpmax-filter-template-editor/references/filter-content-schema.md +21 -0
  77. package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +29 -26
  78. package/skills/bpmax-filter-template-editor/references/filter-runtime-patterns.md +19 -2
  79. package/skills/bpmax-filter-template-editor/references/full-detail-guide.md +56 -0
  80. package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +10 -9
  81. package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +7 -57
  82. package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +4 -48
  83. package/skills/bpmax-flow/SKILL.md +2 -0
  84. package/skills/bpmax-flow-detail-template-editor/SKILL.md +53 -0
  85. package/skills/bpmax-flow-template-editor/SKILL.md +120 -1084
  86. package/skills/bpmax-flow-template-editor/agents/openai.yaml +2 -2
  87. package/skills/bpmax-flow-template-editor/references/diff-strategy.md +3 -3
  88. package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +9 -9
  89. package/skills/bpmax-flow-template-editor/references/flow-template-api-workflow.md +2 -1
  90. package/skills/bpmax-flow-template-editor/references/full-detail-guide.md +1157 -0
  91. package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +1 -1
  92. package/skills/bpmax-flow-template-editor/references/project-create-runtime-gotchas.md +17 -0
  93. package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +8 -3
  94. package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +7 -7
  95. package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +2 -2
  96. package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +8 -2
  97. package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +7 -23
  98. package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +1 -1
  99. package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +19 -75
  100. package/skills/bpmax-form-template-editor/SKILL.md +133 -1104
  101. package/skills/bpmax-form-template-editor/agents/openai.yaml +2 -2
  102. package/skills/bpmax-form-template-editor/references/dynamic-field-state.md +167 -0
  103. package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +51 -51
  104. package/skills/bpmax-form-template-editor/references/full-detail-guide.md +1115 -0
  105. package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +4 -4
  106. package/skills/bpmax-form-template-editor/references/payload-checklist.md +3 -1
  107. package/skills/bpmax-form-template-editor/references/sub-form-patterns.md +6 -0
  108. package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +8 -0
  109. package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +42 -19
  110. package/skills/bpmax-functional-test-design/LICENSE.upstream +24 -0
  111. package/skills/bpmax-functional-test-design/SKILL.md +80 -0
  112. package/skills/bpmax-functional-test-design/agents/openai.yaml +4 -0
  113. package/skills/bpmax-functional-test-design/references/bpmax-test-suite-output.md +95 -0
  114. package/skills/bpmax-functional-test-design/references/decision-table-testing.md +50 -0
  115. package/skills/bpmax-functional-test-design/references/domain-testing.md +43 -0
  116. package/skills/bpmax-functional-test-design/references/state-transition-testing.md +47 -0
  117. package/skills/bpmax-functional-test-design/references/technique-selection.md +38 -0
  118. package/skills/bpmax-functional-test-design/references/use-case-testing.md +55 -0
  119. package/skills/bpmax-group-model-editor/SKILL.md +24 -0
  120. package/skills/bpmax-list-template-editor/SKILL.md +119 -466
  121. package/skills/bpmax-list-template-editor/agents/openai.yaml +2 -2
  122. package/skills/bpmax-list-template-editor/references/content-config-shape.md +16 -4
  123. package/skills/bpmax-list-template-editor/references/full-detail-guide.md +458 -0
  124. package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +6 -9
  125. package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +1 -1
  126. package/skills/bpmax-list-template-editor/references/special-formats.md +5 -2
  127. package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +9 -78
  128. package/skills/bpmax-memory-protocol/SKILL.md +7 -6
  129. package/skills/bpmax-nav-config-editor/SKILL.md +13 -17
  130. package/skills/bpmax-nav-config-editor/agents/openai.yaml +2 -2
  131. package/skills/bpmax-nav-config-editor/references/api-workflow.md +2 -2
  132. package/skills/bpmax-nav-config-editor/references/runtime-probing.md +11 -12
  133. package/skills/bpmax-plugin-config/SKILL.md +20 -4
  134. package/skills/bpmax-project/SKILL.md +37 -1
  135. package/skills/bpmax-project-detail-template-editor/SKILL.md +13 -39
  136. package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +2 -2
  137. package/skills/bpmax-role-editor/SKILL.md +7 -30
  138. package/skills/bpmax-shared/SKILL.md +19 -9
  139. package/skills/bpmax-team-editor/SKILL.md +27 -0
  140. package/skills/bpmax-ui-ux-audit/LICENSE.upstream +23 -0
  141. package/skills/bpmax-ui-ux-audit/SKILL.md +42 -0
  142. package/skills/bpmax-ui-ux-audit/agents/openai.yaml +4 -0
  143. package/skills/bpmax-ui-ux-audit/references/audit-framework.md +39 -0
  144. package/skills/bpmax-ui-ux-audit/references/bpmax-ux-findings.md +56 -0
  145. package/skills/bpmax-user/SKILL.md +33 -1
  146. package/skills/bpmax-user-mock-operator/SKILL.md +20 -48
  147. package/skills/bpmax-user-mock-operator/agents/openai.yaml +2 -2
  148. package/skills/bpmax-user-model-editor/SKILL.md +24 -0
  149. package/skills/form-control-library/references/form-template-submit-schema.md +1 -1
  150. package/skills/bpmax-user-mock-operator/scripts/switch_user_identity.py +0 -37
  151. package/skills/bpmax-user-mock-operator/scripts/user_mock_operator_common.py +0 -136
  152. package/skills/bpmax-user-mock-operator/tests/test_user_mock_operator.py +0 -138
@@ -4,32 +4,32 @@
4
4
 
5
5
  | 旧经验 / 风险点 | 当前覆盖情况 | 覆盖层 | 覆盖位置 | 人工判定点 / 后续动作 |
6
6
  | --- | --- | --- | --- | --- |
7
- | 列表页可以作为合法起手页 | 已覆盖 | 主流程 | `SKILL.md` 的核心原则、工作流 1 | 无 |
8
- | 复杂模板默认按代码模式理解 | 已覆盖 | 主流程 | `SKILL.md` 的核心原则、工作流 5 | 无 |
9
- | 页面与 skill 不一致时如何更新规则 | 已覆盖 | 实战经验 | `SKILL.md` 的实战经验“页面和 skill 不一致时的更新规则” | 无 |
10
- | 低基数字段先抽样再决定是否改为 `select` | 已覆盖 | 主流程 + 实战经验 | `SKILL.md` 的工作流 5、实战经验“当前环节低基数时应改为下拉” | 仍需人工判断抽样值是否足够代表真实分布 |
11
- | 时间范围可能要在 `beforeSearch` 中改写为 `raw range` | 已覆盖 | 专项约定 + 运行态证据 | `SKILL.md` 的专项约定 `beforeSearch` / 时间范围、`filter-content-schema.md` | 保留一份强验证或高价值弱验证记录 |
12
- | 强验证 / 弱验证 / 未能验证必须区分 | 已覆盖 | 输出要求 + 验证规则 | `SKILL.md` 的时间范围专项约定、提交后验证与输出要求 | 仍需人工判断当前样本是否足以宣告强验证 |
13
- | “数据集 id” 不等于模板 `data_set_id` | 已覆盖 | 主流程 + 实战经验 | `SKILL.md` 的核心原则、`runtime-verified-filter-page-shape.md`、实战经验 | 若涉及字段池异常,仍需人工核对真实字段池请求 |
14
- | 裸接口成功不等于模板内容真的更新 | 已覆盖 | 提交方式 + readback blocker | `SKILL.md` 的提交方式、提交后回读、实战经验 | `submit_filter_template.py` 已把 `submit -> readback` 比对做成 blocker |
15
- | 页面组件 `save()` 只解决一部分问题,不等于最佳默认闭环 | 已覆盖 | 主流程 + 实战经验 | `SKILL.md` 的提交方式、`runtime-verified-filter-page-shape.md`、实战经验 | 保持为 fallback |
16
- | 新建模板不能依赖现有 template id | 已覆盖 | 主流程 + 接口契约 | `SKILL.md` 的核心原则、工作流 3/4、`filter-request-shape.md` | 后续 `init_create_filter_template.py` 负责固化 create skeleton |
17
- | 文档不能把未实现脚本写成现成入口 | 已覆盖 | 主流程 + 现状说明 | `SKILL.md` 的核心原则、提交方式、`filter-request-shape.md`、`runtime-verified-filter-page-shape.md` | 持续用 bpmax-builder-shared audit 防止回退 |
18
- | 最终配置必须通过脚本提交 | 已覆盖 | 提交方式 + submit blocker | `SKILL.md` 的提交方式、`filter-request-shape.md` 的最终提交口径 | `submit_filter_template.py` 是唯一最终完成入口 |
19
- | 提交前必须先通过 lint 检查合法性 | 已覆盖 | lint gate | `SKILL.md` 的 lint 检查、`filter-request-shape.md` 的最终提交口径 | `lint_filter_template_semantics.py` 在 blocker 存在时阻断提交 |
7
+ | 列表页可以作为合法起手页 | 已覆盖 | 标准闭环 + 只读验收 | `SKILL.md` 的标准闭环、Verify 与 E2E 验收 | 无 |
8
+ | 复杂模板默认按代码模式理解 | 已覆盖 | 结构与生效门禁 | `SKILL.md` 的结构与生效门禁、查询与脚本 lint | 无 |
9
+ | 页面与 skill 不一致时如何更新规则 | 已覆盖 | 历史归档 | `full-detail-guide.md` 的旧规则去向 | 无 |
10
+ | 低基数字段先抽样再决定是否改为 `select` | 已覆盖 | 结构门禁 + 运行态模式 | `SKILL.md` 的结构与生效门禁、`filter-runtime-patterns.md` | 仍需人工判断抽样值是否足够代表真实分布 |
11
+ | 时间范围可能要在 `beforeSearch` 中改写为 `raw range` | 已覆盖 | 结构门禁 + 内容 schema | `SKILL.md` 的结构与生效门禁、`filter-content-schema.md` | 保留一份强验证或高价值弱验证记录 |
12
+ | 强验证 / 弱验证 / 未能验证必须区分 | 已覆盖 | Verify 与 E2E 验收 | `SKILL.md` 的 Verify 与 E2E 验收、输出要求 | 仍需人工判断当前样本是否足以宣告强验证 |
13
+ | “数据集 id” 不等于模板 `data_set_id` | 已覆盖 | 核心配置门禁 | `SKILL.md` 的核心配置门禁、`runtime-verified-filter-page-shape.md` | 若涉及字段池异常,仍需人工核对真实字段池请求 |
14
+ | 裸接口成功不等于模板内容真的更新 | 已覆盖 | Verify/readback blocker | `SKILL.md` 的 Verify 与 E2E 验收 | typed CLI submit 后必须继续 verify/readback |
15
+ | 页面组件 `save()` 只解决一部分问题,不等于最佳默认闭环 | 已覆盖 | 写入路径硬约束 | `SKILL.md` 的写入路径硬约束、`runtime-verified-filter-page-shape.md` | 只能作为历史反例,不得作为 fallback |
16
+ | 新建模板不能依赖现有 template id | 已覆盖 | Work/Submit 边界 + 接口契约 | `SKILL.md` 的 Work/Submit 边界、`filter-request-shape.md` | typed CLI create work 负责固化 create skeleton |
17
+ | 文档不能把未实现脚本写成现成入口 | 已覆盖 | 写入路径硬约束 + reference 说明 | `SKILL.md` 的写入路径硬约束、`filter-request-shape.md`、`runtime-verified-filter-page-shape.md` | 持续用 bpmax-builder-shared audit 防止回退 |
18
+ | 最终配置必须通过 typed CLI 提交 | 已覆盖 | 写入路径硬约束 | `SKILL.md` 的写入路径硬约束、`filter-request-shape.md` 的最终提交口径 | `bpmax-cli config filter-template submit/create/delete` 是唯一写入入口 |
19
+ | 提交前必须先通过 lint 检查合法性 | 已覆盖 | 标准闭环 + lint gate | `SKILL.md` 的标准闭环、查询与脚本 lint、`filter-request-shape.md` | typed CLI lint/build 在 blocker 存在时阻断提交 |
20
20
 
21
21
  ## 建议做成未来脚本 blocker 的项
22
22
 
23
23
  - `submit` 与 `readback` 不一致时直接失败,不要口头判定成功
24
- - 建议落在:`submit_filter_template.py`
24
+ - 建议落在:typed CLI `config filter-template submit/verify`
25
25
  - lint 存在 blocker 时直接失败,不要进入最终提交
26
- - 建议落在:`lint_filter_template_semantics.py`
26
+ - 建议落在:typed CLI `config filter-template lint/build`
27
27
  - `work` 或 `submit` 哈希变化后,已确认状态自动失效
28
- - 建议落在:`confirm_filter_template.py`
28
+ - 建议落在:typed CLI submit 确认状态或 response evidence
29
29
  - create 模式必须基于真实 `POST /api/flow_page_template` 最小 body 初始化,不允许口算 payload
30
- - 建议落在:`init_create_filter_template.py`
30
+ - 建议落在:typed CLI `config filter-template create/build`
31
31
  - 时间范围控件在涉及 `raw range` 改写时,默认要求保留一份强验证或高价值弱验证记录
32
- - 建议落在:浏览器列表页强验证记录与 Mem0 结论
32
+ - 建议落在:真实用户身份 E2E 列表页强验证记录与 Mem0 结论
33
33
 
34
34
  ## 仍依赖人工审查的项
35
35
 
@@ -71,6 +71,27 @@
71
71
  - `range`
72
72
  - `raw`
73
73
 
74
+ ## 日期区间固定模式
75
+ 日期区间必须使用:
76
+ ```json
77
+ {
78
+ "is": "date-range",
79
+ "field": "tjrq",
80
+ "label": "申请日期",
81
+ "type": "range",
82
+ "time_type": "date_range",
83
+ "props": {
84
+ "placeholder": "请选择申请日期"
85
+ }
86
+ }
87
+ ```
88
+
89
+ - `time_type=d` 表示选择单日并查询该日。
90
+ - `time_type=date_range` 表示选择起止日期。
91
+ - `time_type=time_range` 表示日期时间范围。
92
+ - 禁止使用 `is=date-picker` 或 `props.type=daterange`;平台普通筛选器不会将其识别为日期范围组件。
93
+ - canonical `date-range` 会自行生成 raw ES range,不需要默认配置 `beforeSearch`。
94
+
74
95
  ## `customQuery`
75
96
  `customQuery` 用于附加默认查询条件,已验证存在两种形态:
76
97
 
@@ -75,6 +75,8 @@ Content-Type: application/json
75
75
  - 尝试单独修改模板 `data_set_id` 后,字段池请求形态没有随之改变
76
76
 
77
77
  ## 新建模板
78
+ 以下 HTTP 形态是 typed CLI adapter 背后的平台契约事实,不是 Agent 直接调用入口。
79
+
78
80
  ```http
79
81
  POST /api/flow_page_template
80
82
  Content-Type: application/json
@@ -96,19 +98,20 @@ Content-Type: application/json
96
98
  create 模式默认初始化规则:
97
99
  - 不依赖 `GET /api/flow_page_template/:id`
98
100
  - 先按上面的最小 body 生成 create skeleton
99
- - 再把 skeleton 落到 `.codex/tmp/` 的 raw/work/meta
101
+ - 再把 skeleton 落到 `.codex/tmp/filter-template-editor/` 的 raw/work/meta
100
102
  - 若用户明确要求“参考已有模板改一个版本”,允许额外选择 sample template 作为增强版 skeleton,但不是默认前置
101
103
 
102
104
  建议拆开理解 create / edit 的初始化顺序:
103
105
 
104
106
  ### create 初始化顺序
105
- - 读取真实 `POST /api/flow_page_template` 最小 body
106
- - 生成 create skeleton
107
- - 导出 `.codex/tmp/` 的 raw/work/meta
107
+ - 按 typed adapter 契约生成 create skeleton,不直接发 `POST`
108
+ - 生成 `.codex/tmp/filter-template-editor/` 下的 raw/work/meta
108
109
  - 在本地 work 文件中修改
109
- - 第二次确认后才真正发起 `POST`
110
+ - lint/build 通过并第二次确认后,才通过 `bpmax-cli config filter-template create` 发起真实写入
110
111
 
111
112
  ## 编辑模板
113
+ 以下 HTTP 形态是 typed CLI adapter 背后的平台契约事实,不是 Agent 直接调用入口。
114
+
112
115
  ```http
113
116
  PUT /api/flow_page_template/:id
114
117
  Content-Type: application/json
@@ -128,10 +131,9 @@ Content-Type: application/json
128
131
 
129
132
  补充验证:
130
133
  - 默认请求顺序应为:
131
- - 先 `GET /api/flow_page_template/:id?skip_i18n=true`
132
- - 再导出 `.codex/tmp/` 的 raw/work/meta
134
+ - 先用 `bpmax-cli config filter-template export` 导出 raw/work/meta
133
135
  - 在本地 work 文件中修改
134
- - 通过脚本生成 submit 文件
136
+ - 通过 `bpmax-cli config filter-template lint/build` 生成 submit 文件
135
137
  - 第二次确认后才真正发起 `PUT`
136
138
  - 裸 `PUT` 返回 `code=0`、页面真实 `PUT` 返回 `affectedRows=1`,都不足以证明模板内容已经更新
137
139
  - 必须继续核对:
@@ -144,16 +146,15 @@ Content-Type: application/json
144
146
  - `flow_key`
145
147
  - `content`
146
148
  - `type`
147
- - 若编辑页组件实例可达,允许作为 fallback 直接改组件 `content` 后调用页面 `save()`,但不再是默认路径
149
+ - 编辑页组件实例直改和页面 `save()` 是历史反例,不得作为 fallback 写入路径;当前必须走 typed CLI work -> lint -> build -> submit -> verify/readback。
148
150
 
149
151
  ### edit 初始化顺序
150
- - 先 `GET /api/flow_page_template/:id?skip_i18n=true`
151
- - 再导出 `.codex/tmp/` 的 raw/work/meta
152
+ - 先用 `bpmax-cli config filter-template export` 导出 `.codex/tmp/` 的 raw/work/meta
152
153
  - 在本地 work 文件中修改
153
- - 第二次确认后才真正发起 `PUT`
154
+ - lint/build 通过并第二次确认后,才通过 typed CLI submit 发起真实写入
154
155
 
155
156
  ## 本地工作文件与 submit 文件约定
156
- - 临时文件统一放在 `.codex/tmp/`
157
+ - 临时文件统一放在 `.codex/tmp/filter-template-editor/`
157
158
  - 推荐至少产出:
158
159
  - `raw`:接口原始返回
159
160
  - `work`:供人工修改的展开结构
@@ -167,23 +168,23 @@ Content-Type: application/json
167
168
  - 第一次确认对象是 `work` 文件改动
168
169
  - 第二次确认对象是 `submit` 文件内容
169
170
  - 提交后必须再生成 readback 或 verify 结果,证明线上内容与 `submit` 一致
170
- - 当前脚本入口:
171
- - `export_filter_template.py`
172
- - `init_create_filter_template.py`
173
- - `build_submit_payload.py`
174
- - `lint_filter_template_semantics.py`
175
- - `confirm_filter_template.py`
176
- - `submit_filter_template.py`
177
- - 当前没有单独的运行态验证脚本;运行态验证由 `submit_filter_template.py` 的 readback / verify 结果和浏览器列表页证据共同完成
171
+ - 当前 typed CLI 入口:
172
+ - `bpmax-cli config filter-template export`
173
+ - `bpmax-cli config filter-template lint`
174
+ - `bpmax-cli config filter-template build`
175
+ - `bpmax-cli config filter-template submit/create/delete`
176
+ - `bpmax-cli config filter-template verify`
177
+ - 当前没有单独的运行态验证脚本;运行态验证由 typed CLI readback/verify 结果和只读列表页证据共同完成
178
178
 
179
179
  ## 最终提交口径
180
180
  - 最终配置必须经过:
181
- - `build_submit_payload.py`
182
- - `lint_filter_template_semantics.py`
183
- - `confirm_filter_template.py`
184
- - `submit_filter_template.py`
181
+ - typed CLI lint
182
+ - typed CLI build
183
+ - 用户确认 submit diff
184
+ - typed CLI submit/create/delete
185
+ - typed CLI verify/readback
185
186
  - lint 存在 blocker 时,不得执行最终提交。
186
- - 页面内请求或组件实例 `save()` 只能帮助确认真实请求体和回读差异,不构成最终提交闭环。
187
+ - 页面只用于只读展示验收和问题定位;最终提交闭环必须以 typed CLI submit、verify/readback 为准。
187
188
 
188
189
  ## 删除模板
189
190
  ```http
@@ -211,6 +212,8 @@ GET /api/flow?flow_type=<flow_type>&key=<flow_key>
211
212
  - 因此“当前流程实际在用哪个筛选器模板”应继续以这个字段为准,而不是模板列表状态列反推
212
213
 
213
214
  ## 切换生效模板
215
+ 以下 HTTP 形态是平台契约事实;当前 `filter-template` typed domain 不提供直接切换默认模板的子命令。若没有 typed flow/meta 配置能力,必须停止并说明缺能力,不得手写此 raw `PUT`。
216
+
214
217
  ```http
215
218
  PUT /api/flow/configuration/meta?flow_type=<flow_type>&flow_key=<flow_key>
216
219
  Content-Type: application/json
@@ -36,6 +36,22 @@
36
36
  - 项目列表页的多条件筛选
37
37
  - 带固定枚举、文本搜索和时间筛选的常规页面
38
38
 
39
+ 日期区间的 canonical 配置:
40
+ ```json
41
+ {
42
+ "is": "date-range",
43
+ "field": "tjrq",
44
+ "label": "申请日期",
45
+ "type": "range",
46
+ "time_type": "date_range",
47
+ "props": {
48
+ "placeholder": "请选择申请日期"
49
+ }
50
+ }
51
+ ```
52
+
53
+ 平台 `DateRange` 组件会把选择值直接转换成 `type=raw` 的 ES range。禁止写成 `is=date-picker + props.type=daterange`,因为普通筛选器不识别 `date-picker`,会降级成字符串输入。
54
+
39
55
  ## 模式 2.1:低基数字段筛选
40
56
  典型特征:
41
57
  - 字段真实唯一值很少
@@ -74,12 +90,13 @@
74
90
  - nested 字段查询
75
91
  - raw 查询
76
92
  - 用户输入字段和真实 ES 查询路径不一致
77
- - 时间控件输入改写成后端实际可命中的 `raw range`
93
+ - 非标准时间字段路径或 nested 时间字段需要组合查询
78
94
 
79
95
  注意:
80
96
  - `beforeSearch` 是查询增强,不是展示配置
81
97
  - 改这部分时优先按代码模式理解
82
- - 时间字段如果普通 `range` 查询不命中,但 `raw range` 命中,应保留原有时间控件并在 `beforeSearch` 中转换
98
+ - canonical `date-range` 已自行生成 raw range,不应重复改写
99
+ - 只有字段路径、mapping 或 nested 结构要求额外查询结构时才使用 `beforeSearch`
83
100
 
84
101
  ## 模式 5:看板 / 控制台场景
85
102
  典型特征:
@@ -0,0 +1,56 @@
1
+ # Filter Template Archive Guide
2
+
3
+ > Archive reference for details that used to live in `../SKILL.md`. The active entrypoint is `../SKILL.md`; this file preserves historical decisions, routing notes, and case lessons without weakening the typed CLI write path.
4
+
5
+ ## 常驻结论
6
+ - 筛选器模板是 `flow_page_template.type = 3`。
7
+ - 当前流程使用哪个筛选器,由 `flow.data.meta.table_filter_template` 决定。
8
+ - 编辑模板内容和切换默认模板是两个动作,必须分别验证。
9
+ - 字段池通常由 `flow_type + flow_key` 驱动;`data_set_id` 不一定影响字段池。
10
+ - 复杂模板含 `customQuery`、`beforeSearch`、`tabFilters` 时,默认按代码模式审查。
11
+ - 运行态界面只作为只读展示和 E2E 行为验收,不是配置写入入口。
12
+
13
+ ## 历史经验
14
+
15
+ ### 列表页可以作为起手线索
16
+ 筛选器模板列表能定位候选模板、当前使用状态和预览入口。它可以作为只读起点,但正式修改仍从 typed CLI export/readback 开始。
17
+
18
+ ### 复杂模板默认按代码模式理解
19
+ 出现 `customQuery`、`beforeSearch`、`tabFilters` 或表达式时,不能只按普通 `config[]` 可视化项理解;必须保留查询增强语义并检查脚本 lint。
20
+
21
+ ### 低基数字段先抽样
22
+ 步骤名、状态名、类型名等字段应先抽样真实唯一值。唯一值少时优先 `select + term`,不要凭字段名直接使用输入框或自动补全。
23
+
24
+ ### 日期区间使用平台 canonical 组件
25
+ 日期区间使用 `is=date-range + type=range + time_type=date_range`。平台组件会直接生成 raw ES range;禁止使用 `is=date-picker + props.type=daterange`。只有 nested 或字段路径映射等复杂场景才额外使用 `beforeSearch`。
26
+
27
+ ### 强验证与弱验证必须区分
28
+ 请求成功不等于筛选真的可用。样本只有单值、无正向命中或数量不变时,只能写弱验证或未验证。
29
+
30
+ ### 数据集 id 不一定等于模板 data_set_id
31
+ 用户说“给数据集增加筛选”时,先核对字段池请求和当前流程。很多场景真实诉求是给流程当前列表补筛选项,而不是修改模板 `data_set_id`。
32
+
33
+ ### 成功回包不代表 content 已更新
34
+ 保存或提交后必须做 readback/verify,比较线上 `content` 与 submit 文件。接口成功但 content 仍旧时,不能宣告完成。
35
+
36
+ ### 页面组件实例保存是历史反例
37
+ 直接改组件实例或调用保存方法曾用于定位问题,但不是当前操作建议。当前配置写入必须走 `bpmax-cli config filter-template ...` typed CLI。
38
+
39
+ ## 旧规则去向
40
+ - 请求与 payload 细节:`filter-request-shape.md`
41
+ - 内容结构和字段:`filter-content-schema.md`
42
+ - 查询模式和组件选择:`filter-runtime-patterns.md`
43
+ - 默认模板绑定和字段池关系:`filter-and-flow-binding.md`
44
+ - 只读界面与 E2E 验收入口:`runtime-verified-filter-page-shape.md`
45
+ - 经验覆盖和后续改进:`experience-coverage-matrix.md`
46
+
47
+ ## 统一执行入口
48
+ ```bash
49
+ bpmax-cli config filter-template export --id <id> --out .codex/tmp/filter-template-editor --profile <profile> --format json
50
+ bpmax-cli config filter-template lint --work .codex/tmp/filter-template-editor/work/<file>.json --profile <profile> --format json
51
+ bpmax-cli config filter-template build --work .codex/tmp/filter-template-editor/work/<file>.json --meta .codex/tmp/filter-template-editor/meta/<file>.meta.json --out .codex/tmp/filter-template-editor/submit/<file>.json --profile <profile> --format json
52
+ bpmax-cli config filter-template submit --id <id> --payload .codex/tmp/filter-template-editor/submit/<file>.json --profile <profile> --confirm "submit filter-template <id>" --format json
53
+ bpmax-cli config filter-template verify --id <id> --expect .codex/tmp/filter-template-editor/work/<file>.json --profile <profile> --format json
54
+ ```
55
+
56
+ 旧 Python 脚本只保留为本地结构/lint 参考,不是线上写入路径。
@@ -67,18 +67,18 @@
67
67
  - `type: 3`
68
68
  - 页面保存成功后默认会返回上一页。
69
69
  - 当前默认推荐闭环:
70
- - 编辑:先通过详情接口确认真实线上结构,再下载 raw/work/meta 到 `.codex/tmp/`
71
- - 新建:先按真实 `POST /api/flow_page_template` 最小 body 初始化 create skeleton,再生成 raw/work/meta
70
+ - 编辑:先通过 `bpmax-cli config filter-template export` 确认真实线上结构并生成 raw/work/meta
71
+ - 新建:先按 typed CLI create work 生成 create skeleton,再生成 raw/work/meta
72
72
  - 在 work 文件中修改
73
- - 通过 `build_submit_payload.py` 生成 submit 文件
73
+ - 通过 `bpmax-cli config filter-template lint/build` 生成 submit 文件
74
74
  - 双确认后再提交
75
- - 提交后回读详情并刷新编辑页
75
+ - 提交后 typed CLI verify/readback,并补充只读展示验收
76
76
  - 当前仓库状态:
77
- - `bpmax-filter-template-editor` 已提供 `export/build/lint/confirm/submit` 脚本闭环
78
- - 运行态强验证仍依赖列表页请求、页面刷新和“使用中”状态证据
79
- - 页面组件实例 `save()` 保留为 fallback:
80
- - 仅在页面上下文排障或需要快速对比页面行为时使用
81
- - 不再作为默认最稳路径
77
+ - `bpmax-filter-template-editor` 的配置写入主路径是 typed CLI
78
+ - 运行态强验证依赖真实用户身份的列表页请求、结果变化和“使用中”状态证据
79
+ - 页面组件实例 `save()` 是历史反例:
80
+ - 不得作为 fallback 写入路径
81
+ - 页面上下文只用于只读观察、运行态展示验收和问题定位
82
82
  - 风险提示:
83
83
  - 代码编辑器中的文本不一定已经同步到页面组件状态
84
84
  - `PUT` 返回成功不代表最终写入的是目标 `content`
@@ -87,6 +87,7 @@
87
87
  ## 生效切换
88
88
  - 列表页点击 `使用` 走:
89
89
  - `PUT /api/flow/configuration/meta`
90
+ - 这是平台运行态契约事实,不是 Agent 直接调用入口;当前 `filter-template` typed domain 没有默认模板切换子命令时,必须停止并转入具备 typed flow/meta 能力的配置路径。
90
91
  - 请求体至少包含:
91
92
  - `table_filter_template`
92
93
  - query 至少包含:
@@ -4,12 +4,7 @@ from __future__ import annotations
4
4
  import copy
5
5
  import hashlib
6
6
  import json
7
- import ssl
8
7
  import sys
9
- import urllib.error
10
- import urllib.parse
11
- import urllib.request
12
- from dataclasses import dataclass
13
8
  from datetime import datetime, timezone
14
9
  from difflib import unified_diff
15
10
  from pathlib import Path
@@ -21,9 +16,13 @@ REPO_ROOT = Path(__file__).resolve().parents[4]
21
16
  SHARED_SKILL_ROOT = Path(__file__).resolve().parents[2] / "bpmax-builder-shared"
22
17
  if str(SHARED_SKILL_ROOT) not in sys.path:
23
18
  sys.path.insert(0, str(SHARED_SKILL_ROOT))
24
- from base_url import resolve_base_url
25
19
  TMP_ROOT = REPO_ROOT / ".codex" / "tmp" / "filter-template-editor"
26
20
  TMP_SUBDIRS = ("raw", "work", "meta", "submit", "diffs", "result")
21
+ LEGACY_NETWORK_DISABLED_MESSAGE = (
22
+ "Legacy filter-template network scripts are disabled in bpmax-cli. "
23
+ "Use `bpmax-cli config filter-template export|lint|build|submit|create|delete|verify` "
24
+ "so profile, capability, dry-run, confirmation, audit, and baseline checks are enforced."
25
+ )
27
26
 
28
27
  from template_script_hard_rules import scan_named_script_surfaces
29
28
 
@@ -295,54 +294,5 @@ def ensure_submission_allowed(meta_path: Path, work_path: Path, submit_path: Pat
295
294
  return meta
296
295
 
297
296
 
298
- @dataclass
299
- class ApiClient:
300
- base_url: str
301
- workspace: str
302
- language: str
303
- cookie_header: str
304
- timeout: float
305
- insecure: bool = False
306
-
307
- def _build_url(self, path: str) -> str:
308
- suffix = f"$workspace={urllib.parse.quote(self.workspace)}&$language={urllib.parse.quote(self.language)}"
309
- joiner = "&" if "?" in path else "?"
310
- return self.base_url.rstrip("/") + path + joiner + suffix
311
-
312
- def request(self, method: str, path: str, body: Optional[dict] = None) -> dict:
313
- headers = {"content-type": "application/json", "cookie": self.cookie_header, "accept": "application/json, text/plain, */*"}
314
- data = None if body is None else json.dumps(body, ensure_ascii=False).encode("utf-8")
315
- req = urllib.request.Request(self._build_url(path), data=data, headers=headers, method=method)
316
- context = ssl._create_unverified_context() if self.insecure else None
317
- with urllib.request.urlopen(req, timeout=self.timeout, context=context) as resp:
318
- raw = resp.read().decode("utf-8", "replace")
319
- payload = json.loads(raw)
320
- if payload.get("code") != 0:
321
- raise SystemExit(f"API error {path}: {raw}")
322
- return payload
323
-
324
- def get_template(self, template_id: int) -> dict:
325
- return self.request("GET", f"/api/flow_page_template/{template_id}?skip_i18n=true")
326
-
327
- def create_template(self, payload: dict) -> dict:
328
- return self.request("POST", "/api/flow_page_template", payload)
329
-
330
- def update_template(self, template_id: int, payload: dict) -> dict:
331
- return self.request("PUT", f"/api/flow_page_template/{template_id}", payload)
332
-
333
-
334
- def build_client(args: Any) -> ApiClient:
335
- workspace = getattr(args, "workspace", None)
336
- cookie_header = getattr(args, "cookie_header", None)
337
- if not workspace:
338
- raise SystemExit("--workspace is required")
339
- if not cookie_header:
340
- raise SystemExit("--cookie-header is required")
341
- return ApiClient(
342
- base_url=resolve_base_url(getattr(args, "base_url", None)),
343
- workspace=workspace,
344
- language=getattr(args, "language", None) or DEFAULT_LANGUAGE,
345
- cookie_header=cookie_header,
346
- timeout=float(getattr(args, "timeout", 30)),
347
- insecure=bool(getattr(args, "insecure", False)),
348
- )
297
+ def build_client(args: Any) -> None:
298
+ raise SystemExit(LEGACY_NETWORK_DISABLED_MESSAGE)
@@ -1,11 +1,9 @@
1
1
  from __future__ import annotations
2
2
 
3
- import os
4
3
  import sys
5
4
  import tempfile
6
5
  import unittest
7
6
  from pathlib import Path
8
- from unittest import mock
9
7
 
10
8
 
11
9
  SCRIPT_DIR = Path(__file__).resolve().parents[1] / "scripts"
@@ -167,7 +165,7 @@ class FilterTemplateEditorCommonTests(unittest.TestCase):
167
165
  with self.assertRaises(SystemExit):
168
166
  common.ensure_submission_allowed(meta, work, submit)
169
167
 
170
- def test_build_client_requires_runtime_origin_when_not_explicitly_configured(self) -> None:
168
+ def test_legacy_network_client_is_disabled(self) -> None:
171
169
  args = type(
172
170
  "Args",
173
171
  (),
@@ -180,51 +178,9 @@ class FilterTemplateEditorCommonTests(unittest.TestCase):
180
178
  "insecure": False,
181
179
  },
182
180
  )()
183
- with mock.patch.dict(os.environ, {}, clear=True):
184
- with self.assertRaises(SystemExit) as ctx:
185
- common.build_client(args)
186
- self.assertIn("BPMAX_BASE_URL", str(ctx.exception))
187
-
188
- def test_build_client_keeps_api_endpoint_when_base_url_contains_api_suffix(self) -> None:
189
- args = type(
190
- "Args",
191
- (),
192
- {
193
- "base_url": "https://bpmax.example.com/api",
194
- "workspace": "store_mgr",
195
- "language": "zhCN",
196
- "cookie_header": "token=demo",
197
- "timeout": 30,
198
- "insecure": False,
199
- },
200
- )()
201
- client = common.build_client(args)
202
- self.assertEqual(
203
- client._build_url("/api/flow_page_template/954573388?skip_i18n=true"),
204
- "https://bpmax.example.com/api/flow_page_template/954573388?skip_i18n=true&$workspace=store_mgr&$language=zhCN",
205
- )
206
-
207
- def test_api_client_template_methods_use_api_prefix(self) -> None:
208
- client = common.ApiClient(
209
- base_url="https://bpmax.example.com",
210
- workspace="store_mgr",
211
- language="zhCN",
212
- cookie_header="token=demo",
213
- timeout=30,
214
- )
215
- with mock.patch.object(client, "request", return_value={"code": 0}) as request:
216
- client.get_template(954573388)
217
- client.create_template({"name": "筛选器模板"})
218
- client.update_template(954573388, {"name": "筛选器模板"})
219
-
220
- self.assertEqual(
221
- [call.args[:2] for call in request.call_args_list],
222
- [
223
- ("GET", "/api/flow_page_template/954573388?skip_i18n=true"),
224
- ("POST", "/api/flow_page_template"),
225
- ("PUT", "/api/flow_page_template/954573388"),
226
- ],
227
- )
181
+ with self.assertRaises(SystemExit) as ctx:
182
+ common.build_client(args)
183
+ self.assertIn("Legacy filter-template network scripts are disabled in bpmax-cli", str(ctx.exception))
228
184
 
229
185
 
230
186
  if __name__ == "__main__":
@@ -30,6 +30,8 @@ bpmax-cli flow get --flow-id 123 --format json
30
30
  ## 路由规则
31
31
 
32
32
  - 流程枚举优先 `flow list`
33
+ - 流程枚举不要求 API Key 开启 `configuration.manage`。只要服务端授予独立的 `flow.list` capability,且当前用户的流程读取权限允许访问目标流程,就必须继续使用 `bpmax-cli flow list`;不得把“未开启配置能力”误判为“不能枚举流程模板”。
34
+ - `configuration.manage` 只约束流程模板创建、编辑、发布等配置写操作。需要浏览候选流程时,不得改走 `config flow-template export`,也不得要求用户仅为读取流程列表重新开启配置能力。
33
35
  - 只在需要单流程细节时才用 `flow get`
34
36
  - 需要读取创建选项或流程相关参数时,再用 `flow options`
35
37
  - 创建项目之前,必须用 `flow get` 或 `flow options` 获取流程表单结构,供 `project create` 的 `form` 映射和校验使用
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: bpmax-flow-detail-template-editor
3
+ version: 1.0.0
4
+ description: "Use the typed CLI when discovering, creating, editing, reading back, or verifying BPMAX flow_page_template type=5 flow report/document templates."
5
+ metadata:
6
+ requires:
7
+ bins: ["bpmax-cli"]
8
+ ---
9
+
10
+ # BPMAX Flow Report Template Editor
11
+
12
+ 该 Skill 管理 `report_template` 编辑器使用的 `flow_page_template type=5` 流程报告/文档模板。`flow-detail-template` 是为兼容既有 issue 和命令体系保留的 CLI 名称,不表示页面布局型“流程详情模板”。
13
+
14
+ ## 边界
15
+
16
+ - type=5 流程报告/文档模板使用 `config flow-detail-template`。
17
+ - type=2 项目详情模板使用 `config project-detail-template`。
18
+ - type=6 环节详情模板使用 `config step-detail-template`,并由流程节点 `step_detail_id` 引用。
19
+ - 三种模板不得混用;不得用 type=5 ID 填充 `node.step_detail_id`。
20
+ - 配置写入只能通过 typed CLI 完成,不得直接修改 `think_flow_page_template` 文件,也不得用 raw API 绕过门禁。
21
+ - 不知道模板 ID 时,必须先按 `flow_type/flow_key` 使用 typed list 发现,不能猜测 ID。
22
+
23
+ ## 标准流程
24
+
25
+ ```bash
26
+ bpmax-cli config flow-detail-template list --flow-type <flow_type> --flow-key <flow_key> --profile <profile> --format json
27
+ bpmax-cli config flow-detail-template export --id <id> --profile <profile> --out <dir> --format json
28
+ bpmax-cli config flow-detail-template lint --work <work.json> --format json
29
+ bpmax-cli config flow-detail-template inspect-template --work <work.json> --file <template.docx> --profile <profile> --format json
30
+ bpmax-cli config flow-detail-template build --work <work.json> --meta <meta.json> --out <submit.json> --format json
31
+ bpmax-cli config flow-detail-template submit --id <id> --payload <submit.json> --profile <profile> --format json
32
+ bpmax-cli config flow-detail-template verify --id <id> --profile <profile> --format json
33
+ bpmax-cli config flow-detail-template usage --id <id> --profile <profile> --format json
34
+ bpmax-cli config flow-detail-template render --id <id> --project-id <project_id> --out <generated.docx> --profile <profile> --format json
35
+ ```
36
+
37
+ 新建时先自行准备 `mode=create` 的 work/meta,再由 build 生成 create payload;`config flow-detail-template create` 消费 build 产物,不会替你生成 work/meta。提交前必须检查 dry-run 的 `activation_collateral`,因为 `status=1` 会让同流程范围内其他生效模板失效。删除前必须先执行 usage;仍被节点 `report_actions` 引用时不得删除。
38
+
39
+ ## 门禁
40
+
41
+ - work 和 readback 的 `type` 必须为 `5`。
42
+ - `content` 必须是 `{ fields, templateFile }`:`fields[]` 的 `field/desc/expression` 均为非空字符串且 field 不重复。
43
+ - `expression` 是平台异步函数体,可以使用 `await`,但必须由外层函数显式 `return`;回调函数、注释、字符串或正则中的 `return` 不能代替报告字段返回。lint 只解析和编译,不执行表达式。
44
+ - `templateFile` 必须且只能有一个 `.docx`。`.doc`、`.html` 或多个文件会被阻断,因为服务端实际使用 PizZip + Docxtemplater,且只读取第一个文件。
45
+ - `inspect-template` 必须证明 DOCX ZIP 结构有效,所有占位符均有对应 `fields[].field`;未使用字段必须人工确认。
46
+ - Word 循环块 `{#items}{label}{value}{/items}` 只在 `content.fields` 配置顶层 `items`;`label/value` 来自 `items` 表达式返回的对象,不得重复配置为顶层报告字段。
47
+ - 必须保留 `flow_type`、`flow_key`、`data_set_id` 和报告表达式的原有语义,不得套用 type=2/type=6 的 layout 模块规则。
48
+ - 节点入口使用 `data.nodes[].report_actions=[<type=5 remote id>]`。CLI 必须远端回读并确认模板存在、type=5 且 `flow_type/flow_key` 与流程一致;禁止 UUID、跨流程 ID 和同节点重复 ID。
49
+ - `report_actions` 不能单独证明按钮可见:平台旧版 `stepOperation` 支持该入口,启用 `stepFlowButtonStyle` 的 `stepOperationNew` 当前不渲染报告按钮。必须在目标流程真实页面确认;如果运行态使用新版按钮样式,需要平台前端配合恢复入口,不能靠 CLI 配置绕过。
50
+ - 项目详情入口由 type=2 模板中的 `generate-report` 模块提供。该模块按当前项目流程范围列出报告模板,不绑定单个 type=5 ID。
51
+ - 报告不会在创建、提交、审批或流程完成时自动生成,也不会自动附加、归档或发送;只有用户点击环节报告按钮或项目详情“生成报告”入口时才调用生成接口。
52
+ - lint/build/submit/verify 任一步失败都不能宣称配置完成。
53
+ - typed verify 只能证明配置写入和引用语义;完成结论还必须使用真实项目执行 `render`,验证返回文件是有效 DOCX、hash/MIME 可记录且没有未解析占位符。涉及按钮可见性时还要补真实页面点击和下载证据。