@e4779/pi-fabric 0.92.42-fork.7 → 0.96.4-fork.9

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 (296) 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/recovery-watchdog.d.ts +12 -0
  201. package/dist/worker/recovery-watchdog.d.ts.map +1 -0
  202. package/dist/worker/recovery-watchdog.js +41 -0
  203. package/dist/worker/recovery-watchdog.js.map +7 -0
  204. package/dist/worker.js +70 -20
  205. package/dist/worker.js.map +2 -2
  206. package/docs/agents.md +20 -14
  207. package/docs/architecture.md +1 -1
  208. package/docs/background-tasks.md +140 -0
  209. package/docs/compaction.md +91 -28
  210. package/docs/components.md +5 -1
  211. package/docs/configuration.md +6 -6
  212. package/docs/foreman.md +4 -4
  213. package/docs/harnesses.md +95 -0
  214. package/docs/interface.md +7 -0
  215. package/docs/jev.md +59 -52
  216. package/docs/kernels.md +2 -2
  217. package/docs/licenses/bend-apache-2.0.txt +202 -0
  218. package/docs/memory-recall.md +1 -1
  219. package/docs/programmatic-compaction.md +13 -2
  220. package/docs/provider-capabilities.md +197 -0
  221. package/docs/shell-middleware.md +3 -3
  222. package/docs/skills.md +1 -1
  223. package/docs/verified-kernels.md +278 -0
  224. package/package.json +14 -4
  225. package/proofs/abi.json +308 -0
  226. package/proofs/authority-abi.json +7 -0
  227. package/proofs/authority-kernel.bend +23 -0
  228. package/proofs/authority-proof.bend +74 -0
  229. package/proofs/authority-spec.bend +30 -0
  230. package/proofs/authority-state.bend +43 -0
  231. package/proofs/authority-types.d.ts +3 -0
  232. package/proofs/kernel.bend +139 -0
  233. package/proofs/lifecycle-abi.json +3 -0
  234. package/proofs/lifecycle-kernel.bend +11 -0
  235. package/proofs/lifecycle-proof.bend +249 -0
  236. package/proofs/lifecycle-spec.bend +261 -0
  237. package/proofs/lifecycle-types.d.ts +4 -0
  238. package/proofs/lifecycle.bend +119 -0
  239. package/proofs/provider-abi.json +4 -0
  240. package/proofs/provider-kernel.bend +14 -0
  241. package/proofs/provider-plans.bend +28 -0
  242. package/proofs/provider-spec.bend +14 -0
  243. package/proofs/provider-types.d.ts +5 -0
  244. package/proofs/resource-proof.bend +633 -0
  245. package/proofs/resource-spec.bend +133 -0
  246. package/proofs/resources.bend +160 -0
  247. package/proofs/state-kernel.bend +17 -0
  248. package/proofs/state-plans.bend +40 -0
  249. package/proofs/state-proof.bend +42 -0
  250. package/proofs/state-spec.bend +26 -0
  251. package/proofs/storage-abi.json +3 -0
  252. package/proofs/storage-kernel.bend +11 -0
  253. package/proofs/storage-plans.bend +100 -0
  254. package/proofs/storage-proof.bend +176 -0
  255. package/proofs/storage-spec.bend +70 -0
  256. package/proofs/storage-types.d.ts +8 -0
  257. package/proofs/types.d.ts +7 -0
  258. package/scripts/test-verified-kernels.mjs +107 -0
  259. package/scripts/verified-kernels.mjs +136 -0
  260. package/skillsets/python/fabric-jev/SKILL.md +13 -9
  261. package/skillsets/typescript/fabric-exec/SKILL.md +4 -2
  262. package/skillsets/typescript/fabric-jev/SKILL.md +13 -9
  263. package/dist/chunks/chunk-3H7SDWZI.js.map +0 -7
  264. package/dist/chunks/chunk-3TXOQ5MG.js.map +0 -7
  265. package/dist/chunks/chunk-4NUTVNS2.js.map +0 -7
  266. package/dist/chunks/chunk-77PDIBK2.js +0 -129
  267. package/dist/chunks/chunk-77PDIBK2.js.map +0 -7
  268. package/dist/chunks/chunk-7A6NVHB5.js.map +0 -7
  269. package/dist/chunks/chunk-FLKGJPCN.js.map +0 -7
  270. package/dist/chunks/chunk-G4LADAYY.js.map +0 -7
  271. package/dist/chunks/chunk-IK6PPFWG.js.map +0 -7
  272. package/dist/chunks/chunk-MQG5QKGI.js.map +0 -7
  273. package/dist/chunks/chunk-PSNXUZMY.js.map +0 -7
  274. package/dist/chunks/chunk-Q4XJ4PYL.js.map +0 -7
  275. package/dist/chunks/chunk-RTXZHKMS.js.map +0 -7
  276. package/dist/chunks/chunk-U5FYOMG5.js.map +0 -7
  277. package/dist/chunks/chunk-UQ4LTUH4.js.map +0 -7
  278. package/dist/chunks/chunk-XT4346N7.js.map +0 -7
  279. package/dist/jev/browser.d.ts +0 -37
  280. package/dist/jev/browser.d.ts.map +0 -1
  281. package/dist/jev/browser.js +0 -13
  282. package/dist/jev/browser.js.map +0 -7
  283. /package/dist/chunks/{chunk-IUCVOZRX.js.map → chunk-3SIXBW6A.js.map} +0 -0
  284. /package/dist/chunks/{chunk-2SWRVIYJ.js.map → chunk-754HA6KO.js.map} +0 -0
  285. /package/dist/chunks/{chunk-K6DHXXF5.js.map → chunk-B2IVWASP.js.map} +0 -0
  286. /package/dist/chunks/{chunk-ZDNGXLEC.js.map → chunk-B4HECUJI.js.map} +0 -0
  287. /package/dist/chunks/{chunk-H6DDV6E2.js.map → chunk-CSJSHBAT.js.map} +0 -0
  288. /package/dist/chunks/{chunk-MW5VI7IW.js.map → chunk-D4B4CCTA.js.map} +0 -0
  289. /package/dist/chunks/{chunk-EDL4JDW7.js.map → chunk-EBWMC3OO.js.map} +0 -0
  290. /package/dist/chunks/{chunk-W3FRE4VI.js.map → chunk-FDIEQEXS.js.map} +0 -0
  291. /package/dist/chunks/{chunk-3WIGAX56.js.map → chunk-JCV54SSP.js.map} +0 -0
  292. /package/dist/chunks/{chunk-7VAZ4N43.js.map → chunk-V3PIO7QL.js.map} +0 -0
  293. /package/dist/chunks/{chunk-MGDLRV2R.js.map → chunk-VQGO4P7C.js.map} +0 -0
  294. /package/dist/chunks/{chunk-D5WKZONW.js.map → chunk-X3IRR7CV.js.map} +0 -0
  295. /package/dist/chunks/{chunk-RKRVOBVO.js.map → chunk-YC3QQDZ3.js.map} +0 -0
  296. /package/dist/chunks/{chunk-36B4AIRT.js.map → chunk-ZTXZ6JDO.js.map} +0 -0
