@shundoo-ai/dsh-cosmic 1.0.19 → 1.0.21

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 (245) hide show
  1. package/cordis.patch.yml +5 -5
  2. package/package.json +1 -1
  3. package/skills/cosmic-build/CHANGELOG.md +4 -0
  4. package/skills/cosmic-build/LOCAL-PATCHES.md +91 -40
  5. package/skills/cosmic-build/SKILL.md +46 -13
  6. package/skills/cosmic-build/assets/platform-report-filters/TypedReportFilterFields.java +169 -0
  7. package/skills/cosmic-build/assets/platform-report-filters/platform.patch +98 -0
  8. package/skills/cosmic-build/assets/report-algo-benchmark/ReportAlgoBenchmark.java +48 -0
  9. package/skills/cosmic-build/assets/report-algo-benchmark/ReportBenchmarkLogFactory.java +7 -0
  10. package/skills/cosmic-build/examples/java-rules/CosmicEntryQuery.java +26 -0
  11. package/skills/cosmic-build/examples/java-rules/CosmicReportAggregation.java +35 -0
  12. package/skills/cosmic-build/examples/java-rules/CosmicReportFilters.java +77 -0
  13. package/skills/cosmic-build/examples/java-rules/CosmicTimeAdapter.java +25 -0
  14. package/skills/cosmic-build/examples/java-rules/CosmicTimeAdapterCheck.java +26 -0
  15. package/skills/cosmic-build/knowledge/cosmic/platform/api/algo/GroupbyDataSet.md +47 -0
  16. package/skills/cosmic-build/knowledge/cosmic/platform/api/entity/report/FilterInfo.md +12 -12
  17. package/skills/cosmic-build/knowledge/cosmic/platform/api/entity/report/FilterItemInfo.md +2 -0
  18. package/skills/cosmic-build/knowledge/cosmic/platform/form-plugin.md +2 -4
  19. package/skills/cosmic-build/knowledge/cosmic/platform/java-type-contracts.md +11 -2
  20. package/skills/cosmic-build/knowledge/cosmic/platform/list-plugin.md +18 -14
  21. package/skills/cosmic-build/knowledge/cosmic/platform/operation-plugin.md +4 -4
  22. package/skills/cosmic-build/knowledge/cosmic/platform/reportlistdata-plugin.md +17 -9
  23. package/skills/cosmic-build/knowledge/cosmic/platform/scenes/operation/cross-entity-aggregate-writeback.md +2 -0
  24. package/skills/cosmic-build/knowledge/cosmic/platform/scenes/operation/pre-post-operation.md +15 -7
  25. package/skills/cosmic-build/knowledge/cosmic/platform/sdk/sdk-algo.md +24 -68
  26. package/skills/cosmic-build/knowledge/cosmic/platform/workflow-plugin.md +2 -7
  27. package/skills/cosmic-build/references/application-context.md +35 -1
  28. package/skills/cosmic-build/references/common-reference.md +1 -1
  29. package/skills/cosmic-build/references/compile-guide.md +55 -68
  30. package/skills/cosmic-build/references/delivery.md +59 -7
  31. package/skills/cosmic-build/references/execution-contract.md +38 -0
  32. package/skills/cosmic-build/references/form-discovery.md +7 -1
  33. package/skills/cosmic-build/references/java-plugin-delivery.md +32 -162
  34. package/skills/cosmic-build/references/operation-dispatch.md +17 -0
  35. package/skills/cosmic-build/references/plugin-handoff-input.md +131 -0
  36. package/skills/cosmic-build/references/plugin-runtime-routing.md +1 -1
  37. package/skills/cosmic-build/references/report-filter-contract.md +78 -0
  38. package/skills/cosmic-build/references/sdk-inspection.md +23 -0
  39. package/skills/cosmic-build/schemas/data-model-authoring.schema.json +2 -3
  40. package/skills/cosmic-build/scripts/_http_client.py +55 -55
  41. package/skills/cosmic-build/scripts/appconfig_load.py +2 -2
  42. package/skills/cosmic-build/scripts/apply_report_filter_extension.py +39 -0
  43. package/skills/cosmic-build/scripts/bootstrap_cosmic_context.py +37 -2
  44. package/skills/cosmic-build/scripts/compile_plugin_source.py +279 -156
  45. package/skills/cosmic-build/scripts/execution_binding.py +40 -0
  46. package/skills/cosmic-build/scripts/inspect_platform_sdk.py +169 -0
  47. package/skills/cosmic-build/scripts/kd_api.py +23 -22
  48. package/skills/cosmic-build/scripts/kd_auth.py +1 -1
  49. package/skills/cosmic-build/scripts/kd_env_loader.py +19 -10
  50. package/skills/cosmic-build/scripts/kd_token_cache.py +2 -2
  51. package/skills/cosmic-build/scripts/kingscript_sdk_sync.py +350 -0
  52. package/skills/cosmic-build/scripts/kingscript_source_gate.py +11 -8
  53. package/skills/cosmic-build/scripts/platform_api_contract.py +246 -11
  54. package/skills/cosmic-build/scripts/plugin_corpus/build_index.py +403 -0
  55. package/skills/cosmic-build/scripts/plugin_corpus/jvm_classfile.py +281 -0
  56. package/skills/cosmic-build/scripts/plugin_corpus/measure_api_usage.py +446 -0
  57. package/skills/cosmic-build/scripts/plugin_source_gate.py +48 -7
  58. package/skills/cosmic-build/scripts/plugin_target_sdk.py +45 -0
  59. package/skills/cosmic-build/scripts/prepare_plugin_handoff.py +493 -47
  60. package/skills/cosmic-build/scripts/preview_url.py +35 -6
  61. package/skills/cosmic-build/scripts/query_plugin_handoff.py +250 -0
  62. package/skills/cosmic-build/scripts/register_plugins.py +28 -2
  63. package/skills/cosmic-build/scripts/render_output_cards.py +42 -9
  64. package/skills/cosmic-build/scripts/report_algo_benchmark.py +46 -0
  65. package/skills/cosmic-build/scripts/run.py +2 -2
  66. package/skills/cosmic-build/scripts/sync_generated_locale_assets.py +43 -0
  67. package/skills/cosmic-build/scripts/test/fixtures/ReportSdkCheck.java +64 -0
  68. package/skills/cosmic-build/scripts/test/fixtures/java_context_booking_native.json +541 -0
  69. package/skills/cosmic-build/scripts/test/test_add_rule_business_contract.py +85 -14
  70. package/skills/cosmic-build/scripts/test/test_batch5_drift_governance.py +12 -3
  71. package/skills/cosmic-build/scripts/test/test_build_meta_order.py +0 -16
  72. package/skills/cosmic-build/scripts/test/test_cli_continuation.py +87 -0
  73. package/skills/cosmic-build/scripts/test/test_compile_plugin_source.py +224 -3
  74. package/skills/cosmic-build/scripts/test/test_control_authoring.py +123 -4
  75. package/skills/cosmic-build/scripts/test/test_cosmic_sdk_examples.py +141 -0
  76. package/skills/cosmic-build/scripts/test/test_data_model_contract.py +30 -5
  77. package/skills/cosmic-build/scripts/test/test_delivery_stage_boundary.py +2 -10
  78. package/skills/cosmic-build/scripts/test/test_dym_sync_background.py +11 -0
  79. package/skills/cosmic-build/scripts/test/test_dynamic_form_metadata_only_contract.py +59 -1
  80. package/skills/cosmic-build/scripts/test/test_guide_skeleton_contract.py +87 -43
  81. package/skills/cosmic-build/scripts/test/test_inspect_platform_sdk.py +71 -0
  82. package/skills/cosmic-build/scripts/test/test_kd_api.py +67 -19
  83. package/skills/cosmic-build/scripts/test/test_kingscript_sdk_sync.py +221 -0
  84. package/skills/cosmic-build/scripts/test/test_kingscript_source_gate.py +10 -0
  85. package/skills/cosmic-build/scripts/test/test_list_configuration_closure.py +18 -0
  86. package/skills/cosmic-build/scripts/test/test_long_session_regressions.py +116 -0
  87. package/skills/cosmic-build/scripts/test/test_mcp_cli.py +524 -0
  88. package/skills/cosmic-build/scripts/test/test_modeling_input_recovery.py +141 -0
  89. package/skills/cosmic-build/scripts/test/test_open_world_cli_catalog.py +36 -2
  90. package/skills/cosmic-build/scripts/test/test_platform_api_contract.py +161 -1
  91. package/skills/cosmic-build/scripts/test/test_plugin_business_contract.py +91 -0
  92. package/skills/cosmic-build/scripts/test/test_plugin_corpus.py +195 -0
  93. package/skills/cosmic-build/scripts/test/test_plugin_handoff.py +346 -1
  94. package/skills/cosmic-build/scripts/test/test_plugin_target_sdk.py +70 -0
  95. package/skills/cosmic-build/scripts/test/test_preview_url.py +44 -1
  96. package/skills/cosmic-build/scripts/test/test_property_batch.py +22 -0
  97. package/skills/cosmic-build/scripts/test/test_property_input_discovery.py +13 -11
  98. package/skills/cosmic-build/scripts/test/test_query_plugin_handoff.py +160 -0
  99. package/skills/cosmic-build/scripts/test/test_register_plugins.py +31 -1
  100. package/skills/cosmic-build/scripts/test/test_render_output_cards.py +50 -4
  101. package/skills/cosmic-build/scripts/test/test_report_business_contract.py +27 -0
  102. package/skills/cosmic-build/scripts/test/test_report_doc_contract_sync.py +5 -4
  103. package/skills/cosmic-build/scripts/test/test_report_sdk_optimization.py +36 -0
  104. package/skills/cosmic-build/scripts/test/test_rule_batch_evidence.py +1 -1
  105. package/skills/cosmic-build/scripts/test/test_rule_domain_contract.py +20 -0
  106. package/skills/cosmic-build/scripts/test/test_rule_function_formula.py +16 -6
  107. package/skills/cosmic-build/scripts/test/test_skill_entry_contract.py +1 -0
  108. package/skills/cosmic-build/scripts/test/test_test_environment.py +45 -0
  109. package/skills/cosmic-build/scripts/test/test_verify_plugin_loading.py +79 -0
  110. package/skills/cosmic-build/scripts/test_environment.py +49 -0
  111. package/skills/cosmic-build/scripts/verify_plugin_loading.py +71 -0
  112. package/skills/cosmic-build/skills/cosmic-coding-impl/SKILL.md +86 -162
  113. package/skills/cosmic-build/skills/cosmic-coding-script/ATTRIBUTION.md +1 -1
  114. package/skills/cosmic-build/skills/cosmic-coding-script/SKILL.md +45 -14
  115. package/skills/cosmic-build/skills/cosmic-coding-script/references/kwc-controller-authoring.md +6 -0
  116. package/skills/cosmic-build/skills/cosmic-coding-script/references/sdk/README.md +29 -19
  117. package/skills/cosmic-build/skills/cosmic-coding-script/references/sdk/docs//350/204/232/346/234/254SDK.md +3 -4
  118. package/skills/cosmic-build/skills/cosmic-coding-script/references/sdk/indexes/package-index.md +1 -1
  119. package/skills/cosmic-build/skills/cosmic-coding-script/references/sdk/strategy.md +27 -18
  120. package/skills/cosmic-build/skills/cosmic-meta-api/SKILL.md +11 -17
  121. package/skills/cosmic-build/skills/cosmic-meta-api/apis/ai_meta.md +1 -1
  122. package/skills/cosmic-build/skills/cosmic-meta-api/apis/app_menu.md +1 -1
  123. package/skills/cosmic-build/skills/cosmic-meta-api/apis/meta_log.md +1 -1
  124. package/skills/cosmic-build/skills/cosmic-meta-api/contracts/cli/control-authoring.json +45 -4
  125. package/skills/cosmic-build/skills/cosmic-meta-api/contracts/cli/form-control-traits.json +1 -1
  126. package/skills/cosmic-build/skills/cosmic-meta-api/contracts/cli/layout-ui.json +18 -0
  127. package/skills/cosmic-build/skills/cosmic-meta-api/contracts/cli/menu-publish.json +8 -2
  128. package/skills/cosmic-build/skills/cosmic-meta-api/contracts/cli/property-batch.json +7 -0
  129. package/skills/cosmic-build/skills/cosmic-meta-api/contracts/cli/property-input-index.json +3 -3
  130. package/skills/cosmic-build/skills/cosmic-meta-api/contracts/cli/report-write-contracts.json +1 -0
  131. package/skills/cosmic-build/skills/cosmic-meta-api/contracts/cli/rule-domain.json +37 -5
  132. package/skills/cosmic-build/skills/cosmic-meta-api/contracts/cli/rule-event-contract.json +24 -3
  133. package/skills/cosmic-build/skills/cosmic-meta-api/contracts/cli/run-build-meta.json +61 -12
  134. package/skills/cosmic-build/skills/cosmic-meta-api/contracts/schema/dropdown-menu.schema.json +69 -0
  135. package/skills/cosmic-build/skills/cosmic-meta-api/contracts/schema/report-write.schema.json +2 -1
  136. package/skills/cosmic-build/skills/cosmic-meta-api/contracts/schema/rule-set.schema.json +1 -0
  137. package/skills/cosmic-build/skills/cosmic-meta-api/contracts/schema/rule-write.schema.json +14 -7
  138. package/skills/cosmic-build/skills/cosmic-meta-api/docs/api-summary.md +2 -2
  139. package/skills/cosmic-build/skills/cosmic-meta-api/modules/app-action/SKILL.md +6 -3
  140. package/skills/cosmic-build/skills/cosmic-meta-api/modules/develop/SKILL.md +1 -2
  141. package/skills/cosmic-build/skills/cosmic-meta-api/modules/export/SKILL.md +5 -6
  142. package/skills/cosmic-build/skills/cosmic-meta-api/modules/init/SKILL.md +13 -36
  143. package/skills/cosmic-build/skills/cosmic-meta-api/modules/pdm/SKILL.md +8 -9
  144. package/skills/cosmic-build/skills/cosmic-meta-api/modules/pdm/scripts/config.json.example +5 -15
  145. package/skills/cosmic-build/skills/cosmic-meta-api/modules/reset/SKILL.md +6 -6
  146. package/skills/cosmic-build/skills/cosmic-meta-api/modules/usage/SKILL.md +20 -148
  147. package/skills/cosmic-build/skills/cosmic-meta-api/modules/verify/SKILL.md +1 -1
  148. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/build_receipts.py +171 -0
  149. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/cmd_apps.py +25 -6
  150. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/cmd_controls.py +55 -21
  151. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/cmd_fields.py +10 -3
  152. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/cmd_formactions.py +63 -6
  153. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/cmd_forms.py +59 -2
  154. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/cmd_listui.py +8 -0
  155. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/cmd_metaops.py +36 -1
  156. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/cmd_plugins.py +115 -90
  157. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/cmd_properties.py +666 -4
  158. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/cmd_rules.py +1415 -87
  159. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/commands.py +6 -1
  160. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/config.py +28 -15
  161. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/execution_errors.py +40 -0
  162. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/formatters.py +32 -5
  163. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/property_policy_contract.py +6 -0
  164. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/report_ops.py +113 -17
  165. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/reset.py +3 -3
  166. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/_core/rule_contract.py +107 -26
  167. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/build_meta_order.py +50 -49
  168. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/cosmic_api.py +856 -150
  169. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/field_decorator.py +47 -14
  170. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/test/test_build_receipt_resume.py +374 -0
  171. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/test/test_cli_failure_contract.py +24 -0
  172. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/test/test_creation_identity_boundary.py +4 -2
  173. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/test/test_dropdown_menu_contract.py +382 -0
  174. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/test/test_existing_form_ui.py +0 -25
  175. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/test/test_field_decorator.py +50 -6
  176. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/test/test_functional_group_resolution.py +83 -16
  177. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/test/test_identity_template_resolution.py +103 -0
  178. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/test/test_report_plugin_contract.py +28 -2
  179. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/test/test_report_readback_derivation.py +22 -0
  180. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/test/test_report_typed_filters.py +65 -0
  181. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/test/test_rule_write_closure.py +1041 -15
  182. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/test/test_run_batch_post_build_recovery.py +65 -0
  183. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/test/test_run_batch_verification_evidence.py +17 -0
  184. package/skills/cosmic-build/skills/cosmic-meta-knowledge/generation/api-param-checklist.md +1 -1
  185. package/skills/cosmic-build/skills/cosmic-meta-knowledge/generation/rule-modeling-guide.md +7 -4
  186. package/skills/cosmic-build/skills/cosmic-meta-modeling/SKILL.md +61 -13
  187. package/skills/cosmic-build/skills/cosmic-meta-modeling/modules/app-menu/SKILL.md +8 -0
  188. package/skills/cosmic-build/skills/cosmic-meta-modeling/modules/formtemplate/SKILL.md +5 -0
  189. package/skills/cosmic-build/skills/cosmic-meta-modeling/modules/formtemplate/dynamic-form-artifact-schema.md +5 -0
  190. package/skills/cosmic-build/skills/cosmic-meta-modeling/modules/report/SKILL.md +21 -9
  191. package/skills/cosmic-build/skills/cosmic-meta-modeling/references/authoring-entity-graphs.md +1 -1
  192. package/skills/cosmic-build/skills/cosmic-meta-modeling/references/authoring-storage-constraints.md +5 -3
  193. package/skills/cosmic-build/skills/cosmic-meta-modeling/references/authoring-ui-composition.md +6 -3
  194. package/skills/cosmic-build/skills/cosmic-meta-modeling/references/creation-recovery.md +13 -0
  195. package/skills/cosmic-build/skills/cosmic-meta-modeling/references/parse-core.md +3 -0
  196. package/skills/cosmic-build/skills/cosmic-meta-modeling/scripts/data_model_contract.py +6 -1
  197. package/skills/cosmic-build/skills/cosmic-meta-modeling/scripts/data_model_emit.py +135 -87
  198. package/skills/cosmic-build/skills/cosmic-meta-modeling/scripts/field_type_registry.py +11 -1
  199. package/skills/cosmic-build/skills/cosmic-meta-modeling/scripts/isv_resolver.py +1 -3
  200. package/skills/cosmic-build/skills/cosmic-meta-modeling/scripts/report_validator.py +29 -0
  201. package/skills/cosmic-build/skills/cosmic-meta-modifier/SKILL.md +4 -2
  202. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/context/SKILL.md +2 -2
  203. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/execute/SKILL.md +1 -1
  204. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/operation/SKILL.md +5 -4
  205. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/operation/operation-write.md +6 -2
  206. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/operation/validation.md +2 -0
  207. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/property/SKILL.md +20 -5
  208. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/property/complex-apis.md +1 -1
  209. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/property/policy-grammar.md +4 -1
  210. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/report-op/SKILL.md +9 -0
  211. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/rule/SKILL.md +61 -4
  212. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/rule/raw-rule-authoring.md +3 -1
  213. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/rule/rule-actions.md +2 -2
  214. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/rule/rule-reference.md +6 -6
  215. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/rule/state.md +1 -1
  216. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/unit/SKILL.md +6 -3
  217. package/skills/cosmic-build/skills/cosmic-meta-modifier/modules/verify/usage-guide.md +4 -4
  218. package/skills/cosmic-build/skills/cosmic-meta-modifier/references/list-filter-modification.md +4 -1
  219. package/skills/cosmic-build/skills/cosmic-meta-ui/SKILL.md +9 -1
  220. package/skills/cosmic-build/skills/cosmic-meta-ui/modules/button/SKILL.md +3 -0
  221. package/skills/cosmic-build/skills/mcp-server/SKILL.md +210 -0
  222. package/skills/cosmic-build/skills/mcp-server/scripts/mcp_cli.py +431 -0
  223. package/skills/cosmic-build/skills/openapi-gen/SKILL.md +3 -3
  224. package/skills/cosmic-build/skills/openapi-gen/scripts/api/gen_runner.py +2 -2
  225. package/skills/cosmic-dev-best-practices/references/bill-dev-convention.md +19 -9
  226. package/skills/cosmic-dev-best-practices/references/cosmic-meta-api.md +14 -11
  227. package/skills/cosmic-dev-best-practices/references/design-examples/basedata-design-example.md +1 -1
  228. package/skills/cosmic-dev-best-practices/references/design-examples/bill-design-example.md +1 -1
  229. package/skills/cosmic-dev-best-practices/references/elements/AssistantField.md +1 -1
  230. package/skills/cosmic-dev-best-practices/references/elements/BasedataField.md +2 -2
  231. package/skills/cosmic-dev-best-practices/references/elements/BasedataPropField.md +3 -3
  232. package/skills/cosmic-dev-best-practices/references/elements/CreaterField.md +2 -2
  233. package/skills/cosmic-dev-best-practices/references/elements/CurrencyField.md +2 -2
  234. package/skills/cosmic-dev-best-practices/references/elements/CustomerField.md +2 -2
  235. package/skills/cosmic-dev-best-practices/references/elements/FlexField.md +1 -1
  236. package/skills/cosmic-dev-best-practices/references/elements/MaterielField.md +2 -2
  237. package/skills/cosmic-dev-best-practices/references/elements/OrgField.md +2 -2
  238. package/skills/cosmic-dev-best-practices/references/elements/SupplierField.md +2 -2
  239. package/skills/cosmic-dev-best-practices/references/elements/UnitField.md +1 -1
  240. package/skills/cosmic-dev-best-practices/references/elements/UserField.md +3 -3
  241. package/skills/cosmic-dev-best-practices/references/elements/common-field-property-conventions.md +16 -11
  242. package/skills/cosmic-dev-best-practices/references/layout-control-convention.md +5 -4
  243. package/skills/erp-analysis/references/delivery-contract.md +4 -2
  244. package/skills/erp-analysis/templates/AGENTS.template.md +1 -1
  245. package/skills/cosmic-build/skills/cosmic-meta-api/scripts/.dsh/cosmic/.kd/config.json +0 -21
