soma-core 2.2.4 → 2.2.6

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 (259) hide show
  1. package/README.md +5 -6
  2. package/bin/soma.cjs +2 -2
  3. package/core/build/compiler/flat-page.ts +16 -0
  4. package/core/build/compiler/full-manifest-builder.ts +0 -3
  5. package/core/build/compiler/page-assets.ts +0 -1
  6. package/core/build/compiler/page-closure.ts +245 -0
  7. package/core/build/compiler/page-declaration-compiler.ts +2 -5
  8. package/core/build/compiler/soma-precompile.js +1848 -3244
  9. package/core/build/compiler/soma-precompile.ts +4 -7
  10. package/core/build/component-tree/artifact-codec.ts +4 -8
  11. package/core/build/lsp/soma-declaration.cjs +1 -1
  12. package/core/build/lsp/std-completion.generated.json +3 -3
  13. package/core/client/a11y/a11y-config.ts +2 -1
  14. package/core/client/a11y/dom-id.ts +1 -1
  15. package/core/client/base/SomaHttpClient.ts +11 -3
  16. package/core/client/base/SomaPageRootBase.ts +6 -0
  17. package/core/client/base/defineSomaView.ts +178 -0
  18. package/core/client/base/index.ts +13 -0
  19. package/core/client/base/view-context.ts +328 -0
  20. package/core/client/behavior/adapter-collection.ts +2 -2
  21. package/core/client/compiler/manifest-compiler.ts +5 -36
  22. package/core/client/component/component-definition.types.ts +2 -1
  23. package/core/client/component/component-manager.ts +110 -20
  24. package/core/client/component/structure-adapter.ts +3 -7
  25. package/core/client/container/SomaContainerAdapter.ts +9 -1
  26. package/core/client/data/data-object-resolver.ts +516 -181
  27. package/core/client/data/data-write-actions.ts +79 -15
  28. package/core/client/data/format-config.ts +3 -1
  29. package/core/client/data/region-scope-port.ts +11 -0
  30. package/core/client/engine/asset-resolver.ts +2 -5
  31. package/core/client/engine/dom-renderer.ts +7 -40
  32. package/core/client/engine/event-engine.ts +1 -105
  33. package/core/client/engine/property-watcher.ts +1 -1
  34. package/core/client/engine/reactive-proxy.ts +78 -17
  35. package/core/client/engine/runtime-builder.ts +0 -14
  36. package/core/client/engine/scope-resolver.ts +18 -0
  37. package/core/client/engine/soma-bootstrap.ts +385 -98
  38. package/core/client/engine/style-binder.ts +49 -106
  39. package/core/client/engine/timer-engine.ts +11 -1
  40. package/core/client/host-bridge/load-host-domain-class.ts +2 -1
  41. package/core/client/infra/http/SomaHttpService.ts +15 -4
  42. package/core/client/infra/i18n/pack-locales.ts +2 -2
  43. package/core/client/mount/domain-rule.ts +7 -3
  44. package/core/client/mount/mount-page.ts +38 -5
  45. package/core/client/mount/types.ts +2 -0
  46. package/core/client/parser/confirm-spec.ts +1 -1
  47. package/core/client/parser/data-config-parser.ts +27 -210
  48. package/core/client/parser/pipeline-parser.ts +14 -59
  49. package/core/client/parser/style-config-parser.ts +101 -95
  50. package/core/client/parser/timer-parser.ts +21 -0
  51. package/core/client/parser/ui-config-parser.ts +64 -12
  52. package/core/client/registry/declaration-renderer.ts +1 -1
  53. package/core/client/runtime/SomaRuntimeServices.ts +2 -1
  54. package/core/client/runtime/SomaSnapshotStore.ts +5 -0
  55. package/core/client/security/url-guard.ts +71 -11
  56. package/core/client/validation/async-check-registry.ts +2 -1
  57. package/core/client/validation/contract-validator.ts +2 -6
  58. package/core/client/validation/field-rules.ts +3 -13
  59. package/core/client/validation/object-rules.ts +2 -10
  60. package/core/index.ts +1 -35
  61. package/core/inspect/check-product.ts +5 -5
  62. package/core/inspect/runtime.ts +2 -1
  63. package/core/server/api/dispatch-service-api.ts +35 -36
  64. package/core/server/api/load-host-service.ts +5 -4
  65. package/core/server/compile-port.ts +1 -1
  66. package/core/server/host/app-config-composer.ts +2 -1
  67. package/core/server/host/host-assembly-entry.ts +1 -0
  68. package/core/server/host/host-assembly.ts +47 -3
  69. package/core/server/host/host-caller.ts +2 -1
  70. package/core/server/host/host-dir.ts +9 -0
  71. package/core/server/host/host-response-headers.ts +2 -1
  72. package/core/server/host/invoke-host-request-hook.ts +28 -4
  73. package/core/server/host/published-page-assets.ts +2 -1
  74. package/core/server/host/resolve-host-request-hook.ts +25 -7
  75. package/core/server/host/server-page-assets.ts +4 -4
  76. package/core/server/host/virtual-pages.ts +3 -2
  77. package/core/server/infra/cache/ServerFileCache.ts +79 -9
  78. package/core/server/registry/api-registry-store.ts +3 -1
  79. package/core/server/registry/declaration-precompiler.ts +0 -2
  80. package/core/server/registry/page-registry-repository.ts +2 -1
  81. package/core/server/registry/page-registry-store.ts +2 -1
  82. package/core/server/registry/registry-error.ts +6 -1
  83. package/core/server/registry/registry-file-lock.ts +296 -23
  84. package/core/server/registry/request-body-limit.ts +3 -2
  85. package/core/server/registry/validation/declaration-safety-scan.ts +151 -27
  86. package/core/server/runtime-space/access-gate.ts +21 -7
  87. package/core/server/runtime-space/bindings.ts +3 -6
  88. package/core/server/runtime-space/dynamic-pages.ts +181 -49
  89. package/core/server/runtime-space/errors.ts +3 -0
  90. package/core/server/runtime-space/inject.ts +74 -15
  91. package/core/server/runtime-space/page-grants.ts +7 -1
  92. package/core/server/runtime-space/resolve.ts +66 -19
  93. package/core/server/runtime-space/store.ts +32 -3
  94. package/core/server/runtime-space/submit-steps.ts +2 -1
  95. package/core/server/runtime-space/types.ts +3 -1
  96. package/core/shared/component-tree-errors.ts +2 -1
  97. package/core/shared/contract-a11y.ts +1 -1
  98. package/core/shared/contract-sections.ts +2 -2
  99. package/core/shared/core-diagnostic-codes.ts +8 -0
  100. package/core/shared/declaration-keys.ts +1 -1
  101. package/core/shared/engines/engine-error.ts +2 -1
  102. package/core/shared/generation-error.ts +2 -1
  103. package/core/shared/page-envelope.ts +1 -1
  104. package/core/shared/pure-binding.ts +88 -0
  105. package/core/shared/registry-generated/diagnostic-registry-index.ts +16 -19
  106. package/core/shared/registry-generated/diagnostic-registry.ts +135 -177
  107. package/core/shared/registry-generated/limits.ts +49 -13
  108. package/core/shared/registry-generated/std-grammar-completion.ts +0 -4
  109. package/core/shared/registry-generated/std-grammar-views.ts +40 -10
  110. package/core/shared/registry-generated/std-grammar.ts +42 -20
  111. package/core/shared/soma-error.ts +36 -0
  112. package/core/shared/types/compile-port.types.ts +1 -1
  113. package/core/shared/types/data-config.types.ts +17 -17
  114. package/core/shared/types/engine.types.ts +0 -3
  115. package/core/shared/types/event.types.ts +1 -11
  116. package/core/shared/types/generation-error.types.ts +5 -1
  117. package/core/shared/types/host-assembly.types.ts +7 -1
  118. package/core/shared/types/manifest.types.ts +0 -3
  119. package/core/shared/types/region-scope.types.ts +5 -1
  120. package/core/shared/types/scope-manifest.types.ts +0 -2
  121. package/core/shared/types/style-config.types.ts +21 -21
  122. package/core/shared/types/ui-config.types.ts +4 -5
  123. package/core/shared/types/watcher.types.ts +1 -1
  124. package/dist/browser/runtime-bundle.manifest.json +11 -13
  125. package/dist/browser/soma-runtime.js +2567 -2696
  126. package/dist/core/index.cjs +5446 -5486
  127. package/dist/host-native/aot-builder.cjs +46 -1
  128. package/dist/host-native/native-server.cjs +4879 -4505
  129. package/dist/lsp/component-tree.cjs +5814 -7042
  130. package/dist/types/build/compiler/full-manifest-builder.d.ts +0 -2
  131. package/dist/types/build/compiler/page-closure.d.ts +21 -0
  132. package/dist/types/build/compiler/page-declaration-compiler.d.ts +2 -4
  133. package/dist/types/build/compiler/soma-precompile.d.ts +1 -3
  134. package/dist/types/build/component-tree/artifact-codec.d.ts +0 -2
  135. package/dist/types/client/a11y/a11y-config.d.ts +2 -1
  136. package/dist/types/client/base/SomaHttpClient.d.ts +1 -1
  137. package/dist/types/client/base/SomaPageRootBase.d.ts +5 -0
  138. package/dist/types/client/base/defineSomaView.d.ts +46 -0
  139. package/dist/types/client/base/index.d.ts +2 -0
  140. package/dist/types/client/base/view-context.d.ts +136 -0
  141. package/dist/types/client/behavior/adapter-collection.d.ts +1 -1
  142. package/dist/types/client/compiler/manifest-compiler.d.ts +0 -3
  143. package/dist/types/client/component/component-definition.types.d.ts +2 -1
  144. package/dist/types/client/component/component-manager.d.ts +29 -0
  145. package/dist/types/client/data/data-object-resolver.d.ts +91 -31
  146. package/dist/types/client/data/format-config.d.ts +2 -1
  147. package/dist/types/client/engine/dom-renderer.d.ts +1 -2
  148. package/dist/types/client/engine/event-engine.d.ts +0 -7
  149. package/dist/types/client/engine/reactive-proxy.d.ts +11 -4
  150. package/dist/types/client/engine/runtime-builder.d.ts +0 -4
  151. package/dist/types/client/engine/soma-bootstrap.d.ts +44 -6
  152. package/dist/types/client/engine/style-binder.d.ts +8 -4
  153. package/dist/types/client/host-bridge/load-host-domain-class.d.ts +2 -1
  154. package/dist/types/client/mount/domain-rule.d.ts +2 -0
  155. package/dist/types/client/mount/mount-page.d.ts +2 -1
  156. package/dist/types/client/mount/types.d.ts +2 -0
  157. package/dist/types/client/parser/data-config-parser.d.ts +6 -5
  158. package/dist/types/client/parser/style-config-parser.d.ts +7 -3
  159. package/dist/types/client/parser/timer-parser.d.ts +5 -0
  160. package/dist/types/client/parser/ui-config-parser.d.ts +6 -2
  161. package/dist/types/client/runtime/SomaSnapshotStore.d.ts +2 -0
  162. package/dist/types/client/security/url-guard.d.ts +14 -0
  163. package/dist/types/client/validation/async-check-registry.d.ts +2 -1
  164. package/dist/types/client/validation/object-rules.d.ts +0 -5
  165. package/dist/types/index.d.ts +2 -7
  166. package/dist/types/inspect/runtime.d.ts +2 -1
  167. package/dist/types/server/api/dispatch-service-api.d.ts +5 -0
  168. package/dist/types/server/api/load-host-service.d.ts +1 -1
  169. package/dist/types/server/compile-port.d.ts +1 -1
  170. package/dist/types/server/host/host-assembly-entry.d.ts +1 -1
  171. package/dist/types/server/host/host-assembly.d.ts +2 -0
  172. package/dist/types/server/host/host-dir.d.ts +2 -0
  173. package/dist/types/server/host/invoke-host-request-hook.d.ts +10 -3
  174. package/dist/types/server/host/published-page-assets.d.ts +2 -1
  175. package/dist/types/server/host/resolve-host-request-hook.d.ts +18 -5
  176. package/dist/types/server/host/server-page-assets.d.ts +2 -1
  177. package/dist/types/server/infra/cache/ServerFileCache.d.ts +8 -0
  178. package/dist/types/server/registry/declaration-precompiler.d.ts +0 -1
  179. package/dist/types/server/registry/registry-error.d.ts +5 -1
  180. package/dist/types/server/registry/registry-file-lock.d.ts +30 -0
  181. package/dist/types/server/registry/request-body-limit.d.ts +3 -2
  182. package/dist/types/server/registry/validation/declaration-safety-scan.d.ts +3 -0
  183. package/dist/types/server/runtime-space/access-gate.d.ts +7 -0
  184. package/dist/types/server/runtime-space/bindings.d.ts +3 -2
  185. package/dist/types/server/runtime-space/dynamic-pages.d.ts +6 -1
  186. package/dist/types/server/runtime-space/errors.d.ts +1 -1
  187. package/dist/types/server/runtime-space/resolve.d.ts +2 -0
  188. package/dist/types/server/runtime-space/store.d.ts +8 -1
  189. package/dist/types/server/runtime-space/submit-steps.d.ts +2 -1
  190. package/dist/types/server/runtime-space/types.d.ts +3 -1
  191. package/dist/types/shared/component-tree-errors.d.ts +2 -1
  192. package/dist/types/shared/core-diagnostic-codes.d.ts +1 -1
  193. package/dist/types/shared/declaration-keys.d.ts +1 -1
  194. package/dist/types/shared/engines/engine-error.d.ts +2 -1
  195. package/dist/types/shared/generation-error.d.ts +2 -1
  196. package/dist/types/shared/pure-binding.d.ts +48 -0
  197. package/dist/types/shared/registry-generated/diagnostic-registry.d.ts +119 -158
  198. package/dist/types/shared/registry-generated/limits.d.ts +40 -10
  199. package/dist/types/shared/registry-generated/std-grammar-completion.d.ts +0 -30
  200. package/dist/types/shared/registry-generated/std-grammar-views.d.ts +97 -23
  201. package/dist/types/shared/registry-generated/std-grammar.d.ts +109 -241
  202. package/dist/types/shared/soma-error.d.ts +15 -0
  203. package/dist/types/shared/types/data-config.types.d.ts +14 -16
  204. package/dist/types/shared/types/engine.types.d.ts +0 -3
  205. package/dist/types/shared/types/event.types.d.ts +1 -7
  206. package/dist/types/shared/types/generation-error.types.d.ts +1 -1
  207. package/dist/types/shared/types/host-assembly.types.d.ts +2 -0
  208. package/dist/types/shared/types/manifest.types.d.ts +0 -3
  209. package/dist/types/shared/types/region-scope.types.d.ts +4 -1
  210. package/dist/types/shared/types/scope-manifest.types.d.ts +0 -2
  211. package/dist/types/shared/types/style-config.types.d.ts +17 -19
  212. package/dist/types/shared/types/ui-config.types.d.ts +4 -5
  213. package/host-native/bin/host-native.cjs +22 -1
  214. package/host-native/client/browser-entry.ts +44 -9
  215. package/host-native/src/aot-builder.ts +52 -0
  216. package/host-native/src/host-prepare.ts +39 -5
  217. package/host-native/src/manifest-http.ts +2 -3
  218. package/host-native/src/native-server.ts +812 -174
  219. package/host-native/src/page-http.ts +3 -3
  220. package/host-native/src/public-packages.cjs +0 -1
  221. package/host-native/src/registry-handler.ts +12 -5
  222. package/host-native/src/static-file.ts +203 -53
  223. package/package.json +3 -2
  224. package/core/client/engine/step-runner.ts +0 -212
  225. package/core/client/engine/trigger-engine.ts +0 -55
  226. package/core/client/format/zoned.ts +0 -10
  227. package/core/client/parser/step-parser.ts +0 -359
  228. package/core/client/parser/trigger-parser.ts +0 -90
  229. package/core/client/parser/value-lang.ts +0 -340
  230. package/core/client/time/instant.ts +0 -2
  231. package/core/shared/calc/coerce.ts +0 -2
  232. package/core/shared/calc/errors.ts +0 -40
  233. package/core/shared/calc/evaluator.ts +0 -113
  234. package/core/shared/calc/index.ts +0 -11
  235. package/core/shared/calc/lexer.ts +0 -189
  236. package/core/shared/calc/parser.ts +0 -193
  237. package/core/shared/calc/typer.ts +0 -171
  238. package/core/shared/date-parts.ts +0 -2
  239. package/core/shared/show-when.ts +0 -77
  240. package/core/shared/types/step.types.ts +0 -91
  241. package/core/shared/types/trigger.types.ts +0 -14
  242. package/dist/types/client/engine/step-runner.d.ts +0 -42
  243. package/dist/types/client/engine/trigger-engine.d.ts +0 -16
  244. package/dist/types/client/format/zoned.d.ts +0 -1
  245. package/dist/types/client/parser/step-parser.d.ts +0 -23
  246. package/dist/types/client/parser/trigger-parser.d.ts +0 -13
  247. package/dist/types/client/parser/value-lang.d.ts +0 -63
  248. package/dist/types/client/time/instant.d.ts +0 -1
  249. package/dist/types/shared/calc/coerce.d.ts +0 -1
  250. package/dist/types/shared/calc/errors.d.ts +0 -14
  251. package/dist/types/shared/calc/evaluator.d.ts +0 -2
  252. package/dist/types/shared/calc/index.d.ts +0 -6
  253. package/dist/types/shared/calc/lexer.d.ts +0 -19
  254. package/dist/types/shared/calc/parser.d.ts +0 -43
  255. package/dist/types/shared/calc/typer.d.ts +0 -11
  256. package/dist/types/shared/date-parts.d.ts +0 -1
  257. package/dist/types/shared/show-when.d.ts +0 -21
  258. package/dist/types/shared/types/step.types.d.ts +0 -76
  259. package/dist/types/shared/types/trigger.types.d.ts +0 -12