@@ -0,0 +1,197 @@
1
+ # Provider capabilities
2
+
3
+ Every registry action uses the same executable, proved dispatch-plan kernel.
4
+ This covers state, mesh, memory, schema, agents, components, compact, prewalk,
5
+ Jev, Pi tools, captured extensions, MCP, and third-party registrations. There
6
+ is no opt-in flag or provider-supplied “verified” label. Additional compiled
7
+ kernels own capability attenuation, binding lifecycle transitions, and mesh CAS
8
+ revision decisions.
9
+
10
+ Verification covers dispatch decisions, not arbitrary provider implementations.
11
+ Native callers bypassing the registry remain outside this boundary.
12
+
13
+ ## Dispatch and authority
14
+
15
+ `ActionRegistry` resolves an issued capability view or unrestricted host/root
16
+ authority, prepares and validates arguments, and applies authorization and
17
+ approval policy. The lazy `src/core/provider-operations.ts` interpreter then:
18
+
19
+ 1. Snapshots structured-cloneable arguments in a private payload slot.
20
+ 2. Issues a ticket bound to the provider binding UUID, generation, operation kind,
21
+ exact action ref, descriptor hash, and payload-slot identifier.
22
+ 3. Consumes the ticket synchronously before asynchronous observations.
23
+ 4. Re-describes the bound provider, checks cancellation and authority, and runs
24
+ `providerTake` from the generated `proofs/provider-kernel.bend` artifact.
25
+ 5. Dispatches the action and slot selected by the plan, or refuses the call.
26
+ No asynchronous gap separates that decision from the provider invocation.
27
+
28
+ Ordinary invocation, scoped acquisition, speculative launch, and cached-result
29
+ replay use this path. Speculation requires read risk and a `none` effect; an
30
+ eligibility callback cannot override that floor. Cache tokens include the
31
+ binding, descriptor hash, and capability-view identity. Replay is revalidated
32
+ before disclosure.
33
+
34
+ Preparation outputs are snapshotted before validation. Approval, tracing and
35
+ speculation callbacks receive separate copies, so they cannot change the owned
36
+ validated payload. Shared backing memory is refused, including buffers hidden
37
+ inside maps, typed views, and native WebAssembly memory. This is a tested host
38
+ adapter contract, not a Bend proof of JavaScript cloning or schema validation.
39
+
40
+ Tickets are one-use. This is not distributed exactly-once execution or an
41
+ idempotency guarantee for independently retried calls. Arguments must be
42
+ structured-cloneable data; native function-bearing arguments are refused.
43
+ Native aliases resolve to the descriptor's canonical action before dispatch,
44
+ and that exact canonical target is rechecked.
45
+
46
+ ## Capability views
47
+
48
+ Capability views are immutable, issuer-owned, in-process authorities. Copies,
49
+ forged records, views from another registry, released views, and revoked derived
50
+ views are refused. Portable semantic digests describe capabilities; they are
51
+ not bearer grants. Another runtime must resolve and issue its own view.
52
+
53
+ The compiled authority reducer derives children only from exact parent grants.
54
+ Each grant includes its ref, provider, binding identity, generation, and descriptor
55
+ identity. Use and release consult private canonical state; public view fields are
56
+ presentation data. A child view cannot widen its parent's exact action grants. Parent release
57
+ revokes existing children and drops their binding holds. Release leases
58
+ explicitly: garbage collection is not a resource protocol.
59
+
60
+ Rolling replacement and withdrawal permit retained old generations.
61
+ `registry.revokeProvider(name)` revokes the current generation and cancels its
62
+ admitted callers. Releasing a view revokes that view's borrowers, not other
63
+ views or root authority. A generation whose close has begun cannot admit work.
64
+
65
+ An action grant such as `memory.recall` authorizes that action's argument surface.
66
+ It does not become a key-, path-, tenant-, or collection-scoped grant. A restricted
67
+ guest must not also receive ambient bypass APIs.
68
+
69
+ ## Cancellation and cleanup
70
+
71
+ Caller cancellation does not discard the underlying provider promise. Catalog
72
+ and argument-preparation work and lifecycle finalizers are tracked too. Ordinary
73
+ conflict footprints remain until the actual call settles, not just its caller.
74
+
75
+ Late canceled acquisitions are disposed. Successful supervised acquisitions
76
+ transfer disposal synchronously into their owner's inverse stack, preserving
77
+ owner-before-resource cleanup. Unadopted acquisitions retain automatic abort
78
+ cleanup; failed ownership transfer disposes before publication. Cleanup callbacks are captured once,
79
+ shared between cancellation, explicit disposal, and shutdown, and retained
80
+ through actual completion. Invalid acquisition results and failed cleanup or
81
+ close revoke and quarantine the binding. Failed cleanup is never reported as successful.
82
+
83
+ The compiled lifecycle reducer owns binding phases, hold/work counts, ordinary
84
+ versus cleanup admission, and the transition that reserves close. Revocation and
85
+ owner release preserve outstanding work. Close is reserved synchronously before
86
+ arbitrary finalizers; neither new work nor another close can enter that generation.
87
+ Catalog finalizers are awaited through their actual completion, including returned
88
+ promises. Shutdown revokes views and releases their real leases; it never invents
89
+ a zero hold count while a lease remains owned.
90
+
91
+ Registry shutdown budgets scoped drain and binding drain separately, one second
92
+ each. Non-cooperative work is not killed or declared finished. Inspect
93
+ `registry.providerStatus()` for retiring/in-flight bindings and retained errors.
94
+ Providers are not closed under tracked work; successful late settlement can
95
+ complete their close. Manual disposal can still await a non-cooperative disposer.
96
+ Externally owned providers retain their session ownership exemption.
97
+
98
+ A provider promise settling does not establish that its subprocesses or remote
99
+ work have stopped. Revocation cannot undo an already-started irreversible effect.
100
+ In-flight provider work can continue after caller cancellation; dispatch admission
101
+ does not recheck authority at every internal commit. The registry provides no
102
+ generic rollback guarantee.
103
+
104
+ ## Storage transitions
105
+
106
+ `MeshStore.put/delete` execute `proofs/storage-kernel.bend` plans. Requests capture
107
+ the key, expected revision, JSON value and writer identity before waiting for the
108
+ lock. The interpreter reads the locked slot and applies the plan's exact key,
109
+ payload, identity and successor revisions. CAS refusal, missing-key deletion and
110
+ revision exhaustion perform no replacement.
111
+
112
+ Live-key updates remain `+1`. Successful deletion consumes a revision. New or
113
+ recreated keys allocate above a persisted store-wide high-water mark, so bounded
114
+ tombstone eviction does not cause previously issued positive revisions to recur.
115
+ The JSON envelope remains `format: 1` for existing readers; `revisionFormat: 2`
116
+ requires its high-water mark. Every writer must follow the current protocol.
117
+ Older writers, external edits, deletion or rollback of the storage file are
118
+ outside the freshness guarantee.
119
+
120
+ Legacy migration seeds the clock from retained entries and tombstones. History
121
+ already discarded by older writers cannot be reconstructed. Unrecoverable or
122
+ empty damaged snapshots remain in place: reads tolerate them, while writes refuse
123
+ until a valid snapshot is restored. Complete concatenated snapshots retain their
124
+ existing newest-complete-snapshot recovery behavior. Invalid, missing, regressed
125
+ relative to retained history, or exhausted clocks fail closed on mutation.
126
+
127
+ Revisions use radix-`2^32` limbs, keeping arithmetic inside Bend's immediate-Nat
128
+ domain while representing every nonnegative JS-safe integer. The JSON/UTF-16
129
+ codec, faithful slot observation, history preservation, cooperative lock, atomic
130
+ rename and cache publication remain host assumptions. These plans do not prove
131
+ crash durability, multi-write state transactions or schema filesystem rollback.
132
+
133
+ ## Verification boundary
134
+
135
+ Seven laws cover the executable provider wrapper: `provider_plan_safe`,
136
+ `provider_ticket_consumed`, `provider_replay_refused`,
137
+ `provider_revocation_consumes`, `provider_revoked_refused`,
138
+ `provider_canceled_refused`, and `provider_admission_complete`. They use shared
139
+ full-text plan specifications. The proof forwards a payload-slot identifier,
140
+ not a formal representation of arbitrary JavaScript arguments or provider code.
141
+
142
+ | Guarantee | Evidence | Boundary |
143
+ | --- | --- | --- |
144
+ | Exact, one-use dispatch plans | Executable laws, pinned generation and artifact receipt, ABI tests and negative mutations | Compiler, codec, and interpreter remain trusted |
145
+ | All registry action routes use the gate | Ordinary/scoped/speculative/replay integration tests and bundled smoke | Direct native calls bypass the registry |
146
+ | Exact authority attenuation/use/release | Executable subset, membership, positive acceptance and release laws; forged/cross-registry/retained-generation tests | JS issuer ownership, tuple codec, hashing and parent-abort delivery remain trusted |
147
+ | Binding lifecycle transitions | Executable admission, count-preservation, exact release and close-reservation laws; real-promise and finalizer tests | Host event delivery, private maps and correspondence to provider-owned work remain trusted |
148
+ | Validated/approved argument fidelity | Private snapshots and adversarial mutation/shared-memory tests across ordinary, scoped and speculative routes | Structured cloning, schema validation and the payload-slot interpreter remain trusted |
149
+ | Cancellation preserves ownership | Ignored-abort calls, retained conflicts, late acquisition, cleanup, quarantine and closing-generation tests | Provider-owned background work remains implementation-specific |
150
+ | Mesh CAS/revision plans | Executable safety, positive put/delete/no-op, stale refusal and overflow laws; mutation, eviction, restart and concurrent-writer tests | Faithful locked observations, persistent high-water history, codecs and filesystem effects remain trusted |
151
+ | Cache provenance | Descriptor/view identity, replay validation and read-only eligibility tests | Result and context semantics remain provider-specific |
152
+ | Packaging and lazy loading | Artifact checks, stable lazy entry, cold-import and first-use tests | Supported-platform CI and independent review remain necessary |
153
+
154
+ The host issuer, descriptor truthfulness, hash collision resistance, UUID
155
+ uniqueness, UTF-16/ABI codec, private-slot fidelity, interpreter, lifecycle event
156
+ observation, approval hooks, metadata/preparation hooks, compiler and JavaScript
157
+ runtime are trusted assumptions. Metadata hooks are not proved effect-free.
158
+ Compiler checking does not replace independent specification or adapter review.
159
+
160
+ State and schema use the mesh CAS primitive, but their multi-write transaction
161
+ protocols are not proved by either dispatch admission or the storage reducer.
162
+ Memory collection/lineage filtering and read-disclosure noninterference require
163
+ separate reasoning. Agent/process ownership and remote commit/cancellation remain
164
+ provider responsibilities. Pi tools, shell commands, captured extensions, MCP,
165
+ and managed or third-party implementations retain their native authority.
166
+
167
+ See [verified policy kernels](verified-kernels.md) for additional subsystem laws
168
+ and their precise host assumptions.
169
+
170
+ ## Checks and performance
171
+
172
+ Use targeted checks, never the full suite:
173
+
174
+ ```sh
175
+ bun run proof:generate
176
+ bun run proof:check
177
+ bunx vitest run tests/verified-providers.test.ts tests/verified-authority.test.ts tests/verified-lifecycle.test.ts
178
+ bunx vitest run tests/provider-bindings.test.ts tests/speculation-registry.test.ts
179
+ bunx vitest run tests/verified-storage.test.ts tests/mesh-store.test.ts tests/state-provider.test.ts tests/schema-enforcement.test.ts
180
+ bunx vitest run tests/verified-kernels.test.ts tests/verified-resources.test.ts tests/verified-artifact.test.ts
181
+ bun run typecheck
182
+ bun run build
183
+ bun run proof:dist
184
+ bun run assert:lazy-graph
185
+ bun run benchmark:provider-dispatch
186
+ bun run benchmark:startup . ../pi-fovea ../pi-contour
187
+ ```
188
+
189
+ The contributor toolchain pins Bend 2.0.26. `BEND_BIN` can select a trusted
190
+ compiler executable. Normal builds verify artifact hashes without Bend.
191
+
192
+ The dispatch benchmark measures first use and warm full-registry read calls
193
+ without provider I/O. Each dispatch observes its descriptor again; measure real
194
+ metadata-hook and network costs for the intended adapter. Synthetic results do
195
+ not establish a provider-specific latency budget. The startup benchmark uses
196
+ fresh processes and reports import/registration, not full-session boot. CI
197
+ checks structural lazy-loading budgets, with no millisecond thresholds.
@@ -34,7 +34,7 @@ schemas, guest payloads, or discovery metadata.
34
34
  executes it normally, so it must still include the same protections itself.