@@ -1,7 +1,6 @@
1
+ > 📝 **[G15-script]**: 当向用户转述脚本输出时,按系统 `<language-policy>` 的 `response_language` 改写;脚本语言不一致时不要原样复制日志。
1
2
 
2
- > 📝 **[G15-script]**: When relaying script output to the user, rephrase it in the `response_language` declared in the system prompt's `<language-policy>`. Do not copy-paste logs verbatim when their language differs from that language.
3
-
4
- # 苍穹 Open API 调用技能
3
+ # 苍穹 Open API 调用参考
5
4
 
6
5
 
7
6
  ## 技能说明
@@ -24,31 +23,26 @@ AI 在需要生成苍穹 API 调用代码或解答相关问题时,应优先读
24
23
  | 导出/下载元数据(dym 文件同步到本地) | `modules/export/SKILL.md` |
25
24
  | 生成 PDM / PDM 同步 / 同步数据模型 / 生成建表脚本 | `modules/pdm/SKILL.md` |
26
25
 
27
- ### Workspace / 应用上下文(与建模一致)
28
-
29
- 源码 DYM/DYMX 只在 app-build 会话收口时同步,不在每条写命令后同步。
30
- `render_output_cards.py` 汇总本轮表单编码,只对本地已经存在 `.dym` 的表单执行一次批量
31
- `syncDym --existing-only`;没有现存 DYM 的表单直接跳过,不创建新文件。报表命令若需要 DYM
32
- 完成即时验证,只导出到 `_runtime/`,不会更新源码元数据。
26
+ ### 应用上下文与交付
33
27
 
