@optimystic/db-core 1.0.0-beta.3 → 1.1.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 (171) hide show
  1. package/dist/src/cluster/structs.d.ts +30 -6
  2. package/dist/src/cluster/structs.d.ts.map +1 -1
  3. package/dist/src/cluster/structs.js +5 -3
  4. package/dist/src/cluster/structs.js.map +1 -1
  5. package/dist/src/cohort-topic/antidos/bootstrap-evidence-envelope.d.ts +2 -1
  6. package/dist/src/cohort-topic/antidos/bootstrap-evidence-envelope.d.ts.map +1 -1
  7. package/dist/src/cohort-topic/antidos/bootstrap-evidence-envelope.js +10 -3
  8. package/dist/src/cohort-topic/antidos/bootstrap-evidence-envelope.js.map +1 -1
  9. package/dist/src/cohort-topic/wire/codec.d.ts.map +1 -1
  10. package/dist/src/cohort-topic/wire/codec.js +8 -2
  11. package/dist/src/cohort-topic/wire/codec.js.map +1 -1
  12. package/dist/src/collection/collection.d.ts +439 -34
  13. package/dist/src/collection/collection.d.ts.map +1 -1
  14. package/dist/src/collection/collection.js +843 -148
  15. package/dist/src/collection/collection.js.map +1 -1
  16. package/dist/src/collection/struct.d.ts +109 -4
  17. package/dist/src/collection/struct.d.ts.map +1 -1
  18. package/dist/src/collection/struct.js +88 -1
  19. package/dist/src/collection/struct.js.map +1 -1
  20. package/dist/src/collections/diary/diary.d.ts +6 -2
  21. package/dist/src/collections/diary/diary.d.ts.map +1 -1
  22. package/dist/src/collections/diary/diary.js +5 -2
  23. package/dist/src/collections/diary/diary.js.map +1 -1
  24. package/dist/src/collections/tree/struct.d.ts +124 -16
  25. package/dist/src/collections/tree/struct.d.ts.map +1 -1
  26. package/dist/src/collections/tree/struct.js +86 -11
  27. package/dist/src/collections/tree/struct.js.map +1 -1
  28. package/dist/src/collections/tree/tree.d.ts +13 -3
  29. package/dist/src/collections/tree/tree.d.ts.map +1 -1
  30. package/dist/src/collections/tree/tree.js +106 -40
  31. package/dist/src/collections/tree/tree.js.map +1 -1
  32. package/dist/src/index.d.ts +1 -1
  33. package/dist/src/index.d.ts.map +1 -1
  34. package/dist/src/index.js +1 -1
  35. package/dist/src/index.js.map +1 -1
  36. package/dist/src/matchmaking/wire.d.ts.map +1 -1
  37. package/dist/src/matchmaking/wire.js +8 -2
  38. package/dist/src/matchmaking/wire.js.map +1 -1
  39. package/dist/src/network/durability.d.ts +45 -0
  40. package/dist/src/network/durability.d.ts.map +1 -0
  41. package/dist/src/network/durability.js +114 -0
  42. package/dist/src/network/durability.js.map +1 -0
  43. package/dist/src/network/i-key-network.d.ts +14 -6
  44. package/dist/src/network/i-key-network.d.ts.map +1 -1
  45. package/dist/src/network/index.d.ts +3 -0
  46. package/dist/src/network/index.d.ts.map +1 -1
  47. package/dist/src/network/index.js +3 -0
  48. package/dist/src/network/index.js.map +1 -1
  49. package/dist/src/network/lineage.d.ts +39 -0
  50. package/dist/src/network/lineage.d.ts.map +1 -0
  51. package/dist/src/network/lineage.js +61 -0
  52. package/dist/src/network/lineage.js.map +1 -0
  53. package/dist/src/network/routing-key.d.ts +24 -0
  54. package/dist/src/network/routing-key.d.ts.map +1 -0
  55. package/dist/src/network/routing-key.js +9 -0
  56. package/dist/src/network/routing-key.js.map +1 -0
  57. package/dist/src/network/stale-failure.d.ts +5 -1
  58. package/dist/src/network/stale-failure.d.ts.map +1 -1
  59. package/dist/src/network/stale-failure.js +5 -1
  60. package/dist/src/network/stale-failure.js.map +1 -1
  61. package/dist/src/network/struct.d.ts +151 -8
  62. package/dist/src/network/struct.d.ts.map +1 -1
  63. package/dist/src/network/struct.js.map +1 -1
  64. package/dist/src/reactivity/wire.d.ts.map +1 -1
  65. package/dist/src/reactivity/wire.js +8 -2
  66. package/dist/src/reactivity/wire.js.map +1 -1
  67. package/dist/src/testing/test-transactor.d.ts +64 -7
  68. package/dist/src/testing/test-transactor.d.ts.map +1 -1
  69. package/dist/src/testing/test-transactor.js +150 -23
  70. package/dist/src/testing/test-transactor.js.map +1 -1
  71. package/dist/src/transaction/coordinator.d.ts +141 -21
  72. package/dist/src/transaction/coordinator.d.ts.map +1 -1
  73. package/dist/src/transaction/coordinator.js +408 -122
  74. package/dist/src/transaction/coordinator.js.map +1 -1
  75. package/dist/src/transaction/errors.d.ts +39 -10
  76. package/dist/src/transaction/errors.d.ts.map +1 -1
  77. package/dist/src/transaction/errors.js +34 -9
  78. package/dist/src/transaction/errors.js.map +1 -1
  79. package/dist/src/transaction/index.d.ts +1 -0
  80. package/dist/src/transaction/index.d.ts.map +1 -1
  81. package/dist/src/transaction/index.js.map +1 -1
  82. package/dist/src/transactor/block-floors.d.ts +78 -0
  83. package/dist/src/transactor/block-floors.d.ts.map +1 -0
  84. package/dist/src/transactor/block-floors.js +62 -0
  85. package/dist/src/transactor/block-floors.js.map +1 -0
  86. package/dist/src/transactor/change-notifier.d.ts +43 -0
  87. package/dist/src/transactor/change-notifier.d.ts.map +1 -1
  88. package/dist/src/transactor/change-notifier.js +3 -0
  89. package/dist/src/transactor/change-notifier.js.map +1 -1
  90. package/dist/src/transactor/index.d.ts +1 -0
  91. package/dist/src/transactor/index.d.ts.map +1 -1
  92. package/dist/src/transactor/index.js +1 -0
  93. package/dist/src/transactor/index.js.map +1 -1
  94. package/dist/src/transactor/network-transactor.d.ts +43 -6
  95. package/dist/src/transactor/network-transactor.d.ts.map +1 -1
  96. package/dist/src/transactor/network-transactor.js +279 -86
  97. package/dist/src/transactor/network-transactor.js.map +1 -1
  98. package/dist/src/transactor/transactor-source.d.ts +94 -4
  99. package/dist/src/transactor/transactor-source.d.ts.map +1 -1
  100. package/dist/src/transactor/transactor-source.js +120 -42
  101. package/dist/src/transactor/transactor-source.js.map +1 -1
  102. package/dist/src/transactor/transactor.d.ts +14 -1
  103. package/dist/src/transactor/transactor.d.ts.map +1 -1
  104. package/dist/src/transform/atomic.d.ts.map +1 -1
  105. package/dist/src/transform/atomic.js +12 -9
  106. package/dist/src/transform/atomic.js.map +1 -1
  107. package/dist/src/transform/base-pins.d.ts +50 -17
  108. package/dist/src/transform/base-pins.d.ts.map +1 -1
  109. package/dist/src/transform/base-pins.js +58 -11
  110. package/dist/src/transform/base-pins.js.map +1 -1
  111. package/dist/src/transform/cache-source.d.ts +75 -11
  112. package/dist/src/transform/cache-source.d.ts.map +1 -1
  113. package/dist/src/transform/cache-source.js +162 -36
  114. package/dist/src/transform/cache-source.js.map +1 -1
  115. package/dist/src/transform/digest.d.ts +8 -1
  116. package/dist/src/transform/digest.d.ts.map +1 -1
  117. package/dist/src/transform/digest.js +19 -9
  118. package/dist/src/transform/digest.js.map +1 -1
  119. package/dist/src/transform/helpers.d.ts +6 -2
  120. package/dist/src/transform/helpers.d.ts.map +1 -1
  121. package/dist/src/transform/helpers.js +8 -3
  122. package/dist/src/transform/helpers.js.map +1 -1
  123. package/dist/src/transform/tracker.d.ts +94 -14
  124. package/dist/src/transform/tracker.d.ts.map +1 -1
  125. package/dist/src/transform/tracker.js +222 -68
  126. package/dist/src/transform/tracker.js.map +1 -1
  127. package/dist/src/utility/structural-equals.d.ts +38 -0
  128. package/dist/src/utility/structural-equals.d.ts.map +1 -0
  129. package/dist/src/utility/structural-equals.js +77 -0
  130. package/dist/src/utility/structural-equals.js.map +1 -0
  131. package/package.json +2 -2
  132. package/src/cluster/structs.ts +28 -7
  133. package/src/cohort-topic/antidos/bootstrap-evidence-envelope.ts +260 -253
  134. package/src/cohort-topic/wire/codec.ts +222 -216
  135. package/src/collection/collection.ts +960 -157
  136. package/src/collection/struct.ts +99 -4
  137. package/src/collections/diary/diary.ts +71 -68
  138. package/src/collections/tree/struct.ts +155 -23
  139. package/src/collections/tree/tree.ts +127 -40
  140. package/src/index.ts +1 -1
  141. package/src/matchmaking/wire.ts +8 -2
  142. package/src/network/durability.ts +123 -0
  143. package/src/network/i-key-network.ts +60 -52
  144. package/src/network/index.ts +10 -7
  145. package/src/network/lineage.ts +80 -0
  146. package/src/network/routing-key.ts +27 -0
  147. package/src/network/stale-failure.ts +5 -1
  148. package/src/network/struct.ts +156 -8
  149. package/src/reactivity/wire.ts +230 -224
  150. package/src/testing/test-transactor.ts +152 -24
  151. package/src/transaction/coordinator.ts +470 -131
  152. package/src/transaction/errors.ts +34 -9
  153. package/src/transaction/index.ts +1 -0
  154. package/src/transactor/block-floors.ts +105 -0
  155. package/src/transactor/change-notifier.ts +129 -80
  156. package/src/transactor/index.ts +1 -0
  157. package/src/transactor/network-transactor.ts +297 -89
  158. package/src/transactor/transactor-source.ts +131 -42
  159. package/src/transactor/transactor.ts +13 -1
  160. package/src/transform/atomic.ts +25 -22
  161. package/src/transform/base-pins.ts +76 -18
  162. package/src/transform/cache-source.ts +327 -194
  163. package/src/transform/digest.ts +21 -10
  164. package/src/transform/helpers.ts +8 -3
  165. package/src/transform/tracker.ts +423 -270
  166. package/src/utility/structural-equals.ts +72 -0
  167. package/dist/src/utility/block-id-to-bytes.d.ts +0 -3
  168. package/dist/src/utility/block-id-to-bytes.d.ts.map +0 -1
  169. package/dist/src/utility/block-id-to-bytes.js +0 -7
  170. package/dist/src/utility/block-id-to-bytes.js.map +0 -1
  171. package/src/utility/block-id-to-bytes.ts +0 -8