@@ -5,13 +5,13 @@
5
5
  // ── 键集 / 词表视图(名字、类型、键序与手写常量逐字相同;reconcilesWith 登记它替换谁) ──
6
6
 
7
7
  /** 视图:取代手写常量 soma-core/core/client/parser/data-config-parser.ts#SOMA_DATA_OBJECT_KEYS(迁移时已用 HEAD 源码逐值逐序对账相等)。 */
8
- export const SOMA_DATA_OBJECT_KEYS: readonly string[] = ['from', 'transform', 'fields', 'write', 'predicates', 'name', 'poll'];
8
+ export const SOMA_DATA_OBJECT_KEYS: readonly string[] = ['from', 'fields', 'write', 'name', 'poll'];
9
9
 
10
10
  /** 视图:取代手写常量 soma-core/core/client/parser/data-config-parser.ts#SOMA_DATA_FIELD_KEYS(迁移时已用 HEAD 源码逐值逐序对账相等)。 */
11
- export const SOMA_DATA_FIELD_KEYS: readonly string[] = ['name', 'type', 'rules', 'options', 'calc', 'default'];
11
+ export const SOMA_DATA_FIELD_KEYS: readonly string[] = ['name', 'type', 'rules', 'options', 'default'];
12
12
 
13
13
  /** 视图:取代手写常量 soma-core/core/client/parser/data-config-parser.ts#SOMA_DATA_RULE_KEYS(迁移时已用 HEAD 源码逐值逐序对账相等)。 */
14
- export const SOMA_DATA_RULE_KEYS = ['required', 'max_len', 'min_len', 'pattern', 'min', 'max', 'step', 'message', 'when', 'async', 'severity'] as const;
14
+ export const SOMA_DATA_RULE_KEYS = ['required', 'max_len', 'min_len', 'pattern', 'min', 'max', 'step', 'message', 'async', 'severity'] as const;
15
15
 
16
16
  /** 视图:取代手写常量 soma-core/core/client/parser/data-config-parser.ts#SOMA_DATA_WRITE_KEYS(迁移时已用 HEAD 源码逐值逐序对账相等)。 */
17
17
  export const SOMA_DATA_WRITE_KEYS = ['create', 'update', 'version', 'map', 'only', 'reload', 'delete', 'validate_on', 'failWhen', 'messagePath', 'timeoutMs'] as const;
@@ -57,9 +57,6 @@ export const SOMA_STD_DOMAIN_COMMAND_METHODS = ['POST', 'PUT', 'PATCH'] as const
57
57
  /** 取值域 validate-triggers(对应 SOMA_VALIDATE_TRIGGERS):写通道 validate_on 的校验时机:非空无重复列表 */
58
58
  export const SOMA_STD_DOMAIN_VALIDATE_TRIGGERS = ['change', 'blur', 'submit'] as const;
59
59
 
60
- /** 取值域 show-when-presence-ops(对应 SOMA_SHOW_WHEN_PRESENCE_OPS):Show when 对象形 { field, op, value? } 在谓词算子(predicate-ops)之外多出的有无值算子,不带 value:present = 非 null / undefined / 空白串 / 空数组(0 与 false 算有值,与动作 available_when.requires 同口径);blank = 相反。谓词里的 empty / not_empty 把 false 当空,口径不同 */
61
- export const SOMA_STD_DOMAIN_SHOW_WHEN_PRESENCE_OPS = ['present', 'blank'] as const;
62
-
63
60
  /** 取值域 url-schemes(对应 SOMA_URL_FIELD_SCHEMES):url / image 字段 schemes 的协议闭集(S8);缺省只放行 http / https */