34
- - **应用编码(真实场景唯一起源)**:**仅**当前已绑定应用 **`{appRoot}/archive.json` 中的 `appCode`。**`workspace.json` 的 `appNumber` 须与此一致,由 `bootstrapWorkspace` 从 `archive.json` 同步,**不是**让 AI 在对话中自行推断或从别处「猜」一个编码。
35
- - **入口应用必须已存在**:根入口已经在当前苍穹平台验证 `appCode`。`bootstrapWorkspace` 只能复核并同步该应用;查询不到时以 `EXISTING_APP_NOT_FOUND` 中止,也不会调用通用 `createApp`。源应用验证后,已注册的 `extendApp` 操作可以创建扩展应用。
36
- - **身份交接**:表单扩展采用不同的已有或新建扩展应用时,必须先验证并把应用编码、ID、名称同步到当前 archive/context,再执行下游写入。
37
- - **业务云**:`bizCloudId` / `bizCloudName` 必须来自 `{appRoot}/archive.json`(由主入口应用归属判断写入);`bootstrapWorkspace` 从 archive 读取,缺失则阻断。**禁止**用多轮聊天开放式收集云名/应用作为真源。
38
- - **ISV / standard**:由 `getDevInfo` API 动态获取并写入 `workspace.json`,不硬编码。
39
- - **自举主命令**:`{python} scripts/cosmic_api.py bootstrapWorkspace --app-root "<appRoot>"`。凭据就绪后,它只校验并同步已经绑定的应用身份,不创建流程工作项。
28
+ 命令负责线上目标绑定、鉴权及运行时上下文;本地 archive 是已验证绑定的记录,
29
+ 不是线上对象是否存在的证明。绑定缺失或归属冲突时按
30
+ [应用上下文](../../references/application-context.md)处理,不另建初始化流程。
40
31
 
