@astrale-os/kernel-dsl 1.0.0-beta.3 → 1.0.0-beta.30

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 (413) hide show
  1. package/dist/v1/addressing/class-key.js +3 -3
  2. package/dist/v1/addressing/definition-ref.js +21 -37
  3. package/dist/v1/addressing/domain-dependency.d.ts +0 -6
  4. package/dist/v1/addressing/domain-dependency.js +1 -6
  5. package/dist/v1/addressing/key.d.ts +4 -1
  6. package/dist/v1/addressing/key.js +23 -3
  7. package/dist/v1/addressing/ordering.d.ts +2 -0
  8. package/dist/v1/addressing/ordering.js +2 -0
  9. package/dist/v1/addressing/patterns.d.ts +1 -1
  10. package/dist/v1/addressing/patterns.js +2 -6
  11. package/dist/v1/builder/callable/authoring.d.ts +11 -5
  12. package/dist/v1/builder/callable/authoring.js +2 -0
  13. package/dist/v1/builder/class/authoring.d.ts +94 -224
  14. package/dist/v1/builder/class/authoring.js +30 -35
  15. package/dist/v1/builder/class/handle.d.ts +27 -0
  16. package/dist/v1/builder/class/handle.js +1 -0
  17. package/dist/v1/builder/class/input.d.ts +159 -0
  18. package/dist/v1/builder/class/projection.d.ts +129 -0
  19. package/dist/v1/builder/class/projection.js +1 -0
  20. package/dist/v1/builder/class/property.d.ts +3 -9
  21. package/dist/v1/builder/class/property.js +1 -0
  22. package/dist/v1/builder/core/authoring.d.ts +1 -1
  23. package/dist/v1/builder/index.d.ts +10 -2
  24. package/dist/v1/builder/index.js +2 -0
  25. package/dist/v1/builder/lowering/callable.js +1 -0
  26. package/dist/v1/builder/lowering/class.d.ts +9 -1
  27. package/dist/v1/builder/lowering/class.js +62 -17
  28. package/dist/v1/builder/lowering/policy.js +6 -24
  29. package/dist/v1/builder/lowering/property-keys.d.ts +27 -0
  30. package/dist/v1/builder/lowering/property-keys.js +108 -0
  31. package/dist/v1/builder/lowering/schema/compile.js +13 -6
  32. package/dist/v1/builder/lowering/schema/context.d.ts +9 -1
  33. package/dist/v1/builder/lowering/schema/context.js +36 -7
  34. package/dist/v1/builder/lowering/schema/lifetime.d.ts +11 -0
  35. package/dist/v1/builder/lowering/schema/lifetime.js +55 -0
  36. package/dist/v1/builder/lowering/value/compile.js +29 -22
  37. package/dist/v1/builder/lowering/value/file.d.ts +7 -0
  38. package/dist/v1/builder/lowering/value/file.js +14 -0
  39. package/dist/v1/builder/lowering/value/path.d.ts +1 -1
  40. package/dist/v1/builder/lowering/value/path.js +2 -4
  41. package/dist/v1/builder/lowering/value/zod.js +41 -7
  42. package/dist/v1/builder/policy/authoring.d.ts +80 -9
  43. package/dist/v1/builder/policy/authoring.js +99 -68
  44. package/dist/v1/builder/policy/legacy/edge.d.ts +28 -0
  45. package/dist/v1/builder/policy/legacy/edge.js +16 -0
  46. package/dist/v1/builder/schema/define.d.ts +0 -1
  47. package/dist/v1/builder/schema/diagnostic.d.ts +3 -2
  48. package/dist/v1/builder/schema/diagnostic.js +5 -10
  49. package/dist/v1/builder/schema/input.d.ts +4 -1
  50. package/dist/v1/builder/schema/projection/callable.d.ts +7 -5
  51. package/dist/v1/builder/schema/projection/class.d.ts +78 -16
  52. package/dist/v1/builder/schema/projection/core-input.d.ts +2 -1
  53. package/dist/v1/builder/schema/projection/domain.d.ts +13 -2
  54. package/dist/v1/builder/schema/projection/identity.d.ts +74 -9
  55. package/dist/v1/builder/schema/projection/model.d.ts +4 -2
  56. package/dist/v1/builder/schema/projection/property.d.ts +38 -4
  57. package/dist/v1/builder/schema/projection/resolved-class.d.ts +5 -4
  58. package/dist/v1/builder/schema/projection.d.ts +1 -1
  59. package/dist/v1/builder/schema/rule.d.ts +316 -0
  60. package/dist/v1/builder/schema/rule.js +192 -0
  61. package/dist/v1/builder/value/file.d.ts +34 -0
  62. package/dist/v1/builder/value/file.js +77 -0
  63. package/dist/v1/builder/value/full-match.d.ts +0 -1
  64. package/dist/v1/builder/value/full-match.js +0 -1
  65. package/dist/v1/builder/value/path-metadata.d.ts +1 -1
  66. package/dist/v1/builder/value/path.d.ts +1 -1
  67. package/dist/v1/bundle/codec.js +55 -74
  68. package/dist/v1/bundle/diagnostic.d.ts +3 -1
  69. package/dist/v1/bundle/diagnostic.js +9 -7
  70. package/dist/v1/bundle/index.d.ts +2 -0
  71. package/dist/v1/bundle/index.js +1 -0
  72. package/dist/v1/bundle/model.js +1 -1
  73. package/dist/v1/bundle/rule.d.ts +14 -0
  74. package/dist/v1/bundle/rule.js +41 -0
  75. package/dist/v1/bundle/structure.js +6 -8
  76. package/dist/v1/compiled/admission/accept.js +9 -15
  77. package/dist/v1/compiled/admission/closure.js +17 -34
  78. package/dist/v1/compiled/admission/diagnostic.d.ts +23 -1
  79. package/dist/v1/compiled/admission/diagnostic.js +40 -3
  80. package/dist/v1/compiled/admission/revision.d.ts +9 -1
  81. package/dist/v1/compiled/admission/revision.js +7 -3
  82. package/dist/v1/compiled/admission/semantics/class.d.ts +4 -1
  83. package/dist/v1/compiled/admission/semantics/class.js +48 -19
  84. package/dist/v1/compiled/admission/semantics/core.d.ts +1 -24
  85. package/dist/v1/compiled/admission/semantics/core.js +56 -24
  86. package/dist/v1/compiled/admission/semantics/edge.d.ts +2 -4
  87. package/dist/v1/compiled/admission/semantics/edge.js +6 -65
  88. package/dist/v1/compiled/admission/semantics/policy/admit.js +4 -19
  89. package/dist/v1/compiled/admission/semantics/policy/callable.js +2 -5
  90. package/dist/v1/compiled/admission/semantics/policy/contracts.d.ts +5 -20
  91. package/dist/v1/compiled/admission/semantics/policy/contracts.js +8 -21
  92. package/dist/v1/compiled/admission/semantics/policy/parity.js +44 -53
  93. package/dist/v1/compiled/admission/semantics/policy/pattern.d.ts +4 -1
  94. package/dist/v1/compiled/admission/semantics/policy/pattern.js +7 -21
  95. package/dist/v1/compiled/admission/semantics/policy/typing.d.ts +2 -24
  96. package/dist/v1/compiled/admission/semantics/policy/typing.js +19 -201
  97. package/dist/v1/compiled/admission/wire/callable.d.ts +5 -2
  98. package/dist/v1/compiled/admission/wire/callable.js +24 -20
  99. package/dist/v1/compiled/admission/wire/class.js +79 -30
  100. package/dist/v1/compiled/admission/wire/entry.d.ts +1 -1
  101. package/dist/v1/compiled/admission/wire/entry.js +36 -13
  102. package/dist/v1/compiled/admission/wire/policy.d.ts +4 -3
  103. package/dist/v1/compiled/admission/wire/policy.js +27 -20
  104. package/dist/v1/compiled/admission/wire/program.d.ts +13 -3
  105. package/dist/v1/compiled/admission/wire/program.js +39 -44
  106. package/dist/v1/compiled/admission/wire/property.d.ts +4 -1
  107. package/dist/v1/compiled/admission/wire/property.js +8 -5
  108. package/dist/v1/compiled/admission/wire/value.d.ts +0 -2
  109. package/dist/v1/compiled/admission/wire/value.js +0 -7
  110. package/dist/v1/compiled/codec/json.js +4 -3
  111. package/dist/v1/compiled/compiler/compile.js +15 -33
  112. package/dist/v1/compiled/diagnostic.d.ts +1 -1
  113. package/dist/v1/compiled/diagnostic.js +2 -3
  114. package/dist/v1/compiled/index.d.ts +2 -0
  115. package/dist/v1/compiled/index.js +1 -0
  116. package/dist/v1/compiled/loader/load.d.ts +3 -2
  117. package/dist/v1/compiled/loader/load.js +12 -51
  118. package/dist/v1/compiled/model/schema.d.ts +3 -0
  119. package/dist/v1/compiled/rule.d.ts +49 -0
  120. package/dist/v1/compiled/rule.js +169 -0
  121. package/dist/v1/domain/create.js +9 -10
  122. package/dist/v1/domain/model/domain.d.ts +2 -7
  123. package/dist/v1/domain/model/input.d.ts +15 -10
  124. package/dist/v1/domain/namespace/member-collection.js +8 -7
  125. package/dist/v1/domain/projection/classes.js +11 -8
  126. package/dist/v1/domain/validation/create.d.ts +7 -16
  127. package/dist/v1/domain/validation/create.js +35 -81
  128. package/dist/v1/index.d.ts +5 -3
  129. package/dist/v1/index.js +1 -1
  130. package/dist/v1/language/.spec/schemas/draft-2020-12.schema.json +462 -0
  131. package/dist/v1/language/.spec/schemas/value-schema.schema.json +23 -0
  132. package/dist/v1/language/callable/admission.d.ts +15 -0
  133. package/dist/v1/language/callable/admission.js +44 -0
  134. package/dist/v1/language/callable/model/callable.d.ts +10 -0
  135. package/dist/v1/language/callable/resolved.d.ts +16 -3
  136. package/dist/v1/language/chain.d.ts +7 -0
  137. package/dist/v1/language/chain.js +24 -0
  138. package/dist/v1/language/class/inheritance.d.ts +36 -5
  139. package/dist/v1/language/class/inheritance.js +85 -1
  140. package/dist/v1/language/class/lifetime.d.ts +50 -11
  141. package/dist/v1/language/class/lifetime.js +89 -20
  142. package/dist/v1/language/class/model/class.d.ts +45 -9
  143. package/dist/v1/language/class/model/edge.d.ts +31 -2
  144. package/dist/v1/language/class/model/property.d.ts +16 -7
  145. package/dist/v1/language/class/property-values.js +2 -4
  146. package/dist/v1/language/class/resolved.d.ts +9 -4
  147. package/dist/v1/language/class/unique.d.ts +143 -0
  148. package/dist/v1/language/class/unique.js +264 -0
  149. package/dist/v1/language/core/facts.d.ts +85 -0
  150. package/dist/v1/language/core/facts.js +116 -0
  151. package/dist/v1/language/cycle.d.ts +10 -0
  152. package/dist/v1/language/cycle.js +30 -0
  153. package/dist/v1/language/definition/metadata.d.ts +38 -0
  154. package/dist/v1/language/definition/metadata.js +51 -0
  155. package/dist/v1/language/freeze.d.ts +5 -0
  156. package/dist/v1/{schema/canonical → language}/freeze.js +4 -0
  157. package/dist/v1/language/index.d.ts +7 -2
  158. package/dist/v1/language/index.js +5 -1
  159. package/dist/v1/language/limits.d.ts +83 -0
  160. package/dist/v1/language/limits.js +77 -0
  161. package/dist/v1/language/policy/analysis/branches.d.ts +8 -0
  162. package/dist/v1/language/policy/analysis/branches.js +8 -8
  163. package/dist/v1/language/policy/analysis/budgets.d.ts +45 -12
  164. package/dist/v1/language/policy/analysis/budgets.js +140 -20
  165. package/dist/v1/language/policy/analysis/checks.js +8 -6
  166. package/dist/v1/language/policy/analysis/composition.d.ts +4 -0
  167. package/dist/v1/language/policy/analysis/composition.js +11 -0
  168. package/dist/v1/language/policy/analysis/typing.d.ts +51 -0
  169. package/dist/v1/language/policy/analysis/typing.js +456 -0
  170. package/dist/v1/language/policy/model/policy.d.ts +71 -9
  171. package/dist/v1/language/policy/model/policy.js +42 -4
  172. package/dist/v1/language/policy/normalization/normalize.d.ts +6 -6
  173. package/dist/v1/language/policy/normalization/normalize.js +46 -68
  174. package/dist/v1/language/suspended.d.ts +7 -0
  175. package/dist/v1/language/suspended.js +23 -0
  176. package/dist/v1/language/validation/diagnostic.d.ts +15 -1
  177. package/dist/v1/language/validation/diagnostic.js +21 -0
  178. package/dist/v1/language/validation/rule.d.ts +45 -0
  179. package/dist/v1/language/validation/rule.js +109 -0
  180. package/dist/v1/language/value/compile/fields.js +16 -16
  181. package/dist/v1/language/value/compile/load.d.ts +5 -0
  182. package/dist/v1/language/value/compile/load.js +13 -0
  183. package/dist/v1/language/value/evaluate/assertions.d.ts +5 -1
  184. package/dist/v1/language/value/evaluate/assertions.js +19 -8
  185. package/dist/v1/language/value/evaluate/evaluator.js +117 -120
  186. package/dist/v1/language/value/evaluate/preparation.d.ts +16 -0
  187. package/dist/v1/language/value/evaluate/preparation.js +100 -47
  188. package/dist/v1/language/value/evaluate/program.d.ts +2 -1
  189. package/dist/v1/language/value/evaluate/program.js +6 -6
  190. package/dist/v1/language/value/evaluate/validate.d.ts +3 -3
  191. package/dist/v1/language/value/evaluate/validate.js +14 -10
  192. package/dist/v1/language/value/evaluate/validity.optimization.d.ts +14 -0
  193. package/dist/v1/language/value/evaluate/validity.optimization.js +338 -0
  194. package/dist/v1/language/value/files.d.ts +44 -0
  195. package/dist/v1/language/value/files.js +151 -0
  196. package/dist/v1/language/value/inclusion/arrays.d.ts +3 -0
  197. package/dist/v1/language/value/inclusion/arrays.js +85 -0
  198. package/dist/v1/language/value/inclusion/assertions.d.ts +18 -0
  199. package/dist/v1/language/value/inclusion/assertions.js +28 -0
  200. package/dist/v1/language/value/inclusion/combinators.d.ts +3 -0
  201. package/dist/v1/language/value/inclusion/combinators.js +67 -0
  202. package/dist/v1/language/value/inclusion/equivalence.d.ts +4 -0
  203. package/dist/v1/language/value/inclusion/equivalence.js +76 -0
  204. package/dist/v1/language/value/inclusion/evidence.d.ts +34 -0
  205. package/dist/v1/language/value/inclusion/evidence.js +140 -0
  206. package/dist/v1/language/value/inclusion/includes.d.ts +29 -3
  207. package/dist/v1/language/value/inclusion/includes.js +58 -723
  208. package/dist/v1/language/value/inclusion/keywords.d.ts +5 -0
  209. package/dist/v1/language/value/inclusion/keywords.js +31 -0
  210. package/dist/v1/language/value/inclusion/kinds.d.ts +17 -0
  211. package/dist/v1/language/value/inclusion/kinds.js +57 -0
  212. package/dist/v1/language/value/inclusion/location.d.ts +24 -0
  213. package/dist/v1/language/value/inclusion/location.js +66 -0
  214. package/dist/v1/language/value/inclusion/numbers.d.ts +3 -0
  215. package/dist/v1/language/value/inclusion/numbers.js +41 -0
  216. package/dist/v1/language/value/inclusion/objects.d.ts +3 -0
  217. package/dist/v1/language/value/inclusion/objects.js +190 -0
  218. package/dist/v1/language/value/inclusion/strings.d.ts +3 -0
  219. package/dist/v1/language/value/inclusion/strings.js +29 -0
  220. package/dist/v1/language/value/inclusion/types.d.ts +3 -0
  221. package/dist/v1/language/value/inclusion/types.js +34 -0
  222. package/dist/v1/language/value/model/blob.d.ts +6 -0
  223. package/dist/v1/language/value/model/blob.js +8 -0
  224. package/dist/v1/language/value/model/file.d.ts +41 -0
  225. package/dist/v1/language/value/model/file.js +122 -0
  226. package/dist/v1/language/value/ordering.d.ts +14 -0
  227. package/dist/v1/language/value/ordering.js +144 -77
  228. package/dist/v1/language/value/profile/canonicalize.d.ts +6 -1
  229. package/dist/v1/language/value/profile/canonicalize.js +67 -87
  230. package/dist/v1/language/value/profile/json.validate.d.ts +12 -0
  231. package/dist/v1/language/value/profile/json.validate.js +18 -5
  232. package/dist/v1/language/value/profile/meta-schema.compiled.d.ts +1 -0
  233. package/dist/v1/language/value/profile/meta-schema.compiled.js +21 -5
  234. package/dist/v1/language/value/profile/rules.js +27 -44
  235. package/dist/v1/language/value/profile/validate.js +1 -10
  236. package/dist/v1/language/value/profile/vocabulary.d.ts +36 -2
  237. package/dist/v1/language/value/profile/vocabulary.js +58 -5
  238. package/dist/v1/language/value/reference/closure.js +6 -6
  239. package/dist/v1/language/value/reference/recursion.js +9 -48
  240. package/dist/v1/language/value/reference/references.d.ts +3 -1
  241. package/dist/v1/language/value/reference/references.js +7 -7
  242. package/dist/v1/language/value/reference/registry.index.d.ts +2 -0
  243. package/dist/v1/language/value/reference/registry.index.js +33 -16
  244. package/dist/v1/language/value/regexp/ast.js +6 -7
  245. package/dist/v1/language/value/regexp/compile.d.ts +5 -11
  246. package/dist/v1/language/value/regexp/compile.js +14 -12
  247. package/dist/v1/language/value/regexp/syntax.js +3 -2
  248. package/dist/v1/language/value/regexp/unicode.d.ts +1 -1
  249. package/dist/v1/language/value/regexp/unicode.js +1 -1
  250. package/dist/v1/language/value/syntax/keywords.d.ts +3 -3
  251. package/dist/v1/language/value/syntax/keywords.js +4 -20
  252. package/dist/v1/language/value/syntax/node-path/validate.js +2 -3
  253. package/dist/v1/language/value/syntax/pointer.d.ts +2 -0
  254. package/dist/v1/language/value/syntax/pointer.js +5 -2
  255. package/dist/v1/language/value/syntax/walk.d.ts +9 -0
  256. package/dist/v1/language/value/syntax/walk.js +37 -20
  257. package/dist/v1/schema/.spec/schemas/domain-schema.schema.json +2596 -0
  258. package/dist/v1/schema/admission/accept.d.ts +3 -1
  259. package/dist/v1/schema/admission/accept.js +6 -14
  260. package/dist/v1/schema/admission/callable.d.ts +21 -0
  261. package/dist/v1/schema/admission/callable.js +96 -0
  262. package/dist/v1/schema/analysis/class.d.ts +4 -0
  263. package/dist/v1/schema/analysis/class.js +57 -17
  264. package/dist/v1/schema/canonical/revision.d.ts +4 -1
  265. package/dist/v1/schema/canonical/revision.js +8 -5
  266. package/dist/v1/schema/compatibility/api.d.ts +4 -1
  267. package/dist/v1/schema/compatibility/api.js +2 -0
  268. package/dist/v1/schema/compatibility/comparators/callables.js +1 -1
  269. package/dist/v1/schema/compatibility/comparators/classes.d.ts +9 -4
  270. package/dist/v1/schema/compatibility/comparators/classes.js +50 -29
  271. package/dist/v1/schema/compatibility/comparators/index.d.ts +1 -1
  272. package/dist/v1/schema/compatibility/comparators/members.js +1 -1
  273. package/dist/v1/schema/compatibility/comparators/values.js +2 -2
  274. package/dist/v1/schema/compatibility/context.d.ts +5 -2
  275. package/dist/v1/schema/compatibility/context.js +8 -6
  276. package/dist/v1/schema/compatibility/coordinate.js +3 -3
  277. package/dist/v1/schema/compatibility/diff.js +2 -4
  278. package/dist/v1/schema/compatibility/extension.d.ts +11 -0
  279. package/dist/v1/schema/compatibility/extension.js +22 -0
  280. package/dist/v1/schema/compatibility/fields.d.ts +20 -4
  281. package/dist/v1/schema/compatibility/fields.js +13 -3
  282. package/dist/v1/schema/compatibility/meaning/footprint.js +16 -51
  283. package/dist/v1/schema/compatibility/model.d.ts +17 -5
  284. package/dist/v1/schema/compatibility/references.d.ts +0 -3
  285. package/dist/v1/schema/compatibility/references.js +1 -9
  286. package/dist/v1/schema/compatibility/report.js +1 -1
  287. package/dist/v1/schema/compatibility/rule.d.ts +13 -0
  288. package/dist/v1/schema/compatibility/rule.js +23 -0
  289. package/dist/v1/schema/compatibility/scope.d.ts +2 -0
  290. package/dist/v1/schema/compatibility/scope.js +4 -1
  291. package/dist/v1/schema/compatibility/structure/index.js +6 -4
  292. package/dist/v1/schema/compatibility/structure/requirements.js +58 -61
  293. package/dist/v1/schema/compatibility/versioning/index.js +1 -1
  294. package/dist/v1/schema/compatibility/versioning/surface.d.ts +1 -1
  295. package/dist/v1/schema/compatibility/versioning/surface.js +30 -2
  296. package/dist/v1/schema/compatibility/walk.d.ts +17 -0
  297. package/dist/v1/schema/compatibility/walk.js +41 -0
  298. package/dist/v1/schema/diagnostic.d.ts +17 -3
  299. package/dist/v1/schema/diagnostic.js +14 -11
  300. package/dist/v1/schema/enforcement/changes.d.ts +590 -0
  301. package/dist/v1/schema/enforcement/changes.js +566 -0
  302. package/dist/v1/schema/enforcement/derived.d.ts +236 -0
  303. package/dist/v1/schema/enforcement/derived.js +243 -0
  304. package/dist/v1/schema/enforcement/dispose.d.ts +308 -0
  305. package/dist/v1/schema/enforcement/dispose.js +275 -0
  306. package/dist/v1/schema/enforcement/facts.d.ts +89 -0
  307. package/dist/v1/schema/enforcement/facts.js +70 -0
  308. package/dist/v1/schema/enforcement/fields.d.ts +65 -0
  309. package/dist/v1/schema/enforcement/fields.js +36 -0
  310. package/dist/v1/schema/enforcement/index.d.ts +39 -0
  311. package/dist/v1/schema/enforcement/index.js +10 -0
  312. package/dist/v1/schema/enforcement/install.d.ts +1634 -0
  313. package/dist/v1/schema/enforcement/install.js +1223 -0
  314. package/dist/v1/schema/enforcement/lifecycle.d.ts +87 -0
  315. package/dist/v1/schema/enforcement/lifecycle.js +91 -0
  316. package/dist/v1/schema/enforcement/model.d.ts +253 -0
  317. package/dist/v1/schema/enforcement/model.js +1 -0
  318. package/dist/v1/schema/enforcement/obligations.d.ts +248 -0
  319. package/dist/v1/schema/enforcement/obligations.js +240 -0
  320. package/dist/v1/schema/enforcement/write.d.ts +1314 -0
  321. package/dist/v1/schema/enforcement/write.js +1017 -0
  322. package/dist/v1/schema/index.d.ts +11 -1
  323. package/dist/v1/schema/index.js +5 -0
  324. package/dist/v1/schema/model/schema.d.ts +23 -1
  325. package/dist/v1/schema/model/schema.js +1 -1
  326. package/dist/v1/schema/normalization/domain.d.ts +2 -0
  327. package/dist/v1/schema/normalization/domain.js +50 -13
  328. package/dist/v1/schema/resolution/closure.js +2 -1
  329. package/dist/v1/schema/resolution/context.js +17 -18
  330. package/dist/v1/schema/resolution/domain.d.ts +5 -0
  331. package/dist/v1/schema/resolution/domain.js +5 -13
  332. package/dist/v1/schema/resolution/origins.js +6 -8
  333. package/dist/v1/schema/rule.d.ts +25 -0
  334. package/dist/v1/schema/rule.js +459 -0
  335. package/dist/v1/schema/validation/callable.d.ts +35 -2
  336. package/dist/v1/schema/validation/callable.js +65 -9
  337. package/dist/v1/schema/validation/class.d.ts +6 -2
  338. package/dist/v1/schema/validation/class.js +128 -105
  339. package/dist/v1/schema/validation/core.js +103 -173
  340. package/dist/v1/schema/validation/domain.js +25 -15
  341. package/dist/v1/schema/validation/domain.json-schema.d.ts +15 -0
  342. package/dist/v1/schema/validation/domain.json-schema.js +222 -0
  343. package/dist/v1/schema/validation/domain.route.d.ts +6 -1
  344. package/dist/v1/schema/validation/domain.route.js +18 -0
  345. package/dist/v1/schema/validation/domain.structure.d.ts +7797 -0
  346. package/dist/v1/schema/validation/domain.structure.js +516 -160
  347. package/dist/v1/schema/validation/icon.d.ts +4 -0
  348. package/dist/v1/schema/validation/icon.js +29 -0
  349. package/dist/v1/schema/validation/json.json-schema.d.ts +40 -0
  350. package/dist/v1/schema/validation/json.json-schema.js +46 -0
  351. package/dist/v1/schema/validation/policy/budgets.d.ts +37 -2
  352. package/dist/v1/schema/validation/policy/budgets.js +94 -121
  353. package/dist/v1/schema/validation/policy/context.d.ts +6 -5
  354. package/dist/v1/schema/validation/policy/context.js +7 -10
  355. package/dist/v1/schema/validation/policy/objects.d.ts +1 -1
  356. package/dist/v1/schema/validation/policy/objects.js +6 -14
  357. package/dist/v1/schema/validation/policy/references.js +20 -62
  358. package/dist/v1/schema/validation/policy/typing.d.ts +3 -18
  359. package/dist/v1/schema/validation/policy/typing.js +22 -356
  360. package/dist/v1/schema/validation/policy/uses.d.ts +40 -3
  361. package/dist/v1/schema/validation/policy/uses.js +63 -91
  362. package/dist/v1/schema/validation/policy/validate.js +5 -5
  363. package/dist/v1/schema/validation/value-api.d.ts +27 -1
  364. package/dist/v1/schema/validation/value-api.js +37 -2
  365. package/dist/v1/schema/validation/value.d.ts +3 -0
  366. package/dist/v1/schema/validation/value.js +9 -17
  367. package/dist/v1/schema/validation/value.json-schema.d.ts +54 -0
  368. package/dist/v1/schema/validation/value.json-schema.js +163 -0
  369. package/dist/v1/schema/validation/view.js +4 -8
  370. package/dist/value/accept.d.ts +9 -3
  371. package/dist/value/accept.js +25 -1
  372. package/dist/value/canonical.d.ts +22 -1
  373. package/dist/value/canonical.js +114 -21
  374. package/dist/value/decode.d.ts +7 -0
  375. package/dist/value/decode.js +159 -9
  376. package/dist/value/equal.d.ts +9 -1
  377. package/dist/value/equal.js +37 -3
  378. package/dist/value/immutable.optimization.d.ts +2 -0
  379. package/dist/value/immutable.optimization.js +4 -0
  380. package/dist/value/index.d.ts +5 -3
  381. package/dist/value/index.js +2 -1
  382. package/dist/value/json.d.ts +2 -2
  383. package/dist/value/json.js +2 -2
  384. package/dist/value/limits.d.ts +11 -0
  385. package/dist/value/rule.d.ts +12 -0
  386. package/dist/value/rule.js +50 -0
  387. package/dist/value/types.d.ts +6 -0
  388. package/dist/value/unicode.d.ts +2 -1
  389. package/dist/value/unicode.js +2 -0
  390. package/package.json +15 -4
  391. package/dist/v1/builder/lowering/core-properties.d.ts +0 -10
  392. package/dist/v1/builder/lowering/core-properties.js +0 -76
  393. package/dist/v1/compiled/admission/semantics/cardinality.d.ts +0 -5
  394. package/dist/v1/compiled/admission/semantics/cardinality.js +0 -113
  395. package/dist/v1/compiled/admission/semantics/policy/equality.d.ts +0 -8
  396. package/dist/v1/compiled/admission/semantics/policy/equality.js +0 -27
  397. package/dist/v1/compiled/admission/semantics/policy/measure.d.ts +0 -9
  398. package/dist/v1/compiled/admission/semantics/policy/measure.js +0 -81
  399. package/dist/v1/compiled/admission/semantics/policy/variants.d.ts +0 -10
  400. package/dist/v1/compiled/admission/semantics/policy/variants.js +0 -65
  401. package/dist/v1/compiled/admission/wire/pattern.d.ts +0 -12
  402. package/dist/v1/compiled/admission/wire/pattern.js +0 -111
  403. package/dist/v1/language/class/index.d.ts +0 -8
  404. package/dist/v1/language/class/index.js +0 -1
  405. package/dist/v1/language/core/index.d.ts +0 -2
  406. package/dist/v1/language/value/index.d.ts +0 -11
  407. package/dist/v1/language/value/index.js +0 -8
  408. package/dist/v1/schema/canonical/domain.d.ts +0 -3
  409. package/dist/v1/schema/canonical/domain.digest.d.ts +0 -3
  410. package/dist/v1/schema/canonical/domain.digest.js +0 -5
  411. package/dist/v1/schema/canonical/domain.js +0 -5
  412. package/dist/v1/schema/canonical/freeze.d.ts +0 -1
  413. /package/dist/v1/{language/core/index.js → builder/class/input.js} +0 -0
