@serfab/cadre-core 1.23.0 → 1.24.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 (313) hide show
  1. package/README.md +216 -294
  2. package/dist/arachnode-stub.d.ts +12 -4
  3. package/dist/arachnode-stub.js +15 -8
  4. package/dist/arachnode-stub.js.map +1 -1
  5. package/dist/cadre-invite-protocol.js +5 -4
  6. package/dist/cadre-invite-protocol.js.map +1 -1
  7. package/dist/cadre-node.d.ts +145 -44
  8. package/dist/cadre-node.js +239 -79
  9. package/dist/cadre-node.js.map +1 -1
  10. package/dist/control-authorization.d.ts +14 -2
  11. package/dist/control-authorization.js +8 -3
  12. package/dist/control-authorization.js.map +1 -1
  13. package/dist/control-cohort.d.ts +27 -13
  14. package/dist/control-cohort.js +21 -14
  15. package/dist/control-cohort.js.map +1 -1
  16. package/dist/control-database.d.ts +18 -16
  17. package/dist/control-database.js +57 -22
  18. package/dist/control-database.js.map +1 -1
  19. package/dist/control-protocol-guard.d.ts +1 -1
  20. package/dist/control-protocol-guard.js +7 -3
  21. package/dist/control-protocol-guard.js.map +1 -1
  22. package/dist/control-read-retry.d.ts +49 -11
  23. package/dist/control-read-retry.js +56 -15
  24. package/dist/control-read-retry.js.map +1 -1
  25. package/dist/control-retry.d.ts +32 -3
  26. package/dist/control-retry.js +35 -4
  27. package/dist/control-retry.js.map +1 -1
  28. package/dist/control-schema-version.d.ts +5 -5
  29. package/dist/control-schema-version.js +5 -5
  30. package/dist/control-schema-version.js.map +1 -1
  31. package/dist/control-schema.d.ts +5 -5
  32. package/dist/control-schema.js +1032 -1011
  33. package/dist/control-schema.js.map +1 -1
  34. package/dist/control-write-retry.d.ts +54 -65
  35. package/dist/control-write-retry.js +134 -158
  36. package/dist/control-write-retry.js.map +1 -1
  37. package/dist/delegate-admission.d.ts +1 -1
  38. package/dist/delegate-admission.js +1 -1
  39. package/dist/edge-node/config.d.ts +4 -3
  40. package/dist/edge-node/config.js +11 -9
  41. package/dist/edge-node/config.js.map +1 -1
  42. package/dist/edge-node/dissolve.d.ts +4 -4
  43. package/dist/edge-node/dissolve.js +4 -4
  44. package/dist/edge-node/edge-join.d.ts +1 -1
  45. package/dist/edge-node/edge-join.js +1 -1
  46. package/dist/edge-node/edge-node.js +2 -2
  47. package/dist/edge-node/edge-node.js.map +1 -1
  48. package/dist/edge-node/index.d.ts +1 -0
  49. package/dist/edge-node/index.js +1 -0
  50. package/dist/edge-node/index.js.map +1 -1
  51. package/dist/edge-node/join-credential.d.ts +1 -1
  52. package/dist/edge-node/join-credential.js +1 -1
  53. package/dist/edge-node/lazy-raw-storage.js +12 -0
  54. package/dist/edge-node/lazy-raw-storage.js.map +1 -1
  55. package/dist/edge-node/listen-addrs.d.ts +21 -0
  56. package/dist/edge-node/listen-addrs.js +25 -0
  57. package/dist/edge-node/listen-addrs.js.map +1 -0
  58. package/dist/edge-node/owner-grant.d.ts +1 -1
  59. package/dist/edge-node/owner-grant.js +1 -1
  60. package/dist/edge-node/platform.d.ts +5 -4
  61. package/dist/edge-node/platform.js.map +1 -1
  62. package/dist/edge-node/strand-move.d.ts +1 -1
  63. package/dist/edge-node/strand-move.js +1 -1
  64. package/dist/edge-node/strands.js +27 -11
  65. package/dist/edge-node/strands.js.map +1 -1
  66. package/dist/index.d.ts +7 -5
  67. package/dist/index.js +18 -7
  68. package/dist/index.js.map +1 -1
  69. package/dist/invitation-bootstrap.d.ts +28 -5
  70. package/dist/invitation-bootstrap.js +41 -8
  71. package/dist/invitation-bootstrap.js.map +1 -1
  72. package/dist/link-budget.d.ts +53 -4
  73. package/dist/link-budget.js +58 -5
  74. package/dist/link-budget.js.map +1 -1
  75. package/dist/machine-removal.d.ts +2 -2
  76. package/dist/machine-removal.js +4 -3
  77. package/dist/machine-removal.js.map +1 -1
  78. package/dist/membership-connection-gater.d.ts +2 -2
  79. package/dist/membership-connection-gater.js +2 -2
  80. package/dist/membership-view.d.ts +2 -2
  81. package/dist/membership-view.js +2 -2
  82. package/dist/node-claim-payload.d.ts +15 -7
  83. package/dist/node-claim-payload.js +25 -9
  84. package/dist/node-claim-payload.js.map +1 -1
  85. package/dist/node-class.d.ts +36 -0
  86. package/dist/node-class.js +26 -0
  87. package/dist/node-class.js.map +1 -0
  88. package/dist/node-default-transports.d.ts +50 -3
  89. package/dist/node-default-transports.js +48 -3
  90. package/dist/node-default-transports.js.map +1 -1
  91. package/dist/node-roles.d.ts +118 -0
  92. package/dist/node-roles.js +142 -0
  93. package/dist/node-roles.js.map +1 -0
  94. package/dist/node-transports.d.ts +6 -2
  95. package/dist/node-transports.js +39 -7
  96. package/dist/node-transports.js.map +1 -1
  97. package/dist/owner-anchor-sync.js +1 -1
  98. package/dist/owner-key-export.js +1 -1
  99. package/dist/owner-key-flows.d.ts +1 -1
  100. package/dist/owner-key-store.js +1 -1
  101. package/dist/owner-signer.js +1 -1
  102. package/dist/peer-authorization.d.ts +3 -1
  103. package/dist/peer-authorization.js +3 -1
  104. package/dist/peer-authorization.js.map +1 -1
  105. package/dist/peer-dial.d.ts +74 -10
  106. package/dist/peer-dial.js +89 -17
  107. package/dist/peer-dial.js.map +1 -1
  108. package/dist/peer-join-backfill.js +4 -4
  109. package/dist/peer-join-backfill.js.map +1 -1
  110. package/dist/peer-record.d.ts +34 -9
  111. package/dist/peer-record.js +66 -13
  112. package/dist/peer-record.js.map +1 -1
  113. package/dist/pending-join-runner.d.ts +1 -1
  114. package/dist/pending-join-runner.js +1 -1
  115. package/dist/provider/client.d.ts +6 -5
  116. package/dist/provider/client.js +3 -3
  117. package/dist/provider/client.js.map +1 -1
  118. package/dist/provider/descriptor.d.ts +1 -1
  119. package/dist/provider/descriptor.js +1 -1
  120. package/dist/provider/oauth.d.ts +1 -1
  121. package/dist/provider/oauth.js +1 -1
  122. package/dist/provider/rent-node.d.ts +4 -3
  123. package/dist/provider/rent-node.js +3 -3
  124. package/dist/provider/rent-node.js.map +1 -1
  125. package/dist/relay-addrs.d.ts +62 -7
  126. package/dist/relay-addrs.js +74 -11
  127. package/dist/relay-addrs.js.map +1 -1
  128. package/dist/relay-reservation.d.ts +1 -1
  129. package/dist/relay-reservation.js +1 -1
  130. package/dist/relay-server.d.ts +6 -5
  131. package/dist/relay-server.js +5 -5
  132. package/dist/relay-server.js.map +1 -1
  133. package/dist/schema-verification.d.ts +13 -10
  134. package/dist/schema-verification.js +32 -24
  135. package/dist/schema-verification.js.map +1 -1
  136. package/dist/sealed-party-key.js +1 -1
  137. package/dist/seed-bootstrap.d.ts +4 -3
  138. package/dist/seed-bootstrap.js +6 -7
  139. package/dist/seed-bootstrap.js.map +1 -1
  140. package/dist/strand-addr-protocol.d.ts +8 -6
  141. package/dist/strand-addr-protocol.js +12 -10
  142. package/dist/strand-addr-protocol.js.map +1 -1
  143. package/dist/strand-app-schema-report.d.ts +16 -2
  144. package/dist/strand-app-schema-report.js +15 -0
  145. package/dist/strand-app-schema-report.js.map +1 -1
  146. package/dist/strand-cohort.d.ts +1 -4
  147. package/dist/strand-cohort.js.map +1 -1
  148. package/dist/strand-commit-durability.d.ts +1 -1
  149. package/dist/strand-database.d.ts +13 -6
  150. package/dist/strand-database.js +17 -9
  151. package/dist/strand-database.js.map +1 -1
  152. package/dist/strand-first-sync-gate.d.ts +3 -2
  153. package/dist/strand-first-sync-gate.js +3 -2
  154. package/dist/strand-first-sync-gate.js.map +1 -1
  155. package/dist/strand-formation-deadlines.d.ts +2 -2
  156. package/dist/strand-formation-deadlines.js +2 -2
  157. package/dist/strand-formation-protocol.d.ts +1 -1
  158. package/dist/strand-formation-protocol.js +51 -16
  159. package/dist/strand-formation-protocol.js.map +1 -1
  160. package/dist/strand-instance-manager.d.ts +67 -33
  161. package/dist/strand-instance-manager.js +164 -55
  162. package/dist/strand-instance-manager.js.map +1 -1
  163. package/dist/strand-membership-reconciler.d.ts +8 -3
  164. package/dist/strand-membership-reconciler.js +8 -3
  165. package/dist/strand-membership-reconciler.js.map +1 -1
  166. package/dist/strand-membership-writer.d.ts +2 -2
  167. package/dist/strand-membership-writer.js +41 -39
  168. package/dist/strand-membership-writer.js.map +1 -1
  169. package/dist/strand-move.js +1 -1
  170. package/dist/strand-network-config.d.ts +15 -5
  171. package/dist/strand-network-config.js +7 -6
  172. package/dist/strand-network-config.js.map +1 -1
  173. package/dist/strand-party-key-rotation.d.ts +7 -3
  174. package/dist/strand-party-key-rotation.js +7 -3
  175. package/dist/strand-party-key-rotation.js.map +1 -1
  176. package/dist/strand-party-machines.d.ts +19 -8
  177. package/dist/strand-party-machines.js +26 -11
  178. package/dist/strand-party-machines.js.map +1 -1
  179. package/dist/strand-party-peers.d.ts +36 -14
  180. package/dist/strand-party-peers.js +24 -15
  181. package/dist/strand-party-peers.js.map +1 -1
  182. package/dist/strand-peer-redial.d.ts +1 -1
  183. package/dist/strand-peer-redial.js +1 -1
  184. package/dist/strand-reactivity.d.ts +20 -17
  185. package/dist/strand-reactivity.js +31 -18
  186. package/dist/strand-reactivity.js.map +1 -1
  187. package/dist/strand-revocation-enforcer.d.ts +3 -3
  188. package/dist/strand-revocation-enforcer.js +3 -3
  189. package/dist/strand-wake-protocol.d.ts +19 -7
  190. package/dist/strand-wake-protocol.js +22 -10
  191. package/dist/strand-wake-protocol.js.map +1 -1
  192. package/dist/strand-watcher.d.ts +1 -1
  193. package/dist/strand-watcher.js +1 -1
  194. package/dist/table-change-watch.js +1 -1
  195. package/dist/types.d.ts +116 -55
  196. package/dist/types.js.map +1 -1
  197. package/dist/webrtc-upgrade.d.ts +254 -0
  198. package/dist/webrtc-upgrade.js +355 -0
  199. package/dist/webrtc-upgrade.js.map +1 -0
  200. package/package.json +9 -9
  201. package/src/announce-addrs.ts +93 -93
  202. package/src/arachnode-stub.ts +18 -10
  203. package/src/bootstrap-peer-store-file.ts +44 -44
  204. package/src/bootstrap-peer-store.ts +214 -214
  205. package/src/cadre-invite-protocol.ts +741 -740
  206. package/src/cadre-node.ts +12462 -12280
  207. package/src/claim-proof.ts +147 -147
  208. package/src/control-authorization.ts +290 -276
  209. package/src/control-cohort.ts +223 -204
  210. package/src/control-database.ts +72 -28
  211. package/src/control-formation-recorder.ts +359 -359
  212. package/src/control-protocol-guard.ts +370 -366
  213. package/src/control-read-retry.ts +222 -180
  214. package/src/control-retry.ts +36 -4
  215. package/src/control-schema-version.ts +301 -301
  216. package/src/control-schema.ts +1108 -1087
  217. package/src/control-write-retry.ts +639 -669
  218. package/src/delegate-admission.ts +351 -351
  219. package/src/describe-thrown.ts +60 -60
  220. package/src/ed25519-key.ts +185 -185
  221. package/src/edge-node/config.ts +13 -10
  222. package/src/edge-node/dissolve.ts +252 -252
  223. package/src/edge-node/edge-join.ts +320 -320
  224. package/src/edge-node/edge-node.ts +1095 -1095
  225. package/src/edge-node/index.ts +60 -59
  226. package/src/edge-node/join-credential.ts +16 -16
  227. package/src/edge-node/lazy-raw-storage.ts +194 -178
  228. package/src/edge-node/listen-addrs.ts +26 -0
  229. package/src/edge-node/node-local.ts +84 -84
  230. package/src/edge-node/options.ts +195 -195
  231. package/src/edge-node/owner-grant.ts +63 -63
  232. package/src/edge-node/platform.ts +5 -4
  233. package/src/edge-node/strand-move.ts +266 -266
  234. package/src/edge-node/strands.ts +27 -12
  235. package/src/enrolled-machine-store-file.ts +43 -43
  236. package/src/enrolled-machine-store.ts +280 -280
  237. package/src/fetch-impl.ts +23 -23
  238. package/src/file-durable-slot.ts +64 -64
  239. package/src/file-safe-name.ts +32 -32
  240. package/src/formation-approval.ts +604 -604
  241. package/src/formation-token.ts +63 -63
  242. package/src/fs-atomic.ts +92 -92
  243. package/src/index.ts +987 -957
  244. package/src/invitation-bootstrap.ts +152 -118
  245. package/src/joined-strand-store.ts +553 -553
  246. package/src/key-store-file.ts +142 -142
  247. package/src/link-budget.ts +61 -5
  248. package/src/machine-removal.ts +211 -210
  249. package/src/member-redemption.ts +643 -643
  250. package/src/membership-connection-gater.ts +650 -650
  251. package/src/membership-view.ts +147 -147
  252. package/src/node-claim-payload.ts +34 -12
  253. package/src/node-class.ts +47 -0
  254. package/src/node-default-transports.ts +65 -3
  255. package/src/node-roles.ts +220 -0
  256. package/src/node-transports.ts +86 -49
  257. package/src/owner-anchor-sync.ts +172 -172
  258. package/src/owner-grant-protocol.ts +547 -547
  259. package/src/owner-key-export.ts +348 -348
  260. package/src/owner-key-flows.ts +109 -109
  261. package/src/owner-key-store.ts +1 -1
  262. package/src/owner-keys.ts +179 -179
  263. package/src/owner-signer.ts +92 -92
  264. package/src/peer-addr-book.ts +252 -252
  265. package/src/peer-authorization.ts +584 -582
  266. package/src/peer-dial.ts +698 -605
  267. package/src/peer-join-backfill.ts +961 -961
  268. package/src/peer-record.ts +71 -16
  269. package/src/pending-join-runner.ts +798 -798
  270. package/src/primary-lan-address.ts +47 -47
  271. package/src/provider/client.ts +327 -326
  272. package/src/provider/descriptor.ts +129 -129
  273. package/src/provider/index.ts +59 -59
  274. package/src/provider/oauth.ts +285 -285
  275. package/src/provider/rent-node.ts +276 -275
  276. package/src/relay-addrs.ts +90 -12
  277. package/src/relay-reservation.ts +1 -1
  278. package/src/relay-server.ts +99 -98
  279. package/src/schema-verification.ts +38 -23
  280. package/src/sealed-party-key.ts +190 -190
  281. package/src/seed-bootstrap.ts +8 -11
  282. package/src/seed-trust-policy.ts +353 -353
  283. package/src/self-address-update.ts +19 -19
  284. package/src/strand-addr-protocol.ts +17 -14
  285. package/src/strand-app-schema-report.ts +147 -122
  286. package/src/strand-cohort.ts +1 -5
  287. package/src/strand-commit-durability.ts +165 -165
  288. package/src/strand-database.ts +522 -510
  289. package/src/strand-first-sync-gate.ts +3 -2
  290. package/src/strand-formation-deadlines.ts +227 -227
  291. package/src/strand-formation-manager.ts +731 -731
  292. package/src/strand-formation-protocol.ts +1174 -1138
  293. package/src/strand-fret-addrs.ts +179 -179
  294. package/src/strand-instance-manager.ts +188 -63
  295. package/src/strand-membership-reconciler.ts +1315 -1310
  296. package/src/strand-membership-writer.ts +2152 -2150
  297. package/src/strand-move.ts +1 -1
  298. package/src/strand-network-config.ts +16 -6
  299. package/src/strand-offline.ts +178 -178
  300. package/src/strand-party-key-rotation.ts +440 -436
  301. package/src/strand-party-machines.ts +308 -293
  302. package/src/strand-party-peers.ts +151 -129
  303. package/src/strand-peer-redial.ts +1 -1
  304. package/src/strand-reactivity.ts +36 -19
  305. package/src/strand-revocation-enforcer.ts +758 -758
  306. package/src/strand-wake-protocol.ts +406 -394
  307. package/src/strand-watcher.ts +1 -1
  308. package/src/table-change-watch.ts +285 -285
  309. package/src/timed-step.ts +28 -28
  310. package/src/timeout-scheduler.ts +29 -29
  311. package/src/trusted-owner-store.ts +242 -242
  312. package/src/types.ts +3182 -3121
  313. package/src/webrtc-upgrade.ts +439 -0