32
+ 本轮表单汇总、卡片输出及 DYM/DYMX 同步统一遵循
33
+ [交付契约](../../references/delivery.md)。源码同步创建缺失文件并更新已有文件;
34
+ 即时验证导出的运行时副本不等于源码同步。
41
35
 
42
36
  ---
43
37
 
44
- > **路径推算**:SKILL_DIR = 本文件所在目录(`cosmic-meta-api/`)。CONFIG = `SKILL_DIR/../config.json`(= `skills/config.json`)。Python 脚本统一使用 `{python}`(遵循 `[G9.1]`)。
38
+ > **路径推算**:SKILL_DIR 是当前 `cosmic-meta-api/` 目录。使用根入口提供的 `{python}`;配置及运行时路径由 CLI 解析。
45
39
 
46
40
  ## 共用资源
47
41
 
48
42
 
49
43
  | 资源 | 路径 | 说明 |
50
44
  | -------- | -------------------------------------------------------------------------- | -------------------------------------- |
51
- | API 凭据配置 | `../config.json`(即 `skills/config.json`) | 唯一真源,`server.`* 节 |
45
+ | 环境配置 | `~/.kd/config.json`,由 `kd_env_loader.py` 解析 | 初始化与恢复使用 init/reset 入口 |
52
46
  | 核心脚本 | `scripts/cosmic_api.py` | 所有子命令入口 |
53
47
  | 路径推算 | SKILL_DIR 相对方式(无需 skill_env.json) | |
54
48
  | 运行时状态 | `RUNTIME_DIR`(= `{PROJECT_ROOT}/app/_runtime/cosmic-metadata/`,定义见本文件目录结构) | context.md / biz_cache.json / token |
@@ -1,7 +1,7 @@
1
1
  # AI 建模中心 API
2
2
 
3
3
  > 基础路径:`{BASE_URL}{api_base_path}`
4
- > `api_base_path` 从 `scripts/config.json` 的 `api_base_path` 字段读取(如 `/ierp/kapi/v2/uhyl/uhyl_aireqdecomp/ai-meta`)
4
+ > `api_base_path` 为脚本内部注册的固定接口前缀(如 `/ierp/kapi/v2/uhyl/uhyl_aireqdecomp/ai-meta`),不读取技能目录内的 config.json
5
5
  > 鉴权方式:请求头 `accessToken: <access_token>`,详见 `../auth.md`
6
6
 
7
7
  ---
@@ -1,7 +1,7 @@
1
1
  # 应用菜单管理 API
2
2
 
3
3
  > 基础路径:`{BASE_URL}{api_base_path}/app/menu`
4
- > `api_base_path` 从 `scripts/config.json` 的 `api_base_path` 字段读取(如 `/ierp/kapi/v2/uhyl/uhyl_aireqdecomp/ai-meta`)
4
+ > `api_base_path` 为脚本内部注册的固定接口前缀(如 `/ierp/kapi/v2/uhyl/uhyl_aireqdecomp/ai-meta`),不读取技能目录内的 config.json
5
5
  > 鉴权方式:请求头 `accessToken: <access_token>`,详见 `../auth.md`
6
6
 
7
7
  ---
@@ -1,7 +1,7 @@
1
1
  # 元数据历史记录 API
2
2
 
3
3
  > 基础路径:`{BASE_URL}{api_base_path}/metalog`
4
- > `api_base_path` 读取 `scripts/config.json` 的 `api_base_path` 字段(例如 `/ierp/kapi/v2/devportal/ai-meta`)
4
+ > `api_base_path` 为脚本内部注册的固定接口前缀(例如 `/ierp/kapi/v2/devportal/ai-meta`),不读取技能目录内的 config.json
5
5
  > 鉴权方式:请求头 `accessToken: <access_token>`,详见 `../auth.md`
6
6
  > 后端 Controller:`kd.bos.designer.meta.metalog.MetaLogApiController`
7
7
 
@@ -2,7 +2,48 @@
2
2
  "schemaVersion": "app-build-control-authoring/v1",
3
3
  "command": "addControls",
4
4
  "scope": "one exact existing PC form",