64
61
  export const SOMA_STD_DOMAIN_URL_SCHEMES = ['http', 'https', 'mailto', 'tel', 'sms', 'ftp'] as const;
65
62
 
@@ -110,20 +107,17 @@ export const SOMA_STD_KEY_LIMITS = {
110
107
  export const SOMA_STD_CARRY_TABLE = [
111
108
  { "context": "object", "key": "from", "prop": "from", "carry": { "transform": "ObjectFrom" } },
112
109
  { "context": "field", "key": "name", "prop": "name", "carry": "passthrough" },
113
- { "context": "object", "key": "transform", "prop": "transform", "carry": { "transform": "ObjectTransform" } },
114
110
  { "context": "field", "key": "type", "prop": "type", "carry": { "transform": "FieldType" } },
115
111
  { "context": "object", "key": "fields", "prop": "fields", "carry": { "transform": "ObjectFields" } },
116
112
  { "context": "field", "key": "rules", "prop": "rules", "carry": { "transform": "FieldRules" } },
117
113
  { "context": "object", "key": "write", "prop": "write", "carry": { "transform": "ObjectWrite" } },
118
114
  { "context": "field", "key": "options", "prop": "options", "carry": { "transform": "FieldOptions" } },
119
- { "context": "object", "key": "predicates", "prop": "predicates", "carry": { "transform": "ObjectPredicates" } },
120
115
  { "context": "object", "key": "name", "prop": "displayName", "carry": { "transform": "ObjectName" } },
121
116
  { "context": "object", "key": "poll", "prop": "poll", "carry": { "transform": "ObjectPoll" } },
122
- { "context": "field", "key": "calc", "prop": "calc", "carry": "passthrough" },
123
117
  { "context": "field", "key": "default", "prop": "default", "carry": { "transform": "FieldDefault" } }
124
118
  ] as const;
125
119
 
126
- export const SOMA_STD_TRANSFORM_HOOKS = ['ObjectFrom', 'ObjectTransform', 'FieldType', 'ObjectFields', 'FieldRules', 'ObjectWrite', 'FieldOptions', 'ObjectPredicates', 'ObjectName', 'ObjectPoll', 'FieldDefault'] as const;
120
+ export const SOMA_STD_TRANSFORM_HOOKS = ['ObjectFrom', 'FieldType', 'ObjectFields', 'FieldRules', 'ObjectWrite', 'FieldOptions', 'ObjectName', 'ObjectPoll', 'FieldDefault'] as const;
127
121
  export type SomaStdTransformHookName = (typeof SOMA_STD_TRANSFORM_HOOKS)[number];
128
122
 
129
123
  // ── 授权扫描表:值是「会被调用的接口」的键(授权闸门 / 接口白名单 / 跨库校验 / 底稿接口 共用一份) ──
@@ -137,3 +131,39 @@ export const SOMA_STD_AUTH_SCAN = {
137
131
  ],
138
132
  "containers": []
139
133
  } as const;
