@e4779/pi-fabric 0.92.41-fork.6 → 0.96.4-fork.10

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 (300) hide show
  1. package/LAWS.bend +502 -0
  2. package/PROOF.bend +452 -0
  3. package/README.md +5 -1
  4. package/THIRD_PARTY_NOTICES.md +9 -0
  5. package/dist/agents/handoff.d.ts +2 -1
  6. package/dist/agents/handoff.d.ts.map +1 -1
  7. package/dist/agents/manager.d.ts +2 -0
  8. package/dist/agents/manager.d.ts.map +1 -1
  9. package/dist/agents.js +6 -5
  10. package/dist/agents.js.map +1 -1
  11. package/dist/chunks/{chunk-3TXOQ5MG.js → chunk-3CJETB4S.js} +828 -204
  12. package/dist/chunks/chunk-3CJETB4S.js.map +7 -0
  13. package/dist/chunks/{chunk-IUCVOZRX.js → chunk-3SIXBW6A.js} +2 -2
  14. package/dist/chunks/chunk-4E63LJDD.js +468 -0
  15. package/dist/chunks/chunk-4E63LJDD.js.map +7 -0
  16. package/dist/chunks/{chunk-AAHHYDTO.js → chunk-4NF3S3NM.js} +1 -1
  17. package/dist/chunks/{chunk-AAHHYDTO.js.map → chunk-4NF3S3NM.js.map} +2 -2
  18. package/dist/chunks/{chunk-2SWRVIYJ.js → chunk-754HA6KO.js} +2 -2
  19. package/dist/chunks/{chunk-K6DHXXF5.js → chunk-B2IVWASP.js} +2 -2
  20. package/dist/chunks/{chunk-ZDNGXLEC.js → chunk-B4HECUJI.js} +2 -2
  21. package/dist/chunks/{chunk-H6DDV6E2.js → chunk-CSJSHBAT.js} +5 -5
  22. package/dist/chunks/{chunk-MW5VI7IW.js → chunk-D4B4CCTA.js} +2 -2
  23. package/dist/chunks/{chunk-EDL4JDW7.js → chunk-EBWMC3OO.js} +2 -2
  24. package/dist/chunks/{chunk-4NUTVNS2.js → chunk-F72MAIQY.js} +31 -368
  25. package/dist/chunks/chunk-F72MAIQY.js.map +7 -0
  26. package/dist/chunks/{chunk-W3FRE4VI.js → chunk-FDIEQEXS.js} +2 -2
  27. package/dist/chunks/{chunk-7A6NVHB5.js → chunk-FJSHRHOR.js} +7 -4
  28. package/dist/chunks/chunk-FJSHRHOR.js.map +7 -0
  29. package/dist/chunks/{chunk-PSNXUZMY.js → chunk-G2F2RDZI.js} +5 -47
  30. package/dist/chunks/chunk-G2F2RDZI.js.map +7 -0
  31. package/dist/chunks/{chunk-3WIGAX56.js → chunk-JCV54SSP.js} +2 -2
  32. package/dist/chunks/chunk-KS44WKJJ.js +51 -0
  33. package/dist/chunks/chunk-KS44WKJJ.js.map +7 -0
  34. package/dist/chunks/{chunk-3H7SDWZI.js → chunk-LNLQ2LX3.js} +22 -1
  35. package/dist/chunks/chunk-LNLQ2LX3.js.map +7 -0
  36. package/dist/chunks/{chunk-G4LADAYY.js → chunk-OINADFEF.js} +8 -3
  37. package/dist/chunks/chunk-OINADFEF.js.map +7 -0
  38. package/dist/chunks/{chunk-UQ4LTUH4.js → chunk-OUAC6O5C.js} +36 -9
  39. package/dist/chunks/chunk-OUAC6O5C.js.map +7 -0
  40. package/dist/chunks/{chunk-MQG5QKGI.js → chunk-Q5BMTL6A.js} +217 -95
  41. package/dist/chunks/chunk-Q5BMTL6A.js.map +7 -0
  42. package/dist/chunks/{chunk-IK6PPFWG.js → chunk-QFKHAAZA.js} +11 -11
  43. package/dist/chunks/chunk-QFKHAAZA.js.map +7 -0
  44. package/dist/chunks/{chunk-RTXZHKMS.js → chunk-QNMQJNXE.js} +7 -3
  45. package/dist/chunks/chunk-QNMQJNXE.js.map +7 -0
  46. package/dist/chunks/{chunk-U5FYOMG5.js → chunk-UBPFGMDQ.js} +6 -2
  47. package/dist/chunks/chunk-UBPFGMDQ.js.map +7 -0
  48. package/dist/chunks/{chunk-FLKGJPCN.js → chunk-ULQFHZJE.js} +4 -1
  49. package/dist/chunks/chunk-ULQFHZJE.js.map +7 -0
  50. package/dist/chunks/{chunk-7VAZ4N43.js → chunk-V3PIO7QL.js} +2 -2
  51. package/dist/chunks/{chunk-MGDLRV2R.js → chunk-VQGO4P7C.js} +2 -2
  52. package/dist/chunks/{chunk-XT4346N7.js → chunk-WXSELMFV.js} +9 -3
  53. package/dist/chunks/chunk-WXSELMFV.js.map +7 -0
  54. package/dist/chunks/{chunk-D5WKZONW.js → chunk-X3IRR7CV.js} +2 -2
  55. package/dist/chunks/{chunk-IJL3QK3J.js → chunk-Y57UHPIK.js} +1 -1
  56. package/dist/chunks/{chunk-IJL3QK3J.js.map → chunk-Y57UHPIK.js.map} +1 -1
  57. package/dist/chunks/{chunk-RKRVOBVO.js → chunk-YC3QQDZ3.js} +2 -2
  58. package/dist/chunks/{chunk-Q4XJ4PYL.js → chunk-ZRI433JP.js} +299 -83
  59. package/dist/chunks/chunk-ZRI433JP.js.map +7 -0
  60. package/dist/chunks/{chunk-36B4AIRT.js → chunk-ZTXZ6JDO.js} +2 -2
  61. package/dist/commands/fabric.d.ts.map +1 -1
  62. package/dist/compaction/bounds.d.ts +4 -0
  63. package/dist/compaction/bounds.d.ts.map +1 -1
  64. package/dist/compaction/branch-summary.d.ts.map +1 -1
  65. package/dist/compaction/dialogue.d.ts +24 -0
  66. package/dist/compaction/dialogue.d.ts.map +1 -0
  67. package/dist/compaction/hook.d.ts +6 -2
  68. package/dist/compaction/hook.d.ts.map +1 -1
  69. package/dist/compaction/hook.js +6 -5
  70. package/dist/compaction/instructions.d.ts +1 -0
  71. package/dist/compaction/instructions.d.ts.map +1 -1
  72. package/dist/compaction/projections.d.ts +3 -3
  73. package/dist/compaction/projections.d.ts.map +1 -1
  74. package/dist/compaction/qa.d.ts.map +1 -1
  75. package/dist/compaction/render.d.ts +11 -0
  76. package/dist/compaction/render.d.ts.map +1 -1
  77. package/dist/components/configuration.js +2 -3
  78. package/dist/components/effect-policy.d.ts +2 -0
  79. package/dist/components/effect-policy.d.ts.map +1 -1
  80. package/dist/components/effect-scope.d.ts.map +1 -1
  81. package/dist/components/supervisor.d.ts +1 -1
  82. package/dist/components/supervisor.d.ts.map +1 -1
  83. package/dist/core/action-registry.d.ts +14 -2
  84. package/dist/core/action-registry.d.ts.map +1 -1
  85. package/dist/core/action-registry.js +7 -5
  86. package/dist/core/provider-bindings.d.ts +8 -2
  87. package/dist/core/provider-bindings.d.ts.map +1 -1
  88. package/dist/core/provider-operations.d.ts +28 -0
  89. package/dist/core/provider-operations.d.ts.map +1 -0
  90. package/dist/core/provider-operations.js +201 -0
  91. package/dist/core/provider-operations.js.map +7 -0
  92. package/dist/core/shell-inbox.d.ts +13 -0
  93. package/dist/core/shell-inbox.d.ts.map +1 -0
  94. package/dist/core/shell-jobs.d.ts +51 -7
  95. package/dist/core/shell-jobs.d.ts.map +1 -1
  96. package/dist/core/shell-limits.d.ts +3 -0
  97. package/dist/core/shell-limits.d.ts.map +1 -0
  98. package/dist/core/shell-monitor.d.ts +51 -0
  99. package/dist/core/shell-monitor.d.ts.map +1 -0
  100. package/dist/entropy/index.js +8 -7
  101. package/dist/entropy/normal-form.d.ts.map +1 -1
  102. package/dist/execution-service.d.ts +1 -1
  103. package/dist/execution-service.d.ts.map +1 -1
  104. package/dist/fabric-runtime-state.d.ts +1 -1
  105. package/dist/fabric-runtime-state.d.ts.map +1 -1
  106. package/dist/fabric-runtime-state.js +1124 -325
  107. package/dist/fabric-runtime-state.js.map +4 -4
  108. package/dist/index.js +155 -44
  109. package/dist/index.js.map +3 -3
  110. package/dist/jev/observation.js +5 -3
  111. package/dist/jev.d.ts +0 -1
  112. package/dist/jev.d.ts.map +1 -1
  113. package/dist/jev.js +9 -13
  114. package/dist/memory/digest.d.ts.map +1 -1
  115. package/dist/memory/digest.js +2 -1
  116. package/dist/memory/discovery.js +6 -5
  117. package/dist/memory/expand-service.d.ts.map +1 -1
  118. package/dist/memory/file-worker.js +9 -8
  119. package/dist/memory/file-worker.js.map +1 -1
  120. package/dist/memory/index.d.ts.map +1 -1
  121. package/dist/memory/normalize.d.ts.map +1 -1
  122. package/dist/memory/normalize.js +5 -4
  123. package/dist/memory/search.js +7 -6
  124. package/dist/memory/worker-provider.js +10 -9
  125. package/dist/memory.js +9 -8
  126. package/dist/memory.js.map +1 -1
  127. package/dist/mesh/store.d.ts.map +1 -1
  128. package/dist/prewalk/handoff.d.ts +1 -1
  129. package/dist/prewalk/handoff.d.ts.map +1 -1
  130. package/dist/protocol.d.ts +2 -0
  131. package/dist/protocol.d.ts.map +1 -1
  132. package/dist/protocol.js +1 -1
  133. package/dist/providers/jev-provider.d.ts +1 -1
  134. package/dist/providers/jev-provider.d.ts.map +1 -1
  135. package/dist/providers/jev-provider.js +9 -7
  136. package/dist/providers/memory-provider.js +9 -8
  137. package/dist/providers/pi-tools-provider.d.ts.map +1 -1
  138. package/dist/providers/tasks-provider.d.ts +12 -0
  139. package/dist/providers/tasks-provider.d.ts.map +1 -0
  140. package/dist/residency/host.js +10 -9
  141. package/dist/residency/pi-entry.js +10 -9
  142. package/dist/residency/pi-entry.js.map +1 -1
  143. package/dist/runtime/core-override-guest-types.js +2 -2
  144. package/dist/runtime/guest-types.d.ts +1 -1
  145. package/dist/runtime/guest-types.d.ts.map +1 -1
  146. package/dist/runtime/guest-types.js +1 -1
  147. package/dist/runtime/monty-runtime.js +1 -2
  148. package/dist/runtime/monty-runtime.js.map +1 -1
  149. package/dist/runtime/typescript-kernel.js +2 -2
  150. package/dist/runtime-state-builtins.d.ts +1 -1
  151. package/dist/runtime-state-builtins.d.ts.map +1 -1
  152. package/dist/schema/controller.d.ts.map +1 -1
  153. package/dist/state/store.d.ts.map +1 -1
  154. package/dist/ui/controller.d.ts +1 -0
  155. package/dist/ui/controller.d.ts.map +1 -1
  156. package/dist/ui/conversation-targets.js +2 -2
  157. package/dist/ui/conversation.js +7 -7
  158. package/dist/ui/dashboard.js +9 -9
  159. package/dist/ui/highlight.d.ts.map +1 -1
  160. package/dist/ui/languages/bend.d.ts +4 -0
  161. package/dist/ui/languages/bend.d.ts.map +1 -0
  162. package/dist/ui/languages/bend.js +73 -0
  163. package/dist/ui/languages/bend.js.map +7 -0
  164. package/dist/ui/settings.js +1 -2
  165. package/dist/ui/settings.js.map +1 -1
  166. package/dist/ui/shell-hang-keys.d.ts.map +1 -1
  167. package/dist/ui/shell-tasks.d.ts +22 -0
  168. package/dist/ui/shell-tasks.d.ts.map +1 -0
  169. package/dist/ui/shell-tasks.js +161 -0
  170. package/dist/ui/shell-tasks.js.map +7 -0
  171. package/dist/ui/shiki-catalog.d.ts +2 -1
  172. package/dist/ui/shiki-catalog.d.ts.map +1 -1
  173. package/dist/ui/snapshot.d.ts.map +1 -1
  174. package/dist/ui/types.d.ts +1 -0
  175. package/dist/ui/types.d.ts.map +1 -1
  176. package/dist/ui/widget.d.ts.map +1 -1
  177. package/dist/verified/authority.d.ts +17 -0
  178. package/dist/verified/authority.d.ts.map +1 -0
  179. package/dist/verified/generated/authority-kernel.d.ts +10 -0
  180. package/dist/verified/generated/authority-kernel.js +116 -0
  181. package/dist/verified/generated/kernel.d.ts +31 -0
  182. package/dist/verified/generated/kernel.js +351 -0
  183. package/dist/verified/generated/lifecycle-kernel.d.ts +7 -0
  184. package/dist/verified/generated/lifecycle-kernel.js +155 -0
  185. package/dist/verified/generated/manifest.json +54 -0
  186. package/dist/verified/generated/provider-kernel.d.ts +9 -0
  187. package/dist/verified/generated/provider-kernel.js +80 -0
  188. package/dist/verified/generated/storage-kernel.d.ts +11 -0
  189. package/dist/verified/generated/storage-kernel.js +98 -0
  190. package/dist/verified/memory.d.ts +11 -0
  191. package/dist/verified/memory.d.ts.map +1 -0
  192. package/dist/verified/nat.d.ts +2 -0
  193. package/dist/verified/nat.d.ts.map +1 -0
  194. package/dist/verified/policy.d.ts +37 -0
  195. package/dist/verified/policy.d.ts.map +1 -0
  196. package/dist/verified/resources.d.ts +14 -0
  197. package/dist/verified/resources.d.ts.map +1 -0
  198. package/dist/verified/storage.d.ts +32 -0
  199. package/dist/verified/storage.d.ts.map +1 -0
  200. package/dist/worker/event-projection.d.ts +6 -0
  201. package/dist/worker/event-projection.d.ts.map +1 -0
  202. package/dist/worker/event-projection.js +99 -0
  203. package/dist/worker/event-projection.js.map +7 -0
  204. package/dist/worker/recovery-watchdog.d.ts +12 -0
  205. package/dist/worker/recovery-watchdog.d.ts.map +1 -0
  206. package/dist/worker/recovery-watchdog.js +41 -0
  207. package/dist/worker/recovery-watchdog.js.map +7 -0
  208. package/dist/worker.js +80 -22
  209. package/dist/worker.js.map +2 -2
  210. package/docs/agents.md +26 -14
  211. package/docs/architecture.md +1 -1
  212. package/docs/background-tasks.md +140 -0
  213. package/docs/compaction.md +91 -28
  214. package/docs/components.md +5 -1
  215. package/docs/configuration.md +6 -6
  216. package/docs/foreman.md +4 -4
  217. package/docs/harnesses.md +95 -0
  218. package/docs/interface.md +7 -0
  219. package/docs/jev.md +59 -52
  220. package/docs/kernels.md +2 -2
  221. package/docs/licenses/bend-apache-2.0.txt +202 -0
  222. package/docs/memory-recall.md +1 -1
  223. package/docs/programmatic-compaction.md +13 -2
  224. package/docs/provider-capabilities.md +197 -0
  225. package/docs/shell-middleware.md +3 -3
  226. package/docs/skills.md +1 -1
  227. package/docs/verified-kernels.md +278 -0
  228. package/package.json +14 -4
  229. package/proofs/abi.json +308 -0
  230. package/proofs/authority-abi.json +7 -0
  231. package/proofs/authority-kernel.bend +23 -0
  232. package/proofs/authority-proof.bend +74 -0
  233. package/proofs/authority-spec.bend +30 -0
  234. package/proofs/authority-state.bend +43 -0
  235. package/proofs/authority-types.d.ts +3 -0
  236. package/proofs/kernel.bend +139 -0
  237. package/proofs/lifecycle-abi.json +3 -0
  238. package/proofs/lifecycle-kernel.bend +11 -0
  239. package/proofs/lifecycle-proof.bend +249 -0
  240. package/proofs/lifecycle-spec.bend +261 -0
  241. package/proofs/lifecycle-types.d.ts +4 -0
  242. package/proofs/lifecycle.bend +119 -0
  243. package/proofs/provider-abi.json +4 -0
  244. package/proofs/provider-kernel.bend +14 -0
  245. package/proofs/provider-plans.bend +28 -0
  246. package/proofs/provider-spec.bend +14 -0
  247. package/proofs/provider-types.d.ts +5 -0
  248. package/proofs/resource-proof.bend +633 -0
  249. package/proofs/resource-spec.bend +133 -0
  250. package/proofs/resources.bend +160 -0
  251. package/proofs/state-kernel.bend +17 -0
  252. package/proofs/state-plans.bend +40 -0
  253. package/proofs/state-proof.bend +42 -0
  254. package/proofs/state-spec.bend +26 -0
  255. package/proofs/storage-abi.json +3 -0
  256. package/proofs/storage-kernel.bend +11 -0
  257. package/proofs/storage-plans.bend +100 -0
  258. package/proofs/storage-proof.bend +176 -0
  259. package/proofs/storage-spec.bend +70 -0
  260. package/proofs/storage-types.d.ts +8 -0
  261. package/proofs/types.d.ts +7 -0
  262. package/scripts/test-verified-kernels.mjs +107 -0
  263. package/scripts/verified-kernels.mjs +136 -0
  264. package/skillsets/python/fabric-jev/SKILL.md +13 -9
  265. package/skillsets/typescript/fabric-exec/SKILL.md +4 -2
  266. package/skillsets/typescript/fabric-jev/SKILL.md +13 -9
  267. package/dist/chunks/chunk-3H7SDWZI.js.map +0 -7
  268. package/dist/chunks/chunk-3TXOQ5MG.js.map +0 -7
  269. package/dist/chunks/chunk-4NUTVNS2.js.map +0 -7
  270. package/dist/chunks/chunk-77PDIBK2.js +0 -129
  271. package/dist/chunks/chunk-77PDIBK2.js.map +0 -7
  272. package/dist/chunks/chunk-7A6NVHB5.js.map +0 -7
  273. package/dist/chunks/chunk-FLKGJPCN.js.map +0 -7
  274. package/dist/chunks/chunk-G4LADAYY.js.map +0 -7
  275. package/dist/chunks/chunk-IK6PPFWG.js.map +0 -7
  276. package/dist/chunks/chunk-MQG5QKGI.js.map +0 -7
  277. package/dist/chunks/chunk-PSNXUZMY.js.map +0 -7
  278. package/dist/chunks/chunk-Q4XJ4PYL.js.map +0 -7
  279. package/dist/chunks/chunk-RTXZHKMS.js.map +0 -7
  280. package/dist/chunks/chunk-U5FYOMG5.js.map +0 -7
  281. package/dist/chunks/chunk-UQ4LTUH4.js.map +0 -7
  282. package/dist/chunks/chunk-XT4346N7.js.map +0 -7
  283. package/dist/jev/browser.d.ts +0 -37
  284. package/dist/jev/browser.d.ts.map +0 -1
  285. package/dist/jev/browser.js +0 -13
  286. package/dist/jev/browser.js.map +0 -7
  287. /package/dist/chunks/{chunk-IUCVOZRX.js.map → chunk-3SIXBW6A.js.map} +0 -0
  288. /package/dist/chunks/{chunk-2SWRVIYJ.js.map → chunk-754HA6KO.js.map} +0 -0
  289. /package/dist/chunks/{chunk-K6DHXXF5.js.map → chunk-B2IVWASP.js.map} +0 -0
  290. /package/dist/chunks/{chunk-ZDNGXLEC.js.map → chunk-B4HECUJI.js.map} +0 -0
  291. /package/dist/chunks/{chunk-H6DDV6E2.js.map → chunk-CSJSHBAT.js.map} +0 -0
  292. /package/dist/chunks/{chunk-MW5VI7IW.js.map → chunk-D4B4CCTA.js.map} +0 -0
  293. /package/dist/chunks/{chunk-EDL4JDW7.js.map → chunk-EBWMC3OO.js.map} +0 -0
  294. /package/dist/chunks/{chunk-W3FRE4VI.js.map → chunk-FDIEQEXS.js.map} +0 -0
  295. /package/dist/chunks/{chunk-3WIGAX56.js.map → chunk-JCV54SSP.js.map} +0 -0
  296. /package/dist/chunks/{chunk-7VAZ4N43.js.map → chunk-V3PIO7QL.js.map} +0 -0
  297. /package/dist/chunks/{chunk-MGDLRV2R.js.map → chunk-VQGO4P7C.js.map} +0 -0
  298. /package/dist/chunks/{chunk-D5WKZONW.js.map → chunk-X3IRR7CV.js.map} +0 -0
  299. /package/dist/chunks/{chunk-RKRVOBVO.js.map → chunk-YC3QQDZ3.js.map} +0 -0
  300. /package/dist/chunks/{chunk-36B4AIRT.js.map → chunk-ZTXZ6JDO.js.map} +0 -0