5
- "semantics": "one compact request creates one or many independently verified controls under an exact existing container, or atomically creates one titled general-control panel and places the complete batch inside it; the CLI resolves aliases, parents and generated keys before writing",
5
+ "semantics": "one compact request creates one or many independently verified controls under an exact existing container, or atomically creates one titled general-control panel and places the complete batch inside it; omitted placement uses the live form root. The CLI resolves aliases, parents and generated keys before writing. Retries match exact keys, not control types",
6
+ "inputSchema": {
7
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
8
+ "title": "General control batch input",
9
+ "type": "object",
10
+ "required": ["controls"],
11
+ "properties": {
12
+ "parent": {"type": "string", "minLength": 1, "description": "Exact existing container key or unique caption; omitted means the live form root. Not combined with panel."},
13
+ "panel": {"$ref": "#/$defs/panel"},
14
+ "controls": {"type": "array", "minItems": 1, "maxItems": 50, "items": {"$ref": "#/$defs/control"}}
15
+ },
16
+ "not": {"required": ["parent", "panel"]},
17
+ "additionalProperties": false,
18
+ "$defs": {
19
+ "key": {"type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_]{0,35}$"},
20
+ "panel": {
21
+ "type": "object",
22
+ "required": ["name"],
23
+ "properties": {
24
+ "key": {"$ref": "#/$defs/key", "description": "Stable panel identity; generated from name when omitted."},
25
+ "name": {"type": "string", "minLength": 1},
26
+ "parent": {"type": "string", "minLength": 1, "description": "Existing container selector; omitted means the live form root."},
27
+ "presentation": {"type": "string", "enum": ["auto", "stack"], "default": "auto"}
28
+ },
29
+ "additionalProperties": false
30
+ },
31
+ "control": {
32
+ "type": "object",
33
+ "required": ["type", "name"],
34
+ "properties": {
35
+ "key": {"$ref": "#/$defs/key", "description": "Stable control identity; generated from resolved type and name when omitted. Repeating the same key verifies the existing control; another control of the same type does not satisfy this request."},
36
+ "type": {"type": "string", "minLength": 1, "description": "Released type or case-insensitive alias from x-controlTypes."},
37
+ "name": {"type": "string", "minLength": 1, "description": "Control display name."},
38
+ "parent": {"type": "string", "minLength": 1, "description": "Overrides the batch parent. Omit for a declared panel. Without either parent, use the live form root."},
39
+ "index": {"type": "integer", "minimum": 0},
40
+ "properties": {"type": "object", "description": "Only x-commonProperties and the selected type's x-controlTypes properties are accepted, with their declared value types."}
41
+ },
42
+ "additionalProperties": false
43
+ }
44
+ },
45
+ "examples": [{"controls": [{"type": "LabelAp", "name": "Notice"}]}]
46
+ },
6
47
  "commonProperties": {
7
48
  "visible": {"type": "string", "readProperty": "Visible"},
8
49
  "lock": {"type": "string", "readProperty": "Lock"},
@@ -19,6 +60,7 @@
19
60
  "VectorAp": {"aliases": ["图标", "icon", "vector"], "properties": {"fontClass": {"type": "string", "readProperty": "FontClass"}, "clickable": {"type": "boolean", "readProperty": "Clickable"}}},
20
61
  "ImageListAp": {"aliases": ["图片列表", "image list"], "properties": {"displayTitle": {"type": "boolean", "readProperty": "DisplayTitle"}, "multiImg": {"type": "boolean", "readProperty": "MultiImg"}, "uploadImg": {"type": "boolean", "readProperty": "UploadImg"}, "maxImgSize": {"type": "integer", "minimum": 0, "readProperty": "MaxImgSize"}, "imgSource": {"type": "integer", "minimum": 0, "readProperty": "ImgSource"}, "showName": {"type": "boolean", "readProperty": "ShowName"}, "colNum": {"type": "integer", "minimum": 1, "readProperty": "ColNum"}}},
21
62
  "CodeEditAp": {"aliases": ["代码编辑器", "code editor"], "properties": {"fileType": {"type": "string", "readProperty": "FileType"}, "codeEditTheme": {"type": "string", "readProperty": "CodeEditTheme"}, "showLineNumber": {"type": "boolean", "readProperty": "ShowLineNumber"}}},
63
+ "FilterGridAp": {"aliases": ["通用过滤", "common filter", "common filter grid"], "properties": {}},
22
64
  "TreeViewAp": {"aliases": ["树控件", "tree"], "properties": {"rootVisible": {"type": "boolean", "readProperty": "RootVisible"}, "multiCheck": {"type": "boolean", "readProperty": "Multi"}, "dragEnable": {"type": "boolean", "readProperty": "DragEnable"}}},
23
65
  "AttachmentPanelAp": {"aliases": ["附件面板", "attachment panel"], "properties": {"collapsible": {"type": "boolean", "readProperty": "Collapsible"}, "defaultCollapse": {"type": "boolean", "readProperty": "DefaultCollapse"}, "showTitle": {"type": "boolean", "readProperty": "ShowTitle"}, "showAttachmentTips": {"type": "boolean", "readProperty": "ShowAttachmentTips"}, "expandMore": {"type": "boolean", "readProperty": "ExpandMore"}, "uploadProgressBar": {"type": "boolean", "readProperty": "UploadProgressBar"}}},
24
66
  "QRCodeAp": {"aliases": ["二维码", "qr code"], "properties": {"qrCodeShowStyle": {"type": "integer", "minimum": 0, "readProperty": "QrCodeShowStyle"}, "showBarCodeValue": {"type": "boolean", "readProperty": "ShowBarCodeValue"}}},
@@ -44,8 +86,7 @@
44
86
  "TabAp": {"alias": "页签控件", "route": "applyFormTabs/applyFormUi"},
45
87
  "FieldsetPanelAp": {"alias": "字段布局面板", "route": "addFieldPanel/applyFormUi"},
46
88
  "SplitContainerAp": {"alias": "分割容器", "route": "applyFormSplit"},
47
- "AdvConAp": {"alias": "高级容器", "route": "addAdvancedContainer"},
48
- "FilterGridAp": {"alias": "通用过滤", "route": "configureList"}
89
+ "AdvConAp": {"alias": "高级容器", "route": "addAdvancedContainer"}
49
90
  },
50
91
  "panel": {
51
92
  "type": "FlexPanelAp",
@@ -82,7 +123,7 @@
82
123
  ]
83
124
  },
84
125
  "deferredTypes": {
85
- "AdvFilterGridAp": {"alias": "高级过滤", "reason": "platform feature remains unreleased"},
126
+ "AdvFilterGridAp": {"alias": "高级过滤", "reason": "designer can place the shell, but advanced-filter behavior and wiring are not verified for CLI authoring"},
86
127
  "CustomControlAp": {"alias": "自定义控件", "reason": "requires an exact t_meta_ctlschema schemaId"},
87
128
  "ClientAjaxAp": {"alias": "客户端AJAX", "reason": "design metadata persists but the current runtime creates no control node without a request/response contract"},
88
129
  "WebOfficeAp": {"alias": "WebOffice", "reason": "design metadata persists but runtime requires a document/session binding contract"},
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": "app-build-form-control-traits/v1",
3
- "evidenceSource": "tests/metadata-xml-corpus/contracts/element-superclasses.json",
3
+ "evidenceSource": "platform metadata class hierarchy captured during contract harvest",
4
4
  "purpose": "Language-neutral policy for existing PC-form subtree moves and role classification. Runtime code consumes this contract; the model does not read or reproduce it.",
5
5
  "types": {
6
6
  "FieldAp": {
@@ -130,6 +130,24 @@
130
130
  ]
131
131
  }
132
132
  },
133
+ "configureDropdownMenu": {
134
+ "effect": "write",
135
+ "semantics": "stage append, update, remove and order/moves on one existing button menu, retaining unmentioned items and original IDs, then save once; the command reads the menu and resolves exact keys or unique titles/operation keys",
136
+ "requiredByAppBuild": ["appRoot OR projectRoot", "formNumber OR form-name", "input"],
137
+ "parentResolution": "elementKey/element is optional when existing item selectors identify one menu in the primary form. Otherwise the command returns button candidates without writing.",
138
+ "itemFields": ["key", "title", "subtitle", "operation", "background", "icon", "switch", "theme", "merge", "lock", "visible", "uploadable", "uploadConfig"],
139
+ "locale": "When a title has several languages and no language is selected, the receipt returns language keys and --locale; retry the same intent with the chosen key. Ownership and other translations remain unchanged.",
140
+ "safety": {
141
+ "preflight": "reads current menu; checks executable operation type or attached implementation only for new or changed operation bindings. Display-only edits preserve the original binding without revalidating its business implementation; missing or ambiguous targets return menu candidates without writing",
142
+ "identity": "existing keys and IDs are retained; append never silently overwrites an existing key; clear and replace are not semantic edit actions",
143
+ "references": "binding an operation does not implement its business behavior; never create a no-op placeholder to satisfy a missing operation",
144
+ "failure": "no clear/rebuild/rename fallback; failed verification is not successful delivery",
145
+ "preservation": "Python copies the native menu objects from loadFullMetadata, retaining Id, IsvFlag, multilingual text and unmentioned properties; it changes only the selected menu path and uses existing saveFullMetadata. A fresh baseline check precedes saving, followed by a full-document comparison and a retained recovery snapshot. No new backend endpoint is required.",
146
+ "order": "selected items come first; unmentioned items follow in their original relative order",
147
+ "verification": "full-snapshot read-back checks menu order, IDs, ownership and values plus unrelated metadata; only top-level modifyDate and modifierId are excluded as server audit fields; no-op edits do not save",
148
+ "icons": "use an existing ImageKey from the platform picture selector; semantic icon names are not verified resource keys"
149
+ }
150
+ },
133
151
  "addFieldPanel": {
134
152
  "effect": "write",
135
153
  "semantics": "Create or reuse one titled FieldsetPanelAp for grouping fields, directly inside the exact existing TabPageAp selected by --page when supplied, otherwise under the inferred content root. Page resolution is type-scoped and fails before writing on missing or ambiguous targets. This command does not create fields. Add fields with addField --panel using the returned panelVerification.panelKey.",
@@ -24,7 +24,13 @@
24
24
  "linkWithoutUrl": "menuType=link without linkUrl",
25
25
  "formUuid": "form UUID passed where server expects formNumber"
26
26
  },
27
- "readBack": ["getMenu for each record", "one final queryMenuTree for the complete requested path"]
27
+ "readBack": ["getMenu for each record", "one final queryMenuTree for the complete requested path"],
28
+ "afterVerifiedMenuTree": {
29
+ "command": "publishApp",
30
+ "arguments": ["--bizAppId", "<archive.appId>", "--action", "enable"],
31
+ "precondition": "仅明确要求发布菜单;先用 getApp 核对同一应用身份",
32
+ "alreadyEnabled": "平台明确回复应用已启用时视为无变化,不重试"
33
+ }
28
34
  },