134
+
135
+ // ── 视觉页面禁逻辑语法与纯绑定真源(std-grammar.json#pageForbiddenLogicKeys) ──
136
+
137
+ export const SOMA_STD_PAGE_FORBIDDEN_LOGIC_KEYS = {
138
+ "title": "视觉页面不含逻辑语法:页面语法里禁止出现的逻辑键(三层分工:业务逻辑归业务对象,交互逻辑归展示对象,页面只做纯视觉翻译;见 knowledge/SOMA领域建模与组件编写准则.md §1.0)",
139
+ "decidedAt": "2026-11-09",
140
+ "keys": [
141
+ { "key": "calc", "was": "core 字段计算" },
142
+ { "key": "derive", "was": "foundation 字段级派生(K19)/ kit derive 模板" },
143
+ { "key": "derived", "was": "页面声明里的派生写法" },
144
+ { "key": "showWhen", "was": "条件显示" },
145
+ { "key": "hiddenWhen", "was": "条件隐藏" },
146
+ { "key": "disabledWhen", "was": "条件禁用" },
147
+ { "key": "requiredWhen", "was": "条件必填" },
148
+ { "key": "when", "was": "动作 when 条件 / show when 对象谓词 { field, op, value } / rules[].when 条件规则(纯路径字符串形 when 是纯绑定,放行)", "forbiddenShape": "object" },
149
+ { "key": "predicates", "scope": "standard", "was": "data.<对象>.predicates 具名谓词" },
150
+ { "key": "transform", "scope": "standard", "was": "data.<对象>.transform 取数后派生字段" },
151
+ { "key": "steps", "scope": "standard", "was": "_event 事件编排(when / switch / for_each / goto)" },
152
+ { "key": "triggers", "scope": "standard", "was": "_event triggers 条件触发器(condition + value)" },
153
+ { "key": "switch", "scope": "standard", "was": "_event steps 内 switch 条件分支" },
154
+ { "key": "for_each", "scope": "standard", "was": "_event steps 内 for_each 循环" },
155
+ { "key": "parallel", "scope": "standard", "was": "_event steps 内 parallel 并行编排" }
156
+ ],
157
+ "pureBinding": {
158
+ "title": "展示对象的值对页面只读:页面只做纯路径读取,不在页面里取反、比较、映射;需要判断的地方由展示对象直接给最终值(2026-11-10 裁决)",
159
+ "negatedPath": { "code": "CORE-PAGE-NEGATE-FORBIDDEN", "prefix": "!", "positions": ["show.when", "show.class 值", "show.props 值", "嵌套绑定 when"], "pathPattern": "^!\\s*[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)+\\s*$", "was": "`!path` 取反前缀(when / class 条件路径 / 组件 props 值)", "remedy": "由展示对象另给相反的成员(如 remarkHidden),页面绑定它" },
160
+ "styleComparison": { "code": "CORE-STYLE-COMPARE-FORBIDDEN", "keys": ["condition", "value"], "positions": ["_style states 条目", "_style transitions.active_state"], "was": "_style states 的 `condition: 路径` + `value` 比较 + `apply`,以及 transitions.active_state 的 condition + value", "remedy": "改写成类名档位绑定:`bind: page.成员` + `tiers: { 档位名: 类名 }`,成员的值就是档位名" },
161
+ "styleTier": { "keys": ["bind", "tiers"], "tierNamePattern": "^[a-z][a-z0-9_-]*$", "maxTiers": 8, "positions": ["_style states.<锚点>", "_style transitions.<锚点>(trigger: active_state)"], "note": "bind 是纯路径(点分标识符,无取反 / 管道 / 运算符);tiers 是 档位名 到 类名串 的闭集映射,成员值不在档位内时不加任何类;档位名闭集 pattern 与个数上限读本节,页面不写比较" },
162
+ "roleBy": { "code": "CORE-PAGE-ROLE-BY-INVALID", "pathPattern": "^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)*$", "positions": ["bind.role_by"], "was": "bind.role_by 写了表达式 / 取反 / 管道 / 映射", "remedy": "role_by 只许纯路径:行字段的值直接作为模板名,匹配 data-soma-role=\"item:取值\";行数据自带模板名" }
163
+ },
164
+ "exemptContexts": ["diagnostics", "diagnosticExamples", "rejected", "title", "basis", "was", "summary", "docSummary"],
165
+ "exampleRoots": ["soma-kit-demo/pages", "soma-kit/examples", "soma-ui/tests/fixtures/hosts", "soma-core-demo/ui", "soma-core-demo/pages"],
166
+ "exampleFilePatterns": ["_ui.yaml", ".kit.yaml", "_style.yaml"],
167
+ "exampleSkipDirs": ["node_modules", "negative", "__negative__"],
168
+ "note": "forbiddenShape: 'object' = 只禁对象 / 列表形,值为字符串(纯路径绑定)放行;scope: 'standard' = 只在 core 标准格式(四件套 / 注入口)判定,不进 G83 的跨方言语法源与示例页扫描(方言同名键含义不同,如 steps 页面模式)"
169
+ } as const;
@@ -13,7 +13,7 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
13
13
  "stages": [
14
14
  { "id": "surface", "title": "作者书写的键", "describes": "YAML(biz / ui / app 文件)与 AI 蓝图 JSON 里的键;本身没有类型,是每条路径的起点" },
15
15
  { "id": "page-block", "title": "平铺 _ui.yaml(页面声明)", "describes": "平铺 _ui.yaml 的顶层键(bind / show / initProps 与保留键 envelope / data / state / scopes / session / fragments / domain / locale / watch);类型登记(UiConfig 容纳哪些上下文)由方言叠加" },
16
- { "id": "core-config", "title": "核心层对象配置(数据对象解析器的产物)", "writers": ["soma-core/core/client/parser/", "soma-core/core/server/registry/", "soma-ui/src/compiler/bdl/", "soma-ui/src/compiler/page/session-synthesis.ts", "soma-ui/src/compiler/need/build-need.ts", "soma-core/core/build/compiler/"], "readers": ["soma-core/core/client/data/", "soma-core/core/client/engine/", "soma-core/core/shared/", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/compose/", "soma-ui/src/compiler/driver/", "soma-ui/src/compiler/certify/", "soma-ui/src/compiler/emit/", "soma-ui/src/compiler/behavior/", "soma-ui/src/compiler/forms/", "soma-ui/src/compiler/page/", "soma-ui/src/compiler/contract/", "soma-ui/src/compiler/styling/", "soma-ui/src/data-kit/"], "relays": ["soma-core/core/client/parser/", "soma-ui/src/compiler/bdl/", "soma-core/core/server/registry/"], "relayToFacts": ["soma-ui/src/compiler/need/object-facts.ts"], "closure": { "id": "bdl→object", "title": "BDL 解析 → 对象描述(业务对象声明交给 M2 / 生成 / 运行期数据层)", "produce": [{ "file": "soma-ui/src/compiler/contract/biz-declaration.types.ts", "type": "SomaBizDeclaration" }], "producers": [{ "file": "soma-ui/src/compiler/bdl/object/parse.ts", "symbol": "readBizDeclaration" }, { "file": "soma-ui/src/compiler/bdl/pins/biz-table.ts", "symbol": "resolvePageBiz" }], "consumers": ["soma-ui/src/compiler/need/", "soma-ui/src/compiler/compose/", "soma-ui/src/compiler/page/", "soma-ui/src/compiler/driver/", "soma-ui/src/compiler/behavior/", "soma-ui/src/compiler/styling/", "soma-ui/src/compiler/emit/", "soma-ui/src/compiler/certify/", "soma-ui/src/data-kit/", "soma-core/core/client/", "soma-core/core/server/"], "exclude": ["soma-ui/src/compiler/bdl/", "soma-core/core/client/parser/"] }, "types": [{ "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataObjectConfig", "contexts": ["object"], "writes": "member", "complete": true, "closure": true, "internal": [{ "member": "name", "why": "对象名取自声明映射的键,不是 BDL 的 name 键(那个落在 displayName)" }, { "member": "deps", "why": "依赖对象名集合,由解析器从 from / 关系 / 选项来源推导,作者不写" }] }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataFieldConfig", "contexts": ["field"], "writes": "structural", "complete": true, "closure": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataFieldOption", "contexts": ["field.option"], "writes": "member", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataFieldRule", "contexts": ["field.rule"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataObjectRelation", "contexts": ["relation"], "writes": "structural", "complete": true, "closure": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataActionConfig", "contexts": ["action"], "writes": "structural", "complete": true, "closure": true, "internal": [{ "member": "icon", "why": "图标仅由页面合成的会话动作与应用级管道动作带,BDL 动作条目没有 icon 键" }] }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaObjectPoll", "contexts": ["poll", "poll.while"], "writes": "member", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaObjectState", "contexts": ["state"], "writes": "member", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaObjectVariants", "contexts": ["variants"], "writes": "member", "complete": true }, { "file": "soma-core/core/shared/types/session.types.ts", "type": "SomaSessionConfig", "contexts": ["session", "session.budget"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/session.types.ts", "type": "SomaSessionActionConfig", "contexts": ["session.action"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/session.types.ts", "type": "SomaSessionChildConfig", "contexts": ["session.child", "session.budget"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/region-query.types.ts", "type": "SomaSessionLimits", "contexts": ["session.limits"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/region-query.types.ts", "type": "SomaSessionSearch", "contexts": ["session.search"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataWriteConfig", "contexts": ["write"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/object-declaration.types.ts", "type": "SomaObjectTheme", "contexts": ["object.theme"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/object-constraints.ts", "type": "SomaObjectConstraint", "contexts": ["constraint"], "writes": "structural" }, { "file": "soma-core/core/shared/object-constraints.ts", "type": "SomaObjectConstraintWhen", "contexts": ["constraint.when"], "writes": "structural" }] },
16
+ { "id": "core-config", "title": "核心层对象配置(数据对象解析器的产物)", "writers": ["soma-core/core/client/parser/", "soma-core/core/server/registry/", "soma-ui/src/compiler/bdl/", "soma-ui/src/compiler/page/session-synthesis.ts", "soma-ui/src/compiler/need/build-need.ts", "soma-core/core/build/compiler/"], "readers": ["soma-core/core/client/data/", "soma-core/core/client/engine/", "soma-core/core/shared/", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/compose/", "soma-ui/src/compiler/driver/", "soma-ui/src/compiler/certify/", "soma-ui/src/compiler/emit/", "soma-ui/src/compiler/behavior/", "soma-ui/src/compiler/forms/", "soma-ui/src/compiler/page/", "soma-ui/src/compiler/contract/", "soma-ui/src/compiler/styling/", "soma-ui/src/data-kit/"], "relays": ["soma-core/core/client/parser/", "soma-ui/src/compiler/bdl/", "soma-core/core/server/registry/"], "relayToFacts": ["soma-ui/src/compiler/need/object-facts.ts"], "closure": { "id": "bdl→object", "title": "BDL 解析 → 对象描述(业务对象声明交给 M2 / 生成 / 运行期数据层)", "produce": [{ "file": "soma-ui/src/compiler/contract/biz-declaration.types.ts", "type": "SomaBizDeclaration" }], "producers": [{ "file": "soma-ui/src/compiler/bdl/object/parse.ts", "symbol": "readBizDeclaration" }, { "file": "soma-ui/src/compiler/bdl/pins/biz-table.ts", "symbol": "resolvePageBiz" }], "consumers": ["soma-ui/src/compiler/need/", "soma-ui/src/compiler/compose/", "soma-ui/src/compiler/page/", "soma-ui/src/compiler/driver/", "soma-ui/src/compiler/behavior/", "soma-ui/src/compiler/styling/", "soma-ui/src/compiler/emit/", "soma-ui/src/compiler/certify/", "soma-ui/src/data-kit/", "soma-core/core/client/", "soma-core/core/server/"], "exclude": ["soma-ui/src/compiler/bdl/", "soma-core/core/client/parser/"] }, "types": [{ "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataObjectConfig", "contexts": ["object"], "writes": "member", "complete": true, "closure": true, "internal": [{ "member": "name", "why": "对象名取自声明映射的键,不是 BDL 的 name 键(那个落在 displayName)" }, { "member": "deps", "why": "依赖对象名集合,由解析器从 from / 关系 / 选项来源推导,作者不写" }] }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataFieldConfig", "contexts": ["field"], "writes": "structural", "complete": true, "closure": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataFieldOption", "contexts": ["field.option"], "writes": "member", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataFieldRule", "contexts": ["field.rule"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataObjectRelation", "contexts": ["relation"], "writes": "structural", "complete": true, "closure": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataActionConfig", "contexts": ["action"], "writes": "structural", "complete": true, "closure": true, "internal": [{ "member": "icon", "why": "图标仅由页面合成的会话动作与应用级管道动作带,BDL 动作条目没有 icon 键" }] }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaObjectPoll", "contexts": ["poll", "poll.while"], "writes": "member", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaObjectState", "contexts": ["state"], "writes": "member", "complete": true }, { "file": "soma-core/core/shared/types/session.types.ts", "type": "SomaSessionConfig", "contexts": ["session", "session.budget"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/session.types.ts", "type": "SomaSessionActionConfig", "contexts": ["session.action"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/session.types.ts", "type": "SomaSessionChildConfig", "contexts": ["session.child", "session.budget"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/region-query.types.ts", "type": "SomaSessionLimits", "contexts": ["session.limits"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/region-query.types.ts", "type": "SomaSessionSearch", "contexts": ["session.search"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/data-config.types.ts", "type": "SomaDataWriteConfig", "contexts": ["write"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/types/object-declaration.types.ts", "type": "SomaObjectTheme", "contexts": ["object.theme"], "writes": "structural", "complete": true }, { "file": "soma-core/core/shared/object-constraints.ts", "type": "SomaObjectConstraint", "contexts": ["constraint"], "writes": "structural" }] },
17
17
  { "id": "facts", "title": "对象事实(需求推导的输入)", "writers": ["soma-ui/src/compiler/need/object-facts.ts"], "readers": ["soma-ui/src/compiler/need/", "soma-ui/src/compiler/compose/", "soma-ui/src/compiler/driver/", "soma-ui/src/compiler/certify/", "soma-ui/src/compiler/behavior/", "soma-ui/src/compiler/settle/", "soma-ui/src/compiler/styling/", "soma-ui/src/compiler/emit/"], "relays": ["soma-ui/src/compiler/need/object-facts.ts"], "types": [{ "file": "soma-ui/src/compiler/contract/need.types.ts", "type": "SomaObjectFacts", "contexts": ["object"], "writes": "member", "closure": true }, { "file": "soma-ui/src/compiler/contract/need.types.ts", "type": "SomaFieldFact", "contexts": ["field"], "writes": "member", "closure": true }, { "file": "soma-ui/src/compiler/contract/need.types.ts", "type": "SomaRelationFact", "contexts": ["relation"], "writes": "member", "closure": true }], "closure": { "id": "object→m2", "title": "对象描述 → M2 对象事实(字段 / 关系事实交给需求推导与生成)", "producers": [{ "file": "soma-ui/src/compiler/need/object-facts.ts", "symbol": "buildObjectFacts" }], "consumers": ["soma-ui/src/compiler/need/", "soma-ui/src/compiler/compose/", "soma-ui/src/compiler/settle/", "soma-ui/src/compiler/certify/", "soma-ui/src/compiler/driver/", "soma-ui/src/compiler/styling/", "soma-ui/src/compiler/emit/"], "exclude": ["soma-ui/src/compiler/need/object-facts.ts"] } },
18
18
  { "id": "linkage", "title": "联动规格里的动作视图", "writers": ["soma-ui/src/compiler/need/object-facts.ts"], "readers": ["soma-ui/src/compiler/compose/", "soma-ui/src/compiler/driver/", "soma-ui/src/compiler/behavior/", "soma-ui/src/compiler/need/families/", "soma-ui/src/data-kit/"], "relays": ["soma-ui/src/compiler/need/object-facts.ts"], "types": [{ "file": "soma-ui/src/compiler/contract/need.types.ts", "type": "SomaActionFact", "contexts": ["action"], "writes": "member" }] }
19
19
  ],
@@ -46,7 +46,6 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
46
46
  { "id": "predicate-ops", "ref": "SOMA_FIELD_PREDICATE_OPS", "values": ["eq", "ne", "in", "not_in", "empty", "not_empty", "gt", "gte", "lt", "lte", "between", "matches", "starts_with", "ends_with", "contains", "in_last", "in_next"], "note": "in_last / in_next(D8 / C22)是相对日期算子,值形如 { n, unit },只属 date / datetime 的 dated 运算符族(data-selection#/fieldTypeCaps/opFamilies/dated),求值归 core 时间能力;不在文本 / 比较 / 列表子集内,只进规则子集 predicate-rule-ops" },
47
47
  { "id": "command-methods", "ref": "WRITE_METHODS", "values": ["POST", "PUT", "PATCH"], "note": "写通道 create / update 的方法;大小写不敏感,解析后统一大写" },
48
48
  { "id": "validate-triggers", "ref": "SOMA_VALIDATE_TRIGGERS", "values": ["change", "blur", "submit"], "note": "写通道 validate_on 的校验时机:非空无重复列表" },
49
- { "id": "show-when-presence-ops", "ref": "SOMA_SHOW_WHEN_PRESENCE_OPS", "values": ["present", "blank"], "note": "Show when 对象形 { field, op, value? } 在谓词算子(predicate-ops)之外多出的有无值算子,不带 value:present = 非 null / undefined / 空白串 / 空数组(0 与 false 算有值,与动作 available_when.requires 同口径);blank = 相反。谓词里的 empty / not_empty 把 false 当空,口径不同" },
50
49
  { "id": "url-schemes", "ref": "SOMA_URL_FIELD_SCHEMES", "values": ["http", "https", "mailto", "tel", "sms", "ftp"], "note": "url / image 字段 schemes 的协议闭集(S8);缺省只放行 http / https" },
51
50
  { "id": "envelope-param-types", "ref": "SOMA_ENVELOPE_PARAM_TYPES", "values": ["int", "string", "slug", "uuid", "enum"], "note": "信封 params.<名>.type" },
52
51
  { "id": "envelope-query-types", "ref": "SOMA_ENVELOPE_QUERY_TYPES", "values": ["string", "int", "bool", "enum", "slug"], "note": "信封 query.<名>.type" },
@@ -65,7 +64,7 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
65
64
  { "id": "poll.every", "context": "poll", "key": "every", "order": 1, "surface": ["standard"], "value": { "kind": "int", "min": 2, "max": 300, "unit": "秒" }, "default": null, "sample": { "value": 5 }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaObjectPoll.every" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/data-facts.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "轮询间隔(2..300 的整数秒)" },
66
65
  { "id": "poll.while.field", "context": "poll.while", "key": "field", "order": 1, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "status" }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "carrier": "SomaObjectPoll.while", "name": "field" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/data-facts.ts", "soma-ui/src/data-kit/poll.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "看哪个字段(roles.status 字段或枚举字段)" },
67
66
  { "id": "write.create", "context": "write", "key": "create", "order": 1, "surface": ["standard"], "value": { "kind": "shape", "shape": "write-endpoint" }, "default": null, "sample": { "value": { "api": "/api/o", "method": "post" } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.create" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/", "soma-ui/src/compiler/compose/families/"] } }], "effect": { "changes": ["artifact", "runtime"] }, "docSummary": "写通道", "lsp": { "detail": "新建端点 { api, method: POST | PUT | PATCH }" } },
68
- { "id": "field.name", "context": "field", "key": "name", "order": 1, "origin": "base", "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "客户" }, "carry": "passthrough", "prop": "name", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.name" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/data-kit/"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.name" }, { "stage": "facts", "prop": "SomaFieldFact.name" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/", "soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/need/region-env.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "字段显示名", "status": "implemented" },
67
+ { "id": "field.name", "context": "field", "key": "name", "order": 1, "origin": "base", "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "客户" }, "carry": "passthrough", "prop": "name", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.name" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.name" }, { "stage": "facts", "prop": "SomaFieldFact.name" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/", "soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/need/region-env.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "字段显示名", "status": "implemented" },
69
68
  { "id": "field.option.key", "context": "field.option", "key": "key", "order": 1, "origin": "base", "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "open" }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldOption.key" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/data-kit/"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "候选键", "status": "implemented" },
70
69
  { "id": "field.rule.required", "context": "field.rule", "key": "required", "order": 1, "origin": "base", "surface": ["standard"], "value": { "kind": "bool" }, "default": null, "sample": { "value": true }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.required" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/runtime/console-kit.ts", "soma-ui/src/data-kit/"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "必填", "status": "implemented" },
71
70
  { "id": "page.envelope.url", "context": "page.envelope", "key": "url", "order": 1, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.url" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeUrl" } } }], "docSummary": "页面地址(精确 / 模式 :参数 / 前缀 /*)" },
