@serfab/cadre-core 1.22.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 (314) 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 +159 -53
  8. package/dist/cadre-node.js +276 -89
  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 +6 -3
  82. package/dist/membership-view.js.map +1 -1
  83. package/dist/node-claim-payload.d.ts +15 -7
  84. package/dist/node-claim-payload.js +25 -9
  85. package/dist/node-claim-payload.js.map +1 -1
  86. package/dist/node-class.d.ts +36 -0
  87. package/dist/node-class.js +26 -0
  88. package/dist/node-class.js.map +1 -0
  89. package/dist/node-default-transports.d.ts +50 -3
  90. package/dist/node-default-transports.js +48 -3
  91. package/dist/node-default-transports.js.map +1 -1
  92. package/dist/node-roles.d.ts +118 -0
  93. package/dist/node-roles.js +142 -0
  94. package/dist/node-roles.js.map +1 -0
  95. package/dist/node-transports.d.ts +6 -2
  96. package/dist/node-transports.js +39 -7
  97. package/dist/node-transports.js.map +1 -1
  98. package/dist/owner-anchor-sync.js +1 -1
  99. package/dist/owner-key-export.js +1 -1
  100. package/dist/owner-key-flows.d.ts +1 -1
  101. package/dist/owner-key-store.js +1 -1
  102. package/dist/owner-signer.js +1 -1
  103. package/dist/peer-authorization.d.ts +3 -1
  104. package/dist/peer-authorization.js +3 -1
  105. package/dist/peer-authorization.js.map +1 -1
  106. package/dist/peer-dial.d.ts +74 -10
  107. package/dist/peer-dial.js +89 -17
  108. package/dist/peer-dial.js.map +1 -1
  109. package/dist/peer-join-backfill.js +4 -4
  110. package/dist/peer-join-backfill.js.map +1 -1
  111. package/dist/peer-record.d.ts +34 -9
  112. package/dist/peer-record.js +66 -13
  113. package/dist/peer-record.js.map +1 -1
  114. package/dist/pending-join-runner.d.ts +1 -1
  115. package/dist/pending-join-runner.js +1 -1
  116. package/dist/provider/client.d.ts +6 -5
  117. package/dist/provider/client.js +3 -3
  118. package/dist/provider/client.js.map +1 -1
  119. package/dist/provider/descriptor.d.ts +1 -1
  120. package/dist/provider/descriptor.js +1 -1
  121. package/dist/provider/oauth.d.ts +1 -1
  122. package/dist/provider/oauth.js +1 -1
  123. package/dist/provider/rent-node.d.ts +4 -3
  124. package/dist/provider/rent-node.js +3 -3
  125. package/dist/provider/rent-node.js.map +1 -1
  126. package/dist/relay-addrs.d.ts +62 -7
  127. package/dist/relay-addrs.js +74 -11
  128. package/dist/relay-addrs.js.map +1 -1
  129. package/dist/relay-reservation.d.ts +1 -1
  130. package/dist/relay-reservation.js +1 -1
  131. package/dist/relay-server.d.ts +6 -5
  132. package/dist/relay-server.js +5 -5
  133. package/dist/relay-server.js.map +1 -1
  134. package/dist/schema-verification.d.ts +13 -10
  135. package/dist/schema-verification.js +32 -24
  136. package/dist/schema-verification.js.map +1 -1
  137. package/dist/sealed-party-key.js +1 -1
  138. package/dist/seed-bootstrap.d.ts +4 -3
  139. package/dist/seed-bootstrap.js +6 -7
  140. package/dist/seed-bootstrap.js.map +1 -1
  141. package/dist/strand-addr-protocol.d.ts +8 -6
  142. package/dist/strand-addr-protocol.js +12 -10
  143. package/dist/strand-addr-protocol.js.map +1 -1
  144. package/dist/strand-app-schema-report.d.ts +16 -2
  145. package/dist/strand-app-schema-report.js +15 -0
  146. package/dist/strand-app-schema-report.js.map +1 -1
  147. package/dist/strand-cohort.d.ts +1 -4
  148. package/dist/strand-cohort.js.map +1 -1
  149. package/dist/strand-commit-durability.d.ts +1 -1
  150. package/dist/strand-database.d.ts +13 -6
  151. package/dist/strand-database.js +17 -9
  152. package/dist/strand-database.js.map +1 -1
  153. package/dist/strand-first-sync-gate.d.ts +3 -2
  154. package/dist/strand-first-sync-gate.js +3 -2
  155. package/dist/strand-first-sync-gate.js.map +1 -1
  156. package/dist/strand-formation-deadlines.d.ts +2 -2
  157. package/dist/strand-formation-deadlines.js +2 -2
  158. package/dist/strand-formation-protocol.d.ts +1 -1
  159. package/dist/strand-formation-protocol.js +51 -16
  160. package/dist/strand-formation-protocol.js.map +1 -1
  161. package/dist/strand-instance-manager.d.ts +134 -42
  162. package/dist/strand-instance-manager.js +331 -76
  163. package/dist/strand-instance-manager.js.map +1 -1
  164. package/dist/strand-membership-reconciler.d.ts +8 -3
  165. package/dist/strand-membership-reconciler.js +8 -3
  166. package/dist/strand-membership-reconciler.js.map +1 -1
  167. package/dist/strand-membership-writer.d.ts +2 -2
  168. package/dist/strand-membership-writer.js +41 -39
  169. package/dist/strand-membership-writer.js.map +1 -1
  170. package/dist/strand-move.js +1 -1
  171. package/dist/strand-network-config.d.ts +15 -5
  172. package/dist/strand-network-config.js +7 -6
  173. package/dist/strand-network-config.js.map +1 -1
  174. package/dist/strand-party-key-rotation.d.ts +7 -3
  175. package/dist/strand-party-key-rotation.js +7 -3
  176. package/dist/strand-party-key-rotation.js.map +1 -1
  177. package/dist/strand-party-machines.d.ts +19 -8
  178. package/dist/strand-party-machines.js +26 -11
  179. package/dist/strand-party-machines.js.map +1 -1
  180. package/dist/strand-party-peers.d.ts +36 -14
  181. package/dist/strand-party-peers.js +24 -15
  182. package/dist/strand-party-peers.js.map +1 -1
  183. package/dist/strand-peer-redial.d.ts +1 -1
  184. package/dist/strand-peer-redial.js +1 -1
  185. package/dist/strand-reactivity.d.ts +20 -17
  186. package/dist/strand-reactivity.js +31 -18
  187. package/dist/strand-reactivity.js.map +1 -1
  188. package/dist/strand-revocation-enforcer.d.ts +3 -3
  189. package/dist/strand-revocation-enforcer.js +3 -3
  190. package/dist/strand-wake-protocol.d.ts +19 -7
  191. package/dist/strand-wake-protocol.js +22 -10
  192. package/dist/strand-wake-protocol.js.map +1 -1
  193. package/dist/strand-watcher.d.ts +1 -1
  194. package/dist/strand-watcher.js +1 -1
  195. package/dist/table-change-watch.js +1 -1
  196. package/dist/types.d.ts +127 -57
  197. package/dist/types.js.map +1 -1
  198. package/dist/webrtc-upgrade.d.ts +254 -0
  199. package/dist/webrtc-upgrade.js +355 -0
  200. package/dist/webrtc-upgrade.js.map +1 -0
  201. package/package.json +9 -9
  202. package/src/announce-addrs.ts +93 -93
  203. package/src/arachnode-stub.ts +18 -10
  204. package/src/bootstrap-peer-store-file.ts +44 -44
  205. package/src/bootstrap-peer-store.ts +214 -214
  206. package/src/cadre-invite-protocol.ts +741 -740
  207. package/src/cadre-node.ts +12462 -12252
  208. package/src/claim-proof.ts +147 -147
  209. package/src/control-authorization.ts +290 -276
  210. package/src/control-cohort.ts +223 -204
  211. package/src/control-database.ts +72 -28
  212. package/src/control-formation-recorder.ts +359 -359
  213. package/src/control-protocol-guard.ts +370 -366
  214. package/src/control-read-retry.ts +222 -180
  215. package/src/control-retry.ts +36 -4
  216. package/src/control-schema-version.ts +301 -301
  217. package/src/control-schema.ts +1108 -1087
  218. package/src/control-write-retry.ts +639 -669
  219. package/src/delegate-admission.ts +351 -351
  220. package/src/describe-thrown.ts +60 -60
  221. package/src/ed25519-key.ts +185 -185
  222. package/src/edge-node/config.ts +13 -10
  223. package/src/edge-node/dissolve.ts +252 -252
  224. package/src/edge-node/edge-join.ts +320 -320
  225. package/src/edge-node/edge-node.ts +1095 -1095
  226. package/src/edge-node/index.ts +60 -59
  227. package/src/edge-node/join-credential.ts +16 -16
  228. package/src/edge-node/lazy-raw-storage.ts +194 -178
  229. package/src/edge-node/listen-addrs.ts +26 -0
  230. package/src/edge-node/node-local.ts +84 -84
  231. package/src/edge-node/options.ts +195 -195
  232. package/src/edge-node/owner-grant.ts +63 -63
  233. package/src/edge-node/platform.ts +5 -4
  234. package/src/edge-node/strand-move.ts +266 -266
  235. package/src/edge-node/strands.ts +27 -12
  236. package/src/enrolled-machine-store-file.ts +43 -43
  237. package/src/enrolled-machine-store.ts +280 -280
  238. package/src/fetch-impl.ts +23 -23
  239. package/src/file-durable-slot.ts +64 -64
  240. package/src/file-safe-name.ts +32 -32
  241. package/src/formation-approval.ts +604 -604
  242. package/src/formation-token.ts +63 -63
  243. package/src/fs-atomic.ts +92 -92
  244. package/src/index.ts +987 -957
  245. package/src/invitation-bootstrap.ts +152 -118
  246. package/src/joined-strand-store.ts +553 -553
  247. package/src/key-store-file.ts +142 -142
  248. package/src/link-budget.ts +61 -5
  249. package/src/machine-removal.ts +211 -210
  250. package/src/member-redemption.ts +643 -643
  251. package/src/membership-connection-gater.ts +650 -650
  252. package/src/membership-view.ts +147 -144
  253. package/src/node-claim-payload.ts +34 -12
  254. package/src/node-class.ts +47 -0
  255. package/src/node-default-transports.ts +65 -3
  256. package/src/node-roles.ts +220 -0
  257. package/src/node-transports.ts +86 -49
  258. package/src/owner-anchor-sync.ts +172 -172
  259. package/src/owner-grant-protocol.ts +547 -547
  260. package/src/owner-key-export.ts +348 -348
  261. package/src/owner-key-flows.ts +109 -109
  262. package/src/owner-key-store.ts +1 -1
  263. package/src/owner-keys.ts +179 -179
  264. package/src/owner-signer.ts +92 -92
  265. package/src/peer-addr-book.ts +252 -252
  266. package/src/peer-authorization.ts +584 -582
  267. package/src/peer-dial.ts +698 -605
  268. package/src/peer-join-backfill.ts +961 -961
  269. package/src/peer-record.ts +71 -16
  270. package/src/pending-join-runner.ts +798 -798
  271. package/src/primary-lan-address.ts +47 -47
  272. package/src/provider/client.ts +327 -326
  273. package/src/provider/descriptor.ts +129 -129
  274. package/src/provider/index.ts +59 -59
  275. package/src/provider/oauth.ts +285 -285
  276. package/src/provider/rent-node.ts +276 -275
  277. package/src/relay-addrs.ts +90 -12
  278. package/src/relay-reservation.ts +1 -1
  279. package/src/relay-server.ts +99 -98
  280. package/src/schema-verification.ts +38 -23
  281. package/src/sealed-party-key.ts +190 -190
  282. package/src/seed-bootstrap.ts +8 -11
  283. package/src/seed-trust-policy.ts +353 -353
  284. package/src/self-address-update.ts +19 -19
  285. package/src/strand-addr-protocol.ts +17 -14
  286. package/src/strand-app-schema-report.ts +147 -122
  287. package/src/strand-cohort.ts +1 -5
  288. package/src/strand-commit-durability.ts +165 -165
  289. package/src/strand-database.ts +522 -510
  290. package/src/strand-first-sync-gate.ts +3 -2
  291. package/src/strand-formation-deadlines.ts +227 -227
  292. package/src/strand-formation-manager.ts +731 -731
  293. package/src/strand-formation-protocol.ts +1174 -1138
  294. package/src/strand-fret-addrs.ts +179 -179
  295. package/src/strand-instance-manager.ts +381 -85
  296. package/src/strand-membership-reconciler.ts +1315 -1310
  297. package/src/strand-membership-writer.ts +2152 -2150
  298. package/src/strand-move.ts +1 -1
  299. package/src/strand-network-config.ts +16 -6
  300. package/src/strand-offline.ts +178 -178
  301. package/src/strand-party-key-rotation.ts +440 -436
  302. package/src/strand-party-machines.ts +308 -293
  303. package/src/strand-party-peers.ts +151 -129
  304. package/src/strand-peer-redial.ts +1 -1
  305. package/src/strand-reactivity.ts +36 -19
  306. package/src/strand-revocation-enforcer.ts +758 -758
  307. package/src/strand-wake-protocol.ts +406 -394
  308. package/src/strand-watcher.ts +1 -1
  309. package/src/table-change-watch.ts +285 -285
  310. package/src/timed-step.ts +28 -28
  311. package/src/timeout-scheduler.ts +29 -29
  312. package/src/trusted-owner-store.ts +242 -242
  313. package/src/types.ts +3182 -3112
  314. package/src/webrtc-upgrade.ts +439 -0
