@e4779/pi-fabric 0.117.2-fork.31 → 0.131.0-fork.32

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 (796) hide show
  1. package/README.md +12 -5
  2. package/THIRD_PARTY_NOTICES.md +6 -14
  3. package/dist/activity/store.d.ts +2 -1
  4. package/dist/activity/store.d.ts.map +1 -1
  5. package/dist/actors/binding-store.d.ts +13 -0
  6. package/dist/actors/binding-store.d.ts.map +1 -1
  7. package/dist/actors/directory.d.ts.map +1 -1
  8. package/dist/actors/global-registry.d.ts +8 -0
  9. package/dist/actors/global-registry.d.ts.map +1 -1
  10. package/dist/actors/host-event-payload.d.ts +14 -0
  11. package/dist/actors/host-event-payload.d.ts.map +1 -1
  12. package/dist/actors/manager.d.ts +4 -3
  13. package/dist/actors/manager.d.ts.map +1 -1
  14. package/dist/actors/mesh-monitor.d.ts +2 -0
  15. package/dist/actors/mesh-monitor.d.ts.map +1 -1
  16. package/dist/actors/name-policy.d.ts +3 -0
  17. package/dist/actors/name-policy.d.ts.map +1 -0
  18. package/dist/actors/registry-store.d.ts +14 -5
  19. package/dist/actors/registry-store.d.ts.map +1 -1
  20. package/dist/actors/store-read.d.ts +16 -0
  21. package/dist/actors/store-read.d.ts.map +1 -0
  22. package/dist/agents/agent-files.d.ts +80 -0
  23. package/dist/agents/agent-files.d.ts.map +1 -0
  24. package/dist/agents/agent-files.js +327 -0
  25. package/dist/agents/agent-files.js.map +7 -0
  26. package/dist/agents/child-skills.d.ts +60 -0
  27. package/dist/agents/child-skills.d.ts.map +1 -0
  28. package/dist/agents/child-skills.js +94 -0
  29. package/dist/agents/child-skills.js.map +7 -0
  30. package/dist/agents/clone-first-worktree.d.ts +6 -0
  31. package/dist/agents/clone-first-worktree.d.ts.map +1 -1
  32. package/dist/agents/cow-clone.d.ts.map +1 -1
  33. package/dist/agents/handoff.d.ts +12 -2
  34. package/dist/agents/handoff.d.ts.map +1 -1
  35. package/dist/agents/herdr-status.d.ts +26 -0
  36. package/dist/agents/herdr-status.d.ts.map +1 -0
  37. package/dist/agents/herdr-status.js +161 -0
  38. package/dist/agents/herdr-status.js.map +7 -0
  39. package/dist/agents/hosted-run.d.ts +20 -4
  40. package/dist/agents/hosted-run.d.ts.map +1 -1
  41. package/dist/agents/manager.d.ts +18 -2
  42. package/dist/agents/manager.d.ts.map +1 -1
  43. package/dist/agents/model-pin-guard.d.ts +27 -0
  44. package/dist/agents/model-pin-guard.d.ts.map +1 -0
  45. package/dist/agents/model-pin-guard.js +86 -0
  46. package/dist/agents/model-pin-guard.js.map +7 -0
  47. package/dist/agents/model-pin.d.ts +25 -0
  48. package/dist/agents/model-pin.d.ts.map +1 -0
  49. package/dist/agents/provider-bridge.d.ts +7 -6
  50. package/dist/agents/provider-bridge.d.ts.map +1 -1
  51. package/dist/agents/provider-bridge.js +33 -5
  52. package/dist/agents/provider-bridge.js.map +3 -3
  53. package/dist/agents/request.d.ts.map +1 -1
  54. package/dist/agents/result.d.ts.map +1 -1
  55. package/dist/agents/result.js +1 -1
  56. package/dist/agents/runner-notice.d.ts.map +1 -1
  57. package/dist/agents/runner-protocol.d.ts +8 -0
  58. package/dist/agents/runner-protocol.d.ts.map +1 -1
  59. package/dist/agents/service-schema.d.ts.map +1 -1
  60. package/dist/agents/transports/herdr-socket.d.ts +12 -0
  61. package/dist/agents/transports/herdr-socket.d.ts.map +1 -0
  62. package/dist/agents/transports/herdr-transport.d.ts.map +1 -1
  63. package/dist/agents/types.d.ts +51 -0
  64. package/dist/agents/types.d.ts.map +1 -1
  65. package/dist/agents/worker-recovery.d.ts +75 -0
  66. package/dist/agents/worker-recovery.d.ts.map +1 -0
  67. package/dist/agents/worktree-manager.d.ts.map +1 -1
  68. package/dist/agents.js +12 -11
  69. package/dist/agents.js.map +2 -2
  70. package/dist/audit/details.d.ts +36 -1
  71. package/dist/audit/details.d.ts.map +1 -1
  72. package/dist/audit/projection.d.ts.map +1 -1
  73. package/dist/audit/trace-schema.d.ts +50 -0
  74. package/dist/audit/trace-schema.d.ts.map +1 -0
  75. package/dist/audit/trace.d.ts +2 -48
  76. package/dist/audit/trace.d.ts.map +1 -1
  77. package/dist/chunks/chunk-2RWNVCFD.js +483 -0
  78. package/dist/chunks/chunk-2RWNVCFD.js.map +7 -0
  79. package/dist/chunks/chunk-2SCMGO2Z.js +16 -0
  80. package/dist/chunks/chunk-2SCMGO2Z.js.map +7 -0
  81. package/dist/chunks/chunk-35EEGOH3.js +324 -0
  82. package/dist/chunks/chunk-35EEGOH3.js.map +7 -0
  83. package/dist/chunks/{chunk-3FJUP3GV.js → chunk-36XQFTEN.js} +2 -2
  84. package/dist/chunks/{chunk-UTOBAZ5T.js → chunk-37NIOSVU.js} +1 -1
  85. package/dist/chunks/chunk-37NIOSVU.js.map +7 -0
  86. package/dist/chunks/chunk-3IJEQBFS.js +25 -0
  87. package/dist/chunks/chunk-3IJEQBFS.js.map +7 -0
  88. package/dist/chunks/{chunk-EHQQ4KCX.js → chunk-3MOY6WIB.js} +84 -19
  89. package/dist/chunks/chunk-3MOY6WIB.js.map +7 -0
  90. package/dist/chunks/chunk-3PKZSIRA.js +1312 -0
  91. package/dist/chunks/chunk-3PKZSIRA.js.map +7 -0
  92. package/dist/chunks/chunk-3VK6UGAN.js +64 -0
  93. package/dist/chunks/chunk-3VK6UGAN.js.map +7 -0
  94. package/dist/chunks/{chunk-ROTCDDOV.js → chunk-3XT5WHSG.js} +59 -119
  95. package/dist/chunks/chunk-3XT5WHSG.js.map +7 -0
  96. package/dist/chunks/{chunk-FIDUHKMM.js → chunk-4BYS4ZLY.js} +16 -16
  97. package/dist/chunks/chunk-4BYS4ZLY.js.map +7 -0
  98. package/dist/chunks/{chunk-K7J2ABAZ.js → chunk-4KX6BIPL.js} +91 -31
  99. package/dist/chunks/chunk-4KX6BIPL.js.map +7 -0
  100. package/dist/chunks/{chunk-UOM37PE4.js → chunk-4PBW54I2.js} +162 -92
  101. package/dist/chunks/chunk-4PBW54I2.js.map +7 -0
  102. package/dist/chunks/{chunk-ZEXCKK4K.js → chunk-4WKD3YM3.js} +3 -3
  103. package/dist/chunks/{chunk-PK4NIJEV.js → chunk-4XMXFHAR.js} +62 -3
  104. package/dist/chunks/chunk-4XMXFHAR.js.map +7 -0
  105. package/dist/chunks/{chunk-4EW7GVUR.js → chunk-56NMRVTV.js} +589 -377
  106. package/dist/chunks/chunk-56NMRVTV.js.map +7 -0
  107. package/dist/chunks/{chunk-GIK2WNAK.js → chunk-5BOTHX47.js} +109 -20
  108. package/dist/chunks/chunk-5BOTHX47.js.map +7 -0
  109. package/dist/chunks/chunk-5QJFDKPN.js +179 -0
  110. package/dist/chunks/chunk-5QJFDKPN.js.map +7 -0
  111. package/dist/chunks/{chunk-P7CBPPHY.js → chunk-6GWDGTHC.js} +5 -5
  112. package/dist/chunks/{chunk-P7CBPPHY.js.map → chunk-6GWDGTHC.js.map} +1 -1
  113. package/dist/chunks/chunk-6HO2IUQ5.js +104 -0
  114. package/dist/chunks/chunk-6HO2IUQ5.js.map +7 -0
  115. package/dist/chunks/chunk-6OGYPHNQ.js +62 -0
  116. package/dist/chunks/chunk-6OGYPHNQ.js.map +7 -0
  117. package/dist/chunks/{chunk-GO32KSEZ.js → chunk-7CIES6X2.js} +84 -9
  118. package/dist/chunks/chunk-7CIES6X2.js.map +7 -0
  119. package/dist/chunks/{chunk-G4TLWHRS.js → chunk-7N7IC3Z2.js} +4 -3
  120. package/dist/chunks/{chunk-G4TLWHRS.js.map → chunk-7N7IC3Z2.js.map} +2 -2
  121. package/dist/chunks/{chunk-5XBYFSI5.js → chunk-7YNE4NB2.js} +2 -2
  122. package/dist/chunks/{chunk-NTC2MCB6.js → chunk-B5L3X3ID.js} +1 -1
  123. package/dist/chunks/{chunk-NTC2MCB6.js.map → chunk-B5L3X3ID.js.map} +1 -1
  124. package/dist/chunks/chunk-BIBRWZWQ.js +325 -0
  125. package/dist/chunks/chunk-BIBRWZWQ.js.map +7 -0
  126. package/dist/chunks/{chunk-K6QXUGS5.js → chunk-BMAEZNZ5.js} +2 -1
  127. package/dist/chunks/{chunk-FSB2VIRZ.js → chunk-CBIV747V.js} +14 -3
  128. package/dist/chunks/chunk-CBIV747V.js.map +7 -0
  129. package/dist/chunks/{chunk-CCHZXF6K.js → chunk-CXYJJ3HZ.js} +3 -3
  130. package/dist/chunks/{chunk-R2XQ6AHT.js → chunk-DGERP4VL.js} +22 -10
  131. package/dist/chunks/chunk-DGERP4VL.js.map +7 -0
  132. package/dist/chunks/chunk-F2LGSRIN.js +38 -0
  133. package/dist/chunks/chunk-F2LGSRIN.js.map +7 -0
  134. package/dist/chunks/chunk-F6A6MQ6G.js +609 -0
  135. package/dist/chunks/chunk-F6A6MQ6G.js.map +7 -0
  136. package/dist/chunks/{chunk-IR3PIHJM.js → chunk-FK73YJKV.js} +67 -2
  137. package/dist/chunks/chunk-FK73YJKV.js.map +7 -0
  138. package/dist/chunks/{chunk-VYQV5JRT.js → chunk-GJVKEHDL.js} +2 -2
  139. package/dist/chunks/chunk-GJVKEHDL.js.map +7 -0
  140. package/dist/chunks/{chunk-TIIIHPHF.js → chunk-GS67KDMV.js} +2 -2
  141. package/dist/chunks/{chunk-D5NYNIST.js → chunk-H57KPL3V.js} +5 -5
  142. package/dist/chunks/{chunk-KVYNGDGC.js → chunk-HFDJWLMS.js} +6 -6
  143. package/dist/chunks/{chunk-KVYNGDGC.js.map → chunk-HFDJWLMS.js.map} +1 -1
  144. package/dist/chunks/{chunk-INRXG4J5.js → chunk-HGD75NZY.js} +2 -2
  145. package/dist/chunks/{chunk-CRRUW26I.js → chunk-HRDMBGMY.js} +12 -12
  146. package/dist/chunks/{chunk-CRRUW26I.js.map → chunk-HRDMBGMY.js.map} +2 -2
  147. package/dist/chunks/{chunk-MLLYR3Y6.js → chunk-HSEZPCL5.js} +19 -78
  148. package/dist/chunks/chunk-HSEZPCL5.js.map +7 -0
  149. package/dist/chunks/{chunk-LNASO4VT.js → chunk-IOGDTIGN.js} +44 -19
  150. package/dist/chunks/chunk-IOGDTIGN.js.map +7 -0
  151. package/dist/chunks/chunk-JMUUNW2H.js +65 -0
  152. package/dist/chunks/chunk-JMUUNW2H.js.map +7 -0
  153. package/dist/chunks/{chunk-UXIBKMUM.js → chunk-KIFOEBYJ.js} +4 -4
  154. package/dist/chunks/{chunk-SPCJXN4K.js → chunk-LKYLD5SN.js} +298 -65
  155. package/dist/chunks/chunk-LKYLD5SN.js.map +7 -0
  156. package/dist/chunks/{chunk-FUY6XVRX.js → chunk-MPMEK3IQ.js} +2 -2
  157. package/dist/chunks/{chunk-HP5P7NBO.js → chunk-MSDL7U6Q.js} +4 -4
  158. package/dist/chunks/chunk-N7ZAK2PB.js +132 -0
  159. package/dist/chunks/chunk-N7ZAK2PB.js.map +7 -0
  160. package/dist/chunks/{chunk-VSDUSNIA.js → chunk-NBIYYMKS.js} +8 -2
  161. package/dist/chunks/chunk-NBIYYMKS.js.map +7 -0
  162. package/dist/chunks/chunk-NENQZCGW.js +45 -0
  163. package/dist/chunks/chunk-NENQZCGW.js.map +7 -0
  164. package/dist/chunks/chunk-NJHJKINP.js +47 -0
  165. package/dist/chunks/chunk-NJHJKINP.js.map +7 -0
  166. package/dist/chunks/{chunk-U366I5K2.js → chunk-NQ7IWEIF.js} +18 -6
  167. package/dist/chunks/chunk-NQ7IWEIF.js.map +7 -0
  168. package/dist/chunks/{chunk-ZQMBS5SH.js → chunk-OJ4HAALD.js} +15 -12
  169. package/dist/chunks/chunk-OJ4HAALD.js.map +7 -0
  170. package/dist/chunks/chunk-OZCJU3PZ.js +33 -0
  171. package/dist/chunks/chunk-OZCJU3PZ.js.map +7 -0
  172. package/dist/chunks/chunk-P3DCXKL3.js +40 -0
  173. package/dist/chunks/chunk-P3DCXKL3.js.map +7 -0
  174. package/dist/chunks/chunk-P7YSPKTM.js +294 -0
  175. package/dist/chunks/chunk-P7YSPKTM.js.map +7 -0
  176. package/dist/chunks/chunk-PQVUMJ5J.js +223 -0
  177. package/dist/chunks/chunk-PQVUMJ5J.js.map +7 -0
  178. package/dist/chunks/chunk-PUBHBEYO.js +84 -0
  179. package/dist/chunks/chunk-PUBHBEYO.js.map +7 -0
  180. package/dist/chunks/{chunk-P4KH4S4S.js → chunk-QGTD3LAZ.js} +5 -20
  181. package/dist/chunks/chunk-QGTD3LAZ.js.map +7 -0
  182. package/dist/chunks/{chunk-TIJ3YQXX.js → chunk-QOEOKW2X.js} +2 -2
  183. package/dist/chunks/{chunk-TIJ3YQXX.js.map → chunk-QOEOKW2X.js.map} +1 -1
  184. package/dist/chunks/{chunk-QT4W5YVB.js → chunk-RAA3FAYZ.js} +2 -2
  185. package/dist/chunks/{chunk-WJJXODAB.js → chunk-RLKRZXSX.js} +8 -1
  186. package/dist/chunks/{chunk-WJJXODAB.js.map → chunk-RLKRZXSX.js.map} +2 -2
  187. package/dist/chunks/chunk-RWKQ5SRW.js +129 -0
  188. package/dist/chunks/chunk-RWKQ5SRW.js.map +7 -0
  189. package/dist/chunks/chunk-SW25R47N.js +71 -0
  190. package/dist/chunks/chunk-SW25R47N.js.map +7 -0
  191. package/dist/chunks/{chunk-EFETPXU2.js → chunk-TJZYM2SP.js} +118 -237
  192. package/dist/chunks/chunk-TJZYM2SP.js.map +7 -0
  193. package/dist/chunks/{chunk-53N2I4QA.js → chunk-TXCNZCZP.js} +2 -2
  194. package/dist/chunks/chunk-UD7LFV43.js +28 -0
  195. package/dist/chunks/chunk-UD7LFV43.js.map +7 -0
  196. package/dist/chunks/{chunk-ASSLHWZS.js → chunk-UFMYN5TA.js} +2 -2
  197. package/dist/chunks/{chunk-7QKKLBHJ.js → chunk-UPMWLOKL.js} +10 -1
  198. package/dist/chunks/{chunk-7QKKLBHJ.js.map → chunk-UPMWLOKL.js.map} +2 -2
  199. package/dist/chunks/chunk-V4OW2ULC.js +422 -0
  200. package/dist/chunks/chunk-V4OW2ULC.js.map +7 -0
  201. package/dist/chunks/{chunk-FE6NOAO7.js → chunk-VNWQIGQL.js} +1820 -649
  202. package/dist/chunks/chunk-VNWQIGQL.js.map +7 -0
  203. package/dist/chunks/{chunk-PYFJW3HC.js → chunk-W5FEHVZA.js} +2 -16
  204. package/dist/chunks/{chunk-PYFJW3HC.js.map → chunk-W5FEHVZA.js.map} +3 -3
  205. package/dist/chunks/{chunk-XCEEQ5AB.js → chunk-WGMCNCP6.js} +1567 -1564
  206. package/dist/chunks/chunk-WGMCNCP6.js.map +7 -0
  207. package/dist/chunks/chunk-WKFRGICG.js +101 -0
  208. package/dist/chunks/chunk-WKFRGICG.js.map +7 -0
  209. package/dist/chunks/{chunk-3UGN25XS.js → chunk-WWTGWGH7.js} +80 -1662
  210. package/dist/chunks/chunk-WWTGWGH7.js.map +7 -0
  211. package/dist/chunks/{chunk-5UBRGTVN.js → chunk-X7QETPBC.js} +31 -15
  212. package/dist/chunks/chunk-X7QETPBC.js.map +7 -0
  213. package/dist/chunks/{chunk-LEU5CDSL.js → chunk-XFOSUGLU.js} +5 -5
  214. package/dist/chunks/{chunk-MZUC6LLH.js → chunk-XMYG2TKR.js} +4 -4
  215. package/dist/chunks/{chunk-MZUC6LLH.js.map → chunk-XMYG2TKR.js.map} +1 -1
  216. package/dist/chunks/chunk-YC65P7ZO.js +57 -0
  217. package/dist/chunks/chunk-YC65P7ZO.js.map +7 -0
  218. package/dist/chunks/{chunk-EKODKR6Y.js → chunk-YHFWMAQ5.js} +1 -24
  219. package/dist/chunks/chunk-YHFWMAQ5.js.map +7 -0
  220. package/dist/chunks/{chunk-C7Z6F3SO.js → chunk-ZFWICFNJ.js} +27 -20
  221. package/dist/chunks/{chunk-C7Z6F3SO.js.map → chunk-ZFWICFNJ.js.map} +2 -2
  222. package/dist/cli/decisions.d.ts.map +1 -1
  223. package/dist/cli/decisions.js +15 -3
  224. package/dist/cli/decisions.js.map +2 -2
  225. package/dist/cli/mesh.js +4 -3
  226. package/dist/cli/mesh.js.map +1 -1
  227. package/dist/commands/fabric-handler.d.ts +7 -0
  228. package/dist/commands/fabric-handler.d.ts.map +1 -0
  229. package/dist/commands/fabric-handler.js +916 -0
  230. package/dist/commands/fabric-handler.js.map +7 -0
  231. package/dist/commands/fabric.d.ts +11 -1
  232. package/dist/commands/fabric.d.ts.map +1 -1
  233. package/dist/compaction/claim-events.d.ts +61 -0
  234. package/dist/compaction/claim-events.d.ts.map +1 -0
  235. package/dist/compaction/claim-events.js +210 -0
  236. package/dist/compaction/claim-events.js.map +7 -0
  237. package/dist/compaction/claim.d.ts +51 -0
  238. package/dist/compaction/claim.d.ts.map +1 -0
  239. package/dist/compaction/hook.d.ts +28 -2
  240. package/dist/compaction/hook.d.ts.map +1 -1
  241. package/dist/compaction/hook.js +12 -7
  242. package/dist/compaction/owner.js +9 -8
  243. package/dist/compaction/trace-events.d.ts +1 -1
  244. package/dist/compaction/trace-events.d.ts.map +1 -1
  245. package/dist/components/configuration.js +6 -6
  246. package/dist/components/effect-scope.d.ts.map +1 -1
  247. package/dist/config.d.ts +39 -2
  248. package/dist/config.d.ts.map +1 -1
  249. package/dist/core/action-arguments.d.ts.map +1 -1
  250. package/dist/core/action-policy-hooks.d.ts +69 -0
  251. package/dist/core/action-policy-hooks.d.ts.map +1 -0
  252. package/dist/core/action-registry.d.ts +31 -10
  253. package/dist/core/action-registry.d.ts.map +1 -1
  254. package/dist/core/action-registry.js +12 -9
  255. package/dist/core/approval-controller.d.ts +23 -3
  256. package/dist/core/approval-controller.d.ts.map +1 -1
  257. package/dist/core/atomic-write.d.ts +164 -0
  258. package/dist/core/atomic-write.d.ts.map +1 -1
  259. package/dist/core/child-tool-allowlist.d.ts +17 -1
  260. package/dist/core/child-tool-allowlist.d.ts.map +1 -1
  261. package/dist/core/compact-controller.d.ts +34 -0
  262. package/dist/core/compact-controller.d.ts.map +1 -1
  263. package/dist/core/core-override-guidance.d.ts +3 -1
  264. package/dist/core/core-override-guidance.d.ts.map +1 -1
  265. package/dist/core/file-lock.d.ts.map +1 -1
  266. package/dist/core/foreground-tools.d.ts +4 -1
  267. package/dist/core/foreground-tools.d.ts.map +1 -1
  268. package/dist/core/host-policy.d.ts +43 -0
  269. package/dist/core/host-policy.d.ts.map +1 -0
  270. package/dist/core/host-sdk-runtime.d.ts.map +1 -1
  271. package/dist/core/host-sdk.d.ts.map +1 -1
  272. package/dist/core/host-sdk.js +1 -1
  273. package/dist/core/managed-host-guidance.d.ts +5 -0
  274. package/dist/core/managed-host-guidance.d.ts.map +1 -0
  275. package/dist/core/model-aliases.d.ts +22 -0
  276. package/dist/core/model-aliases.d.ts.map +1 -0
  277. package/dist/core/model-resolution.d.ts +41 -20
  278. package/dist/core/model-resolution.d.ts.map +1 -1
  279. package/dist/core/native-tool-result.d.ts +1 -0
  280. package/dist/core/native-tool-result.d.ts.map +1 -1
  281. package/dist/core/program-tasks.d.ts +52 -0
  282. package/dist/core/program-tasks.d.ts.map +1 -0
  283. package/dist/core/prompt-guidance.d.ts +5 -0
  284. package/dist/core/prompt-guidance.d.ts.map +1 -0
  285. package/dist/core/prompt-guidance.js +159 -0
  286. package/dist/core/prompt-guidance.js.map +7 -0
  287. package/dist/core/provider-operations.d.ts.map +1 -1
  288. package/dist/core/provider-operations.js +60 -108
  289. package/dist/core/provider-operations.js.map +3 -3
  290. package/dist/core/shell-inbox.d.ts.map +1 -1
  291. package/dist/core/shell-jobs.d.ts +7 -5
  292. package/dist/core/shell-jobs.d.ts.map +1 -1
  293. package/dist/core/shell-timing.d.ts.map +1 -1
  294. package/dist/core/skill-prompt.d.ts +1 -1
  295. package/dist/core/skill-prompt.d.ts.map +1 -1
  296. package/dist/core/skill-references.d.ts +1 -1
  297. package/dist/core/skill-references.d.ts.map +1 -1
  298. package/dist/core/system-guidance.d.ts.map +1 -1
  299. package/dist/core/tool-result-proxy.d.ts.map +1 -1
  300. package/dist/decisions/command.d.ts +2 -1
  301. package/dist/decisions/command.d.ts.map +1 -1
  302. package/dist/decisions/command.js +40 -12
  303. package/dist/decisions/command.js.map +2 -2
  304. package/dist/decisions/events.d.ts +12 -0
  305. package/dist/decisions/events.d.ts.map +1 -0
  306. package/dist/decisions/events.js +130 -0
  307. package/dist/decisions/events.js.map +7 -0
  308. package/dist/decisions/host.d.ts +31 -3
  309. package/dist/decisions/host.d.ts.map +1 -1
  310. package/dist/decisions/render.d.ts +44 -0
  311. package/dist/decisions/render.d.ts.map +1 -0
  312. package/dist/decisions/store.d.ts +8 -0
  313. package/dist/decisions/store.d.ts.map +1 -1
  314. package/dist/durable/agent.d.ts +8 -0
  315. package/dist/durable/agent.d.ts.map +1 -1
  316. package/dist/durable/extension-load-error.d.ts +8 -0
  317. package/dist/durable/extension-load-error.d.ts.map +1 -0
  318. package/dist/durable/session.d.ts +1 -0
  319. package/dist/durable/session.d.ts.map +1 -1
  320. package/dist/durable/worker-host.d.ts +10 -1
  321. package/dist/durable/worker-host.d.ts.map +1 -1
  322. package/dist/durable/worker-host.js +10 -1181
  323. package/dist/durable/worker-host.js.map +4 -4
  324. package/dist/durable/worker-options.d.ts +3 -0
  325. package/dist/durable/worker-options.d.ts.map +1 -1
  326. package/dist/durable/worker-role-seed.d.ts +82 -0
  327. package/dist/durable/worker-role-seed.d.ts.map +1 -0
  328. package/dist/durable/worker.js +43 -4
  329. package/dist/durable/worker.js.map +2 -2
  330. package/dist/durable-controls.d.ts.map +1 -1
  331. package/dist/durable-extension-wasm.d.ts +8 -0
  332. package/dist/durable-extension-wasm.d.ts.map +1 -0
  333. package/dist/durable-extension-wasm.js +32 -0
  334. package/dist/durable-extension-wasm.js.map +7 -0
  335. package/dist/durable-extension.d.ts +94 -0
  336. package/dist/durable-extension.d.ts.map +1 -0
  337. package/dist/durable-extension.js +649 -0
  338. package/dist/durable-extension.js.map +7 -0
  339. package/dist/durable-host.d.ts +8 -0
  340. package/dist/durable-host.d.ts.map +1 -0
  341. package/dist/durable-host.js +20 -0
  342. package/dist/durable-host.js.map +7 -0
  343. package/dist/durable-journal.d.ts +94 -0
  344. package/dist/durable-journal.d.ts.map +1 -0
  345. package/dist/durable.d.ts.map +1 -1
  346. package/dist/durable.js +10 -8
  347. package/dist/durable.js.map +2 -2
  348. package/dist/entropy/index.js +12 -10
  349. package/dist/entropy/pool-store.d.ts.map +1 -1
  350. package/dist/execution-service.d.ts +14 -0
  351. package/dist/execution-service.d.ts.map +1 -1
  352. package/dist/extension-bootstrap.d.ts.map +1 -1
  353. package/dist/extension-bootstrap.js +28 -27
  354. package/dist/extension-bootstrap.js.map +2 -2
  355. package/dist/extension-copy.d.ts +21 -0
  356. package/dist/extension-copy.d.ts.map +1 -0
  357. package/dist/extension-copy.js +90 -0
  358. package/dist/extension-copy.js.map +7 -0
  359. package/dist/extension.d.ts +1 -1
  360. package/dist/extension.d.ts.map +1 -1
  361. package/dist/fabric-exec-arguments.d.ts.map +1 -1
  362. package/dist/fabric-exec-tool.d.ts +2 -1
  363. package/dist/fabric-exec-tool.d.ts.map +1 -1
  364. package/dist/fabric-runtime-state.d.ts +19 -0
  365. package/dist/fabric-runtime-state.d.ts.map +1 -1
  366. package/dist/fabric-runtime-state.js +2125 -786
  367. package/dist/fabric-runtime-state.js.map +4 -4
  368. package/dist/fabric-state.d.ts +44 -1
  369. package/dist/fabric-state.d.ts.map +1 -1
  370. package/dist/index.d.ts +5 -3
  371. package/dist/index.d.ts.map +1 -1
  372. package/dist/index.js +88 -53
  373. package/dist/index.js.map +2 -2
  374. package/dist/jev/client.js +2 -2
  375. package/dist/jev/manager.d.ts +3 -0
  376. package/dist/jev/manager.d.ts.map +1 -1
  377. package/dist/jev/observation.d.ts +1 -1
  378. package/dist/jev/observation.js +6 -6
  379. package/dist/jev-fabric/bridge.d.ts.map +1 -1
  380. package/dist/jev.js +11 -12
  381. package/dist/managed-host.d.ts +13 -0
  382. package/dist/managed-host.d.ts.map +1 -1
  383. package/dist/memory/digest.js +2 -2
  384. package/dist/memory/discovery.js +6 -7
  385. package/dist/memory/file-worker.js +10 -11
  386. package/dist/memory/file-worker.js.map +1 -1
  387. package/dist/memory/normalize.js +5 -6
  388. package/dist/memory/search.js +7 -8
  389. package/dist/memory/worker-provider.js +11 -12
  390. package/dist/memory.js +11 -12
  391. package/dist/memory.js.map +1 -1
  392. package/dist/mesh/grants.d.ts +3 -3
  393. package/dist/mesh/grants.d.ts.map +1 -1
  394. package/dist/mesh/store.d.ts +8 -0
  395. package/dist/mesh/store.d.ts.map +1 -1
  396. package/dist/native-codemode.d.ts.map +1 -1
  397. package/dist/native-tool-catalog.d.ts.map +1 -1
  398. package/dist/native-tool-catalog.js +12 -3
  399. package/dist/native-tool-catalog.js.map +2 -2
  400. package/dist/programs/host.d.ts +18 -6
  401. package/dist/programs/host.d.ts.map +1 -1
  402. package/dist/programs/host.js +71 -47
  403. package/dist/programs/host.js.map +2 -2
  404. package/dist/programs/source.d.ts +11 -0
  405. package/dist/programs/source.d.ts.map +1 -1
  406. package/dist/programs/store.d.ts.map +1 -1
  407. package/dist/protocol.d.ts +504 -8
  408. package/dist/protocol.d.ts.map +1 -1
  409. package/dist/protocol.js +41 -11
  410. package/dist/provider-globals.d.ts +13 -0
  411. package/dist/provider-globals.d.ts.map +1 -0
  412. package/dist/providers/agents-actions.d.ts.map +1 -1
  413. package/dist/providers/agents-provider.d.ts +3 -0
  414. package/dist/providers/agents-provider.d.ts.map +1 -1
  415. package/dist/providers/captured-tools-provider.d.ts +5 -0
  416. package/dist/providers/captured-tools-provider.d.ts.map +1 -1
  417. package/dist/providers/compact-provider.d.ts +4 -1
  418. package/dist/providers/compact-provider.d.ts.map +1 -1
  419. package/dist/providers/components-provider.d.ts.map +1 -1
  420. package/dist/providers/decisions-provider.d.ts +9 -1
  421. package/dist/providers/decisions-provider.d.ts.map +1 -1
  422. package/dist/providers/jev-provider.d.ts +1 -1
  423. package/dist/providers/jev-provider.js +11 -12
  424. package/dist/providers/memory-provider.js +10 -11
  425. package/dist/providers/pi-tools-provider.d.ts +14 -0
  426. package/dist/providers/pi-tools-provider.d.ts.map +1 -1
  427. package/dist/providers/programs-provider.d.ts.map +1 -1
  428. package/dist/providers/sessions-provider.d.ts +7 -0
  429. package/dist/providers/sessions-provider.d.ts.map +1 -1
  430. package/dist/repeat-guard.d.ts +7 -6
  431. package/dist/repeat-guard.d.ts.map +1 -1
  432. package/dist/residency/actor-client.js +3 -3
  433. package/dist/residency/client.d.ts +15 -0
  434. package/dist/residency/client.d.ts.map +1 -1
  435. package/dist/residency/host.d.ts.map +1 -1
  436. package/dist/residency/host.js +34 -23
  437. package/dist/residency/launcher.js +1 -1
  438. package/dist/residency/pi-entry.js +34 -23
  439. package/dist/residency/pi-entry.js.map +1 -1
  440. package/dist/residency/protocol.d.ts +2 -0
  441. package/dist/residency/protocol.d.ts.map +1 -1
  442. package/dist/runners.js +11 -1
  443. package/dist/runners.js.map +2 -2
  444. package/dist/runtime/core-override-guest-types.js +2 -2
  445. package/dist/runtime/cpython-child-source.d.ts.map +1 -1
  446. package/dist/runtime/cpython-runtime.d.ts.map +1 -1
  447. package/dist/runtime/cpython-runtime.js +51 -21
  448. package/dist/runtime/cpython-runtime.js.map +2 -2
  449. package/dist/runtime/deadline-pause.d.ts +2 -0
  450. package/dist/runtime/deadline-pause.d.ts.map +1 -1
  451. package/dist/runtime/dynamic-guest-types.d.ts.map +1 -1
  452. package/dist/runtime/dynamic-guest-types.js +2 -1
  453. package/dist/runtime/exec-journal.d.ts +73 -0
  454. package/dist/runtime/exec-journal.d.ts.map +1 -0
  455. package/dist/runtime/exec-journal.js +335 -0
  456. package/dist/runtime/exec-journal.js.map +7 -0
  457. package/dist/runtime/guest-types.d.ts +3 -2
  458. package/dist/runtime/guest-types.d.ts.map +1 -1
  459. package/dist/runtime/guest-types.js +1 -1
  460. package/dist/runtime/journal-shim.d.ts +3 -0
  461. package/dist/runtime/journal-shim.d.ts.map +1 -0
  462. package/dist/runtime/kernel.d.ts +95 -1
  463. package/dist/runtime/kernel.d.ts.map +1 -1
  464. package/dist/runtime/monty-bridge.d.ts +6 -2
  465. package/dist/runtime/monty-bridge.d.ts.map +1 -1
  466. package/dist/runtime/monty-runtime.d.ts.map +1 -1
  467. package/dist/runtime/monty-runtime.js +27 -15
  468. package/dist/runtime/monty-runtime.js.map +2 -2
  469. package/dist/runtime/native-codemode-guest.d.ts.map +1 -1
  470. package/dist/runtime/node-process-runtime.d.ts.map +1 -1
  471. package/dist/runtime/node-process-runtime.js +7 -5
  472. package/dist/runtime/quickjs-runtime.d.ts +7 -1
  473. package/dist/runtime/quickjs-runtime.d.ts.map +1 -1
  474. package/dist/runtime/quickjs-runtime.js +5 -4
  475. package/dist/runtime/sha256.d.ts +4 -0
  476. package/dist/runtime/sha256.d.ts.map +1 -0
  477. package/dist/runtime/transpile.d.ts +8 -0
  478. package/dist/runtime/transpile.d.ts.map +1 -0
  479. package/dist/runtime/type-checker.d.ts +1 -7
  480. package/dist/runtime/type-checker.d.ts.map +1 -1
  481. package/dist/runtime/type-checker.js +4 -2
  482. package/dist/runtime/typescript-kernel.js +13 -10
  483. package/dist/runtime/typescript-kernel.js.map +1 -1
  484. package/dist/runtime-state-builtins.d.ts.map +1 -1
  485. package/dist/speculation/scanner.js +1 -1
  486. package/dist/speculation/store.d.ts +7 -16
  487. package/dist/speculation/store.d.ts.map +1 -1
  488. package/dist/speculation/types.d.ts +1 -0
  489. package/dist/speculation/types.d.ts.map +1 -1
  490. package/dist/storage/retention.d.ts.map +1 -1
  491. package/dist/topology/participant-directory.d.ts +26 -1
  492. package/dist/topology/participant-directory.d.ts.map +1 -1
  493. package/dist/topology/peer-presence.d.ts.map +1 -1
  494. package/dist/topology/peer-settle.js +11 -0
  495. package/dist/topology/peer-settle.js.map +7 -0
  496. package/dist/topology/session-label-settings.d.ts +13 -0
  497. package/dist/topology/session-label-settings.d.ts.map +1 -0
  498. package/dist/topology/session-label.d.ts +60 -0
  499. package/dist/topology/session-label.d.ts.map +1 -0
  500. package/dist/topology/types.d.ts +27 -0
  501. package/dist/topology/types.d.ts.map +1 -1
  502. package/dist/type-error-guidance.js +1 -1
  503. package/dist/ui/controller.d.ts +1 -0
  504. package/dist/ui/controller.d.ts.map +1 -1
  505. package/dist/ui/conversation-chrome.d.ts.map +1 -1
  506. package/dist/ui/conversation-chrome.js +3 -2
  507. package/dist/ui/conversation-commands.d.ts +1 -1
  508. package/dist/ui/conversation-commands.d.ts.map +1 -1
  509. package/dist/ui/conversation-native-reader.js +2 -2
  510. package/dist/ui/conversation-selection.d.ts +4 -1
  511. package/dist/ui/conversation-selection.d.ts.map +1 -1
  512. package/dist/ui/conversation-targets.d.ts.map +1 -1
  513. package/dist/ui/conversation-targets.js +2 -2
  514. package/dist/ui/conversation.d.ts +25 -24
  515. package/dist/ui/conversation.d.ts.map +1 -1
  516. package/dist/ui/conversation.js +170 -339
  517. package/dist/ui/conversation.js.map +2 -2
  518. package/dist/ui/core-tool-render.d.ts +1 -0
  519. package/dist/ui/core-tool-render.d.ts.map +1 -1
  520. package/dist/ui/dashboard.d.ts.map +1 -1
  521. package/dist/ui/dashboard.js +17 -13
  522. package/dist/ui/dashboard.js.map +2 -2
  523. package/dist/ui/fabric-render.d.ts +6 -0
  524. package/dist/ui/fabric-render.d.ts.map +1 -1
  525. package/dist/ui/footer-dock.d.ts +48 -0
  526. package/dist/ui/footer-dock.d.ts.map +1 -0
  527. package/dist/ui/format.d.ts +7 -0
  528. package/dist/ui/format.d.ts.map +1 -1
  529. package/dist/ui/settings-sections-lifecycle.d.ts.map +1 -1
  530. package/dist/ui/settings-sections-presentation.d.ts.map +1 -1
  531. package/dist/ui/settings-values.d.ts +1 -0
  532. package/dist/ui/settings-values.d.ts.map +1 -1
  533. package/dist/ui/settings.js +59 -18
  534. package/dist/ui/settings.js.map +2 -2
  535. package/dist/ui/shell-hang-keys.d.ts +8 -1
  536. package/dist/ui/shell-hang-keys.d.ts.map +1 -1
  537. package/dist/ui/shell-tasks.d.ts +2 -2
  538. package/dist/ui/shell-tasks.d.ts.map +1 -1
  539. package/dist/ui/shell-tasks.js +27 -94
  540. package/dist/ui/shell-tasks.js.map +2 -2
  541. package/dist/ui/snapshot.d.ts.map +1 -1
  542. package/dist/ui/terminal-title.d.ts +41 -0
  543. package/dist/ui/terminal-title.d.ts.map +1 -0
  544. package/dist/ui/types.d.ts +4 -0
  545. package/dist/ui/types.d.ts.map +1 -1
  546. package/dist/ui/widget-keys.d.ts +5 -0
  547. package/dist/ui/widget-keys.d.ts.map +1 -0
  548. package/dist/ui/widget.d.ts +34 -16
  549. package/dist/ui/widget.d.ts.map +1 -1
  550. package/dist/ui/word-diff/line-emphasis.js +1603 -0
  551. package/dist/ui/word-diff/line-emphasis.js.map +7 -0
  552. package/dist/util.d.ts +2 -0
  553. package/dist/util.d.ts.map +1 -1
  554. package/dist/verified/authority.d.ts +2 -2
  555. package/dist/verified/authority.d.ts.map +1 -1
  556. package/dist/verified/budget.d.ts +4 -0
  557. package/dist/verified/budget.d.ts.map +1 -0
  558. package/dist/verified/generated/actor-name.d.ts +4 -0
  559. package/dist/verified/generated/actor-name.js +17 -0
  560. package/dist/verified/generated/authority.d.ts +4 -0
  561. package/dist/verified/generated/authority.js +28 -0
  562. package/dist/verified/generated/budget.d.ts +4 -0
  563. package/dist/verified/generated/budget.js +17 -0
  564. package/dist/verified/generated/compaction.d.ts +4 -0
  565. package/dist/verified/generated/compaction.js +19 -0
  566. package/dist/verified/generated/grants.d.ts +4 -0
  567. package/dist/verified/generated/grants.js +17 -0
  568. package/dist/verified/generated/lifecycle.d.ts +4 -0
  569. package/dist/verified/generated/lifecycle.js +50 -0
  570. package/dist/verified/generated/manifest.json +137 -48
  571. package/dist/verified/generated/policy.d.ts +17 -0
  572. package/dist/verified/generated/policy.js +211 -0
  573. package/dist/verified/generated/provider.d.ts +4 -0
  574. package/dist/verified/generated/provider.js +18 -0
  575. package/dist/verified/generated/resources.d.ts +6 -0
  576. package/dist/verified/generated/resources.js +73 -0
  577. package/dist/verified/generated/speculation.d.ts +6 -0
  578. package/dist/verified/generated/speculation.js +48 -0
  579. package/dist/verified/generated/storage.d.ts +4 -0
  580. package/dist/verified/generated/storage.js +18 -0
  581. package/dist/verified/grants.d.ts +22 -0
  582. package/dist/verified/grants.d.ts.map +1 -0
  583. package/dist/verified/lifecycle.d.ts +31 -0
  584. package/dist/verified/lifecycle.d.ts.map +1 -0
  585. package/dist/verified/machine.d.ts +18 -0
  586. package/dist/verified/machine.d.ts.map +1 -0
  587. package/dist/verified/memory.d.ts +1 -1
  588. package/dist/verified/memory.d.ts.map +1 -1
  589. package/dist/verified/nat.d.ts +1 -1
  590. package/dist/verified/nat.d.ts.map +1 -1
  591. package/dist/verified/policy.d.ts +17 -5
  592. package/dist/verified/policy.d.ts.map +1 -1
  593. package/dist/verified/provider.d.ts +22 -0
  594. package/dist/verified/provider.d.ts.map +1 -0
  595. package/dist/verified/resources.d.ts +21 -7
  596. package/dist/verified/resources.d.ts.map +1 -1
  597. package/dist/verified/speculation.d.ts +36 -0
  598. package/dist/verified/speculation.d.ts.map +1 -0
  599. package/dist/verified/storage.d.ts.map +1 -1
  600. package/dist/worker/missing-install.d.ts +8 -0
  601. package/dist/worker/missing-install.d.ts.map +1 -0
  602. package/dist/worker/options.d.ts.map +1 -1
  603. package/dist/worker/options.js +25 -0
  604. package/dist/worker/options.js.map +2 -2
  605. package/dist/worker/prompt-lifecycle.d.ts +16 -0
  606. package/dist/worker/prompt-lifecycle.d.ts.map +1 -0
  607. package/dist/worker/prompt-lifecycle.js +90 -0
  608. package/dist/worker/prompt-lifecycle.js.map +7 -0
  609. package/dist/worker/questions.d.ts +15 -3
  610. package/dist/worker/questions.d.ts.map +1 -1
  611. package/dist/worker/questions.js +53 -8
  612. package/dist/worker/questions.js.map +2 -2
  613. package/dist/worker/recovery-watchdog.d.ts +22 -0
  614. package/dist/worker/recovery-watchdog.d.ts.map +1 -1
  615. package/dist/worker/recovery-watchdog.js +116 -1
  616. package/dist/worker/recovery-watchdog.js.map +2 -2
  617. package/dist/worker/result.js +1 -1
  618. package/dist/worker/result.js.map +2 -2
  619. package/dist/worker.js +131 -21
  620. package/dist/worker.js.map +2 -2
  621. package/docs/actor-name-policy-handoff.md +5 -0
  622. package/docs/agents.md +164 -17
  623. package/docs/architecture.md +5 -1
  624. package/docs/audit-trace.md +2 -1
  625. package/docs/background-tasks.md +102 -16
  626. package/docs/codemode-parity.md +2 -2
  627. package/docs/compaction.md +21 -5
  628. package/docs/components.md +1 -1
  629. package/docs/configuration.md +111 -66
  630. package/docs/decisions.md +92 -10
  631. package/docs/durable-extension.md +121 -0
  632. package/docs/durable-pi.md +306 -6
  633. package/docs/extractive-history.md +3 -1
  634. package/docs/interface.md +20 -17
  635. package/docs/jev.md +1 -1
  636. package/docs/kernels.md +1 -1
  637. package/{node_modules/pi-coralbricks-provider/LICENSE → docs/licenses/gdp-wired-mit.txt} +1 -1
  638. package/docs/managed-host-migration.md +50 -0
  639. package/docs/programmatic-compaction.md +216 -6
  640. package/docs/programs.md +23 -1
  641. package/docs/prompt-cache.md +4 -2
  642. package/docs/provider-capabilities.md +15 -14
  643. package/docs/providers.md +99 -3
  644. package/docs/shell-composition.md +15 -0
  645. package/docs/short-lock-protocol.md +90 -0
  646. package/docs/skills.md +5 -1
  647. package/docs/speculation.md +6 -0
  648. package/docs/verified-kernels.md +309 -220
  649. package/package.json +45 -24
  650. package/proofs/actor-name.ts +27 -0
  651. package/proofs/authority.ts +62 -0
  652. package/proofs/budget.ts +24 -0
  653. package/proofs/compaction.ts +51 -0
  654. package/proofs/grants.ts +39 -0
  655. package/proofs/index.ts +40 -0
  656. package/proofs/kernel.ts +44 -0
  657. package/proofs/lifecycle.ts +128 -0
  658. package/proofs/policy.ts +195 -0
  659. package/proofs/provider.ts +52 -0
  660. package/proofs/resources.ts +160 -0
  661. package/proofs/speculation.ts +69 -0
  662. package/proofs/storage.ts +66 -0
  663. package/scripts/verified-kernels.ts +141 -0
  664. package/skillsets/python/fabric-council/SKILL.md +92 -20
  665. package/skillsets/python/fabric-exec/SKILL.md +2 -2
  666. package/skillsets/python/fabric-exec/references/agents.md +10 -4
  667. package/skillsets/python/fabric-fusion/SKILL.md +1 -1
  668. package/skillsets/python/fabric-guide/SKILL.md +1 -1
  669. package/skillsets/typescript/fabric-council/SKILL.md +109 -22
  670. package/skillsets/typescript/fabric-exec/SKILL.md +7 -7
  671. package/skillsets/typescript/fabric-exec/references/agents.md +12 -3
  672. package/skillsets/typescript/fabric-fusion/SKILL.md +1 -1
  673. package/skillsets/typescript/fabric-guide/SKILL.md +1 -1
  674. package/LAWS.bend +0 -502
  675. package/PROOF.bend +0 -452
  676. package/dist/chunks/chunk-3UGN25XS.js.map +0 -7
  677. package/dist/chunks/chunk-4EW7GVUR.js.map +0 -7
  678. package/dist/chunks/chunk-5UBRGTVN.js.map +0 -7
  679. package/dist/chunks/chunk-BN7F52EG.js +0 -525
  680. package/dist/chunks/chunk-BN7F52EG.js.map +0 -7
  681. package/dist/chunks/chunk-DK35W6U7.js +0 -259
  682. package/dist/chunks/chunk-DK35W6U7.js.map +0 -7
  683. package/dist/chunks/chunk-EFETPXU2.js.map +0 -7
  684. package/dist/chunks/chunk-EHQQ4KCX.js.map +0 -7
  685. package/dist/chunks/chunk-EKODKR6Y.js.map +0 -7
  686. package/dist/chunks/chunk-FE6NOAO7.js.map +0 -7
  687. package/dist/chunks/chunk-FIDUHKMM.js.map +0 -7
  688. package/dist/chunks/chunk-FSB2VIRZ.js.map +0 -7
  689. package/dist/chunks/chunk-GIK2WNAK.js.map +0 -7
  690. package/dist/chunks/chunk-GO32KSEZ.js.map +0 -7
  691. package/dist/chunks/chunk-IR3PIHJM.js.map +0 -7
  692. package/dist/chunks/chunk-ITVLKXCI.js +0 -266
  693. package/dist/chunks/chunk-ITVLKXCI.js.map +0 -7
  694. package/dist/chunks/chunk-K7J2ABAZ.js.map +0 -7
  695. package/dist/chunks/chunk-KJZAOENY.js +0 -212
  696. package/dist/chunks/chunk-KJZAOENY.js.map +0 -7
  697. package/dist/chunks/chunk-LNASO4VT.js.map +0 -7
  698. package/dist/chunks/chunk-MLLYR3Y6.js.map +0 -7
  699. package/dist/chunks/chunk-P4KH4S4S.js.map +0 -7
  700. package/dist/chunks/chunk-PK4NIJEV.js.map +0 -7
  701. package/dist/chunks/chunk-Q2JQ3RYZ.js +0 -99
  702. package/dist/chunks/chunk-Q2JQ3RYZ.js.map +0 -7
  703. package/dist/chunks/chunk-R2XQ6AHT.js.map +0 -7
  704. package/dist/chunks/chunk-ROTCDDOV.js.map +0 -7
  705. package/dist/chunks/chunk-SPCJXN4K.js.map +0 -7
  706. package/dist/chunks/chunk-U366I5K2.js.map +0 -7
  707. package/dist/chunks/chunk-UKMQK5VP.js +0 -231
  708. package/dist/chunks/chunk-UKMQK5VP.js.map +0 -7
  709. package/dist/chunks/chunk-UOM37PE4.js.map +0 -7
  710. package/dist/chunks/chunk-UTOBAZ5T.js.map +0 -7
  711. package/dist/chunks/chunk-VSDUSNIA.js.map +0 -7
  712. package/dist/chunks/chunk-VTK2FEH7.js +0 -229
  713. package/dist/chunks/chunk-VTK2FEH7.js.map +0 -7
  714. package/dist/chunks/chunk-VYQV5JRT.js.map +0 -7
  715. package/dist/chunks/chunk-XCEEQ5AB.js.map +0 -7
  716. package/dist/chunks/chunk-ZLNJDTCN.js +0 -226
  717. package/dist/chunks/chunk-ZLNJDTCN.js.map +0 -7
  718. package/dist/chunks/chunk-ZQMBS5SH.js.map +0 -7
  719. package/dist/ui/conversation-shortcut.d.ts +0 -3
  720. package/dist/ui/conversation-shortcut.d.ts.map +0 -1
  721. package/dist/ui/widget-activity.d.ts +0 -21
  722. package/dist/ui/widget-activity.d.ts.map +0 -1
  723. package/dist/verified/generated/authority-kernel.d.ts +0 -10
  724. package/dist/verified/generated/authority-kernel.js +0 -127
  725. package/dist/verified/generated/kernel.d.ts +0 -31
  726. package/dist/verified/generated/kernel.js +0 -389
  727. package/dist/verified/generated/lifecycle-kernel.d.ts +0 -7
  728. package/dist/verified/generated/lifecycle-kernel.js +0 -164
  729. package/dist/verified/generated/provider-kernel.d.ts +0 -9
  730. package/dist/verified/generated/provider-kernel.js +0 -87
  731. package/dist/verified/generated/storage-kernel.d.ts +0 -11
  732. package/dist/verified/generated/storage-kernel.js +0 -107
  733. package/docs/licenses/bend-apache-2.0.txt +0 -202
  734. package/node_modules/pi-coralbricks-provider/README.md +0 -306
  735. package/node_modules/pi-coralbricks-provider/auth.ts +0 -30
  736. package/node_modules/pi-coralbricks-provider/custom-models.json +0 -1
  737. package/node_modules/pi-coralbricks-provider/deprecated-models.json +0 -1
  738. package/node_modules/pi-coralbricks-provider/guard.ts +0 -155
  739. package/node_modules/pi-coralbricks-provider/index.ts +0 -662
  740. package/node_modules/pi-coralbricks-provider/models.json +0 -88
  741. package/node_modules/pi-coralbricks-provider/package.json +0 -74
  742. package/node_modules/pi-coralbricks-provider/park.ts +0 -122
  743. package/node_modules/pi-coralbricks-provider/patch.json +0 -34
  744. package/node_modules/pi-coralbricks-provider/scripts/update-models.js +0 -658
  745. package/node_modules/pi-coralbricks-provider/settings.ts +0 -143
  746. package/node_modules/pi-coralbricks-provider/sync-policy.ts +0 -309
  747. package/proofs/abi.json +0 -308
  748. package/proofs/authority-abi.json +0 -7
  749. package/proofs/authority-kernel.bend +0 -23
  750. package/proofs/authority-proof.bend +0 -74
  751. package/proofs/authority-spec.bend +0 -30
  752. package/proofs/authority-state.bend +0 -43
  753. package/proofs/authority-types.d.ts +0 -3
  754. package/proofs/kernel.bend +0 -139
  755. package/proofs/lifecycle-abi.json +0 -3
  756. package/proofs/lifecycle-kernel.bend +0 -11
  757. package/proofs/lifecycle-proof.bend +0 -249
  758. package/proofs/lifecycle-spec.bend +0 -261
  759. package/proofs/lifecycle-types.d.ts +0 -4
  760. package/proofs/lifecycle.bend +0 -119
  761. package/proofs/provider-abi.json +0 -4
  762. package/proofs/provider-kernel.bend +0 -14
  763. package/proofs/provider-plans.bend +0 -28
  764. package/proofs/provider-spec.bend +0 -14
  765. package/proofs/provider-types.d.ts +0 -5
  766. package/proofs/resource-proof.bend +0 -633
  767. package/proofs/resource-spec.bend +0 -133
  768. package/proofs/resources.bend +0 -160
  769. package/proofs/state-kernel.bend +0 -17
  770. package/proofs/state-plans.bend +0 -40
  771. package/proofs/state-proof.bend +0 -42
  772. package/proofs/state-spec.bend +0 -26
  773. package/proofs/storage-abi.json +0 -3
  774. package/proofs/storage-kernel.bend +0 -11
  775. package/proofs/storage-plans.bend +0 -100
  776. package/proofs/storage-proof.bend +0 -176
  777. package/proofs/storage-spec.bend +0 -70
  778. package/proofs/storage-types.d.ts +0 -8
  779. package/proofs/types.d.ts +0 -7
  780. package/scripts/test-verified-kernels.mjs +0 -107
  781. package/scripts/verified-kernels.mjs +0 -176
  782. /package/dist/chunks/{chunk-3FJUP3GV.js.map → chunk-36XQFTEN.js.map} +0 -0
  783. /package/dist/chunks/{chunk-ZEXCKK4K.js.map → chunk-4WKD3YM3.js.map} +0 -0
  784. /package/dist/chunks/{chunk-5XBYFSI5.js.map → chunk-7YNE4NB2.js.map} +0 -0
  785. /package/dist/chunks/{chunk-K6QXUGS5.js.map → chunk-BMAEZNZ5.js.map} +0 -0
  786. /package/dist/chunks/{chunk-CCHZXF6K.js.map → chunk-CXYJJ3HZ.js.map} +0 -0
  787. /package/dist/chunks/{chunk-TIIIHPHF.js.map → chunk-GS67KDMV.js.map} +0 -0
  788. /package/dist/chunks/{chunk-D5NYNIST.js.map → chunk-H57KPL3V.js.map} +0 -0
  789. /package/dist/chunks/{chunk-INRXG4J5.js.map → chunk-HGD75NZY.js.map} +0 -0
  790. /package/dist/chunks/{chunk-UXIBKMUM.js.map → chunk-KIFOEBYJ.js.map} +0 -0
  791. /package/dist/chunks/{chunk-FUY6XVRX.js.map → chunk-MPMEK3IQ.js.map} +0 -0
  792. /package/dist/chunks/{chunk-HP5P7NBO.js.map → chunk-MSDL7U6Q.js.map} +0 -0
  793. /package/dist/chunks/{chunk-QT4W5YVB.js.map → chunk-RAA3FAYZ.js.map} +0 -0
  794. /package/dist/chunks/{chunk-53N2I4QA.js.map → chunk-TXCNZCZP.js.map} +0 -0
  795. /package/dist/chunks/{chunk-ASSLHWZS.js.map → chunk-UFMYN5TA.js.map} +0 -0
  796. /package/dist/chunks/{chunk-LEU5CDSL.js.map → chunk-XFOSUGLU.js.map} +0 -0
