@astrale-os/kernel-core 0.9.0-beta.9 → 0.9.0

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 (380) hide show
  1. package/dist/auth/authority/accept.js +4 -0
  2. package/dist/auth/authority/admission/admission.d.ts +4 -1
  3. package/dist/auth/authority/admission/admission.js +46 -147
  4. package/dist/auth/authority/admission/index.d.ts +1 -1
  5. package/dist/auth/authority/admission/index.js +1 -1
  6. package/dist/auth/authority/admission/references.d.ts +13 -0
  7. package/dist/auth/authority/admission/references.js +38 -0
  8. package/dist/auth/authority/admission/term.d.ts +6 -0
  9. package/dist/auth/authority/admission/term.js +60 -0
  10. package/dist/auth/authority/admission/wire.d.ts +8 -0
  11. package/dist/auth/authority/admission/wire.js +33 -0
  12. package/dist/auth/authority/canonical.d.ts +2 -0
  13. package/dist/auth/authority/canonical.js +15 -0
  14. package/dist/auth/authority/index.d.ts +9 -2
  15. package/dist/auth/authority/index.js +6 -1
  16. package/dist/auth/authority/language/index.d.ts +3 -1
  17. package/dist/auth/authority/language/index.js +1 -0
  18. package/dist/auth/authority/language/predicate.d.ts +31 -16
  19. package/dist/auth/authority/language/predicate.js +1 -1
  20. package/dist/auth/authority/language/program.d.ts +21 -0
  21. package/dist/auth/authority/language/program.js +2 -0
  22. package/dist/auth/authority/normalization/index.d.ts +1 -1
  23. package/dist/auth/authority/normalization/index.js +1 -1
  24. package/dist/auth/authority/normalization/normalize.d.ts +2 -0
  25. package/dist/auth/authority/normalization/normalize.js +38 -16
  26. package/dist/auth/authority/ownership.optimization.d.ts +8 -0
  27. package/dist/auth/authority/ownership.optimization.js +83 -0
  28. package/dist/auth/authority/prepare-binder-body.d.ts +4 -0
  29. package/dist/auth/authority/prepare-binder-body.js +31 -0
  30. package/dist/auth/authority/program.d.ts +28 -0
  31. package/dist/auth/authority/program.js +191 -0
  32. package/dist/auth/authority/semantics/class-authority.d.ts +8 -0
  33. package/dist/auth/authority/semantics/class-authority.js +26 -0
  34. package/dist/auth/authority/semantics/composition.d.ts +46 -0
  35. package/dist/auth/authority/semantics/composition.js +150 -0
  36. package/dist/auth/authority/semantics/failure.d.ts +21 -0
  37. package/dist/auth/authority/semantics/failure.js +10 -0
  38. package/dist/auth/authority/semantics/index.d.ts +13 -0
  39. package/dist/auth/authority/semantics/index.js +6 -0
  40. package/dist/auth/authority/semantics/interpret.d.ts +41 -0
  41. package/dist/auth/authority/semantics/interpret.js +388 -0
  42. package/dist/auth/authority/semantics/residual.d.ts +32 -0
  43. package/dist/auth/authority/semantics/residual.js +166 -0
  44. package/dist/auth/authority/semantics/snapshot.d.ts +40 -0
  45. package/dist/auth/authority/semantics/terms.d.ts +22 -0
  46. package/dist/auth/authority/semantics/terms.js +96 -0
  47. package/dist/auth/authority/semantics/vocabulary.d.ts +19 -0
  48. package/dist/auth/context/context.d.ts +4 -3
  49. package/dist/auth/expression/authoring/builder.d.ts +2 -11
  50. package/dist/auth/expression/authoring/builder.js +1 -45
  51. package/dist/auth/expression/authoring/index.d.ts +1 -1
  52. package/dist/auth/expression/authoring/index.js +1 -1
  53. package/dist/auth/expression/index.d.ts +1 -2
  54. package/dist/auth/expression/index.js +1 -2
  55. package/dist/auth/expression/language/identity-expression.d.ts +2 -22
  56. package/dist/auth/grant/index.d.ts +1 -1
  57. package/dist/auth/grant/index.js +1 -1
  58. package/dist/auth/grant/resolved/admission.d.ts +4 -3
  59. package/dist/auth/grant/resolved/admission.js +23 -13
  60. package/dist/auth/grant/resolved/grant.d.ts +1 -1
  61. package/dist/auth/grant/resolved/index.d.ts +1 -1
  62. package/dist/auth/grant/resolved/index.js +1 -1
  63. package/dist/auth/grant/unresolved/admission.d.ts +4 -1
  64. package/dist/auth/grant/unresolved/admission.js +27 -67
  65. package/dist/auth/grant/unresolved/limits.d.ts +2 -4
  66. package/dist/auth/grant/unresolved/limits.js +1 -5
  67. package/dist/auth/identity/admission.js +11 -3
  68. package/dist/auth/identity/identity.d.ts +15 -3
  69. package/dist/auth/identity/index.d.ts +1 -1
  70. package/dist/auth/index.d.ts +4 -4
  71. package/dist/auth/index.js +1 -1
  72. package/dist/auth/jwk/index.d.ts +1 -1
  73. package/dist/auth/jwk/index.js +1 -1
  74. package/dist/auth/jwk/thumbprint.d.ts +2 -0
  75. package/dist/auth/jwk/thumbprint.js +12 -6
  76. package/dist/auth/register/fingerprint/fingerprint.d.ts +25 -0
  77. package/dist/auth/register/fingerprint/fingerprint.js +31 -0
  78. package/dist/auth/register/fingerprint/index.d.ts +2 -0
  79. package/dist/auth/register/index.d.ts +5 -0
  80. package/dist/auth/register/request/admission.d.ts +3 -0
  81. package/dist/auth/register/request/admission.js +103 -0
  82. package/dist/auth/register/request/index.d.ts +3 -0
  83. package/dist/auth/register/request/limits.d.ts +6 -0
  84. package/dist/auth/register/request/limits.js +6 -0
  85. package/dist/auth/register/request/request.d.ts +19 -0
  86. package/dist/auth/{provision → register}/request/self-issuer.d.ts +1 -1
  87. package/dist/auth/{provision → register}/request/self-issuer.js +1 -1
  88. package/dist/auth/register/result/index.d.ts +1 -0
  89. package/dist/auth/register/result/result.d.ts +10 -0
  90. package/dist/auth/register/result/result.js +1 -0
  91. package/dist/callable/contract/body.d.ts +10 -0
  92. package/dist/callable/contract/body.js +7 -0
  93. package/dist/callable/contract/index.d.ts +2 -1
  94. package/dist/callable/contract/index.js +1 -1
  95. package/dist/callable/contract/output.d.ts +18 -2
  96. package/dist/callable/index.d.ts +3 -2
  97. package/dist/callable/index.js +2 -1
  98. package/dist/callable/invocation/call.d.ts +16 -2
  99. package/dist/callable/invocation/call.js +41 -1
  100. package/dist/callable/invocation/index.d.ts +1 -1
  101. package/dist/callable/invocation/index.js +1 -1
  102. package/dist/callable/invocation/result.d.ts +10 -3
  103. package/dist/dns-label.d.ts +1 -2
  104. package/dist/dns-label.js +2 -3
  105. package/dist/graph/graph/graph.d.ts +1 -5
  106. package/dist/graph/graph/graph.js +3 -27
  107. package/dist/graph/graph/index.d.ts +2 -4
  108. package/dist/graph/graph/index.js +2 -3
  109. package/dist/graph/graph/model/codec.js +4 -4
  110. package/dist/graph/graph/model/index.d.ts +1 -1
  111. package/dist/graph/graph/model/index.js +1 -1
  112. package/dist/graph/graph/model/model.d.ts +7 -7
  113. package/dist/graph/graph/model/model.js +6 -6
  114. package/dist/graph/graph/model/wire.d.ts +58 -78
  115. package/dist/graph/graph/model/wire.js +18 -19
  116. package/dist/graph/mutate/authoring/builder.d.ts +2 -2
  117. package/dist/graph/mutate/authoring/builder.js +2 -2
  118. package/dist/graph/mutate/authoring/create.js +13 -5
  119. package/dist/graph/mutate/index.d.ts +1 -1
  120. package/dist/graph/mutate/language/codec.js +3 -3
  121. package/dist/graph/mutate/language/model.d.ts +4 -4
  122. package/dist/graph/mutate/language/wire.d.ts +226 -215
  123. package/dist/graph/mutate/language/wire.js +42 -47
  124. package/dist/graph/mutate/result/index.d.ts +4 -3
  125. package/dist/graph/mutate/result/index.js +8 -6
  126. package/dist/graph/mutate/result/wire.d.ts +4 -4
  127. package/dist/graph/mutate/result/wire.js +7 -4
  128. package/dist/graph/node/identity/id.d.ts +0 -4
  129. package/dist/graph/node/identity/id.js +0 -5
  130. package/dist/graph/node/identity/order.js +20 -0
  131. package/dist/graph/path/authoring/path.d.ts +8 -5
  132. package/dist/graph/path/authoring/path.js +21 -3
  133. package/dist/graph/path/language/model.d.ts +8 -3
  134. package/dist/graph/path/language/syntax.js +23 -8
  135. package/dist/graph/query/authoring/builder.js +37 -5
  136. package/dist/graph/query/authoring/model.d.ts +20 -1
  137. package/dist/graph/query/index.d.ts +4 -2
  138. package/dist/graph/query/index.js +1 -0
  139. package/dist/graph/query/language/codec.js +18 -3
  140. package/dist/graph/query/language/fingerprint.js +8 -0
  141. package/dist/graph/query/language/model.d.ts +22 -4
  142. package/dist/graph/query/language/wire.d.ts +124 -114
  143. package/dist/graph/query/language/wire.js +54 -47
  144. package/dist/graph/query/order/index.d.ts +53 -0
  145. package/dist/graph/query/order/index.js +79 -0
  146. package/dist/graph/query/reference/evaluate.d.ts +1 -0
  147. package/dist/graph/query/reference/evaluate.js +39 -52
  148. package/dist/graph/query/result/index.js +1 -1
  149. package/dist/graph/query/result/wire.d.ts +93 -94
  150. package/dist/graph/query/result/wire.js +20 -20
  151. package/dist/graph/reconcile/condition/model.d.ts +2 -2
  152. package/dist/graph/reconcile/condition/references.d.ts +0 -1
  153. package/dist/graph/reconcile/condition/references.js +4 -4
  154. package/dist/graph/reconcile/correspondence.d.ts +9 -8
  155. package/dist/graph/reconcile/evidence.d.ts +2 -2
  156. package/dist/graph/reconcile/mutation/assess.d.ts +2 -1
  157. package/dist/graph/reconcile/observation.d.ts +4 -3
  158. package/dist/graph/reconcile/planning/canonical.d.ts +6 -0
  159. package/dist/graph/reconcile/planning/canonical.js +28 -0
  160. package/dist/graph/reconcile/planning/context.d.ts +3 -3
  161. package/dist/graph/reconcile/planning/model.d.ts +8 -4
  162. package/dist/graph/reconcile/planning/plan.js +2 -1
  163. package/dist/schema/authority/authority-relation.js +3 -0
  164. package/dist/schema/authority/claims.d.ts +24 -25
  165. package/dist/schema/authority/claims.js +8 -8
  166. package/dist/schema/authority/governed-by.d.ts +16 -91
  167. package/dist/schema/authority/governed-by.js +1 -1
  168. package/dist/schema/authority/operation-node.d.ts +27 -13
  169. package/dist/schema/authority/operations.d.ts +8 -168
  170. package/dist/schema/authority/policy.d.ts +27 -15
  171. package/dist/schema/authority/vocabulary.d.ts +3 -0
  172. package/dist/schema/authority/vocabulary.js +25 -0
  173. package/dist/schema/callables/entrypoint.d.ts +32 -0
  174. package/dist/schema/callables/entrypoint.js +12 -0
  175. package/dist/schema/callables/execution.d.ts +569 -0
  176. package/dist/schema/callables/execution.js +32 -0
  177. package/dist/schema/callables/function.d.ts +3400 -55
  178. package/dist/schema/callables/function.js +6 -4
  179. package/dist/schema/callables/index.d.ts +2 -1
  180. package/dist/schema/callables/index.js +2 -1
  181. package/dist/schema/callables/method-of.d.ts +18 -143
  182. package/dist/schema/callables/method-of.js +2 -2
  183. package/dist/schema/callables/view.d.ts +83 -51
  184. package/dist/schema/definitions/class.d.ts +45 -33
  185. package/dist/schema/definitions/extends.d.ts +16 -110
  186. package/dist/schema/definitions/instance-of.d.ts +17 -69
  187. package/dist/schema/domain/domain.d.ts +3343 -148
  188. package/dist/schema/domain/domain.js +6 -3
  189. package/dist/schema/domain/of-domain.d.ts +18 -192
  190. package/dist/schema/domain/of-domain.js +1 -1
  191. package/dist/schema/identity/composition.d.ts +5 -0
  192. package/dist/schema/identity/composition.js +5 -0
  193. package/dist/schema/identity/identity.d.ts +225 -122
  194. package/dist/schema/identity/identity.js +3 -4
  195. package/dist/schema/index.d.ts +1 -0
  196. package/dist/schema/index.js +1 -0
  197. package/dist/schema/installation/operation-id.d.ts +1 -2
  198. package/dist/schema/installation/operation-id.js +2 -4
  199. package/dist/schema/introspection/index.d.ts +1 -1
  200. package/dist/schema/introspection/language.d.ts +12 -28
  201. package/dist/schema/kernel/projection/callables.js +2 -3
  202. package/dist/schema/kernel/projection/core.d.ts +7 -0
  203. package/dist/schema/kernel/projection/core.js +51 -0
  204. package/dist/schema/kernel/projection/definitions.d.ts +13 -0
  205. package/dist/schema/kernel/projection/definitions.js +71 -0
  206. package/dist/schema/kernel/projection/index.d.ts +3 -3
  207. package/dist/schema/kernel/projection/index.js +2 -2
  208. package/dist/schema/kernel/projection/methods.d.ts +5 -0
  209. package/dist/schema/kernel/projection/methods.js +41 -0
  210. package/dist/schema/kernel/projection/part.d.ts +34 -0
  211. package/dist/schema/kernel/projection/part.js +42 -0
  212. package/dist/schema/kernel/projection/paths.d.ts +6 -0
  213. package/dist/schema/kernel/projection/{keys.js → paths.js} +12 -14
  214. package/dist/schema/kernel/projection/project.d.ts +4 -2
  215. package/dist/schema/kernel/projection/project.js +33 -258
  216. package/dist/schema/kernel/projection/properties.d.ts +11 -0
  217. package/dist/schema/kernel/projection/properties.js +36 -0
  218. package/dist/schema/kernel/projection/relations.d.ts +7 -0
  219. package/dist/schema/kernel/projection/relations.js +61 -0
  220. package/dist/schema/kernel/projection/types.d.ts +28 -2
  221. package/dist/schema/kernel/schema.d.ts +9008 -4939
  222. package/dist/schema/kernel/schema.js +12 -8
  223. package/dist/schema/kernel/syscalls/contracts/admit.d.ts +15 -12
  224. package/dist/schema/kernel/syscalls/contracts/admit.js +16 -9
  225. package/dist/schema/kernel/syscalls/contracts/blob.d.ts +31 -0
  226. package/dist/schema/kernel/syscalls/contracts/blob.js +24 -0
  227. package/dist/schema/kernel/syscalls/contracts/can.d.ts +19 -8
  228. package/dist/schema/kernel/syscalls/contracts/can.js +12 -4
  229. package/dist/schema/kernel/syscalls/contracts/delegate.d.ts +6 -7
  230. package/dist/schema/kernel/syscalls/contracts/delegate.js +5 -5
  231. package/dist/schema/kernel/syscalls/contracts/execution.d.ts +300 -0
  232. package/dist/schema/kernel/syscalls/contracts/execution.js +116 -0
  233. package/dist/schema/kernel/syscalls/contracts/expected.d.ts +5 -0
  234. package/dist/schema/kernel/syscalls/contracts/expected.js +9 -0
  235. package/dist/schema/kernel/syscalls/contracts/identity.d.ts +18 -19
  236. package/dist/schema/kernel/syscalls/contracts/identity.js +6 -7
  237. package/dist/schema/kernel/syscalls/contracts/impersonate.d.ts +6 -0
  238. package/dist/schema/kernel/syscalls/contracts/impersonate.js +4 -0
  239. package/dist/schema/kernel/syscalls/contracts/index.d.ts +6 -3
  240. package/dist/schema/kernel/syscalls/contracts/index.js +6 -3
  241. package/dist/schema/kernel/syscalls/contracts/install.d.ts +309 -217
  242. package/dist/schema/kernel/syscalls/contracts/install.js +68 -26
  243. package/dist/schema/kernel/syscalls/contracts/installation.d.ts +70 -351
  244. package/dist/schema/kernel/syscalls/contracts/installation.js +29 -67
  245. package/dist/schema/kernel/syscalls/contracts/introspect.d.ts +11 -15
  246. package/dist/schema/kernel/syscalls/contracts/introspect.js +8 -15
  247. package/dist/schema/kernel/syscalls/contracts/journal.d.ts +26 -27
  248. package/dist/schema/kernel/syscalls/contracts/journal.js +15 -15
  249. package/dist/schema/kernel/syscalls/contracts/mint.d.ts +5 -7
  250. package/dist/schema/kernel/syscalls/contracts/mint.js +4 -5
  251. package/dist/schema/kernel/syscalls/contracts/mutate.d.ts +243 -224
  252. package/dist/schema/kernel/syscalls/contracts/mutate.js +7 -1
  253. package/dist/schema/kernel/syscalls/contracts/query.d.ts +239 -222
  254. package/dist/schema/kernel/syscalls/contracts/query.js +17 -15
  255. package/dist/schema/kernel/syscalls/contracts/register.d.ts +20 -0
  256. package/dist/schema/kernel/syscalls/contracts/register.js +24 -0
  257. package/dist/schema/kernel/syscalls/contracts/uninstall.d.ts +55 -148
  258. package/dist/schema/kernel/syscalls/contracts/uninstall.js +7 -5
  259. package/dist/schema/kernel/syscalls/contracts/view-host-requirements.d.ts +17 -0
  260. package/dist/schema/kernel/syscalls/contracts/view-host-requirements.js +40 -0
  261. package/dist/schema/kernel/syscalls/contracts/view-resolve.d.ts +27 -28
  262. package/dist/schema/kernel/syscalls/contracts/view-resolve.js +16 -24
  263. package/dist/schema/kernel/syscalls/contracts/whoami.d.ts +19 -20
  264. package/dist/schema/kernel/syscalls/contracts/whoami.js +2 -2
  265. package/dist/schema/kernel/syscalls/contracts/whois.d.ts +22 -23
  266. package/dist/schema/kernel/syscalls/contracts/whois.js +3 -3
  267. package/dist/schema/kernel/syscalls/declarations/admit.d.ts +18 -18
  268. package/dist/schema/kernel/syscalls/declarations/admit.js +3 -3
  269. package/dist/schema/kernel/syscalls/declarations/can.d.ts +19 -14
  270. package/dist/schema/kernel/syscalls/declarations/can.js +4 -4
  271. package/dist/schema/kernel/syscalls/declarations/delegate.d.ts +9 -12
  272. package/dist/schema/kernel/syscalls/declarations/delegate.js +4 -4
  273. package/dist/schema/kernel/syscalls/declarations/download.d.ts +12 -0
  274. package/dist/schema/kernel/syscalls/declarations/download.js +10 -0
  275. package/dist/schema/kernel/syscalls/declarations/execution.d.ts +255 -0
  276. package/dist/schema/kernel/syscalls/declarations/execution.js +52 -0
  277. package/dist/schema/kernel/syscalls/declarations/impersonate.d.ts +9 -0
  278. package/dist/schema/kernel/syscalls/declarations/impersonate.js +12 -0
  279. package/dist/schema/kernel/syscalls/declarations/index.d.ts +1079 -1323
  280. package/dist/schema/kernel/syscalls/declarations/index.js +18 -2
  281. package/dist/schema/kernel/syscalls/declarations/install.d.ts +85 -172
  282. package/dist/schema/kernel/syscalls/declarations/install.js +7 -3
  283. package/dist/schema/kernel/syscalls/declarations/introspect.d.ts +8 -19
  284. package/dist/schema/kernel/syscalls/declarations/introspect.js +3 -4
  285. package/dist/schema/kernel/syscalls/declarations/journal.d.ts +29 -31
  286. package/dist/schema/kernel/syscalls/declarations/journal.js +4 -2
  287. package/dist/schema/kernel/syscalls/declarations/mint.d.ts +8 -13
  288. package/dist/schema/kernel/syscalls/declarations/mint.js +5 -5
  289. package/dist/schema/kernel/syscalls/declarations/mutate.d.ts +239 -256
  290. package/dist/schema/kernel/syscalls/declarations/mutate.js +4 -2
  291. package/dist/schema/kernel/syscalls/declarations/query.d.ts +236 -260
  292. package/dist/schema/kernel/syscalls/declarations/query.js +4 -2
  293. package/dist/schema/kernel/syscalls/declarations/register.d.ts +23 -0
  294. package/dist/schema/kernel/syscalls/declarations/register.js +10 -0
  295. package/dist/schema/kernel/syscalls/declarations/uninstall.d.ts +51 -153
  296. package/dist/schema/kernel/syscalls/declarations/uninstall.js +6 -2
  297. package/dist/schema/kernel/syscalls/declarations/upload.d.ts +15 -0
  298. package/dist/schema/kernel/syscalls/declarations/upload.js +10 -0
  299. package/dist/schema/kernel/syscalls/declarations/use-policy.d.ts +4 -0
  300. package/dist/schema/kernel/syscalls/declarations/use-policy.js +9 -0
  301. package/dist/schema/kernel/syscalls/declarations/view-resolve.d.ts +30 -37
  302. package/dist/schema/kernel/syscalls/declarations/view-resolve.js +5 -3
  303. package/dist/schema/kernel/syscalls/declarations/whoami.d.ts +22 -26
  304. package/dist/schema/kernel/syscalls/declarations/whoami.js +3 -3
  305. package/dist/schema/kernel/syscalls/declarations/whois.d.ts +25 -29
  306. package/dist/schema/kernel/syscalls/declarations/whois.js +5 -3
  307. package/dist/schema/kernel/syscalls/descriptors/execution.d.ts +303 -0
  308. package/dist/schema/kernel/syscalls/descriptors/execution.js +11 -0
  309. package/dist/schema/kernel/syscalls/descriptors/function.d.ts +8 -2
  310. package/dist/schema/kernel/syscalls/descriptors/functions.d.ts +3 -1
  311. package/dist/schema/kernel/syscalls/descriptors/functions.js +3 -1
  312. package/dist/schema/kernel/syscalls/descriptors/identity.d.ts +47 -13
  313. package/dist/schema/kernel/syscalls/descriptors/identity.js +2 -1
  314. package/dist/schema/kernel/syscalls/descriptors/index.d.ts +2 -1
  315. package/dist/schema/kernel/syscalls/descriptors/index.js +2 -1
  316. package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.d.ts +5 -2
  317. package/dist/schema/kernel/syscalls/descriptors/results/view-resolution.js +8 -38
  318. package/dist/schema/kernel/syscalls/descriptors/view.d.ts +11 -9
  319. package/dist/schema/kernel/syscalls/index.d.ts +2 -2
  320. package/dist/schema/kernel/syscalls/index.js +2 -2
  321. package/dist/schema/kernel/syscalls/references/execution.d.ts +55 -0
  322. package/dist/schema/kernel/syscalls/references/execution.js +13 -0
  323. package/dist/schema/kernel/syscalls/references/functions.d.ts +12 -2
  324. package/dist/schema/kernel/syscalls/references/functions.js +3 -1
  325. package/dist/schema/kernel/syscalls/references/identity.d.ts +9 -0
  326. package/dist/schema/kernel/syscalls/references/identity.js +1 -0
  327. package/dist/schema/kernel/syscalls/references/index.d.ts +2 -1
  328. package/dist/schema/kernel/syscalls/references/index.js +2 -1
  329. package/dist/schema/meta/created-by.d.ts +32 -0
  330. package/dist/schema/meta/created-by.js +17 -0
  331. package/dist/schema/meta/descriptable.d.ts +13 -11
  332. package/dist/schema/meta/edge.d.ts +5 -9
  333. package/dist/schema/meta/iconable.d.ts +13 -11
  334. package/dist/schema/meta/index.d.ts +1 -0
  335. package/dist/schema/meta/index.js +1 -0
  336. package/dist/schema/meta/named.d.ts +13 -9
  337. package/dist/schema/meta/node.d.ts +9 -1
  338. package/dist/schema/meta/remotable.d.ts +15 -22
  339. package/dist/schema/meta/statused.d.ts +13 -7
  340. package/dist/schema/meta/timestamped.d.ts +14 -12
  341. package/package.json +9 -7
  342. package/dist/auth/expression/normalization/canonicalize.d.ts +0 -7
  343. package/dist/auth/expression/normalization/canonicalize.js +0 -102
  344. package/dist/auth/expression/normalization/index.d.ts +0 -2
  345. package/dist/auth/expression/normalization/index.js +0 -2
  346. package/dist/auth/expression/normalization/raise-denials.d.ts +0 -3
  347. package/dist/auth/expression/normalization/raise-denials.js +0 -59
  348. package/dist/auth/provision/fingerprint/fingerprint.d.ts +0 -9
  349. package/dist/auth/provision/fingerprint/fingerprint.js +0 -33
  350. package/dist/auth/provision/fingerprint/index.d.ts +0 -2
  351. package/dist/auth/provision/index.d.ts +0 -5
  352. package/dist/auth/provision/request/admission.d.ts +0 -3
  353. package/dist/auth/provision/request/admission.js +0 -125
  354. package/dist/auth/provision/request/index.d.ts +0 -3
  355. package/dist/auth/provision/request/request.d.ts +0 -29
  356. package/dist/auth/provision/result/index.d.ts +0 -1
  357. package/dist/auth/provision/result/result.d.ts +0 -12
  358. package/dist/graph/graph/navigation/error.d.ts +0 -12
  359. package/dist/graph/graph/navigation/error.js +0 -20
  360. package/dist/graph/graph/navigation/index.d.ts +0 -2
  361. package/dist/graph/graph/navigation/index.js +0 -1
  362. package/dist/graph/graph/navigation/model.d.ts +0 -15
  363. package/dist/schema/callables/view-for.d.ts +0 -296
  364. package/dist/schema/callables/view-for.js +0 -12
  365. package/dist/schema/kernel/projection/keys.d.ts +0 -3
  366. package/dist/schema/kernel/projection/path.d.ts +0 -2
  367. package/dist/schema/kernel/projection/path.js +0 -140
  368. package/dist/schema/kernel/syscalls/contracts/provision.d.ts +0 -292
  369. package/dist/schema/kernel/syscalls/contracts/provision.js +0 -19
  370. package/dist/schema/kernel/syscalls/declarations/define.d.ts +0 -5
  371. package/dist/schema/kernel/syscalls/declarations/define.js +0 -7
  372. package/dist/schema/kernel/syscalls/declarations/provision.d.ts +0 -296
  373. package/dist/schema/kernel/syscalls/declarations/provision.js +0 -8
  374. /package/dist/auth/{provision/request/request.js → authority/semantics/snapshot.js} +0 -0
  375. /package/dist/auth/{provision/result/index.js → authority/semantics/vocabulary.js} +0 -0
  376. /package/dist/auth/{provision → register}/fingerprint/index.js +0 -0
  377. /package/dist/auth/{provision → register}/index.js +0 -0
  378. /package/dist/auth/{provision → register}/request/index.js +0 -0
  379. /package/dist/auth/{provision/result/result.js → register/request/request.js} +0 -0
  380. /package/dist/{graph/graph/navigation/model.js → auth/register/result/index.js} +0 -0
