bpmax-cli 0.2.1-beta.9 → 0.2.1-beta.90

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 (197) hide show
  1. package/README.md +30 -7
  2. package/dist/bin.js +45185 -12834
  3. package/dist/bin.js.map +1 -1
  4. package/package.json +12 -5
  5. package/scripts/install-skills.mjs +27 -60
  6. package/scripts/run-source-cli.mjs +145 -0
  7. package/skills/bpmax-ai-taskbook/SKILL.md +17 -1
  8. package/skills/bpmax-ai-taskbook/references/blueprint-taskbook-gates.md +141 -0
  9. package/skills/bpmax-ai-taskbook/references/taskbook-template.md +43 -3
  10. package/skills/bpmax-api-platform-editor/SKILL.md +24 -31
  11. package/skills/bpmax-api-platform-editor/agents/openai.yaml +2 -2
  12. package/skills/bpmax-api-platform-editor/references/platform-api-map.md +2 -2
  13. package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +3 -3
  14. package/skills/bpmax-approval-matrix/SKILL.md +54 -2
  15. package/skills/bpmax-blueprint-doc-workflow/SKILL.md +38 -5
  16. package/skills/bpmax-blueprint-doc-workflow/references/blueprint-structure.md +24 -8
  17. package/skills/bpmax-blueprint-doc-workflow/references/business-language.md +74 -0
  18. package/skills/bpmax-blueprint-doc-workflow/references/per-flow-required-structure.md +13 -0
  19. package/skills/bpmax-blueprint-doc-workflow/references/review-and-confirmation-dialogue.md +70 -0
  20. package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-modeling-review.xml +23 -0
  21. package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-review-record.xml +72 -0
  22. package/skills/bpmax-blueprint-doc-workflow/references/sample-paragraph-flow-details.xml +27 -0
  23. package/skills/bpmax-blueprint-doc-workflow/references/sample-pass.xml +59 -35
  24. package/skills/bpmax-blueprint-doc-workflow/references/sample-system-identifier.xml +79 -0
  25. package/skills/bpmax-blueprint-doc-workflow/references/source-traceability-and-flow-modeling.md +115 -0
  26. package/skills/bpmax-blueprint-doc-workflow/scripts/lint_blueprint_doc.py +586 -5
  27. package/skills/bpmax-bug-reporting/SKILL.md +72 -0
  28. package/skills/bpmax-builder-shared/SKILL.md +1 -0
  29. package/skills/bpmax-builder-shared/configuration-impact-review.md +76 -0
  30. package/skills/bpmax-builder-shared/template_script_hard_rules.py +3 -1
  31. package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +16 -0
  32. package/skills/bpmax-business-skill/SKILL.md +3 -1
  33. package/skills/bpmax-cli/SKILL.md +46 -0
  34. package/skills/bpmax-config-latest/SKILL.md +4 -0
  35. package/skills/bpmax-console-template-editor/SKILL.md +113 -523
  36. package/skills/bpmax-console-template-editor/agents/openai.yaml +2 -2
  37. package/skills/bpmax-console-template-editor/references/full-detail-guide.md +45 -0
  38. package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +13 -12
  39. package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +299 -78
  40. package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +344 -30
  41. package/skills/bpmax-dataset-field-template-editor/SKILL.md +131 -594
  42. package/skills/bpmax-dataset-field-template-editor/references/full-detail-guide.md +570 -0
  43. package/skills/bpmax-dataset-field-template-editor/references/nested-field-patterns.md +8 -8
  44. package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +1 -1
  45. package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +11 -77
  46. package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +4 -57
  47. package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +2 -0
  48. package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +4 -78
  49. package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +3 -89
  50. package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +14 -0
  51. package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +2 -0
  52. package/skills/bpmax-dataset-template-editor/SKILL.md +123 -778
  53. package/skills/bpmax-dataset-template-editor/references/dataset-script-runtime-matrix.md +11 -0
  54. package/skills/bpmax-dataset-template-editor/references/full-detail-guide.md +753 -0
  55. package/skills/bpmax-dataset-template-editor/references/runtime-gotchas.md +12 -0
  56. package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +1 -0
  57. package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +2 -2
  58. package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +8 -1
  59. package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +9 -90
  60. package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +8 -1
  61. package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +8 -1
  62. package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +1 -2
  63. package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +8 -1
  64. package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +8 -1
  65. package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +6 -40
  66. package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +18 -4
  67. package/skills/bpmax-e2e-flow-config-orchestrator/agents/openai.yaml +2 -2
  68. package/skills/bpmax-e2e-flow-config-orchestrator/references/orchestration-matrix.md +13 -9
  69. package/skills/bpmax-e2e-flow-test-operator/SKILL.md +174 -546
  70. package/skills/bpmax-e2e-flow-test-operator/agents/openai.yaml +2 -3
  71. package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +181 -15
  72. package/skills/bpmax-e2e-flow-test-operator/references/browser-action-dsl.md +169 -0
  73. package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +15 -7
  74. package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +589 -0
  75. package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +12 -8
  76. package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +4 -4
  77. package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +1 -1
  78. package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +3 -1
  79. package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +7 -5
  80. package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +2 -2
  81. package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +5 -1
  82. package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +71 -0
  83. package/skills/bpmax-e2e-flow-test-operator-v2/SKILL.md +64 -0
  84. package/skills/bpmax-e2e-flow-test-operator-v2/agents/openai.yaml +7 -0
  85. package/skills/bpmax-e2e-flow-test-operator-v2/references/automation-generation-pipeline.md +33 -0
  86. package/skills/bpmax-e2e-flow-test-operator-v2/references/autonomous-execution.md +40 -0
  87. package/skills/bpmax-e2e-flow-test-operator-v2/references/batch-generation-and-execution.md +17 -0
  88. package/skills/bpmax-e2e-flow-test-operator-v2/references/browser-action-runner.md +19 -0
  89. package/skills/bpmax-e2e-flow-test-operator-v2/references/browser-recording-and-replay.md +95 -0
  90. package/skills/bpmax-e2e-flow-test-operator-v2/references/form-script-generation.md +41 -0
  91. package/skills/bpmax-e2e-flow-test-operator-v2/references/identity-and-failure-routing.md +92 -0
  92. package/skills/bpmax-e2e-flow-test-operator-v2/references/multi-request-mutation.md +9 -0
  93. package/skills/bpmax-e2e-flow-test-operator-v2/references/scenario-coverage-generation.md +17 -0
  94. package/skills/bpmax-e2e-flow-test-operator-v2/references/scoped-execution.md +13 -0
  95. package/skills/bpmax-e2e-flow-test-operator-v2/references/step-restartability-and-state.md +23 -0
  96. package/skills/bpmax-e2e-flow-test-operator-v2/references/test-assets-and-evidence.md +9 -0
  97. package/skills/bpmax-e2e-flow-test-operator-v2/references/test-data-and-selector-contract.md +51 -0
  98. package/skills/bpmax-e2e-flow-test-operator-v2/references/test-preflight-and-confirmation.md +32 -0
  99. package/skills/bpmax-filter-template-editor/SKILL.md +114 -551
  100. package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +18 -18
  101. package/skills/bpmax-filter-template-editor/references/filter-content-schema.md +21 -0
  102. package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +29 -26
  103. package/skills/bpmax-filter-template-editor/references/filter-runtime-patterns.md +19 -2
  104. package/skills/bpmax-filter-template-editor/references/full-detail-guide.md +56 -0
  105. package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +10 -9
  106. package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +7 -57
  107. package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +4 -48
  108. package/skills/bpmax-flow/SKILL.md +2 -0
  109. package/skills/bpmax-flow-detail-template-editor/SKILL.md +53 -0
  110. package/skills/bpmax-flow-template-editor/SKILL.md +132 -1137
  111. package/skills/bpmax-flow-template-editor/agents/openai.yaml +2 -2
  112. package/skills/bpmax-flow-template-editor/references/diff-strategy.md +3 -3
  113. package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +9 -9
  114. package/skills/bpmax-flow-template-editor/references/flow-template-api-workflow.md +2 -1
  115. package/skills/bpmax-flow-template-editor/references/full-detail-guide.md +1162 -0
  116. package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +1 -1
  117. package/skills/bpmax-flow-template-editor/references/message-card-professional-standard.md +234 -0
  118. package/skills/bpmax-flow-template-editor/references/payload-checklist.md +2 -0
  119. package/skills/bpmax-flow-template-editor/references/project-create-runtime-gotchas.md +17 -0
  120. package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +8 -3
  121. package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +7 -7
  122. package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +2 -2
  123. package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +12 -2
  124. package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +7 -23
  125. package/skills/bpmax-flow-template-editor/references/script-review-hard-rules.md +17 -0
  126. package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +1 -1
  127. package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +19 -75
  128. package/skills/bpmax-form-template-editor/SKILL.md +138 -1151
  129. package/skills/bpmax-form-template-editor/agents/openai.yaml +2 -2
  130. package/skills/bpmax-form-template-editor/references/dynamic-field-state.md +167 -0
  131. package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +51 -51
  132. package/skills/bpmax-form-template-editor/references/full-detail-guide.md +1115 -0
  133. package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +4 -4
  134. package/skills/bpmax-form-template-editor/references/payload-checklist.md +3 -1
  135. package/skills/bpmax-form-template-editor/references/sub-form-patterns.md +6 -0
  136. package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +8 -0
  137. package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +42 -19
  138. package/skills/bpmax-functional-test-design/LICENSE.upstream +24 -0
  139. package/skills/bpmax-functional-test-design/SKILL.md +80 -0
  140. package/skills/bpmax-functional-test-design/agents/openai.yaml +4 -0
  141. package/skills/bpmax-functional-test-design/references/bpmax-test-suite-output.md +95 -0
  142. package/skills/bpmax-functional-test-design/references/decision-table-testing.md +50 -0
  143. package/skills/bpmax-functional-test-design/references/domain-testing.md +43 -0
  144. package/skills/bpmax-functional-test-design/references/state-transition-testing.md +47 -0
  145. package/skills/bpmax-functional-test-design/references/technique-selection.md +38 -0
  146. package/skills/bpmax-functional-test-design/references/use-case-testing.md +55 -0
  147. package/skills/bpmax-group-model-editor/SKILL.md +24 -0
  148. package/skills/bpmax-home-portal-editor/SKILL.md +81 -0
  149. package/skills/bpmax-icon-catalog/SKILL.md +18 -0
  150. package/skills/bpmax-icon-catalog/agents/openai.yaml +4 -0
  151. package/skills/bpmax-icon-catalog/assets/ri-icons.json +3140 -0
  152. package/skills/bpmax-icon-catalog/references/source-contract.md +3 -0
  153. package/skills/bpmax-list-template-editor/SKILL.md +133 -466
  154. package/skills/bpmax-list-template-editor/agents/openai.yaml +2 -2
  155. package/skills/bpmax-list-template-editor/references/content-config-shape.md +16 -4
  156. package/skills/bpmax-list-template-editor/references/full-detail-guide.md +461 -0
  157. package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +6 -9
  158. package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +1 -1
  159. package/skills/bpmax-list-template-editor/references/runtime-verified-workflow.md +50 -2
  160. package/skills/bpmax-list-template-editor/references/special-formats.md +5 -2
  161. package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +9 -78
  162. package/skills/bpmax-memory-protocol/SKILL.md +7 -6
  163. package/skills/bpmax-nav-config-editor/SKILL.md +14 -17
  164. package/skills/bpmax-nav-config-editor/agents/openai.yaml +2 -2
  165. package/skills/bpmax-nav-config-editor/references/api-workflow.md +2 -2
  166. package/skills/bpmax-nav-config-editor/references/runtime-probing.md +11 -12
  167. package/skills/bpmax-page-composition-template-editor/SKILL.md +398 -0
  168. package/skills/bpmax-page-composition-template-editor/examples/presets/catalog.json +41 -0
  169. package/skills/bpmax-page-composition-template-editor/examples/presets/full-capability-workbench.json +294 -0
  170. package/skills/bpmax-page-composition-template-editor/examples/presets/project-detail-step-panel.json +184 -0
  171. package/skills/bpmax-page-composition-template-editor/examples/presets/project-list-quick-process.json +177 -0
  172. package/skills/bpmax-page-composition-template-editor/examples/presets/project-operations-dashboard.json +400 -0
  173. package/skills/bpmax-page-composition-template-editor/examples/presets/project-operations-visual-light.json +214 -0
  174. package/skills/bpmax-page-composition-template-editor/examples/presets/step-related-projects.json +184 -0
  175. package/skills/bpmax-page-composition-template-editor/references/resource-api.md +9 -0
  176. package/skills/bpmax-plugin-config/SKILL.md +55 -5
  177. package/skills/bpmax-project/SKILL.md +37 -1
  178. package/skills/bpmax-project-detail-template-editor/SKILL.md +13 -39
  179. package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +2 -2
  180. package/skills/bpmax-role-editor/SKILL.md +11 -30
  181. package/skills/bpmax-shared/SKILL.md +19 -9
  182. package/skills/bpmax-team-editor/SKILL.md +27 -0
  183. package/skills/bpmax-ui-ux-audit/LICENSE.upstream +23 -0
  184. package/skills/bpmax-ui-ux-audit/SKILL.md +42 -0
  185. package/skills/bpmax-ui-ux-audit/agents/openai.yaml +4 -0
  186. package/skills/bpmax-ui-ux-audit/references/audit-framework.md +39 -0
  187. package/skills/bpmax-ui-ux-audit/references/bpmax-ux-findings.md +56 -0
  188. package/skills/bpmax-user/SKILL.md +33 -1
  189. package/skills/bpmax-user-mock-operator/SKILL.md +58 -56
  190. package/skills/bpmax-user-mock-operator/agents/openai.yaml +2 -2
  191. package/skills/bpmax-user-mock-operator/scripts/chrome_identity_bridge.mjs +1766 -0
  192. package/skills/bpmax-user-model-editor/SKILL.md +24 -0
  193. package/skills/bpmax-workspace-editor/SKILL.md +1 -0
  194. package/skills/form-control-library/references/form-template-submit-schema.md +3 -1
  195. package/skills/bpmax-user-mock-operator/scripts/switch_user_identity.py +0 -37
  196. package/skills/bpmax-user-mock-operator/scripts/user_mock_operator_common.py +0 -136
  197. package/skills/bpmax-user-mock-operator/tests/test_user_mock_operator.py +0 -138
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "BPMAX List Template Editor"
3
- short_description: "在浏览器里创建或编辑 BPMAX 项目列表模板"
4
- default_prompt: "使用 $bpmax-list-template-editor 根据当前浏览器页和需求创建或编辑 BPMAX 项目列表模板。"
3
+ short_description: "通过 bpmax-cli typed config 创建或编辑 BPMAX 项目列表模板"
4
+ default_prompt: "使用 $bpmax-list-template-editor 通过 bpmax-cli typed config 创建或编辑 BPMAX 项目列表模板,并用回读验证确认结果。"
@@ -9,7 +9,7 @@
9
9
  {
10
10
  "title": "名称",
11
11
  "props": {
12
- "width": "400px"
12
+ "minWidth": "240px"
13
13
  },
14
14
  "createElement": {
15
15
  "is": "span",
@@ -32,7 +32,7 @@
32
32
  - 列标题
33
33
  - `props`
34
34
  - 透传给 `el-table-column`
35
- - 常见如 `width`、`fixed`
35
+ - 常见如 `width`、`minWidth`、`fixed`、`showOverflowTooltip`
36
36
  - `createElement`
37
37
  - 列单元格的渲染定义
38
38
  - `icon`
@@ -114,7 +114,7 @@
114
114
  {
115
115
  "is": "el-button",
116
116
  "if": {
117
- "$template": "{return ctx.status === 0 && !ctx.current_flow_step_name}",
117
+ "$template": "{return ctx.$CAN_DELETE}",
118
118
  "eval": true
119
119
  },
120
120
  "attribute": {
@@ -136,7 +136,19 @@
136
136
  - 操作列的 `icon` / `iconColor` 不放在列根,默认留空或不写。
137
137
  - icon 放到每个操作按钮自身,优先用 `attribute.props.icon`,或显式渲染 `i.ri ri_*` 在按钮文本前。
138
138
  - 操作列必须包含详情/查看和删除/移除动作。
139
- - 删除/移除动作必须带条件 guard,依据项目状态、当前环节或步骤状态控制是否可用;默认只允许刚创建、未推进的项目删除,过了第一个节点后不能删除。
139
+ - 删除/移除动作必须带权限 guard,首选 `ctx.$CAN_DELETE`。它已包含全局删除权限,以及“仅删除本人项目”权限与创建人匹配逻辑。
140
+ - 若必须显式展开 `project.delete.my`,创建人比较必须使用 `ctx.__owner_id === ctx.$USER_INFO.id`;`project.owner.id` / `__project_owner.id` 不是列表行稳定契约。
141
+ - 不得用 `!ctx.current_flow_step_id` / `!ctx.current_flow_step_name` 控制删除按钮;创建后立即进入首节点的流程会让该条件永远无法命中。
142
+ - 如需附加业务状态限制,应写成 `ctx.$CAN_DELETE && <业务状态条件>`,不能用状态条件替代权限判断。
143
+
144
+ ## 列宽与内容可读性
145
+
146
+ - 每个列表至少保留一个非操作数据列作为自适应列:省略 `props.width`,需要下限时只写 `props.minWidth`。
147
+ - 操作列、选择列、序号列和展开列不计入自适应数据列。
148
+ - 固定数据列使用 `props.width`;如同时设置 `props.minWidth`,两者都必须是正数或 `px` 数值,并保证 `minWidth <= width`。
149
+ - 不要写 `width: "auto"` 或百分比来表示自适应;直接删除 `width`,让表格分配剩余空间。
150
+ - 列宽至少应完整容纳标题。长文本列固定宽度时必须提供完整内容提示,优先 `props.showOverflowTooltip: true`,也可使用已验证的 `attribute.title` 或 tooltip/popover,避免内容被无提示截断。
151
+ - 列宽修改属于高风险视觉改动,提交后必须在常见桌面宽度下检查标题、内容、操作按钮和横向滚动行为。
140
152
 
141
153
  ## 图标列
142
154
  - 渲染层会把 `icon` / `iconColor` 作为列外层配置传入
@@ -0,0 +1,461 @@
1
+ # List Template Full Detail Guide
2
+
3
+ Archive reference for `bpmax-list-template-editor`.
4
+
5
+ The active entrypoint is `../SKILL.md`. This file preserves detailed workflow
6
+ notes, historical request shapes, and field examples. It is not a standalone
7
+ skill and must not weaken the typed CLI write path, scope gate, lint gate, or
8
+ real-user runtime validation requirements in `../SKILL.md`.
9
+
10
+ ---
11
+ name: "bpmax-list-template-editor"
12
+ description: "用于通过 bpmax-cli typed config 创建或编辑 BPMAX 项目列表模板。只要用户提到“新建列表模板”“编辑项目列表模板”“按需求改 BPMAX 列表列”“确认列表模板配置”“让 Codex 根据需求构造列表模板配置”或等价表达,就应使用这个 skill。它要求 Codex 先通过 typed CLI 和真实线上接口确认数据格式,再把模板导出到本地临时文件,走 work 文件修改、第一次确认、submit 文件构建、强制 lint、第二次确认、typed CLI 提交和接口回读的配置闭环。"
13
+ ---
14
+
15
+ # BPMAX List Template Editor
16
+
17
+ ## 写入路径硬约束
18
+ - 执行前必须先运行 `bpmax-cli config adapters --format json` 核对 `list-template`;只有 `build_status` 和 `submit_status` 都是 `supported` 时才允许进入 build/submit。当前若显示 `blocked`,只能导出、编辑 work、lint 和形成变更建议,不得提交。
19
+ - 在 bpmax-cli npm 分发包中,真实远端写操作只能走 `bpmax-cli config list-template build/submit/create/delete/verify` typed adapter;create 通过 `submit --id create:list-template`,delete 通过 `config list-template delete`。
20
+ - 旧来源脚本 `scripts/submit*.py` 只保留为结构参考,默认会硬失败;不得用它们直调 BPMAX API。
21
+ - 不得用 `bpmax-cli api POST/PUT/DELETE /flow_page_template*` 或其它 raw API 绕过 typed config submit。
22
+
23
+ ## 全局范围门禁
24
+ - 范围 gate 对本 skill 是强要求。任何会修改 BPMAX 配置、线上状态、本地提交体或最终结果的动作,都必须先归类为 `requested`、`required-collateral` 或 `out-of-scope`。
25
+ - 范围 gate 必须基于线上最新配置:分析或编辑配置前,先通过对应 workflow/API 拉取或读取远端最新状态;提交前再次确认本地 work/submit/payload 仍基于该最新远端基线,若线上配置已变化必须停止并重新对照。
26
+ - 只有用户明确要求的 `requested`,或为闭合需求不可避免的 `required-collateral`,才允许进入 work / submit / 线上 payload / 状态变更。
27
+ - `required-collateral` 必须逐项解释“不改会坏/会失真/会不闭合”的原因并取得确认;`out-of-scope` 一律不得提交或顺手混入。
28
+ - 不得以历史脏配置、顺手修复、统一风格、编辑器自动补字段、方便调试为理由修改需求外配置。
29
+
30
+ ## 何时使用
31
+ - 用户需要通过 bpmax-cli typed config 管理 BPMAX 列表模板。
32
+ - 用户要按自然语言需求新增、删除、调整列表列。
33
+ - 用户需要使用当前 CLI profile、capability 和线上回读结果完成配置闭环。
34
+ - 用户要让 Codex 通过 typed CLI 完成提交,再用接口回读和只读列表页核对结果。
35
+
36
+ ## 前置条件
37
+ - 先通过 CLI profile/capability 和目标参数确认以下任一对象:
38
+ - `.../w:<workspace>/project_detail_table/create`
39
+ - `.../w:<workspace>/project_detail_table/<id>`
40
+ - 编辑现有模板时,优先使用页面当前已经打开的完整编辑页 URL,不要擅自裁掉查询参数。
41
+ - 当前验证过的编辑页完整地址规则是:
42
+ - `/w:<workspace>/project_detail_table/<id>?flow_type=<flow_type>&flow_key=<flow_key>&_rad=1&flowKey=flow:<flow_type>:<flow_key>`
43
+ - 当 `flow_key` 为空字符串时,`flowKey` 仍然保留尾部冒号,例如:`flow:flow876464415:`
44
+ - 如果手动从项目列表页跳转到编辑页,必须按上面的完整规则进入,不要只拼裸路径 `/w:<workspace>/project_detail_table/<id>`,否则可能进入字段未完整回填的空壳编辑页。
45
+ - 如果是编辑现有模板,开始前必须确认页面里已经真实显示当前列标题,而不是只凭接口猜测。
46
+ - 用户需要在请求里明确说明这次要做什么改动。
47
+
48
+ ## Mem0 协议
49
+ - 开始前先调用 [$bpmax-memory-protocol](../bpmax-memory-protocol/SKILL.md),检索词至少包含:
50
+ - `flow_type`
51
+ - `flow_key`
52
+ - 列表模板 `id` / 模板名
53
+ - 关键列名 / 数据集字段 / 图标 / 标签 / 操作列关键词
54
+ - 优先查这些历史信息:
55
+ - 同流程已有列表模板和列对象骨架
56
+ - 某个字段做成图标列、状态列、图片列的已验证写法
57
+ - 编辑页保存链路或列表页渲染的已知坑点
58
+ - 完成接口回读、编辑页刷新确认,以及高风险场景下的列表页验收后,再写回真正可复用的结论:
59
+ - `decision`:列对象选型、lint 规则、验收口径
60
+ - `task_learning`:某类 `$template`、图标、图片预览、badge 或操作列的稳定写法
61
+ - `anti_pattern`:接口 success 但回读不一致、错误 URL 进入空壳编辑页、脚本列在列表页报错
62
+ - 不要把普通列顺序调整、颜色微调、整段列 JSON 原样写进 Mem0。
63
+ - 如果停在“submit 已构建但未二次确认”“lint 未通过”“接口回读未通过”“编辑页或列表页未验收”等状态,结束前写 `session_state`。
64
+
65
+ ## 核心原则
66
+ - 开发前必须先通过真实线上接口确认当前环境的列表模板详情结构,而不是只看本地镜像或旧请求样例。
67
+ - 只要用户反馈“项目列表没数据 / 暂无项目”,第一优先级先确认目标流程是否已经配置默认列表模板,而不是先把根因归到数据集、数据集字段或 ES 数据为空:
68
+ - 优先检查流程详情里的 `table_list_template`
69
+ - 或直接查 `GET /api/flow_page_template?flow_type=<flow_type>&type=1`
70
+ - 若默认列表模板未配置,页面可能直接显示空态,甚至不会自动发起 `POST /bpmax/project/list`;这是列表页运行时行为观察,不是脚本生成模板的默认方案
71
+ - 列表模板验收必须核对“列表列 -> 表单字段 -> 数据集字段”的一致性:
72
+ - 列表中展示的业务列必须能在当前流程发起表单、节点表单或数据集字段中找到稳定来源。
73
+ - 当表单字段 key、控件类型或数据集字段发生变化时,要同步检查列表列的 `$template` 是否仍读取正确 key。
74
+ - 列表模板的 `data_set_id` 必须指向当前流程实际发布并可刷新的数据集;不能只因为列表接口有模板回读就判定通过。
75
+ - 测试列表页时至少验证:字段列能渲染出真实数据、操作列可进入详情、筛选条件不会引用已删除或改名字段。
76
+ - 逐列检查是强要求:每一列都要记录列名、读取 key 或脚本来源、对应表单/数据集字段、是否符合业务语义;不能只抽查前几列或只看模板整体成功。
77
+ - 最终落库必须通过 `bpmax-cli config list-template submit` 完成,不回退成 `vm.save()`、旧脚本或 raw API 主路径。
78
+ - 编辑态若出现“脚本 PUT success 但 readback 不一致”或涉及 `data_set_id` 切换等已知 false positive 风险,必须追加页面运行时复核,不能直接宣告成功。
79
+ - 查询改写硬门禁:`config[]`、`customQuery`、`beforeSearch`、`tabFilters` 等查询位点里,不得把 `data_set_id` 当 ES dataset 查询入口;lint 命中后直接阻断提交。
80
+ - 查询改写默认口径:
81
+ - 前端脚本默认优先 `raw-es-search`
82
+ - 后端 helper 默认优先 `ctx.$esQuery(...)` 或已验证的 `rootUser` helper
83
+ - 脚本中禁止使用 `/bpmax/project/list` / 用户态 `ESProjectList`;涉及项目 ES 数据时必须使用 `raw-es-search` + `data_set_key`、后端 `ctx.$esQuery(...)` 或不依赖 project/list 的 helper
84
+ - 只有明确需要“当前登录人可见项目列表”语义时,才允许例外使用 `/bpmax/project/list` / 用户态 `ESProjectList`,且脚本里必须写 `bpmax-allow-user-scope-project-list: <reason>`;否则 lint 阻断
85
+ - 禁止把 `/bpmax/project/list` 返回的 `count` / `total` 当真实总数;该接口可能被 10000 上限截断,真实总数必须用 `raw-es-search` + `track_total_hits=true`
86
+ - 禁止把复杂 SQL join 作为数据集联动默认方案;能按数据集字段查询时,必须把条件下推到 `raw-es-search` / `ctx.$esQuery(...)`
87
+ - 禁止先拉取大批 ES 数据再在脚本里 `find` / `filter` / `some` 匹配;必须直接查询需要的数据并控制 `size`
88
+ - 禁止把 `raw-es-search`、`ctx.$esQuery(...)`、`/bpmax/project/list` 放进逐条 SN / 项目 / 团队循环里形成 N+1;必须批量 terms、aggregation 或预计算
89
+ - 默认主流程不是“在对话里手改 payload”,而是:
90
+ - 线上详情导出到本地临时文件
91
+ - 修改 `work`
92
+ - 第一次确认
93
+ - 构建 `submit`
94
+ - 强制 lint
95
+ - 第二次确认
96
+ - typed CLI submit
97
+ - 接口回读
98
+ - 浏览器刷新编辑页
99
+ - 高风险改动自动进入真实列表页验收
100
+ - typed CLI 线上回读、真实接口返回和只读列表页验收优先级高于本地 `think_*` 镜像;本地配置只用于检索候选和参考样例,不能覆盖线上事实。
101
+ - 新建与编辑要严格区分:
102
+ - 新建:`POST /api/flow_page_template`
103
+ - 编辑:`PUT /api/flow_page_template/:id`
104
+ - 如果任务是“继续修正刚创建的新模板”,不要再次沿用旧 sample 走 create 流程。
105
+ - create 成功后要把新模板 `id` 视为后续唯一目标,后续迭代优先切到该 `id` 的编辑模式。
106
+ - 否则很容易再次 `POST` 出第二个新模板,导致引用方仍指向旧 `template_id`,形成模板 ID 漂移。
107
+ - 列表模板不是表单模板:
108
+ - 不使用 `rule/value`
109
+ - 不使用 `publish`
110
+ - 主体是 `content: JSON.stringify({ level, config })`
111
+
112
+ ## 完成标准
113
+ - 低风险改动:
114
+ - `readbackAccepted`
115
+ - `editorPageAccepted`
116
+ - 高风险改动:
117
+ - `readbackAccepted`
118
+ - `editorPageAccepted`
119
+ - `listPageAccepted`
120
+ - 高风险场景自动触发条件:
121
+ - 脚本列
122
+ - badge / 状态标签 / `ColorBackgroundText`
123
+ - icon / 头像 / 颜色 / 单行溢出 / 列宽调整
124
+ - 操作列按钮
125
+ - 图片预览列
126
+ - `data_set_id` 切换
127
+
128
+ ## 工作流
129
+
130
+ ### 1. 识别当前模式
131
+ - 读取当前页 URL。
132
+ - 如果 URL 以 `/project_detail_table/create` 结尾,按“新建”流程处理。
133
+ - 如果 URL 形如 `/project_detail_table/<id>`,按“编辑”流程处理。
134
+ - 如果 URL 已带 `flow_type`、`flow_key`、`_rad`、`flowKey` 查询参数,默认保留整条 URL 继续工作;不要自行归一化成裸路径。
135
+ - 进入列配置构造前,先按流程、模板和目标列语义检索一次 Mem0。
136
+
137
+ ### 2. 获取 CLI 上下文
138
+ - 使用当前 `bpmax-cli` profile、capability 和线上 readback 作为授权与事实来源。
139
+ - 不读取或复用浏览器 Cookie、浏览器存储、手工请求头或旧脚本环境变量。
140
+ - URL 只作为目标 flow/workspace/template 的定位线索;真实写入必须回到 typed CLI。
141
+
142
+ - 当前已确认:
143
+ - `GET /api/flow_page_template/:id` 可直接读取详情
144
+ - `/bpmax/data-set` 是真实可用的数据集读取路径
145
+ - `/api/bpmax/data-set` 在当前同域上下文里会返回 403,不能作为默认事实来源
146
+
147
+ ### 3. 先用真实线上接口确认详情结构
148
+ - 编辑已有模板时,第一事实来源固定为:
149
+ - `GET /api/flow_page_template/:id`
150
+ - 新建模板时,必须先找到一个可复用模板或已验证样例,再用:
151
+ - `GET /api/flow_page_template/:sampleId`
152
+ - 把它当作 create skeleton 的真实格式样本
153
+ - 当前环境至少要确认这些顶层字段:
154
+ - `name`
155
+ - `desc`
156
+ - `data_set_id`
157
+ - `flow_type`
158
+ - `flow_key`
159
+ - `type`
160
+ - `content`
161
+ - `status`
162
+ - `content` 展开后至少包含:
163
+ - `level`
164
+ - `config`
165
+ - 只要线上接口返回与本地镜像冲突,一律以线上接口为准。
166
+
167
+ ### 3.1 检索候选模板
168
+ - 如果当前症状是“项目列表页显示暂无项目”,在新建或编辑模板前先确认该流程是否已有默认列表模板:
169
+ - 流程镜像中看 `flow.data.meta.table_list_template`
170
+ - 线上看 `GET /api/flow_page_template?flow_type=<flow_type>&type=1`
171
+ - 没有默认列表模板时,先把它视为根因候选;不要跳过这一步直接排查数据集
172
+ - 只要需求涉及“新建列表模板”“给流程配一套列表列”“参考已有列表模板改一个版本”,先在当前已激活配置仓库检索 `think_flow_page_template`。
173
+ - 检索方式优先:
174
+ - 模板名称
175
+ - 流程 `flow_type`
176
+ - 数据集相关关键词
177
+ - 列标题关键词
178
+ - 在没有得到用户确认前,不要直接新建一个语义重复的新列表模板。
179
+
180
+ ### 3.2 导出到本地临时文件
181
+ - 锁定目标模板后,默认先导出到 `.codex/tmp/list-template-editor/`,不要直接在对话里手拼 payload。
182
+ - 编辑已有模板:
183
+
184
+ ```bash
185
+ bpmax-cli config list-template export --id <template-id> --out .codex/tmp/list-template-editor --profile <profile> --format json
186
+ ```
187
+
188
+ - 基于线上样例创建 skeleton:
189
+
190
+ ```bash
191
+ bpmax-cli config list-template export --id <sample-template-id> --out .codex/tmp/list-template-editor --profile <profile> --format json
192
+ ```
193
+
194
+ - 如果当前任务涉及数据集字段映射或切换数据集,还必须取实时数据集列表:
195
+
196
+ ```bash
197
+ bpmax-cli config dataset export --id <data-set-id> --profile <profile> --format json
198
+ ```
199
+
200
+ ### 3.3 本地 work 文件结构
201
+ - `work/<stem>.json` 是唯一允许人工修改的主文件,结构固定为:
202
+ - `id`
203
+ - `mode`
204
+ - `sampleTemplateId`
205
+ - `basic`
206
+ - `content`
207
+ - `meta`
208
+ - `basic` 保存顶层业务字段:
209
+ - `name`
210
+ - `desc`
211
+ - `data_set_id`
212
+ - `flow_type`
213
+ - `flow_key`
214
+ - `type`
215
+ - `status`
216
+ - `content` 保存对象态的:
217
+ - `level`
218
+ - `config`
219
+ - `meta` 至少保留:
220
+ - `previousDataSetId`
221
+ - `sourceTemplateId`
222
+ - `riskHints`
223
+ - 用户只改对象态结构,不直接手写字符串化 `content`。
224
+
225
+ ### 3.4 第一次确认
226
+ - 修改 `work/<stem>.json` 后,先向用户展示 `diffs/<stem>.work.diff.txt` 的关键差异。
227
+ - 明确询问“work 文件是否正确”。
228
+ - 用户确认后,记录 work 确认状态:
229
+
230
+ ```bash
231
+ "$PYTHON_BIN" .codex/skills/bpmax-list-template-editor/scripts/confirm_list_template.py \
232
+ --stem 954573650 \
233
+ --stage work \
234
+ --actor codex
235
+ ```
236
+
237
+ - 没有明确确认前,不得构建 submit 文件。
238
+
239
+ ### 4. 构造 submit 文件
240
+ - `submit/<stem>.json` 只能通过脚本从 `work/<stem>.json` 构建,不能手写。
241
+ - 默认命令:
242
+
243
+ ```bash
244
+ "$PYTHON_BIN" .codex/skills/bpmax-list-template-editor/scripts/build_submit_payload.py \
245
+ --stem 954573650
246
+ ```
247
+
248
+ - 构建规则固定为:
249
+ - 顶层只保留真实需要的提交字段:`name/desc/data_set_id/flow_type/flow_key/type/content`
250
+ - `create` 模式额外补 `status`
251
+ - `content` 必须由脚本统一转成 `JSON.stringify({ level, config })`
252
+ - `content.config` 必须仍是数组
253
+
254
+ ### 5. 强制 lint 门禁
255
+ - 在第二次确认和正式提交前,必须先跑 lint:
256
+
257
+ ```bash
258
+ bpmax-cli config list-template lint --work .codex/tmp/list-template-editor/work/<stem>.json --profile <profile> --format json
259
+ ```
260
+
261
+ - lint 结果分两层,但都属于严格阻断:
262
+ - `errors`
263
+ - `style_errors`
264
+ - 命中以下任一问题就禁止继续:
265
+ - `content` 不是对象态,或 `config` 不是数组
266
+ - 列对象存在未允许字段,或混入表单模板字段
267
+ - `createElement.children.$template` / `eval` 结构非法
268
+ - 操作列在列根配置了 `icon` / `iconColor`
269
+ - 操作列任一按钮未配置按钮级 icon
270
+ - 操作列缺少“详情/查看”或“删除/移除”动作
271
+ - 删除/移除动作没有基于 `ctx.$CAN_DELETE` 或平台等价权限表达式的权限 guard
272
+ - 删除 guard 要求 `current_flow_step_id/name` 为空,或 `disabled` 直接使用正向权限表达式导致极性写反
273
+ - `icon` 不是完整 `ri ri_*`
274
+ - 普通数据列带 `icon` 的列数少于 1 列或多于 3 列
275
+ - `iconColor` 不符合规范
276
+ - 涉及到人的列未渲染头像
277
+ - 长文本列未配 `showOverflowTooltip`
278
+ - 固定宽度只写了 `width` 或只写了 `minWidth`
279
+ - 日期字段没有按 `YYYY-MM-DD` 规范处理
280
+ - HTML 字符串 badge 未使用已验证组件/结构
281
+ - `data_set_id` 不存在于实时数据集列表
282
+ - 模板里引用了当前数据集不存在的字段 key
283
+ - 切换 `data_set_id` 后保留了失效字段引用
284
+ - 已知限制:
285
+ - 这套 lint 目前按“当前 `data_set_id` 的字段集合”做静态校验。
286
+ - “人的列必须有头像”当前按列标题关键词和渲染结构做启发式识别,例如:`负责人` / `申请人` / `发起人` / `创建人` / `审批人` / `处理人` / `人员`。
287
+ - 如果列表模板实际运行在 `project/sub`、详情页子流程表格、或其他非纯 ES dataset 返回结构上,运行态可能还会额外提供 `metaForm`、`current_step` 等对象;这类引用在页面上可能可用,但 lint 仍可能报“字段不存在”。
288
+ - 遇到这类报错时,不要先假设模板写法错了,先确认当前列表真实数据源到底是 ES 列表还是 `project/sub`。
289
+
290
+ ### 6. 第二次确认
291
+ - lint 通过后,向用户展示 `submit/<stem>.json` 摘要和 `diffs/<stem>.submit.diff.txt`,再次明确询问“submit 文件是否正确”。
292
+ - 用户确认后,再记录 submit 确认状态:
293
+
294
+ ```bash
295
+ "$PYTHON_BIN" .codex/skills/bpmax-list-template-editor/scripts/confirm_list_template.py \
296
+ --stem 954573650 \
297
+ --stage submit \
298
+ --actor codex
299
+ ```
300
+
301
+ - 没有 lint 通过或没有第二次明确确认前,不得执行 typed CLI submit。
302
+
303
+ ### 7. Typed CLI 提交与接口回读
304
+ - 正式提交统一走:
305
+
306
+ ```bash
307
+ bpmax-cli config list-template submit \
308
+ --id 954573650 \
309
+ --payload .codex/tmp/list-template-editor/submit/list-template-954573650.json \
310
+ --confirm "submit list-template 954573650"
311
+ ```
312
+
313
+ - 旧 `submit_list_template.py` 只保留为结构参考,默认会硬失败。
314
+ - 不得直接调用 `POST/PUT /api/flow_page_template`。
315
+ - 提交后脚本必须自动生成:
316
+ - `result/<stem>.response.json`
317
+ - `result/<stem>.readback.json`
318
+ - `result/<stem>.readback.diff.txt`
319
+ - `result/<stem>.verify.json`
320
+ - `result/<stem>.acceptance.json`
321
+ - 回读验收至少检查:
322
+ - 顶层字段:`name/desc/data_set_id/flow_type/flow_key/type`
323
+ - `content.level`
324
+ - `content.config[]`
325
+ - 列标题顺序
326
+ - 若 `readback` 不一致,或涉及 `data_set_id` 切换、已知 false positive 场景,必须追加页面运行时复核,不能直接宣布完成。
327
+ - 如果列表模板被别的模板通过 `template_id` 引用,提交后还要回到引用方页面确认引用 ID 是否已经切到这次实际生效的新模板 ID。
328
+
329
+ ### 8. 刷新浏览器编辑页验收
330
+ - 提交成功后,必须刷新对应编辑页,让用户做最终确认。
331
+ - 编辑:
332
+ - 刷新当前 `/w:<workspace>/project_detail_table/<id>`
333
+ - 新建:
334
+ - 用返回的新 `id` 打开 `/w:<workspace>/project_detail_table/<newId>`
335
+ - 编辑页验收口径:
336
+ - 新字段或新列标题已出现
337
+ - 目标列顺序符合预期
338
+ - 数据集绑定修改已回填到页面
339
+ - 验收后记录:
340
+
341
+ ```bash
342
+ "$PYTHON_BIN" .codex/skills/bpmax-list-template-editor/scripts/record_acceptance.py \
343
+ --stem 954573650 \
344
+ --editor-page-accepted
345
+ ```
346
+
347
+ ### 9. 高风险自动列表页验收
348
+ - 命中高风险条件时,必须继续打开真实列表页:
349
+ - `/w:<workspace>/project?flow_type=<flow_type>&flow_key=<flow_key>`
350
+ - 至少检查:
351
+ - 目标列是否真实出现在列表页
352
+ - 图标、头像、badge、单行溢出、列宽是否符合预期
353
+ - 控制台是否出现模板引入的 `eval fn parsed failed`、`TypeError` 等错误
354
+ - 数据集切换后列表是否仍正常渲染
355
+ - 验收后记录:
356
+
357
+ ```bash
358
+ "$PYTHON_BIN" .codex/skills/bpmax-list-template-editor/scripts/record_acceptance.py \
359
+ --stem 954573650 \
360
+ --list-page-accepted
361
+ ```
362
+ - 高风险验收未通过时,skill 不允许宣告完成。
363
+
364
+ ## 列对象与结构约束
365
+ - 每个列对象至少可能包含:
366
+ - `title`
367
+ - `props`
368
+ - `createElement`
369
+ - `icon`
370
+ - `iconColor`
371
+ - `isSort`
372
+ - `sortConf`
373
+ - `preset`
374
+ - 如果需求是“把某个数据集字段加成一列”,优先按前端 `FieldSelector` 的结构生成:
375
+ - `title` 使用字段名
376
+ - `createElement.children.$template` 使用 `ctx.<dataSetFieldKey>`
377
+ - `createElement.children.eval = true`
378
+ - 图标规则:
379
+ - 操作列列根不要配置 `icon` / `iconColor`
380
+ - 操作列的每个操作按钮前面都要带 icon
381
+ - 操作列必须包含详情/查看动作和删除/移除动作
382
+ - 删除/移除动作必须有权限 guard,首选 `ctx.$CAN_DELETE`;若使用 `disabled`,写成 `!ctx.$CAN_DELETE`
383
+ - `$CAN_DELETE` 已覆盖全局删除权限,以及“仅删除本人项目”权限与创建人匹配;不得再用当前环节为空推导删除权限
384
+ - 业务状态可以追加到权限表达式,但不能替代权限 guard
385
+ - 普通数据列至少 1 列带 icon,最多 3 列带 icon
386
+ - 列表列 icon 和操作按钮 icon 都必须写完整 class:`ri ri_*`
387
+ - 默认优先统一浅灰色:`#D6DCE5`
388
+ - 人员列规则:
389
+ - 涉及到人的列必须渲染头像,不允许只显示姓名文本
390
+ - 默认优先使用 `el-avatar + span` 的“头像 + 名称”结构
391
+ - 多人列也必须带头像,至少要有稳定的头像渲染节点,而不是纯 `name.join(',')`
392
+ - 空值兜底:
393
+ - 简单字段列推荐写法:`ctx.xxx || '--'`
394
+ - 日期字段默认只显示 `YYYY-MM-DD`
395
+ - 长文本列优先加 `showOverflowTooltip: true`
396
+ - 列宽规则:
397
+ - 用户明确要求固定宽度时,默认同时写 `props.width` 和 `props.minWidth`
398
+ - 不要把表单模板概念混进列表模板:
399
+ - 不使用 `rule`
400
+ - 不使用 `value`
401
+ - 不使用 `field_type`
402
+ - 不使用 `publish`
403
+
404
+ ## 输出要求
405
+ - 明确告诉用户这次是“新建”还是“编辑”。
406
+ - 如果做过现有模板检索,要先汇报候选模板并说明是否已得到用户确认。
407
+ - 明确告诉用户本次用到的核心 typed CLI 命令:
408
+ - `bpmax-cli config list-template export`
409
+ - `bpmax-cli config list-template lint`
410
+ - `bpmax-cli config list-template build`
411
+ - `bpmax-cli config list-template submit`
412
+ - `bpmax-cli config list-template verify`
413
+ - 如果引用了旧来源脚本,只能说明它们用于结构参考或本地 lint,不得把旧 `submit_list_template.py` 描述为提交路径。
414
+ - 必须说明:
415
+ - `work` 是否已确认
416
+ - lint 是否已通过
417
+ - `submit` 是否已确认
418
+ - 接口回读是否通过
419
+ - 浏览器编辑页是否已刷新确认
420
+ - 若命中高风险条件,真实列表页是否已验收
421
+
422
+ ## 参考资料
423
+ - 创建/编辑接口与内容结构: [list-template-api-workflow.md](./list-template-api-workflow.md)
424
+ - `content.config[]` 形态与列对象模型: [content-config-shape.md](./content-config-shape.md)
425
+ - 提交前的 payload 检查清单: [payload-checklist.md](./payload-checklist.md)
426
+ - 当前页面与前端实现对应关系: [browser-page-contract.md](./browser-page-contract.md)
427
+ - 数据集字段映射列的生成规则: [dataset-field-mapping.md](./dataset-field-mapping.md)
428
+ - 运行时验证过的页面操作方式: [runtime-verified-workflow.md](./runtime-verified-workflow.md)
429
+ - 当前已确认可用的特殊格式清单: [special-formats.md](./special-formats.md)
430
+ - 本地临时文件闭环: [local-temp-workflow.md](./local-temp-workflow.md)
431
+
432
+ ## 关键经验
433
+ - 编辑态最终仍要 typed CLI 提交,但对“接口 success、回读不一致”的场景必须提高警惕,不能只看 200。
434
+ - 数据集读取必须走 `/bpmax/data-set`;新增字段列和切换数据集时,实时数据集列表是唯一事实来源。
435
+ - 图标 class 必须完整,不能写成 `ri_file-text-line` 这种半截格式。
436
+ - 操作列列根配置 `icon` / `iconColor` 或任一按钮缺少 icon 都视为 lint 阻断项;普通列按“至少 1 列、最多 3 列”控制 icon 覆盖数量。
437
+ - 涉及到人的列必须带头像,优先复用 `el-avatar + span`;只写姓名文本视为 lint 阻断项。
438
+ - 至少一个非操作数据列必须省略 `width` 作为自适应列;操作/选择/序号列不能代替数据列满足该要求。
439
+ - 固定数据列可只写 `width`;同时设置 `minWidth` 时保证 `minWidth <= width`,且标题可以完整展示;长文本固定列必须提供 `showOverflowTooltip`、`attribute.title` 或 tooltip/popover 等完整内容提示。
440
+ - HTML 字符串 badge、复杂脚本列、图标和操作列都属于高风险改动,默认必须进真实列表页验收。
441
+
442
+
443
+ ## bpmax-cli 统一执行入口
444
+
445
+ 本 npm 分发版必须优先使用 typed CLI 命令,不要让 Agent 直接拼 raw API 或直接运行旧来源脚本提交配置:
446
+
447
+ ```bash
448
+ bpmax-cli config list-template export --id <id> --out .codex/tmp/list-template-editor
449
+ bpmax-cli config list-template lint --work .codex/tmp/list-template-editor/work/<file>.json
450
+ bpmax-cli config list-template impact --raw .codex/tmp/list-template-editor/raw/<file>.json --work .codex/tmp/list-template-editor/work/<file>.json --out .codex/tmp/list-template-editor/result/<file>.impact.json
451
+ bpmax-cli config list-template build --work .codex/tmp/list-template-editor/work/<file>.json --meta .codex/tmp/list-template-editor/meta/<file>.meta.json --out .codex/tmp/list-template-editor/submit/<file>.json --impact-report .codex/tmp/list-template-editor/result/<file>.impact.json
452
+ bpmax-cli config list-template submit --id <id> --payload .codex/tmp/list-template-editor/submit/<file>.json --validation-report .codex/tmp/list-template-editor/result/<file>.runtime.json
453
+ bpmax-cli config list-template submit --id <id> --payload .codex/tmp/list-template-editor/submit/<file>.json --validation-report .codex/tmp/list-template-editor/result/<file>.runtime.json --confirm "submit list-template <id>"
454
+ bpmax-cli config list-template verify --id <id> --expect .codex/tmp/list-template-editor/work/<file>.json
455
+ ```
456
+
457
+ 权限相关修改还必须在 build 时传 `--boundary-manifest <file>`。当 build 产物要求运行态证据时,先用 `config list-template smoke --evidence <runtime-report>` 校验完整矩阵;只有审计过的紧急情况才能用 `--override-reason "<具体原因>"` 覆盖。
458
+
459
+ 授权前置:当前 profile 必须通过校对码授权,并在授权页开启“配置能力”。如果 CLI 返回 capability 缺失,停止并让用户使用有管理权限的账号重新授权。
460
+
461
+ 旧来源中的 `scripts/` 和 `references/` 只作为字段结构、lint 规则和验收规则参考;真实远端写操作必须走 `bpmax-cli config list-template build/submit/create/delete/verify` typed adapter,保留 dry-run、二次确认、审计和回读验证。
@@ -7,18 +7,15 @@
7
7
  - 编辑页:`/w:<workspace>/project_detail_table/<id>`
8
8
 
9
9
  ## 鉴权与执行环境
10
- - 优先依赖浏览器当前登录态。
11
- - 优先在页面上下文内观察同域请求,复用已有 Cookie 做只读诊断。
12
- - 可读取的上下文包括:
13
- - `document.cookie`
14
- - `localStorage`
15
- - `sessionStorage`
16
- - 当前页最近一次提交流量
10
+ - 优先依赖 `bpmax-cli` profile、capability 和 typed CLI readback。
11
+ - 浏览器页面只用于只读验收、可见行为观察和错误定位,不作为配置读取、写入或鉴权来源。
12
+ - 不得读取或复用浏览器 Cookie、浏览器存储、手工请求头或页面会话凭据。
13
+ - 可以记录脱敏后的 URL、可见列、console/network 错误摘要和接口契约差异。
17
14
 
18
15
  实践建议:
19
- - 如果只是为了确认接口结构,可以观察页面里的 `fetch(..., { credentials: 'include' })`。
16
+ - 如果只是为了确认接口结构,优先用 typed CLI export/readback;页面网络面板只能作为只读契约对照。
20
17
  - 如果需要提交,必须把结构写入本地 work 文件并通过 `bpmax-cli config list-template submit`。
21
- - Cookie 信息用于确认和诊断,不应成为唯一提交手段。
18
+ - 页面会话凭据不得成为提交、诊断复现或自动化脚本的输入。
22
19
 
23
20
  ## 已确认的接口
24
21
 
@@ -18,7 +18,7 @@
18
18
  5. 构建 `submit`
19
19
  6. 运行严格 lint,检查结构、样式、 icon 和数据集字段合法性
20
20
  7. 向用户展示 `submit diff` 做第二次确认
21
- 8. 执行提交脚本
21
+ 8. 执行 typed CLI submit
22
22
  9. 回读线上详情
23
23
  10. 刷新浏览器编辑页验收
24
24
  11. 若命中高风险条件,再进入真实列表页验收
@@ -74,10 +74,13 @@ const res = await vm.$axios.$post('/flow_page_template', payload);
74
74
  实际提交必须改为:
75
75
 
76
76
  ```bash
77
- bpmax-cli config list-template build --work <work-file> --meta <meta-file> --out <submit-file>
78
- bpmax-cli config list-template submit --id <template-id> --payload <submit-file> --confirm "submit list-template <template-id>"
77
+ bpmax-cli config list-template impact --raw <raw-file> --work <work-file> --out <impact-report>
78
+ bpmax-cli config list-template build --work <work-file> --meta <meta-file> --out <submit-file> --impact-report <impact-report>
79
+ bpmax-cli config list-template submit --id <template-id> --payload <submit-file> --validation-report <runtime-report> --confirm "submit list-template <template-id>"
79
80
  ```
80
81
 
82
+ 权限相关修改还必须在 build 时传 `--boundary-manifest <file>`;只有审计过的紧急情况才能用 `--override-reason "<具体原因>"` 代替运行态验证报告。
83
+
81
84
  ## 创建页默认模板与线上默认模板
82
85
  - `create` 页默认骨架不一定等于当前流程线上已挂的默认列表模板
83
86
  - 应优先读取:
@@ -90,6 +93,51 @@ vm.flow?.data?.meta?.table_list_template
90
93
  - 基于 create 页默认骨架扩展
91
94
  - 还是基于已有线上模板复制增强
92
95
 
96
+ ## 关键字段运行态契约
97
+
98
+ 页面有项目行、静态 lint 通过或接口返回 200 都不能证明关键业务列可用。对每个关键列生成 `schema_version=1` 的证据文件,并执行:
99
+
100
+ ```bash
101
+ bpmax-cli config list-template runtime-check --evidence <runtime-evidence.json> --profile <profile> --format json
102
+ ```
103
+
104
+ 最小证据结构:
105
+
106
+ ```json
107
+ {
108
+ "schema_version": 1,
109
+ "field_contracts": [
110
+ {
111
+ "field": "award_amount",
112
+ "required_nonempty": true,
113
+ "allowed_empty_reason": null,
114
+ "source_dataset_field": "award_amount",
115
+ "detail_consistency": true,
116
+ "runtime_evidence": {
117
+ "page": "real list page",
118
+ "row": 1
119
+ },
120
+ "icon_token": {
121
+ "name": "ri ri_money-cny-circle-line",
122
+ "color": "text-muted"
123
+ }
124
+ }
125
+ ],
126
+ "dataset_fields": ["award_amount"],
127
+ "list_row": { "award_amount": 12000 },
128
+ "detail_values": { "award_amount": 12000 },
129
+ "index_document": { "award_amount": 12000 },
130
+ "icon_tokens": {
131
+ "award_amount": {
132
+ "name": "ri ri_money-cny-circle-line",
133
+ "color": "text-muted"
134
+ }
135
+ }
136
+ }
137
+ ```
138
+
139
+ `field_contracts` 的六个契约项缺一不可。命令会区分 `source_empty`、`mapping_missing`、`index_stale`、`template_unresolved`、`icon_token_mismatch` 和 `contract_invalid`,任一关键字段不是 `ok` 都以非零状态退出。允许为空的字段必须设置 `required_nonempty=false` 并写明 `allowed_empty_reason`;没有图标的列仍要显式写 `icon_token: null`。
140
+
93
141
  ## 状态彩色标签的已验证方案
94
142
 
95
143
  状态标签列可直接使用:
@@ -228,7 +228,7 @@
228
228
  {
229
229
  "is": "el-button",
230
230
  "if": {
231
- "$template": "{return ctx.status === 0 && !ctx.current_flow_step_name}",
231
+ "$template": "{return ctx.$CAN_DELETE}",
232
232
  "eval": true
233
233
  },
234
234
  "attribute": {
@@ -250,7 +250,10 @@
250
250
  - 操作列不要在列根写 `icon` / `iconColor`。
251
251
  - 每个操作按钮都要自己带 icon,推荐直接写在 `attribute.props.icon`。
252
252
  - 操作列必须保留“详情/查看”和“删除/移除”动作;缺删除动作时 CLI gate 会阻断。
253
- - 删除/移除动作必须带可用性 guard,例如 `if` 或 `disabled`,并引用项目状态、当前环节或步骤状态。默认语义是:刚创建、未推进到第一个节点后的项目可以删除;过了第一个节点后不能删除。
253
+ - 删除/移除动作必须带权限 guard。可见性写法使用 `if: ctx.$CAN_DELETE`;禁用写法使用 `disabled: !ctx.$CAN_DELETE`。
254
+ - `$CAN_DELETE` 对齐平台 `project.delete`,以及 `project.delete.my + 当前用户是创建人` 的权限判断。项目状态只能作为额外限制,不能替代权限 guard。
255
+ - 显式展开本人项目权限时,只使用 `ctx.__owner_id === ctx.$USER_INFO.id`;不要使用列表上下文不保证存在的 `project.owner.id` 或 `__project_owner.id`。
256
+ - 禁止要求 `current_flow_step_id/name` 为空;对于创建即生效的流程,该条件会让删除按钮永久隐藏。
254
257
 
255
258
  ## 5. 条件显示
256
259