@@ -1,6 +1,6 @@
1
- import { CoordinatorPartialCommitError, SyncRetryExhaustedError, TornActionError } from '@optimystic/db-core';
1
+ import { CoordinatorPartialCommitError, PeersIncompleteError, SyncRetryExhaustedError, TornActionError } from '@optimystic/db-core';
2
2
  import { ConcurrentModificationError, PartialCommitError } from '@optimystic/quereus-plugin-optimystic';
3
- import { causeChain, chainMessages, reportsUnreachableCohort, retryControlOperation } from './control-retry.js';
3
+ import { causeChain, chainMessages, reportsUnansweredShortfall, reportsUnreachableCohort, retryControlOperation } from './control-retry.js';
4
4
  /**
5
5
  * Bounded retry for TRANSIENT control-write failures — the classifier and loop behind
6
6
  * `ControlDatabase.lockedWithRetry`, the single funnel every local control write passes
@@ -10,20 +10,21 @@ import { causeChain, chainMessages, reportsUnreachableCohort, retryControlOperat
10
10
  * three-machine party commits control writes unanimously (`ceil(3 × 0.75) = 3` approvals) —
11
11
  * and no `superMajorityThreshold` can lower that bar without violating Optimystic's
12
12
  * partition-safety condition at the shipped admission fraction (the arithmetic lives in
13
- * `docs/architecture.md` → "Replication cluster size"). Cadre therefore accepts unanimity
13
+ * `docs/cadre/control-replication.md` → "Replication cluster size"). Cadre therefore accepts unanimity
14
14
  * and absorbs the transient half of its cost here: a write that failed because the cohort
15
15
  * did not ANSWER (a stream reset mid-connection-formation, zero approvals) is re-presented
16
16
  * a moment later, which the degraded-cohort-member scenario measured as safe (a failed
17
17
  * write rolls back, nothing half-commits) and effective (the next write commits in ~1 s).
18
18
  *
19
19
  * A write somebody actually REJECTED is never retried on the strength of the rejection itself —
20
- * no matcher here claims a rejection message, at any phase, because re-presenting one would
21
- * re-present a spent signature against a cohort that already said no. Rejections are re-presented
22
- * anyway when they arrive inside the transactor's promise-phase `[block:` aggregate, which
23
- * {@link isUncommittedTransactorAggregate} claims on the WRAPPER alone, whatever the cause inside
24
- * says. Safe because nothing has committed at that phase, and deliberately kept — one of the
25
- * remaining promise-phase rejections is exactly the kind a re-presentation fixes. See the
26
- * accepted-tradeoff `NOTE:` there for which, and why no blanket rejection veto is wanted.
20
+ * nothing here claims a rejection, at any phase (the shortfall claim reads the vote count for
21
+ * exactly this reason), because re-presenting one would re-present a spent signature against a
22
+ * cohort that already said no. Rejections are re-presented anyway when they arrive inside the
23
+ * transactor's promise-phase aggregate, which {@link isUncommittedTransactorAggregate}
24
+ * claims on the PHASE alone, whatever the cause inside says. Safe because nothing has committed
25
+ * at that phase, and deliberately kept — one of the remaining promise-phase rejections is exactly
26
+ * the kind a re-presentation fixes. See the accepted-tradeoff `NOTE:` there for which, and why no
27
+ * blanket rejection veto is wanted.
27
28
  *
28
29
  * A failure that says some of the write may be STORED is a different matter, and never
29
30
  * re-presented whatever text it carries: {@link reportsPossiblyStoredWrite} vetoes it by type
@@ -86,8 +87,8 @@ export const SCHEMA_INIT_ATTEMPTS = 5;
86
87
  * (`cohortReadDeadlineMs` in `link-budget.ts`: 7 s at the default declared link, 5 s before it
87
88
  * was derived, 1 s at Optimystic's own default), so it still gets one retry inside this budget
88
89
  * where it once got two; an attempt that runs into the `ClusterClient` response deadline
89
- * (10.5 s at the default declared link) still gets none. See `docs/cadre-consistency.md` →
90
- * "Deadlines Over Optimystic's Reads and Commits".
90
+ * (10.5 s at the default declared link) still gets none. See `docs/network/deadlines.md` →
91
+ * "Deadlines over Optimystic's reads and commits".
91
92
  *
92
93
  * NOTE: a failed commit attempt also pays a cancel discharge before its error returns
93
94
  * (optimystic `TransactorSource.transact`'s catch) — bounded by six rounds and
@@ -105,7 +106,7 @@ export const SCHEMA_INIT_ATTEMPTS = 5;
105
106
  * condition to watch, not work to do: if that case ever starts failing with
106
107
  * `failed after 2/3 attempt(s)`, the cancel discharge is where the time went.
107
108
  */