29
35
  "publishApp": {
30
36
  "effect": "platform-application-state-write",
@@ -42,7 +48,7 @@
42
48
  }
43
49
  },
44
50
  "verificationMapping": {
45
- "design": "getMenu contains the exact record identity and one final queryMenuTree contains every requested parent/category/page path",
51
+ "design": "getMenu 验证准确菜单记录;最终 queryMenuTree 验证全部目标路径;明确发布菜单后用 getApp/publishApp 核实同一应用的启用状态",
46
52
  "runtime": "not part of default delivery; only run separate acceptance when explicitly requested by the user",
47
53
  "rollback": "verify deletion through the command's design-state read-back; external runtime acceptance is user-initiated"
48
54
  }
@@ -78,6 +78,13 @@
78
78
  "idempotency": "请求与线上值已一致时返回 status true、changed=false 且 writeAttempted=false,两条路都是",
79
79
  "readBack": "getProperties.InstantSync 从 JSON 字符串解码后,canUpdate 为 false 的列集合必须等于请求,且解码出来的每个行事件状态也必须等于请求;清空必须读回 null。写入后不一致按 unknown_after_write 报出"
80
80
  },
81
+ "renameElementKey": {
82
+ "effect": "write",
83
+ "scope": "one exact existing form element",
84
+ "arguments": ["app_root OR project_root with app identity", "formNumber OR form_name", "element as current exact key or unique caption", "new_key"],
85
+ "semantics": "applies the developer namespace once, renames through the live single-target Key setter, migrates matching form/biz-rule preCondition and triggerField strings, and verifies the element name/type/parent/index plus absence of stale rule references",
86
+ "failureBoundary": "rule inventory is required before mutation; a failed rule migration triggers a key rollback and reports whether metadata remains changed"
87
+ },
81
88
  "setProperties": {
82
89
  "legacyFailureReceipt": {
83
90
  "results": "retains each raw result, including the failed item and unknown write state",
@@ -40407,11 +40407,11 @@
40407
40407
  "valueDomains": null,
40408
40408
  "appliesTo": null,
40409
40409
  "writeRoute": {
40410
- "command": "setComplexProperty",
40410
+ "command": "configureDropdownMenu",
40411
40411
  "complexType": "dropdownItems",
40412
- "dataKind": "array",
40412
+ "dataKind": "editIntent",
40413
40413
  "requiresElementKey": true,
40414
- "backendMethod": "setDropdownItems"
40414
+ "backendMethod": "loadFullMetadata + saveFullMetadata"
40415
40415
  }
40416
40416
  }
40417
40417
  },
@@ -23,6 +23,7 @@
23
23
  "setReportFilters": {
24
24
  "payloadSchemaRef": "skills/cosmic-meta-api/contracts/schema/report-write.schema.json#/$defs/filters",
25
25
  "writeSemantics": "full replacement; the supplied array is the desired complete filter state",
26
+ "controlTypeBoundary": "Optional source={formNumber,fieldKey} selects ReportFilters.typed. The platform resolves the native field and creates its editor type with reference/enum options; date between uses DateRangeField. getReportSchema reads actual configuration, independently compared to fresh source fieldSchemas. Source conditions requiring unresolved organization or conditional references fail before mutation. Older platforms reject the typed route; never retry through the legacy text route.",
26
27
  "readBack": "getReportSchema.reportFilters matches the requested filter controls and panel state",
27
28
  "preWriteGuard": "REPORT_FILTER_KEY_COLLIDES_WITH_COLUMN: a fieldPath repeating a report column or group fieldKey is refused before the platform call, because control and column would share one element key and only the designer would reject the duplicated identifier. Use a distinct key such as flt_<column> and apply it to the column inside the data-fetch plugin."
28
29
  },
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "schemaVersion": "app-build-rule-domain/v1",
3
3
  "contract": "rule-domain",
4
+ "actionTiming": "每个带 RET 的规则服务动作都可用 events 指定新规则的完整触发时机,或用 addEvents 追加时机而不清除原值。原子服务命令重复传 --event / --add-event,ensureRuleSet 的各项透传相同参数。已有规则要替换整组时机需用准确 ruleId 调用 updateRule。ensureFieldCalculation 和 ensureConditionalEntryStyle 不是 RET 服务动作。",
4
5
  "targetBinding": {
5
6
  "form": "每条已发布 ensure* 规则命令只接受 formNumber 或 form-name 之一。使用 form-name 时,同一调用通过 prepareFormMutationTarget 解析并验证可编辑表单;准确编码加 app-root 的旧路径继续作为兼容快路径。",
6
7
  "entity": "entity 为可选参数;表头、明细、分录、单据体等业务别名由 CLI 内部解析。一张苍穹单据包含一个主元数据实体,也可能包含多个 EntryEntity。实体业务规则绑定一个所属实体;界面/控件规则通过表单控件树绑定。需要实体求值的命令优先准确 key,并推导唯一共享 EntityKey。",
@@ -13,6 +14,7 @@
13
14
  },
14
15
  "sceneBoundary": {
15
16
  "sameEntityBinaryNumericCalculation": "ensureFieldCalculation",
17
+ "sameEntityTimeDifferenceHours": "ensureTimeDifferenceCalculation",
16
18
  "entryNumericSummaryToHeader": "setSummaryToField",
17
19
  "conditionalRequired": "setMustInputCondition plus ensureMustInputValidation when the operation must block",
18
20
  "operationBlockingMessage": "ensureOperationValidation",
@@ -23,6 +25,7 @@
23
25
  "advancedEntityActions": "addRule with ruleType=bizRule only for a released action family",
24
26
  "advancedClientReportListActions": "addRule with ruleType=formRule, an exact ClientRules-owning mount, and the action-specific ClientProperty/DisplayStyle/RowStyle caller shape",
25
27
  "conditionalClearSameEntityFields": "ensureConditionalClearFields",
28
+ "conditionalFieldValueUpdateService": "ensureConditionalFieldChange",
26
29
  "conditionalCopySameEntityFieldValue": "ensureConditionalCopyFieldValue",
27
30
  "conditionalCarryDeclaredReferenceProperty": "ensureConditionalCarryReferenceProperty",
28
31
  "conditionalSameEntityBinaryCalculation": "ensureConditionalCalculation",
@@ -44,11 +47,15 @@
44
47
  "semantics": "validate one 1..20 item whitelist batch, then invoke only released rule-domain ensure writers in order; each writer keeps its own deterministic identity and read-back, and a failure returns completed results plus a continuation without crossing domains",
45
48
  "arguments": ["formNumber OR form-name", "input {rules:[{id,command,args}]}"],
46
49
  "allowedCommands": [
50
+ "ensureRuleFunctionFormula",
47
51
  "ensureFieldCalculation",
52
+ "ensureTimeDifferenceCalculation",
48
53
  "ensureConditionalFieldState",
49
54
  "ensureConditionalEntryStyle",
55
+ "ensureConditionalClientAppearance",
50
56
  "ensureConditionalControlState",
51
57
  "ensureConditionalClearFields",
58
+ "ensureConditionalFieldChange",
52
59
  "ensureConditionalCopyFieldValue",
53
60
  "ensureConditionalCalculation",
54
61
  "ensureConditionalCarryReferenceProperty",
@@ -71,10 +78,23 @@
71
78
  "duplicate actions for the same source and target fail closed"
72
79
  ]
73
80
  },