@@ -6,6 +6,7 @@ import { GraphData } from '../../graph/index.js';
6
6
  import { NodeId as admitNodeId } from '../../node/index.js';
7
7
  import { compareNodeIds } from '../../node/index.js';
8
8
  import { encodeQueryAST, QueryASTDecodeError } from '../language/index.js';
9
+ import { compareQueryRank, queryRangeContains } from '../order/index.js';
9
10
  import { decodeQueryResult } from '../result/index.js';
10
11
  import { QueryReferenceError } from './error.js';
11
12
  /** Independent backend-neutral executable Query V6 row algebra. */
@@ -141,8 +142,10 @@ function evaluate(ast, context, options) {
141
142
  if (!Object.hasOwn(value.value.props, predicate.property)) {
142
143
  return false;
143
144
  }
144
- return (predicate.kind === 'property.present' ||
145
- portable.equal(value.value.props[predicate.property], predicate.value));
145
+ const stored = value.value.props[predicate.property];
146
+ if (predicate.kind === 'property.range')
147
+ return queryRangeContains(predicate, stored);
148
+ return predicate.kind === 'property.present' || portable.equal(stored, predicate.value);
146
149
  });
147
150
  }
148
151
  stepRows.push(rows.length);
@@ -273,9 +276,13 @@ function decodeWitness(input, path, context) {
273
276
  }