108
- // eslint-disable-next-line no-restricted-syntax -- cuts off by design: it ends the retries of slow attempts rather than waiting them out; see docs/cadre-consistency.md → "Deadlines Over Optimystic's Reads and Commits"
109
+ // eslint-disable-next-line no-restricted-syntax -- cuts off by design: it ends the retries of slow attempts rather than waiting them out; see docs/network/deadlines.md → "Deadlines over Optimystic's reads and commits"
109
110
  export const CONTROL_WRITE_RETRY_BUDGET_MS = 10000;
110
111
  /**
111
112
  * Backoff before retry N, jittered ±50% (so the first sleep is 125–375 ms — the jitter can
@@ -135,51 +136,19 @@ const CONTROL_WRITE_RETRY_DELAYS_MS = [250, 1000];
135
136
  * ceiling rather than stretching to cover the full 30 s window.
136
137
  */
137
138
  const SCHEMA_INIT_RETRY_DELAYS_MS = [250, 500, 1000, 2000];
138
- /** The network transactor's aggregate, raised when some cohort peers gave no usable answer. */
139
- const TRANSACTOR_AGGREGATE = /Some peers did not complete:/;
140
139
  /**
141
- * How the aggregate's per-batch details name a SINGLE-block batch — the shape both the block
142
- * read (`get`) and phase 1 (`pend`) format, and the only shape safe to re-present.
143
- */
144
- const SINGLE_BLOCK_BATCH_TOKEN = '[block:';
145
- /**
146
- * How the aggregate's per-batch details name a MULTI-block batch — the shape phase 2
147
- * (`commitBlocks`) formats, and the marker of an outcome too indeterminate to retry.
148
- */
149
- const COMMIT_BATCH_TOKEN = '[blocks:';
150
- /**
151
- * The cluster coordinator's super-majority shortfall (`PromiseShortfallError`, db-core), matched
152
- * ONLY with a ZERO rejection count. The same message with a non-zero count means a member actually
153
- * voted no (that branch carries `membership-not-admitted` rejections), and retrying it would
154
- * re-present a spent signature to a cohort that already refused it. A pend's shortfall reaches this
155
- * funnel as that error on its own, before any commit, so re-presenting it is safe; a commit's
156
- * arrives inside the `[blocks:` aggregate, which {@link reportsIndeterminateCommit} vetoes (both
157
- * seen live in `control-write-degraded-cohort-member`).
158
- *
159
- * NOTE: matched by TEXT although the error is typed. Upstream keeps this sentence byte for byte as a
160
- * downstream contract, so the regex is stable; moving to `instanceof PromiseShortfallError` with
161
- * `rejections === 0` is backlog `debt-control-write-retry-matches-the-shortfall-by-type`.
162
- *
163
- * This regex itself never matches a decisive rejection (`ValidatorRejectionError`, `Transaction
164
- * rejected by validators`) — that text carries no `Failed to get super-majority:` prefix. But the
165
- * composite classifier is not this matcher alone: a rejection raised while promises are still
166
- * being collected reaches this repo wrapped in the transactor's `Some peers did not complete:
167
- * …[block:…]` aggregate, and {@link isUncommittedTransactorAggregate} matches that wrapper on its
168
- * own, whatever the cause inside it says — see the accepted-tradeoff `NOTE:` there.
169
- */
170
- const SUPER_MAJORITY_SHORTFALL_UNANSWERED = /Failed to get super-majority: \d+\/\d+ approvals \(needed \d+, 0 rejections\)/;
171
- /**
172
- * Is this a transactor aggregate from a phase where nothing can have committed yet?
140
+ * Does any link of the `cause` chain report a transactor aggregate from a phase where nothing can
141
+ * have committed yet?
173
142
  *
174
- * The transactor raises `Some peers did not complete:` from three sites
175
- * (`db-core/src/transactor/network-transactor.ts`), and only two of them are safe to
176
- * re-present:
143
+ * `NetworkTransactor` composes one `PeersIncompleteError` for all four of its operations and says
144
+ * which in `phase` (`db-core/src/transactor/peers-incomplete-error.ts`). Only two of the four are
145
+ * safe to re-present:
177
146
  *
178
147
  * - `get` (a block read, which a write body also performs) and `pend` (phase 1) fail before
179
148
  * anything commits, so the write is known not to have landed. `get` raises it only when a
180
149
  * coordinator answered and left a block out; a block nobody answered for fails typed
181
150
  * instead, which {@link matchesRetriableFailure} claims ({@link reportsUnreachableCohort});
182
- * - `commitBlocks` (phase 2) is REACHABLE here and NOT safe. `commitBlock` throws the
151
+ * - `commit` (phase 2) is REACHABLE here and NOT safe. `commitBlock` throws the
183
152
  * aggregate when a header/tail commit got NO response at all — precisely the transient
184
153
  * class this retry targets — and that escapes `commit()`, survives `TransactorSource`'s
185
154
  * cancel-and-rethrow (cancel reaches PENDING actions only; a peer that already committed
@@ -189,34 +158,23 @@ const SUPER_MAJORITY_SHORTFALL_UNANSWERED = /Failed to get super-majority: \d+\/
189
158
  * the commit may have completed with only the response lost. Re-running the write body over
190
159
  * a write that landed turns a success into a constraint failure (e.g.
191
160
  * `UNIQUE constraint failed: CadrePeer.PeerId`). Surfacing the transient error instead lets
192
- * the caller re-read committed state and decide. Commit-phase messages are vetoed by
193
- * {@link reportsIndeterminateCommit}, not here.
194
- *
195
- * The `cause` chain does not discriminate the phases — a commit-phase aggregate carries the
196
- * same stream-reset/dial error a pend-phase one does. The per-batch DETAIL text does: `get`
197
- * and `pend` format `<peerId>[block:<id>](<status>)`, `commitBlocks` formats
198
- * `<peerId>[blocks:<count>](<status>)`. `[block:` cannot occur inside `[blocks:`, so the two
199
- * tokens are disjoint and separate the phases.
200
- *
201
- * NOTE: the discriminator is a formatting detail of another repo. If Optimystic ever reformats
202
- * those per-batch details, this fails CLOSED — the aggregate stops matching and control writes
203
- * simply stop being retried, silently losing the absorption rather than doing anything unsafe.
204
- * The guard is `control-write-degraded-cohort-member.integration.ts`, which asserts the `[block:`
205
- * token on any live aggregate a degraded case produces; if it reddens there, an upstream reformat
206
- * is the first thing to check. NOTE: on Optimystic 1.20.0 none of its cases produced this form
207
- * (2026-10-28: the injected reset failed the write's read typed, and a pend's shortfall arrives on
208
- * its own), so the guard can pass without seeing it; if the form is ever needed live again, inject
209
- * the reset at the pend's batch rather than the read's.
210
- *
211
- * NOTE: the discriminator is the prefix AND the token within ONE message — never relax it to
212
- * "contains `[block:`". Beyond the `get` and `pend` sites above, Optimystic renders `[block:` in
213
- * one further place — a third formatter, outside the aggregate's three sites — `dischargeCancel`
214
- * (`Cancel of action <id> did not discharge <n> block(s): …`), which does not raise the
215
- * `Some peers did not complete:` prefix; only the conjunction keeps a cancel fault from
216
- * classifying as a retriable get/pend (checked against optimystic `c56c2bd4`, 2026-09-16).
161
+ * the caller re-read committed state and decide. The commit phase is vetoed by
162
+ * {@link reportsIndeterminateCommit}, not here;
163
+ * - `cancel` — a failed attempt's own cancel that could not discharge the pend it left behind —
164
+ * is neither claimed here nor vetoed there, so it falls through unmatched and is not retried.
165
+ * Per LINK, not per chain: a cancel aggregate carrying a `get`/`pend` one below it is still
166
+ * claimed on that lower link, which is right for the same reason the lower link alone is
167
+ * (nothing committed at either phase) and is what the text matcher this replaced also did.
168
+ *
169
+ * What still fails CLOSED is the error not arriving: a future wrapper that drops `cause` takes
170
+ * every link below it with it, so no typed claim matches and the write is simply not retried.
171
+ * `control-write-degraded-cohort-member.integration.ts` turns that into a red assertion on a live
172
+ * aggregate; NOTE: on Optimystic 1.20.0 none of its cases produced an aggregate at all (2026-10-28:
173
+ * the injected reset failed the write's read typed, and a pend's shortfall arrives on its own), so
174
+ * that guard can pass without ever seeing one.
217
175
  *
218
176
  * NOTE: accepted tradeoff — a REJECTION raised while promises are still being collected reaches
219
- * this repo wrapped in this same aggregate, and this matcher claims it on the wrapper alone,
177
+ * this repo wrapped in this same aggregate, and this matcher claims it on the phase alone,
220
178
  * whatever the cause inside says. That re-presents such a rejection up to two more times inside
221
179
  * the 10 s budget. Kept deliberately, and re-decided on 2026-09-17 against the current upstream
222
180
  * behaviour rather than inherited:
@@ -242,35 +200,47 @@ const SUPER_MAJORITY_SHORTFALL_UNANSWERED = /Failed to get super-majority: \d+\/
242
200
  *
243
201
  * Revisit if a re-presentation ever becomes expensive relative to what it buys — a rejection class
244
202
  * that costs a full cohort round-trip to re-present, or a write body whose reads are no longer
245
- * cheap — or when upstream offers a typed refusal surface to classify on instead of this text
246
- * (`../optimystic/tickets/backlog/debt-a-downstream-repo-classifies-retries-by-parsing-our-error-text`).
203
+ * cheap — or when upstream offers a typed refusal surface to classify the rejection itself on.
247
204
  * Contention is no longer the reason to revisit.
248
205
  *
249
- * An aggregate whose details came out EMPTY (possible when `formatBatchStatuses` has no
250
- * batches to format) carries neither token, matches nothing here, and is not retried — an
251
- * unattributable failure is not a proven non-commit.
206
+ * An aggregate whose per-peer details came out EMPTY (possible when `formatBatchStatuses` has no
207
+ * batches to format) is claimed like any other: `phase` is on the error whether or not a batch
208
+ * formatted, and `get`/`pend` is itself the proof that nothing committed.
252
209
  *
253
- * Exported for the READ classifier (`control-read-retry.ts`), which reuses it verbatim: a
254
- * `get` batch formats the same single-block `[block:` token, and a read can never produce
255
- * the commit-phase `[blocks:` shape at all.
210
+ * Exported for the READ classifier (`control-read-retry.ts`), which reuses it verbatim, `pend`
211
+ * included: a control read presents no transaction, so it cannot produce a `pend` aggregate at
212
+ * all — claiming that phase there is unreachable rather than unsafe, and one shared predicate is
213
+ * one thing to keep correct instead of two.
256
214
  */