@@ -76,11 +75,10 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
76
75
  { "id": "page.envelope.meta.description", "context": "page.envelope.meta", "key": "description", "order": 1, "surface": ["standard"], "value": { "kind": "string", "maxCodepoints": 160 }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.meta.description" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeMeta" } } }], "docSummary": "页面描述(字面量)" },
77
76
  { "id": "page.envelope.source.format", "context": "page.envelope.source", "key": "format", "order": 1, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.source.format" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeSource" } } }], "docSummary": "来源格式标签" },
78
77
  { "id": "page.envelope.lifecycle.persist", "context": "page.envelope.lifecycle", "key": "persist", "order": 1, "surface": ["standard"], "value": { "kind": "enum", "domain": "envelope-persist-levels" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.lifecycle.persist" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeLifecycle" } } }], "docSummary": "持久度(memory / runtime / registry)" },
79
- { "id": "object.transform", "context": "object", "key": "transform", "order": 2, "origin": "base", "surface": ["standard"], "value": { "kind": "map", "of": "string" }, "default": null, "sample": { "value": { "total_text": "total | money" } }, "carry": { "transform": "ObjectTransform" }, "prop": "transform", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.transform" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/data-object-resolver.ts"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.transform" }, { "stage": "facts", "prop": "SomaFieldFact.derived" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/need/object-facts.ts", "soma-ui/src/compiler/settle/style.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "取数后派生", "status": "implemented" },
80
78
  { "id": "poll.while", "context": "poll", "key": "while", "order": 2, "surface": ["standard"], "value": { "kind": "shape", "contains": "poll.while" }, "default": null, "sample": { "value": { "field": "status", "in": ["running"] } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaObjectPoll.while" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/data-facts.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "继续轮询的条件" },
81
79
  { "id": "poll.while.in", "context": "poll.while", "key": "in", "order": 2, "surface": ["standard"], "value": { "kind": "list", "of": "string" }, "default": null, "sample": { "value": ["running"] }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "carrier": "SomaObjectPoll.while", "name": "in" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/data-facts.ts", "soma-ui/src/data-kit/poll.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "字段取这些候选键时继续轮询" },
82
80
  { "id": "write.update", "context": "write", "key": "update", "order": 2, "surface": ["standard"], "value": { "kind": "shape", "shape": "write-endpoint" }, "default": null, "sample": { "value": { "api": "/api/o/{no}", "method": "put" } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.update" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/", "soma-ui/src/compiler/compose/families/"] } }], "effect": { "changes": ["artifact", "runtime"] }, "docSummary": "写通道", "lsp": { "detail": "更新端点 { api, method: POST | PUT | PATCH }" } },
83
- { "id": "field.type", "context": "field", "key": "type", "order": 2, "origin": "base", "surface": ["standard"], "value": { "kind": "enum", "domain": "field-types" }, "default": null, "sample": { "value": "money" }, "carry": { "transform": "FieldType" }, "prop": "type", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.type" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/", "soma-ui/src/compiler/page/", "soma-ui/src/data-kit/"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.type" }, { "stage": "facts", "prop": "SomaFieldFact.type" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/", "soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/settle/type-select.ts", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/need/families/", "soma-ui/src/compiler/styling/state-variants.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "类型(二十六种)", "status": "implemented" },
81
+ { "id": "field.type", "context": "field", "key": "type", "order": 2, "origin": "base", "surface": ["standard"], "value": { "kind": "enum", "domain": "field-types" }, "default": null, "sample": { "value": "money" }, "carry": { "transform": "FieldType" }, "prop": "type", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.type" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.type" }, { "stage": "facts", "prop": "SomaFieldFact.type" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/", "soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/settle/type-select.ts", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/need/families/", "soma-ui/src/compiler/styling/state-variants.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "类型(二十六种)", "status": "implemented" },
84
82
  { "id": "field.option.label", "context": "field.option", "key": "label", "order": 2, "origin": "base", "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "待处理" }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldOption.label" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/data-kit/"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "候选显示名", "status": "implemented" },
85
83
  { "id": "field.rule.max_len", "context": "field.rule", "key": "max_len", "order": 2, "origin": "base", "surface": ["standard"], "value": { "kind": "int" }, "default": null, "sample": { "value": 20 }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.max_len" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/runtime/console-kit.ts", "soma-ui/src/compiler/need/region-env.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "最大长度", "status": "implemented" },
86
84
  { "id": "page.envelope.params", "context": "page.envelope", "key": "params", "order": 2, "surface": ["standard"], "value": { "kind": "map", "contains": "page.envelope.params" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.params" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeParams" } } }], "docSummary": "地址参数规格(名与 url 的 :名 对应)" },
@@ -91,7 +89,7 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
91
89
  { "id": "page.envelope.meta.tags", "context": "page.envelope.meta", "key": "tags", "order": 2, "surface": ["standard"], "value": { "kind": "list", "of": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.meta.tags" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeMeta" } } }], "docSummary": "标签(≤8 个)" },
92
90
  { "id": "page.envelope.source.author", "context": "page.envelope.source", "key": "author", "order": 2, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.source.author" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeSource" } } }], "docSummary": "来源作者标签" },
93
91
  { "id": "page.envelope.lifecycle.expires", "context": "page.envelope.lifecycle", "key": "expires", "order": 2, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.lifecycle.expires" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeLifecycle" } } }], "docSummary": "有效期(<n>m|h|d,≤30d)" },
94
- { "id": "object.fields", "context": "object", "key": "fields", "order": 3, "origin": "base", "surface": ["standard"], "value": { "kind": "map", "of": "shape", "contains": "field" }, "default": null, "sample": { "value": { "no": { "type": "text" } } }, "carry": { "transform": "ObjectFields" }, "prop": "fields", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.fields" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/", "soma-ui/src/compiler/certify/invariants/", "soma-ui/src/compiler/driver/data-facts.ts", "soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/need/families/", "soma-ui/src/compiler/page/"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.fields" }, { "stage": "facts", "prop": "SomaObjectFacts.fields" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/", "soma-ui/src/compiler/settle/type-select.ts", "soma-ui/src/compiler/settle/subtree.ts", "soma-ui/src/compiler/need/families/", "soma-ui/src/compiler/need/region-env.ts", "soma-ui/src/compiler/styling/state-variants.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "字段字典", "status": "implemented", "note": "字段字典:每个字段的键见 field 上下文" },
92
+ { "id": "object.fields", "context": "object", "key": "fields", "order": 2, "origin": "base", "surface": ["standard"], "value": { "kind": "map", "of": "shape", "contains": "field" }, "default": null, "sample": { "value": { "no": { "type": "text" } } }, "carry": { "transform": "ObjectFields" }, "prop": "fields", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.fields" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/", "soma-ui/src/compiler/certify/invariants/", "soma-ui/src/compiler/driver/data-facts.ts", "soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/need/families/", "soma-ui/src/compiler/page/"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.fields" }, { "stage": "facts", "prop": "SomaObjectFacts.fields" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/driver/", "soma-ui/src/compiler/settle/type-select.ts", "soma-ui/src/compiler/settle/subtree.ts", "soma-ui/src/compiler/need/families/", "soma-ui/src/compiler/need/region-env.ts", "soma-ui/src/compiler/styling/state-variants.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "字段字典", "status": "implemented", "note": "字段字典:每个字段的键见 field 上下文" },
95
93
  { "id": "write.reload", "context": "write", "key": "reload", "order": 6, "surface": ["standard"], "value": { "kind": "list", "of": "string", "also": ["self", "all"] }, "default": null, "sample": { "value": "self" }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.reload" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "提交后重取", "lsp": { "detail": "提交成功后重取:self / all / 本页数据对象名列表" } },
96
94
  { "id": "write.version", "context": "write", "key": "version", "order": 3, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "rev", "root": { "from": [{ "api": "/api/orders" }], "fields": { "rev": { "type": "int" } }, "write": { "update": { "api": "/api/o/{no}", "method": "put" } } } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.version" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "乐观锁 / 白名单 / 改名", "lsp": { "detail": "乐观锁字段(必须在字典里,随请求体上行)" } },
97
95
  { "id": "field.rule.min_len", "context": "field.rule", "key": "min_len", "order": 3, "origin": "base", "surface": ["standard"], "value": { "kind": "int" }, "default": null, "sample": { "value": 2 }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.min_len" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/runtime/console-kit.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "最小长度", "status": "implemented" },
@@ -108,7 +106,7 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
108
106
  { "id": "page.envelope.params.max", "context": "page.envelope.params", "key": "max", "order": 4, "surface": ["standard"], "value": { "kind": "int" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.params.max" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkParamSpec" } } }], "docSummary": "int 上界" },
109
107
  { "id": "page.envelope.query.values", "context": "page.envelope.query", "key": "values", "order": 4, "surface": ["standard"], "value": { "kind": "list", "of": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.query.values" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkQuerySpec" } } }], "docSummary": "enum 候选(1–32 个)" },