274
277
  function selectNodes(rows, select, size, after, admission, properties) {
275
278
  const selected = new Map();
279
+ const ordered = orderedClasses(select.order, 'node', properties);
276
280
  rows.forEach((row) => {
277
281
  const node = boundNode(row, select.binding, '/select/binding');
278
- const needsRead = select.kind === 'graph' || (select.kind === 'nodes' && select.projection.kind === 'value');
282
+ // A value is read; an ordered reference reads a fact its order applies to before ranking it.
283
+ const needsRead = select.kind === 'graph' ||
284
+ (select.kind === 'nodes' && select.projection.kind === 'value') ||
285
+ ordered.has(node.class);
279
286
  if (needsRead && !admission.readNode(node, '/select/binding'))
280
287
  return;
281
288
  selected.set(node.id, node);
@@ -305,6 +312,7 @@ function selectNodes(rows, select, size, after, admission, properties) {
305
312
  }
306
313
  function selectEdges(rows, select, size, after, context, admission, properties) {
307
314
  const selected = new Map();
315
+ const ordered = orderedClasses(select.order, 'edge', properties);
308
316
  rows.forEach((row) => {
309
317
  const edge = boundEdge(row, select.binding, '/select/binding');
310
318
  const source = requireNode(context, edge.source, '/select/binding');
@@ -319,7 +327,7 @@ function selectEdges(rows, select, size, after, context, admission, properties)
319
327
  admission.readNode(source, '/select/binding') &&
320
328
  admission.readNode(target, '/select/binding')
321
329
  : select.kind === 'edges'
322
- ? (select.projection.edge === 'reference' ||
330
+ ? ((select.projection.edge === 'reference' && !ordered.has(edge.class)) ||
323
331
  admission.readEdge(edge, '/select/binding')) &&
324
332
  (select.projection.source === 'reference' ||
325
333
  admission.readNode(source, '/select/binding')) &&
@@ -362,12 +370,24 @@ function selectEdges(rows, select, size, after, context, admission, properties)
362
370
  const next = last === undefined ? undefined : frontierOf(last, order, 'edge', properties);
363
371
  return Object.freeze({ result, ...(next === undefined ? {} : { next }) });
364
372
  }
373
+ /** The Classes a Property order applies to, whose facts are read before they are ranked. */
374
+ function orderedClasses(order, kind, properties) {
375
+ return order === undefined
376
+ ? new Set()
377
+ : properties.close(order.property, kind, '/select/order/property');
378
+ }
365
379
  function orderingComparator(order, kind, properties) {
366
- return (left, right) => compareReferenceRank(rankOf(left, order, kind, properties), rankOf(right, order, kind, properties), order);
380
+ const ordering = orderingOf(order, kind, properties);
381
+ return (left, right) => compareReferenceRank(rankOf(left, order, kind, properties), rankOf(right, order, kind, properties), order, ordering);
382
+ }
383
+ function orderingOf(order, kind, properties) {
384
+ return order === undefined
385
+ ? undefined
386
+ : properties.ordering(order.property, kind, '/select/order/property');
367
387
  }
368
388
  function compareFrontier(frontier, fact, order, kind, properties) {
369
389
  const admitted = decodeReferenceFrontier(frontier, order, kind, properties);
370
- return compareReferenceRank(admitted, rankOf(fact, order, kind, properties), order);
390
+ return compareReferenceRank(admitted, rankOf(fact, order, kind, properties), order, orderingOf(order, kind, properties));
371
391
  }
372
392
  function frontierOf(fact, order, kind, properties) {
373
393
  const rank = rankOf(fact, order, kind, properties);
@@ -413,36 +433,8 @@ function decodeReferenceFrontier(frontier, order, kind, properties) {
413
433
  }
414
434
  return Object.freeze({ bucket: 'ranked', value: frontier.value, identity });
415
435
  }
416
- function compareReferenceRank(left, right, order) {
417
- if (order === undefined)
418
- return compareIdentity(left.identity, right.identity);
419
- if (left.bucket !== right.bucket) {
420
- return left.bucket === 'unranked'
421
- ? order.unranked === 'first'
422
- ? -1
423
- : 1
424
- : order.unranked === 'first'
425
- ? 1
426
- : -1;
427
- }
428
- if (left.bucket === 'ranked' && right.bucket === 'ranked') {
429
- const kind = typeof left.value === 'boolean'
430
- ? 'boolean'
431
- : typeof left.value === 'number'
432
- ? 'number'
433
- : 'string';
434
- const compared = compareOrderingValue(left.value, right.value, kind);
435
- if (compared !== 0)
436
- return order.direction === 'asc' ? compared : -compared;
437
- }
438
- return compareIdentity(left.identity, right.identity);
439
- }
440
- function compareIdentity(left, right) {
441
- if (typeof left === 'string' && typeof right === 'string')
442
- return compareNodeIds(left, right);
443
- if (typeof left !== 'string' && typeof right !== 'string')
444
- return compareEdgeKeys(left, right);
445
- invalid('/after/identity', 'Frontier identity kind disagrees with selection');
436
+ function compareReferenceRank(left, right, order, ordering) {
437
+ return compareQueryRank(left, right, order === undefined || ordering === undefined ? undefined : { ...order, kind: ordering });
446
438
  }
447
439
  function orderingValue(input, kind) {
448
440
  if (kind === 'boolean')
@@ -451,22 +443,6 @@ function orderingValue(input, kind) {
451
443
  return typeof input === 'number' && Number.isFinite(input);
452
444
  return typeof input === 'string';
453
445
  }
454
- function compareOrderingValue(left, right, kind) {
455
- if (kind === 'boolean')
456
- return Number(left) - Number(right);
457
- if (kind === 'number')
458
- return left - right;
459
- return compareUnicodeScalars(left, right);
460
- }
461
- function compareUnicodeScalars(left, right) {
462
- const a = Array.from(left, (value) => value.codePointAt(0));
463
- const b = Array.from(right, (value) => value.codePointAt(0));
464
- for (let index = 0; index < Math.min(a.length, b.length); index += 1) {
465
- if (a[index] !== b[index])
466
- return a[index] - b[index];
467
- }
468
- return a.length - b.length;
469
- }
470
446
  function projectNode(node, shape) {
471
447
  return shape === 'value'
472
448
  ? Object.freeze({ kind: 'value', value: node })
@@ -611,6 +587,15 @@ class Admission {
611
587
  const cached = this.#edges.get(key);
612
588
  if (cached !== undefined)
613
589
  return cached;
590
+ const source = requireNode(this.context, edge.source, path);
591
+ const target = requireNode(this.context, edge.target, path);
592
+ const admitted = call(path, 'Logical Edge fact admission failed', () => this.context.admitEdge(edge, source, target));
593
+ if (typeof admitted !== 'boolean')
594
+ invalid(path, 'Logical Edge fact admission must return boolean');
595
+ if (!admitted) {
596
+ this.#edges.set(key, false);
597
+ return false;
598
+ }
614
599
  const explicit = call(path, 'Edge traversal admission failed', () => this.context.traverseEdge(edge));
615
600
  if (typeof explicit !== 'boolean')
616
601
  invalid(path, 'Edge traversal admission must return boolean');
@@ -648,6 +633,7 @@ function acceptContext(input) {
648
633
  'closeClass',
649
634
  'closeProperty',
650
635
  'orientation',
636
+ 'admitEdge',
651
637
  'traverseNode',
652
638
  'traverseEdge',
653
639
  'readNode',
@@ -671,6 +657,7 @@ function acceptContext(input) {
671
657
  closeClass: input.closeClass.bind(input),
672
658
  closeProperty: input.closeProperty.bind(input),
673
659
  orientation: input.orientation.bind(input),
660
+ admitEdge: input.admitEdge.bind(input),
674
661
  traverseNode: input.traverseNode.bind(input),
675
662
  traverseEdge: input.traverseEdge.bind(input),
676
663
  readNode: input.readNode.bind(input),
@@ -35,7 +35,7 @@ export function queryResultSelection(input) {
35
35
  /** Decode exact QueryResult structure; Query-relative closure remains Runtime-owned. */
36
36
  export function decodeQueryResult(input) {
37
37
  try {
38
- const value = decodeWire(queryResultSchema, portable.accept(input), invalid);
38
+ const value = decodeWire(queryResultSchema, portable.acceptForRead(input), invalid);
39
39
  if (value.kind === 'graph') {
40
40
  const graph = decodeGraph(value.graph, '/graph');
41
41
  const selection = decodeSelection(value.selection, graph);
@@ -1,95 +1,94 @@
1
- import { z } from 'zod';
2
1
  /** Exact discriminated structural result; Runtime owns Query-relative closure and order. */
3
- export declare const queryResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
- kind: z.ZodLiteral<"graph">;
5
- graph: z.ZodObject<{
6
- nodes: z.ZodArray<z.ZodObject<{
7
- id: z.ZodString;
8
- class: z.ZodString;
9
- props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
10
- }, z.core.$strict>>;
11
- edges: z.ZodArray<z.ZodObject<{
12
- source: z.ZodString;
13
- target: z.ZodString;
14
- class: z.ZodString;
15
- slug: z.ZodOptional<z.ZodType<import("../../edge/index.js").EdgeSlug, unknown, z.core.$ZodTypeInternals<import("../../edge/index.js").EdgeSlug, unknown>>>;
16
- props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
17
- }, z.core.$strict>>;
18
- }, z.core.$strict>;
19
- selection: z.ZodDiscriminatedUnion<[z.ZodObject<{
20
- kind: z.ZodLiteral<"node">;
21
- ids: z.ZodArray<z.ZodString>;
22
- }, z.core.$strict>, z.ZodObject<{
23
- kind: z.ZodLiteral<"edge">;
24
- keys: z.ZodArray<z.ZodObject<{
25
- source: z.ZodString;
26
- target: z.ZodString;
27
- class: z.ZodString;
28
- }, z.core.$strict>>;
29
- }, z.core.$strict>], "kind">;
30
- }, z.core.$strict>, z.ZodObject<{
31
- kind: z.ZodLiteral<"nodes">;
32
- nodes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
33
- kind: z.ZodLiteral<"reference">;
34
- value: z.ZodObject<{
35
- id: z.ZodString;
36
- class: z.ZodString;
37
- }, z.core.$strict>;
38
- }, z.core.$strict>, z.ZodObject<{
39
- kind: z.ZodLiteral<"value">;
40
- value: z.ZodObject<{
41
- id: z.ZodString;
42
- class: z.ZodString;
43
- props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
44
- }, z.core.$strict>;
45
- }, z.core.$strict>], "kind">>;
46
- }, z.core.$strict>, z.ZodObject<{
47
- kind: z.ZodLiteral<"edges">;
48
- edges: z.ZodArray<z.ZodObject<{
49
- edge: z.ZodDiscriminatedUnion<[z.ZodObject<{
50
- kind: z.ZodLiteral<"reference">;
51
- value: z.ZodObject<{
52
- source: z.ZodString;
53
- target: z.ZodString;
54
- class: z.ZodString;
55
- }, z.core.$strict>;
56
- }, z.core.$strict>, z.ZodObject<{
57
- kind: z.ZodLiteral<"value">;
58
- value: z.ZodObject<{
59
- source: z.ZodString;
60
- target: z.ZodString;
61
- class: z.ZodString;
62
- slug: z.ZodOptional<z.ZodType<import("../../edge/index.js").EdgeSlug, unknown, z.core.$ZodTypeInternals<import("../../edge/index.js").EdgeSlug, unknown>>>;
63
- props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
64
- }, z.core.$strict>;
65
- }, z.core.$strict>], "kind">;
66
- source: z.ZodDiscriminatedUnion<[z.ZodObject<{
67
- kind: z.ZodLiteral<"reference">;
68
- value: z.ZodObject<{
69
- id: z.ZodString;
70
- class: z.ZodString;
71
- }, z.core.$strict>;
72
- }, z.core.$strict>, z.ZodObject<{
73
- kind: z.ZodLiteral<"value">;
74
- value: z.ZodObject<{
75
- id: z.ZodString;
76
- class: z.ZodString;
77
- props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
78
- }, z.core.$strict>;
79
- }, z.core.$strict>], "kind">;
80
- target: z.ZodDiscriminatedUnion<[z.ZodObject<{
81
- kind: z.ZodLiteral<"reference">;
82
- value: z.ZodObject<{
83
- id: z.ZodString;
84
- class: z.ZodString;
85
- }, z.core.$strict>;
86
- }, z.core.$strict>, z.ZodObject<{
87
- kind: z.ZodLiteral<"value">;
88
- value: z.ZodObject<{
89
- id: z.ZodString;
90
- class: z.ZodString;
91
- props: z.ZodRecord<z.ZodString, z.ZodUnknown>;
92
- }, z.core.$strict>;
93
- }, z.core.$strict>], "kind">;
94
- }, z.core.$strict>>;
95
- }, z.core.$strict>], "kind">;
2
+ export declare const queryResultSchema: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
3
+ kind: import("zod").ZodLiteral<"graph">;
4
+ graph: import("zod").ZodObject<{
5
+ nodes: import("zod").ZodArray<import("zod").ZodObject<{
6
+ id: import("zod").ZodString;
7
+ class: import("zod").ZodString;
8
+ props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
9
+ }, import("zod/v4/core").$strict>>;
10
+ edges: import("zod").ZodArray<import("zod").ZodObject<{
11
+ source: import("zod").ZodString;
12
+ target: import("zod").ZodString;
13
+ class: import("zod").ZodString;
14
+ slug: import("zod").ZodOptional<import("zod").ZodType<import("../../edge/index.js").EdgeSlug, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../edge/index.js").EdgeSlug, unknown>>>;
15
+ props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
16
+ }, import("zod/v4/core").$strict>>;
17
+ }, import("zod/v4/core").$strict>;
18
+ selection: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
19
+ kind: import("zod").ZodLiteral<"node">;
20
+ ids: import("zod").ZodArray<import("zod").ZodString>;
21
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
22
+ kind: import("zod").ZodLiteral<"edge">;
23
+ keys: import("zod").ZodArray<import("zod").ZodObject<{
24
+ source: import("zod").ZodString;
25
+ target: import("zod").ZodString;
26
+ class: import("zod").ZodString;
27
+ }, import("zod/v4/core").$strict>>;
28
+ }, import("zod/v4/core").$strict>], "kind">;
29
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
30
+ kind: import("zod").ZodLiteral<"nodes">;
31
+ nodes: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
32
+ kind: import("zod").ZodLiteral<"reference">;
33
+ value: import("zod").ZodObject<{
34
+ id: import("zod").ZodString;
35
+ class: import("zod").ZodString;
36
+ }, import("zod/v4/core").$strict>;
37
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
38
+ kind: import("zod").ZodLiteral<"value">;
39
+ value: import("zod").ZodObject<{
40
+ id: import("zod").ZodString;
41
+ class: import("zod").ZodString;
42
+ props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
43
+ }, import("zod/v4/core").$strict>;
44
+ }, import("zod/v4/core").$strict>], "kind">>;
45
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
46
+ kind: import("zod").ZodLiteral<"edges">;
47
+ edges: import("zod").ZodArray<import("zod").ZodObject<{
48
+ edge: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
49
+ kind: import("zod").ZodLiteral<"reference">;
50
+ value: import("zod").ZodObject<{
51
+ source: import("zod").ZodString;
52
+ target: import("zod").ZodString;
53
+ class: import("zod").ZodString;
54
+ }, import("zod/v4/core").$strict>;
55
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
56
+ kind: import("zod").ZodLiteral<"value">;
57
+ value: import("zod").ZodObject<{
58
+ source: import("zod").ZodString;
59
+ target: import("zod").ZodString;
60
+ class: import("zod").ZodString;
61
+ slug: import("zod").ZodOptional<import("zod").ZodType<import("../../edge/index.js").EdgeSlug, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../edge/index.js").EdgeSlug, unknown>>>;
62
+ props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
63
+ }, import("zod/v4/core").$strict>;
64
+ }, import("zod/v4/core").$strict>], "kind">;
65
+ source: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
66
+ kind: import("zod").ZodLiteral<"reference">;
67
+ value: import("zod").ZodObject<{
68
+ id: import("zod").ZodString;
69
+ class: import("zod").ZodString;
70
+ }, import("zod/v4/core").$strict>;
71
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
72
+ kind: import("zod").ZodLiteral<"value">;
73
+ value: import("zod").ZodObject<{
74
+ id: import("zod").ZodString;
75
+ class: import("zod").ZodString;
76
+ props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
77
+ }, import("zod/v4/core").$strict>;
78
+ }, import("zod/v4/core").$strict>], "kind">;
79
+ target: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
80
+ kind: import("zod").ZodLiteral<"reference">;
81
+ value: import("zod").ZodObject<{
82
+ id: import("zod").ZodString;
83
+ class: import("zod").ZodString;
84
+ }, import("zod/v4/core").$strict>;
85
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
86
+ kind: import("zod").ZodLiteral<"value">;
87
+ value: import("zod").ZodObject<{
88
+ id: import("zod").ZodString;
89
+ class: import("zod").ZodString;
90
+ props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
91
+ }, import("zod/v4/core").$strict>;
92
+ }, import("zod/v4/core").$strict>], "kind">;
93
+ }, import("zod/v4/core").$strict>>;
94
+ }, import("zod/v4/core").$strict>], "kind">;
@@ -1,33 +1,33 @@
1
- import { z } from 'zod';
1
+ import { array, discriminatedUnion, literal, strictObject, string } from 'zod';
2
2
  import { edgeKeySchema, graphDataSchema, graphEdgeSchema, graphNodeSchema, } from '#graph/graph/model/wire';