257
- export function isUncommittedTransactorAggregate(message) {
258
- return TRANSACTOR_AGGREGATE.test(message) && message.includes(SINGLE_BLOCK_BATCH_TOKEN);
215
+ export function isUncommittedTransactorAggregate(links) {
216
+ return links.some(link => link instanceof PeersIncompleteError
217
+ && (link.phase === 'get' || link.phase === 'pend'));
259
218
  }
260
219
  /**
261
- * Does ANY message in the failure's `cause` chain describe a commit-phase batch — i.e. an
262
- * outcome nobody can call committed or not?
263
- *
264
- * Vetoes the whole chain rather than the one message carrying the token, and vetoes it
265
- * regardless of which matcher would otherwise have claimed it. The narrower per-message rule
266
- * would already catch every shape the transactor is known to build (a commit-phase aggregate
267
- * emits `[blocks:` for every batch it formats, and embeds its cause's message inline as
268
- * `root: …`, so both tokens land in one string) — but "known to build" is an argument about
269
- * another repo's error assembly, and this way an indeterminate commit anywhere in the chain
270
- * costs a retry we could have had instead of risking a re-run over a write that landed.
220
+ * Does any link of the failure's `cause` chain report a COMMIT-phase transactor aggregate — i.e.
221
+ * an outcome nobody can call committed or not?
222
+ *
223
+ * Vetoes the whole chain rather than the one link carrying the phase, and vetoes it regardless of
224
+ * which claim would otherwise have taken it: an indeterminate commit anywhere in the chain costs a
225
+ * retry we could have had instead of risking a re-run over a write that landed.
226
+ *
227
+ * Fails CLOSED in the only direction that matters: this veto and every TYPED claim the write
228
+ * classifier makes rest on the same `instanceof`, so a chain this cannot see (a wrapper that
229
+ * dropped `cause`, a second loaded copy of `@optimystic/db-core`) is a chain no typed claim can
230
+ * see either, and nothing is retried for the veto to have to stop.
231
+ *
232
+ * NOTE: that symmetry holds for every claim matched by type, which is all of them in the default
233
+ * and lost-update policies. Schema init adds one matched by TEXT
234
+ * ({@link isSelfCoordinationGraceRefusal}), and a commit aggregate raised OVER that refusal embeds
235
+ * it as the aggregate's own `; root: …` tail — so a chain that kept the text and lost the typed
236
+ * link would be claimed with this veto blind, where the text veto this replaced declined it. Fine
237
+ * today: every wrapper between the transactor and `applyControlSchema` passes the inner error as
238
+ * `cause` (Quereus' DDL, module-create and failed-apply wrappers all do). Revisit if one stops, or
239
+ * if the default policy ever grows a text matcher of its own — either way the veto then needs a
240
+ * text arm beside the typed one.
271
241
  */
272
- function reportsIndeterminateCommit(messages) {
273
- return messages.some(message => message.includes(COMMIT_BATCH_TOKEN));
242
+ function reportsIndeterminateCommit(links) {
243
+ return links.some(link => link instanceof PeersIncompleteError && link.phase === 'commit');
274
244
  }
275
245
  /**
276
246
  * Does any link of the `cause` chain say some of this write may be stored, or may still be?
@@ -285,13 +255,13 @@ function reportsIndeterminateCommit(messages) {
285
255
  * same transaction is already durable, and re-running the whole body would apply it twice.
286
256
  *
287
257
  * Every one of these embeds text from elsewhere in its message (a responder's refusal, the
288
- * underlying failure), which can carry the pend-phase aggregate's prefix and `[block:` token —
289
- * so this veto runs before any text matcher.
258
+ * underlying failure), and upstream may chain that failure on `cause` besides — so this veto runs
259
+ * before any claim.
290
260
  *
291
261
  * Matched by TYPE: each survives the bridge's and Quereus' rewraps on `cause`. An error built by a
292
262
  * second loaded copy of `@optimystic/db-core` (or of the plugin, for `PartialCommitError`) fails
293
- * `instanceof`, and then this veto does not fire — falling back to the text classifiers, which is
294
- * how these failures were classified before the veto existed. The asymmetry with
263
+ * `instanceof`, and then this veto does not fire — but neither does any claim against that same
264
+ * copy, so nothing is retried for it to have to stop. The asymmetry with
295
265
  * {@link isFinalTornWrite} is deliberate: there, a missed `instanceof` means no retry, which is the
296
266
  * safe side. No text fallback parses `TornActionError`'s closing sentence, since upstream says its
297
267
  * wording is for log lines only.
@@ -333,10 +303,6 @@ function reportsPossiblyStoredWrite(links) {
333
303
  function isFinalTornWrite(link) {
334
304
  return link instanceof TornActionError && link.final === true;
335
305
  }
336
- /** The coordinator's shortfall, raised pre-commit, with nobody having voted no. */
337
- function isUnansweredSuperMajorityShortfall(message) {
338
- return SUPER_MAJORITY_SHORTFALL_UNANSWERED.test(message);
339
- }
340
306
  /**
341
307
  * A LOST UPDATE: the optimystic bridge refusing a commit because another writer changed or
342
308
  * removed a row this statement read (`TransactionBridge.mapCommitRefusal` over a
@@ -382,8 +348,8 @@ function isLostUpdate(link) {
382
348
  * `cause`. It now rethrows through `rewrapAsQueryError`, which keeps `cause`
383
349
  * (`quereus-plugin-optimystic/src/optimystic-module.ts`); whether every Quereus wrapper above it on
384
350
  * the schema-init path keeps it too has not been checked, and the text still arrives either way.
385
- * Like every matcher here this fails CLOSED — a rewording upstream stops the retry engaging, it
386
- * never makes it unsafe.
351
+ * This matcher — the module's only one — fails CLOSED: a rewording upstream stops the retry
352
+ * engaging, it never makes it unsafe.
387
353
  */
388
354
  const SELF_COORDINATION_GRACE_REFUSAL = /Self-coordination blocked: grace-period-not-elapsed\. No coordinator available for key\./;
389
355
  /** Self-coordination refused because the node's last connection dropped moments ago. */
@@ -391,34 +357,42 @@ function isSelfCoordinationGraceRefusal(message) {
391
357
  return SELF_COORDINATION_GRACE_REFUSAL.test(message);
392
358
  }
393
359
  /**
394
- * The error messages that mean "the cohort did not answer AND nothing committed", and nothing
395
- * else. The observed one-shot failure was `registerSelf()` racing a connection still forming:
396
- * a read/pend-phase transactor aggregate with `cause=The stream has been reset`. When none of
397
- * the cohort answers the read at all, that failure arrives typed instead, and is claimed by
398
- * type in {@link matchesRetriableFailure} ({@link reportsUnreachableCohort}), not here.
399
- *
400
- * Deliberately NOT matched: every constraint / authorization failure
360
+ * The error messages the DEFAULT write policy claims: none. Every failure it re-presents is now
361
+ * claimed by TYPE in {@link matchesRetriableFailure} — the transactor's get/pend aggregate
362
+ * ({@link isUncommittedTransactorAggregate}), a block read the cohort could not answer
363
+ * ({@link reportsUnreachableCohort}), an unanswered super-majority shortfall
364
+ * ({@link reportsUnansweredShortfall}) and a final torn write ({@link isFinalTornWrite}) — and so
365
+ * are both vetoes.
366
+ *
367
+ * Kept empty rather than deleted for two reasons: it is what {@link RETRIABLE_SCHEMA_INIT_MATCHERS}
368
+ * spreads, so the "widened, not replaced" relation between the two policies stays expressed in
369
+ * code; and a future text matcher has one obvious home. The only text matcher left in this module
370
+ * is the schema-init self-coordination refusal, which comes from `@optimystic/db-p2p`, not from the
371
+ * transactor.
372
+ *
373
+ * Deliberately NOT matched, here or anywhere: every constraint / authorization failure
401
374
  * (`CHECK constraint failed:`, `UNIQUE constraint failed:`) — those reach the same funnel
402
375
  * and must be retried zero times: the cohort REFUSED the write, so re-presenting it
403
376
  * re-presents a spent signature and can never commit.
404
377
  */
405
- const RETRIABLE_CONTROL_WRITE_MATCHERS = [
406
- isUncommittedTransactorAggregate,
407
- isUnansweredSuperMajorityShortfall,
408
- ];
378
+ const RETRIABLE_CONTROL_WRITE_MATCHERS = [];
409
379
  /**
410
- * The above PLUS the self-coordination grace refusal — the classifier for schema init ONLY
411
- * ({@link SCHEMA_INIT_RETRY_POLICY}), deliberately not folded into the list above.
380
+ * The (currently empty) default list PLUS the self-coordination grace refusal — the classifier for
381
+ * schema init ONLY ({@link SCHEMA_INIT_RETRY_POLICY}), deliberately not folded into the list above.
412
382
  *
413
383
  * Why this class is safe HERE and not everywhere: a write refused at coordinator SELECTION never
414
384
  * reached a peer, so re-presenting it is a proven non-commit. But `findCoordinator` is also
415
385
  * reached from `NetworkTransactor.commitBlock` during PHASE 2 (`resolveCoordinator`,
416
386
  * `db-core/src/transactor/network-transactor.ts`), and `commit()` commits the header block before
417
387
  * the rest — so a general control write refused there can be refused AFTER something already
418
- * committed. Worse, that error carries no `[blocks:` batch token, so
419
- * {@link reportsIndeterminateCommit} would not veto it, and re-running an insert body over a write
420
- * that landed is exactly the `UNIQUE constraint failed: CadrePeer.PeerId` failure that veto exists
421
- * to prevent.
388
+ * committed. Worse, it is thrown from the batch assembly OUTSIDE the `try` that composes the
389
+ * commit-phase aggregate (`batchesForPayload`, `db-core/src/transactor/network-transactor.ts`), so
390
+ * it normally arrives with no aggregate around it at all and
391
+ * {@link reportsIndeterminateCommit} has nothing to veto on — and re-running an insert body over a
392
+ * write that landed is exactly the `UNIQUE constraint failed: CadrePeer.PeerId` failure that veto
393
+ * exists to prevent. (The one path where the veto does fire is the per-block retry's
394
+ * re-resolution inside `processBatches`, where such a throw becomes the commit aggregate's root
395
+ * cause.)
422
396
  *
423
397
  * Schema init does not have that problem: `apply schema` is a diff rather than a replay, and a
424
398
  * failed apply is taken back whole — Quereus unwinds every step it ran and verifies the catalog
@@ -450,25 +424,23 @@ const RETRIABLE_SCHEMA_INIT_MATCHERS = [
450
424
  * Did this control write fail because the cluster cohort did not ANSWER — i.e. is
451
425
  * re-presenting the SAME signed write a moment later the right response?
452
426
  *
453
- * Classifies the transient cases by MESSAGE, walking the `cause` chain with the shared
454
- * {@link chainMessages} (Quereus' own `unwrapError` underneath) — the transactor and the
455
- * coordinator both throw bare `Error`s, not recognisable by type. By the time one reaches
427
+ * Classifies entirely by TYPE, over the `cause` chain — by the time a failure reaches
456
428
  * `ControlDatabase` it is wrapped in a `QuereusError` (the real chain is `QuereusError` → `Error`
457
- * → `Error`), so the match must work at any depth. Anything that is not an `Error` is never
458
- * retried.
459
- *
460
- * Two vetoes run over the whole chain before any matcher: {@link reportsPossiblyStoredWrite}
461
- * (by type — a spent sync budget, a non-final torn write, a partial commit) and
462
- * {@link reportsIndeterminateCommit} (by text — a commit-phase batch). A chain either veto flags,
463
- * at any level, is never retried on the strength of some other level looking transient. Two typed
464
- * failures are claimed as retriable: a block read the cohort could not answer
465
- * ({@link reportsUnreachableCohort}, shared with the read classifier) and a final torn write
466
- * ({@link isFinalTornWrite}).
467
- *
468
- * NOTE: this depends on engine/transactor error TEXT. The messages producible without a
469
- * network are driven from the REAL engine in `control-formation-seat-budget.spec.ts`, so
470
- * a rewording reddens a spec rather than silently disabling the retry. The RETRIABLE failures
471
- * need a real multi-node cluster to produce; the degraded-cohort scenario
429
+ * → `Error`), so every claim and veto must work at any depth. Anything that is not an `Error` is
430
+ * never retried.
431
+ *
432
+ * Two vetoes run over the whole chain before any claim: {@link reportsPossiblyStoredWrite}
433
+ * (a spent sync budget, a non-final torn write, a partial commit) and
434
+ * {@link reportsIndeterminateCommit} (a commit-phase transactor aggregate). A chain either veto
435
+ * flags, at any level, is never retried on the strength of some other level looking transient.
436
+ * Four failures are claimed as retriable: the transactor's get/pend aggregate
437
+ * ({@link isUncommittedTransactorAggregate}, shared with the read classifier), a block read the
438
+ * cohort could not answer ({@link reportsUnreachableCohort}, also shared with it), an unanswered
439
+ * super-majority shortfall ({@link reportsUnansweredShortfall}, shared with the edge node's
440
+ * `retryAfterRestart`) and a final torn write ({@link isFinalTornWrite}).
441
+ *
442
+ * The RETRIABLE failures need a real multi-node cluster to produce, so the unit cases build the
443
+ * upstream classes directly; the degraded-cohort scenario
472
444
  * (`control-write-degraded-cohort-member.integration.ts`) asserts this classifier against the
473
445
  * super-majority shortfall from a real silent member, and absorbs a real stream reset end to end
474
446
  * (on Optimystic 1.20.0 the reset fails the write's read as an unanswered block, claimed by type).
@@ -499,41 +471,45 @@ export function isRetriableLostUpdateFailure(error) {
499
471
  /**
500
472
  * Shared body of the three classifiers: walk the `cause` chain, let
501
473
  * {@link reportsPossiblyStoredWrite} and then {@link reportsIndeterminateCommit} veto it, then claim
502
- * a block read the cohort could not answer ({@link reportsUnreachableCohort}), a final torn write
474
+ * a get/pend transactor aggregate ({@link isUncommittedTransactorAggregate}), a block read the
475
+ * cohort could not answer ({@link reportsUnreachableCohort}), an unanswered
476
+ * super-majority shortfall ({@link reportsUnansweredShortfall}), a final torn write
503
477
  * ({@link isFinalTornWrite}) or any link `claimsLink` names, then ask `matchers`. The vetoes run
504
478
  * BEFORE any claim for every policy — a chain reporting a possibly-stored write or a commit-phase
505
479
  * batch is never retried, however transient some other level looks, and a final torn write or a
506
480
  * lost update carried by a partial commit is still declined because a sibling collection landed.
507
481
  * `claimsLink` is the one typed claim a policy may add; it sits here beside the shared typed claims
508
482
  * so the vetoes stay in one place above all of them.
483
+ *
484
+ * The three shared typed claims are predicates over the WHOLE chain and the policy's own is per
485
+ * link, which is why the one `some` below carries only the latter. The shortfall claim being shared
486
+ * with the edge node is what keeps the two write policies from drifting on it; where a shortfall
487
+ * leaves the write is still decided here, by the commit-phase veto above.
509
488
  */
510
489
  function matchesRetriableFailure(error, matchers, claimsLink) {
511
490
  if (!(error instanceof Error)) {
512
491
  return false;
513
492
  }
514
493
  const links = causeChain(error);
515
- if (reportsPossiblyStoredWrite(links)) {
516
- return false;
517
- }
518
- const messages = chainMessages(error);
519
- if (reportsIndeterminateCommit(messages)) {
494
+ if (reportsPossiblyStoredWrite(links) || reportsIndeterminateCommit(links)) {
520
495
  return false;
521
496
  }
522
497
  // NOTE: an unanswered read can fail AFTER this write's log entry is stored: the refresh between
523
498
  // commit attempts reads the collection's log ends, and finishing the write's own entry
524
499
  // (`Collection.completeOwnEntry`) asks `getStatus` when no attempt is retained at the entry's
525
500
  // revision (a forked lineage — both commit paths retain the failed attempt before refreshing).
526
- // Either throw escapes the refresh loop unwrapped. Claimed anyway, because the `[block:`
527
- // aggregate those same reads raise is already claimed by the text matcher, so the typed form
528
- // adds no new case: the re-run is a new transaction whose body re-reads the blocks, so it diffs
529
- // to nothing or fails on `UNIQUE` where the earlier write landed, and writes it once where it did
530
- // not. A refresh that already saved a sibling collection arrives as
531
- // `CoordinatorPartialCommitError`, which the veto above declines.
532
- if (reportsUnreachableCohort(links)
501
+ // Either throw escapes the refresh loop unwrapped. Claimed anyway, because the get/pend
502
+ // aggregate those same reads raise is already claimed beside it, so this adds no new case: the
503
+ // re-run is a new transaction whose body re-reads the blocks, so it diffs to nothing or fails on
504
+ // `UNIQUE` where the earlier write landed, and writes it once where it did not. A refresh that
505
+ // already saved a sibling collection arrives as `CoordinatorPartialCommitError`, which the veto
506
+ // above declines.
507
+ if (isUncommittedTransactorAggregate(links) || reportsUnreachableCohort(links)
508
+ || reportsUnansweredShortfall(links)
533
509
  || links.some(link => isFinalTornWrite(link) || claimsLink?.(link) === true)) {
534
510
  return true;
535
511
  }
536
- return messages.some(message => matchers.some(matches => matches(message)));
512
+ return chainMessages(error).some(message => matchers.some(matches => matches(message)));
537
513
  }
538
514
  /**
539
515
  * The schema-init policy: `ControlDatabase.applyControlSchema`'s distributed DDL, which
@@ -1 +1 @@
1
- {"version":3,"file":"control-write-retry.js","sourceRoot":"","sources":["../src/control-write-retry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC9G,OAAO,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AACxG,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGhH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAExC;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;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10
  *
11
- * The resolution (docs/strands.md → "Relay willingness"): a party control
11
+ * The resolution (docs/network/relay.md → "Who a relay is willing to serve"): a party control
12
12
  * node running a relay is party-private infrastructure — it relays for its own
13
13
  * party's nodes, including the extra transport identities its members' strand
14
14
  * nodes run as. The mechanism is a **member-announced delegate grant**: before
@@ -8,7 +8,7 @@
8
8
  * including a co-cadre relay — can recompute it: a sibling's relay sees an
9
9
  * unknown peerId it has no way to place as a member.
10
10
  *
11
- * The resolution (docs/strands.md → "Relay willingness"): a party control
11
+ * The resolution (docs/network/relay.md → "Who a relay is willing to serve"): a party control
12
12
  * node running a relay is party-private infrastructure — it relays for its own
13
13
  * party's nodes, including the extra transport identities its members' strand
14
14
  * nodes run as. The mechanism is a **member-announced delegate grant**: before
@@ -35,7 +35,8 @@ export interface EdgeNodeConfigInputs extends EdgeNodeOptions {
35
35
  transports: Libp2pTransports;
36
36
  /**
37
37
  * Listen addresses besides the bare `/p2p-circuit` entry cadre-core adds for a named relay.
38
- * Default `[]`: an edge device accepts no inbound connection. See `EdgeNodePlatform.listenAddrs`.
38
+ * Default `[]`: an edge device accepts no inbound connection over a socket-bound transport. An
39
+ * app carrying WebRTC names `/webrtc` here. See `EdgeNodePlatform.listenAddrs`.
39
40
  */
40
41
  listenAddrs?: string[];
41
42
  /** See `EdgeNodePlatform.allowPrivateDial`. */
@@ -46,7 +47,7 @@ export interface EdgeNodeConfigInputs extends EdgeNodeOptions {
46
47
  strandNetworkStateStore: StrandNetworkStateStore;
47
48
  }
48
49
  /**
49
- * The edge node's config: transaction profile (Ring Zulu only, intermittent connectivity), no
50
+ * The edge node's config: the `'device'` node class (Ring Zulu only, intermittent connectivity), no
50
51
  * listen address unless the platform names one, reachability through the configured relays (if
51
52
  * any) but never a hard requirement for one, every strand the control network lists, and no
52
53
  * automatic hibernation (the app's lifecycle runner hibernates on background), and offline mode
@@ -66,7 +67,7 @@ export type OwnerGenesisResult = 'enrolled' | 'member' | 'failed' | 'timed-out';
66
67
  * Default bound on {@link runOwnerGenesis} and {@link wireJoinedOwnerKey}: what a start can wait
67
68
  * for its owner step, which runs control reads and one control write, before it goes on without
68
69
  * it. Not derived from the link, since a start that waited out a stalled write (about 84 s, see
69
- * `docs/cadre-consistency.md`) would be a start the user gave up on.
70
+ * `docs/network/deadlines.md`) would be a start the user gave up on.
70
71
  */
71
72
  export declare const DEFAULT_OWNER_GENESIS_TIMEOUT_MS = 60000;
72
73
  /** Default `EdgeNodeOptions.ownerKeyLabel`: the founding owner key's name on its `OwnerKey` row. */
@@ -6,7 +6,7 @@ import { DEFAULT_IDENTITY_KEY_ID } from '../key-store.js';
6
6
  import { createOwnerKey, loadOwnerSigner } from '../owner-key-store.js';
7
7
  import { OWNER_KEY_MAX_LABEL } from '../owner-key-export.js';
8
8
  /**
9
- * The edge node's config: transaction profile (Ring Zulu only, intermittent connectivity), no
9
+ * The edge node's config: the `'device'` node class (Ring Zulu only, intermittent connectivity), no
10
10
  * listen address unless the platform names one, reachability through the configured relays (if
11
11
  * any) but never a hard requirement for one, every strand the control network lists, and no
12
12
  * automatic hibernation (the app's lifecycle runner hibernates on background), and offline mode
@@ -24,17 +24,19 @@ export function buildEdgeNodeConfig(inputs) {
24
24
  partyId: inputs.partyId,
25
25
  bootstrapNodes: inputs.bootstrapAddrs,
26
26
  },
27
- profile: 'transaction',
27
+ nodeClass: 'device',
28
28
  storage: {
29
29
  provider: inputs.storageProvider,
30
30
  },
31
31
  network: {
32
32
  transports: inputs.transports,
33
- // An edge device accepts no inbound connection, so by default it listens on nothing:
34
- // the only address it ever has is the `/p2p-circuit` address a relay reservation earns
35
- // it. An explicitly empty `listenAddrs` stays empty through cadre-core's derivation, and
36
- // naming a relay adds the bare `/p2p-circuit` search entry to it
37
- // (`cadre-core/src/relay-addrs.ts` → `resolveListenAddrs`). A browser adds `/webrtc`.
33
+ // An edge device binds no socket, so by default it listens on nothing: the only address
34
+ // it then has is the `/p2p-circuit` address a relay reservation earns it. An explicitly
35
+ // empty `listenAddrs` stays empty through cadre-core's derivation, and naming a relay
36
+ // adds the bare `/p2p-circuit` search entry to it
37
+ // (`cadre-core/src/relay-addrs.ts` → `resolveListenAddrs`). An app whose transports carry
38
+ // WebRTC — a browser tab or a phone — adds `/webrtc` when it has a relay
39
+ // (`webrtcListenAddrs`), so a peer can open a direct connection to it.
38
40
  listenAddrs: inputs.listenAddrs ?? [],
39
41
  // Through this config field rather than `CadreNode.reserveRelays()`, which reaches the
40
42
  // control node only: formation has the invitee dial the control node and then the strand
@@ -77,9 +79,9 @@ export function buildEdgeNodeConfig(inputs) {
77
79
  * Default bound on {@link runOwnerGenesis} and {@link wireJoinedOwnerKey}: what a start can wait
78
80
  * for its owner step, which runs control reads and one control write, before it goes on without
79
81
  * it. Not derived from the link, since a start that waited out a stalled write (about 84 s, see
80
- * `docs/cadre-consistency.md`) would be a start the user gave up on.
82
+ * `docs/network/deadlines.md`) would be a start the user gave up on.
81
83
  */
82
- // eslint-disable-next-line no-restricted-syntax -- cuts off by design: a start goes on without its owner step rather than wait out a stalled control write; see docs/cadre-consistency.md → "Deadlines Over Optimystic's Reads and Commits"
84
+ // eslint-disable-next-line no-restricted-syntax -- cuts off by design: a start goes on without its owner step rather than wait out a stalled control write; see docs/network/deadlines.md → "Deadlines over Optimystic's reads and commits"
83
85
  export const DEFAULT_OWNER_GENESIS_TIMEOUT_MS = 60000;
84
86
  /** Default `EdgeNodeOptions.ownerKeyLabel`: the founding owner key's name on its `OwnerKey` row. */
85
87
  export const DEFAULT_OWNER_KEY_LABEL = 'phone';
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/edge-node/config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAiB,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AA8C7D;;;;;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