@earendil-works/chord 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (820) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +79 -14
  3. package/dist/cell.d.ts +7 -7
  4. package/dist/cell.d.ts.map +1 -1
  5. package/dist/cell.js.map +1 -1
  6. package/dist/context/index.d.ts +1 -1
  7. package/dist/context/index.d.ts.map +1 -1
  8. package/dist/context/index.js +1 -1
  9. package/dist/context/index.js.map +1 -1
  10. package/dist/contract.d.ts +51 -52
  11. package/dist/contract.d.ts.map +1 -1
  12. package/dist/contract.js +19 -24
  13. package/dist/contract.js.map +1 -1
  14. package/dist/delta/apply-immutable-trusted.js +3 -4
  15. package/dist/delta/apply-immutable-trusted.js.map +1 -1
  16. package/dist/delta/diff.d.ts.map +1 -1
  17. package/dist/delta/diff.js +5 -3
  18. package/dist/delta/diff.js.map +1 -1
  19. package/dist/delta/index.d.ts +9 -1
  20. package/dist/delta/index.d.ts.map +1 -1
  21. package/dist/delta/index.js +15 -11
  22. package/dist/delta/index.js.map +1 -1
  23. package/dist/delta/pending.d.ts +36 -0
  24. package/dist/delta/pending.d.ts.map +1 -0
  25. package/dist/delta/pending.js +143 -0
  26. package/dist/delta/pending.js.map +1 -0
  27. package/dist/delta/tracker.d.ts +12 -0
  28. package/dist/delta/tracker.d.ts.map +1 -1
  29. package/dist/delta/tracker.js +109 -39
  30. package/dist/delta/tracker.js.map +1 -1
  31. package/dist/host.d.ts.map +1 -1
  32. package/dist/host.js +9 -7
  33. package/dist/host.js.map +1 -1
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +1 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/next/contracts/accepts.d.ts +81 -0
  39. package/dist/next/contracts/accepts.d.ts.map +1 -0
  40. package/dist/next/contracts/accepts.js +123 -0
  41. package/dist/next/contracts/accepts.js.map +1 -0
  42. package/dist/next/contracts/contract.d.ts +121 -0
  43. package/dist/next/contracts/contract.d.ts.map +1 -0
  44. package/dist/next/contracts/contract.js +50 -0
  45. package/dist/next/contracts/contract.js.map +1 -0
  46. package/dist/next/contracts/declare.d.ts +107 -0
  47. package/dist/next/contracts/declare.d.ts.map +1 -0
  48. package/dist/next/contracts/declare.js +136 -0
  49. package/dist/next/contracts/declare.js.map +1 -0
  50. package/dist/next/contracts/evolve.d.ts +92 -0
  51. package/dist/next/contracts/evolve.d.ts.map +1 -0
  52. package/dist/next/contracts/evolve.js +179 -0
  53. package/dist/next/contracts/evolve.js.map +1 -0
  54. package/dist/next/contracts/fingerprint.d.ts +16 -0
  55. package/dist/next/contracts/fingerprint.d.ts.map +1 -0
  56. package/dist/next/contracts/fingerprint.js +50 -0
  57. package/dist/next/contracts/fingerprint.js.map +1 -0
  58. package/dist/next/contracts/history.d.ts +71 -0
  59. package/dist/next/contracts/history.d.ts.map +1 -0
  60. package/dist/next/contracts/history.js +3 -0
  61. package/dist/next/contracts/history.js.map +1 -0
  62. package/dist/next/contracts/host-kind.d.ts +40 -0
  63. package/dist/next/contracts/host-kind.d.ts.map +1 -0
  64. package/dist/next/contracts/host-kind.js +37 -0
  65. package/dist/next/contracts/host-kind.js.map +1 -0
  66. package/dist/next/contracts/index.d.ts +7 -0
  67. package/dist/next/contracts/index.d.ts.map +1 -0
  68. package/dist/next/contracts/index.js +6 -0
  69. package/dist/next/contracts/index.js.map +1 -0
  70. package/dist/next/contracts/internal.d.ts +10 -0
  71. package/dist/next/contracts/internal.d.ts.map +1 -0
  72. package/dist/next/contracts/internal.js +9 -0
  73. package/dist/next/contracts/internal.js.map +1 -0
  74. package/dist/next/contracts/names.d.ts +3 -0
  75. package/dist/next/contracts/names.d.ts.map +1 -0
  76. package/dist/next/contracts/names.js +13 -0
  77. package/dist/next/contracts/names.js.map +1 -0
  78. package/dist/next/contracts/params.d.ts +28 -0
  79. package/dist/next/contracts/params.d.ts.map +1 -0
  80. package/dist/next/contracts/params.js +50 -0
  81. package/dist/next/contracts/params.js.map +1 -0
  82. package/dist/next/contracts/schema.d.ts +102 -0
  83. package/dist/next/contracts/schema.d.ts.map +1 -0
  84. package/dist/next/contracts/schema.js +103 -0
  85. package/dist/next/contracts/schema.js.map +1 -0
  86. package/dist/next/contracts/snapshot.d.ts +16 -0
  87. package/dist/next/contracts/snapshot.d.ts.map +1 -0
  88. package/dist/next/contracts/snapshot.js +167 -0
  89. package/dist/next/contracts/snapshot.js.map +1 -0
  90. package/dist/next/data/args.d.ts +50 -0
  91. package/dist/next/data/args.d.ts.map +1 -0
  92. package/dist/next/data/args.js +83 -0
  93. package/dist/next/data/args.js.map +1 -0
  94. package/dist/next/data/errors.d.ts +73 -0
  95. package/dist/next/data/errors.d.ts.map +1 -0
  96. package/dist/next/data/errors.js +107 -0
  97. package/dist/next/data/errors.js.map +1 -0
  98. package/dist/next/data/failure.d.ts +26 -0
  99. package/dist/next/data/failure.d.ts.map +1 -0
  100. package/dist/next/data/failure.js +72 -0
  101. package/dist/next/data/failure.js.map +1 -0
  102. package/dist/next/data/index.d.ts +4 -0
  103. package/dist/next/data/index.d.ts.map +1 -0
  104. package/dist/next/data/index.js +4 -0
  105. package/dist/next/data/index.js.map +1 -0
  106. package/dist/next/data/internal.d.ts +7 -0
  107. package/dist/next/data/internal.d.ts.map +1 -0
  108. package/dist/next/data/internal.js +8 -0
  109. package/dist/next/data/internal.js.map +1 -0
  110. package/dist/next/data/params.d.ts +20 -0
  111. package/dist/next/data/params.d.ts.map +1 -0
  112. package/dist/next/data/params.js +31 -0
  113. package/dist/next/data/params.js.map +1 -0
  114. package/dist/next/data/principal.d.ts +17 -0
  115. package/dist/next/data/principal.d.ts.map +1 -0
  116. package/dist/next/data/principal.js +41 -0
  117. package/dist/next/data/principal.js.map +1 -0
  118. package/dist/next/data/validator.d.ts +12 -0
  119. package/dist/next/data/validator.d.ts.map +1 -0
  120. package/dist/next/data/validator.js +34 -0
  121. package/dist/next/data/validator.js.map +1 -0
  122. package/dist/next/documents/address-source.d.ts +20 -0
  123. package/dist/next/documents/address-source.d.ts.map +1 -0
  124. package/dist/next/documents/address-source.js +44 -0
  125. package/dist/next/documents/address-source.js.map +1 -0
  126. package/dist/next/documents/definition.d.ts +84 -0
  127. package/dist/next/documents/definition.d.ts.map +1 -0
  128. package/dist/next/documents/definition.js +73 -0
  129. package/dist/next/documents/definition.js.map +1 -0
  130. package/dist/next/documents/documents.d.ts +106 -0
  131. package/dist/next/documents/documents.d.ts.map +1 -0
  132. package/dist/next/documents/documents.js +224 -0
  133. package/dist/next/documents/documents.js.map +1 -0
  134. package/dist/next/documents/fence.d.ts +9 -0
  135. package/dist/next/documents/fence.d.ts.map +1 -0
  136. package/dist/next/documents/fence.js +15 -0
  137. package/dist/next/documents/fence.js.map +1 -0
  138. package/dist/next/documents/handles.d.ts +76 -0
  139. package/dist/next/documents/handles.d.ts.map +1 -0
  140. package/dist/next/documents/handles.js +66 -0
  141. package/dist/next/documents/handles.js.map +1 -0
  142. package/dist/next/documents/index.d.ts +4 -0
  143. package/dist/next/documents/index.d.ts.map +1 -0
  144. package/dist/next/documents/index.js +3 -0
  145. package/dist/next/documents/index.js.map +1 -0
  146. package/dist/next/documents/internal.d.ts +9 -0
  147. package/dist/next/documents/internal.d.ts.map +1 -0
  148. package/dist/next/documents/internal.js +9 -0
  149. package/dist/next/documents/internal.js.map +1 -0
  150. package/dist/next/documents/keyed-slot.d.ts +103 -0
  151. package/dist/next/documents/keyed-slot.d.ts.map +1 -0
  152. package/dist/next/documents/keyed-slot.js +395 -0
  153. package/dist/next/documents/keyed-slot.js.map +1 -0
  154. package/dist/next/documents/line.d.ts +7 -0
  155. package/dist/next/documents/line.d.ts.map +1 -0
  156. package/dist/next/documents/line.js +14 -0
  157. package/dist/next/documents/line.js.map +1 -0
  158. package/dist/next/documents/persistence.d.ts +104 -0
  159. package/dist/next/documents/persistence.d.ts.map +1 -0
  160. package/dist/next/documents/persistence.js +128 -0
  161. package/dist/next/documents/persistence.js.map +1 -0
  162. package/dist/next/documents/residency.d.ts +31 -0
  163. package/dist/next/documents/residency.d.ts.map +1 -0
  164. package/dist/next/documents/residency.js +93 -0
  165. package/dist/next/documents/residency.js.map +1 -0
  166. package/dist/next/documents/slot.d.ts +109 -0
  167. package/dist/next/documents/slot.d.ts.map +1 -0
  168. package/dist/next/documents/slot.js +181 -0
  169. package/dist/next/documents/slot.js.map +1 -0
  170. package/dist/next/documents/transaction.d.ts +133 -0
  171. package/dist/next/documents/transaction.d.ts.map +1 -0
  172. package/dist/next/documents/transaction.js +409 -0
  173. package/dist/next/documents/transaction.js.map +1 -0
  174. package/dist/next/host/activity.d.ts +31 -0
  175. package/dist/next/host/activity.d.ts.map +1 -0
  176. package/dist/next/host/activity.js +40 -0
  177. package/dist/next/host/activity.js.map +1 -0
  178. package/dist/next/host/adapted.d.ts +49 -0
  179. package/dist/next/host/adapted.d.ts.map +1 -0
  180. package/dist/next/host/adapted.js +214 -0
  181. package/dist/next/host/adapted.js.map +1 -0
  182. package/dist/next/host/attempt.d.ts +278 -0
  183. package/dist/next/host/attempt.d.ts.map +1 -0
  184. package/dist/next/host/attempt.js +1072 -0
  185. package/dist/next/host/attempt.js.map +1 -0
  186. package/dist/next/host/backoff.d.ts +29 -0
  187. package/dist/next/host/backoff.d.ts.map +1 -0
  188. package/dist/next/host/backoff.js +69 -0
  189. package/dist/next/host/backoff.js.map +1 -0
  190. package/dist/next/host/ctx.d.ts +47 -0
  191. package/dist/next/host/ctx.d.ts.map +1 -0
  192. package/dist/next/host/ctx.js +108 -0
  193. package/dist/next/host/ctx.js.map +1 -0
  194. package/dist/next/host/deadline.d.ts +12 -0
  195. package/dist/next/host/deadline.d.ts.map +1 -0
  196. package/dist/next/host/deadline.js +40 -0
  197. package/dist/next/host/deadline.js.map +1 -0
  198. package/dist/next/host/dependencies.d.ts +65 -0
  199. package/dist/next/host/dependencies.d.ts.map +1 -0
  200. package/dist/next/host/dependencies.js +115 -0
  201. package/dist/next/host/dependencies.js.map +1 -0
  202. package/dist/next/host/destination.d.ts +48 -0
  203. package/dist/next/host/destination.d.ts.map +1 -0
  204. package/dist/next/host/destination.js +101 -0
  205. package/dist/next/host/destination.js.map +1 -0
  206. package/dist/next/host/facet.d.ts +79 -0
  207. package/dist/next/host/facet.d.ts.map +1 -0
  208. package/dist/next/host/facet.js +55 -0
  209. package/dist/next/host/facet.js.map +1 -0
  210. package/dist/next/host/follow.d.ts +52 -0
  211. package/dist/next/host/follow.d.ts.map +1 -0
  212. package/dist/next/host/follow.js +207 -0
  213. package/dist/next/host/follow.js.map +1 -0
  214. package/dist/next/host/host.d.ts +495 -0
  215. package/dist/next/host/host.d.ts.map +1 -0
  216. package/dist/next/host/host.js +1075 -0
  217. package/dist/next/host/host.js.map +1 -0
  218. package/dist/next/host/index.d.ts +17 -0
  219. package/dist/next/host/index.d.ts.map +1 -0
  220. package/dist/next/host/index.js +6 -0
  221. package/dist/next/host/index.js.map +1 -0
  222. package/dist/next/host/internal.d.ts +10 -0
  223. package/dist/next/host/internal.d.ts.map +1 -0
  224. package/dist/next/host/internal.js +8 -0
  225. package/dist/next/host/internal.js.map +1 -0
  226. package/dist/next/host/members.d.ts +50 -0
  227. package/dist/next/host/members.d.ts.map +1 -0
  228. package/dist/next/host/members.js +107 -0
  229. package/dist/next/host/members.js.map +1 -0
  230. package/dist/next/host/native.d.ts +55 -0
  231. package/dist/next/host/native.d.ts.map +1 -0
  232. package/dist/next/host/native.js +92 -0
  233. package/dist/next/host/native.js.map +1 -0
  234. package/dist/next/host/object.d.ts +290 -0
  235. package/dist/next/host/object.d.ts.map +1 -0
  236. package/dist/next/host/object.js +1127 -0
  237. package/dist/next/host/object.js.map +1 -0
  238. package/dist/next/host/parked.d.ts +23 -0
  239. package/dist/next/host/parked.d.ts.map +1 -0
  240. package/dist/next/host/parked.js +79 -0
  241. package/dist/next/host/parked.js.map +1 -0
  242. package/dist/next/host/presence.d.ts +34 -0
  243. package/dist/next/host/presence.d.ts.map +1 -0
  244. package/dist/next/host/presence.js +117 -0
  245. package/dist/next/host/presence.js.map +1 -0
  246. package/dist/next/host/ref-state.d.ts +53 -0
  247. package/dist/next/host/ref-state.d.ts.map +1 -0
  248. package/dist/next/host/ref-state.js +83 -0
  249. package/dist/next/host/ref-state.js.map +1 -0
  250. package/dist/next/host/reference-keys.d.ts +36 -0
  251. package/dist/next/host/reference-keys.d.ts.map +1 -0
  252. package/dist/next/host/reference-keys.js +168 -0
  253. package/dist/next/host/reference-keys.js.map +1 -0
  254. package/dist/next/host/reference-source.d.ts +65 -0
  255. package/dist/next/host/reference-source.d.ts.map +1 -0
  256. package/dist/next/host/reference-source.js +285 -0
  257. package/dist/next/host/reference-source.js.map +1 -0
  258. package/dist/next/host/reference.d.ts +308 -0
  259. package/dist/next/host/reference.d.ts.map +1 -0
  260. package/dist/next/host/reference.js +775 -0
  261. package/dist/next/host/reference.js.map +1 -0
  262. package/dist/next/host/retry-on.d.ts +28 -0
  263. package/dist/next/host/retry-on.d.ts.map +1 -0
  264. package/dist/next/host/retry-on.js +52 -0
  265. package/dist/next/host/retry-on.js.map +1 -0
  266. package/dist/next/host/revocation.d.ts +16 -0
  267. package/dist/next/host/revocation.d.ts.map +1 -0
  268. package/dist/next/host/revocation.js +27 -0
  269. package/dist/next/host/revocation.js.map +1 -0
  270. package/dist/next/host/root.d.ts +27 -0
  271. package/dist/next/host/root.d.ts.map +1 -0
  272. package/dist/next/host/root.js +68 -0
  273. package/dist/next/host/root.js.map +1 -0
  274. package/dist/next/host/route.d.ts +64 -0
  275. package/dist/next/host/route.d.ts.map +1 -0
  276. package/dist/next/host/route.js +190 -0
  277. package/dist/next/host/route.js.map +1 -0
  278. package/dist/next/host/routines.d.ts +76 -0
  279. package/dist/next/host/routines.d.ts.map +1 -0
  280. package/dist/next/host/routines.js +350 -0
  281. package/dist/next/host/routines.js.map +1 -0
  282. package/dist/next/host/sleep.d.ts +9 -0
  283. package/dist/next/host/sleep.d.ts.map +1 -0
  284. package/dist/next/host/sleep.js +40 -0
  285. package/dist/next/host/sleep.js.map +1 -0
  286. package/dist/next/host/staging.d.ts +94 -0
  287. package/dist/next/host/staging.d.ts.map +1 -0
  288. package/dist/next/host/staging.js +302 -0
  289. package/dist/next/host/staging.js.map +1 -0
  290. package/dist/next/host/unbound.d.ts +30 -0
  291. package/dist/next/host/unbound.d.ts.map +1 -0
  292. package/dist/next/host/unbound.js +67 -0
  293. package/dist/next/host/unbound.js.map +1 -0
  294. package/dist/next/host/uuid.d.ts +3 -0
  295. package/dist/next/host/uuid.d.ts.map +1 -0
  296. package/dist/next/host/uuid.js +38 -0
  297. package/dist/next/host/uuid.js.map +1 -0
  298. package/dist/next/index.d.ts +28 -0
  299. package/dist/next/index.d.ts.map +1 -0
  300. package/dist/next/index.js +18 -0
  301. package/dist/next/index.js.map +1 -0
  302. package/dist/next/jobs/definition.d.ts +96 -0
  303. package/dist/next/jobs/definition.d.ts.map +1 -0
  304. package/dist/next/jobs/definition.js +83 -0
  305. package/dist/next/jobs/definition.js.map +1 -0
  306. package/dist/next/jobs/index.d.ts +5 -0
  307. package/dist/next/jobs/index.d.ts.map +1 -0
  308. package/dist/next/jobs/index.js +3 -0
  309. package/dist/next/jobs/index.js.map +1 -0
  310. package/dist/next/jobs/internal.d.ts +3 -0
  311. package/dist/next/jobs/internal.d.ts.map +1 -0
  312. package/dist/next/jobs/internal.js +4 -0
  313. package/dist/next/jobs/internal.js.map +1 -0
  314. package/dist/next/jobs/job.d.ts +152 -0
  315. package/dist/next/jobs/job.d.ts.map +1 -0
  316. package/dist/next/jobs/job.js +320 -0
  317. package/dist/next/jobs/job.js.map +1 -0
  318. package/dist/next/jobs/persisted.d.ts +38 -0
  319. package/dist/next/jobs/persisted.d.ts.map +1 -0
  320. package/dist/next/jobs/persisted.js +95 -0
  321. package/dist/next/jobs/persisted.js.map +1 -0
  322. package/dist/next/jobs/records.d.ts +231 -0
  323. package/dist/next/jobs/records.d.ts.map +1 -0
  324. package/dist/next/jobs/records.js +869 -0
  325. package/dist/next/jobs/records.js.map +1 -0
  326. package/dist/next/jobs/run-states.d.ts +69 -0
  327. package/dist/next/jobs/run-states.d.ts.map +1 -0
  328. package/dist/next/jobs/run-states.js +228 -0
  329. package/dist/next/jobs/run-states.js.map +1 -0
  330. package/dist/next/jobs/run.d.ts +113 -0
  331. package/dist/next/jobs/run.d.ts.map +1 -0
  332. package/dist/next/jobs/run.js +200 -0
  333. package/dist/next/jobs/run.js.map +1 -0
  334. package/dist/next/jobs/running.d.ts +44 -0
  335. package/dist/next/jobs/running.d.ts.map +1 -0
  336. package/dist/next/jobs/running.js +117 -0
  337. package/dist/next/jobs/running.js.map +1 -0
  338. package/dist/next/jobs/stored.d.ts +63 -0
  339. package/dist/next/jobs/stored.d.ts.map +1 -0
  340. package/dist/next/jobs/stored.js +55 -0
  341. package/dist/next/jobs/stored.js.map +1 -0
  342. package/dist/next/link/binary.d.ts +4 -0
  343. package/dist/next/link/binary.d.ts.map +1 -0
  344. package/dist/next/link/binary.js +534 -0
  345. package/dist/next/link/binary.js.map +1 -0
  346. package/dist/next/link/channel.d.ts +63 -0
  347. package/dist/next/link/channel.d.ts.map +1 -0
  348. package/dist/next/link/channel.js +202 -0
  349. package/dist/next/link/channel.js.map +1 -0
  350. package/dist/next/link/errors.d.ts +7 -0
  351. package/dist/next/link/errors.d.ts.map +1 -0
  352. package/dist/next/link/errors.js +21 -0
  353. package/dist/next/link/errors.js.map +1 -0
  354. package/dist/next/link/index.d.ts +8 -0
  355. package/dist/next/link/index.d.ts.map +1 -0
  356. package/dist/next/link/index.js +8 -0
  357. package/dist/next/link/index.js.map +1 -0
  358. package/dist/next/link/internal.d.ts +9 -0
  359. package/dist/next/link/internal.d.ts.map +1 -0
  360. package/dist/next/link/internal.js +10 -0
  361. package/dist/next/link/internal.js.map +1 -0
  362. package/dist/next/link/ipc.d.ts +22 -0
  363. package/dist/next/link/ipc.d.ts.map +1 -0
  364. package/dist/next/link/ipc.js +64 -0
  365. package/dist/next/link/ipc.js.map +1 -0
  366. package/dist/next/link/link.d.ts +34 -0
  367. package/dist/next/link/link.d.ts.map +1 -0
  368. package/dist/next/link/link.js +87 -0
  369. package/dist/next/link/link.js.map +1 -0
  370. package/dist/next/link/message.d.ts +249 -0
  371. package/dist/next/link/message.d.ts.map +1 -0
  372. package/dist/next/link/message.js +123 -0
  373. package/dist/next/link/message.js.map +1 -0
  374. package/dist/next/link/part.d.ts +80 -0
  375. package/dist/next/link/part.d.ts.map +1 -0
  376. package/dist/next/link/part.js +164 -0
  377. package/dist/next/link/part.js.map +1 -0
  378. package/dist/next/link/text.d.ts +6 -0
  379. package/dist/next/link/text.d.ts.map +1 -0
  380. package/dist/next/link/text.js +335 -0
  381. package/dist/next/link/text.js.map +1 -0
  382. package/dist/next/link/values.d.ts +40 -0
  383. package/dist/next/link/values.d.ts.map +1 -0
  384. package/dist/next/link/values.js +117 -0
  385. package/dist/next/link/values.js.map +1 -0
  386. package/dist/next/link/websocket.d.ts +26 -0
  387. package/dist/next/link/websocket.d.ts.map +1 -0
  388. package/dist/next/link/websocket.js +91 -0
  389. package/dist/next/link/websocket.js.map +1 -0
  390. package/dist/next/registries/contribution.d.ts +50 -0
  391. package/dist/next/registries/contribution.d.ts.map +1 -0
  392. package/dist/next/registries/contribution.js +129 -0
  393. package/dist/next/registries/contribution.js.map +1 -0
  394. package/dist/next/registries/entries.d.ts +18 -0
  395. package/dist/next/registries/entries.d.ts.map +1 -0
  396. package/dist/next/registries/entries.js +42 -0
  397. package/dist/next/registries/entries.js.map +1 -0
  398. package/dist/next/registries/index.d.ts +3 -0
  399. package/dist/next/registries/index.d.ts.map +1 -0
  400. package/dist/next/registries/index.js +5 -0
  401. package/dist/next/registries/index.js.map +1 -0
  402. package/dist/next/registries/internal.d.ts +4 -0
  403. package/dist/next/registries/internal.d.ts.map +1 -0
  404. package/dist/next/registries/internal.js +5 -0
  405. package/dist/next/registries/internal.js.map +1 -0
  406. package/dist/next/registries/record.d.ts +94 -0
  407. package/dist/next/registries/record.d.ts.map +1 -0
  408. package/dist/next/registries/record.js +253 -0
  409. package/dist/next/registries/record.js.map +1 -0
  410. package/dist/next/registries/registry.d.ts +74 -0
  411. package/dist/next/registries/registry.d.ts.map +1 -0
  412. package/dist/next/registries/registry.js +14 -0
  413. package/dist/next/registries/registry.js.map +1 -0
  414. package/dist/next/registries/value.d.ts +48 -0
  415. package/dist/next/registries/value.d.ts.map +1 -0
  416. package/dist/next/registries/value.js +199 -0
  417. package/dist/next/registries/value.js.map +1 -0
  418. package/dist/next/remote/calls.d.ts +25 -0
  419. package/dist/next/remote/calls.d.ts.map +1 -0
  420. package/dist/next/remote/calls.js +62 -0
  421. package/dist/next/remote/calls.js.map +1 -0
  422. package/dist/next/remote/consumer.d.ts +42 -0
  423. package/dist/next/remote/consumer.d.ts.map +1 -0
  424. package/dist/next/remote/consumer.js +343 -0
  425. package/dist/next/remote/consumer.js.map +1 -0
  426. package/dist/next/remote/hold.d.ts +130 -0
  427. package/dist/next/remote/hold.d.ts.map +1 -0
  428. package/dist/next/remote/hold.js +537 -0
  429. package/dist/next/remote/hold.js.map +1 -0
  430. package/dist/next/remote/host-link.d.ts +77 -0
  431. package/dist/next/remote/host-link.d.ts.map +1 -0
  432. package/dist/next/remote/host-link.js +182 -0
  433. package/dist/next/remote/host-link.js.map +1 -0
  434. package/dist/next/remote/internal.d.ts +6 -0
  435. package/dist/next/remote/internal.d.ts.map +1 -0
  436. package/dist/next/remote/internal.js +6 -0
  437. package/dist/next/remote/internal.js.map +1 -0
  438. package/dist/next/remote/path.d.ts +46 -0
  439. package/dist/next/remote/path.d.ts.map +1 -0
  440. package/dist/next/remote/path.js +73 -0
  441. package/dist/next/remote/path.js.map +1 -0
  442. package/dist/next/remote/provider.d.ts +76 -0
  443. package/dist/next/remote/provider.d.ts.map +1 -0
  444. package/dist/next/remote/provider.js +506 -0
  445. package/dist/next/remote/provider.js.map +1 -0
  446. package/dist/next/remote/relay.d.ts +58 -0
  447. package/dist/next/remote/relay.d.ts.map +1 -0
  448. package/dist/next/remote/relay.js +117 -0
  449. package/dist/next/remote/relay.js.map +1 -0
  450. package/dist/next/remote/remote-object.d.ts +133 -0
  451. package/dist/next/remote/remote-object.d.ts.map +1 -0
  452. package/dist/next/remote/remote-object.js +411 -0
  453. package/dist/next/remote/remote-object.js.map +1 -0
  454. package/dist/next/remote/replica.d.ts +59 -0
  455. package/dist/next/remote/replica.d.ts.map +1 -0
  456. package/dist/next/remote/replica.js +125 -0
  457. package/dist/next/remote/replica.js.map +1 -0
  458. package/dist/next/state/batch.d.ts +64 -0
  459. package/dist/next/state/batch.d.ts.map +1 -0
  460. package/dist/next/state/batch.js +163 -0
  461. package/dist/next/state/batch.js.map +1 -0
  462. package/dist/next/state/derive.d.ts +52 -0
  463. package/dist/next/state/derive.d.ts.map +1 -0
  464. package/dist/next/state/derive.js +182 -0
  465. package/dist/next/state/derive.js.map +1 -0
  466. package/dist/next/state/index.d.ts +6 -0
  467. package/dist/next/state/index.d.ts.map +1 -0
  468. package/dist/next/state/index.js +4 -0
  469. package/dist/next/state/index.js.map +1 -0
  470. package/dist/next/state/internal.d.ts +6 -0
  471. package/dist/next/state/internal.d.ts.map +1 -0
  472. package/dist/next/state/internal.js +8 -0
  473. package/dist/next/state/internal.js.map +1 -0
  474. package/dist/next/state/native-source.d.ts +106 -0
  475. package/dist/next/state/native-source.d.ts.map +1 -0
  476. package/dist/next/state/native-source.js +240 -0
  477. package/dist/next/state/native-source.js.map +1 -0
  478. package/dist/next/state/watchable.d.ts +114 -0
  479. package/dist/next/state/watchable.d.ts.map +1 -0
  480. package/dist/next/state/watchable.js +156 -0
  481. package/dist/next/state/watchable.js.map +1 -0
  482. package/dist/next/state/writable.d.ts +32 -0
  483. package/dist/next/state/writable.d.ts.map +1 -0
  484. package/dist/next/state/writable.js +49 -0
  485. package/dist/next/state/writable.js.map +1 -0
  486. package/dist/next/store/adapter.d.ts +67 -0
  487. package/dist/next/store/adapter.d.ts.map +1 -0
  488. package/dist/next/store/adapter.js +118 -0
  489. package/dist/next/store/adapter.js.map +1 -0
  490. package/dist/next/store/allocator.d.ts +17 -0
  491. package/dist/next/store/allocator.d.ts.map +1 -0
  492. package/dist/next/store/allocator.js +30 -0
  493. package/dist/next/store/allocator.js.map +1 -0
  494. package/dist/next/store/applier.d.ts +8 -0
  495. package/dist/next/store/applier.d.ts.map +1 -0
  496. package/dist/next/store/applier.js +375 -0
  497. package/dist/next/store/applier.js.map +1 -0
  498. package/dist/next/store/apply-batch.d.ts +12 -0
  499. package/dist/next/store/apply-batch.d.ts.map +1 -0
  500. package/dist/next/store/apply-batch.js +83 -0
  501. package/dist/next/store/apply-batch.js.map +1 -0
  502. package/dist/next/store/archive.d.ts +32 -0
  503. package/dist/next/store/archive.d.ts.map +1 -0
  504. package/dist/next/store/archive.js +129 -0
  505. package/dist/next/store/archive.js.map +1 -0
  506. package/dist/next/store/backend.d.ts +10 -0
  507. package/dist/next/store/backend.d.ts.map +1 -0
  508. package/dist/next/store/backend.js +15 -0
  509. package/dist/next/store/backend.js.map +1 -0
  510. package/dist/next/store/catalog.d.ts +24 -0
  511. package/dist/next/store/catalog.d.ts.map +1 -0
  512. package/dist/next/store/catalog.js +17 -0
  513. package/dist/next/store/catalog.js.map +1 -0
  514. package/dist/next/store/claims.d.ts +23 -0
  515. package/dist/next/store/claims.d.ts.map +1 -0
  516. package/dist/next/store/claims.js +65 -0
  517. package/dist/next/store/claims.js.map +1 -0
  518. package/dist/next/store/columns.d.ts +77 -0
  519. package/dist/next/store/columns.d.ts.map +1 -0
  520. package/dist/next/store/columns.js +77 -0
  521. package/dist/next/store/columns.js.map +1 -0
  522. package/dist/next/store/engine.d.ts +176 -0
  523. package/dist/next/store/engine.d.ts.map +1 -0
  524. package/dist/next/store/engine.js +283 -0
  525. package/dist/next/store/engine.js.map +1 -0
  526. package/dist/next/store/evaluate.d.ts +17 -0
  527. package/dist/next/store/evaluate.d.ts.map +1 -0
  528. package/dist/next/store/evaluate.js +128 -0
  529. package/dist/next/store/evaluate.js.map +1 -0
  530. package/dist/next/store/export.d.ts +17 -0
  531. package/dist/next/store/export.d.ts.map +1 -0
  532. package/dist/next/store/export.js +200 -0
  533. package/dist/next/store/export.js.map +1 -0
  534. package/dist/next/store/expression.d.ts +150 -0
  535. package/dist/next/store/expression.d.ts.map +1 -0
  536. package/dist/next/store/expression.js +268 -0
  537. package/dist/next/store/expression.js.map +1 -0
  538. package/dist/next/store/import.d.ts +10 -0
  539. package/dist/next/store/import.d.ts.map +1 -0
  540. package/dist/next/store/import.js +276 -0
  541. package/dist/next/store/import.js.map +1 -0
  542. package/dist/next/store/index.d.ts +16 -0
  543. package/dist/next/store/index.d.ts.map +1 -0
  544. package/dist/next/store/index.js +13 -0
  545. package/dist/next/store/index.js.map +1 -0
  546. package/dist/next/store/json-column.d.ts +33 -0
  547. package/dist/next/store/json-column.d.ts.map +1 -0
  548. package/dist/next/store/json-column.js +61 -0
  549. package/dist/next/store/json-column.js.map +1 -0
  550. package/dist/next/store/jsonl.d.ts +9 -0
  551. package/dist/next/store/jsonl.d.ts.map +1 -0
  552. package/dist/next/store/jsonl.js +61 -0
  553. package/dist/next/store/jsonl.js.map +1 -0
  554. package/dist/next/store/outbox.d.ts +26 -0
  555. package/dist/next/store/outbox.d.ts.map +1 -0
  556. package/dist/next/store/outbox.js +80 -0
  557. package/dist/next/store/outbox.js.map +1 -0
  558. package/dist/next/store/query.d.ts +39 -0
  559. package/dist/next/store/query.d.ts.map +1 -0
  560. package/dist/next/store/query.js +97 -0
  561. package/dist/next/store/query.js.map +1 -0
  562. package/dist/next/store/refusal.d.ts +15 -0
  563. package/dist/next/store/refusal.d.ts.map +1 -0
  564. package/dist/next/store/refusal.js +36 -0
  565. package/dist/next/store/refusal.js.map +1 -0
  566. package/dist/next/store/rows.d.ts +80 -0
  567. package/dist/next/store/rows.d.ts.map +1 -0
  568. package/dist/next/store/rows.js +183 -0
  569. package/dist/next/store/rows.js.map +1 -0
  570. package/dist/next/store/schema.d.ts +25 -0
  571. package/dist/next/store/schema.d.ts.map +1 -0
  572. package/dist/next/store/schema.js +115 -0
  573. package/dist/next/store/schema.js.map +1 -0
  574. package/dist/next/store/sql.d.ts +73 -0
  575. package/dist/next/store/sql.d.ts.map +1 -0
  576. package/dist/next/store/sql.js +234 -0
  577. package/dist/next/store/sql.js.map +1 -0
  578. package/dist/next/store/step.d.ts +48 -0
  579. package/dist/next/store/step.d.ts.map +1 -0
  580. package/dist/next/store/step.js +50 -0
  581. package/dist/next/store/step.js.map +1 -0
  582. package/dist/next/store/store.d.ts +161 -0
  583. package/dist/next/store/store.d.ts.map +1 -0
  584. package/dist/next/store/store.js +627 -0
  585. package/dist/next/store/store.js.map +1 -0
  586. package/dist/next/store/table-changes.d.ts +29 -0
  587. package/dist/next/store/table-changes.d.ts.map +1 -0
  588. package/dist/next/store/table-changes.js +102 -0
  589. package/dist/next/store/table-changes.js.map +1 -0
  590. package/dist/next/store/table-evolve.d.ts +74 -0
  591. package/dist/next/store/table-evolve.d.ts.map +1 -0
  592. package/dist/next/store/table-evolve.js +201 -0
  593. package/dist/next/store/table-evolve.js.map +1 -0
  594. package/dist/next/store/table-handle.d.ts +67 -0
  595. package/dist/next/store/table-handle.d.ts.map +1 -0
  596. package/dist/next/store/table-handle.js +101 -0
  597. package/dist/next/store/table-handle.js.map +1 -0
  598. package/dist/next/store/table-history.d.ts +75 -0
  599. package/dist/next/store/table-history.d.ts.map +1 -0
  600. package/dist/next/store/table-history.js +42 -0
  601. package/dist/next/store/table-history.js.map +1 -0
  602. package/dist/next/store/table-migration.d.ts +16 -0
  603. package/dist/next/store/table-migration.d.ts.map +1 -0
  604. package/dist/next/store/table-migration.js +202 -0
  605. package/dist/next/store/table-migration.js.map +1 -0
  606. package/dist/next/store/table-writes.d.ts +125 -0
  607. package/dist/next/store/table-writes.d.ts.map +1 -0
  608. package/dist/next/store/table-writes.js +165 -0
  609. package/dist/next/store/table-writes.js.map +1 -0
  610. package/dist/next/store/table.d.ts +80 -0
  611. package/dist/next/store/table.d.ts.map +1 -0
  612. package/dist/next/store/table.js +103 -0
  613. package/dist/next/store/table.js.map +1 -0
  614. package/dist/next/store/text.d.ts +14 -0
  615. package/dist/next/store/text.d.ts.map +1 -0
  616. package/dist/next/store/text.js +51 -0
  617. package/dist/next/store/text.js.map +1 -0
  618. package/dist/next/store/writes.d.ts +5 -0
  619. package/dist/next/store/writes.d.ts.map +1 -0
  620. package/dist/next/store/writes.js +4 -0
  621. package/dist/next/store/writes.js.map +1 -0
  622. package/dist/next-node/compression.d.ts +7 -0
  623. package/dist/next-node/compression.d.ts.map +1 -0
  624. package/dist/next-node/compression.js +24 -0
  625. package/dist/next-node/compression.js.map +1 -0
  626. package/dist/next-node/http/admission.d.ts +63 -0
  627. package/dist/next-node/http/admission.d.ts.map +1 -0
  628. package/dist/next-node/http/admission.js +134 -0
  629. package/dist/next-node/http/admission.js.map +1 -0
  630. package/dist/next-node/http/authenticate.d.ts +21 -0
  631. package/dist/next-node/http/authenticate.d.ts.map +1 -0
  632. package/dist/next-node/http/authenticate.js +34 -0
  633. package/dist/next-node/http/authenticate.js.map +1 -0
  634. package/dist/next-node/http/cookies.d.ts +24 -0
  635. package/dist/next-node/http/cookies.d.ts.map +1 -0
  636. package/dist/next-node/http/cookies.js +62 -0
  637. package/dist/next-node/http/cookies.js.map +1 -0
  638. package/dist/next-node/http/file.d.ts +23 -0
  639. package/dist/next-node/http/file.d.ts.map +1 -0
  640. package/dist/next-node/http/file.js +94 -0
  641. package/dist/next-node/http/file.js.map +1 -0
  642. package/dist/next-node/http/headers.d.ts +37 -0
  643. package/dist/next-node/http/headers.d.ts.map +1 -0
  644. package/dist/next-node/http/headers.js +129 -0
  645. package/dist/next-node/http/headers.js.map +1 -0
  646. package/dist/next-node/http/http.d.ts +100 -0
  647. package/dist/next-node/http/http.d.ts.map +1 -0
  648. package/dist/next-node/http/http.js +462 -0
  649. package/dist/next-node/http/http.js.map +1 -0
  650. package/dist/next-node/http/incoming.d.ts +19 -0
  651. package/dist/next-node/http/incoming.d.ts.map +1 -0
  652. package/dist/next-node/http/incoming.js +31 -0
  653. package/dist/next-node/http/incoming.js.map +1 -0
  654. package/dist/next-node/http/index.d.ts +11 -0
  655. package/dist/next-node/http/index.d.ts.map +1 -0
  656. package/dist/next-node/http/index.js +12 -0
  657. package/dist/next-node/http/index.js.map +1 -0
  658. package/dist/next-node/http/node.d.ts +78 -0
  659. package/dist/next-node/http/node.d.ts.map +1 -0
  660. package/dist/next-node/http/node.js +291 -0
  661. package/dist/next-node/http/node.js.map +1 -0
  662. package/dist/next-node/http/request.d.ts +54 -0
  663. package/dist/next-node/http/request.d.ts.map +1 -0
  664. package/dist/next-node/http/request.js +116 -0
  665. package/dist/next-node/http/request.js.map +1 -0
  666. package/dist/next-node/http/response.d.ts +63 -0
  667. package/dist/next-node/http/response.d.ts.map +1 -0
  668. package/dist/next-node/http/response.js +202 -0
  669. package/dist/next-node/http/response.js.map +1 -0
  670. package/dist/next-node/http/router.d.ts +114 -0
  671. package/dist/next-node/http/router.d.ts.map +1 -0
  672. package/dist/next-node/http/router.js +261 -0
  673. package/dist/next-node/http/router.js.map +1 -0
  674. package/dist/next-node/http/upgrades.d.ts +58 -0
  675. package/dist/next-node/http/upgrades.d.ts.map +1 -0
  676. package/dist/next-node/http/upgrades.js +184 -0
  677. package/dist/next-node/http/upgrades.js.map +1 -0
  678. package/dist/next-node/plugins/build.d.ts +57 -0
  679. package/dist/next-node/plugins/build.d.ts.map +1 -0
  680. package/dist/next-node/plugins/build.js +334 -0
  681. package/dist/next-node/plugins/build.js.map +1 -0
  682. package/dist/next-node/plugins/discover.d.ts +36 -0
  683. package/dist/next-node/plugins/discover.d.ts.map +1 -0
  684. package/dist/next-node/plugins/discover.js +91 -0
  685. package/dist/next-node/plugins/discover.js.map +1 -0
  686. package/dist/next-node/plugins/evaluate.d.ts +33 -0
  687. package/dist/next-node/plugins/evaluate.d.ts.map +1 -0
  688. package/dist/next-node/plugins/evaluate.js +98 -0
  689. package/dist/next-node/plugins/evaluate.js.map +1 -0
  690. package/dist/next-node/plugins/index.d.ts +9 -0
  691. package/dist/next-node/plugins/index.d.ts.map +1 -0
  692. package/dist/next-node/plugins/index.js +11 -0
  693. package/dist/next-node/plugins/index.js.map +1 -0
  694. package/dist/next-node/plugins/install.d.ts +13 -0
  695. package/dist/next-node/plugins/install.d.ts.map +1 -0
  696. package/dist/next-node/plugins/install.js +37 -0
  697. package/dist/next-node/plugins/install.js.map +1 -0
  698. package/dist/next-node/plugins/plugins.d.ts +135 -0
  699. package/dist/next-node/plugins/plugins.d.ts.map +1 -0
  700. package/dist/next-node/plugins/plugins.js +206 -0
  701. package/dist/next-node/plugins/plugins.js.map +1 -0
  702. package/dist/next-node/plugins/runtime.d.ts +41 -0
  703. package/dist/next-node/plugins/runtime.d.ts.map +1 -0
  704. package/dist/next-node/plugins/runtime.js +136 -0
  705. package/dist/next-node/plugins/runtime.js.map +1 -0
  706. package/dist/next-node/plugins/stack.d.ts +16 -0
  707. package/dist/next-node/plugins/stack.d.ts.map +1 -0
  708. package/dist/next-node/plugins/stack.js +61 -0
  709. package/dist/next-node/plugins/stack.js.map +1 -0
  710. package/dist/next-node/plugins/watcher.d.ts +58 -0
  711. package/dist/next-node/plugins/watcher.d.ts.map +1 -0
  712. package/dist/next-node/plugins/watcher.js +281 -0
  713. package/dist/next-node/plugins/watcher.js.map +1 -0
  714. package/dist/next-node/workers/control.d.ts +83 -0
  715. package/dist/next-node/workers/control.d.ts.map +1 -0
  716. package/dist/next-node/workers/control.js +77 -0
  717. package/dist/next-node/workers/control.js.map +1 -0
  718. package/dist/next-node/workers/index.d.ts +5 -0
  719. package/dist/next-node/workers/index.d.ts.map +1 -0
  720. package/dist/next-node/workers/index.js +7 -0
  721. package/dist/next-node/workers/index.js.map +1 -0
  722. package/dist/next-node/workers/lock.d.ts +21 -0
  723. package/dist/next-node/workers/lock.d.ts.map +1 -0
  724. package/dist/next-node/workers/lock.js +137 -0
  725. package/dist/next-node/workers/lock.js.map +1 -0
  726. package/dist/next-node/workers/main.d.ts +46 -0
  727. package/dist/next-node/workers/main.d.ts.map +1 -0
  728. package/dist/next-node/workers/main.js +230 -0
  729. package/dist/next-node/workers/main.js.map +1 -0
  730. package/dist/next-node/workers/process.d.ts +42 -0
  731. package/dist/next-node/workers/process.d.ts.map +1 -0
  732. package/dist/next-node/workers/process.js +125 -0
  733. package/dist/next-node/workers/process.js.map +1 -0
  734. package/dist/next-node/workers/workers.d.ts +80 -0
  735. package/dist/next-node/workers/workers.d.ts.map +1 -0
  736. package/dist/next-node/workers/workers.js +572 -0
  737. package/dist/next-node/workers/workers.js.map +1 -0
  738. package/dist/object.d.ts +4 -4
  739. package/dist/object.d.ts.map +1 -1
  740. package/dist/object.js +3 -4
  741. package/dist/object.js.map +1 -1
  742. package/dist/output.d.ts +1 -1
  743. package/dist/output.d.ts.map +1 -1
  744. package/dist/output.js +4 -2
  745. package/dist/output.js.map +1 -1
  746. package/dist/remote.d.ts.map +1 -1
  747. package/dist/remote.js +2 -2
  748. package/dist/remote.js.map +1 -1
  749. package/dist/schema.d.ts +8 -4
  750. package/dist/schema.d.ts.map +1 -1
  751. package/dist/schema.js +180 -5
  752. package/dist/schema.js.map +1 -1
  753. package/dist/sqlite/cloudflare.d.ts +2 -0
  754. package/dist/sqlite/cloudflare.d.ts.map +1 -1
  755. package/dist/sqlite/cloudflare.js +10 -0
  756. package/dist/sqlite/cloudflare.js.map +1 -1
  757. package/dist/sqlite/database.d.ts +5 -2
  758. package/dist/sqlite/database.d.ts.map +1 -1
  759. package/dist/sqlite/database.js.map +1 -1
  760. package/dist/sqlite/node.d.ts +4 -1
  761. package/dist/sqlite/node.d.ts.map +1 -1
  762. package/dist/sqlite/node.js +22 -5
  763. package/dist/sqlite/node.js.map +1 -1
  764. package/dist/watch.d.ts +194 -0
  765. package/dist/watch.d.ts.map +1 -0
  766. package/dist/watch.js +383 -0
  767. package/dist/watch.js.map +1 -0
  768. package/dist/wire.d.ts +174 -193
  769. package/dist/wire.d.ts.map +1 -1
  770. package/dist/wire.js +81 -80
  771. package/dist/wire.js.map +1 -1
  772. package/docs/guide.md +15 -15
  773. package/docs/next/benchmarks.md +959 -0
  774. package/docs/next/decisions.md +2957 -0
  775. package/docs/next/dependencies/book.md +1671 -0
  776. package/docs/next/dependencies/index.html +2641 -0
  777. package/docs/next/dependencies/model.md +330 -0
  778. package/docs/next/design.md +2554 -0
  779. package/docs/next/durable-observers/book.md +432 -0
  780. package/docs/next/durable-observers/index.html +517 -0
  781. package/docs/next/flow-control/book.md +333 -0
  782. package/docs/next/flow-control/fold/index.html +265 -0
  783. package/docs/next/flow-control/index.html +548 -0
  784. package/docs/next/flow-control/window/index.html +228 -0
  785. package/docs/next/guide-plugins-hosts/book.md +607 -0
  786. package/docs/next/guide-plugins-hosts/index.html +652 -0
  787. package/docs/next/http-workers/book.md +378 -0
  788. package/docs/next/http-workers/index.html +515 -0
  789. package/docs/next/layer-1.md +311 -0
  790. package/docs/next/layer-2.md +216 -0
  791. package/docs/next/plugin-model/book.md +186 -0
  792. package/docs/next/plugin-model/index.html +310 -0
  793. package/docs/next/plugin-primer/book.md +273 -0
  794. package/docs/next/plugin-primer/index.html +430 -0
  795. package/docs/next/slice-1.md +236 -0
  796. package/docs/next/slice-10.md +285 -0
  797. package/docs/next/slice-11.md +93 -0
  798. package/docs/next/slice-2.md +174 -0
  799. package/docs/next/slice-3a.md +296 -0
  800. package/docs/next/slice-3b.md +197 -0
  801. package/docs/next/slice-4.md +146 -0
  802. package/docs/next/slice-4a.md +418 -0
  803. package/docs/next/slice-4b.md +208 -0
  804. package/docs/next/slice-5.md +281 -0
  805. package/docs/next/slice-6a.md +676 -0
  806. package/docs/next/slice-6b.md +332 -0
  807. package/docs/next/slice-7a.md +130 -0
  808. package/docs/next/slice-7b/book.md +608 -0
  809. package/docs/next/slice-7b/index.html +842 -0
  810. package/docs/next/slice-7b.md +255 -0
  811. package/docs/next/slice-7c.md +165 -0
  812. package/docs/next/slice-8.md +194 -0
  813. package/docs/next/slices.md +230 -0
  814. package/docs/next/store/book.md +665 -0
  815. package/docs/next/store/index.html +861 -0
  816. package/docs/next/store/walkthrough.md +193 -0
  817. package/docs/spec.md +9 -9
  818. package/docs/tutorial.md +26 -25
  819. package/package.json +22 -6
  820. package/src/delta/README.md +69 -0