35
35
  - Opt-in explicitly replaces the override's `execute` and argument preparation
36
36
  for nested `pi.bash` calls with Fabric's standard local-shell semantics. The
37
- schema gains `cwd` and `background`; aliases, lifecycle hooks, policy blocking,
37
+ schema gains `cwd`, `background`, `description`, and opt-in `monitor`; aliases, lifecycle hooks, policy blocking,
38
38
  hard timeouts, cancellation, and session-owned job cleanup remain active.
39
39
  - `options` accepts `shellPath`, `commandPrefix`, `spawnHook`, and
40
40
  `exposeSessionEnvironment` (Pi's `BashToolOptions` except `operations`). The spawn
@@ -46,10 +46,10 @@ schemas, guest payloads, or discovery metadata.
46
46
  truncation file see only these filtered bytes. Handle split UTF-8/secret chunks
47
47
  and flush safely on exit, errors, and cancellation.
48
48
  - A handoff never disables an explicit `timeout`: it can still kill an already
49
- backgrounded child. `executor.shellHangMs: 0` disables automatic handoff, not
49
+ backgrounded child. Monitor events consume only the middleware-filtered bytes, like retained logs; see [background tasks](background-tasks.md). `executor.shellHangMs: 0` disables automatic handoff, not
50
50
  explicit `background: true`.
51
51
  - Middleware factories and hooks may close over current policy. Fabric reads the
52
- active captured definition for each invocation rather than caching a prior
52
+ active captured definition for each invocation without caching a prior
53
53
  extension generation. The selected protection remains pinned across that
54
54
  invocation's awaited lifecycle hooks. There is no load-order handshake or need to register another `bash` tool.
55
55
  - Invalid capabilities or failing factories reject the call; Fabric never retries
package/docs/skills.md CHANGED
@@ -42,7 +42,7 @@ A mandatory pointer serves legibility and single-source maintenance. Per-run tok
42
42
  - `/skill:fabric-fusion`: run multi-model deliberation (compare) or acting (read-only references + one actor).
43
43
  - `/skill:fabric-rlm`: decompose context recursively.
44
44
  - `/skill:fabric-schema`: gate mutation behind evidence.
45
- - `/skill:fabric-jev`: compose typed System One judgments, bounded foreground/background loops, and event-driven Main-turn advisors; see [Jev](jev.md).
45
+ - `/skill:fabric-jev`: compose shell-first foreground/background programs, optional explicit typed judgments, and event-driven Main-turn advisors; see [Jev](jev.md).
46
46
  - `/skill:fabric-foreman`: supervise Main’s coding work with batched Jev judgments and deterministic policy, per turn or at settlement; see [Foreman](foreman.md).
47
47
  - `/skill:fabric-advisor`: get persistent peer advice.
48
48
  - `/skill:fabric-supervisor`: supervise a persistent goal.
@@ -0,0 +1,278 @@
1
+ # Verified policy kernels
2
+
3
+ Fabric executes JavaScript compiled from the registered Bend kernel entry points.
4
+ Production acceptance points and state transitions call that generated code;
5
+ there is no parallel reference implementation standing in for production.
6
+ TypeScript retains host integration, source observation, optimized
7
+ candidate production, and diagnostics. There is no handwritten fallback when a
8
+ kernel rejects a candidate.
9
+
10
+ `LAWS.bend`, `proofs/resource-spec.bend`, `proofs/state-spec.bend`,
11
+ `proofs/provider-spec.bend`, `proofs/authority-spec.bend`,
12
+ `proofs/lifecycle-spec.bend`, and `proofs/storage-spec.bend` define the specification
13
+ review boundaries.
14
+ `PROOF.bend` and its imported proof modules supply the closed proofs.
15
+ Review laws independently of implementations; never weaken a claim
16
+ to make an implementation check. Compiler checking does not replace independent
17
+ specification review. Independent predicates prevent a change to the kernel's
18
+ condition builder from silently changing its law.
19
+
20
+ ## Acceptance ledger
21
+
22
+ Policy kernels cover the following areas through production bridges. The proof boundary is a set
23
+ of small policy kernels, **not a proof of every subsystem invariant**.
24
+
25
+ | Area | Executed/checked policy | Authoritative production path | Evidence |
26
+ | --- | --- | --- | --- |
27
+ | Effect independence | Complete-source normalization preserves every conflict; exact outputs preserve identities in both directions and obey bounds; effect-group traversal checks all pairs | `verified/resources.ts`, `components/effect-policy.ts`, `components/effect-scope.ts`, `core/action-registry.ts` | `resource_conflict_preserved`, `resource_refinement`, `resource_output_valid`, `resource_groups_exact`; source/ABI/registry/component regressions |
28
+ | Component lifecycle | Publication eligibility requires current epoch/owner, non-retirement and an open supervisor; one-use disposer admission; cleanup failure chooses quarantine | `components/supervisor.ts`, `components/effect-scope.ts` | `transition_sound`, `cleanup_failure_quarantines`, `consume_retires`; async lifecycle and inverse-stack tests |
29
+ | Capability authority | Exact parent-subset derivation, authorized membership, release refusal and positive acceptance over complete grants | `verified/authority.ts`, `core/action-registry.ts` | `authority_derive_safe`, `authority_child_use_safe`, `authority_released_refused`, `authority_derive_complete`; provenance and snapshot tests |
30
+ | Binding lifecycle | Admission and exact count transitions; retirement/revocation preserve holds and work; close reserves a generation only after owner, holds and calls clear | `core/provider-bindings.ts`, `core/provider-operations.ts` | `lifecycle-spec.bend` laws; real-settlement, repeated-release, shutdown, quarantine and finalizer tests |
31
+ | Compaction | Every successful proposed cut satisfies eligibility, prior-marker ordering, estimated tail budget and every matched call/result span; rendered byte/estimated-token bounds; retained-plus-omitted sample accounting | `compaction/hook.ts`, `compaction/bounds.ts` | `span_sound`, `spans_sound`, `cut_sound`, `summary_bounds`, `sample_accounting`; compaction and bridge tests |
32
+ | Memory | Active selection cannot admit a non-member unless all-branch selection is explicit; source/lineage bindings must both match; chunks have exact lengths, contiguous offsets, truthful completion and progress; truncated coverage cannot be complete | `memory/normalize.ts`, `memory/expand-service.ts`, `memory/digest.ts`, `memory/index.ts` | `active_lineage_only`, `explicit_all_lineages`, `pointer_sound`, `chunk_sound`, `coverage_sound`; source-bound pagination/lineage/integrity tests |
33
+ | Entropy normal forms | Canonical arguments stay original; candidate acceptance requires a proved plan, an actual change, and acceptance by the unchanged schema | `entropy/normal-form.ts` | `normalization_sound`, `canonical_identity`; identity/idempotence/forged-plan tests |
34
+ | Storage CAS | Exact key/value/identity forwarding, stale refusal, key and high-water successors, missing-delete no-op, safe-integer overflow refusal | `verified/storage.ts`, `mesh/store.ts` | `storage_safe`, `storage_put_complete`, `storage_delete_complete`, `storage_stale_refused`, overflow laws; eviction, corruption, request-mutation and writer-race tests |
35
+ | State and Schema | Pending protocol-2 heads need a commit marker; valid committed heads survive marker eviction; certificate checks all hold; consumption produces an inactive token | `state/store.ts`, `schema/controller.ts` | `head_sound`, `pending_without_marker_hidden`, `committed_head_visible`, `certificate_sound`, `consume_once`, `consume_retires`; state/schema protocol tests |
36
+
37
+ `all_sound` and `all_complete` establish the conjunction checker by induction,
38
+ not just a finite truth table. `spans_sound` separately lifts per-span evidence
39
+ over arbitrary finite lists. Lifecycle `begin_open_complete`,
40
+ `retain_open_complete`, and `inspect_open_complete` establish exact successful
41
+ outcomes from the independent `Open` predicate across every phase, cleanup mode
42
+ and counter value, alongside the existing safety and exact-transition laws.
43
+
44
+ ### Proof-backed testing
45
+
46
+ Bend checks universal policy properties. JavaScript tests check the emitted ABI
47
+ and host boundaries with fixed, distinguishing examples. Cartesian products of
48
+ already-proved conditions are unnecessary:
49
+
50
+ - Resource refinement and conflict preservation use the universal laws, not a
51
+ second handwritten conflict interpreter and a source/proposal cross-product.
52
+ - Authority derivation, provider tickets, storage CAS and lifecycle decisions
53
+ retain positive and negative wire examples with unequal fields and counters.
54
+ - Certificate checks retain each host diagnostic position and multiple-failure
55
+ precedence. Conjunction laws replace the Boolean matrix.
56
+
57
+ Keep encoding, numeric-limit, limb-carry, mutation/aliasing, artifact-provenance
58
+ and packaged-runtime probes: the compiler and TypeScript codecs are trusted
59
+ boundaries, not proved implementations. Keep real cancellation, settlement,
60
+ cleanup ordering, locking, corruption and migration regressions too.
61
+
62
+ Not every enumeration is redundant. The addressed-sampling sweep checks a
63
+ TypeScript producer and its omitted-entry identities; proved accounting alone
64
+ does not prove that producer. Component scheduling and diagnostic projections
65
+ also retain their host-level tests. Before pruning a decision matrix, identify
66
+ which policy assertions the closed laws cover, including positive completeness,
67
+ and retain focused tests for the remaining host observables. A safety law alone
68
+ can still permit an implementation that denies valid requests.
69
+
70
+ ### Universal provider dispatch
71
+
72
+ All registry action routes execute `proofs/provider-kernel.bend` plans:
73
+ ordinary invocation, scoped acquisition, speculative launch, and cached-result
74
+ replay. Seven laws establish exact authority/descriptor/payload-slot forwarding,
75
+ single-use consumption, replay refusal, cancellation, revocation, and admission
76
+ completeness. The state-plan specifications are reused unchanged.
77
+
78
+ Policy, dispatch, authority, lifecycle and storage kernels are separate generated
79
+ libraries bound by the version-2 artifact receipt. The operation interpreter loads
80
+ on first use,
81
+ not idle startup. Shared full-text plan definitions and lemmas in
82
+ `proofs/state-*.bend` support the provider proofs; they do not establish storage
83
+ transaction correctness or expose a separate state-provider API. See
84
+ [provider capabilities](provider-capabilities.md) for the runtime contract and
85
+ its trust boundaries.
86
+
87
+ ### Complete-resource conflict preservation
88
+
89
+ The footprint bridge proves the normalization-to-conflict-preservation
90
+ property over arbitrary finite declarations and arbitrary proposed outputs:
91
+
92
+ ```text
93
+ conflict(A, B)
94
+ => conflict(normalize(A, proposalA), normalize(B, proposalB))
95
+ ```
96
+
97
+ `proofs/resources.bend` is the executable implementation. Its checked functions
98
+ are exported through `proofs/kernel.bend` and compiled into the same generated
99
+ library as the other policies. There is no second TypeScript overlap algorithm
100
+ that can grant independence.
101
+
102
+ The production path is:
103
+
104
+ 1. `src/verified/resources.ts` snapshots and encodes the **complete original**
105
+ declaration. No resource-count or name-length limit is applied during encoding.
106
+ 2. TypeScript proposes a small deduplicated list. This producer is untrusted for
107
+ policy correctness: it may omit, shorten, reorder, duplicate, or add names.
108
+ 3. The compiled checker independently verifies nonempty metadata, the 64-resource
109
+ and 256-code-unit bounds, wildcard exclusion, and **both directions of set
110
+ inclusion** between the original and proposed lists.
111
+ 4. An accepted exact scope retains the checked identities. Every rejected proposal
112
+ becomes the compiled `Unknown` scope; an unknown source cannot become exact.
113
+ 5. Component lifetime and registry call policy compare complete effect declarations
114
+ through the compiled conflict/group operations. TypeScript summary maps and
115
+ flags provide diagnostics only. They cannot turn a compiled conflict into an
116
+ empty conflict list, even if the diagnostic data is inconsistent.
117
+
118
+ In particular, a proposer that silently drops resource 65 fails the full-list
119
+ coverage check. The theorem does not assume that TypeScript reported the correct
120
+ count, overlap, validity, or unknown-scope flags.
121
+
122
+ The independent specification uses equality witnesses, set membership, structural
123
+ list bounds, and shared-resource witnesses. It does not copy producer Boolean flags.
124
+ The 14 resource laws establish (the root claims name the actual exported entry
125
+ functions, so changing a forwarding wrapper also breaks the proof):
126
+
127
+ - Source interpretation preserves names or widens to unknown; exact sources are
128
+ nonempty and contain no empty/malformed or wildcard identity. Every well-formed
129
+ source remains exact before normalization, without a count or name-length cap.
130
+ - Exact normalization preserves resource membership in **both** directions.
131
+ - Every exact output meets the resource/name bounds and excludes wildcards.
132
+ - Conflict computation is sound and complete for named/unknown active scopes;
133
+ quiet effects cannot conflict, and both-commutative effects remain independent.
134
+ - Normalization cannot erase a conflict, for **any** proposed output.
135
+ - Valid bounded set-equivalent proposals are accepted, preventing a deny-all
136
+ implementation. Identity proposals are unchanged.
137
+ - Rechecking a result with the same proposal is idempotent.
138
+ - Group traversal is equivalent to checking every effect pair, not just the first.
139
+
140
+ Precision has an explicit premise: the candidate must be valid, bounded and
141
+ set-equivalent to its source. A broken producer can still cause conservative
142
+ false positives by supplying a bad proposal; it cannot create false independence.
143
+ The proof does not claim that an arbitrary producer finds a good proposal.
144
+
145
+ Identities are encoded as complete UTF-16 code-unit lists, including NUL and lone
146
+ surrogates. There are no lossy hashes, Unicode normalization, prefix clipping or
147
+ separately assigned integer IDs. Non-string values encode an invalid empty name;
148
+ missing/non-array resource collections encode missing scope. The decoder checks
149
+ the code-unit ABI. Tests cover every UTF-16 unit, adversarial proposals, the
150
+ 64/65 and 256/257 boundaries, and 20,000-entry declarations.
151
+
152
+ The remaining trust boundary is faithful snapshot/ABI conversion and effect-kind/
153
+ ordering encoding, Bend's checker/compiler/Base, bundling and the JS runtime,
154
+ and truthful provider declarations. The TypeScript wire codec is tested, not
155
+ itself formally verified. Hash receipts and CI bind the entire transitive proof
156
+ source set to its generated artifact; finite tests are not substitutes for the
157
+ universal preservation proof.
158
+
159
+ ### Producer/checker boundaries
160
+
161
+ The compactor's optimized TypeScript selector still proposes cuts. `computeCut`
162
+ checks every successful result, including the legacy and compact-all paths,
163
+ before it can become `firstKeptEntryId`. Checks use the live entries and complete
164
+ call/result span set. Span batches of at most 128 bound backend list
165
+ construction; every batch must pass. Candidate-selection optimality is still
166
+ test-backed, not formally proved. Token guarantees concern the structural
167
+ estimator and supplied calibration, not an undocumented provider tokenizer.
168
+
169
+ Memory checks the actual outgoing page **after** envelope trimming. The bridge
170
+ compares each text chunk with the selected normalized source slice, checks its
171
+ range through Bend, and checks the proposed continuation against the resulting
172
+ cursor. Source reads/hashes, parent-graph reconstruction, normalization,
173
+ Unicode slicing and page composition remain host responsibilities. The exact
174
+ claim concerns normalized text, not byte-for-byte JSONL reconstruction. A source
175
+ or lineage change fails closed; old pointers are never reinterpreted.
176
+
177
+ Entropy's schema validator and plan derivation remain TypeScript. Their actual
178
+ results feed the compiled acceptance decision; the original object is returned
179
+ on refusal. Validated output plus the canonical-identity gate establishes the
180
+ operational idempotence argument under the validator assumption. This is not a
181
+ proof of TypeBox or of JavaScript numeric-string conversion.
182
+
183
+ Schema's eight evidence facts are a fixed-length tuple at the adapter boundary.
184
+ The compiled conjunction checks all eight before mutation. The consumed status
185
+ comes from the compiled token transition and is persisted with the existing
186
+ compare-and-swap. At-most-once use across processes depends on that CAS protocol
187
+ and the mesh store, not on an in-memory Boolean alone. Filesystem rollback and
188
+ postcondition commands are not formally verified.
189
+
190
+ ### Lifecycle limits
191
+
192
+ Provider bindings execute the compiled event reducer for admission, holds,
193
+ in-flight work, retirement, revocation and close reservation. Independent laws
194
+ prove exact count updates and prevent close while ownership remains. The host
195
+ interprets commands, observes actual promise settlement and releases private
196
+ one-use leases. Those observations and interpreter effects remain trusted.
197
+
198
+ The component supervisor still uses compiled eligibility and cleanup predicates.
199
+ Its epoch allocation, publication sequencing, inverse-stack execution and fairness
200
+ remain TypeScript protocols checked by integration tests. Neither reducer proves
201
+ that provider promises account for every subprocess or remote effect.
202
+ Arbitrary inverses, ambient effects, liveness, schedule confluence, and
203
+ author-defined observational equivalence are not claimed as Bend theorems.
204
+
205
+ ## Reproducible bridge
206
+
207
+ The contributor toolchain pins **Bend 2.0.26**. Installed Fabric needs neither
208
+ Bend nor a Bend loader. Linux CI downloads that exact release archive and checks
209
+ its SHA-256 before running proofs. Windows tests execute the checked-in generated
210
+ JS and ABI; native Bend currently requires Linux, macOS, or WSL.
211
+
212
+ ```sh
213
+ bend PROOF.bend --check-only
214
+ bun run proof:generate # prove, compile, regenerate JS + declarations + receipt
215
+ bun run proof:check # reprove, reproduce byte-for-byte, reject negative mutations
216
+ bun run proof:artifact # compiler-free source/bridge/artifact freshness check
217
+ bunx vitest run tests/verified-kernels.test.ts tests/verified-resources.test.ts tests/verified-providers.test.ts tests/verified-artifact.test.ts
218
+ bunx vitest run tests/verified-authority.test.ts tests/verified-lifecycle.test.ts tests/verified-storage.test.ts
219
+ bun run typecheck
220
+ bun run build
221
+ bun run proof:dist # probe the actual bundled registry/compactor and kernel
222
+ ```
223
+
224
+ `BEND_BIN` may explicitly select a trusted compiler executable. Generation sets
225
+ `BEND_NO_TELEMETRY=1`. It never installs or updates Bend automatically.
226
+
227
+ Bend's CLI emits executable JavaScript, not a library switch. A pure `IO.pure`
228
+ main keeps the kernel definitions reachable for compilation. The build bridge:
229
+
230
+ 1. Checks the entire root proof file and its imported laws.
231
+ 2. Refuses unsafe declarations, holes, foreign effects, remote imports, and
232
+ untracked local proof dependencies.
233
+ 3. Compiles the same kernel source that those laws import.
234
+ 4. Parses the emitted program and requires the exact pinned CLI footer.
235
+ 5. Removes only its two invocation statements and exports the compiler-produced
236
+ definitions through Bend's own trampoline, checking names and arities.
237
+ 6. Tree-shakes unused runtime code and rejects host IO/imports before compacting
238
+ compiler-local identifiers and syntax. Public ABI export names stay stable.
239
+ 7. Writes generated JS, ABI declarations, and a SHA-256 receipt over the proof
240
+ sources, ABI, bridge, and generated artifacts.
241
+
242
+ No algorithm is translated into handwritten JS. The small bridge, ABI
243
+ conversions, Bend checker/compiler/Base, esbuild, and JS engine are part of the
244
+ trusted computing base. Numeric adapters reject NaN, infinities, fractions and
245
+ unsafe integers. Comparison-only primitives accept JS-safe integer `BigInt`s.
246
+ Arithmetic guards respect the pinned backend's immediate `Nat` bound of
247
+ `2^48 - 1`; chunk/sample sums and lifecycle increments fail closed before overflow.
248
+ Storage revisions use canonical radix-`2^32` limbs to cover the full JS-safe integer
249
+ range. Booleans and tagged records/lists follow the emitted
250
+ ABI. Tests exercise those representations on both CI platforms.
251
+
252
+ Every build checks artifact freshness before bundling. Linux CI and `prepack`
253
+ add fresh checking and byte-for-byte regeneration, so editing a receipt is not a
254
+ substitute for proving the code. The standalone generated JS, declarations and receipt are
255
+ copied into `dist/verified/generated/`. Laws, proofs, kernel source and Bend's
256
+ license are included in the package for inspection. The receipt is a freshness
257
+ record, **not a standalone independently verified proof certificate**.
258
+
259
+ Negative probes delete a proof or deliberately break footprint bounds, source
260
+ coverage, identity matching, source validation, group traversal, positive
261
+ acceptance, epoch checks, tool-pair closure, chunk completion, canonical identity,
262
+ commit-marker visibility, and one-use consumption. The pinned compiler must reject each
263
+ mutation while the specification remains unchanged.
264
+
265
+ ## What remains outside the claims
266
+
267
+ - Semantic remembering, arbitrary prose retention, retrieval ranking quality,
268
+ secret detection, and recovery after source deletion.
269
+ - Full correctness of parsers, schemas, hashing, source observations, graph
270
+ reconstruction, or filesystem transactions.
271
+ - Full lifecycle confluence, eventual settling, or rollback correctness for
272
+ arbitrary provider code.
273
+ - Validation of user intent, success of host operations, and security against a
274
+ malicious trusted host or provider.
275
+
276
+ These boundaries are deliberate. Executed kernels and mandatory result checks
277
+ remove the parallel-model gap for the specified decisions; they do not turn
278
+ unverified host observations or adapters into proved facts.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e4779/pi-fabric",
3
- "version": "0.92.42-fork.7",
3
+ "version": "0.96.4-fork.9",
4
4
  "description": "A programmable tool and agent runtime for Pi",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -37,10 +37,19 @@
37
37
  "docs/",
38
38
  "README.md",
39
39
  "LICENSE",
40
- "THIRD_PARTY_NOTICES.md"
40
+ "THIRD_PARTY_NOTICES.md",
41
+ "LAWS.bend",
42
+ "PROOF.bend",
43
+ "proofs/",
44
+ "scripts/verified-kernels.mjs",
45
+ "scripts/test-verified-kernels.mjs"
41
46
  ],