@@ -0,0 +1,141 @@
1
+ #!/usr/bin/env bun
2
+ // Proves the registered gdp-wired kernels and compiles them to the generated
3
+ // modules Fabric executes. `--artifact` only checks the receipt's hashes, so a
4
+ // build never loads the prover.
5
+ import { createHash } from "node:crypto";
6
+ import { readFileSync, writeFileSync } from "node:fs";
7
+ import { availableParallelism } from "node:os";
8
+ import type { ProofTask, ProofResult } from "./verified-kernel-worker.js";
9
+ import { resolve } from "node:path";
10
+ import { fileURLToPath } from "node:url";
11
+
12
+ const root = fileURLToPath(new URL("../", import.meta.url));
13
+ const read = (path: string): string => readFileSync(resolve(root, path), "utf8");
14
+ const hash = (text: string): string => createHash("sha256").update(text).digest("hex");
15
+ const receipt = "src/verified/generated/manifest.json";
16
+ const stems = ["policy", "compaction", "resources", "lifecycle", "storage", "provider", "authority", "grants", "speculation", "budget", "actor-name"];
17
+ const sources = ["proofs/index.ts", "proofs/kernel.ts", ...stems.map((stem) => `proofs/${stem}.ts`), "scripts/verified-kernels.ts", "scripts/verified-kernel-pool.ts", "scripts/verified-kernel-worker.ts"];
18
+ const artifacts = stems.flatMap((stem) => [`src/verified/generated/${stem}.js`, `src/verified/generated/${stem}.d.ts`]);
19
+ const pinned = (): string => {
20
+ const version = (JSON.parse(read("package.json")) as { devDependencies?: Record<string, string> }).devDependencies?.["gdp-wired"];
21
+ if (!version || !/^\d+\.\d+\.\d+$/.test(version)) throw new Error("gdp-wired must be pinned to an exact devDependency version");
22
+ return version;
23
+ };
24
+
25
+ interface Manifest {
26
+ version: 3;
27
+ prover: string;
28
+ inputs: Record<string, string>;
29
+ outputs: Record<string, string>;
30
+ claims: Record<string, string[]>;
31
+ }
32
+
33
+ const mode = process.argv[2];
34
+ const explicitJobs = process.argv.length === 5 && process.argv[3] === "--jobs";
35
+ const jobs = explicitJobs ? Number(process.argv[4]) : Math.min(4, availableParallelism());
36
+ if ((process.argv.length !== 3 && !explicitJobs) || !["--write", "--check", "--artifact"].includes(mode ?? "") ||
37
+ (mode === "--artifact" && explicitJobs) || !Number.isSafeInteger(jobs) || jobs < 1 || jobs > 4) {
38
+ throw new Error("Usage: bun scripts/verified-kernels.ts --write|--check [--jobs 1..4] | --artifact");
39
+ }
40
+
41
+ if (mode === "--artifact") {
42
+ const stored = JSON.parse(read(receipt)) as Manifest;
43
+ const stale = stored.version !== 3 || stored.prover !== `gdp-wired@${pinned()}` ||
44
+ JSON.stringify(stored.inputs) !== JSON.stringify(Object.fromEntries(sources.map((path) => [path, hash(read(path))]))) ||
45
+ JSON.stringify(stored.outputs) !== JSON.stringify(Object.fromEntries(artifacts.map((path) => [path, hash(read(path))])));
46
+ if (stale) throw new Error("Verified kernel artifact is stale. Run bun run proof:generate.");
47
+ console.log("Verified kernel artifact matches its proof sources.");
48
+ process.exit(0);
49
+ }
50
+
51
+ const installed = (JSON.parse(read("node_modules/gdp-wired/package.json")) as { version: string }).version;
52
+ if (installed !== pinned()) throw new Error(`gdp-wired ${pinned()} is pinned, but ${installed} is installed`);
53
+ const { modules } = await import("../proofs/index.js");
54
+ const { runWorkerTasks } = await import("./verified-kernel-pool.js");
55
+ const started = performance.now();
56
+ const plans = modules.map(module => ({ module, kernels: module.kernels() }));
57
+ if (new Set(modules.map(module => module.stem)).size !== stems.length || modules.length !== stems.length) throw new Error("Kernel module registry differs from the artifact inventory");
58
+ for (const { module, kernels } of plans) {
59
+ if (`proofs/${module.stem}.ts` !== module.source || !stems.includes(module.stem) || new Set(kernels.map(kernel => kernel.id)).size !== kernels.length) throw new Error(`Invalid kernel module ${module.stem}`);
60
+ }
61
+ const tasks: ProofTask[] = plans.flatMap(({ module, kernels }) => [
62
+ ...kernels.map(kernel => ({ kind: "kernel" as const, stem: module.stem, id: kernel.id })),
63
+ { kind: "mutations" as const, stem: module.stem },
64
+ ]);
65
+ console.log(`Checking ${tasks.length - modules.length} kernels and ${modules.reduce((count, module) => count + module.bugs.length, 0)} broken variants with ${jobs} isolated workers`);
66
+ const results = await runWorkerTasks<ProofTask, ProofResult>(tasks, {
67
+ worker: new URL("./verified-kernel-worker.ts", import.meta.url), jobs,
68
+ onResult(result, task) {
69
+ if (!result || result.kind !== task.kind || result.stem !== task.stem || !Array.isArray(result.failures)) throw new Error("Invalid proof worker result");
70
+ if (task.kind === "kernel") {
71
+ if (result.kind !== "kernel" || result.id !== task.id || typeof result.compiled !== "string") throw new Error("Missing compiled kernel result");
72
+ const kernel = plans.find(plan => plan.module.stem === task.stem)!.kernels.find(kernel => kernel.id === task.id)!;
73
+ const names = [...(kernel.laws ?? []), ...(kernel.stepLaws ?? [])].map(law => law.name).join("; ");
74
+ const expected = [
75
+ ...(kernel.rule && names ? [`${kernel.id}: ${names}`] : []),
76
+ ...(kernel.decisions ?? []).map(decision => `${kernel.id}: ${decision.name}`),
77
+ ];
78
+ if (JSON.stringify(result.claims) !== JSON.stringify(expected)) throw new Error(`Incomplete proof claims for ${task.stem}.${task.id}`);
79
+ console.log(`${result.failures.length ? "failed" : "proved"} ${task.stem}.${task.id} (${Math.round(result.seconds * 1000)} ms)`);
80
+ } else {
81
+ const count = plans.find(plan => plan.module.stem === task.stem)!.module.bugs.length;
82
+ if (result.kind !== "mutations" || (result.refused !== count && result.failures.length === 0)) throw new Error(`Incomplete mutation refusals for ${task.stem}`);
83
+ console.log(`refused ${result.refused} broken variants of ${task.stem}`);
84
+ }
85
+ },
86
+ });
87
+ const proved = new Map(results.filter((result): result is Extract<ProofResult, { kind: "kernel" }> => result.kind === "kernel").map(result => [`${result.stem}.${result.id}`, result]));
88
+
89
+ const failures = results.flatMap(result => result.failures);
90
+ const claims: Record<string, string[]> = {};
91
+ const files = new Map<string, string>();
92
+ for (const { module, kernels } of plans) {
93
+ claims[module.stem] = kernels.flatMap(kernel => proved.get(`${module.stem}.${kernel.id}`)!.claims);
94
+
95
+ const header = `// Generated by scripts/verified-kernels.ts from ${module.source} with gdp-wired@${installed}. Do not edit.\n`;
96
+ // Each compiled machine opens with the runtime helpers it calls, one per line;
97
+ // emit each helper once per module.
98
+ const helpers = new Map<string, string>();
99
+ const js = kernels.map((kernel) => {
100
+ const lines = proved.get(`${module.stem}.${kernel.id}`)!.compiled.trimEnd().split("\n");
101
+ const start = lines.findIndex((line) => line.startsWith("export function init("));
102
+ if (start < 1) throw new Error(`Unrecognized compiled machine layout in ${kernel.id}`);
103
+ for (const line of lines.slice(1, start)) {
104
+ const name = /^function (\$\w+)\(/.exec(line)?.[1];
105
+ if (name === undefined || (helpers.has(name) && helpers.get(name) !== line)) throw new Error(`Unrecognized compiled machine layout in ${kernel.id}`);
106
+ helpers.set(name, line);
107
+ }
108
+ // `fork` copies a state for branching searches; Fabric never branches, so it is not shipped.
109
+ const forkAt = lines.findIndex((line) => line.startsWith("export function fork("));
110
+ if (forkAt < start || lines[forkAt + 2] !== "}") throw new Error(`Unrecognized compiled machine layout in ${kernel.id}`);
111
+ const body = [lines[0], ...lines.slice(start, forkAt), ...lines.slice(forkAt + 3)].join("\n").replace(/^export function /gm, "function ");
112
+ if (/\bexport\b|\bimport\b|\brequire\(|\bprocess\b|\bglobalThis\b/.test(body)) throw new Error(`Unexpected host access in ${kernel.id}`);
113
+ return `export const ${kernel.id} = /* @__PURE__ */ (() => {\n${body}\nreturn { init, step };\n})();\n`;
114
+ }).join("\n");
115
+ const dts = [
116
+ "export interface MachineState { scalars: Record<string, number>; maps: Record<string, Map<number, number>>; defaults?: Record<string, number> }",
117
+ "export interface Machine { init(params: object): MachineState; step(params: object, state: MachineState, input: object): MachineState }",
118
+ ...kernels.map((kernel) => `export declare const ${kernel.id}: Machine;`),
119
+ ].join("\n");
120
+ files.set(`src/verified/generated/${module.stem}.js`, `${header}${[...helpers.values()].join("\n")}\n\n${js}`);
121
+ files.set(`src/verified/generated/${module.stem}.d.ts`, `${header}${dts}\n`);
122
+ }
123
+ if (failures.length) throw new Error(`Verified kernels failed:\n${failures.join("\n")}`);
124
+
125
+ const manifest: Manifest = {
126
+ version: 3,
127
+ prover: `gdp-wired@${installed}`,
128
+ inputs: Object.fromEntries(sources.map((path) => [path, hash(read(path))])),
129
+ outputs: Object.fromEntries(artifacts.map((path) => [path, hash(files.get(path)!)])),
130
+ claims,
131
+ };
132
+ files.set(receipt, `${JSON.stringify(manifest, null, 2)}\n`);
133
+ if (mode === "--write") {
134
+ for (const [path, text] of files) writeFileSync(resolve(root, path), text);
135
+ console.log(`Wrote ${files.size} verified kernel artifacts.`);
136
+ } else {
137
+ const drift = [...files].filter(([path, text]) => { try { return read(path) !== text; } catch { return true; } }).map(([path]) => path);
138
+ if (drift.length) throw new Error(`Generated kernels differ from the proved sources: ${drift.join(", ")}. Run bun run proof:generate.`);
139
+ console.log("Verified kernels reproduce byte for byte.");
140
+ }
141
+ console.log(`Proof verification completed in ${((performance.now() - started) / 1000).toFixed(2)}s (${jobs} workers)`);
@@ -6,11 +6,12 @@ disable-model-invocation: true
6
6
 
7
7
  # Fabric Council — Python
8
8
 
9
- Use one Python `fabric_exec`. Pass `payloads.task` and a JSON array in `payloads.roles`. Choose 3–5 distinct non-empty roles with useful disagreements, not redundant reviewers. Label the outer `display` and every child.
9
+ Use one Python `fabric_exec`. Pass `payloads.task`, a JSON array in `payloads.roles`, and a synthesis model key in `payloads.synthesis`; an empty `payloads.synthesis` keeps the session default. Choose 3–8 distinct non-empty roles with useful disagreements, not redundant reviewers. A role is a string or an object with `role` and optional `model` and `thinking`; a role without `model` runs on the session default. Label the outer `display` and every child.
10
10
 
11
11
  ```python
12
12
  import asyncio
13
13
  import json
14
+ from datetime import datetime, timezone
14
15
 
15
16
  async def ask(task, name, options=None):
16
17
  request = {"task": task, "name": name, "tools": ["read", "grep", "find", "ls"]}
@@ -21,34 +22,105 @@ async def ask(task, name, options=None):
21
22
  raise RuntimeError(result.get("error") or result["status"])
22
23
  return result["value"] if result.get("value") is not None else result["text"]
23
24
 
24
- roles = []
25
- for role in json.loads(π.roles):
26
- role = role.strip()
27
- if role and role not in roles:
28
- roles.append(role)
29
- if len(roles) < 3 or len(roles) > 5:
30
- raise ValueError("Council requires 3–5 distinct non-empty roles.")
25
+ def text(value):
26
+ return value.strip() if isinstance(value, str) else ""
31
27
 
32
- async def review(role):
28
+ def canonical(keys, needle, owner):
29
+ key = keys.get(needle.lower())
30
+ if key is not None:
31
+ return key
32
+ model_id = needle.lower().split("/")[-1]
33
+ near = [candidate for candidate in keys.values() if candidate.lower().endswith("/" + model_id)]
34
+ hint = " Did you mean: " + ", ".join(near[:8]) + "?" if near else ""
35
+ raise ValueError("Council: model " + needle + " for " + owner + " is not in the model registry." + hint)
36
+
37
+ specs = json.loads(π.roles)
38
+ if not isinstance(specs, list):
39
+ raise ValueError("Council roles must be a JSON array.")
40
+ seats = []
41
+ for spec in specs:
42
+ entry = {"role": spec} if isinstance(spec, str) else spec
43
+ if not isinstance(entry, dict):
44
+ raise ValueError("Each council role must be a string or an object with role and optional model and thinking.")
45
+ role = text(entry.get("role"))
46
+ if not role:
47
+ if isinstance(spec, str):
48
+ continue
49
+ raise ValueError("A council role object needs a non-empty role.")
50
+ if [value for value in [entry.get("model"), entry.get("thinking")] if value is not None and not isinstance(value, str)]:
51
+ raise ValueError("Council role " + role + " has a non-string model or thinking.")
52
+ if text(entry.get("thinking")) and text(entry.get("thinking")) not in ["off", "minimal", "low", "medium", "high", "xhigh", "max"]:
53
+ raise ValueError("Council role " + role + " has unknown thinking " + text(entry.get("thinking")) + ".")
54
+ seat = {"role": role}
55
+ if text(entry.get("model")):
56
+ seat["model"] = text(entry.get("model"))
57
+ if text(entry.get("thinking")):
58
+ seat["thinking"] = text(entry.get("thinking"))
59
+ earlier = [other for other in seats if other["role"] == role]
60
+ if not earlier:
61
+ seats.append(seat)
62
+ elif earlier[0].get("model") != seat.get("model") or earlier[0].get("thinking") != seat.get("thinking"):
63
+ raise ValueError("Council role " + role + " appears twice with different settings.")
64
+ if len(seats) < 3 or len(seats) > 8:
65
+ raise ValueError("Council requires 3–8 distinct non-empty roles.")
66
+ synthesis_model = text(π.synthesis)
67
+ if synthesis_model or [seat for seat in seats if seat.get("model")]:
68
+ # Match registry keys exactly before any agent runs, so a typo spends nothing.
69
+ keys = {}
70
+ for entry in await tools.models():
71
+ keys[entry["key"].lower()] = entry["key"]
72
+ for seat in seats:
73
+ if seat.get("model"):
74
+ seat["model"] = canonical(keys, seat["model"], "role " + seat["role"])
75
+ if synthesis_model:
76
+ synthesis_model = canonical(keys, synthesis_model, "synthesis")
77
+
78
+ async def review(seat):
79
+ options = {}
80
+ outcome = {"role": seat["role"]}
81
+ if seat.get("model"):
82
+ options["model"] = seat["model"]
83
+ outcome["model"] = seat["model"]
84
+ if seat.get("thinking"):
85
+ options["thinking"] = seat["thinking"]
33
86
  try:
34
- report = await ask("Act as the " + role + " council member. Independently analyze:\n" + π.task, role)
35
- return {"role": role, "status": "completed", "report": report}
87
+ report = await ask("Act as the " + seat["role"] + " council member. Independently analyze:\n" + π.task, seat["role"], options)
88
+ outcome.update({"status": "completed", "report": report})
36
89
  except Exception as error:
37
- return {"role": role, "status": "failed", "error": str(error)}
90
+ outcome.update({"status": "failed", "error": str(error)})
91
+ return outcome
38
92
 
39
- outcomes = await asyncio.gather(*[review(role) for role in roles])
93
+ outcomes = await asyncio.gather(*[review(seat) for seat in seats])
40
94
  completed = [item for item in outcomes if item["status"] == "completed"]
41
95
  failures = [item for item in outcomes if item["status"] == "failed"]
42
- coverage = {"requested": len(roles), "completed": len(completed)}
96
+ coverage = {"requested": len(seats), "completed": len(completed)}
97
+ # Name the model each seat and the synthesis requested; an unpinned seat ran on the session default.
98
+ summary = {"coverage": coverage, "seats": [dict(seats[index], status=outcomes[index]["status"]) for index in range(len(seats))]}
99
+ if synthesis_model:
100
+ summary["synthesisModel"] = synthesis_model
43
101
  if not completed:
44
- return {"status": "failed", "coverage": coverage, "failures": failures, "result": None}
102
+ return dict(summary, status="failed", failures=failures, result=None)
103
+ # Park completed reports in mesh before synthesis: an audit trail that survives this
104
+ # program, and full-text recovery when synthesis fails or a budget runs out.
105
+ reports_key = "council/" + datetime.now(timezone.utc).strftime("%Y-%m-%d-%H-%M-%S") + "/reports"
106
+ try:
107
+ await mesh.put({
108
+ "key": reports_key,
109
+ "value": [
110
+ {"role": item.get("role"), **({"model": item["model"]} if item.get("model") else {}), "report": item["report"]}
111
+ for item in completed
112
+ ],
113
+ })
114
+ reports = reports_key
115
+ except Exception as error:
116
+ reports = {"error": str(error)}
45
117
  if len(completed) == 1:
46
- return {"status": "partial", "coverage": coverage, "failures": failures, "result": completed[0]["report"], "synthesisSkipped": "Only one role completed; another agent adds no diversity."}
118
+ return dict(summary, status="partial", failures=failures, result=completed[0]["report"], reports=reports, synthesisSkipped="Only one role completed; another agent adds no diversity.")
47
119
  try:
48
- result = await ask("Synthesize only the completed reports into one decision. Reject unsupported claims, preserve material disagreements, and attribute concerns to roles. Never infer views of failed roles.\nTask:\n" + π.task + "\nReports:\n" + json.dumps(completed), "council synthesis")
49
- return {"status": "partial" if failures else "success", "coverage": coverage, "failures": failures, "result": result}
120
+ result = await ask("Synthesize only the completed reports into one decision. Reject unsupported claims, preserve material disagreements, and attribute concerns to roles. Never infer views of failed roles.\nTask:\n" + π.task + "\nReports:\n" + json.dumps(completed), "council synthesis", {"model": synthesis_model} if synthesis_model else None)
121
+ return dict(summary, status="partial" if failures else "success", failures=failures, result=result, reports=reports)
50
122
  except Exception as error:
51
- return {"status": "partial", "coverage": coverage, "failures": failures, "result": None, "synthesisError": str(error), "fallback": completed}
123
+ return dict(summary, status="partial", failures=failures, result=None, synthesisError=str(error), reports=reports, fallback=[{"role": item.get("role"), "status": "completed", "report": item["report"][:1200]} for item in completed])
52
124
  ```
53
125
 
54
- Reserve at least the role count plus one agent call. Concurrency remains host-limited; usage settles afterward, not as a hard token reservation. Successful synthesis returns only the compact decision; raw reports return only on synthesis failure. A partial result is useful evidence with named gaps, not permission for an automatic whole-council rerun. Retry only the failed role or synthesis when needed. Do not use a council for a lookup.
126
+ Reserve at least the role count plus one agent call. Concurrency remains host-limited; usage settles afterward, not as a hard token reservation. Model keys must match a Pi registry key from `tools.models()` exactly, ignoring case; the program refuses a `models.aliases` name or a partial id, and checks every key before any agent runs. Whenever at least one seat completes, full role reports are parked to mesh under a `council/<timestamp>/reports` key carried by every outcome as `reports`: `mesh.get` it for audit or to retry a budget-starved synthesis with one plain agent, and `mesh.delete` it when no longer needed; on synthesis failure the fallback carries report heads plus that mesh key, so full texts never need to land in context. Every result lists `seats` with each role's pinned model, thinking, and status, plus `synthesisModel` when one was pinned. These are the models the program requested; keeping a run on its pinned model is the host's job. Successful synthesis returns only the compact decision, coverage, seats, and failures; raw reports return only on synthesis failure. A partial result is useful evidence with named gaps, not permission for an automatic whole-council rerun. Retry only the failed role or synthesis when needed. Do not use a council for a lookup.
@@ -40,7 +40,7 @@ Use top-level `payloads` for multiline content. Only exact keys supplied in this
40
40
 
41
41
  ## Discovery and host actions
42
42
 
43
- Known actions use `await mcp.<server>.<tool>(...)`, `await extensions.<name>(...)`, or stable providers `memory`, `state`, `schema`, `compact`, `thinking`, `decisions`, `programs`, `components`, `agents`, and `mesh`. Underscore-prefixed capability names require `tools.call` with the exact discovered ref. Host methods accept one dict or keyword arguments, not callback functions. Supply acyclic JSON-compatible arguments.
43
+ Known actions use `await mcp.<server>.<tool>(...)`, `await extensions.<name>(...)`, or stable providers `memory`, `state`, `schema`, `compact`, `thinking`, `decisions`, `programs`, `components`, `agents`, and `mesh`. A provider another extension registers is also a global named after it: `await context.task_add(title="x")` is `tools.call` with the same policy. Reserved or hyphenated provider names (and `tasks`, `sessions`) have no global; call them with `tools.call`. Underscore-prefixed capability names require `tools.call` with the exact discovered ref. Host methods accept one dict or keyword arguments, not callback functions. Supply acyclic JSON-compatible arguments.
44
44
 
45
45
  ```python
46
46
  hits = await tools.search(query="deployment status", limit=3)
@@ -55,7 +55,7 @@ Inspect `inputSchema` and `outputSchema` before calling a dynamic action. `await
55
55
 
56
56
  `memory.recall` searches evidence; catalog descriptions are navigation, not evidence. Follow returned `follow` and `next` dictionaries with `await tools.call(hit["follow"])` and `await tools.call(result["next"])`. Use `memory.expand` and explicit loops for paging, not guest callback helpers. Do not parse Pi session JSONL manually. Discover exact schemas with `tools.describe` rather than guessing fields.
57
57
 
58
- `state` records claims and verification; `await state.verify(binding={"commit": sha})` binds the certificate (a commit that differs from git HEAD fails closed). Under Schema enforce, protected changes must use `schema.hypothesize`, `schema.verify`, and `schema.commit` in one invocation; do not bypass host gates. `compact.request` requests compaction rather than running an alternate executor. `await compact.pressure()` returns a read-only dict with `band` (`ok`/`warn`/`urgent`/`unknown`), `headroomTokens`, and `owner`; `await compact.carry(add=["fact"])` keeps a bounded focus list in every Fabric summary until `compact.carry(clear=True)` (no arguments reads `{"items": [...]}`). `await thinking.set(level="high", scope="turn")` raises Main's reasoning effort until the next agent_end (`scope="turns"` with `turns=1..20`, or `"session"` until `await thinking.reset()`); levels clamp into `thinking.bounds` and the model's levels, and `await thinking.status()` reports `level`, `available`, `bounds`, `baseline`, and any `override`. `d = (await decisions.raise(title="Deploy?", input="confirm"))["id"]` stores a durable pending decision (`holder` `"user"` by default, so only a person answers through `/fabric decisions` or `pi-fabric decisions answer`); `await decisions.wait(id=d)` returns the record once answered, expired, or cancelled, and `decisions.list`, `decisions.answer(id=..., optionId=...)`, and `decisions.cancel(id=...)` cover the rest. `onExpire="escalate"` with `escalation={"hopTimeoutMs": 600000}` hands an unanswered decision up its chain (default supervisor, root, user) at each deadline; the current holder passes it up now with `await decisions.escalate(id=d, reason="...")`. Never answer a decision you raised. `await programs.save(name="triage", code=source, inputSchema={...})` stores a content-addressed candidate and returns `{"ref": "triage@<digest12>", "digest": ...}`; `await programs.run(ref="triage", input={...})` runs a saved program nested with this program's capabilities and approvals, its `input` global set from `input`, and returns its value. `programs.list(name=..., status=...)` and `programs.get(ref=...)` read; only the user promotes or retires with `/fabric programs`.
58
+ `state` records claims and verification; `await state.verify(binding={"commit": sha})` binds the certificate (a commit that differs from git HEAD fails closed). Under Schema enforce, protected changes must use `schema.hypothesize`, `schema.verify`, and `schema.commit` in one invocation; do not bypass host gates. `compact.request` requests compaction rather than running an alternate executor; `seed="..."` is queued after the commit as a labelled Fabric message that starts a turn. `await compact.pressure()` returns a read-only dict with `band` (`ok`/`warn`/`urgent`/`unknown`), `headroomTokens`, and `owner`; `await compact.carry(add=["fact"])` keeps a bounded focus list in every Fabric summary until `compact.carry(clear=True)` (no arguments reads `{"items": [...]}`). `await thinking.set(level="high", scope="turn")` raises Main's reasoning effort until the next agent_end (`scope="turns"` with `turns=1..20`, or `"session"` until `await thinking.reset()`); levels clamp into `thinking.bounds` and the model's levels, and `await thinking.status()` reports `level`, `available`, `bounds`, `baseline`, and any `override`. `d = (await decisions.raise(title="Deploy?", input="confirm"))["id"]` stores a durable pending decision (`holder` `"user"` by default, so only a person answers through `/fabric decisions` or `pi-fabric decisions answer`); `await decisions.wait(id=d)` returns the record once answered, expired, or cancelled; the program deadline pauses while it waits, and with no `timeoutMs` and no decision deadline it returns the still-open record after `executor.maxTimeoutMs`; and `decisions.list`, `decisions.answer(id=..., optionId=...)`, and `decisions.cancel(id=...)` cover the rest. `onExpire="escalate"` with `escalation={"hopTimeoutMs": 600000}` hands an unanswered decision up its chain (default supervisor, root, user) at each deadline; the current holder passes it up now with `await decisions.escalate(id=d, reason="...")`. Never answer a decision you raised. `await programs.save(name="triage", code=source, inputSchema={...})` stores a content-addressed candidate and returns `{"ref": "triage@<digest12>", "digest": ...}`; `await programs.run(ref="triage", input={...})` runs a saved program nested with this program's capabilities and approvals, its `input` global set from `input`, and returns its value. `programs.list(name=..., status=...)` and `programs.get(ref=...)` read; only the user promotes or retires with `/fabric programs`.
59
59
 
60
60
  Advanced agent/mesh workflows require explicit user intent. Branch pointers: read `<skill-dir>/references/agents.md` for child agents and persistent actors, `<skill-dir>/references/mesh.md` for coordination, and `<skill-dir>/references/mcp.md` for MCP naming/management only when the task needs those surfaces. Peer means another root Pi session: query `await agents.peers()` first, not child-agent lists. Agent calls inherit this kernel unless a child's language is explicitly selected; that does not change this program's language. Omit agent `timeoutMs` unless requesting longer than the configured default. Use discovered host actions with ordinary loops and `asyncio.gather`; use the selected Python skill tree, never launch another interpreter to run workflow programs.
61
61
 
@@ -13,11 +13,15 @@ result = await agents.run(name="security-review", task="Review the current diff
13
13
  return {"status": result["status"], "text": result["text"], "error": result.get("error")}
14
14
  ```
15
15
 
16
- Request fields include task, name, runner, kernel, transport, model, persona, thinking, thinkingBounds, tools, timeoutMs, extensions, recursive, cwd, worktree, worktreeSetup, seed, seedMessages, readOnly, writableRoots, shell, scope, schema. Omit timeoutMs normally; per-call values below the configured agent timeout floor are ignored. Use top-level agentBudget for bounded calls; the Python guest has no callback-helper tokenBudget API. Host concurrency and settled-usage checks still apply.
16
+ Request fields include task, agent, name, runner, kernel, transport, model, modelMatch, persona, thinking, thinkingBounds, tools, timeoutMs, extensions, recursive, cwd, worktree, worktreeSetup, seed, seedMessages, readOnly, writableRoots, shell, scope, schema, systemPrompt, skills, plus spawn-only residency and queue. Omit timeoutMs normally; per-call values below the configured agent timeout floor are ignored. Use top-level agentBudget for bounded calls; the Python guest has no callback-helper tokenBudget API. Host concurrency and settled-usage checks still apply.
17
17
 
18
18
  - Pi children inherit Python and its configured backend, including recursive and alternate-cwd launches. Explicit child kernel selection changes only the child, never this invocation. Claude/Veda and extensions=False reject concrete Fabric kernels; omitted/inherit leaves their harness native. Do not hop interpreters to run this program.
19
19
  - `runner` defaults to configured policy; Pi, Claude, and Veda are available. Only Pi supports recursion. Veda persona/model follow its backend; Claude keys come from `await agents.models(runner="claude")`. Extensions may register more runner ids; requests needing an undeclared runner capability fail before launch. `outcome == "indeterminate"` means Fabric cannot confirm the work ran and never retries it; inspect before re-running.
20
- - Pi models must resolve in the owner's visible registry. `await tools.models()` lists Pi models; `agents.models` uses the requested or configured runner. Use canonical keys; report unresolved/ambiguous choices rather than guessing.
20
+ - `modelMatch="exact"` (Pi runners only) selects a listed `provider/id` without aliases, closest or fuzzy matching, or alias thinking. Missing, malformed or unlisted models and non-Pi runners are refused before launch. Admission is strict, and a child guard detects session model switches and some rewrites of known API payloads. **This is not a security guarantee or final-dispatch enforcement:** later hooks, unknown API payloads, providers and extension-made calls can route data elsewhere. Attribution may detect drift only after a call; do not rely on this mode to prevent data disclosure. See `docs/agents.md`.
21
+ - `systemPrompt` is appended to the child's system prompt (Veda gets it as a `<system_instructions>` block); blank is ignored and durable spawn refuses it.
22
+ - `skills` picks the child's Pi skills by name from this session's skills: `False` gives none; `["writing"]` preloads those in full and keeps this session's others listed; `{"preload": ["writing"], "inherit": False}` keeps only the preloaded ones. Omitted keeps Pi's own discovery. An unknown name fails before launch and lists the names. Pi runners only; Claude, Veda and durable spawn refuse it.
23
+ - `agent="name"` fills the request from a Markdown agent file (user `~/.pi/agent/agents`, project `.pi/agents`; project wins): body is `systemPrompt`, plus `model`, `tools`, `thinking` or `effort`, `skills`, `context.skills`, and `runtimes.fabric`. Fields on the call win; an unknown name fails before launch listing the names. `await agents.definitions()` lists them with `scope`, `shadows` and `warnings`.
24
+ - Pi models must resolve in the owner's visible registry. `await tools.models()` lists Pi models; `agents.models` uses the requested or configured runner. Use canonical keys; report unresolved/ambiguous choices rather than guessing. To check one known key without reading the whole list, pass it as `model`: only entries whose `key` equals it exactly and case-sensitively are returned (no alias or fuzzy resolution, `[]` when absent), e.g. `known = await agents.models(runner="pi", model="provider/id")`.
21
25
  - `tools` is a native allowlist, inherited by nested calls for extension-enabled full-code Pi children. Claude maps supported core tools to its native names. `extensions=False` disables Fabric, not ordinary tools.
22
26
  - `cwd` is a real directory, relative to the caller or absolute; symlinks canonicalize. Invalid/non-directory paths fail without fallback. Recursive Pi requests accept cwd too (`agents.run(..., runner="pi", recursive=True, cwd="../other")`). Omission inherits the immediate caller’s effective directory. Project/mesh lineage and kernel/backend inheritance stay with the caller; cwd does not grant project trust, and Pi evaluates the actual target/worktree path under its own rules. Descendant tools are intersected with the inherited optional-tool allowlist, including durable transfer. Cwd is not filesystem isolation.
23
27
  - `worktree=True` creates a retained dedicated Git worktree in the selected repository. Verify canonical repository identity, never infer it from directory naming. Abort with zero changes on mismatch. Partition concurrent edit ownership; never edit shared files concurrently. Inspect and stop active work before cleanup; leave unrelated worktrees alone.
@@ -28,14 +32,16 @@ Request fields include task, name, runner, kernel, transport, model, persona, th
28
32
  - Children may read `PI_FABRIC_LINEAGE` (also `(await agents.self())["lineage"]`), `PI_FABRIC_WRITE_POLICY`, `PI_FABRIC_SCOPE`, `PI_FABRIC_THINKING_BOUNDS`, `PI_FABRIC_DEPTH`, and `PI_FABRIC_AGENT_NAME`; other `PI_FABRIC_*` variables are internal.
29
33
  - `schema` requests validated structured output. `thinking` is configured/clamped reasoning effort; with `thinking.bounds` configured a clamped run reports `requestedThinking`. `thinkingBounds={"min": ..., "max": ...}` narrows the child's bounds and must lie inside the caller's bounds.
30
34
 
31
- `agents.spawn` returns a handle; `wait`, `status`, `stop`, and `cleanup` take its id. Unread detached results are batched after the current tool turn, or wake idle Main once; concise UI notices appear immediately. `wait`/`join` and terminal `status` acknowledge results and retract pending notifications, even after completion. Running status and UI/list polling do not acknowledge them. Return the relevant outcome to Main from your program; prefer `wait` over status polling. Escape/error parks results until new input. `residency="durable"` is a spawn-only opt-in to outlive Main, requiring trusted mesh and no Schema enforce; unread deliveries and acknowledgments survive reconnects.
35
+ For a long workflow (many agents or beads) whose result you do not need before continuing, call `fabric_exec` with `background: true`: the call returns a task ID, the program keeps running, and its result arrives as a background task event. The user can then steer you while it runs. Do not start the same program again while it runs.
36
+
37
+ `agents.spawn` returns a handle; `wait`, `status`, `stop`, and `cleanup` take its id. Unread detached results are batched after the current tool turn, or wake idle Main once; concise UI notices appear immediately. `wait`/`join` and terminal `status` acknowledge results and retract pending notifications, even after completion. Running status and UI/list polling do not acknowledge them. Return the relevant outcome to Main from your program; prefer `wait` over status polling. Escape/error parks results until new input. `residency="durable"` is a spawn-only opt-in to outlive Main, requiring trusted mesh and no Schema enforce; unread deliveries and acknowledgments survive reconnects. `spawn` waits inside the call for a free `agents.maxConcurrent` slot; `queue=True` returns at once with `status: "queued"`, and the run starts when a slot frees, even after the program ends. `wait`, `status` and `list` accept the id meanwhile, and `stop` cancels it without launching. Not with `residency="durable"`.
32
38
 
33
39
  ```python
34
40
  handle = await agents.spawn(task="Map the persistence layer.", tools=["read", "grep", "find", "ls"])
35
41
  return await agents.wait(id=handle["id"])
36
42
  ```
37
43
 
38
- `agents.list(scope="local")` lists local children; lineage/project include federated participants. Peer is reserved for another root Pi session: query `await agents.peers()` first, not children. A `<fabric-peers>` transcript message is a host notice (not a user request) listing the other root sessions sharing this project's files by label and participant id, sent only when that set changes; pass a listed id to `agents.steer` to coordinate. `agents.self`, `members`, and `main` expose participant identity and capabilities. Cross-process steer/followUp/stop route through the authenticated owner and return after acknowledgment; do not publish control topics yourself. If the owner restarted, an unexecuted command fails with "targets a previous owner incarnation"; Fabric does not retry, so re-read the participant and resend only if still wanted. Prefer steering useful running children over destroying their context. Check status before steering a finished child. Provider-registered work appears as `kind="provider"` members with ids `provider:<provider>:<id>`; `agents.stop`, `steer`, and `followUp` accept those ids and call the provider (stop returns `{"ref", "outcome": "confirmed" | "unconfirmed"}`). Cancelling or timing out a program stops the non-detached provider work it started.
44
+ `agents.list(scope="local")` lists local children; lineage/project include federated participants. Peer is reserved for another root Pi session: query `await agents.peers()` first, not children. A `<fabric-peers>` transcript message is a host notice (not a user request) listing the other root sessions sharing this project's files by label and participant id, sent only when that set changes; pass a listed id to `agents.steer` to coordinate. `agents.self`, `members`, and `main` expose participant identity and capabilities. Cross-process steer/followUp/stop route through the authenticated owner and return after acknowledgment; do not publish control topics yourself. If the owner restarted, an unexecuted command fails with "targets a previous owner incarnation"; Fabric does not retry, so re-read the participant and resend only if still wanted. Prefer steering useful running children over destroying their context. Check status before steering a finished child. Provider-registered work appears as `kind="provider"` members with ids `provider:<provider>:<id>`; `agents.stop`, `steer`, and `followUp` accept those ids and call the provider (stop returns `{"ref", "outcome": "confirmed" | "unconfirmed"}`). Cancelling or timing out a program stops the non-detached provider work it started. `agents.sleep(id=...)` parks an idle hosted run in this session and `agents.wake(id=...)` resumes it; both need a runner with the `sleep` capability and return `{"id", "requested"}`. The run stays `running` with `sleeping: true` once the runner reports it. Other runners, unknown ids, and finished runs raise.
39
45
 
40
46
  ## Lifecycle subscriptions
41
47
 
@@ -109,4 +109,4 @@ except Exception as error:
109
109
 
110
110
  Reserve panel count plus one agent call; concurrency and settled usage are host-limited, not hard token reservations. Plain non-recursive agents keep deliberation one level. Claude is optional and uses canonical `claude/` keys; never pass a concrete Fabric kernel to a native Claude child. Pi children inherit Python.
111
111
 
112
- Successful comparison returns only compact structured analysis. Successful acting keeps reference advice private. Zero completed references mean no actor spend; partial reference coverage still permits one actor. Failed aggregation returns completed work as fallback. Never automatically rerun successful references or the full panel; retry only missing coverage or aggregation. For same-model role diversity recommend `/skill:fabric-council` for the user; do not invoke another user-only skill yourself.
112
+ Successful comparison returns only compact structured analysis. Successful acting keeps reference advice private. Zero completed references mean no actor spend; partial reference coverage still permits one actor. Failed aggregation returns completed work as fallback. Never automatically rerun successful references or the full panel; retry only missing coverage or aggregation. For role diversity, on one model or with a model pinned to each role, recommend `/skill:fabric-council` for the user; do not invoke another user-only skill yourself.
@@ -11,7 +11,7 @@ Recommend the smallest sufficient path; do not invoke it. Core coding needs no a
11
11
  | Need | Recommend |
12
12
  |---|---|
13
13
  | Finite discover → fan-out → verify work | `/skill:fabric-workflow` |
14
- | Same-model independent roles and synthesis | `/skill:fabric-council` |
14
+ | Independent roles and synthesis, optionally one model per seat | `/skill:fabric-council` |
15
15
  | Different models compared by a judge, or read-only references executed by one actor | `/skill:fabric-fusion` |
16
16
  | Work too large for one context window | `/skill:fabric-rlm` |
17
17
  | Evidence-gated or transactional local-file mutation | `/skill:fabric-schema` |
@@ -6,41 +6,93 @@ disable-model-invocation: true
6
6
 
7
7
  # Fabric Council
8
8
 
9
- Use one `fabric_exec` call with bounded role fan-out. Choose three to five roles that disagree usefully rather than duplicating one another, such as correctness, security, operability, maintainability, and requirements skepticism.
9
+ Use one `fabric_exec` call with bounded role fan-out. Choose three to eight roles that disagree usefully rather than duplicating one another, such as correctness, security, operability, maintainability, and requirements skepticism. Pin a model to a role when you want vendor diversity as well as role diversity.
10
10
 
11
11
  ```ts
12
+ type CouncilSeat = { role: string; model?: string; thinking?: FabricThinking };
12
13
  type CouncilOutcome =
13
- | { role: string; status: "completed"; report: string }
14
- | { role: string; status: "failed"; error: string };
14
+ | { role: string; model?: string; status: "completed"; report: string }
15
+ | { role: string; model?: string; status: "failed"; error: string };
15
16
 
16
- const roles = [...new Set(
17
- (JSON.parse(π.roles) as string[]).map((role) => role.trim()).filter(Boolean),
18
- )];
19
- if (roles.length < 3 || roles.length > 5) {
20
- throw new Error("Council requires 3–5 distinct non-empty roles.");
17
+ const text = (value: unknown): string => (typeof value === "string" ? value.trim() : "");
18
+ const specs: unknown = JSON.parse(π.roles);
19
+ if (!Array.isArray(specs)) throw new Error("Council roles must be a JSON array.");
20
+ const seats: CouncilSeat[] = [];
21
+ for (const spec of specs) {
22
+ const entry = (typeof spec === "string" ? { role: spec } : spec) as Record<string, unknown> | null;
23
+ if (!entry || typeof entry !== "object") {
24
+ throw new Error("Each council role must be a string or a { role, model?, thinking? } object.");
25
+ }
26
+ const role = text(entry.role);
27
+ if (!role) {
28
+ if (typeof spec === "string") continue;
29
+ throw new Error("A council role object needs a non-empty role.");
30
+ }
31
+ if ([entry.model, entry.thinking].some((value) => value != null && typeof value !== "string")) {
32
+ throw new Error(`Council role "${role}" has a non-string model or thinking.`);
33
+ }
34
+ const thinking = text(entry.thinking);
35
+ if (thinking && !["off", "minimal", "low", "medium", "high", "xhigh", "max"].includes(thinking)) {
36
+ throw new Error(`Council role "${role}" has unknown thinking "${thinking}".`);
37
+ }
38
+ const seat: CouncilSeat = { role };
39
+ if (text(entry.model)) seat.model = text(entry.model);
40
+ if (text(entry.thinking)) seat.thinking = text(entry.thinking) as FabricThinking;
41
+ const earlier = seats.find((other) => other.role === role);
42
+ if (!earlier) seats.push(seat);
43
+ else if (earlier.model !== seat.model || earlier.thinking !== seat.thinking) {
44
+ throw new Error(`Council role "${role}" appears twice with different settings.`);
45
+ }
46
+ }
47
+ if (seats.length < 3 || seats.length > 8) {
48
+ throw new Error("Council requires 3–8 distinct non-empty roles.");
49
+ }
50
+ let synthesisModel = text(π.synthesis) || undefined;
51
+ if (synthesisModel || seats.some((seat) => seat.model)) {
52
+ // Match registry keys exactly before any agent runs, so a typo spends nothing.
53
+ const keys = new Map((await tools.models()).map((entry) => [entry.key.toLowerCase(), entry.key]));
54
+ const canonical = (needle: string, owner: string): string => {
55
+ const key = keys.get(needle.toLowerCase());
56
+ if (key) return key;
57
+ const id = needle.toLowerCase().split("/").pop();
58
+ const near = [...keys.values()].filter((candidate) => candidate.toLowerCase().endsWith(`/${id}`));
59
+ throw new Error(
60
+ `Council: model "${needle}" for ${owner} is not in the model registry.` +
61
+ (near.length ? ` Did you mean: ${near.slice(0, 8).join(", ")}?` : ""),
62
+ );
63
+ };
64
+ for (const seat of seats) if (seat.model) seat.model = canonical(seat.model, `role "${seat.role}"`);
65
+ if (synthesisModel) synthesisModel = canonical(synthesisModel, "synthesis");
21
66
  }
22
67
  await workflow.configure({
23
68
  name: "Council review",
24
- description: `${roles.length} independent perspectives with best-effort synthesis`,
69
+ description: `${seats.length} independent perspectives with best-effort synthesis`,
25
70
  });
26
- await phase("Deliberate", { total: roles.length + 1 });
71
+ await phase("Deliberate", { total: seats.length + 1 });
27
72
  const outcomes = await parallel(
28
- roles.map((role) => async (): Promise<CouncilOutcome> => {
73
+ seats.map((seat) => async (): Promise<CouncilOutcome> => {
74
+ const pin = seat.model ? { model: seat.model } : {};
29
75
  try {
30
76
  const report = await agent(
31
- `Act as the ${role} council member. Independently analyze this task:\n\n${π.task}`,
32
- { label: role, tools: ["read", "grep", "find", "ls"] },
77
+ `Act as the ${seat.role} council member. Independently analyze this task:\n\n${π.task}`,
78
+ {
79
+ label: seat.role,
80
+ tools: ["read", "grep", "find", "ls"],
81
+ ...pin,
82
+ ...(seat.thinking ? { thinking: seat.thinking } : {}),
83
+ },
33
84
  );
34
- return { role, status: "completed", report };
85
+ return { role: seat.role, ...pin, status: "completed", report };
35
86
  } catch (error) {
36
87
  return {
37
- role,
88
+ role: seat.role,
89
+ ...pin,
38
90
  status: "failed",
39
91
  error: error instanceof Error ? error.message : String(error),
40
92
  };
41
93
  }
42
94
  }),
43
- { concurrency: roles.length },
95
+ { concurrency: seats.length },
44
96
  );
45
97
  const completed = outcomes.filter(
46
98
  (outcome): outcome is Extract<CouncilOutcome, { status: "completed" }> =>
@@ -50,16 +102,39 @@ const failures = outcomes.filter(
50
102
  (outcome): outcome is Extract<CouncilOutcome, { status: "failed" }> =>
51
103
  outcome.status === "failed",
52
104
  );
53
- const coverage = { requested: roles.length, completed: completed.length };
105
+ const coverage = { requested: seats.length, completed: completed.length };
106
+ // Name the model each seat and the synthesis requested; an unpinned seat ran on the session default.
107
+ const pins = {
108
+ seats: seats.map((seat, index) => ({ ...seat, status: outcomes[index].status })),
109
+ ...(synthesisModel ? { synthesisModel } : {}),
110
+ };
54
111
  if (completed.length === 0) {
55
- return { status: "failed", coverage, failures, result: null };
112
+ return { status: "failed", coverage, ...pins, failures, result: null };
113
+ }
114
+ // Park completed reports in mesh before synthesis: an audit trail that survives this
115
+ // program, and full-text recovery when synthesis fails or a budget runs out.
116
+ const reportsKey = `council/${new Date().toISOString().slice(0, 19).replace(/[:T]/g, "-")}/reports`;
117
+ let reports: string | { error: string } = reportsKey;
118
+ try {
119
+ await mesh.put({
120
+ key: reportsKey,
121
+ value: completed.map((outcome) => ({
122
+ role: outcome.role,
123
+ ...(outcome.model ? { model: outcome.model } : {}),
124
+ report: outcome.report,
125
+ })),
126
+ });
127
+ } catch (error) {
128
+ reports = { error: error instanceof Error ? error.message : String(error) };
56
129
  }
57
130
  if (completed.length === 1) {
58
131
  return {
59
132
  status: "partial",
60
133
  coverage,
134
+ ...pins,
61
135
  failures,
62
136
  result: completed[0].report,
137
+ reports,
63
138
  synthesisSkipped: "Only one role completed; another agent would add no diversity.",
64
139
  };
65
140
  }
@@ -67,28 +142,40 @@ if (completed.length === 1) {
67
142
  try {
68
143
  const result = await agent(
69
144
  `Synthesize these completed reports into one decision. Reject unsupported claims, preserve material disagreements, attribute each concern to its role. Do not infer the views of failed roles.\n\nTask:\n${π.task}\n\nReports:\n${JSON.stringify(completed)}`,
70
- { label: "council synthesis", tools: ["read", "grep", "find", "ls"] },
145
+ {
146
+ label: "council synthesis",
147
+ tools: ["read", "grep", "find", "ls"],
148
+ ...(synthesisModel ? { model: synthesisModel } : {}),
149
+ },
71
150
  );
72
151
  return {
73
152
  status: failures.length === 0 ? "success" : "partial",
74
153
  coverage,
154
+ ...pins,
75
155
  failures,
76
156
  result,
157
+ reports,
77
158
  };
78
159
  } catch (error) {
79
160
  return {
80
161
  status: "partial",
81
162
  coverage,
163
+ ...pins,
82
164
  failures,
83
165
  result: null,
84
166
  synthesisError: error instanceof Error ? error.message : String(error),
85
- fallback: completed,
167
+ reports,
168
+ fallback: completed.map((outcome) => ({
169
+ role: outcome.role,
170
+ status: "completed",
171
+ report: outcome.report.slice(0, 1200),
172
+ })),
86
173
  };
87
174
  }
88
175
  ```
89
176
 
90
- Pass the task as `strings.task` and the JSON role array as `strings.roles`. Successful synthesis returns only the compact decision, coverage, and failures. Raw completed reports return only when synthesis fails; one surviving role returns directly without spending another agent call.
177
+ Pass the task as `strings.task`, the JSON role array as `strings.roles`, and the synthesis model key as `strings.synthesis`; an empty `strings.synthesis` keeps the session default. A role is a string or `{ "role": "security", "model": "provider/id", "thinking": "high" }`, and a role without `model` runs on the session default. Model keys must match a Pi registry key from `tools.models()` exactly, ignoring case; the skill refuses a `models.aliases` name or a partial id, and checks every key before any agent runs. Every result lists `seats`, each with its role, pinned model and thinking, and status, plus `synthesisModel` when one was pinned. These are the models the skill requested; keeping a run on its pinned model is the host's job. Successful synthesis returns only the compact decision, coverage, seats, and failures. Whenever at least one seat completes, the full role reports are parked to mesh under a `council/<timestamp>/reports` key and every outcome carries it as `reports`: `mesh.get` it for audit or to retry a budget-starved synthesis with one plain agent, and `mesh.delete` it when no longer needed. On synthesis failure the fallback carries report heads plus that mesh key, so full texts never need to land in context; one surviving role returns directly without spending another agent call.
91
178
 
92
- Concurrent calls can overshoot an observational `tokenBudget` because usage settles afterward. Reserve at least `roles.length + 1` top-level agent calls when synthesis may run, and use a finite role set rather than relying on token accounting as a hard concurrent ceiling.
179
+ Concurrent calls can overshoot an observational `tokenBudget` because usage settles afterward. Reserve at least `seats.length + 1` top-level agent calls when synthesis may run, and use a finite role set rather than relying on token accounting as a hard concurrent ceiling. A budget-exhausted synthesis loses nothing: the parked reports are complete, so re-run only the synthesis step.
93
180
 
94
181
  Status is `success`, `partial`, or `failed`. A partial result is usable evidence with named gaps and must not trigger an automatic whole-council rerun. If a missing perspective matters, retry that role with one plain agent using the original task and role; do not invoke a new council or rerun successful roles. Do not use a council for a lookup or a decision with no meaningful competing considerations.