3
- const text = z.string().min(1);
4
- const nodeReference = z.strictObject({ id: text, class: text });
5
- const nodeProjection = z.discriminatedUnion('kind', [
6
- z.strictObject({ kind: z.literal('reference'), value: nodeReference }),
7
- z.strictObject({ kind: z.literal('value'), value: graphNodeSchema }),
3
+ const text = string().min(1);
4
+ const nodeReference = strictObject({ id: text, class: text });
5
+ const nodeProjection = discriminatedUnion('kind', [
6
+ strictObject({ kind: literal('reference'), value: nodeReference }),
7
+ strictObject({ kind: literal('value'), value: graphNodeSchema }),
8
8
  ]);
9
- const edgeProjection = z.discriminatedUnion('kind', [
10
- z.strictObject({ kind: z.literal('reference'), value: edgeKeySchema }),
11
- z.strictObject({ kind: z.literal('value'), value: graphEdgeSchema }),
9
+ const edgeProjection = discriminatedUnion('kind', [
10
+ strictObject({ kind: literal('reference'), value: edgeKeySchema }),
11
+ strictObject({ kind: literal('value'), value: graphEdgeSchema }),
12
12
  ]);
13
- const edgeItem = z.strictObject({
13
+ const edgeItem = strictObject({
14
14
  edge: edgeProjection,
15
15
  source: nodeProjection,
16
16
  target: nodeProjection,
17
17
  });
18
18
  /** Exact discriminated structural result; Runtime owns Query-relative closure and order. */
19
- export const queryResultSchema = z.discriminatedUnion('kind', [
20
- z.strictObject({
21
- kind: z.literal('graph'),
19
+ export const queryResultSchema = discriminatedUnion('kind', [
20
+ strictObject({
21
+ kind: literal('graph'),
22
22
  graph: graphDataSchema,
23
- selection: z.discriminatedUnion('kind', [
24
- z.strictObject({ kind: z.literal('node'), ids: z.array(text) }),
25
- z.strictObject({ kind: z.literal('edge'), keys: z.array(edgeKeySchema) }),
23
+ selection: discriminatedUnion('kind', [
24
+ strictObject({ kind: literal('node'), ids: array(text) }),
25
+ strictObject({ kind: literal('edge'), keys: array(edgeKeySchema) }),
26
26
  ]),
27
27
  }),
28
- z.strictObject({
29
- kind: z.literal('nodes'),
30
- nodes: z.array(nodeProjection),
28
+ strictObject({
29
+ kind: literal('nodes'),
30
+ nodes: array(nodeProjection),
31
31
  }),
32
- z.strictObject({ kind: z.literal('edges'), edges: z.array(edgeItem) }),
32
+ strictObject({ kind: literal('edges'), edges: array(edgeItem) }),
33
33
  ]);
@@ -1,13 +1,13 @@
1
1
  import type { PropertyKey } from '@astrale-os/kernel-dsl/v1';
2
2
  import type { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
3
3
  import type { EdgeKey, EdgeSlug } from '../../edge/index.js';
4
- import type { LocalBinding, MergeConflict as GraphMergeConflict } from '../../graph/index.js';
4
+ import type { LocalAlias, MergeConflict as GraphMergeConflict } from '../../graph/index.js';
5
5
  import type { NodeId } from '../../node/index.js';
6
6
  import type { DesiredProperties } from '../../properties/index.js';
7
7
  import type { QueryEdgeAST, QueryNodeAST } from '../../query/index.js';
8
8
  declare const DESIRED_BRAND: unique symbol;
9
9
  export type DesiredNodeRef = NodeId | {
10
- readonly desired: LocalBinding;
10
+ readonly desired: LocalAlias;
11
11
  };
12
12
  export interface DesiredEdgeRef {
13
13
  readonly source: DesiredNodeRef;
@@ -2,7 +2,6 @@ import type { DesiredEdge, DesiredEdgeRef, DesiredNode, DesiredNodeRef, Expectat
2
2
  import { type EdgeKey, type EdgeSlug } from '../../edge/index.js';
3
3
  export declare function admitDesiredNode(node: DesiredNode): DesiredNode;
4
4
  export declare function admitDesiredEdge(edge: DesiredEdge): DesiredEdge;
5
- export declare function admitNodeRef(ref: DesiredNodeRef): DesiredNodeRef;
6
5
  export declare function admitEdgeRef(ref: DesiredEdgeRef | EdgeKey): DesiredEdgeRef;
7
6
  export declare function equalExpectation(left: Expectation<EdgeSlug>, right: Expectation<EdgeSlug>): boolean;
8
7
  export declare function encodeDesiredNodeRef(ref: DesiredNodeRef): string;
@@ -1,6 +1,6 @@
1
1
  import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
2
2
  import { isEdgeSlug } from '../../edge/index.js';
3
- import { LocalBinding, isLocalBinding } from '../../graph/index.js';
3
+ import { LocalAlias, isLocalAlias } from '../../graph/index.js';
4
4
  import { isNodeId } from '../../node/index.js';
5
5
  export function admitDesiredNode(node) {
6
6
  const ref = admitNodeRef(node.node);
@@ -29,14 +29,14 @@ export function admitDesiredEdge(edge) {
29
29
  properties: edge.properties,
30
30
  });
31
31
  }
32
- export function admitNodeRef(ref) {
32
+ function admitNodeRef(ref) {
33
33
  if (typeof ref === 'string') {
34
34
  requireNodeId(ref);
35
35
  return ref;
36
36
  }
37
- if (!isLocalBinding(ref.desired))
37
+ if (!isLocalAlias(ref.desired))
38
38
  throw new TypeError(`Invalid desired Node binding.`);
39
- return Object.freeze({ desired: LocalBinding(ref.desired) });
39
+ return Object.freeze({ desired: LocalAlias(ref.desired) });
40
40
  }
41
41
  export function admitEdgeRef(ref) {
42
42
  if (!ClassKey.is(ref.class))
@@ -1,8 +1,8 @@
1
- import type { LocalBinding } from '../graph/index.js';
1
+ import type { LocalAlias } from '../graph/index.js';
2
2
  import type { NodeId } from '../node/index.js';
3
3
  import type { QueryObservation } from './evidence.js';
4
4
  export type CorrespondenceEntry = {
5
- readonly desired: LocalBinding;
5
+ readonly desired: LocalAlias;
6
6
  readonly kind: 'present';
7
7
  readonly node: NodeId;
8
8
  readonly observation: Extract<QueryObservation, {
@@ -11,7 +11,7 @@ export type CorrespondenceEntry = {
11
11
  };
12
12
  }>;
13
13
  } | {
14
- readonly desired: LocalBinding;
14
+ readonly desired: LocalAlias;
15
15
  readonly kind: 'absent';
16
16
  readonly observation: Extract<QueryObservation, {
17
17
  readonly selection: {
@@ -24,18 +24,19 @@ export interface Correspondence {
24
24
  }
25
25
  export type CorrespondenceConflict = {
26
26
  readonly kind: 'correspondence-duplicate';
27
- readonly desired: LocalBinding;
27
+ readonly desired: LocalAlias;
28
28
  } | {
29
29
  readonly kind: 'correspondence-noninjective';
30
30
  readonly node: NodeId;
31
- readonly desired: readonly LocalBinding[];
31
+ readonly desired: readonly LocalAlias[];
32
32
  } | {
33
33
  readonly kind: 'correspondence-observation-invalid';
34
- readonly desired: LocalBinding;
34
+ readonly desired: LocalAlias;
35
35
  };
36
- export interface CorrespondenceAnalysis {
37
- readonly entries: ReadonlyMap<LocalBinding, CorrespondenceEntry>;
36
+ interface CorrespondenceAnalysis {
37
+ readonly entries: ReadonlyMap<LocalAlias, CorrespondenceEntry>;
38
38
  readonly conflicts: readonly CorrespondenceConflict[];
39
39
  }
40
40
  /** Canonically index correspondence and classify duplicate or non-injective mappings. */
41
41
  export declare function analyzeCorrespondence(entries: readonly CorrespondenceEntry[]): CorrespondenceAnalysis;
42
+ export {};
@@ -1,10 +1,10 @@
1
- import type { LocalBinding } from '../graph/index.js';
1
+ import type { LocalAlias } from '../graph/index.js';
2
2
  import type { NodeId } from '../node/index.js';
3
3
  import type { QueryEdgeAST, QueryNodeAST, QuerySelection } from '../query/index.js';
4
4
  import { type EdgeKey } from '../edge/index.js';
5
5
  export type ObservationRequirement = {
6
6
  readonly kind: 'correspondence';
7
- readonly desired: LocalBinding;
7
+ readonly desired: LocalAlias;
8
8
  } | {
9
9
  readonly kind: 'selection';
10
10
  readonly query: QueryNodeAST | QueryEdgeAST;
@@ -4,7 +4,7 @@ export type QueryPremise = Extract<ReconciliationPlan['premises'][number], {
4
4
  kind: 'query';
5
5
  }>;
6
6
  export type PointPremise = Exclude<ReconciliationPlan['premises'][number], QueryPremise>;
7
- export type MutationAssessment = {
7
+ type MutationAssessment = {
8
8
  readonly kind: 'supported';
9
9
  readonly pointPremises: readonly PointPremise[];
10
10
  readonly queryPremises: readonly QueryPremise[];
@@ -14,3 +14,4 @@ export type MutationAssessment = {
14
14
  };
15
15
  /** Classify whether one complete semantic plan fits the target's atomic Mutation profile. */
16
16
  export declare function assess(plan: ReconciliationPlan, profile: MutationRealizationProfile): MutationAssessment;
17
+ export {};
@@ -1,4 +1,4 @@
1
- import type { GraphData, LocalBinding } from '../graph/index.js';
1
+ import type { GraphData, LocalAlias } from '../graph/index.js';
2
2
  import type { Node, NodeId } from '../node/index.js';
3
3
  import type { Correspondence, CorrespondenceEntry } from './correspondence.js';
4
4
  import type { EvidenceRequirement, ObservationEvidence } from './evidence.js';
@@ -16,11 +16,12 @@ export type ObservationConflict = {
16
16
  readonly kind: 'observation-evidence-contradiction';
17
17
  readonly requirement: EvidenceRequirement;
18
18
  };
19
- export interface ObservationAnalysis {
19
+ interface ObservationAnalysis {
20
20
  readonly nodes: ReadonlyMap<NodeId, Node>;
21
21
  readonly edges: ReadonlyMap<string, Edge>;
22
22
  readonly evidence: readonly ObservationEvidence[];
23
23
  readonly conflicts: readonly ObservationConflict[];
24
24
  }
25
25
  /** Index finite facts and classify contradictory or duplicate evidence. */
26
- export declare function analyzeObservation(observation: Observation, correspondence: ReadonlyMap<LocalBinding, CorrespondenceEntry>): ObservationAnalysis;
26
+ export declare function analyzeObservation(observation: Observation, correspondence: ReadonlyMap<LocalAlias, CorrespondenceEntry>): ObservationAnalysis;
27
+ export {};
@@ -2,6 +2,12 @@ import { type ObservationRequirement } from '#graph/reconcile/evidence';
2
2
  import type { Effect, PlanningBlocker, PlanningConflict, Premise, ReconciliationPlan } from './model.js';
3
3
  export declare function canonicalRequirements(values: readonly ObservationRequirement[]): ObservationRequirement[];
4
4
  export declare function canonicalPremises(values: readonly Premise[]): Premise[];
5
+ /**
6
+ * Distinct desired refs can name one target: an explicit NodeId and a binding whose
7
+ * correspondence observes that Node. Effects with one key and equal content collapse; effects with
8
+ * one key and different content contradict the desired state, which no transition can establish.
9
+ */
10
+ export declare function contradictoryEffects(values: readonly Effect[]): PlanningConflict[];
5
11
  export declare function canonicalEffects(values: readonly Effect[]): Effect[];
6
12
  export declare function canonicalConflicts(values: readonly PlanningConflict[]): PlanningConflict[];
7
13
  export declare function canonicalBlockers(values: readonly PlanningBlocker[]): PlanningBlocker[];
@@ -1,3 +1,4 @@
1
+ import * as portable from '@astrale-os/kernel-dsl/value';
1
2
  import { freezeRequirement, requirementKey, } from '#graph/reconcile/evidence';
2
3
  import { encodeEdgeKey } from '../../edge/index.js';
3
4
  export function canonicalRequirements(values) {
@@ -8,6 +9,30 @@ export function canonicalRequirements(values) {
8
9
  export function canonicalPremises(values) {
9
10
  return [...new Map(values.map((value) => [premiseKey(value), value])).values()].sort(comparePremises);
10
11
  }
12
+ /**
13
+ * Distinct desired refs can name one target: an explicit NodeId and a binding whose
14
+ * correspondence observes that Node. Effects with one key and equal content collapse; effects with
15
+ * one key and different content contradict the desired state, which no transition can establish.
16
+ */
17
+ export function contradictoryEffects(values) {
18
+ const groups = new Map();
19
+ for (const value of values) {
20
+ const key = effectKey(value);
21
+ const group = groups.get(key) ?? new Map();
22
+ group.set(portable.json.serialize(value), value);
23
+ groups.set(key, group);
24
+ }
25
+ const conflicts = [];
26
+ for (const group of groups.values()) {
27
+ if (group.size < 2)
28
+ continue;
29
+ conflicts.push({
30
+ kind: 'desired-target-contradictory',
31
+ effects: [...group].sort(([left], [right]) => compare(left, right)).map(([, value]) => value),
32
+ });
33
+ }
34
+ return conflicts;
35
+ }
11
36
  export function canonicalEffects(values) {
12
37
  return [...new Map(values.map((value) => [effectKey(value), value])).values()].sort(compareEffects);
13
38
  }
@@ -66,6 +91,9 @@ function freezeConflict(value) {
66
91
  if (value.kind === 'correspondence-noninjective') {
67
92
  return Object.freeze({ ...value, desired: Object.freeze([...value.desired]) });
68
93
  }
94
+ if (value.kind === 'desired-target-contradictory') {
95
+ return Object.freeze({ ...value, effects: Object.freeze([...value.effects]) });
96
+ }
69
97
  return Object.freeze({ ...value });
70
98
  }
71
99
  function compare(left, right) {