110
108
  { "id": "page.envelope.nav.parent", "context": "page.envelope.nav", "key": "parent", "order": 4, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.nav.parent" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeNav" } } }], "docSummary": "导航高亮的父页精确地址" },
111
- { "id": "object.write", "context": "object", "key": "write", "order": 5, "origin": "base", "surface": ["standard"], "value": { "kind": "shape", "contains": "write" }, "default": null, "sample": { "value": { "update": { "api": "/api/o/{no}", "method": "put" } } }, "carry": { "transform": "ObjectWrite" }, "prop": "write", "authScan": [{ "path": ["create", "api"], "rank": 3 }, { "path": ["update", "api"], "rank": 4 }, { "path": ["delete", "api"], "rank": 5 }], "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.write" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/", "soma-ui/src/compiler/forms/verb-events.ts", "soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/page/region-scope.ts"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.write" }, { "stage": "facts", "prop": "SomaObjectFacts.canCreate" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/need/families/edit.ts"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.write" }, { "stage": "facts", "prop": "SomaObjectFacts.canUpdate" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/compose/families/edit.ts", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/need/families/edit.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "写通道", "violations": [{ "kind": "api-unregistered", "code": "ERR-BIZ-002" }], "status": "implemented" },
109
+ { "id": "object.write", "context": "object", "key": "write", "order": 4, "origin": "base", "surface": ["standard"], "value": { "kind": "shape", "contains": "write" }, "default": null, "sample": { "value": { "update": { "api": "/api/o/{no}", "method": "put" } } }, "carry": { "transform": "ObjectWrite" }, "prop": "write", "authScan": [{ "path": ["create", "api"], "rank": 3 }, { "path": ["update", "api"], "rank": 4 }, { "path": ["delete", "api"], "rank": 5 }], "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.write" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/", "soma-ui/src/compiler/forms/verb-events.ts", "soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/page/region-scope.ts"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.write" }, { "stage": "facts", "prop": "SomaObjectFacts.canCreate" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/need/families/edit.ts"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.write" }, { "stage": "facts", "prop": "SomaObjectFacts.canUpdate" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/compose/families/edit.ts", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/need/families/edit.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "写通道", "violations": [{ "kind": "api-unregistered", "code": "ERR-BIZ-002" }], "status": "implemented" },
112
110
  { "id": "write.only", "context": "write", "key": "only", "order": 5, "surface": ["standard"], "value": { "kind": "list", "of": "string" }, "default": null, "sample": { "value": ["title"], "root": { "from": [{ "api": "/api/orders" }], "fields": { "title": { "type": "text", "permission": "w" } }, "write": { "update": { "api": "/api/o/{no}", "method": "put" } } } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.only" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "乐观锁 / 白名单 / 改名", "lsp": { "detail": "请求体字段白名单(非空字段名列表)" } },
113
111
  { "id": "field.options", "context": "field", "key": "options", "order": 5, "origin": "base", "surface": ["standard"], "value": { "kind": "list", "of": "shape", "contains": "field.option" }, "default": null, "sample": { "value": [{ "key": "open", "label": "待处理", "class": "waiting" }], "with": { "type": "enum" } }, "carry": { "transform": "FieldOptions" }, "prop": "options", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.options" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/data-kit/"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.options" }, { "stage": "facts", "prop": "SomaFieldFact.options" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/settle/control-form.ts", "soma-ui/src/compiler/compose/families/", "soma-ui/src/compiler/need/", "soma-ui/src/compiler/need/families/", "soma-ui/src/compiler/styling/state-variants.ts"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.options" }, { "stage": "facts", "prop": "SomaFieldFact.optionCount" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/settle/control-form.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "枚举候选", "status": "implemented" },
114
112
  { "id": "field.rule.min", "context": "field.rule", "key": "min", "order": 5, "origin": "base", "surface": ["standard"], "value": { "kind": "number" }, "default": null, "sample": { "value": 0 }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.min" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/runtime/console-kit.ts", "soma-ui/src/shared/field-components.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "最小值", "status": "implemented" },
@@ -116,7 +114,6 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
116
114
  { "id": "page.envelope.params.max_len", "context": "page.envelope.params", "key": "max_len", "order": 5, "surface": ["standard"], "value": { "kind": "int", "min": 1, "max": 200 }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.params.max_len" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkParamSpec" } } }], "docSummary": "string / slug 最大长度" },
117
115
  { "id": "page.envelope.query.max_len", "context": "page.envelope.query", "key": "max_len", "order": 5, "surface": ["standard"], "value": { "kind": "int", "min": 1, "max": 200 }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.query.max_len" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkQuerySpec" } } }], "docSummary": "string / slug 最大长度" },
118
116
  { "id": "page.envelope.nav.items", "context": "page.envelope.nav", "key": "items", "order": 5, "surface": ["standard"], "value": { "kind": "list", "of": "shape" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.nav.items" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,导航项形状判据 navItemsProblem(core/shared/region-query.ts)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeNav" } } }], "docSummary": "导航项描述器 [{ key, text, href, active, forceIntoMore, children, divider, actions, priority, parent, access, available, requires, on_unavailable, route_to, requires_secrets, unavailable_reason }](C54:不可用分流 hide / grey,requires_secrets 点名外部密钥,route_to / unavailable_reason 只在 grey 时有意义)" },
119
- { "id": "object.predicates", "context": "object", "key": "predicates", "order": 6, "origin": "base", "surface": ["standard"], "value": { "kind": "map", "of": "shape" }, "default": null, "sample": { "value": { "vip": { "field": "level", "op": "eq", "value": "vip" } }, "root": { "from": [{ "api": "/api/orders" }], "fields": { "level": { "type": "text" } } } }, "carry": { "transform": "ObjectPredicates" }, "prop": "predicates", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.predicates" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/data-object-resolver.ts"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "具名条件", "status": "implemented", "note": "页内 objects: 不收(编译产物形态)" },
120
117
  { "id": "field.rule.max", "context": "field.rule", "key": "max", "order": 6, "origin": "base", "surface": ["standard"], "value": { "kind": "number" }, "default": null, "sample": { "value": 100 }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.max" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/runtime/console-kit.ts", "soma-ui/src/shared/field-components.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "最大值", "status": "implemented" },
121
118
  { "id": "page.envelope.nav", "context": "page.envelope", "key": "nav", "order": 6, "surface": ["standard"], "value": { "kind": "shape", "contains": "page.envelope.nav", "also": ["false"] }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.nav" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeNav" } } }], "docSummary": "导航(false,或 group / order / icon / parent)" },
122
119
  { "id": "page.envelope.params.values", "context": "page.envelope.params", "key": "values", "order": 6, "surface": ["standard"], "value": { "kind": "list", "of": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.params.values" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkParamSpec" } } }], "docSummary": "enum 候选(1–32 个)" },
@@ -126,24 +123,49 @@ export const SOMA_PIPELINE_STD_GRAMMAR = {
126
123
  { "id": "page.envelope.nav.list", "context": "page.envelope.nav", "key": "list", "order": 7, "surface": ["standard"], "value": { "kind": "any" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.nav.list" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);形状判据 listUrlDiagnostics(core/shared/list-origin.ts),来源还原见 parseListUrl", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeNav" } } }], "docSummary": "来源列表声明(list.url: prefix / keys / staticFilters)" },
127
124
  { "id": "field.rule.message", "context": "field.rule", "key": "message", "order": 8, "origin": "base", "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "提示", "with": { "max_len": 20 } }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.message" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/runtime/console-kit.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "校验失败提示", "status": "implemented" },
128
125
  { "id": "page.envelope.frame", "context": "page.envelope", "key": "frame", "order": 8, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.frame" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeFrame" } } }], "docSummary": "逻辑外壳名(或 none)" },
129
- { "id": "write.delete", "context": "write", "key": "delete", "order": 9, "surface": ["standard"], "value": { "kind": "shape", "shape": "delete-endpoint" }, "default": null, "sample": { "value": { "api": "/api/o/{no}" } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.delete" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "删除端点(DELETE,不带请求体)", "lsp": { "detail": "删除端点 { api, method?: DELETE },不带请求体" } },
130
- { "id": "field.rule.when", "context": "field.rule", "key": "when", "order": 9, "origin": "extra", "surface": ["standard"], "value": { "kind": "shape", "shape": "predicate" }, "default": null, "sample": { "value": { "field": "g", "op": "eq", "value": true }, "with": { "required": true }, "root": { "from": [{ "api": "/api/orders" }], "fields": { "g": { "type": "bool" }, "f": { "type": "int", "rules": [{ "message": "提示" }] } } } }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.when" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/validation/field-rules.ts", "soma-core/core/client/parser/data-config-parser.ts"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "条件规则(谓词成立才参与)", "status": "implemented" },
126
+ { "id": "write.delete", "context": "write", "key": "delete", "order": 7, "surface": ["standard"], "value": { "kind": "shape", "shape": "delete-endpoint" }, "default": null, "sample": { "value": { "api": "/api/o/{no}" } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.delete" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "删除端点(DELETE,不带请求体)", "lsp": { "detail": "删除端点 { api, method?: DELETE },不带请求体" } },
131
127
  { "id": "page.envelope.locale", "context": "page.envelope", "key": "locale", "order": 9, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.locale" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeLocale" } } }], "docSummary": "本页字面量所用语言(BCP 47)" },