@@ -2,6 +2,25 @@ import type { ITransactor, CollectionId, Transforms } from "../index.js";
2
2
  import type { Transaction, ExecutionResult, ITransactionEngine, CollectionActions, ReadDependency } from "./transaction.js";
3
3
  import type { Collection } from "../collection/collection.js";
4
4
  import type { SyncOptions } from "../collection/index.js";
5
+ /**
6
+ * What a pend this coordinator sends carries for the receiving cluster members to re-check.
7
+ *
8
+ * - `'transaction'` (default): the transaction and the hash of every operation it produced — the
9
+ * session-mode shape. A member with a transaction validator re-executes the statements and
10
+ * compares hashes; the aged retry priority rides inside the transaction.
11
+ * - `'none'`: bare transforms, exactly the shape a single-collection `Collection.sync` pend has.
12
+ * For a commit that has no statements to re-execute — the Quereus adapter's legacy multi-tree
13
+ * commit, whose rows were staged directly into the trees — a validating member would otherwise
14
+ * refuse the pend as a validator fault. The aged priority then rides on the pend itself
15
+ * (`PendRequest.priority`), which is the other carrier a member's race resolution reads, so a
16
+ * repeatedly-losing commit still ages. Members configured `unvalidatablePendPolicy: 'reject'`
17
+ * refuse these pends, as they refuse every unvalidatable pend.
18
+ */
19
+ export type PendValidationMode = 'transaction' | 'none';
20
+ export interface CoordinatorOptions {
21
+ /** See {@link PendValidationMode}. Default `'transaction'`. */
22
+ pendValidation?: PendValidationMode;
23
+ }
5
24
  /**
6
25
  * Coordinates multi-collection transactions.
7
26
  *
@@ -50,7 +69,19 @@ export declare class TransactionCoordinator {
50
69
  * appears in `this.collections` (see {@link captureUncaptured}), so a collection registered
51
70
  * mid-transaction is still captured before anything stages into it. */