81
+ "ensureTimeDifferenceCalculation": {
82
+ "effect": "write",
83
+ "semantics": "解析同一实体中的一个数值目标字段和两个 TimeField,编译 target = (end - start) / 3600.0 的 FormulaAction,启用两个来源字段的更新事件;任一时间为空时清空目标,并独立回读完整规则",
84
+ "arguments": ["formNumber 或 form-name", "可选 entity", "target", "start", "end"],
85
+ "resultUnit": "十进制小时",
86
+ "timeStorage": "TimeField 以整数秒存储;必须使用 3600.0 才能保留小数小时,避免整数除法截断",
87
+ "overnightBoundary": "公式计算带符号的同日时间差;结束时间早于开始时间时不会自行推断为次日,需先取得明确业务决定",
88
+ "failClosed": [
89
+ "start 和 end 必须是所选实体内两个不同的 TimeField",
90
+ "target 必须是同一实体内另一个数值字段",
91
+ "同一目标已有不同 FormulaAction 或 ExecuteActions 计算时在写入前停止"
92
+ ]
93
+ },
74
94
  "ensureRuleFunctionFormula": {
75
95
  "effect": "write",
76
96
  "semantics": "解析同一实体中的目标字段和类型化 FX 调用树,从当前全局 listRuleFunctions 目录获取实际公式函数名与签名,编译一个 RET 253 的 FormulaAction;普通调用按字段类型保护(数值:field <> null;文本:field <> null and field <> '')并带清空目标的 false 分支,空值处理函数与 MultiSelectBaseData 谓词仍可在空输入时执行;启用来源字段变化触发器并独立回读完整规则",
77
- "arguments": ["formNumber OR form-name", "可选 entity", "target", "input {call:{functionId,args:[{field}|{literal}|{call}|{condition}]}}"],
97
+ "arguments": ["formNumber OR form-name", "可选 entity", "target", "input {call:{functionId,args:[{field}|{literal}|{call}|{condition}]}}", "可选重复 event/events 或 add-event/addEvents"],
78
98
  "releasedGroups": ["Math", "String", "DateTime", "Set", "JudgeNull", "NullJudge", "MultiSelectBaseData", "Bill", "Common"],
79
99
  "setFunctionBoundary": "if 使用类型化 condition 节点;sum/min/max/count/avg 仅接受同实体标量字段、嵌套调用和字面量。原始 addRule 的聚合函数仍被阻断,分录汇总到表头仍使用 setSummaryToField。",
80
100
  "multiSelectBaseDataBoundary": "MulBasedataIsNull/MulBasedataNotNull 接受一个 MulBasedataField。MulBasedataInclude/MulBasedataNotInclude 还要求非空记录编码字面量,多个编码用英文逗号分隔;编译器输出该字段的 .number 属性,调用方不得手写点路径。四个函数在空选择时返回自身布尔结果,不使用普通空值保护。",
@@ -99,7 +119,7 @@
99
119
  "effect": "write",
100
120
  "existingCondition": "a related generated rule with the same trigger and inverse actions blocks appending a conflicting condition; return RULE_CONDITION_UPDATE_REQUIRES_RULE_ID with candidates and a unique suggestedUpdate, never automatically replace it",
101
121
  "semantics": "解析一个条件作用域、触发字段、一个或多个同实体目标字段和业务比较;布尔常量不加字符串引号;下拉显示名、物理值和 @first 第一项哨兵均在命令内解析;创建一条动作包含完整目标集合和正确反向动作的确定性 formRule;主描述使用可读业务语义并保留末尾短标识;独立回读两个分支,重复执行不写入",
102
- "arguments": ["formNumber OR form-name", "optional entity", "condition-field", "operator", "value", "one or more repeated target", "behavior"],
122
+ "arguments": ["formNumber OR form-name", "optional entity", "condition-field", "operator", "value", "one or more repeated target", "behavior", "optional exact repeated event / events array OR appended add-event / addEvents array"],
103
123
  "behaviors": ["show", "hide", "lock", "unlock"],
104
124
  "operators": ["equals", "not-equals", "greater-than", "greater-or-equal", "less-than", "less-or-equal", "empty", "not-empty"],
105
125
  "conditionScope": "挂载点跟随目标字段所在实体;条件字段可以在该实体上,也可以在单据头上——分录上的界面规则在行上下文里能读到单头值。empty 与 not-empty 不传 value。",
@@ -129,7 +149,7 @@
129
149
  "ensureConditionalClientAppearance": {
130
150
  "effect": "write",
131
151
  "semantics": "resolve one ClientRules-owning list grid/card row and one business condition, compile row style, field style and client field properties into one deterministic client rule, and independently read back the nested actions",
132
- "arguments": ["formNumber OR form-name", "input {clientMount, optional entity, conditionField, operator, value, effects[]}"],
152
+ "arguments": ["formNumber OR form-name", "input {clientMount, optional entity, conditionField, operator, value, effects[], optional events OR addEvents}"],
133
153
  "effectKinds": ["rowStyle", "fieldStyle", "fieldProperty"],
134
154
  "scopeRules": {"ListGridViewAp": ["rowStyle", "fieldStyle"], "CardEntryRowAp/CardRowPanelAp": ["fieldStyle", "fieldProperty"]},
135
155
  "failClosed": [
@@ -155,8 +175,8 @@
155
175
  },
156
176
  "ensureConditionalClearFields": {
157
177
  "effect": "write",
158
- "semantics": "解析一个实体、条件和一个或多个目标字段,包括下拉显示名、物理值和 @first;编译平台冒号分隔字段表达式与 RET 253 的单个 ClearValueAction,启用触发事件、去重并独立回读动作",
159
- "arguments": ["formNumber OR form-name", "optional entity", "condition-field", "operator", "value", "one or more target"],
178
+ "semantics": "解析实体、条件与目标字段,编译单个 ClearValueAction。通用 events 指定新规则的准确时机,addEvents 在默认或已有 RET 上追加;更新后回读确认动作 ID 和完整规则均保留。重复执行已满足时零写入。",
179
+ "arguments": ["formNumber OR form-name", "optional entity", "condition-field", "operator", "value", "one or more target", "optional repeated event / events array OR add-event / addEvents array"],
160
180
  "failClosed": [
161
181
  "every target must resolve to a field owned by the selected entity",
162
182
  "duplicate targets are collapsed deterministically",
@@ -164,8 +184,19 @@
164
184
  "the caller never supplies Expression, RET, Seq, itemId or mountPoint"
165
185
  ]
166
186
  },
187
+ "ensureConditionalFieldChange": {
188
+ "effect": "write",
189
+ "semantics": "按字段名称或 key 解析条件和目标,编译平台支持的非空条件,创建一条 CallFieldChangeAction。新建时 events 只选择用户指定时机;addEvents 追加到默认时机或准确匹配的已有规则。回读规则身份、条件、目标和时机;设计态成功不代表运行态已分发后续规则。",
190
+ "arguments": ["formNumber OR form-name", "optional entity", "condition-field", "operator", "optional value", "target", "optional exact repeated event / events array OR appended add-event / addEvents array"],
191
+ "failClosed": [
192
+ "字段不存在或歧义时写前失败",
193
+ "不新增第二条语义相同的规则",
194
+ "运行态分发仍需目标环境验证"
195
+ ]
196
+ },
167
197
  "ensureConditionalCopyFieldValue": {
168
198
  "effect": "write",
199
+ "multiMapping": "多组字段带出用 --input {mappings:[{source,target,可选 onlyEmptyTarget}],可选 conditionField/operator/value/ruleId/branch},或 ensureRuleSet 的 args.mappings;一条 SetEqutionAction 包含全部映射。省略 branch 表示条件成立时执行;branch=false 只在条件不成立时执行;不成立时不执行服务就省略 branch。合并已有拆分规则必须传准确 ruleId。",
169
200
  "semantics": "resolve one entity, condition, source and distinct target; compile SetEqutionAction Expression/FieldName as one TakeValueId mapping pair with optional only-empty behavior, validate entity scope, deduplicate semantically and independently read back the nested mapping",
170
201
  "arguments": ["formNumber OR form-name", "optional entity", "condition-field", "operator", "value", "source", "target", "optional only-empty-target"],
171
202
  "failClosed": [
@@ -177,6 +208,7 @@
177
208
  },
178
209
  "ensureConditionalCarryReferenceProperty": {
179
210
  "effect": "write",
211
+ "multiMapping": "多组基础资料属性带出用 --input {mappings:[{sourceReference,sourceProperty,target,可选 onlyEmptyTarget}],可选 conditionField/operator/value/ruleId/branch},或 ensureRuleSet 的 args.mappings;一条 TakeBaseProAction 包含全部映射。省略 branch 表示条件成立时执行;branch=false 只在条件不成立时执行;不成立时不执行服务就省略 branch。合并已有拆分规则必须传准确 ruleId。",
180
212
  "semantics": "解析一个实体、已有引用字段、引用实体上的准确属性和不同目标;默认在来源引用不为空时触发,也可传显式业务条件;RefProps 缺少该属性时,通过 BaseEntityId 定位引用表单、验证唯一字段并用 setRefProps 闭环追加;编译带嵌套 TakeValueId、RET 253 和来源触发器的 TakeBaseProAction;规则语义相同时不重写规则",
181
213
  "arguments": ["formNumber OR form-name", "optional entity", "optional condition-field/operator/value", "source-reference", "source-property", "target", "optional only-empty-target"],
182
214
  "failClosed": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": "app-build-rule-event-contract/v1",
3
- "legalEventUnion": 1023,
3
+ "legalEventUnion": 2047,
4
4
  "eventBits": {
5
5
  "1": "FieldChanged",
6
6
  "2": "Initialized",
@@ -11,7 +11,26 @@
11
11
  "64": "SelectRowChanged",
12
12
  "128": "ItemAdding",
13
13
  "256": "AfterAdded",
14
- "512": "AfterFieldChanged"
14
+ "512": "AfterFieldChanged",
15
+ "1024": "AfterCopy"
16
+ },
17
+ "actionMasksMeaning": "Metamodel raiseEventType values retained for registration and reference, not per-action event limits. Explicit RET is validated against the known event bits.",
18
+ "eventAliases": {
19
+ "新建": "ItemAdded",
20
+ "新增": "ItemAdded",
21
+ "值更新": "FieldChanged",
22
+ "字段值变化": "FieldChanged",
23
+ "加载": "Initialized",
24
+ "创建": "ItemAdded",
25
+ "创建后": "AfterAdded",
26
+ "值更新后": "AfterFieldChanged",
27
+ "字段值变化后": "AfterFieldChanged",
28
+ "Create": "ItemAdded",
29
+ "Update": "FieldChanged",
30
+ "FieldChange": "FieldChanged",
31
+ "AfterCreate": "AfterAdded",
32
+ "AfterFieldChange": "AfterFieldChanged",
33
+ "复制后": "AfterCopy"
15
34
  },
16
35
  "actionMasks": {
17
36
  "FormulaAction": 1021,
@@ -47,7 +66,9 @@
47
66
  "ClientSetRowFmtAction": 251
48
67
  },
49
68
  "blockedActions": {
50
- "CallFieldChangeAction": "Current-version isolated runtime testing still proves that the action does not dispatch the target field's downstream business-rule or form-rule chain, even with a bare exact field key and RET=773.",
51
69
  "SetVisibleAction": "历史 Schema 占位名,不是平台动作:8.0 的 FormRuleActionTypes.xml 与 bos-metadata 类清单均不存在 SetVisibleAction。请使用已验证的 ShowFieldAction/HideFieldAction 或 ShowControlAction/HideControlAction 配对。"
70
+ },
71
+ "runtimeWarnings": {
72
+ "CallFieldChangeAction": "设计器支持此动作,元数据回读可验证配置。较早平台版本的隔离运行态测试未观察到后续规则链分发;在目标环境验证前不得声称运行效果已生效。"
52
73
  }
53
74
  }
@@ -3,14 +3,34 @@
3
3
  "commands": {
4
4
  "run": {
5
5
  "effect": "platform-create",
6
- "requiredByAppBuild": ["appRoot", "artifact"],
6
+ "requiredByAppBuild": [
7
+ "appRoot",
8
+ "artifact"
9
+ ],
7
10
  "resolvers": {
8
- "artifact": ["explicit artifact path", "metadata/_emit_manifest.json first artifact"],
9
- "templateNumber": ["explicit template", "artifact.templateNumber", "matching manifest item templateNumber"],
10
- "bizAppId": ["workspace.json bizAppId", "bootstrapWorkspace result"]
11
+ "artifact": [
12
+ "explicit artifact path",
13
+ "metadata/_emit_manifest.json first artifact"
14
+ ],
15
+ "templateNumber": [
16
+ "explicit template",
17
+ "artifact.templateNumber",
18
+ "matching manifest item templateNumber"
19
+ ],
20
+ "bizAppId": [
21
+ "workspace.json bizAppId",
22
+ "bootstrapWorkspace result"
23
+ ]
11
24
  },
12
25
  "positiveExample": {
13
- "arguments": ["--app-root", "<owned-app-root>", "--artifact", "<decorated-artifact-path>", "--template", "bos_billtpl"],
26
+ "arguments": [
27
+ "--app-root",
28
+ "<owned-app-root>",
29
+ "--artifact",
30
+ "<decorated-artifact-path>",
31
+ "--template",
32
+ "bos_billtpl"
33
+ ],
14
34
  "artifactRequirements": {
15
35
  "entities": "non-empty array",
16
36
  "entityKey": "non-empty for non-report entities",
@@ -35,14 +55,38 @@
35
55
  },
36
56
  "runBatch": {
37
57
  "effect": "platform-create-batch",
38
- "requiredByAppBuild": ["appRoot", "appCode", "artifacts"],
58
+ "requiredByAppBuild": [
59
+ "appRoot",
60
+ "appCode",
61
+ "artifacts"
62
+ ],
39
63
  "resolvers": {
40
- "artifacts": ["explicit artifact paths", "metadata/_emit_manifest.json artifacts"],
41
- "templateNumberPerArtifact": ["batch template override", "artifact.templateNumber", "matching manifest item templateNumber"],
42
- "bizAppId": ["workspace.json bizAppId", "bootstrapWorkspace result"]
64
+ "artifacts": [
65
+ "explicit artifact paths",
66
+ "metadata/_emit_manifest.json artifacts"
67
+ ],
68
+ "templateNumberPerArtifact": [
69
+ "batch template override",
70
+ "artifact.templateNumber",
71
+ "matching manifest item templateNumber"
72
+ ],
73
+ "bizAppId": [
74
+ "workspace.json bizAppId",
75
+ "bootstrapWorkspace result"
76
+ ]
43
77
  },
44
78
  "positiveExample": {
45
- "arguments": ["--app-root", "<owned-app-root>", "--app-code", "<exact-existing-app-code>", "--artifacts", "<decorated-artifact-1>", "<decorated-artifact-2>", "--concurrency", "4"],
79
+ "arguments": [
80
+ "--app-root",
81
+ "<owned-app-root>",
82
+ "--app-code",
83
+ "<exact-existing-app-code>",
84
+ "--artifacts",
85
+ "<decorated-artifact-1>",
86
+ "<decorated-artifact-2>",
87
+ "--concurrency",
88
+ "4"
89
+ ],
46
90
  "rules": [
47
91
  "one artifact per independently creatable main object",
48
92
  "concurrency is clamped to 1..8",
@@ -65,12 +109,17 @@
65
109
  "write": "every successful item independently exposes created formId/formNumber",
66
110
  "telemetry": "one batch started/finished pair records artifacts, waves and concurrency",
67
111
  "readBack": "queryForms/getFormSchema 独立验证每个成功项;动态项返回 dynamicUiResult,截图/业务组合返回 formCompositionResult",
68
- "partialSuccess": "保留元数据的后置失败返回 forms,以及 continuation.appRoot/formNumber/formId/command/input 和 rerunBuildMeta=false"
112
+ "partialSuccess": "保留元数据的后置失败返回 forms,以及 continuation.appRoot/formNumber/formId/command/input 和 rerunBuildMeta=false",
113
+ "postBuildFailure": "POST_BUILD_PHASE_FAILED retains the exact saved target even when entityResults.success=true. Reconciliation precedes narrow repair; repairPlans preserve the failed phase, original artifact and available pending write input. notStartedArtifacts contains only explicit writeAttempted=false items. Never recreate a retained or verified form."
69
114
  }
70
115
  }
71
116
  },
72
117
  "verificationMapping": {
73
- "design": ["queryFormsByApp", "getFormSchema", "listElements"],
118
+ "design": [
119
+ "queryFormsByApp",
120
+ "getFormSchema",
121
+ "listElements"
122
+ ],
74
123
  "runtime": "not part of default delivery; only run separate acceptance when the user explicitly requests it and names an available tool",
75
124
  "rollback": "delete only disposable forms created by this campaign, then independently confirm absence"
76
125
  }