@@ -0,0 +1,308 @@
1
+ {
2
+ "footprintFits": [
3
+ [
4
+ "count",
5
+ "bigint"
6
+ ],
7
+ [
8
+ "limit",
9
+ "bigint"
10
+ ],
11
+ [
12
+ "valid",
13
+ "boolean"
14
+ ],
15
+ "boolean"
16
+ ],
17
+ "unknownConflict": [
18
+ [
19
+ "leftUnknown",
20
+ "boolean"
21
+ ],
22
+ [
23
+ "leftUnknownOrdered",
24
+ "boolean"
25
+ ],
26
+ [
27
+ "leftOrdered",
28
+ "boolean"
29
+ ],
30
+ [
31
+ "rightUnknown",
32
+ "boolean"
33
+ ],
34
+ [
35
+ "rightUnknownOrdered",
36
+ "boolean"
37
+ ],
38
+ [
39
+ "rightOrdered",
40
+ "boolean"
41
+ ],
42
+ "boolean"
43
+ ],
44
+ "transitionCurrent": [
45
+ [
46
+ "retired",
47
+ "boolean"
48
+ ],
49
+ [
50
+ "sameEpoch",
51
+ "boolean"
52
+ ],
53
+ [
54
+ "sameOwner",
55
+ "boolean"
56
+ ],
57
+ [
58
+ "closed",
59
+ "boolean"
60
+ ],
61
+ "boolean"
62
+ ],
63
+ "canClose": [
64
+ [
65
+ "retiring",
66
+ "boolean"
67
+ ],
68
+ [
69
+ "ownerRetained",
70
+ "boolean"
71
+ ],
72
+ [
73
+ "hasRetainers",
74
+ "boolean"
75
+ ],
76
+ [
77
+ "hasInFlight",
78
+ "boolean"
79
+ ],
80
+ "boolean"
81
+ ],
82
+ "cleanupState": [
83
+ [
84
+ "failed",
85
+ "boolean"
86
+ ],
87
+ [
88
+ "diverted",
89
+ "boolean"
90
+ ],
91
+ "number"
92
+ ],
93
+ "spansSafe": [
94
+ [
95
+ "spans",
96
+ "BendList<Span>"
97
+ ],
98
+ [
99
+ "boundary",
100
+ "bigint"
101
+ ],
102
+ "boolean"
103
+ ],
104
+ "cutAccepted": [
105
+ [
106
+ "cut",
107
+ "Cut"
108
+ ],
109
+ "boolean"
110
+ ],
111
+ "pointerCurrent": [
112
+ [
113
+ "sourceMatches",
114
+ "boolean"
115
+ ],
116
+ [
117
+ "lineageMatches",
118
+ "boolean"
119
+ ],
120
+ "boolean"
121
+ ],
122
+ "chunkAccepted": [
123
+ [
124
+ "chunk",
125
+ "Chunk"
126
+ ],
127
+ "boolean"
128
+ ],
129
+ "coverageComplete": [
130
+ [
131
+ "sourceComplete",
132
+ "boolean"
133
+ ],
134
+ [
135
+ "truncated",
136
+ "boolean"
137
+ ],
138
+ "boolean"
139
+ ],
140
+ "useNormalized": [
141
+ [
142
+ "canonical",
143
+ "boolean"
144
+ ],
145
+ [
146
+ "plan",
147
+ "boolean"
148
+ ],
149
+ [
150
+ "changed",
151
+ "boolean"
152
+ ],
153
+ [
154
+ "accepted",
155
+ "boolean"
156
+ ],
157
+ "boolean"
158
+ ],
159
+ "headReadable": [
160
+ [
161
+ "sequence",
162
+ "boolean"
163
+ ],
164
+ [
165
+ "version",
166
+ "boolean"
167
+ ],
168
+ [
169
+ "committed",
170
+ "boolean"
171
+ ],
172
+ [
173
+ "pending",
174
+ "boolean"
175
+ ],
176
+ [
177
+ "marker",
178
+ "boolean"
179
+ ],
180
+ "boolean"
181
+ ],
182
+ "certificateAccepted": [
183
+ [
184
+ "conditions",
185
+ "BendList<boolean>"
186
+ ],
187
+ "boolean"
188
+ ],
189
+ "consume": [
190
+ [
191
+ "active",
192
+ "boolean"
193
+ ],
194
+ "{ $: 'Tuple'; fst: boolean; snd: boolean }"
195
+ ],
196
+ "lineageSelected": [
197
+ [
198
+ "allBranches",
199
+ "boolean"
200
+ ],
201
+ [
202
+ "member",
203
+ "boolean"
204
+ ],
205
+ "boolean"
206
+ ],
207
+ "knownConflict": [
208
+ [
209
+ "shared",
210
+ "boolean"
211
+ ],
212
+ [
213
+ "leftOrdered",
214
+ "boolean"
215
+ ],
216
+ [
217
+ "rightOrdered",
218
+ "boolean"
219
+ ],
220
+ "boolean"
221
+ ],
222
+ "summaryWithin": [
223
+ [
224
+ "bytes",
225
+ "bigint"
226
+ ],
227
+ [
228
+ "byteLimit",
229
+ "bigint"
230
+ ],
231
+ [
232
+ "projected",
233
+ "bigint"
234
+ ],
235
+ [
236
+ "target",
237
+ "bigint"
238
+ ],
239
+ "boolean"
240
+ ],
241
+ "sampleWithin": [
242
+ [
243
+ "total",
244
+ "bigint"
245
+ ],
246
+ [
247
+ "retained",
248
+ "bigint"
249
+ ],
250
+ [
251
+ "omitted",
252
+ "bigint"
253
+ ],
254
+ [
255
+ "limit",
256
+ "bigint"
257
+ ],
258
+ "boolean"
259
+ ],
260
+ "resourceSource": [
261
+ [
262
+ "names",
263
+ "BendList<ResourceName>"
264
+ ],
265
+ "ResourceScope"
266
+ ],
267
+ "resourceNormalize": [
268
+ [
269
+ "original",
270
+ "ResourceScope"
271
+ ],
272
+ [
273
+ "candidate",
274
+ "BendList<ResourceName>"
275
+ ],
276
+ "ResourceScope"
277
+ ],
278
+ "resourceConflict": [
279
+ [
280
+ "left",
281
+ "ResourceScope"
282
+ ],
283
+ [
284
+ "right",
285
+ "ResourceScope"
286
+ ],
287
+ [
288
+ "leftOrdered",
289
+ "boolean"
290
+ ],
291
+ [
292
+ "rightOrdered",
293
+ "boolean"
294
+ ],
295
+ "boolean"
296
+ ],
297
+ "resourceGroups": [
298
+ [
299
+ "left",
300
+ "BendList<ResourceEffect>"
301
+ ],
302
+ [
303
+ "right",
304
+ "BendList<ResourceEffect>"
305
+ ],
306
+ "boolean"
307
+ ]
308
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "authorityIssue": [["grants", "AuthorityGrants"], "AuthorityState"],
3
+ "authorityLive": [["authority", "AuthorityState"], "boolean"],
4
+ "authorityAllows": [["authority", "AuthorityState"], ["grant", "AuthorityText"], "boolean"],
5
+ "authorityDerive": [["parent", "AuthorityState"], ["candidate", "AuthorityGrants"], "AuthorityState"],
6
+ "authorityRelease": [["authority", "AuthorityState"], "AuthorityState"]
7
+ }
@@ -0,0 +1,23 @@
1
+ import Base
2
+ import ./authority-state.bend as A
3
+
4
+ def authorityIssue(grants: +List<+List<Nat>>) -> A.Authority:
5
+ A.issue(grants)
6
+
7
+ def authorityLive(authority: A.Authority) -> Bool:
8
+ A.live(authority)
9
+
10
+ def authorityAllows(authority: A.Authority, grant: +List<Nat>) -> Bool:
11
+ A.allows(authority, grant)
12
+
13
+ def authorityDerive(parent: A.Authority, candidate: +List<+List<Nat>>) -> A.Authority:
14
+ A.derive(parent, candidate)
15
+
16
+ def authorityRelease(authority: A.Authority) -> A.Authority:
17
+ A.release(authority)
18
+
19
+ type AuthorityKernel is Type:
20
+ AuthorityKernel{issue: +List<+List<Nat>> -> A.Authority, live: A.Authority -> Bool, allows: A.Authority -> +List<Nat> -> Bool, derive: A.Authority -> +List<+List<Nat>> -> A.Authority, release: A.Authority -> A.Authority}
21
+
22
+ def main() -> IO(AuthorityKernel):
23
+ IO.pure(AuthorityKernel, AuthorityKernel{authorityIssue, authorityLive, authorityAllows, authorityDerive, authorityRelease})
@@ -0,0 +1,74 @@
1
+ import Base
2
+ import ./authority-state.bend as A
3
+ import ./authority-spec.bend as S
4
+ import ./resources.bend as R
5
+ import ./resource-proof.bend as P
6
+ import ./resource-spec.bend as Set
7
+
8
+ # Closed universal laws over the executable state transitions. These do not
9
+ # prove JS issuer ownership, serialization, descriptor hashing, or event delivery.
10
+ def useSafe(+authority: A.Authority, +grant: +List<Nat>, p: {A.allows(authority, grant) == True{} : Bool}) -> S.CanUse(authority, grant):
11
+ match authority:
12
+ case A.Released{}:
13
+ P.falseTrue(p)
14
+ case A.Active{grants}:
15
+ P.memberEvidence(grant, grants, p)
16
+
17
+ def useAccepted(+authority: A.Authority, +grant: +List<Nat>, p: S.CanUse(authority, grant)) -> {A.allows(authority, grant) == True{} : Bool}:
18
+ match authority:
19
+ case A.Released{}:
20
+ Empty.absurd({False{} == True{} : Bool}, p)
21
+ case A.Active{grants}:
22
+ P.memberComplete(grants, grant, False{}, p)
23
+
24
+ def selectedSafe(+grants: +List<+List<Nat>>, +candidate: +List<+List<Nat>>, +accepted: Bool, p: {R.covered(candidate, grants, True{}) == accepted : Bool}) -> S.DerivationSafe(A.Active{grants}, candidate, A.select(accepted, candidate)):
25
+ match accepted:
26
+ case False{}:
27
+ Unit{}
28
+ case True{}:
29
+ (P.coverage(candidate, grants, p), {==})
30
+
31
+ def deriveSafe(+parent: A.Authority, +candidate: +List<+List<Nat>>) -> S.DerivationSafe(parent, candidate, A.derive(parent, candidate)):
32
+ match parent:
33
+ case A.Released{}:
34
+ Unit{}
35
+ case A.Active{grants}:
36
+ selectedSafe(grants, candidate, R.covered(candidate, grants, True{}), {==})
37
+
38
+ def deriveAccepted(+parent: A.Authority, +candidate: +List<+List<Nat>>, p: S.CanDerive(parent, candidate)) -> S.DerivationAccepted(candidate, A.derive(parent, candidate)):
39
+ match parent:
40
+ case A.Released{}:
41
+ Empty.absurd(S.DerivationAccepted(candidate, A.Released{}), p)
42
+ case A.Active{grants}:
43
+ %Equal.sym(Bool, R.covered(candidate, grants, True{}), True{}, P.coveredComplete(candidate, grants, True{}, {==}, p)) : {A.select(_, candidate) == A.Active{candidate} : A.Authority}
44
+ {==}
45
+
46
+ def derivedUseAccepted(+parent: A.Authority, +candidate: +List<+List<Nat>>, +grant: +List<Nat>, subset: S.CanDerive(parent, candidate), member: Set.Member(grant, candidate)) -> {A.allows(A.derive(parent, candidate), grant) == True{} : Bool}:
47
+ %Equal.sym(A.Authority, A.derive(parent, candidate), A.Active{candidate}, deriveAccepted(parent, candidate, subset)) : {A.allows(_, grant) == True{} : Bool}
48
+ P.memberComplete(candidate, grant, False{}, member)
49
+
50
+ def childUseSelected(+grants: +List<+List<Nat>>, +candidate: +List<+List<Nat>>, +grant: +List<Nat>, +accepted: Bool, p: {R.covered(candidate, grants, True{}) == accepted : Bool}, used: {A.allows(A.select(accepted, candidate), grant) == True{} : Bool}) -> Set.Member(grant, grants):
51
+ match accepted:
52
+ case False{}:
53
+ Empty.absurd(Set.Member(grant, grants), P.falseTrue(used))
54
+ case True{}:
55
+ P.subsetMember(candidate, grants, grant, P.memberEvidence(grant, candidate, used), P.coverage(candidate, grants, p))
56
+
57
+ def childUseSafe(+parent: A.Authority, +candidate: +List<+List<Nat>>, +grant: +List<Nat>, used: {A.allows(A.derive(parent, candidate), grant) == True{} : Bool}) -> S.CanUse(parent, grant):
58
+ match parent:
59
+ case A.Released{}:
60
+ P.falseTrue(used)
61
+ case A.Active{grants}:
62
+ childUseSelected(grants, candidate, grant, R.covered(candidate, grants, True{}), {==}, used)
63
+
64
+ def releasedCannotUse(+authority: A.Authority, +grant: +List<Nat>) -> {A.allows(A.release(authority), grant) == False{} : Bool}:
65
+ {==}
66
+
67
+ def releasedCannotDerive(+authority: A.Authority, +candidate: +List<+List<Nat>>) -> {A.derive(A.release(authority), candidate) == A.Released{} : A.Authority}:
68
+ {==}
69
+
70
+ def releaseNotLive(+authority: A.Authority) -> {A.live(A.release(authority)) == False{} : Bool}:
71
+ {==}
72
+
73
+ def issueExact(+grants: +List<+List<Nat>>) -> {A.issue(grants) == A.Active{grants} : A.Authority}:
74
+ {==}
@@ -0,0 +1,30 @@
1
+ import Base
2
+ import ./authority-state.bend as A
3
+ import ./resource-spec.bend as Set
4
+
5
+ # Independent proof-relevant safety and acceptance specifications. Set.Member
6
+ # and Set.Subset use full propositional list equality, not Boolean predicates.
7
+ def CanUse(authority: A.Authority, grant: +List<Nat>) -> Type:
8
+ match authority:
9
+ case A.Released{}:
10
+ Empty
11
+ case A.Active{grants}:
12
+ Set.Member(grant, grants)
13
+
14
+ def CanDerive(parent: A.Authority, candidate: +List<+List<Nat>>) -> Type:
15
+ match parent:
16
+ case A.Released{}:
17
+ Empty
18
+ case A.Active{grants}:
19
+ Set.Subset(candidate, grants)
20
+
21
+ def DerivationSafe(+parent: A.Authority, candidate: +List<+List<Nat>>, child: A.Authority) -> Type:
22
+ match child:
23
+ case A.Released{}:
24
+ Unit
25
+ case A.Active{actual}:
26
+ CanDerive(parent, actual) & {actual == candidate : +List<+List<Nat>>}
27
+
28
+ # Positive acceptance is exact output equality, ruling out deny-all kernels.
29
+ def DerivationAccepted(candidate: +List<+List<Nat>>, child: A.Authority) -> Type:
30
+ {child == A.Active{candidate} : A.Authority}
@@ -0,0 +1,43 @@
1
+ import Base
2
+ import ./resources.bend as R
3
+
4
+ # One grant is the complete UTF-16 text encoding of the canonical tuple
5
+ # [ref, provider, binding identity, generation, descriptor identity]. The JS
6
+ # tuple codec is trusted. No length bounds, prefixes, or hashes are computed here.
7
+ type Authority is Data:
8
+ Released{}
9
+ Active{grants: +List<+List<Nat>>}
10
+
11
+ def issue(grants: +List<+List<Nat>>) -> Authority:
12
+ Active{grants}
13
+
14
+ def live(authority: Authority) -> Bool:
15
+ match authority:
16
+ case Released{}:
17
+ False{}
18
+ case Active{grants}:
19
+ True{}
20
+
21
+ def allows(authority: Authority, grant: +List<Nat>) -> Bool:
22
+ match authority:
23
+ case Released{}:
24
+ False{}
25
+ case Active{grants}:
26
+ R.member(grants, grant, False{})
27
+
28
+ def select(accepted: Bool, candidate: +List<+List<Nat>>) -> Authority:
29
+ match accepted:
30
+ case False{}:
31
+ Released{}
32
+ case True{}:
33
+ Active{candidate}
34
+
35
+ def derive(parent: Authority, +candidate: +List<+List<Nat>>) -> Authority:
36
+ match parent:
37
+ case Released{}:
38
+ Released{}
39
+ case Active{grants}:
40
+ select(R.covered(candidate, grants, True{}), candidate)
41
+
42
+ def release(authority: Authority) -> Authority:
43
+ Released{}
@@ -0,0 +1,3 @@
1
+ export type AuthorityText = { $: "Nil" } | { $: "Con"; head: bigint; tail: AuthorityText };
2
+ export type AuthorityGrants = { $: "Nil" } | { $: "Con"; head: AuthorityText; tail: AuthorityGrants };
3
+ export type AuthorityState = { $: "Released" } | { $: "Active"; grants: AuthorityGrants };
@@ -0,0 +1,139 @@
1
+ import Base
2
+ import ./resources.bend as R
3
+
4
+ # This module is the executable policy, not a reference implementation.
5
+ def all(xs: +List<Bool>) -> Bool:
6
+ match xs:
7
+ case Nil{}:
8
+ True{}
9
+ case Con{False{}, t}:
10
+ False{}
11
+ case Con{True{}, t}:
12
+ all(t)
13
+
14
+ def footprintConditions(count: Nat, limit: Nat, valid: Bool) -> +List<Bool>:
15
+ [valid, Nat.is_le(count, limit)]
16
+
17
+ def footprintFits(count: Nat, limit: Nat, valid: Bool) -> Bool:
18
+ all(footprintConditions(count, limit, valid))
19
+
20
+ def unknownConflict(lu: Bool, luo: Bool, lo: Bool, ru: Bool, ruo: Bool, ro: Bool) -> Bool:
21
+ (lu && (luo || ro)) || (ru && (ruo || lo))
22
+
23
+ def transitionConditions(retired: Bool, epoch: Bool, owner: Bool, closed: Bool) -> +List<Bool>:
24
+ [Bool.not(retired), epoch, owner, Bool.not(closed)]
25
+
26
+ def transitionCurrent(retired: Bool, epoch: Bool, owner: Bool, closed: Bool) -> Bool:
27
+ all(transitionConditions(retired, epoch, owner, closed))
28
+
29
+ def closeConditions(retiring: Bool, owner: Bool, retained: Bool, inflight: Bool) -> +List<Bool>:
30
+ [retiring, Bool.not(owner), Bool.not(retained), Bool.not(inflight)]
31
+
32
+ def canClose(retiring: Bool, owner: Bool, retained: Bool, inflight: Bool) -> Bool:
33
+ all(closeConditions(retiring, owner, retained, inflight))
34
+
35
+ def cleanupState(failed: Bool, diverted: Bool) -> U32:
36
+ match failed diverted:
37
+ case True{} _:
38
+ 2
39
+ case False{} True{}:
40
+ 1
41
+ case False{} False{}:
42
+ 0
43
+
44
+ type Span is Data:
45
+ Span{first: Nat, last: Nat, paired: Bool}
46
+
47
+ def spanSafe(+boundary: Nat, span: Span) -> Bool:
48
+ match span:
49
+ case Span{first, last, paired}:
50
+ Bool.not(paired) || Nat.is_le(boundary, first) || Nat.is_lt(last, boundary)
51
+
52
+ def spanConditions(spans: +List<Span>, +boundary: Nat) -> +List<Bool>:
53
+ match spans:
54
+ case Nil{}:
55
+ Nil{}
56
+ case Con{h, t}:
57
+ spanSafe(boundary, h) <> spanConditions(t, boundary)
58
+
59
+ def spansSafe(spans: +List<Span>, boundary: Nat) -> Bool:
60
+ all(spanConditions(spans, boundary))
61
+
62
+ type Cut is Data:
63
+ Cut{eligible: Bool, afterPrevious: Bool, retained: Nat, budget: Nat, boundary: Nat, spans: +List<Span>}
64
+
65
+ def cutConditions(cut: Cut) -> +List<Bool>:
66
+ match cut:
67
+ case Cut{eligible, afterPrevious, retained, budget, boundary, spans}:
68
+ [eligible, afterPrevious, Nat.is_le(retained, budget), spansSafe(spans, boundary)]
69
+
70
+ def cutAccepted(cut: Cut) -> Bool:
71
+ all(cutConditions(cut))
72
+
73
+ def lineageSelected(allBranches: Bool, member: Bool) -> Bool:
74
+ allBranches || member
75
+
76
+ def pointerCurrent(source: Bool, lineage: Bool) -> Bool:
77
+ all([source, lineage])
78
+
79
+ type Chunk is Data:
80
+ Chunk{start: Nat, end: Nat, total: Nat, expectedStart: Nat, expectedTotal: Nat, length: Nat, complete: Bool}
81
+
82
+ def chunkConditions(chunk: Chunk) -> +List<Bool>:
83
+ match chunk:
84
+ case Chunk{+start, +end, +total, expectedStart, expectedTotal, length, +complete}:
85
+ [Nat.is_eq(start, expectedStart), Nat.is_eq(total, expectedTotal), Nat.is_le(start, end), Nat.is_le(end, total), Nat.is_eq(length, Nat.sub(end, start)), Bool.not(Bool.xor(complete, Nat.is_eq(end, total))), complete || Nat.is_lt(start, end)]
86
+
87
+ def chunkAccepted(chunk: Chunk) -> Bool:
88
+ all(chunkConditions(chunk))
89
+
90
+ def coverageComplete(sourceComplete: Bool, truncated: Bool) -> Bool:
91
+ all([sourceComplete, Bool.not(truncated)])
92
+
93
+ def normalizationConditions(canonical: Bool, plan: Bool, changed: Bool, accepted: Bool) -> +List<Bool>:
94
+ [Bool.not(canonical), plan, changed, accepted]
95
+
96
+ def useNormalized(canonical: Bool, plan: Bool, changed: Bool, accepted: Bool) -> Bool:
97
+ all(normalizationConditions(canonical, plan, changed, accepted))
98
+
99
+ def headReadable(sequence: Bool, version: Bool, committed: Bool, pending: Bool, marker: Bool) -> Bool:
100
+ all([sequence, version, committed || (pending && marker)])
101
+
102
+ def certificateAccepted(conditions: +List<Bool>) -> Bool:
103
+ all(conditions)
104
+
105
+ def consume(active: Bool) -> Bool & Bool:
106
+ (active, False{})
107
+
108
+ def knownConflict(shared: Bool, leftOrdered: Bool, rightOrdered: Bool) -> Bool:
109
+ shared && (leftOrdered || rightOrdered)
110
+
111
+ def summaryWithin(bytes: Nat, byteLimit: Nat, projected: Nat, target: Nat) -> Bool:
112
+ all([Nat.is_le(bytes, byteLimit), Nat.is_le(projected, target)])
113
+
114
+ def sampleWithin(total: Nat, retained: Nat, omitted: Nat, limit: Nat) -> Bool:
115
+ +kept = retained
116
+ all([Nat.is_eq(total, Nat.add(kept, omitted)), Nat.is_le(kept, limit)])
117
+
118
+ def resourceSource(names: +List<+List<Nat>>) -> R.Scope:
119
+ R.source(names)
120
+
121
+ def resourceNormalize(original: R.Scope, candidate: +List<+List<Nat>>) -> R.Scope:
122
+ R.normalize(original, candidate)
123
+
124
+ def resourceConflict(left: R.Scope, right: R.Scope, lo: Bool, ro: Bool) -> Bool:
125
+ R.conflict(left, right, lo, ro)
126
+
127
+ def resourceGroups(left: +List<R.Effect>, right: +List<R.Effect>) -> Bool:
128
+ R.groups(left, right, False{})
129
+
130
+ type Kernel is Type:
131
+ Kernel{resourceSource: +List<+List<Nat>> -> R.Scope, resourceNormalize: R.Scope -> +List<+List<Nat>> -> R.Scope, resourceConflict: R.Scope -> R.Scope -> Bool -> Bool -> Bool, resourceGroups: +List<R.Effect> -> +List<R.Effect> -> Bool, knownConflict: Bool -> Bool -> Bool -> Bool, summaryWithin: Nat -> Nat -> Nat -> Nat -> Bool, sampleWithin: Nat -> Nat -> Nat -> Nat -> Bool, footprintFits: Nat -> Nat -> Bool -> Bool, unknownConflict: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool, transitionCurrent: Bool -> Bool -> Bool -> Bool -> Bool, canClose: Bool -> Bool -> Bool -> Bool -> Bool, cleanupState: Bool -> Bool -> U32, spansSafe: +List<Span> -> Nat -> Bool, cutAccepted: Cut -> Bool, lineageSelected: Bool -> Bool -> Bool, pointerCurrent: Bool -> Bool -> Bool, chunkAccepted: Chunk -> Bool, coverageComplete: Bool -> Bool -> Bool, useNormalized: Bool -> Bool -> Bool -> Bool -> Bool, headReadable: Bool -> Bool -> Bool -> Bool -> Bool -> Bool, certificateAccepted: +List<Bool> -> Bool, consume: Bool -> Bool & Bool}
132
+
133
+ def kernel() -> Kernel:
134
+ Kernel{resourceSource, resourceNormalize, resourceConflict, resourceGroups, knownConflict, summaryWithin, sampleWithin, footprintFits, unknownConflict, transitionCurrent, canClose, cleanupState, spansSafe, cutAccepted, lineageSelected, pointerCurrent, chunkAccepted, coverageComplete, useNormalized, headReadable, certificateAccepted, consume}
135
+
136
+ # The CLI only emits JS for a runnable main. The build bridge removes its two
137
+ # invocation statements and exports kernel(); no IO is executed at import.
138
+ def main() -> IO(Kernel):
139
+ IO.pure(Kernel, kernel())
@@ -0,0 +1,3 @@
1
+ {
2
+ "bindingStep": [["life", "BindingLife"], ["event", "BindingEvent"], "BindingOutcome"]
3
+ }
@@ -0,0 +1,11 @@
1
+ import Base
2
+ import ./lifecycle.bend as L
3
+
4
+ def bindingStep(life: L.Life, event: L.BindingEvent) -> L.Outcome:
5
+ L.bindingStep(life, event)
6
+
7
+ type LifecycleKernel is Type:
8
+ LifecycleKernel{step: L.Life -> L.BindingEvent -> L.Outcome}
9
+
10
+ def main() -> IO(LifecycleKernel):
11
+ IO.pure(LifecycleKernel, LifecycleKernel{bindingStep})