52
71
  private stampData;
53
- constructor(transactor: ITransactor, collections: Map<CollectionId, Collection<any>>);
72
+ /** See {@link PendValidationMode}; fixed for the coordinator's lifetime, so every pend it
73
+ * sends has one shape. */
74
+ private readonly pendValidation;
75
+ constructor(transactor: ITransactor, collections: Map<CollectionId, Collection<any>>, options?: CoordinatorOptions);
76
+ /**
77
+ * The validation pair every pend of this attempt carries, or `undefined` when this coordinator
78
+ * sends unvalidated pends (see {@link PendValidationMode}). Built once per attempt, AFTER the
79
+ * log append: the hash covers ALL operations across ALL collections, which a validator
80
+ * recomputes from its own re-execution and compares. The shared operations-hash module
81
+ * canonicalises (sort + canonical JSON), so the fingerprint is order-independent. Skipped
82
+ * entirely — not computed and discarded — when no pend will carry it.
83
+ */
84
+ private pendValidationFor;
54
85
  /**
55
86
  * Apply actions to collections (called by engines during statement execution).
56
87
  *
@@ -110,30 +141,110 @@ export declare class TransactionCoordinator {
110
141
  /**
111
142
  * Commit a transaction with a bounded, jittered backoff retry around a CLEAN stale loss.
112
143
  *
113
- * The single-attempt work lives in {@link commitOnce}; this wrapper re-drives it when the attempt
114
- * fails as a clean optimistic-concurrency loss ({@link CoordinatorStaleLossError} — nothing
115
- * durably committed, every tracker restored to its pre-append state). Before each re-attempt it
116
- * re-reads each collection to fresh revisions (so the retry pends against current state rather
117
- * than immediately re-failing stale), then backs off with the same jitter policy as
144
+ * The single-attempt work lives in {@link commitOnce}; {@link commitAttempts} re-drives it when
145
+ * the attempt fails as a clean optimistic-concurrency loss ({@link CoordinatorStaleLossError} —
146
+ * nothing durably committed, every tracker restored to its pre-append state). Before each
147
+ * re-attempt it re-reads each collection to fresh revisions (so the retry pends against current
148
+ * state rather than immediately re-failing stale), then backs off with the same jitter policy as
118
149
  * {@link Collection.sync}. Retry is bounded by `maxAttempts` and an optional wall-clock
119
150
  * `deadlineMs`, and honours an abort `signal`.
120
151
  *
121
- * A {@link CoordinatorPartialCommitError} (a partial landing — some collection durably committed)
122
- * is NOT retryable and escapes immediately: blindly retrying would re-log already-durable actions.
123
- * Any other failure (expired transaction, unavailable transactor, unreachable cluster) also
124
- * propagates without retry only genuine clean stale losses are re-driven.
152
+ * A PARTIAL landing — some collection durably committed while a sibling's commit was refused —
153
+ * is re-driven too when every refusal was a returned one (a member behind on the block's base,
154
+ * a rival that took the revision slot): the committed collections are recorded as saved and the
155
+ * next attempt commits only what is still staged, so the durable half is never re-logged and the
156
+ * refused collection gets the same refresh-and-finish recovery a clean loss gets. A caller must
157
+ * still never re-drive a partial landing itself. A partial landing on a HARD failure (the
158
+ * transport budget spent, a structural rejection) escapes at once as
159
+ * {@link CoordinatorPartialCommitError}, and any other failure (expired transaction,
160
+ * unavailable transactor, unreachable cluster) also propagates without retry.
161
+ *
162
+ * A participant can also be SAVED between attempts: an attempt that reported a loss may still
163
+ * have stored that participant's log tail, and the refresh before the next attempt then finishes
164
+ * and consumes the participant's own entry (see {@link refreshBetweenAttempts}). From that moment
165
+ * the commit can no longer fail cleanly, so EVERY failure that escapes afterwards — a torn sibling,
166
+ * a sibling that keeps losing until the budget runs out, an abort, an expiry, a hard error — is
167
+ * rethrown as {@link CoordinatorPartialCommitError}, counting the refresh-saved participants as
168
+ * committed and carrying the original error as its `reason` (see {@link reportSaved}). A commit in
169
+ * which nothing was saved fails with exactly the error it failed with.
125
170
  *
126
171
  * Defaults are safe out of the box: a caller that passes no options gets bounded, jittered retry.
127
172
  *
173
+ * NOTE: this returns nothing, so a multi-collection commit reports NO durability — unlike
174
+ * `Collection.sync`, which now answers with the {@link WriteDurability} of what it committed. The
175
+ * gap is deliberate and tracked in `tickets/backlog/feat-multi-collection-commit-reports-durability.md`:
176
+ * folding a class across collections that may individually have committed or been dropped (see
177
+ * {@link CoordinatorPartialCommitError}) is its own design problem, not a pass-through. Until that
178
+ * lands, a caller that needs to know whether a write is fully held has to use the single-collection
179
+ * path; do not infer one here from a plain successful return.
180
+ *
128
181
  * @param transaction - The transaction to commit
129
182
  * @param options - Retry knobs; shares the {@link SyncOptions} vocabulary with `Collection.sync`.
130
183
  */