132
- { "id": "write.validate_on", "context": "write", "key": "validate_on", "order": 10, "surface": ["standard"], "value": { "kind": "list", "of": "string", "domain": "validate-triggers" }, "default": null, "sample": { "value": ["blur", "submit"] }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.validate_on" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "校验时机 / 离开守卫", "lsp": { "detail": "校验时机:change / blur / submit 的非空无重复列表" } },
133
- { "id": "write.failWhen", "context": "write", "key": "failWhen", "order": 19, "surface": ["standard"], "value": { "kind": "map" }, "default": null, "sample": { "value": { "field": "success", "op": "eq", "value": false }, "root": { "from": [{ "api": "/api/orders" }], "fields": { "title": { "type": "text", "permission": "w" } }, "write": { "update": { "api": "/api/o/{no}", "method": "put" } } } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.failWhen" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "响应信封失败判定", "lsp": { "detail": "HTTP 成功但响应体命中此闭集谓词即按失败落账(字段是响应体顶层键,深取用 path);core 不预设后端字段约定" } },
134
- { "id": "write.messagePath", "context": "write", "key": "messagePath", "order": 20, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "message", "root": { "from": [{ "api": "/api/orders" }], "fields": { "title": { "type": "text", "permission": "w" } }, "write": { "update": { "api": "/api/o/{no}", "method": "put" }, "failWhen": { "field": "success", "op": "eq", "value": false } } } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.messagePath" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "响应信封失败信息路径", "lsp": { "detail": "命中 failWhen 时业务错误信息在响应体里的点路径" } },
135
- { "id": "write.timeoutMs", "context": "write", "key": "timeoutMs", "order": 21, "surface": ["standard"], "value": { "kind": "int", "min": 1000, "max": 600000, "unit": "毫秒" }, "default": null, "sample": { "value": 120000, "root": { "from": [{ "api": "/api/orders" }], "fields": { "title": { "type": "text", "permission": "w" } }, "write": { "update": { "api": "/api/o/{no}", "method": "put" } } } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.timeoutMs" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "写请求超时(毫秒)", "lsp": { "detail": "本写通道各端点(create / update / delete)单次请求的超时毫秒数,1000..600000 的整数;不写 = 沿用 Host http 服务的缺省超时。用于耗时长的后端调用,超时按网络失败落账" } },
136
- { "id": "field.rule.async", "context": "field.rule", "key": "async", "order": 10, "origin": "extra", "surface": ["standard"], "value": { "kind": "any" }, "default": null, "sample": { "value": { "check": "order_no_free", "on_error": "pass" } }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.async" }], "terminal": { "kind": "validate-only", "why": "async 规则由 parseAsyncRule 核形状(检查器名 / { check, on_error? },闭集外键拒收)并携带;合并规则与防抖在 client/validation/async-rules.ts,检查器由应用注册(R-22 / R-23)", "check": { "file": "soma-core/core/client/parser/data-config-parser.ts", "contains": "function parseAsyncRule" } } }], "status": "implemented", "docSummary": "异步校验位(向服务端查重)", "lsp": { "detail": "异步校验 检查器名 | { check, on_error: pass | block }" } },
128
+ { "id": "write.validate_on", "context": "write", "key": "validate_on", "order": 8, "surface": ["standard"], "value": { "kind": "list", "of": "string", "domain": "validate-triggers" }, "default": null, "sample": { "value": ["blur", "submit"] }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.validate_on" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "校验时机 / 离开守卫", "lsp": { "detail": "校验时机:change / blur / submit 的非空无重复列表" } },
129
+ { "id": "write.failWhen", "context": "write", "key": "failWhen", "order": 17, "surface": ["standard"], "value": { "kind": "map" }, "default": null, "sample": { "value": { "field": "success", "op": "eq", "value": false }, "root": { "from": [{ "api": "/api/orders" }], "fields": { "title": { "type": "text", "permission": "w" } }, "write": { "update": { "api": "/api/o/{no}", "method": "put" } } } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.failWhen" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "响应信封失败判定", "lsp": { "detail": "HTTP 成功但响应体命中此闭集谓词即按失败落账(字段是响应体顶层键,深取用 path);core 不预设后端字段约定" } },
130
+ { "id": "write.messagePath", "context": "write", "key": "messagePath", "order": 18, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "message", "root": { "from": [{ "api": "/api/orders" }], "fields": { "title": { "type": "text", "permission": "w" } }, "write": { "update": { "api": "/api/o/{no}", "method": "put" }, "failWhen": { "field": "success", "op": "eq", "value": false } } } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.messagePath" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "响应信封失败信息路径", "lsp": { "detail": "命中 failWhen 时业务错误信息在响应体里的点路径" } },
131
+ { "id": "write.timeoutMs", "context": "write", "key": "timeoutMs", "order": 19, "surface": ["standard"], "value": { "kind": "int", "min": 1000, "max": 600000, "unit": "毫秒" }, "default": null, "sample": { "value": 120000, "root": { "from": [{ "api": "/api/orders" }], "fields": { "title": { "type": "text", "permission": "w" } }, "write": { "update": { "api": "/api/o/{no}", "method": "put" } } } }, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataWriteConfig.timeoutMs" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "写请求超时(毫秒)", "lsp": { "detail": "本写通道各端点(create / update / delete)单次请求的超时毫秒数,1000..600000 的整数;不写 = 沿用 Host http 服务的缺省超时。用于耗时长的后端调用,超时按网络失败落账" } },
132
+ { "id": "field.rule.async", "context": "field.rule", "key": "async", "order": 9, "origin": "extra", "surface": ["standard"], "value": { "kind": "any" }, "default": null, "sample": { "value": { "check": "order_no_free", "on_error": "pass" } }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.async" }], "terminal": { "kind": "validate-only", "why": "async 规则由 parseAsyncRule 核形状(检查器名 / { check, on_error? },闭集外键拒收)并携带;合并规则与防抖在 client/validation/async-rules.ts,检查器由应用注册(R-22 / R-23)", "check": { "file": "soma-core/core/client/parser/data-config-parser.ts", "contains": "function parseAsyncRule" } } }], "status": "implemented", "docSummary": "异步校验位(向服务端查重)", "lsp": { "detail": "异步校验 检查器名 | { check, on_error: pass | block }" } },
137
133
  { "id": "page.envelope.meta", "context": "page.envelope", "key": "meta", "order": 10, "surface": ["standard"], "value": { "kind": "shape", "contains": "page.envelope.meta" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.meta" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeMeta" } } }], "docSummary": "页面元信息(description / tags)" },
138
- { "id": "field.rule.severity", "context": "field.rule", "key": "severity", "order": 11, "origin": "base", "surface": ["standard"], "value": { "kind": "enum", "domain": "validation-severities" }, "default": null, "sample": { "value": "hint", "with": { "required": true } }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.severity" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/validation/field-rules.ts", "soma-core/core/client/validation/soft-once.ts"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "校验强度(hard / soft-once / hint / discourage)", "violations": [{ "kind": "severity-declaration", "code": "CORE-OBJ-DECLARATION-INVALID" }], "status": "implemented" },
134
+ { "id": "field.rule.severity", "context": "field.rule", "key": "severity", "order": 10, "origin": "base", "surface": ["standard"], "value": { "kind": "enum", "domain": "validation-severities" }, "default": null, "sample": { "value": "hint", "with": { "required": true } }, "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldRule.severity" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/validation/field-rules.ts", "soma-core/core/client/validation/soft-once.ts"] } }], "effect": { "changes": ["runtime"] }, "docSummary": "校验强度(hard / soft-once / hint / discourage)", "violations": [{ "kind": "severity-declaration", "code": "CORE-OBJ-DECLARATION-INVALID" }], "status": "implemented" },
139
135
  { "id": "page.envelope.version", "context": "page.envelope", "key": "version", "order": 11, "surface": ["standard"], "value": { "kind": "string" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.version" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeVersion" } } }], "docSummary": "作者修订标签" },
140
136
  { "id": "page.envelope.source", "context": "page.envelope", "key": "source", "order": 12, "surface": ["standard"], "value": { "kind": "shape", "contains": "page.envelope.source" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.source" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeSource" } } }], "docSummary": "来源盖章(format / author)" },
141
- { "id": "object.name", "context": "object", "key": "name", "order": 13, "origin": "extra", "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "订单" }, "carry": { "transform": "ObjectName" }, "prop": "displayName", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.displayName" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/compose/families/inspect.ts"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.displayName" }, { "stage": "facts", "prop": "SomaObjectFacts.displayName" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/need/families/browse.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "显示名", "status": "implemented", "note": "解析产物里叫 displayName:config.name 是对象键名" },
137
+ { "id": "object.name", "context": "object", "key": "name", "order": 10, "origin": "extra", "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "订单" }, "carry": { "transform": "ObjectName" }, "prop": "displayName", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.displayName" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/compose/families/inspect.ts"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.displayName" }, { "stage": "facts", "prop": "SomaObjectFacts.displayName" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/need/families/browse.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "显示名", "status": "implemented", "note": "解析产物里叫 displayName:config.name 是对象键名" },
142
138
  { "id": "page.envelope.lifecycle", "context": "page.envelope", "key": "lifecycle", "order": 13, "surface": ["standard"], "value": { "kind": "shape", "contains": "page.envelope.lifecycle" }, "default": null, "status": "implemented", "carriesTo": [{ "path": [{ "stage": "page-block", "name": "envelope.lifecycle" }], "terminal": { "kind": "validate-only", "why": "信封由 core/shared/page-envelope.ts 判定(闭集、取值、写面);进入标准格式后原样携带,运行期消费见地址绑定与访问门(E2–E4)", "check": { "file": "soma-core/core/shared/page-envelope.ts", "contains": "checkEnvelopeLifecycle" } } }], "docSummary": "生命周期(persist / expires / warm)" },
143
- { "id": "object.poll", "context": "object", "key": "poll", "order": 20, "origin": "extra", "surface": ["standard"], "value": { "kind": "shape", "contains": "poll" }, "default": null, "sample": { "value": { "every": 5, "while": { "field": "status", "in": ["running"] } }, "root": { "from": [{ "api": "/api/orders" }], "fields": { "status": { "type": "enum", "options": [{ "key": "running", "label": "运行中", "class": "active" }] } }, "roles": { "status": "status" } } }, "carry": { "transform": "ObjectPoll" }, "prop": "poll", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.poll" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/parser/data-config-parser.ts", "soma-ui/src/compiler/driver/data-facts.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "自动重取", "status": "implemented" },
144
- { "id": "field.calc", "context": "field", "key": "calc", "order": 6, "origin": "base", "surface": ["standard"], "value": { "kind": "string" }, "default": null, "sample": { "value": "[revenue] - [cost]", "root": { "from": [{ "api": "/api/orders" }], "fields": { "revenue": { "type": "money" }, "cost": { "type": "money" }, "f": { "type": "money" } } } }, "carry": "passthrough", "prop": "calc", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.calc" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/data/", "soma-ui/src/compiler/certify/invariants/edit.ts", "soma-ui/src/compiler/page/region-scope.ts", "soma-ui/src/data-kit/"] } }, { "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.calc" }, { "stage": "facts", "prop": "SomaFieldFact.derived" }], "terminal": { "kind": "consumed", "readers": ["soma-ui/src/compiler/need/object-facts.ts", "soma-ui/src/compiler/settle/style.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "派生", "status": "implemented" },
145
- { "id": "field.default", "context": "field", "key": "default", "order": 29, "origin": "extra", "surface": ["standard"], "value": { "kind": "any" }, "default": null, "sample": { "value": "open", "with": { "type": "text", "permission": "w" } }, "carry": { "transform": "FieldDefault" }, "prop": "default", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.default" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/validation/form-draft.ts", "soma-core/core/client/data/data-object-resolver.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "新建初值", "status": "implemented" }
139
+ { "id": "object.poll", "context": "object", "key": "poll", "order": 17, "origin": "extra", "surface": ["standard"], "value": { "kind": "shape", "contains": "poll" }, "default": null, "sample": { "value": { "every": 5, "while": { "field": "status", "in": ["running"] } }, "root": { "from": [{ "api": "/api/orders" }], "fields": { "status": { "type": "enum", "options": [{ "key": "running", "label": "运行中", "class": "active" }] } }, "roles": { "status": "status" } } }, "carry": { "transform": "ObjectPoll" }, "prop": "poll", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataObjectConfig.poll" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/parser/data-config-parser.ts", "soma-ui/src/compiler/driver/data-facts.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "自动重取", "status": "implemented" },
140
+ { "id": "field.default", "context": "field", "key": "default", "order": 26, "origin": "extra", "surface": ["standard"], "value": { "kind": "any" }, "default": null, "sample": { "value": "open", "with": { "type": "text", "permission": "w" } }, "carry": { "transform": "FieldDefault" }, "prop": "default", "carriesTo": [{ "path": [{ "stage": "core-config", "prop": "SomaDataFieldConfig.default" }], "terminal": { "kind": "consumed", "readers": ["soma-core/core/client/validation/form-draft.ts", "soma-core/core/client/data/data-object-resolver.ts"] } }], "effect": { "changes": ["artifact"] }, "docSummary": "新建初值", "status": "implemented" }
146
141
  ],
142
+ "pageForbiddenLogicKeys": {
143
+ "title": "视觉页面不含逻辑语法:页面语法里禁止出现的逻辑键(三层分工:业务逻辑归业务对象,交互逻辑归展示对象,页面只做纯视觉翻译;见 knowledge/SOMA领域建模与组件编写准则.md §1.0)",
144
+ "decidedAt": "2026-11-09",
145
+ "keys": [
146
+ { "key": "calc", "was": "core 字段计算" },
147
+ { "key": "derive", "was": "foundation 字段级派生(K19)/ kit derive 模板" },
148
+ { "key": "derived", "was": "页面声明里的派生写法" },
149
+ { "key": "showWhen", "was": "条件显示" },
150
+ { "key": "hiddenWhen", "was": "条件隐藏" },
151
+ { "key": "disabledWhen", "was": "条件禁用" },
152
+ { "key": "requiredWhen", "was": "条件必填" },
153
+ { "key": "when", "was": "动作 when 条件 / show when 对象谓词 { field, op, value } / rules[].when 条件规则(纯路径字符串形 when 是纯绑定,放行)", "forbiddenShape": "object" },
154
+ { "key": "predicates", "scope": "standard", "was": "data.<对象>.predicates 具名谓词" },
155
+ { "key": "transform", "scope": "standard", "was": "data.<对象>.transform 取数后派生字段" },
156
+ { "key": "steps", "scope": "standard", "was": "_event 事件编排(when / switch / for_each / goto)" },
157
+ { "key": "triggers", "scope": "standard", "was": "_event triggers 条件触发器(condition + value)" },
158
+ { "key": "switch", "scope": "standard", "was": "_event steps 内 switch 条件分支" },
159
+ { "key": "for_each", "scope": "standard", "was": "_event steps 内 for_each 循环" },
160
+ { "key": "parallel", "scope": "standard", "was": "_event steps 内 parallel 并行编排" }
161
+ ],
162
+ "pureBinding": { "title": "展示对象的值对页面只读:页面只做纯路径读取,不在页面里取反、比较、映射;需要判断的地方由展示对象直接给最终值(2026-11-10 裁决)", "negatedPath": { "code": "CORE-PAGE-NEGATE-FORBIDDEN", "prefix": "!", "positions": ["show.when", "show.class 值", "show.props 值", "嵌套绑定 when"], "pathPattern": "^!\\s*[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)+\\s*$", "was": "`!path` 取反前缀(when / class 条件路径 / 组件 props 值)", "remedy": "由展示对象另给相反的成员(如 remarkHidden),页面绑定它" }, "styleComparison": { "code": "CORE-STYLE-COMPARE-FORBIDDEN", "keys": ["condition", "value"], "positions": ["_style states 条目", "_style transitions.active_state"], "was": "_style states 的 `condition: 路径` + `value` 比较 + `apply`,以及 transitions.active_state 的 condition + value", "remedy": "改写成类名档位绑定:`bind: page.成员` + `tiers: { 档位名: 类名 }`,成员的值就是档位名" }, "styleTier": { "keys": ["bind", "tiers"], "tierNamePattern": "^[a-z][a-z0-9_-]*$", "maxTiers": 8, "positions": ["_style states.<锚点>", "_style transitions.<锚点>(trigger: active_state)"], "note": "bind 是纯路径(点分标识符,无取反 / 管道 / 运算符);tiers 是 档位名 到 类名串 的闭集映射,成员值不在档位内时不加任何类;档位名闭集 pattern 与个数上限读本节,页面不写比较" }, "roleBy": { "code": "CORE-PAGE-ROLE-BY-INVALID", "pathPattern": "^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*)*$", "positions": ["bind.role_by"], "was": "bind.role_by 写了表达式 / 取反 / 管道 / 映射", "remedy": "role_by 只许纯路径:行字段的值直接作为模板名,匹配 data-soma-role=\"item:取值\";行数据自带模板名" } },
163
+ "exemptContexts": ["diagnostics", "diagnosticExamples", "rejected", "title", "basis", "was", "summary", "docSummary"],
164
+ "exampleRoots": ["soma-kit-demo/pages", "soma-kit/examples", "soma-ui/tests/fixtures/hosts", "soma-core-demo/ui", "soma-core-demo/pages"],
165
+ "exampleFilePatterns": ["_ui.yaml", ".kit.yaml", "_style.yaml"],
166
+ "exampleSkipDirs": ["node_modules", "negative", "__negative__"],
167
+ "note": "forbiddenShape: 'object' = 只禁对象 / 列表形,值为字符串(纯路径绑定)放行;scope: 'standard' = 只在 core 标准格式(四件套 / 注入口)判定,不进 G83 的跨方言语法源与示例页扫描(方言同名键含义不同,如 steps 页面模式)"
168
+ },
147
169
  "views": [
148
170
  { "name": "SOMA_DATA_OBJECT_KEYS", "kind": "keys", "context": "object", "type": "strings", "reconcilesWith": "soma-core/core/client/parser/data-config-parser.ts#SOMA_DATA_OBJECT_KEYS" },
149
171
  { "name": "SOMA_DATA_FIELD_KEYS", "kind": "keys", "context": "field", "type": "strings", "reconcilesWith": "soma-core/core/client/parser/data-config-parser.ts#SOMA_DATA_FIELD_KEYS" },
@@ -0,0 +1,36 @@
1
+ // SOMA 受控错误的公共基类(两端共用,无任何内部依赖)。
2
+ //
3
+ // 只给「带码的 SOMA 错误」一个统一的判断与读码方式;不统一码的命名空间,
4
+ // 不改错误响应体形状。基类自身不往实例写任何属性:`code` 由子类照旧声明与赋值,
5
+ // 这里只在类型上声明它(`declare` 不产生运行时字段),所以子类的可枚举属性集合不变。
6
+ // `code` 声明为可选:个别子类的码只在特定拒收时才有。
7
+
8
+ export class SomaError extends Error {
9
+ /**
10
+ * 错误码;由子类声明并赋值,基类不写入。
11
+ * 绝大多数子类用字符串码;注册中心错误(`RegistryError`)沿用 45xx 数字码,故类型放宽到 `string | number`,
12
+ * 子类可收窄为 `string` 或 `number`。读码的统一口径 `somaErrorCodeOf` 仍只认非空字符串(数字码读不出、不会被误当字符串码)。
13
+ */
14
+ declare readonly code?: string | number;
15
+
16
+ constructor(message?: string, options?: { cause?: unknown }) {
17
+ super(message, options);
18
+ }
19
+ }
20
+
21
+ /** 结构口径:是 Error 且 `code` 为非空字符串(兼容跨打包副本、同口径于 `(error as { code?: unknown })?.code`) */
22
+ function hasStringCode(value: unknown): value is Error & { code: string } {
23
+ if (!(value instanceof Error)) return false;
24
+ const code = (value as { code?: unknown }).code;
25
+ return typeof code === 'string' && code !== '';
26
+ }
27
+
28
+ /** 是否 SOMA 受控错误:`instanceof SomaError`,或(跨打包副本时)Error 且带非空字符串码 */
29
+ export function isSomaError(value: unknown): value is SomaError {
30
+ return value instanceof SomaError || hasStringCode(value);
31
+ }
32
+
33
+ /** 读出错误码;不是 Error 或没有非空字符串码时返回 undefined */
34
+ export function somaErrorCodeOf(value: unknown): string | undefined {
35
+ return hasStringCode(value) ? value.code : undefined;
36
+ }
@@ -1,6 +1,6 @@
1
1
  // 编译用途与页面生成资产来源的类型(06b KC15;06e §2.10 / AD-CORE-04 / AD-CORE-21)。
2
2
  //
3
- // core 不持有编译器端口:方言(soma-ui / soma-lite)在运行期把自己的页面编译成标准格式,再按 URL 注入 core。
3
+ // core 不持有编译器端口:方言(soma-ui / soma-kit)在运行期把自己的页面编译成标准格式,再按 URL 注入 core。
4
4
  // 这里只剩 core 自己用得上的几个形状。
5
5
  //
6
6
  // 为什么只放类型:本文件住 shared,无 DOM、无 Node 专属 API、不 import core 其他运行代码(KI-8 规则 1)。