@@ -15,11 +15,11 @@ const log = debug('sereus:cadre:arachnode');
15
15
  * This is a stub that will be replaced when arachnode is fully implemented.
16
16
  */
17
17
  export class ArachnodeStub {
18
- constructor(profile, config) {
18
+ constructor(nodeClass, config) {
19
19
  this.running = false;
20
- this.profile = profile;
20
+ this.nodeClass = nodeClass;
21
21
  this.config = config;
22
- log('ArachnodeStub created for profile=%s, config=%o', profile, config);
22
+ log('ArachnodeStub created for nodeClass=%s, config=%o', nodeClass, config);
23
23
  }
24
24
  /**
25
25
  * Start participating in rings
@@ -32,8 +32,8 @@ export class ArachnodeStub {
32
32
  log('Joining Ring Zulu (transaction ring)');
33
33
  // Stub: In real implementation, would register with transaction verification network
34
34
  }
35
- // Storage nodes join storage rings
36
- if (this.profile === 'storage' && this.config.storageRing) {
35
+ // Always-on nodes join storage rings
36
+ if (this.nodeClass === 'server' && this.config.storageRing) {
37
37
  const { ring, partition = 0 } = this.config.storageRing;
38
38
  log('Joining storage ring %d, partition %d', ring, partition);
39
39
  // Calculate keyspace range for this partition
@@ -108,12 +108,19 @@ export class ArachnodeStub {
108
108
  }
109
109
  /**
110
110
  * Create an arachnode instance for a strand
111
+ *
112
+ * NOTE: the node class, not the `alwaysOn` node role every other behaviour now follows
113
+ * (`node-roles.ts`). Nothing in this repo calls this, and the storage rings it hands out are
114
+ * unimplemented (`backlog/later/5-ring-zulu-storage-rings`), so the divergence reaches nobody —
115
+ * but it means a `device` told `roles: { alwaysOn: true }` joins the real Ring Zulu and would
116
+ * still be given no storage ring here. Take `NodeRoles` instead of a class when the rings are
117
+ * built; the signature is exported, so that is a breaking change rather than a rename.
111
118
  */
112
- export function createArachnodeStub(profile, config) {
119
+ export function createArachnodeStub(nodeClass, config) {
113
120
  const fullConfig = {
114
121
  enableRingZulu: config?.enableRingZulu ?? true,
115
- storageRing: profile === 'storage' ? (config?.storageRing ?? { ring: 0 }) : undefined
122
+ storageRing: nodeClass === 'server' ? (config?.storageRing ?? { ring: 0 }) : undefined
116
123
  };
117
- return new ArachnodeStub(profile, fullConfig);
124
+ return new ArachnodeStub(nodeClass, fullConfig);
118
125
  }
119
126
  //# sourceMappingURL=arachnode-stub.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"arachnode-stub.js","sourceRoot":"","sources":["../src/arachnode-stub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,GAAG,GAAG,KAAK,CAAC,wBAAwB,CAAC,CAAC;AAe5C;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,aAAa;IAMxB,YAAY,OAAoB,EAAE,MAAuB;QAFjD,YAAO,GAAG,KAAK,CAAC;QAGtB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,GAAG,CAAC,iDAAiD,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK;QACT,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO;QACzB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QAEpB,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;YAC/B,GAAG,CAAC,sCAAsC,CAAC,CAAC;YAC5C,qFAAqF;QACvF,CAA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CAAC;QACxC,MAAM,aAAa,GAAG,GAAG,GAAG,aAAa,CAAC;QAC1C,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;QACjC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,aAAa,CAAC,CAAC;QACjD,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,oBAAoB,CAAC,IAAY,EAAE,SAAiB;QAC1D,2EAA2E;QAC3E,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QACxC,MAAM,aAAa,GAAG,GAAG,GAAG,aAAa,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;QAC/B,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;QACzD,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,4BAA4B;QAC/C,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CACjC,SAAoB,EACpB,MAAiC;IAEjC,MAAM,UAAU,GAAoB;QAClC,cAAc,EAAE,MAAM,EAAE,cAAc,IAAI,IAAI;QAC9C,WAAW,EAAE,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,WAAW,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;KACvF,CAAC;IAEF,OAAO,IAAI,aAAa,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAClD,CAAC"}
@@ -26,6 +26,7 @@ import { sign } from '@optimystic/quereus-plugin-crypto';
26
26
  import { cadreInviteRedeemMessage, cadreInviteConsentMessage, CadreInviteIssuerUnknownError, InvitationExhaustedError } from './control-database.js';
27
27
  import { verifyCadreInviteRow, verifyCadreInviteRedemption } from './peer-authorization.js';
28
28
  import { verifyPeerRecordSignature } from './peer-record.js';
29
+ import { isPublishedProfile } from './node-class.js';
29
30
  import { ed25519PublicKeyB64FromPeerId } from './ed25519-key.js';
30
31
  import { CADRE_INVITATION_PREFIX, CADRE_JOIN_REQUEST_PREFIX, OWNER_GRANT_PREFIX, OWNER_KEY_EXPORT_STEM } from './cadre-join-request.js';
31
32
  import { MemberRedemptionHandler, constraintRefusal, dialRedemption, dialRedemptionInPasses, isBoundedString, isEd25519KeyB64, isNullableBoundedString, isNullableUseCap, rejection, writeFailureRefusal } from './member-redemption.js';
@@ -187,9 +188,9 @@ function isWellFormedRedeemRequest(value) {
187
188
  }
188
189
  /**
189
190
  * Judge the device's record (`request.record`) for its admission row. The signature covers the
190
- * exact address list, so it is kept only when sanitizing dropped nothing, the profile is one the
191
- * schema's `KnownProfile` check admits, the stamp and signature are in their stored forms, and
192
- * the signature verifies for `partyId` under the device's key. Anything less admits the device
191
+ * exact address list, so it is kept only when sanitizing dropped nothing, the stored `Profile`
192
+ * code is one the schema's `KnownProfile` check admits, the stamp and signature are in their
193
+ * stored forms, and the signature verifies for `partyId` under the device's key. Anything less admits the device
193
194
  * with its addresses and no signature, as an owner-written row is, and the device's next
194
195
  * publish fills it in. No clock check: a stamp in the future or the past is one the device's own
195
196
  * self-publish could write too.
@@ -202,7 +203,7 @@ function admittedRecord(partyId, remotePeerId, request) {
202
203
  if (!Array.isArray(offered) || addrs.length !== offered.length) {
203
204
  return unsigned('sanitizing changed the signed address list');
204
205
  }
205
- if (profile !== null && profile !== 'transaction' && profile !== 'storage') {
206
+ if (profile !== null && !isPublishedProfile(profile)) {
206
207
  return unsigned('unknown profile');
207
208
  }
208
209
  if (typeof updatedAt !== 'number' || !Number.isSafeInteger(updatedAt) || updatedAt <= 0 || !isBoundedString(sig)) {
@@ -1 +1 @@
1
- {"version":3,"file":"cadre-invite-protocol.js","sourceRoot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G,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClE,CAAC;IACF,OAAO,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC9C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { Libp2p, PeerId } from '@libp2p/interface';
2
2
  import type { Multiaddr } from '@multiformats/multiaddr';
3
- import type { CadreNodeConfig, StrandInstance, StrandRow, StrandConfig, FoundStrandConfig, FoundStrandResult, FoundStrandOptions, FoundStrandBackgroundResult, SAppConfig, CadreNodeEvents, ControlNetworkSeed, ApplySeedResult, SeedAckMessage, SeedDeliveryTarget, AddDroneOptions, DroneInitResult, OpenInvitation, FormStrandResult, StrandFormationDisclosure, StrandMembershipInvite, ResolveOpts, SelfRegistrationOutcome, ServiceWakeResult, PushPlatform, DeviceTokenRecord, CadreInviteStatus, CadreMachine, CadreOwnerKey, MachineRemovalPlan, MachineRemovalResult, PendingPartyKeyRotation, OwnerKeyRemovalPlan, OwnerKeyRemovalResult, RemoveOwnerOptions, CadreRemoval, CadreInvitationReach, CreateCadreInvitationOptions, CreateCadreInvitationResult, RedeemCadreInvitationOptions, RedeemCadreInvitationResult, CreateOwnerGrantOptions, CreateOwnerGrantResult, OwnerGrantStatus, RedeemOwnerGrantOptions, RedeemOwnerGrantResult, JoinWithOwnerGrantResult, ResolveDeviceTokenOpts, PendingJoinStatus } from './types.js';
3
+ import type { CadreNodeConfig, StrandInstance, StrandRow, StrandConfig, FoundStrandConfig, FoundStrandResult, FoundStrandOptions, FoundStrandBackgroundResult, SAppConfig, CadreNodeEvents, ControlNetworkSeed, ApplySeedResult, SeedAckMessage, SeedDeliveryTarget, AddDroneOptions, DroneInitResult, OpenInvitation, FormStrandResult, StrandFormationDisclosure, StrandMembershipInvite, ResolveOpts, SelfRegistrationOutcome, ServiceWakeResult, PushPlatform, DeviceTokenRecord, CadrePeerRow, CadreInviteStatus, CadreMachine, CadreOwnerKey, MachineRemovalPlan, MachineRemovalResult, PendingPartyKeyRotation, OwnerKeyRemovalPlan, OwnerKeyRemovalResult, RemoveOwnerOptions, CadreRemoval, CadreInvitationReach, CreateCadreInvitationOptions, CreateCadreInvitationResult, RedeemCadreInvitationOptions, RedeemCadreInvitationResult, CreateOwnerGrantOptions, CreateOwnerGrantResult, OwnerGrantStatus, RedeemOwnerGrantOptions, RedeemOwnerGrantResult, JoinWithOwnerGrantResult, ResolveDeviceTokenOpts, PendingJoinStatus } from './types.js';
4
4
  import { type StrandLeaveOptions, type StrandOfflineMode } from './strand-offline.js';
5
5
  import { type TrustedOwnerStore, type TrustSource } from './trusted-owner-store.js';
6
6
  import { type OwnerSign, type OwnerSigner } from './owner-signer.js';
@@ -10,7 +10,6 @@ import { type EnrolledMachineStore } from './enrolled-machine-store.js';
10
10
  import { type JoinedStrandRecord } from './joined-strand-store.js';
11
11
  import { type PartyStrandPeer } from './strand-party-peers.js';
12
12
  import { type SAppIdLookup } from './strand-watcher.js';
13
- import type { CohortPeerRow } from './strand-cohort.js';
14
13
  import { type ControlCohortReconcileResult } from './control-cohort.js';
15
14
  import { EnrollmentService } from './enrollment.js';
16
15
  import { ControlDatabase } from './control-database.js';
@@ -56,6 +55,16 @@ type EventHandler<T> = (data: T) => void;
56
55
  */
57
56
  export declare class CadreNode implements SAppIdLookup {
58
57
  private readonly config;
58
+ /**
59
+ * What this node DOES, resolved once from `config.nodeClass` and `config.roles`
60
+ * (`node-roles.ts`). Everything that used to map the node class itself reads this instead:
61
+ * the control node's FRET tier and Ring Zulu, the relay-server default, the
62
+ * {@link hostUnclaimedStrands} default, the `CadrePeer.Profile` this machine publishes, and
63
+ * the roles every strand node is launched with. The class stays on `config` as what it is —
64
+ * the preset's name, which is what an operator set and what the CLI reports — and is compared
65
+ * to a literal nowhere outside `node-roles.ts`.
66
+ */
67
+ private readonly roles;
59
68
  /**
60
69
  * The resolved node identity key, set once by {@link resolveIdentityKey}
61
70
  * during {@link start} (from `config.keyStore`, else `config.privateKey`).
@@ -84,6 +93,13 @@ export declare class CadreNode implements SAppIdLookup {
84
93
  * start() cycle rebuilds it with a fresh caught-up-peer memo.
85
94
  */
86
95
  private controlBackfill;
96
+ /**
97
+ * The control node's background WebRTC upgrade of its relayed connections
98
+ * ({@link startWebrtcUpgrade}). Created in {@link start} and stopped in {@link cleanup}
99
+ * beside the backfill, so a stop()→start() cycle starts over with no backoff state from the
100
+ * previous session.
101
+ */
102
+ private webrtcUpgrade;
87
103
  /**
88
104
  * Devices whose invitation redemption this member has verified and is admitting right now,
89
105
  * each with its count of overlapping redemptions. The control backfill's gate and the
@@ -219,7 +235,9 @@ export declare class CadreNode implements SAppIdLookup {
219
235
  private discoveredStrands;
220
236
  /**
221
237
  * Whether an unclaimed strand the filter admits is launched as a storage replica
222
- * ({@link CadreNodeConfig.hostUnclaimedStrands}), resolved once from the config.
238
+ * ({@link CadreNodeConfig.hostUnclaimedStrands}), resolved once from the config over the
239
+ * {@link roles} default (`resolveHostUnclaimedStrands`: `alwaysOn`, on a node that holds strand
240
+ * blocks).
223
241
  *
224
242
  * NOTE: a replica host stores every admitted strand of its party with no quota (Arachnode
225
243
  * quotas are unimplemented). Fine at a party's handful of strands; if always-on nodes come
@@ -327,7 +345,7 @@ export declare class CadreNode implements SAppIdLookup {
327
345
  private readonly unauthorizedRelayReservations;
328
346
  /**
329
347
  * Does this node's CONTROL libp2p run the circuit-relay server, and with which
330
- * init? Resolved once from `network` and `profile` by the same function every
348
+ * init? Resolved once from `network` and {@link roles} by the same function every
331
349
  * strand node's build uses (`relay-server.ts`). Read by
332
350
  * {@link buildControlNodeOptions} (which configures the server from it) and
333
351
  * the unauthorized budget above (whose TTL is the server's).
@@ -501,6 +519,8 @@ export declare class CadreNode implements SAppIdLookup {
501
519
  * is up — only a strand with no runtime at all answers retryably meanwhile.
502
520
  */
503
521
  private readonly strandLaunchRefusals;
522
+ /** {@link stopAppSchemaRefusedStrand} runs in flight, keyed by strandId, so a second report joins the first. */
523
+ private readonly appSchemaStops;
504
524
  /**
505
525
  * Dial targets learned out of band, keyed by peer id, valued by the multiaddr
506
526
  * strings this node was handed (parsed lazily, at dial time). Two writers:
@@ -1131,6 +1151,30 @@ export declare class CadreNode implements SAppIdLookup {
1131
1151
  * backfill would have nothing to read or no way to dial.
1132
1152
  */
1133
1153
  private startControlBackfill;
1154
+ /**
1155
+ * Arm the control node's background WebRTC upgrade: whenever a machine identifies over a
1156
+ * relayed connection and publishes a WebRTC address, dial it once and let new streams move to
1157
+ * the direct connection (`webrtc-upgrade.ts`). The service is inert on a node whose embedder
1158
+ * passed no WebRTC transport: the phones and browser tabs always have one, and a Node host
1159
+ * has one when it asked for it (`cadre-cli`'s `network.webrtc`, which resolves to a `/webrtc`
1160
+ * listen entry — see `node-default-transports.ts`).
1161
+ *
1162
+ * Who this can reach is narrower than the connection gate, and not by anything here: the
1163
+ * trigger is `peer:identify`, and Optimystic gives each control node an identify protocol id
1164
+ * naming its own party (`/optimystic/control-<partyId>/id/1.0.0`, the table in
1165
+ * `control-protocol-guard.ts`). Another party's control node never completes identify with this
1166
+ * one, so a formation joiner or a stranger dialing through this node's relay is never a
1167
+ * candidate however long its connection stays open. What is left is this party's own machines
1168
+ * and a device redeeming an invitation INTO this party.
1169
+ *
1170
+ * NOTE: that device is the one case where an upgrade is attempted against a peer this node has
1171
+ * not yet admitted, and ICE tells it this machine's own interface addresses and the address a
1172
+ * STUN server sees it at, which the relayed connection did not. Accepted: it is a machine in
1173
+ * the act of becoming a member, and the same connection already carries the redemption. If
1174
+ * that exposure ever matters, gate this service's attempts on {@link isAuthorizedMember}
1175
+ * rather than narrowing the gate.
1176
+ */
1177
+ private startWebrtcUpgrade;
1134
1178
  /**
1135
1179
  * Admit a device whose invitation redemption has verified to this member's control
1136
1180
  * replication until the returned release is called (the handler's `admitDevice`;
@@ -1304,7 +1348,7 @@ export declare class CadreNode implements SAppIdLookup {
1304
1348
  * RESERVE request, so it is never called on a node whose relay server is off.
1305
1349
  *
1306
1350
  * Refuses everyone, ahead of every admission below, while this node is waiting to be
1307
- * claimed ({@link isAwaitingClaim}): a storage-profile node runs the relay server by
1351
+ * claimed ({@link isAwaitingClaim}): a `'server'` node runs the relay server by
1308
1352
  * default, and an unclaimed node on a public address must not become anyone's relay.
1309
1353
  * The empty-anchor admission in check 1 exists for a node that will be enrolled by
1310
1354
  * its siblings, which an unclaimed node has none of.
@@ -1438,10 +1482,10 @@ export declare class CadreNode implements SAppIdLookup {
1438
1482
  private isControlCohortMember;
1439
1483
  /**
1440
1484
  * Per-stream authorization for the protocol guard's `members-snapshot` class
1441
- * (`control-protocol-guard.ts`): the four Optimystic control-DB protocols
1442
- * (`/optimystic/control-<party>/{repo,cluster,sync,block-transfer}/…`), FRET's
1485
+ * (`control-protocol-guard.ts`): the five Optimystic control-DB protocols
1486
+ * (`/optimystic/control-<party>/{repo,cluster,sync,block-transfer,blob}/…`), FRET's
1443
1487
  * five, and any protocol nobody classed. Also wired as Optimystic's
1444
- * `authorizeInboundStream` in {@link createControlNode} for the four DB
1488
+ * `authorizeInboundStream` in {@link createControlNode} for the five DB
1445
1489
  * protocols. The fail-closed layer behind the fail-open connection gater.
1446
1490
  * Control node ONLY: strand cohort nodes legitimately serve cross-party peers.
1447
1491
  *
@@ -1517,6 +1561,15 @@ export declare class CadreNode implements SAppIdLookup {
1517
1561
  * and dial each peer once — what `@libp2p/bootstrap` would have done had the node been
1518
1562
  * built with them. Best-effort: a failed dial is logged, and the connection manager and
1519
1563
  * FRET reconnect from the address book as they do for any known peer.
1564
+ *
1565
+ * NOTE: this dials by peer id, so libp2p's own address sorter picks the order rather than
1566
+ * `peer-dial.ts` → `directBeforeRelayed`. A `/p2p-circuit/webrtc` address in a bootstrap
1567
+ * peer's record therefore sorts AHEAD of the plain relayed one (libp2p's
1568
+ * `circuitRelayAddressesLast` counts only an exact `Circuit` match as relayed) and can cost
1569
+ * this peer one ICE timeout, about 23 s, before the relayed address is tried. Left as it is
1570
+ * because nothing waits on this pass — `start()` voids it, and a peer it misses is reconnected
1571
+ * from the address book. Dial by address (`dialPeerAddrs`) if bootstrap peers ever start
1572
+ * publishing WebRTC addresses and the timing of their first connection matters.
1520
1573
  */
1521
1574
  private dialControlBootstrapPeers;
1522
1575
  /**
@@ -1598,12 +1651,13 @@ export declare class CadreNode implements SAppIdLookup {
1598
1651
  registerSelfUnlessCouldFork(): Promise<SelfRegistrationOutcome | 'deferred'>;
1599
1652
  /**
1600
1653
  * Publish (or refresh) this node's own signed `CadrePeer` address record so
1601
- * other members can resolve its current signaling/relay multiaddrs from its
1654
+ * other members can resolve its current relayed and direct multiaddrs from its
1602
1655
  * PeerId alone. Public, awaitable, and idempotent.
1603
1656
  *
1604
1657
  * - Builds a `PeerAddressRecord` from the node's current dialable addrs
1605
- * (signaling/`p2p-circuit` first), signed with the ed25519 key behind its
1606
- * PeerId (the resolved node identity from `keyStore`/`config.privateKey`).
1658
+ * ({@link collectSelfAddrs}: relayed first, WebRTC last), signed with the
1659
+ * ed25519 key behind its PeerId (the resolved node identity from
1660
+ * `keyStore`/`config.privateKey`).
1607
1661
  * - If the row already exists: a self-signed UPDATE bumping `UpdatedAt`.
1608
1662
  * - If not, and the node is its own owner: an owner-signed INSERT that
1609
1663
  * also carries the self-signature. That INSERT is idempotent, so if an owner
@@ -1654,7 +1708,7 @@ export declare class CadreNode implements SAppIdLookup {
1654
1708
  private publishSelfRecordUnlessCurrent;
1655
1709
  /**
1656
1710
  * Is `record` still the one to publish: signed less than half a heartbeat ago, with this
1657
- * node's profile, over the addresses it would publish now, and the signature the own row
1711
+ * node's own always-on claim, over the addresses it would publish now, and the signature the own row
1658
1712
  * holds? The age bound keeps a record that is not re-written fresh for resolvers: at most half
1659
1713
  * a heartbeat old here and re-stamped by the heartbeat within one more, so never older than
1660
1714
  * 1.5 heartbeats (11.25 min) against {@link DEFAULT_PEER_RECORD_MAX_AGE_MS}. Cheap checks
@@ -1711,6 +1765,16 @@ export declare class CadreNode implements SAppIdLookup {
1711
1765
  * `CadrePeer.AuthorizedUpdate` self-branch enforces.
1712
1766
  */
1713
1767
  private signSelfRecord;
1768
+ /**
1769
+ * What this node publishes in its own `CadrePeer.Profile`: the `alwaysOn` role, in the stored
1770
+ * form (`node-class.ts`). The column is the one place the old codes survive, because the
1771
+ * control store is the one place backwards compatibility applies
1772
+ * (`docs/cadre/control-schema.md` → "Schema versions and migrations").
1773
+ *
1774
+ * ONE method for both uses on purpose: the heartbeat republishes when the stored row differs
1775
+ * from this, so a second derivation that disagreed would republish on every heartbeat forever.
1776
+ */
1777
+ private publishedProfile;
1714
1778
  /**
1715
1779
  * The ed25519 keypair (base64url) the node signs its own record with — the key
1716
1780
  * behind its libp2p PeerId. Sourced from the resolved {@link identityKey}
@@ -1761,10 +1825,11 @@ export declare class CadreNode implements SAppIdLookup {
1761
1825
  */
1762
1826
  private publishFirstSelfRecord;
1763
1827
  /**
1764
- * Collect this node's current dialable addresses for publication, signaling
1765
- * (`/p2p-circuit`) first. Prefers the best invite/NAT-resolved set and folds
1766
- * in the relay/signaling address (the WebRTC dial input) when not already
1767
- * present.
1828
+ * Collect this node's current dialable addresses for publication, ranked by
1829
+ * {@link orderRelayedFirst}: the plain relayed addresses, then the direct ones,
1830
+ * then any that needs ICE after its relay hop. Prefers the best
1831
+ * invite/NAT-resolved set and folds in this node's relayed address
1832
+ * ({@link getRelayAddress}) when not already present.
1768
1833
  */
1769
1834
  private collectSelfAddrs;
1770
1835
  /**
@@ -1803,8 +1868,9 @@ export declare class CadreNode implements SAppIdLookup {
1803
1868
  * 4. freshness — rejected once older than `maxAgeMs` (never a dead relay
1804
1869
  * reservation),
1805
1870
  * 5. the pluggable trust gate (`opts.trustPolicy`).
1806
- * Survivors are returned signaling (`/p2p-circuit`) first, filtered to
1807
- * signaling-only when requested, as parsed `Multiaddr`s (unparsable addrs
1871
+ * Survivors are returned in {@link orderRelayedFirst} order — plain relayed,
1872
+ * then direct, then WebRTC — filtered to the addresses reaching through a relay
1873
+ * when `signalingOnly` is set, as parsed `Multiaddr`s (unparsable addrs
1808
1874
  * dropped). Any gate failure yields an empty array rather than throwing.
1809
1875
  *
1810
1876
  * Every returned address is normalized to terminate in `/p2p/<peerId>` — see
@@ -2471,6 +2537,30 @@ export declare class CadreNode implements SAppIdLookup {
2471
2537
  * Returns whether it suppressed.
2472
2538
  */
2473
2539
  private suppressIfAppSchemaRefused;
2540
+ /**
2541
+ * Stop a running strand whose `App` schema can no longer be used here: another member recorded a
2542
+ * higher App schema version than the one its database runs (`onAppSchemaSuperseded`), so its writes
2543
+ * would erase what the newer version added, or a rebuild after hibernation was refused the schema
2544
+ * (`AppSchemaRefusedError`), which every later rebuild would be too. Leaves what a refused launch
2545
+ * leaves (docs/strands/app-schema.md → "A running member stops"): no instance, the sApp config registered, the
2546
+ * strand suppressed in the watcher until the next {@link addStrand}, which launches through the
2547
+ * connect's version gate. Storage, saved network state and control rows stay. Emits
2548
+ * `strand:stopped`, then `strand:error` with the refusal, so an app tells its user to update on
2549
+ * `error instanceof AppSchemaOutdatedError`.
2550
+ *
2551
+ * Through the manager's stop rather than {@link detachStrand}, which drops the sApp config the next
2552
+ * claim replaces. A claim that registered another config meanwhile is not suppressed but handed to the
2553
+ * watcher's relaunch, since its schema has not been tried ({@link suppressIfAppSchemaRefused}).
2554
+ * A second report for the strand while one stop runs joins it. Never rejects.
2555
+ */
2556
+ private stopAppSchemaRefusedStrand;
2557
+ private runAppSchemaRefusedStop;
2558
+ /**
2559
+ * {@link stopAppSchemaRefusedStrand} for a wake or check-in whose rebuild was refused the strand's
2560
+ * `App` schema, in place of re-hibernating it for a later wake to be refused again. Returns whether it
2561
+ * stopped the strand.
2562
+ */
2563
+ private stopIfRebuildRefusedAppSchema;
2474
2564
  /**
2475
2565
  * Offer a strand no local config claims to the hosting app as `strand:discovered`, so
2476
2566
  * it can decide whether to join (register a config + addStrand); the strand-agnostic
@@ -2559,7 +2649,8 @@ export declare class CadreNode implements SAppIdLookup {
2559
2649
  * triggers are coalesced upstream by `HibernationManager`, so this runs once
2560
2650
  * per wake; a wake racing a check-in joins the check-in's rebuild in `resumeStrand`.
2561
2651
  *
2562
- * A failed rebuild re-hibernates the strand (see {@link rehibernateIfResumeFailed});
2652
+ * A failed rebuild re-hibernates the strand (see {@link rehibernateIfResumeFailed}), except one
2653
+ * refused the strand's `App` schema, which stops it ({@link stopIfRebuildRefusedAppSchema});
2563
2654
  * every failure rethrows, so the waker still sees the error.
2564
2655
  *
2565
2656
  * Records no activity itself: whoever asked for the wake did ({@link wakeStrand},
@@ -2596,7 +2687,7 @@ export declare class CadreNode implements SAppIdLookup {
2596
2687
  /**
2597
2688
  * Replace a running strand node whose launch seed names a machine removed from the cadre with one
2598
2689
  * built from a fresh seed, which a removed machine is not in, so an offline queue stops waiting
2599
- * for it (`docs/strands.md` → Waiting for the party's own machines). The same pair hibernation
2690
+ * for it (`docs/strands/writes.md` → Waiting for the party's own machines). The same pair hibernation
2600
2691
  * runs, so the app sees what it sees on a wake, and a queue is restored from its journal; the
2601
2692
  * quiesce waits for a build in flight. A strand that went down meanwhile takes a fresh seed at its
2602
2693
  * next wake, so it is left down.
@@ -2735,7 +2826,7 @@ export declare class CadreNode implements SAppIdLookup {
2735
2826
  }): Promise<StrandInstance>;
2736
2827
  /**
2737
2828
  * Switch a strand between offline mode, where a commit resolves once the transaction is queued on
2738
- * this machine, and online mode (docs/strands.md → "Offline mode"). Affects transactions begun from
2829
+ * this machine, and online mode (docs/strands/writes.md → "Offline mode"). Affects transactions begun from
2739
2830
  * now on; one already open keeps the acknowledgement it began with. The mode belongs to the strand:
2740
2831
  * a hibernating strand takes it at its next build, and it lasts across hibernation and every
2741
2832
  * rebuild until the process exits, after which the strand starts in `strandOffline.initialMode`.
@@ -2752,10 +2843,11 @@ export declare class CadreNode implements SAppIdLookup {
2752
2843
  */
2753
2844
  getStrandOfflineMode(strandId: string): StrandOfflineMode;
2754
2845
  /**
2755
- * The party's other machines known to hold `strandId` (each has written its `StrandPeer` row for
2756
- * it) with no open connection from this node's strand node: what a queued transaction reporting
2846
+ * The party's other machines known to STORE `strandId` (each has a `StrandPeer` row for it whose
2847
+ * role says it serves; a client's row is read and skipped) with no open connection from this
2848
+ * node's strand node: what a queued transaction reporting
2757
2849
  * `waitingFor: 'cohort'` may be waiting for, by control peer id (`listMachines`, `removeMachine`)
2758
- * and strand peer id (docs/strands.md → "Waiting for the party's own machines"). Empty on a
2850
+ * and strand peer id (docs/strands/writes.md → "Waiting for the party's own machines"). Empty on a
2759
2851
  * strand not running here, and on a node offering no offline mode. Nothing releases the wait on
2760
2852
  * its own: the transaction is safe in the journal, and removing the machine is the user's call.
2761
2853
  */
@@ -2999,7 +3091,7 @@ export declare class CadreNode implements SAppIdLookup {
2999
3091
  * deletion cannot be replayed, and `queryStrands` reads raw (no retired-stamp filter),
3000
3092
  * so siblings that already hold the row keep running the strand until the collection
3001
3093
  * itself converges (logged loudly; see "Deletes made while alone" in
3002
- * docs/architecture.md).
3094
+ * docs/cadre/control-convergence.md).
3003
3095
  *
3004
3096
  * A no-op (no throw, no tombstone) when the row is already absent — but a
3005
3097
  * locally-running instance of that id is still stopped.
@@ -3011,7 +3103,7 @@ export declare class CadreNode implements SAppIdLookup {
3011
3103
  * step, not a widening of this method.
3012
3104
  *
3013
3105
  * Refuses while the strand's offline queue on this machine holds transactions, unless
3014
- * `options.discardQueued` (docs/strands.md → "Leaving a strand with unsent transactions"). The
3106
+ * `options.discardQueued` (docs/strands/writes.md → "Leaving a strand with unsent transactions"). The
3015
3107
  * check and the discard run before the control-plane delete, so a delete refused afterwards
3016
3108
  * leaves the discarded transactions discarded.
3017
3109
  *
@@ -3037,7 +3129,7 @@ export declare class CadreNode implements SAppIdLookup {
3037
3129
  * NOT the strand row's shared `MemberPrivateKey`, which formation hands to every
3038
3130
  * joining party — is what the founder bootstrap derives `Member.Key`/`Manager.MemberKey`
3039
3131
  * from. It replicates to every machine this party owns (same plaintext-at-rest stance
3040
- * as `MemberPrivateKey`; docs/strands.md → "Closed-Strand Member Key Handling") and is
3132
+ * as `MemberPrivateKey`; docs/strands/keys.md → "Closed-strand member key handling") and is
3041
3133
  * never put on the formation wire.
3042
3134
  *
3043
3135
  * A founding seats the key in the same transaction as the strand row, not through here.
@@ -3550,8 +3642,8 @@ export declare class CadreNode implements SAppIdLookup {
3550
3642
  private mergeStrandPeerAddrs;
3551
3643
  /**
3552
3644
  * The local strand instance's dialable strand-network multiaddrs for the
3553
- * strand-addr RPC, ordered signaling-first (reusing the control node's
3554
- * {@link orderSignalingFirst}). Returns `[]` when the strand is not running
3645
+ * strand-addr RPC, ordered relayed-first and WebRTC last (reusing the control
3646
+ * node's {@link orderRelayedFirst}). Returns `[]` when the strand is not running
3555
3647
  * locally or has no live libp2p node (hibernating / quiescing / never
3556
3648
  * participated) — a node only answers for a strand it is actively meshing,
3557
3649
  * regardless of the strand's mode. A `bootstrap`-mode first node still has a
@@ -3574,7 +3666,7 @@ export declare class CadreNode implements SAppIdLookup {
3574
3666
  * strand stays, so a later re-formation reuses the same identity.
3575
3667
  *
3576
3668
  * Refuses while the strand's offline queue on this machine holds transactions, unless
3577
- * `options.discardQueued` (docs/strands.md → "Leaving a strand with unsent transactions"). The
3669
+ * `options.discardQueued` (docs/strands/writes.md → "Leaving a strand with unsent transactions"). The
3578
3670
  * check and the discard run before the party-wide row is removed, so a removal refused
3579
3671
  * afterwards leaves the discarded transactions discarded.
3580
3672
  *
@@ -3588,7 +3680,7 @@ export declare class CadreNode implements SAppIdLookup {
3588
3680
  forgetJoinedStrand(strandId: string, options?: StrandLeaveOptions): Promise<void>;
3589
3681
  /**
3590
3682
  * Before a leave changes anything: refuse while the strand's offline queue holds transactions,
3591
- * unless the app asked to discard them (docs/strands.md → "Leaving a strand with unsent
3683
+ * unless the app asked to discard them (docs/strands/writes.md → "Leaving a strand with unsent
3592
3684
  * transactions"). Transactions Optimystic will not withdraw stay in the journal, named in one
3593
3685
  * warning, and the leave goes on: they may already be saved, and a cohort that never returns
3594
3686
  * would otherwise block the leave forever.
@@ -3879,7 +3971,7 @@ export declare class CadreNode implements SAppIdLookup {
3879
3971
  * as serving the control database and is one this node sends control writes to (an
3880
3972
  * authorized member, or a device whose admission it is writing). Optimystic counts a peer
3881
3973
  * into a control block's cohort on those same terms; with none, a write commits on this node
3882
- * alone and is queued for re-issue once one is reachable (docs/architecture.md → "Writes made
3974
+ * alone and is queued for re-issue once one is reachable (docs/cadre/control-convergence.md → "Writes made
3883
3975
  * while alone").
3884
3976
  *
3885
3977
  * It exists so an embedder can warn an owner before a control write that this machine
@@ -3963,12 +4055,12 @@ export declare class CadreNode implements SAppIdLookup {
3963
4055
  * never reach here: {@link ControlDatabase.queryCadrePeers} excludes them, so a
3964
4056
  * revoked peer is not addressable either.
3965
4057
  *
3966
- * NOTE: answers the whole `CadrePeerRow`, past the fields declared; the integration
3967
- * harness (`owner-cli-node.ts`, `OwnerCliMemberRow.sig`) reads `sig` off it through the admin
3968
- * channel to tell a row another member seated from one the subject published itself. Narrow
3969
- * this to the declared fields only together with that reader.
4058
+ * NOTE: answers the whole row. The integration harness (`owner-cli-node.ts`,
4059
+ * `OwnerCliMemberRow.sig`) reads `sig` off it through the admin channel to tell a row
4060
+ * another member seated from one the subject published itself. Narrow this to fewer fields
4061
+ * only together with that reader.
3970
4062
  */
3971
- listMembers(): Promise<CohortPeerRow[]>;
4063
+ listMembers(): Promise<CadrePeerRow[]>;
3972
4064
  /**
3973
4065
  * Probe whether a given peer is a `CadrePeer` member.
3974
4066
  *
@@ -4163,7 +4255,7 @@ export declare class CadreNode implements SAppIdLookup {
4163
4255
  * Push-wake a hibernating cadre peer over the control network.
4164
4256
  *
4165
4257
  * Resolves the target's signed control-network address from its `CadrePeer`
4166
- * record (via {@link resolvePeerAddrs}, signaling/relay first — so a NAT'd peer
4258
+ * record (via {@link resolvePeerAddrs}, relayed first — so a NAT'd peer
4167
4259
  * is reachable through its circuit-relay address), dials `WAKE_PROTOCOL`, sends
4168
4260
  * the {@link WakeRequest}, and returns the peer's {@link WakeAck}. The receiver
4169
4261
  * only resumes a strand it already participates in; it acks once it has decided,
@@ -4329,7 +4421,7 @@ export declare class CadreNode implements SAppIdLookup {
4329
4421
  * Whether a control write made now could fork the party's history: no sibling is reachable
4330
4422
  * ({@link committedAlone}) while the party has other members. Such a write commits on this
4331
4423
  * node alone, and if another member writes the same collection meanwhile, both take it to the
4332
- * same revision with different content, which no re-issue heals (docs/architecture.md →
4424
+ * same revision with different content, which no re-issue heals (docs/cadre/control-convergence.md →
4333
4425
  * "Writes made while alone"). A party with no other members cannot fork.
4334
4426
  *
4335
4427
  * What a caller does on `true` depends on the write. An `OwnerKey` add has no re-issue path at
@@ -4471,7 +4563,7 @@ export declare class CadreNode implements SAppIdLookup {
4471
4563
  * withdrawal of every live invitation it could redeem to come back, and a
4472
4564
  * `PendingStrandPartyKey` row per closed strand the party holds a key for, in ONE transaction
4473
4565
  * ({@link ControlDatabase.removeMachine}), with a `Revocation` tombstone per removed row so the
4474
- * removal holds on every machine ("Deletes made while alone" in docs/architecture.md), under
4566
+ * removal holds on every machine ("Deletes made while alone" in docs/cadre/control-convergence.md), under
4475
4567
  * one owner approval. The pending row reaches the removed machine in that same transaction, so
4476
4568
  * the fresh key rides in it sealed to the machines that remain
4477
4569
  * ({@link pendingPartyKeyRecipients}): the removed machine holds the row and cannot open it. Afterwards this node forgets the machine as a dial target, and the
@@ -4615,6 +4707,14 @@ export declare class CadreNode implements SAppIdLookup {
4615
4707
  * the party-machine watch and the next reconciler pass. Written regardless of whether this machine holds the party's
4616
4708
  * member key: a storage replica is bound by its siblings. A node on an ephemeral identity
4617
4709
  * cannot sign the row and writes nothing. Never rejects.
4710
+ *
4711
+ * The row's role is this node's own: null when it serves the blocks of the strands it runs,
4712
+ * `'client'` when it runs them without storing any (`NodeRoles.strandCohortMember`). Read here
4713
+ * rather than carried through {@link deferredStrandPeerWrites}, which stores the strand peer id
4714
+ * alone, because the role cannot change while the node runs. A row already in the party keeps
4715
+ * the role it was written with, since the row is immutable; `ControlDatabase.insertStrandPeer`
4716
+ * logs the mismatch when a reconfigured machine publishes a different one
4717
+ * (`docs/strands/membership.md` → "Limits and accepted tradeoffs").
4618
4718
  */
4619
4719
  private publishStrandPeer;
4620
4720
  /** The re-attempt of every `StrandPeer` row in {@link deferredStrandPeerWrites} (growth drain, party-machine watch); each contains its own failure. */
@@ -4678,8 +4778,9 @@ export declare class CadreNode implements SAppIdLookup {
4678
4778
  */
4679
4779
  decodeSeed(encoded: string): ControlNetworkSeed;
4680
4780
  /**
4681
- * Get this node's circuit relay address for inclusion in seeds.
4682
- * Returns null if no relay address is available.
4781
+ * This node's one relayed address for a seed, or null when it holds no reservation:
4782
+ * {@link firstRelayedAddr} of its announced addresses, so the plain relayed address
4783
+ * is named ahead of a WebRTC one that needs ICE after the same relay hop.
4683
4784
  */
4684
4785
  getRelayAddress(): Promise<string | null>;
4685
4786
  /**
@@ -4707,7 +4808,7 @@ export declare class CadreNode implements SAppIdLookup {
4707
4808
  * the peer id, addresses and secret its host showed (the QR code): mint a seed, prove
4708
4809
  * possession of the secret beside it (`claim-proof.ts`), deliver it, and on acceptance
4709
4810
  * vouch the node into this cadre and keep its addresses as a dial target. The owner
4710
- * side of the claim-secret entry in the Seed Delivery Protocol (`docs/architecture.md`).
4811
+ * side of "Claiming a node" (`docs/cadre/membership.md`).
4711
4812
  *
4712
4813
  * Requires the seed service with an owner key ({@link useOwnerSigner}), as
4713
4814
  * {@link addDrone} does, and like it is one owner approval (the seed and the vouch). The
@@ -5156,7 +5257,7 @@ export declare class CadreNode implements SAppIdLookup {
5156
5257
  /**
5157
5258
  * Ask to join through `invitation` and have the party keep trying until the join works, the
5158
5259
  * invitation is used up or expires, or the request is dismissed: across restarts, and from
5159
- * any owner machine of the party (`docs/strands.md` → "Joining while the inviter is
5260
+ * any owner machine of the party (`docs/strands/formation.md` → "Joining while the inviter is
5160
5261
  * offline"). Records a party-wide `JoinRequest` row, runs one attempt on this machine at
5161
5262
  * once, and returns the status after it: `'joined'` when the inviter answered yes, `'waiting'`
5162
5263
  * when it was unreachable or not ready, `'failed'` when it refused for good.