131
184
  commit(transaction: Transaction, options?: SyncOptions): Promise<void>;
185
+ /** The retry loop behind {@link commit}: every attempt, and the refresh between them. Records
186
+ * what it learns in `cycle`; {@link commit} owns turning a failure into the right report. */
187
+ private commitAttempts;
188
+ /**
189
+ * Refresh every registered collection between attempts, recording in `cycle.saved` each one
190
+ * whose refresh finished this transaction's own log entry (see {@link Collection.refreshInFlight}).
191
+ *
192
+ * Visits EVERY collection even after one throws. Stopping at the first throw would leave a
193
+ * participant later in the map unfinished whenever an earlier one is torn — its log tail stored
194
+ * and its other blocks never landed, the silent loss `Collection.completeOwnEntry` exists to
195
+ * prevent — and unreported. Each refresh is independent (its own latch, its own instance state),
196
+ * so one failing says nothing about the next.
197
+ *
198
+ * NOTE: refreshes EVERY registered collection, not only the participants of this transaction.
199
+ * Not free: a non-participant's refresh throws CollectionHeaderVanishedError if its header
200
+ * momentarily reads absent while it holds a committed revision, aborting this retry. And because
201
+ * a throw no longer stops the round, an unreachable cluster costs one failed read per registered
202
+ * collection rather than one. The registered set is small today; if that (or retry latency) ever
203
+ * bites, narrow this to the transaction's participants.
204
+ *
205
+ * @param lastChance - this is the round that spends the last of the retry budget, so a
206
+ * participant whose half-landed write is refused again settles it (`Collection.completeOwnEntry`)
207
+ * rather than asking for a round it will not get; the error returned then carries `final`.
208
+ * @returns the first `completion-refused` {@link TornActionError} when that is the only way any
209
+ * refresh failed — the round is worth retrying; `undefined` when every refresh succeeded.
210
+ * @throws the first other error, once every collection has been visited.
211
+ */
212
+ private refreshBetweenAttempts;
213
+ /** Every registered collection with something to push — the participants an attempt starting
214
+ * now would commit. The predicate is {@link Collection.hasUnsyncedChanges}, the one
215
+ * `Collection.sync` loops on: staged actions OR uncommitted tracker transforms. Not the
216
+ * transforms alone: an action can be staged and have changed no block — a delete of an index
217
+ * entry this instance's stale view never held (the shape `blind-index-delete-is-logged-but-
218
+ * never-applied` fixed for the single-collection path) — and such a collection MUST still take
219
+ * part. Its stale pend is refused, and the refresh between attempts replays the action against
220
+ * the adopted revision, where it finds the entry and produces the delete the retry commits.
221
+ * Filtering on transforms dropped it from the batch entirely, so the row went and its index
222
+ * entry stayed behind, on every node. */
223
+ private stagedCollections;
224
+ /**
225
+ * What a failure escaping {@link commit} must be reported as. When nothing is saved, the error
226
+ * itself, untouched. When a refresh between attempts already saved a participant, the commit
227
+ * half-landed whatever the error says — a {@link CoordinatorStaleLossError}'s "nothing durably
228
+ * committed, safe to re-drive" would be false, and a re-drive would apply the saved half twice —
229
+ * so it becomes a {@link CoordinatorPartialCommitError}:
230
+ *
231
+ * - `committedCollections`: every refresh-saved participant, plus the committed set of `err`
232
+ * when it is itself a partial landing (merged, never wrapped twice — its `reason` is kept);
233
+ * - `failedCollections`: every other participant of any attempt. Empty when a failure came after
234
+ * every participant was saved (a refresh that finished its entry and then threw, say);
235
+ * - `reason`: the original error.
236
+ *
237
+ * Local state already matches that report: a saved participant was consumed by its refresh, and
238
+ * an unsaved one kept its staged actions (a failed finish throws before touching anything, and
239
+ * commitOnceLatched restores every participant it did not commit). The stamp is released, as on
240
+ * the existing partial path, because the transaction can no longer be cleanly rolled back.
241
+ */
242
+ private reportSaved;
132
243
  /**
133
244
  * Commit a transaction (single attempt): materialise a log entry from each collection's staged
134
245
  * pending actions, then orchestrate the distributed consensus (GATHER/PEND/COMMIT).
135
246
  *
136
- * Called by {@link commit} (which wraps it in the backoff+jitter retry loop). The
247
+ * Called by {@link commitAttempts} (the backoff+jitter retry loop behind {@link commit}). The
137
248
  * staged mutations already live in each collection's tracker — applied either via
138
249
  * applyActions() (engine-driven path) or directly via Collection.act()/Tree.stage
139
250
  * (the vtab's deferred-DML path) — but in BOTH cases without a log entry yet, so
@@ -141,16 +252,18 @@ export declare class TransactionCoordinator {
141
252
  * and folds the committed transforms back into each collection's read cache.
142
253
  *
143
254
  * On a clean stale loss (nothing durable, every tracker restored) it throws
144
- * {@link CoordinatorStaleLossError} so the caller can retry; on a partial landing it throws
255
+ * {@link CoordinatorStaleLossError} so the caller can retry. On a partial landing it throws the
256
+ * same, after recording the committed collections in `cycle.saved`, when every refusal was a
257
+ * returned one (the retry finishes the refused collection); on a hard failure it throws
145
258
  * {@link CoordinatorPartialCommitError} (not retryable).
146
259
  *
147
260
  * @param transaction - The transaction to commit
148
- * @param inFlightDisposers - Collects one disposer per participant marked in flight under this
149
- * transaction's id (see {@link Collection.beginInFlightAction}). REQUIRED, so a future caller
150
- * cannot silently reintroduce the unmarked refresh this parameter exists to prevent: a caller
151
- * that never refreshes between attempts passes a throwaway array and simply ignores it. The
152
- * caller owns clearing them, because the mark has to survive past this attempt see the
153
- * array's declaration in {@link commit}.
261
+ * @param cycle - The state this commit keeps across attempts (see {@link CommitCycle}). This
262
+ * attempt adds its participants to `cycle.participants` and one disposer per participant it marks
263
+ * in flight under this transaction's id (see {@link Collection.beginInFlightAction}) to
264
+ * `cycle.inFlightDisposers`. REQUIRED, so a future caller cannot silently reintroduce the
265
+ * unmarked refresh the disposers exist to prevent, nor lose track of who took part. The caller
266
+ * owns clearing the marks, because they have to survive past this attempt.
154
267
  */