42
47
  "scripts": {
43
- "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json --emitDeclarationOnly && node scripts/build.mjs && bun run assert:build-artifacts",
48
+ "proof:generate": "node scripts/verified-kernels.mjs --write",
49
+ "proof:check": "node scripts/verified-kernels.mjs --check && node scripts/test-verified-kernels.mjs",
50
+ "proof:artifact": "node scripts/verified-kernels.mjs --artifact",
51
+ "proof:dist": "node scripts/smoke-verified-kernels.mjs",
52
+ "build": "bun run proof:artifact && node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json --emitDeclarationOnly && node scripts/build.mjs && bun run assert:build-artifacts",
44
53
  "typecheck": "tsc --noEmit",
45
54
  "test:jev:live": "PI_FABRIC_JEV_LIVE=1 vitest run tests/jev-live.test.ts",
46
55
  "test:jev:dist": "node scripts/smoke-jev.mjs",
@@ -55,13 +64,14 @@
55
64
  "benchmark:memory-heads": "bun run build && node scripts/benchmark-memory-heads.mjs",
56
65
  "benchmark:memory-recall": "bun run build && node scripts/benchmark-memory-recall.mjs",
57
66
  "benchmark:conversation": "bun run build && node --expose-gc scripts/benchmark-conversation.mjs",
67
+ "benchmark:provider-dispatch": "node scripts/benchmark-provider-dispatch.mjs",
58
68
  "benchmark:activity": "node --expose-gc scripts/benchmark-activity.mjs",
59
69
  "benchmark:turn-cpu": "node scripts/benchmark-turn-cpu.mjs",
60
70
  "benchmark:startup": "node scripts/benchmark-startup.mjs",
61
71
  "lint:dead": "knip --no-gitignore",
62
72
  "assert:lazy-graph": "node scripts/assert-lazy-graph-host-free.mjs",
63
73
  "assert:build-artifacts": "node scripts/assert-build-artifacts.mjs",
64
- "prepack": "bun run typecheck && bun run build"
74
+ "prepack": "bun run proof:check && bun run typecheck && bun run build"
65
75
  },
66
76
  "keywords": [
67
77
  "pi-package",