@@ -0,0 +1,87 @@
1
+ /**
2
+ * What a schema change the Kernel admits does: how much of the store it reads, what it commits
3
+ * together and what stops it. What it refuses are the rows of `INSTALL`.
4
+ */
5
+ export declare const LIFECYCLE: Readonly<{
6
+ readonly NOOP: {
7
+ readonly phase: 'install';
8
+ readonly layer: 'lifecycle';
9
+ readonly subjects: readonly ["install.request"];
10
+ readonly does: 'apply';
11
+ readonly statement: 'A request that changes no Registration writes its record alone: it activates nothing and reads no stored data, unless an `uncertified` Instance forces it to validate in full.';
12
+ readonly laws: readonly ["INSTALL-WORKFLOW-CLASSES", "INSTALL-CLASSIFY-PURE", "INSTALL-NOOP-INERT"];
13
+ };
14
+ readonly IMMEDIATE: {
15
+ readonly phase: 'install';
16
+ readonly layer: 'lifecycle';
17
+ readonly subjects: readonly ["install.activation"];
18
+ readonly does: 'apply';
19
+ readonly statement: 'A change no obligation reads, such as a new service pin, an added Domain or a projection that narrows nothing stored, activates without reading stored data.';
20
+ readonly laws: readonly ["INSTALL-WORKFLOW-CLASSES", "INSTALL-CLASSIFY-PURE", "INSTALL-RELEASE-NO-DATA"];
21
+ };
22
+ readonly REVALIDATE: {
23
+ readonly phase: 'install';
24
+ readonly layer: 'lifecycle';
25
+ readonly subjects: readonly ["install.validation"];
26
+ readonly does: 'apply';
27
+ readonly statement: 'A change an obligation reads validates its target over the stored data before it activates, one journaled window at a time, its progress kept until the validation ends. What it refutes answers INSTALL.DATA_MIGRATION_REQUIRED.';
28
+ readonly laws: readonly ["INSTALL-WORKFLOW-CLASSES", "INSTALL-CLASSIFY-PURE"];
29
+ };
30
+ readonly COSTLIEST_DOMAIN_CLASS: {
31
+ readonly phase: 'install';
32
+ readonly layer: 'lifecycle';
33
+ readonly subjects: readonly ["install.request"];
34
+ readonly does: 'apply';
35
+ readonly statement: 'A request takes the class of its costliest Domain, from the active Registry, its staged artifacts and its Plan alone, before it evaluates its grant ceiling, prepares the activation or reads stored data. Its record names that class.';
36
+ readonly laws: readonly ["INSTALL-CLASSIFY-PURE", "INSTALL-WORKFLOW-CLASSES"];
37
+ };
38
+ readonly SESSION_CLASS_BY_RELAXATION: {
39
+ readonly phase: 'install';
40
+ readonly layer: 'lifecycle';
41
+ readonly subjects: readonly ["install.session"];
42
+ readonly does: 'apply';
43
+ readonly statement: 'A repair session names `immediate` when its target only relaxes the source it opened on and `revalidate` otherwise, in its status and in its record.';
44
+ readonly laws: readonly ["SESSION-WORKFLOW-CLASS"];
45
+ };
46
+ readonly REQUEST_COMMITS_ONCE: {
47
+ readonly phase: 'install';
48
+ readonly layer: 'engine';
49
+ readonly subjects: readonly ["install.activation"];
50
+ readonly does: 'apply';
51
+ readonly statement: 'One request is one commit: every Domain it names activates together or nothing changes, and its receipt holds real transitions only. An uninstall commits the Domains it selects as one, with its record in that commit unless it retires Classes, whose record the last transition of its purge writes.';
52
+ readonly laws: readonly ["INSTALLATION-ATOMIC-CONVERGENCE", "INSTALLATION-ATOMIC-UNINSTALL", "SCHEMA-ACTIVATION-ATOMIC"];
53
+ };
54
+ readonly COOPERATIVE_CANCEL: {
55
+ readonly phase: 'install';
56
+ readonly layer: 'lifecycle';
57
+ readonly subjects: readonly ["install.request"];
58
+ readonly does: 'apply';
59
+ readonly statement: 'A cooperative cancel changes nothing before the activation commits, and writes the record `cancelled`; after that commit it is ignored. A cancel that rejects an activation still running ends the run as the record the store keeps says.';
60
+ readonly laws: readonly ["INSTALL-WORKFLOW-CANCEL"];
61
+ };
62
+ readonly TARGET_REPLACED: {
63
+ readonly phase: 'install';
64
+ readonly layer: 'identity';
65
+ readonly subjects: readonly ["install.identity", "install.revision"];
66
+ readonly does: 'apply';
67
+ readonly statement: 'A change of the exact target at one Schema revision replaces the Domain and keeps its principal and projected identities, leaves the bound projection as it is when only the service pin moved, and asks no reverse dependent to reinstall. An exact target already installed changes nothing. An installed Domain keeps each dependency revision its closure embeds when the Registry serves another, the replaced Kernel included.';
68
+ readonly laws: readonly ["CP-EXACT-TARGET-REPLACE", "CP-RETAINED-DEPENDENT-TARGET", "KU-DEPENDENCY-CONTEXT"];
69
+ };
70
+ readonly SESSION_ENTERS_REPAIR: {
71
+ readonly phase: 'install';
72
+ readonly layer: 'lifecycle';
73
+ readonly subjects: readonly ["install.session"];
74
+ readonly does: 'apply';
75
+ readonly statement: 'A repair session makes its Execution the session of the open Instance row, waits at most 10 s for the writes that entered to drain, then enters `repair` under the vocabulary of the active and target Registries. An `apply` validates the difference from the active to the submitted source over the stored data, and the submitted source over what was written since the session opened: what it refutes is reported and returns the row to `repair`, and what holds commits the activation, the exit from the session and the terminal record together. An `abort` stops its attempt within one validation window, 30 s by default, and returns the row to `repair`.';
76
+ readonly laws: readonly ["SESSION-WORKFLOW-OPEN-APPLY", "SESSION-WORKFLOW-ABORT"];
77
+ };
78
+ readonly PROJECTION_DIGEST_SELECTS_ITEMS: {
79
+ readonly phase: 'install';
80
+ readonly layer: 'lifecycle';
81
+ readonly subjects: readonly ["fact.projection"];
82
+ readonly does: 'apply';
83
+ readonly statement: 'A Plan derives the projection digest of each Domain from its exact target and the active Kernel revision alone, reading no store, and plans projection items only for a Domain added, removed or whose digest changed.';
84
+ readonly laws: readonly ["INSTALL-PROJECTION-IMPACT"];
85
+ };
86
+ }>;
87
+ export type LifecycleId = keyof typeof LIFECYCLE;
@@ -0,0 +1,91 @@
1
+ import { deepFreeze } from '../../language/freeze.js';
2
+ /**
3
+ * What a schema change the Kernel admits does: how much of the store it reads, what it commits
4
+ * together and what stops it. What it refuses are the rows of `INSTALL`.
5
+ */
6
+ export const LIFECYCLE = deepFreeze({
7
+ NOOP: {
8
+ phase: 'install',
9
+ layer: 'lifecycle',
10
+ subjects: ['install.request'],
11
+ does: 'apply',
12
+ statement: 'A request that changes no Registration writes its record alone: it activates nothing and reads no stored data, unless an `uncertified` Instance forces it to validate in full.',
13
+ laws: ['INSTALL-WORKFLOW-CLASSES', 'INSTALL-CLASSIFY-PURE', 'INSTALL-NOOP-INERT'],
14
+ },
15
+ IMMEDIATE: {
16
+ phase: 'install',
17
+ layer: 'lifecycle',
18
+ subjects: ['install.activation'],
19
+ does: 'apply',
20
+ statement: 'A change no obligation reads, such as a new service pin, an added Domain or a projection that narrows nothing stored, activates without reading stored data.',
21
+ laws: ['INSTALL-WORKFLOW-CLASSES', 'INSTALL-CLASSIFY-PURE', 'INSTALL-RELEASE-NO-DATA'],
22
+ },
23
+ REVALIDATE: {
24
+ phase: 'install',
25
+ layer: 'lifecycle',
26
+ subjects: ['install.validation'],
27
+ does: 'apply',
28
+ statement: 'A change an obligation reads validates its target over the stored data before it activates, one journaled window at a time, its progress kept until the validation ends. What it refutes answers INSTALL.DATA_MIGRATION_REQUIRED.',
29
+ laws: ['INSTALL-WORKFLOW-CLASSES', 'INSTALL-CLASSIFY-PURE'],
30
+ },
31
+ COSTLIEST_DOMAIN_CLASS: {
32
+ phase: 'install',
33
+ layer: 'lifecycle',
34
+ subjects: ['install.request'],
35
+ does: 'apply',
36
+ statement: 'A request takes the class of its costliest Domain, from the active Registry, its staged artifacts and its Plan alone, before it evaluates its grant ceiling, prepares the activation or reads stored data. Its record names that class.',
37
+ laws: ['INSTALL-CLASSIFY-PURE', 'INSTALL-WORKFLOW-CLASSES'],
38
+ },
39
+ SESSION_CLASS_BY_RELAXATION: {
40
+ phase: 'install',
41
+ layer: 'lifecycle',
42
+ subjects: ['install.session'],
43
+ does: 'apply',
44
+ statement: 'A repair session names `immediate` when its target only relaxes the source it opened on and `revalidate` otherwise, in its status and in its record.',
45
+ laws: ['SESSION-WORKFLOW-CLASS'],
46
+ },
47
+ REQUEST_COMMITS_ONCE: {
48
+ phase: 'install',
49
+ layer: 'engine',
50
+ subjects: ['install.activation'],
51
+ does: 'apply',
52
+ statement: 'One request is one commit: every Domain it names activates together or nothing changes, and its receipt holds real transitions only. An uninstall commits the Domains it selects as one, with its record in that commit unless it retires Classes, whose record the last transition of its purge writes.',
53
+ laws: [
54
+ 'INSTALLATION-ATOMIC-CONVERGENCE',
55
+ 'INSTALLATION-ATOMIC-UNINSTALL',
56
+ 'SCHEMA-ACTIVATION-ATOMIC',
57
+ ],
58
+ },
59
+ COOPERATIVE_CANCEL: {
60
+ phase: 'install',
61
+ layer: 'lifecycle',
62
+ subjects: ['install.request'],
63
+ does: 'apply',
64
+ statement: 'A cooperative cancel changes nothing before the activation commits, and writes the record `cancelled`; after that commit it is ignored. A cancel that rejects an activation still running ends the run as the record the store keeps says.',
65
+ laws: ['INSTALL-WORKFLOW-CANCEL'],
66
+ },
67
+ TARGET_REPLACED: {
68
+ phase: 'install',
69
+ layer: 'identity',
70
+ subjects: ['install.identity', 'install.revision'],
71
+ does: 'apply',
72
+ statement: 'A change of the exact target at one Schema revision replaces the Domain and keeps its principal and projected identities, leaves the bound projection as it is when only the service pin moved, and asks no reverse dependent to reinstall. An exact target already installed changes nothing. An installed Domain keeps each dependency revision its closure embeds when the Registry serves another, the replaced Kernel included.',
73
+ laws: ['CP-EXACT-TARGET-REPLACE', 'CP-RETAINED-DEPENDENT-TARGET', 'KU-DEPENDENCY-CONTEXT'],
74
+ },
75
+ SESSION_ENTERS_REPAIR: {
76
+ phase: 'install',
77
+ layer: 'lifecycle',
78
+ subjects: ['install.session'],
79
+ does: 'apply',
80
+ statement: 'A repair session makes its Execution the session of the open Instance row, waits at most 10 s for the writes that entered to drain, then enters `repair` under the vocabulary of the active and target Registries. An `apply` validates the difference from the active to the submitted source over the stored data, and the submitted source over what was written since the session opened: what it refutes is reported and returns the row to `repair`, and what holds commits the activation, the exit from the session and the terminal record together. An `abort` stops its attempt within one validation window, 30 s by default, and returns the row to `repair`.',
81
+ laws: ['SESSION-WORKFLOW-OPEN-APPLY', 'SESSION-WORKFLOW-ABORT'],
82
+ },
83
+ PROJECTION_DIGEST_SELECTS_ITEMS: {
84
+ phase: 'install',
85
+ layer: 'lifecycle',
86
+ subjects: ['fact.projection'],
87
+ does: 'apply',
88
+ statement: 'A Plan derives the projection digest of each Domain from its exact target and the active Kernel revision alone, reading no store, and plans projection items only for a Domain added, removed or whose digest changed.',
89
+ laws: ['INSTALL-PROJECTION-IMPACT'],
90
+ },
91
+ });
@@ -0,0 +1,253 @@
1
+ import type { EdgeClassDefinition, NodeClassDefinition } from '../../language/class/model/class.js';
2
+ import type { DirectedEdgeConstraints, DirectedSourceEndpoint, DirectedTargetEndpoint, IncidentEndpoint } from '../../language/class/model/edge.js';
3
+ import type { PropertyDefinition } from '../../language/class/model/property.js';
4
+ import type { SchemaDiagnosticCode } from '../diagnostic.js';
5
+ /** A union's keys across its members, where `keyof` alone keeps only the keys they share. */
6
+ type KeysOf<Union> = Union extends unknown ? keyof Union : never;
7
+ /** A field of a definition a Schema document declares. Every one is classified by `FIELDS`. */
8
+ export type DeclaredField = `class.${KeysOf<NodeClassDefinition | EdgeClassDefinition>}` | `property.${KeysOf<PropertyDefinition>}` | `endpoint.${KeysOf<DirectedSourceEndpoint | DirectedTargetEndpoint | IncidentEndpoint>}` | `constraint.${keyof DirectedEdgeConstraints}`;
9
+ /** What a rule protects that no field of a Schema declares. */
10
+ export type KernelFact =
11
+ /** The Class a request names, resolved in the Registry it is planned in. */
12
+ 'request.class'
13
+ /** The shape of one Mutation: its effects, conditions, locators and sizes. */
14
+ | 'request.mutation'
15
+ /** The Path a Mutation locates a Node by. */
16
+ | 'request.path'
17
+ /** The conditions a Mutation states on the live graph. */
18
+ | 'request.condition'
19
+ /** The receipt of a Mutation retried under one key. */
20
+ | 'request.receipt'
21
+ /** The Registry and the admission a Mutation expects, and its plan closes over. */
22
+ | 'request.expectation'
23
+ /** The identity of a Node: its id, its Class. */
24
+ | 'fact.node'
25
+ /** The identity of an Edge: its Class and endpoints, then its slug. */
26
+ | 'fact.edge'
27
+ /** The Edge each Node holds to its Class, which its Class derives. */
28
+ | 'fact.instance_of'
29
+ /** The Authentication Properties of an Identity. */
30
+ | 'fact.authentication'
31
+ /** The facts of an Execution and its attribution, which only the durable call path writes. */
32
+ | 'fact.execution'
33
+ /** The Edges which grant authority, which only an installation writes. */
34
+ | 'fact.authority'
35
+ /** The Edges which project a Schema into the graph, which only an installation writes. */
36
+ | 'fact.projection'
37
+ /** A fact a Schema owns. */
38
+ | 'fact.schema'
39
+ /** A Schema as bytes: its canonical document, its revision, its compiled form and its closure. */
40
+ | 'schema.document'
41
+ /** Two versions of a Schema compared: what a dependent relies on, and what a change requires. */
42
+ | 'schema.comparison'
43
+ /** A Value as the Kernel reads it, whatever Property holds it. */
44
+ | 'value'
45
+ /** The request of a schema change: its entries, its mode, its operation id. */
46
+ | 'install.request'
47
+ /** What a Domain serves to install it: its address, its release, its attestation. */
48
+ | 'install.source'
49
+ /** How Domains depend on each other. */
50
+ | 'install.dependency'
51
+ /** The Nodes and Edges a Domain authors, as they are written. */
52
+ | 'install.core'
53
+ /** What stays one thing across a replacement: the principal, its subject, the issuer. */
54
+ | 'install.identity'
55
+ /** The Registry a change is decided on, and the change that holds it. */
56
+ | 'install.revision'
57
+ /** The reads which judge a change. */
58
+ | 'install.validation'
59
+ /** The commit of a change, and what settles it. */
60
+ | 'install.activation'
61
+ /** A repair session, which owns the Instance while it repairs. */
62
+ | 'install.session'
63
+ /** The store itself, whatever the data. */
64
+ | 'store'
65
+ /** The Kernel's own composition, which no request reaches. */
66
+ | 'kernel';
67
+ export type EnforcementSubject = DeclaredField | KernelFact;
68
+ /** When the rule holds. Refusing a Schema document is `RULES` and `values.RULES`. */
69
+ export type EnforcementPhase = 'write' | 'install' | 'dispose';
70
+ /**
71
+ * What the rule protects. `structure`: the shape of the graph. `value`: a Property value.
72
+ * `identity`: which fact a request names. `lifecycle`: how a value may change over time. `limit`: a
73
+ * size. `protection`: a fact only the Kernel writes. `authority`: who may. `source`: what a Domain
74
+ * serves. `concurrency`: another change moved what this one was decided on. `engine`: the store,
75
+ * whatever the data. `defect`: the Kernel's own composition, which no request reaches.
76
+ */
77
+ export type EnforcementLayer = 'structure' | 'value' | 'identity' | 'lifecycle' | 'limit' | 'protection' | 'authority' | 'source' | 'concurrency' | 'engine' | 'defect';
78
+ /**
79
+ * How one Mutation is planned. `ordinary`: the public path of an open Instance. `repair-kernel` and
80
+ * `repair-application`: the same path in a repair session, on what the Kernel declares and on what
81
+ * an application declares. `preserve`: a trusted workflow which moves or deletes stored facts and
82
+ * keeps their automatic values. `projection`: a trusted workflow which writes a Schema's projection,
83
+ * its automatic values under exact contracts.
84
+ */
85
+ export type WriteMode = 'ordinary' | 'repair-kernel' | 'repair-application' | 'preserve' | 'projection';
86
+ /**
87
+ * The step of a Mutation that refuses it, as the store's outcome reports it. The public outcome
88
+ * repeats it where its details hold a phase.
89
+ */
90
+ export type WritePhase = 'decode' | 'input' | 'registry' | 'plan' | 'admission' | 'preState' | 'authorization' | 'precondition' | 'postState' | 'submission' | 'execute' | 'outcome';
91
+ /**
92
+ * The extent a rule reads and the Classes it spans: what decides the verdict. `exact`: one concrete
93
+ * Class. `descendants`: a Class and its active concrete descendants. `touched`: the facts the
94
+ * transition wrote and their endpoints. `extent`: every fact in scope.
95
+ */
96
+ export interface EnforcementScope {
97
+ readonly classes: 'exact' | 'descendants';
98
+ readonly reads: 'touched' | 'extent';
99
+ }
100
+ /** A refusal of a Mutation as its caller receives it. */
101
+ export interface WriteRefusal {
102
+ readonly phase: WritePhase;
103
+ /** The public code. */
104
+ readonly code: string;
105
+ /** The cause under a generic code: the `issue` of its details. */
106
+ readonly issue?: string;
107
+ /** The rule a post-state refusal names. */
108
+ readonly rule?: string;
109
+ /** The Mutation planner raises it by naming the row. */
110
+ readonly planner?: true;
111
+ }
112
+ interface EnforcementBase {
113
+ readonly phase: EnforcementPhase;
114
+ readonly layer: EnforcementLayer;
115
+ /** What the rule is about: the fields a Schema declares for it, or a fact of the Kernel's. */
116
+ readonly subjects: readonly [EnforcementSubject, ...EnforcementSubject[]];
117
+ /** The rule, in one plain sentence. */
118
+ readonly statement: string;
119
+ /** The acceptance rule of the field this rule enforces, where one guards it. */
120
+ readonly accepted?: SchemaDiagnosticCode;
121
+ /** The Codegraph laws which state the rule. */
122
+ readonly laws?: readonly string[];
123
+ /** The extent of the rule, where it reads more than the request. */
124
+ readonly scope?: EnforcementScope;
125
+ }
126
+ /** The Kernel refuses a Mutation. */
127
+ export interface WriteRefusalEnforcement extends EnforcementBase {
128
+ readonly phase: 'write';
129
+ readonly does: 'refuse';
130
+ readonly modes: readonly WriteMode[];
131
+ readonly refusal: WriteRefusal;
132
+ /** What an engine answers instead, where the engines differ. */
133
+ readonly divergence?: string;
134
+ }
135
+ /** The Kernel does something to the data of a Mutation it admits. */
136
+ export interface WriteEffectEnforcement extends EnforcementBase {
137
+ readonly phase: 'write';
138
+ readonly does: 'apply';
139
+ readonly modes: readonly WriteMode[];
140
+ }
141
+ /** A declaration the Kernel holds and does not enforce on a write. */
142
+ export interface WriteAbstention extends EnforcementBase {
143
+ readonly phase: 'write';
144
+ readonly does: 'abstain';
145
+ }
146
+ export type WriteEnforcement = WriteRefusalEnforcement | WriteEffectEnforcement | WriteAbstention;
147
+ /** The families of a migration report: what a failing question is about. */
148
+ export type ObligationFamily = 'class' | 'declared' | 'required' | 'value' | 'endpoints' | 'distinct' | 'noSelf' | 'acyclic' | 'unique' | 'degree' | 'facts';
149
+ /** The work a refused schema change names: how stored data comes to meet the question. */
150
+ export type ObligationOperation = 'validate-existing' | 'populate-required' | 'rewrite-values' | 'remove-facts';
151
+ /**
152
+ * One question a schema change asks of a stored extent. `judge`: who answers it, the store which
153
+ * counts or the Runtime which reads pages. `subject`: what a requirement names, the Property or the
154
+ * Class. `unit`: what a report counts, the facts or the distinct values.
155
+ */
156
+ export interface DataObligation extends EnforcementBase {
157
+ readonly phase: 'install';
158
+ readonly does: 'refuse';
159
+ readonly family: ObligationFamily;
160
+ readonly operation: ObligationOperation;
161
+ readonly judge: 'backend' | 'runtime';
162
+ readonly subject: 'property' | 'definition';
163
+ readonly unit: 'facts' | 'values';
164
+ /** The reason it reports when the facts refute it. */
165
+ readonly reason: 'invalid-existing';
166
+ /** The reason it reports on a Class the target removes, where that differs. */
167
+ readonly removedReason?: 'destructive-change';
168
+ /** What an engine answers instead, where the engines differ. */
169
+ readonly divergence?: string;
170
+ }
171
+ /** A requirement of a refused schema change that is the answer to no one question. */
172
+ export interface ChangeRequirement extends EnforcementBase {
173
+ readonly phase: 'install';
174
+ readonly does: 'refuse';
175
+ readonly operation: ObligationOperation;
176
+ readonly reason: 'invalid-existing' | 'budget-exceeded';
177
+ readonly subject: 'domain' | 'definition';
178
+ /** What an engine answers instead, where the engines differ. */
179
+ readonly divergence?: string;
180
+ }
181
+ /** A refusal of a schema change as its caller receives it. */
182
+ export interface InstallRefusal {
183
+ /** The public code. */
184
+ readonly code: string;
185
+ /** The fixed fields of its public details, which tell this cause from another under the code. */
186
+ readonly details?: Readonly<Record<string, string>>;
187
+ /** It ends a trusted path, or is a defect: no caller receives it as a refusal. */
188
+ readonly internal?: true;
189
+ }
190
+ /**
191
+ * How a change leaves facts behind. `replace`: an install that replaces a Domain. `safe`: an
192
+ * uninstall that deletes no data of the Domain. `destructive`: an uninstall that retires the Classes
193
+ * it removes. `retiring`: any request while a checkpoint retires Classes.
194
+ */
195
+ export type DisposeMode = 'replace' | 'safe' | 'destructive' | 'retiring';
196
+ /** What a disposal refuses. */
197
+ export type DisposeRefusal =
198
+ /** One requirement of `DATA_MIGRATION_REQUIRED`, which its caller receives. */
199
+ {
200
+ readonly requirement: {
201
+ readonly operation: ObligationOperation;
202
+ readonly reason: 'destructive-change' | 'restricted-deletion' | 'budget-exceeded';
203
+ };
204
+ }
205
+ /** What the store answers the Runtime, which no caller receives. */
206
+ | {
207
+ readonly provider: {
208
+ readonly phase: string;
209
+ readonly code: string;
210
+ };
211
+ }
212
+ /** What a call on the Execution of the change receives. */
213
+ | {
214
+ readonly code: string;
215
+ };
216
+ /** The Kernel refuses to leave a fact behind. */
217
+ export interface DisposeRefusalEnforcement extends EnforcementBase {
218
+ readonly phase: 'dispose';
219
+ readonly does: 'refuse';
220
+ readonly modes: readonly DisposeMode[];
221
+ readonly refusal: DisposeRefusal;
222
+ /** What an engine answers instead, where the engines differ. */
223
+ readonly divergence?: string;
224
+ }
225
+ /** The Kernel does something to a fact a change leaves behind. */
226
+ export interface DisposeEffectEnforcement extends EnforcementBase {
227
+ readonly phase: 'dispose';
228
+ readonly does: 'apply';
229
+ readonly modes: readonly DisposeMode[];
230
+ /** What an engine does instead, where the engines differ. */
231
+ readonly divergence?: string;
232
+ }
233
+ export type DisposeEnforcement = DisposeRefusalEnforcement | DisposeEffectEnforcement;
234
+ /** The Kernel does something with a schema change it admits. */
235
+ export interface LifecycleEnforcement extends EnforcementBase {
236
+ readonly phase: 'install';
237
+ readonly does: 'apply';
238
+ }
239
+ /** The error of a path whose causes share a code, which raises by naming the row. */
240
+ export interface InstallRaise {
241
+ readonly error: 'plan' | 'projection';
242
+ readonly code: string;
243
+ }
244
+ /** The Kernel refuses a schema change, whatever the data stored. */
245
+ export interface InstallEnforcement extends EnforcementBase {
246
+ readonly phase: 'install';
247
+ readonly does: 'refuse';
248
+ readonly refusal: InstallRefusal;
249
+ readonly raised?: InstallRaise;
250
+ /** What an engine answers instead, where the engines differ. */
251
+ readonly divergence?: string;
252
+ }
253
+ export {};
@@ -0,0 +1 @@
1
+ export {};