155
268
  private commitOnce;
156
269
  /**
@@ -159,6 +272,10 @@ export declare class TransactionCoordinator {
159
272
  * participant's latch — every Collection member it touches (snapshotPending, getPendingActions,
160
273
  * recordCommitted, applyCommittedToCache, restorePending, clearPendingActions, tracker.reset)
161
274
  * is latch-free by contract.
275
+ *
276
+ * `cycle` is written only on a partial landing that is retried forward: the participants this
277
+ * attempt committed go into `cycle.saved`, so the retry loop reports every later failure as the
278
+ * partial landing it is (see {@link reportSaved}).
162
279
  */
163
280
  private commitOnceLatched;
164
281
  /**
@@ -225,7 +342,8 @@ export declare class TransactionCoordinator {
225
342
  * Coordinate a transaction across multiple collections.
226
343
  *
227
344
  * @param transaction - The transaction to coordinate
228
- * @param operationsHash - Hash of all operations for validation
345
+ * @param validation - What every pend carries for members to re-check, or undefined for an
346
+ * unvalidated pend (see {@link pendValidationFor})
229
347
  * @param collectionTransforms - Map of collectionId to its transforms
230
348
  * @param criticalBlocks - Map of collectionId to its log tail blockId
231
349
  * @param pendedRevs - Per collection, the revision its log entry was stamped with (from
@@ -245,8 +363,10 @@ export declare class TransactionCoordinator {
245
363
  /**
246
364
  * PEND phase: Distribute transaction to all affected block clusters.
247
365
  *
248
- * @param transaction - The full transaction for replay/validation
249
- * @param operationsHash - Hash of all operations for validation
366
+ * @param transaction - The transaction being pended (its id names the action; its aged
367
+ * priority rides on an unvalidated pend)
368
+ * @param validation - What every pend carries for members to re-check, or undefined for an
369
+ * unvalidated pend (see {@link pendValidationFor})
250
370
  * @param collectionTransforms - Map of collectionId to its transforms
251
371
  * @param pendedRevs - Per collection, the revision its log entry was stamped with — the pend
252
372
  * request repeats it verbatim rather than recomputing from the collection (a recompute after
@@ -1 +1 @@
1
- {"version":3,"file":"coordinator.d.ts","sourceRoot":"","sources":["../../../src/transaction/coordinator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAW,YAAY,EAAE,UAAU,EAAwC,MAAM,aAAa,CAAC;AACxH,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAG5H,OAAO,KAAK,EAAE,UAAU,EAAsB,MAAM,6BAA6B,CAAC;AAClF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