@@ -0,0 +1,332 @@
1
+ # Slice 6b: Durable and jobs on the store (spec)
2
+
3
+ Status: **built** (2026-10-28, pi `14b4c56e5`: one build, a build review and two fix rounds by the four spec reviewers;
4
+ reopen, the one-entry commit's mean and the resume watch's CPU accepted by the owner). Was: ready to build (2026-10-27).
5
+
6
+ The single source for building 6b, together with `design.md` read in full; the decision log `decisions.md` (later
7
+ entries win), in particular "The store", S1, S2, S4, S10, S11, S13, S15, W1, W12, "Slice 6 first decisions", "Durable's
8
+ synchronous observers", "Text is plain UTF-8", "Failures are watch calls", the "One vocabulary" entries, "The performance
9
+ and memory bar", and every "Slice 6b" entry; `slice-6a.md` (what 6a built); the feature map and the carry-over of
10
+ `slices.md` (6b); the root `AGENTS.md` "Chord v2 Code Style".
11
+
12
+ 6b puts Durable on the store (`StoreStorage`), follows Durable's views as Chord sources (`self.follow`), persists jobs,
13
+ and extends the applier to every write kind. A worker then has one store: Chord's objects and Durable's Session commit
14
+ through one queue, and a commit of either is one seq in one outbox.
15
+
16
+ ## What an app can do after this slice
17
+
18
+ ```ts
19
+ // p3 worker base code
20
+ const store = await openStore(sqliteBackend(db), ctx);
21
+ const host = createHost<P>({ address: Session({ id }), principal, store, onError });
22
+ await host.load([{ name: "@p3/core", facet: coreWorkerFacet({ init, store }) }, ...plugins], ctx);
23
+
24
+ // the core facet: the harness object opens Durable on the same store, its data under the harness's own type
25
+ host.serve(Harness, (_, self) => { // local, empty params (P3)
26
+ const harness = self.open(async (context) =>
27
+ Harness.open(await StoreStorage.open(store, Harness.name, context), { models, registry, … }, context),
28
+ (h, _reason, context) => h.close(context));
29
+ const view = self.follow((observer, ctx) => harness.value.observeConversation(rootId, observer, ctx, { min: 50 }));
30
+ return { view };
31
+ });
32
+
33
+ // a persisted job: survives a crash, a clean close and its object's retry
34
+ const ImportJob = defineJob("notes.import", {
35
+ version: 1, args: obj({ path: str() }), result: obj({ count: int() }),
36
+ state: ImportState /* persist: true, checkpointWhen */, persist: { resume: "rerun" },
37
+ });
38
+ const imports = self.job(ImportJob, { run, finish });
39
+ await imports.abort(id, ctx); // "marked" | "terminal", stored
40
+ await ctx.state.change((d) => { d.output = text; }, ctx, { persistence: { kind: "deferred" } });
41
+ ```
42
+
43
+ ## 1. Changes to 6a's store
44
+
45
+ Every item below changes 6a's code; nothing is deployed, so the schema and the archive format change in place.
46
+
47
+ ### 1.1 Names and claims (decisions "R2", "owner names and claims")
48
+
49
+ - Tables are `"<owner>:<table>"` (`"notes.store:edits"`), document owners `"<owner>"`; no host kind. The applier and
50
+ import check two name parts.
51
+ - **Claims** (owner, 2026-10-27, decision "owner names and claims", refined): what can collide is claimed once per
52
+ store, in memory: a table by its SQL name, documents by `(owner, namespace)`. An object claims its tables and
53
+ `(type, "chord")` (plus `chord.jobs` and `chord.job-states` with persisted jobs) when it declares them;
54
+ `StoreStorage.open` claims its five tables and its document namespaces (Durable's scopes contain a `:`, Chord's
55
+ namespaces never do). A second claim is refused `invalid/args`; a claim is released by its owner's end
56
+ (`StoreStorage.close` after its calls underway drained, the object's end), so a new Session can reopen over the same
57
+ store. So the object that opens Durable can declare its own persisted data under the same owner name, and two
58
+ harnesses can share a store under two owner names.
59
+
60
+ ### 1.2 One id allocator (D3)
61
+
62
+ - The store owns one synchronous allocator: `mintId()` takes the next id; the commit step takes its documents' ids from
63
+ the same allocator when a creation applies (no copy in the `Step`, no overwrite after `COMMIT`); explicit ids in
64
+ staged writes raise it at staging (`max`); a refused step leaves its ids unused (gaps, S10). Each commit persists
65
+ the allocator's current value.
66
+ - It starts at 2 (id 1 is Durable's root conversation). It saturates at `Number.MAX_SAFE_INTEGER`: an explicit write of
67
+ that id is accepted, the persisted value stays `MAX_SAFE_INTEGER`, every later `mintId` rejects "ID space is
68
+ exhausted", and a Chord creation at the saturated allocator refuses its own commit (1.4).
69
+ - Each commit takes the allocator's value once, after its writes applied, for the outbox commit (`{ seq, nextId,
70
+ writes }`) and the metadata row (mints meanwhile only raise it further); an export reads it once with `lastSeq`; the
71
+ archive manifest's `nextDocumentId` is `nextId`; import and batch apply restore it, so a replica mints above every id
72
+ it holds.
73
+
74
+ ### 1.3 The commit step
75
+
76
+ - **A staged write returns the writes it recorded:** `StagedWrite.apply(step): Promise<readonly StoreWrite[]>`.
77
+ `StoreStorage` stages one composite write per Durable commit (1.3 of section 2).
78
+ - **Order:** within the step, writes apply in the order staged, except that a staged write that frees a live address
79
+ (a retirement of another incarnation) is applied before the creation at that address (rule 9's reason, the partial
80
+ unique index); Chord's own staging keeps 6a's order. The outbox records the writes in applied order; the applier
81
+ replays them in that order (no re-sort).
82
+ - **Stamps:** a staged write can take values only the step knows (`step.seq`): Durable's `entries.commit_seq`. The
83
+ outbox records the resolved values.
84
+ - **Adopt in the owner's batch:** the host gives the store its batch when it attaches (`attach({ failed, batch })`);
85
+ an adapter's fence runs its `adopt` in `batch.within(…)` (joins a running batch, opens one otherwise); Chord's own
86
+ transactions keep their `batch.commit`. Without a host, `adopt` runs plain.
87
+
88
+ ### 1.4 Errors: Durable's Storage semantics (D4)
89
+
90
+ - The step records the error its own code threw inside the transaction callback. A rejection of the backend
91
+ transaction that is that very error is a **refusal**: the facade rolled back (a failed `ROLLBACK` reaches us as
92
+ another error, an `AggregateError` on Node), the commit rejects, nothing is adopted, the allocator keeps its raised
93
+ value, the store goes on. Any other rejection (`BEGIN`, `COMMIT`, `ROLLBACK`, a throwing `adopt`) is an unknown
94
+ outcome: the store stops (`storage_failed`). The Cloudflare facade is checked to keep the same identity; a test
95
+ injects failures at `BEGIN`, in the body, at `COMMIT` and at `ROLLBACK` on both drivers' facades.
96
+ - **The refusal's error reaches the owner unchanged** (Durable's suite matches its messages); the store classifies it
97
+ for Chord's owners: an `int` `CHECK` failure (SQLite's extended code `SQLITE_CONSTRAINT_CHECK` on Node; the error
98
+ message on the Durable Object facade, which has no extended codes) is `invalid/args` and
99
+ fails only that transaction; every other refusal of a Chord commit (the engine's counted `UPDATE`/`DELETE`, the
100
+ live-address index, a primary key, the saturated allocator, a backend error in a statement) fails the object live
101
+ (`object_failed`, `broken`: memory and disk disagree).
102
+ - **6a's owners:** a refused `self.tx` rejects with the error above and the object fails as above; a refused
103
+ migration commit (a chunk, (A) or (Z)) is rolled back whole, fails the activation `broken`, the table stays
104
+ `migrating`, earlier committed chunks stay; a refused job start rejects the start; a refused outcome or finish commit fails the object (records and
105
+ memory disagree); a refused commit that carried held changes (D8) fails the object.
106
+ - **Reads:** a read's callback returns data, never throws for a request: an adapter's request checks (an unknown
107
+ conversation, a cursor, history a document does not keep) happen after the guarded read returned, from tagged
108
+ results, so only a backend error fails the store. The store offers a read transaction for reads of several queries
109
+ that must see one state (S4).
110
+
111
+ ### 1.5 The documents engine
112
+
113
+ - **Addresses:** `(owner, namespace, kind, key?)`: `owner` the owner name; `namespace` the adapter's partition, claimed
114
+ with the owner (Chord: `chord` for documents, `chord.jobs` and `chord.job-states` for persisted runs; Durable: the
115
+ document's scope, `session`, `conversation:<id>`, `task:<id>`, which Durable's reads by scope need); `kind` and `key` as the adapter writes them (Durable JSON-encodes both,
116
+ as its indexed strings). One live record per address (the partial unique index).
117
+ - **`history` per record (R1):** `none` (Chord: older revisions dropped at a new base; row and revisions deleted at
118
+ retirement), `latest` (Durable's session, task and latest conversation documents: older revisions dropped; the row
119
+ kept with `retired_at` at retirement), `rewindable` (nothing dropped; the row kept). `retireDocument` reads the record
120
+ and applies its rule.
121
+ - **Explicit ids:** a creation may carry its id (Durable mints ahead); otherwise the allocator gives one.
122
+ - **Changes without a known revision:** an adapter whose writes carry no revision (Durable) stages a change that reads
123
+ the record in the step and uses its revision; the counted conditional `UPDATE` stays the guard.
124
+ - **`meta`:** Durable's `fork` policy and `history` details live in the record's `meta`.
125
+ - **Reads at a point:** `find(address, at)`, `load(id, at)` (the base at or below `at` plus the deltas up to it, its
126
+ version the base's), `list(owner, namespace, at, kind?, limit, after?)` by id, with the half-open lifetime
127
+ (`createdAt <= at < retiredAt`); records carry `retiredAt`. New indexes (store schema version 2):
128
+ `(owner, namespace, kind, key, created_at)`, `(owner, namespace, id)`, revisions `(document_id, kind, seq)`; their
129
+ cost on Chord's commit gate is measured.
130
+
131
+ ### 1.6 The archive and batch apply
132
+
133
+ - **Format 1 gains** (nothing deployed): `document.create` carries `history`, `retiredAt?` and `meta`; a
134
+ `document.revision { id, seq, content }` (`content` a `DocumentContent`: `{ kind: "base", version, value }` or `{ kind:
135
+ "delta", version, ops }`) part per kept revision, in seq order after its create; for
136
+ live `none` and `latest` records only the current base and its deltas are exported (as 6a); a retired `latest` record
137
+ is exported as its record alone (no base: its content was dropped at retirement); for `rewindable` every revision,
138
+ retired records included. Import checks: revisions in seq order, a base first, `seq <= lastSeq`, lifetimes
139
+ at one address never overlapping (a second live record is still refused), versions per revision; the `end` count
140
+ includes revisions.
141
+ - **Batch apply** (`applyBatch(store, commits, ctx)`, internal): refused while any owner holds a claim on the store
142
+ (an object or a `StoreStorage`: its memory would go stale) and run through the store's commit queue; `commits[0].seq` follows `lastSeq` (S5); one backend transaction for the batch, every write applied
143
+ with its commit's seq, `lastSeq` and `nextId` set from the last commit; the applier handles every `StoreWrite` kind
144
+ (`alter`, `dropIndex`, `update`/`updateWhere`/`delete`/`deleteWhere` with their recorded counts and versions,
145
+ `document.change`, `document.retire`, `document.revision`), checked against the store's records (a trust boundary);
146
+ a count that differs from the recorded one stops applying and marks the store diverged (S17): every later
147
+ `applyBatch` rejects. A test replays a store's outbox into an empty store and compares the exports, manifest
148
+ included.
149
+
150
+ ## 2. `StoreStorage`: Durable's `Storage` on the store (D1, D2)
151
+
152
+ In Durable's `src` (an ordinary pi module), importing `@earendil-works/chord/next` (Chord's `./next` export comes
153
+ with it: the store and the adapter surface below, marked internal for adapters). It passes Durable's storage
154
+ conformance suite on SQLite `:memory:` and across reopen (a wrapper that closes and reopens the store file after
155
+ every commit, Durable's reopen harness), and Durable's Session and harness test files run on it.
156
+
157
+ ### 2.1 Opening and the adapter surface
158
+
159
+ `StoreStorage.open(store, owner, ctx)`: claims `owner` (1.1); declares its tables through the store's table
160
+ preparation (the path `self.table` takes: created at the newest version or migrated); raises the allocator to
161
+ `max(record_ids.id) + 1`, saturating at `Number.MAX_SAFE_INTEGER` (one index read; covers stores built by import or
162
+ batch apply); attaches to the store's host
163
+ batch if there is one. Chord exports for it: `StoreOwnerTables` (declare and prepare tables under an owner),
164
+ staged table writes and engine writes, the step reader, the read transaction, `mintId`, the commit with a fence. Its
165
+ `close(context)` refuses new calls ("StoreStorage is closed"), waits for its calls underway, then releases its claims; the store stays open (the
166
+ app owns it).
167
+
168
+ ### 2.2 Tables
169
+
170
+ Every row carries the record's indexed columns and the whole record as `json(unknown(), { version: 1 })`; indexed
171
+ strings that must stay lossless (`kind`, `request_id`) hold Durable's JSON encoding; index columns are non-`opt`, so
172
+ absent values take sentinels that no encoded value can be (`0` for an absent owner id, ids start at 2; `""` for an
173
+ absent request id, JSON-encoded strings start with `"`). SQLite's partial head index is the table `entry_heads`
174
+ (builder, 2026-10-27: an index on `(conversation_id, has_head, id)` cost about 5.5 µs per commit; the table is written
175
+ only for entries with a head and is faster on both paths).
176
+
177
+ | Table | Key | Columns | Indexes |
178
+ | --- | --- | --- | --- |
179
+ | `record_ids` | `id` | `record_type str` | |
180
+ | `conversations` | `id` | `owner_conversation_id int`, `owner_task_id int`, `record` | `(owner_conversation_id, id)`, `(owner_task_id, id)` |
181
+ | `entries` | `id` | `conversation_id int`, `commit_seq int` (stamped), `record` | `(conversation_id, id)` |
182
+ | `entry_heads` | `id` | `conversation_id int` (one row per entry with a `head`, written with it) | `(conversation_id, id)` |
183
+ | `tasks` | `id` | `conversation_id int`, `kind str`, `status str`, `abort_requested int`, `background int`, `record` | `(status, id)`, `(conversation_id, id)`, `(kind, id)`, `(abort_requested, id)`, `(background, id)` |
184
+ | `submissions` | `id` | `conversation_id int`, `request_id str`, `status str`, `record` | `(conversation_id, request_id)`, `(conversation_id, id)`, `(status, id)` |
185
+
186
+ ### 2.3 Commits
187
+
188
+ `commit(writes, adopt, ctx)` stages one composite write and calls the store's commit with `{ admit: () => true,
189
+ adopt: (seq) => adopt(seq) }` (adopted in the host's batch, 1.3). Inside the step the composite write does what
190
+ `SqliteStorage` does inside its transaction, with the step's reader: `checkGlobalIds` (an id already claimed by
191
+ another record type, a conversation, entry or document written twice: Durable's messages), the per-document actions
192
+ of `prepareDocumentActions`/`checkDocumentActions` (one content command per document, a delta on its version, one live
193
+ incarnation per address: "already has a current incarnation"), then the table `put`s (`record_ids` only for ids not yet
194
+ claimed by the same type), then the documents in two passes: first every document that already exists (its content,
195
+ then its retirement), which frees the addresses a creation of this commit takes, then the creations and copies (each
196
+ with its retirement, a create-plus-retire being an empty lifetime, `createdAt = retiredAt = seq`). Durable's
197
+ "reconstructs rewindable documents" case (`create secondId` at address A, `retire firstId` at A, `change firstId`)
198
+ needs this order. Copies (`document.copy`) are resolved before
199
+ the step (S11): the source read at its point, checked against the copy's record ("changed in the copy batch",
200
+ kind, key, history, fork), entered as a creation carrying the base. A refused check rejects with Durable's message (a
201
+ refusal, 1.4): the store goes on, Durable's Session fails (`GuardedStorage`).
202
+
203
+ ### 2.4 Reads
204
+
205
+ `conversation`, `entry` (both overloads, `commitSeq` from its column), `findLatestHeadMarker`, `scanEntries` (both
206
+ orders, the fork chain walked as `SqliteStorage` does), `task`, `scanTasks`, `submission`, `scanSubmissions`,
207
+ `submissionByRequest`, `scanConversations`: queries over the tables, Durable's cursors (`scan.ts`) as they are;
208
+ `findDocument`, `document` (one read transaction), `scanDocuments`: the engine's reads at a point (1.5). Request errors
209
+ (`StorageRequestError`) are thrown after the guarded read (1.4).
210
+
211
+ ### 2.5 Cost
212
+
213
+ Statements per commit, as the gate measures them: an entry append, a `record_ids` check read, the `record_ids` put,
214
+ the entry put, the meta update (4; `SqliteStorage` 5); a document delta, the record read, the revision insert, the
215
+ counted update, the meta update (about 4-5; `SqliteStorage` about 7). Per `put` one compiled row check and the JSON
216
+ encoding of indexed strings.
217
+
218
+ ## 3. `self.follow`: Durable's views as Chord sources (D9, R4)
219
+
220
+ `self.follow(attach)` in a factory returns a `Watchable` (a state member, a derive source, an `on` source);
221
+ `attach(observer, ctx)` returns `Promise<{ value, detach } | undefined>` (Durable's `Observation`; `undefined` for an
222
+ absent `observeDoc` address). In 6b it is used inside the object that opened Durable (a native's value); reaching
223
+ Durable from other objects is slice 8's (the harness in a registry entry, carry-over).
224
+
225
+ - **Activation:** after the natives opened, before the members are checked and derives compute: Chord makes the
226
+ observer and calls `attach`; calls arriving before it resolves are queued and applied in order on `value`; a rejected
227
+ or `undefined` attach fails the activation like a failed dependency (`transient`); a failed activation detaches
228
+ what attached. The attempt's end detaches.
229
+ - **Calls:** a call inside a running batch (Durable's `adopt` on the store) applies the queued calls first, then marks
230
+ the source in that batch; a call outside any batch (Durable's deferred commits, `#hold`, and the task graph's
231
+ `blocked` refresh, even on the store; any Durable storage that is not the store) is queued and one batch on the next
232
+ microtask applies everything queued. A derive over two views of one commit sees both changes in one computation.
233
+ - **Ends (R4):** `failed` fails the live object `transient` (reported once as `object_failed` with that failure, its
234
+ identity's backoff, several sources ending at once fail it once; its retry reopens Durable and attaches again); `ended` is final:
235
+ a pending retirement call reaches the source's watches first (Durable's `endAfterDelivery`), then they end `ended`;
236
+ the member keeps its last value; a new `watch` on an ended follow source opens at that value and ends `ended` at once.
237
+
238
+ ## 4. Persisted jobs (D5-D8, R3)
239
+
240
+ `persist: { resume: "rerun" | "abandon" }` only in `local` types with empty params (P3, at `self.job`); a persisted job
241
+ needs a state definition with `persist: true` and `checkpointWhen` if it has state, and a JSON-only result (no `bytes()`,
242
+ refused at declaration).
243
+
244
+ ### 4.1 Records
245
+
246
+ Each unsettled run is a keyed persisted document in namespace `chord.jobs` (kind the job name, key the run id,
247
+ `history: none`); its state is a keyed persisted document in namespace `chord.job-states` (same kind and key), so two
248
+ jobs sharing a state definition never meet. The record:
249
+
250
+ ```ts
251
+ { version, fingerprint, args, key?, trace?,
252
+ phase: "pending" | "running" | "stopped" | "finishing" | "blocked",
253
+ restarts, finishFailures, abort?: true, blocked?: "finish_failed" | "version",
254
+ outcome?: { kind: "done", result } | { kind: "failed", error: StoredJobError } }
255
+ // StoredJobError: { kind: "threw", error: WireError } | { kind: "aborted", reason } | { kind: "restart_limit", restarts }
256
+ ```
257
+
258
+ Errors are stored in the wire error format (a `PluginError`'s code, message and details survive); a stored outcome is
259
+ rebuilt as the in-memory one.
260
+
261
+ ### 4.2 Transitions
262
+
263
+ | Event | Writes (one commit unless noted) | After |
264
+ | --- | --- | --- |
265
+ | start | record `pending`, state `initial()` | invoked on the live attempt |
266
+ | reservation (before `run`) | record `running` | `run` invoked (a crash after it counts) |
267
+ | `ctx.state.change` | state; the record's `restarts: 0` only when it was not 0 | |
268
+ | abort (D7) | record `abort: true` (on the line); the signal fires after the commit, outside the batch; the line is released, then `abort` joins `run` | `"marked"` |
269
+ | `run` settles | held state flushed (D8), record `finishing` with the outcome | `finish` on the live attempt |
270
+ | `finish` fails | record `finishFailures + 1`; at 5 `blocked: "finish_failed"` | retried after the backoff, a blocked run on reload |
271
+ | `finish` succeeds | record deleted, state retired (Q9), with what `finish` wrote | the run settles |
272
+ | clean stop (host close, a native restart, R3's seal) | the stopped runs written `stopped`, held state flushed, by the close writer | |
273
+ | activation (records loaded once per object; each live attempt resumes what waits) | each `running` record: `restarts + 1` (or, at 5, `failed { restart_limit }` and `finishing`, `job_interrupted` reported); `stopped` and `pending`: back to `pending` | maps, keys, active count, `running` rebuilt before anything runs; `rerun` invokes, `abandon` records `failed { aborted, restart }`; an abort-marked run finishes `aborted` without `run`; `finishing` resumes `finish`; `blocked` stays; a record of another job version, or of the same version with another fingerprint, is `blocked: "version"` |
274
+
275
+ - **A retry after a seal (R3):** the runs the seal stopped are resumed by the next live attempt only once their old
276
+ invocation settled (bounded by `closeTimeout`, as the drain; an invocation outliving it is fenced, its run resumes
277
+ then), so a `run` that ignores its signal never runs twice at once.
278
+ - **The close writer:** at the object's end, after the drain and before the documents drop, one commit past the seal
279
+ (Durable's `writeAtClose`): the runs stopped by the end written `stopped`, held state flushed; a run whose `run`
280
+ outlived the drain is fenced and written `stopped` too; blocked persisted runs keep their records (dropped only by
281
+ `abort`). In-memory runs keep 6a's rules.
282
+ - **Pinning:** records and state documents of unsettled runs stay in memory (never evicted): `ctx.state.value` and
283
+ `running` read them synchronously.
284
+ - **Fingerprint:** the job's fingerprint (args, result, state) is stored; a mismatch is `blocked: "version"` (resolved
285
+ by slice 7). A run ending at the limit reports `job_interrupted { object, job, id, restarts }` (a new `HostError`).
286
+
287
+ ### 4.3 Deferred state (D8)
288
+
289
+ As Durable's holds: the slot adopts and publishes the change at once (`valueVersion` ahead of what is stored), keeps
290
+ the held ops in a `PendingOps` (a base flag when `checkpointWhen` selected one), and the run's documents stay pinned;
291
+ the next immediate change of the state document stores the held ops and its own as one delta on the stored revision
292
+ (or a base); one foreground timer per object for the earliest deadline (`withinMs`, default 1,000 ms, `Infinity` waits
293
+ for the others; a negative or non-number `withinMs` is `invalid/args`); the outcome's commit and the close writer
294
+ store what is held; a held change of a fenced invocation is still stored; a crash loses it. A deferred change that
295
+ would reset `restarts` is stored at once (the reset must be durable). On an in-memory job the option is accepted and
296
+ does nothing.
297
+
298
+ ## 5. Benchmarks and tests
299
+
300
+ - **The gate** ("The performance and memory bar"): Durable's storage benchmark (`test/storage.bench.ts`, every read and
301
+ write case, 1k and 10k) and `test/conversation-view-bench.ts` on `StoreStorage` against `SqliteStorage`, outbox off
302
+ (its cost reported separately): each hot path within about 5%, allocation per op and retained memory no worse beyond
303
+ noise; Chord's 6a commit gate again with the new indexes and the allocator; persisted job start and state change
304
+ reported against in-memory ones (a disk commit is not held to the in-memory number).
305
+ - **Tests:** the conformance suite (both fixtures); the D4 matrix (`BEGIN`, body, `COMMIT`, `ROLLBACK` failures; a
306
+ refused Durable commit keeps the store; a refused Chord commit fails its object; a `CHECK` failure only its
307
+ transaction; a refused migration chunk; a request error inside a multi-query read keeps the store); the allocator (a
308
+ mint during a running Chord step, saturation across reopen, a refused step's gap, replay restoring `nextId`);
309
+ create-plus-retire and change-plus-retire through the outbox and the applier; reads at a point on retired `latest`
310
+ and `rewindable` records; export and import of rewindable history and mixed Chord and Durable data; `applyBatch`
311
+ (every kind, the replay equality, a diverged count); `self.follow` (one frame per commit, a derive over two views,
312
+ calls outside a batch on the store, early calls, an absent `observeDoc`, `failed` and `ended`, a retirement before
313
+ the end); persisted jobs (every transition of 4.2, a crash between reservation and `run`, a crash during the close
314
+ writer, a seal and retry, restart counting and its reset, the limit, the finish failure count across a crash, abort
315
+ joined and stored, abort racing an outcome, deferred state merged, flushed at the outcome and at close, pinned past
316
+ the retention); GC (closed `StoreStorage`, ended follow sources, cancelled abort waiters, deferred timers, settled and
317
+ dropped runs).
318
+ - **Examples:** Durable's `test/examples/35-durable-on-the-store.ts` (a worker with Durable's Session and a Chord store
319
+ object on one store, exporting the archive) and `36-durable-views.ts` (Chord's tests import nothing of Durable);
320
+ Chord's `28-persisted-jobs.ts`.
321
+
322
+ ## Carry-over taken
323
+
324
+ From `slices.md` "Slice 6b": persisted jobs (all of it, the finish failure count included), `StoreStorage` (ids, fork
325
+ copies, `adopt` in the batch), the Chord source over Durable's views (`self.follow`), the applier for batch apply;
326
+ `job.abort` async and stored.
327
+
328
+ ## Carry-over left
329
+
330
+ Slice 7: `blocked: "version"` resolved on reload; runs of jobs the code no longer declares; blocked runs retried on
331
+ reload. Slice 8: Durable's views from other objects (the harness in a registry entry). Slice 9: the trace carrier's
332
+ use.
@@ -0,0 +1,130 @@
1
+ # Slice 7a: the dependency model (spec)
2
+
3
+ Status: **ready to build** (owner, 2026-10-29: the model decided, "just build this"). Slice 7 is split: 7a builds the
4
+ dependency model on what exists (one `load` per host, links, routes, relays); 7b builds reload and rollout on top of it
5
+ (removal, dropped versions, installs, own-code reloads, loader D).
6
+
7
+ Read in full before writing code: `dependencies/model.md` (the model as decided; its section numbers are cited below as
8
+ M§), `design.md`, `decisions.md` (the entries of 2026-10-28/29: "No client providers", "Every remote type declares its
9
+ placement", "`hostAddress` instead of `placement`", "Only hosts with an address serve remote types", "Getters wait
10
+ through `waiting`", "Cycles across hosts: no probe, a diagnostic", "The dependency model is decided"), `slices.md`
11
+ (slice 7's carry-over: 7a takes none of it unless named here; 7b takes the rest), the explainer
12
+ `dependencies/book.md` for the scenarios (its catalogs are test material).
13
+
14
+ ## 1. Requests and the unbound index (M§1)
15
+
16
+ - Every reference is a request with one holder (attempt, call, outside code, a link's peer). It ends only when its
17
+ holder ends it; never because its provider is missing or does not fit.
18
+ - The destination by address is built (`host/destination.ts`, slice 7a's predecessor commit `5ec241882`). Add: version
19
+ checks only against the selected provider (no `#assertRoute` comparison with a same-name registration on the
20
+ consumer's host); a local type not served here is no longer a throw at `self.get`/`host.hold`/getters but an unbound
21
+ request.
22
+ - **The publication gate:** a request made on this host, or a hold arriving on its links, before the host's first
23
+ publication is not placed: `loading`, placed by the publication. `pendingLoad` no longer gates `Hold.start` or
24
+ `#hold` beyond the publication (it ends the startup deadlock: Sol's probe `/tmp/dep-graph-sol-barrier.log` becomes a
25
+ regression test that passes with fake timers never advanced).
26
+ - **Unbound reasons** (M§1's table): `unpublished` (loading), `not_served` and `version` (`failed { waiting }`),
27
+ `compose` for registries (`failed { waiting }`), `no_link` on a path (loading); `authorize` refused or invalid params
28
+ stay `broken`, never indexed. Indexes per host by name (local requests; refused holds that arrived over links, kept as
29
+ today's refused state in `remote/hold.ts`); entries removed when the request ends (release, call settled, getter gave
30
+ up, `closed { origin }`, link close, revocation). GC tests.
31
+
32
+ ## 2. States (M§2)
33
+
34
+ - `FailureCause` gains `{ kind: "waiting"; error }` (no `retryAt`). The wire's `failed` cause schema carries it; the
35
+ pinned list and its test change; `PROTOCOL_VERSION` stays 1.
36
+ - The mapping of M§2's table: `loading` for activating, unpublished, no link (and `installing`, 7b); `failed
37
+ { waiting }` for not served, version, compose, and a dependent whose dependency failed.
38
+ - A remote refusal for not served / version is `failed { waiting }` instead of `broken`; the provider keeps the refused
39
+ hold (it does today) and the consumer never retries it by itself (no backoff).
40
+
41
+ ## 3. Parked attempts (M§3)
42
+
43
+ - Order: factory, persisted singleton hydration (as today), requests made; the attempt is **parked** while any
44
+ dependency (`self.get` local or remote, `self.registry`, keyed pins) is not live and hydrated. `self.follow` is not a
45
+ dependency (its attach is an own step).
46
+ - What it shows: `loading` while blockers are only `loading`; `failed { waiting, "waiting for X: <cause>" }` (nearest
47
+ blocker plus root cause, 500-character rule) when one failed; `broken` when one failed with `invalid/cycle` (off-ring
48
+ dependents) or ended.
49
+ - **No timer while parked:** no dependency deadline, no identity backoff for dependency failures; the attempt's
50
+ `readyTimeout` deadline is paused while parked (as eager migrations pause it) and resumes with the budget left. The
51
+ identity backoff stays for the object's own `transient` failures only.
52
+ - **The dependency check is the boundary:** once all are live, the own steps run (natives, follow attaches, member
53
+ checks, derives) under the deadline; a dependency leaving `live` afterwards is treated as after live (R18): the
54
+ attempt goes on.
55
+ - **Wakes on every state change** of a dependency (live, loading, failed, a new cause compared by value, ended):
56
+ re-evaluate what the object shows, leave parking when all are live; never re-run the factory while parked; coalesce
57
+ per object after the batch that caused them; remember changes during own steps or teardown.
58
+ - **Retry passes on:** `ref.retry()` on a `failed { waiting }` object retries its `broken` and `transient` blockers hop
59
+ by hop (the existing `retry` message), once per operation (an id dedupes diamonds); `waiting` blockers pass it on.
60
+ A `retryOn` value call while parked `waiting` does nothing.
61
+
62
+ ## 4. Wakes (M§4)
63
+
64
+ Two events: a target changes state (the requests bound to it and their dependents); a name becomes usable on a host
65
+ (in 7a: `load`'s publication serving types and registries, a registry's value turning usable at a version): the
66
+ unbound requests indexed under it, and refused holds, which re-run their start and send `loading`, then `bound` or
67
+ `failed`. No new message kind.
68
+
69
+ ## 5. Startup (M§6)
70
+
71
+ - `load` runs the setups, publishes them in one batch (types, registries served and composed once, contributions),
72
+ wakes after that batch, then activates host-lifetime objects.
73
+ - **The barrier, decision (a):** `load` resolves when every host-lifetime object of the load has a first outcome:
74
+ live, failed by its own cause, or parked with no blocker that is a local object still without its first outcome
75
+ (`local` = executing on this host, keyed pins still loading here included). One `firstOutcome` signal per object,
76
+ separate from the readiness dependents wait for; counted once; an object of the cohort that ends before its first
77
+ outcome settles as ended; `host.close` settles a waiting `load`.
78
+
79
+ ## 6. Getters, holds, calls (M§8, decision "Getters wait through `waiting`")
80
+
81
+ - `host.hold` returns a reference at once; only invalid params throw (also before `load`); a missing local type gives
82
+ `loading` before the publication, `failed { waiting }` after it, before and after `load` alike.
83
+ - `host.get`, `ctx.get`, `host.registry`: resolve when live; wait through `loading`, `failed { transient }` and
84
+ `failed { waiting }` until their `readyTimeout`, then reject with the last cause and release; reject at once only on
85
+ `failed { broken }`.
86
+ - Calls: park on `loading` (bounded, as today); reject at once on `failed`; never resent.
87
+
88
+ ## 7. Registries (M§9)
89
+
90
+ A reader's request: bound while R is served and has a usable value at its version; otherwise unbound `not_served`,
91
+ `version` (S2's newer or unmapped reader: `waiting`, not `broken`) or `compose` (first compose or the version mapping
92
+ threw), `loading` before the publication. Woken at every transition to usable (`#valued`'s latch goes). The last good
93
+ value is kept only while every contribution it was built from is still in the table (decision 5): when one leaves,
94
+ the last good value is dropped and `.value` throws until `compose` succeeds.
95
+
96
+ ## 8. Keep-alive, revocation, cycles (M§7, M§10)
97
+
98
+ - A request over a link counts once in `host.activity.references` from arrival to end, bound or unbound;
99
+ `host.references` lists bound references only.
100
+ - Revocation ends the requests of a revoked principal, bound and unbound, at every hop.
101
+ - `gone` only for revocation (a closing provider host sends nothing, as today).
102
+ - **Cycles:** the walk at `self.get` on one host, through parked attempts too; the activation chains across hosts as
103
+ today. Remove the dependency deadline (no fallback). Add `HostError` `parked_long { object, waitingFor, since }`:
104
+ once per parking episode, when an attempt has been parked longer than its `readyTimeout` on a remote attempt that is
105
+ itself only `loading`. The guide (host README) states the four authoring rules of M§7.
106
+
107
+ ## 9. Not in 7a (7b)
108
+
109
+ Removal and re-serving of types (local re-binding of a `Binding`, a `failed` on a bound hold unbinding it, window
110
+ slots), a dropped accepted version, `installing` and install ends, own-code reloads and the parked-attempt handover,
111
+ pure swaps parking (decision 4), rollout, loader D. 7a's code must leave those paths possible, not build them.
112
+
113
+ ## 10. Tests and cost
114
+
115
+ - One `describe` per mechanism; the four catalogs in `dependencies/book.md` (chapters XIV-XVII) are the scenario list:
116
+ every row that 7a's scope reaches becomes a test (memory links; relays; fake timers where a test proves no timer
117
+ runs). Must include: the startup deadlock without `readyTimeout`; a hold before the publication placed here, not via
118
+ the parent; a missing local type on `self.get`, `host.hold`, `host.get` (waits, then rejects with the cause); a
119
+ remote refusal kept and re-run when the provider's late `load` publishes; a parked three-level chain across hosts
120
+ woken in order; wakes on every state change with causes updated; retry passing on through a diamond once; the
121
+ barrier's first-outcome rule (CodeMode → Harness waits; a remote blocker ends the pass); a cohort object ending
122
+ before its outcome; registries' waiting reader, wake after a provider arrives, last good dropped when a contribution
123
+ leaves; keep-alive counting unbound holds; revocation of unbound holds; `parked_long` reported once; GC tests for the
124
+ indexes and a parked chain released from the top.
125
+ - Benchmarks (the bar of "The performance and memory bar"): calls, activation churn, a watched derive, links against
126
+ HEAD, pinned, alternating, a HEAD copy at a path of the same length; results in `benchmarks.md`.
127
+ - Examples: `31-parked-dependencies.ts` (a missing provider arrives; causes shown; no timers), `32-startup.ts` (two
128
+ hosts that would have deadlocked).
129
+ - Docs: fold the model into `design.md` (§3, §6, §7, §17, §21's 7a parts) in the same change as the build; mark
130
+ `dependencies/model.md` as built for 7a.