@serfab/cadre-core 1.13.0 → 1.15.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 (230) hide show
  1. package/README.md +293 -274
  2. package/dist/cadre-invite-protocol.d.ts +383 -0
  3. package/dist/cadre-invite-protocol.js +774 -0
  4. package/dist/cadre-invite-protocol.js.map +1 -0
  5. package/dist/cadre-join-request.d.ts +42 -0
  6. package/dist/cadre-join-request.js +144 -0
  7. package/dist/cadre-join-request.js.map +1 -0
  8. package/dist/cadre-node.d.ts +849 -210
  9. package/dist/cadre-node.js +1574 -374
  10. package/dist/cadre-node.js.map +1 -1
  11. package/dist/claim-proof.d.ts +45 -0
  12. package/dist/claim-proof.js +132 -0
  13. package/dist/claim-proof.js.map +1 -0
  14. package/dist/control-authorization.d.ts +80 -19
  15. package/dist/control-authorization.js +55 -13
  16. package/dist/control-authorization.js.map +1 -1
  17. package/dist/control-cohort.js +1 -1
  18. package/dist/control-cohort.js.map +1 -1
  19. package/dist/control-database.d.ts +605 -108
  20. package/dist/control-database.js +1299 -280
  21. package/dist/control-database.js.map +1 -1
  22. package/dist/control-protocol-guard.d.ts +142 -0
  23. package/dist/control-protocol-guard.js +293 -0
  24. package/dist/control-protocol-guard.js.map +1 -0
  25. package/dist/control-schema.d.ts +1 -1
  26. package/dist/control-schema.js +817 -1067
  27. package/dist/control-schema.js.map +1 -1
  28. package/dist/control-stream.d.ts +4 -0
  29. package/dist/control-stream.js +22 -7
  30. package/dist/control-stream.js.map +1 -1
  31. package/dist/delegate-admission.d.ts +1 -1
  32. package/dist/delegate-admission.js +1 -1
  33. package/dist/device-token.d.ts +11 -9
  34. package/dist/device-token.js +14 -12
  35. package/dist/device-token.js.map +1 -1
  36. package/dist/ed25519-key.d.ts +22 -9
  37. package/dist/ed25519-key.js +47 -10
  38. package/dist/ed25519-key.js.map +1 -1
  39. package/dist/fetch-impl.d.ts +12 -0
  40. package/dist/fetch-impl.js +23 -0
  41. package/dist/fetch-impl.js.map +1 -0
  42. package/dist/file-durable-slot.js +2 -1
  43. package/dist/file-durable-slot.js.map +1 -1
  44. package/dist/file-safe-name.d.ts +25 -0
  45. package/dist/file-safe-name.js +29 -0
  46. package/dist/file-safe-name.js.map +1 -0
  47. package/dist/formation-approval.js +5 -11
  48. package/dist/formation-approval.js.map +1 -1
  49. package/dist/fs-atomic.d.ts +0 -19
  50. package/dist/fs-atomic.js +3 -24
  51. package/dist/fs-atomic.js.map +1 -1
  52. package/dist/index.d.ts +22 -10
  53. package/dist/index.js +54 -11
  54. package/dist/index.js.map +1 -1
  55. package/dist/invitation-bootstrap.d.ts +50 -12
  56. package/dist/invitation-bootstrap.js +76 -13
  57. package/dist/invitation-bootstrap.js.map +1 -1
  58. package/dist/joined-strand-store.d.ts +7 -0
  59. package/dist/joined-strand-store.js +9 -0
  60. package/dist/joined-strand-store.js.map +1 -1
  61. package/dist/key-store-file.js +2 -1
  62. package/dist/key-store-file.js.map +1 -1
  63. package/dist/link-budget.d.ts +25 -33
  64. package/dist/link-budget.js +25 -35
  65. package/dist/link-budget.js.map +1 -1
  66. package/dist/machine-removal.d.ts +78 -0
  67. package/dist/machine-removal.js +166 -0
  68. package/dist/machine-removal.js.map +1 -0
  69. package/dist/membership-connection-gater.d.ts +191 -151
  70. package/dist/membership-connection-gater.js +236 -173
  71. package/dist/membership-connection-gater.js.map +1 -1
  72. package/dist/node-claim-payload.d.ts +74 -0
  73. package/dist/node-claim-payload.js +224 -0
  74. package/dist/node-claim-payload.js.map +1 -0
  75. package/dist/node-default-transports.d.ts +27 -0
  76. package/dist/node-default-transports.js +35 -0
  77. package/dist/node-default-transports.js.map +1 -0
  78. package/dist/node-transports.d.ts +30 -0
  79. package/dist/node-transports.js +40 -0
  80. package/dist/node-transports.js.map +1 -0
  81. package/dist/owner-anchor-sync.d.ts +22 -0
  82. package/dist/owner-anchor-sync.js +143 -0
  83. package/dist/owner-anchor-sync.js.map +1 -0
  84. package/dist/peer-authorization.d.ts +113 -18
  85. package/dist/peer-authorization.js +225 -29
  86. package/dist/peer-authorization.js.map +1 -1
  87. package/dist/peer-dial.d.ts +143 -27
  88. package/dist/peer-dial.js +276 -31
  89. package/dist/peer-dial.js.map +1 -1
  90. package/dist/peer-join-backfill.d.ts +26 -2
  91. package/dist/peer-join-backfill.js +60 -12
  92. package/dist/peer-join-backfill.js.map +1 -1
  93. package/dist/peer-record.d.ts +17 -52
  94. package/dist/peer-record.js +20 -58
  95. package/dist/peer-record.js.map +1 -1
  96. package/dist/pending-join-runner.d.ts +66 -58
  97. package/dist/pending-join-runner.js +136 -145
  98. package/dist/pending-join-runner.js.map +1 -1
  99. package/dist/primary-lan-address.d.ts +8 -0
  100. package/dist/primary-lan-address.js +46 -0
  101. package/dist/primary-lan-address.js.map +1 -0
  102. package/dist/provider/client.d.ts +131 -0
  103. package/dist/provider/client.js +226 -0
  104. package/dist/provider/client.js.map +1 -0
  105. package/dist/provider/descriptor.d.ts +41 -0
  106. package/dist/provider/descriptor.js +103 -0
  107. package/dist/provider/descriptor.js.map +1 -0
  108. package/dist/provider/index.d.ts +9 -0
  109. package/dist/provider/index.js +10 -0
  110. package/dist/provider/index.js.map +1 -0
  111. package/dist/provider/oauth.d.ts +125 -0
  112. package/dist/provider/oauth.js +199 -0
  113. package/dist/provider/oauth.js.map +1 -0
  114. package/dist/provider/rent-node.d.ts +101 -0
  115. package/dist/provider/rent-node.js +220 -0
  116. package/dist/provider/rent-node.js.map +1 -0
  117. package/dist/push-fanout.d.ts +8 -2
  118. package/dist/push-fanout.js +8 -2
  119. package/dist/push-fanout.js.map +1 -1
  120. package/dist/relay-addrs.d.ts +9 -4
  121. package/dist/relay-addrs.js +9 -4
  122. package/dist/relay-addrs.js.map +1 -1
  123. package/dist/relay-reservation.d.ts +51 -16
  124. package/dist/relay-reservation.js +107 -24
  125. package/dist/relay-reservation.js.map +1 -1
  126. package/dist/seed-bootstrap.d.ts +165 -123
  127. package/dist/seed-bootstrap.js +313 -275
  128. package/dist/seed-bootstrap.js.map +1 -1
  129. package/dist/seed-trust-policy.d.ts +98 -37
  130. package/dist/seed-trust-policy.js +188 -2
  131. package/dist/seed-trust-policy.js.map +1 -1
  132. package/dist/strand-addr-protocol.d.ts +24 -26
  133. package/dist/strand-addr-protocol.js +19 -26
  134. package/dist/strand-addr-protocol.js.map +1 -1
  135. package/dist/strand-commit-durability.d.ts +54 -0
  136. package/dist/strand-commit-durability.js +74 -0
  137. package/dist/strand-commit-durability.js.map +1 -0
  138. package/dist/strand-database.d.ts +23 -8
  139. package/dist/strand-database.js +41 -13
  140. package/dist/strand-database.js.map +1 -1
  141. package/dist/strand-first-sync-gate.d.ts +7 -1
  142. package/dist/strand-first-sync-gate.js +7 -1
  143. package/dist/strand-first-sync-gate.js.map +1 -1
  144. package/dist/strand-formation-protocol.js +5 -2
  145. package/dist/strand-formation-protocol.js.map +1 -1
  146. package/dist/strand-fret-addrs.d.ts +19 -1
  147. package/dist/strand-fret-addrs.js +27 -9
  148. package/dist/strand-fret-addrs.js.map +1 -1
  149. package/dist/strand-instance-manager.d.ts +81 -19
  150. package/dist/strand-instance-manager.js +216 -105
  151. package/dist/strand-instance-manager.js.map +1 -1
  152. package/dist/strand-move.d.ts +124 -0
  153. package/dist/strand-move.js +438 -0
  154. package/dist/strand-move.js.map +1 -0
  155. package/dist/strand-network-config.js +7 -6
  156. package/dist/strand-network-config.js.map +1 -1
  157. package/dist/strand-peer-redial.d.ts +113 -0
  158. package/dist/strand-peer-redial.js +236 -0
  159. package/dist/strand-peer-redial.js.map +1 -0
  160. package/dist/strand-revocation-enforcer.d.ts +11 -11
  161. package/dist/strand-revocation-enforcer.js +11 -11
  162. package/dist/strand-wake-protocol.d.ts +13 -16
  163. package/dist/strand-wake-protocol.js +23 -27
  164. package/dist/strand-wake-protocol.js.map +1 -1
  165. package/dist/trusted-owner-store.d.ts +35 -5
  166. package/dist/trusted-owner-store.js +50 -8
  167. package/dist/trusted-owner-store.js.map +1 -1
  168. package/dist/types.d.ts +512 -89
  169. package/dist/types.js +10 -0
  170. package/dist/types.js.map +1 -1
  171. package/package.json +19 -10
  172. package/src/cadre-invite-protocol.ts +1052 -0
  173. package/src/cadre-join-request.ts +167 -0
  174. package/src/cadre-node.ts +1703 -386
  175. package/src/claim-proof.ts +147 -0
  176. package/src/control-authorization.ts +203 -117
  177. package/src/control-cohort.ts +1 -1
  178. package/src/control-database.ts +4663 -3453
  179. package/src/control-protocol-guard.ts +348 -0
  180. package/src/control-schema.ts +828 -1078
  181. package/src/control-stream.ts +26 -7
  182. package/src/delegate-admission.ts +1 -1
  183. package/src/device-token.ts +14 -10
  184. package/src/ed25519-key.ts +47 -10
  185. package/src/fetch-impl.ts +23 -0
  186. package/src/file-durable-slot.ts +64 -63
  187. package/src/file-safe-name.ts +32 -0
  188. package/src/formation-approval.ts +604 -610
  189. package/src/fs-atomic.ts +92 -117
  190. package/src/index.ts +789 -648
  191. package/src/invitation-bootstrap.ts +91 -13
  192. package/src/joined-strand-store.ts +508 -498
  193. package/src/key-store-file.ts +142 -141
  194. package/src/link-budget.ts +25 -36
  195. package/src/machine-removal.ts +216 -0
  196. package/src/membership-connection-gater.ts +259 -191
  197. package/src/node-claim-payload.ts +259 -0
  198. package/src/node-default-transports.ts +38 -0
  199. package/src/node-transports.ts +49 -0
  200. package/src/owner-anchor-sync.ts +171 -0
  201. package/src/peer-authorization.ts +258 -29
  202. package/src/peer-dial.ts +604 -315
  203. package/src/peer-join-backfill.ts +62 -11
  204. package/src/peer-record.ts +159 -197
  205. package/src/pending-join-runner.ts +729 -735
  206. package/src/primary-lan-address.ts +47 -0
  207. package/src/provider/client.ts +326 -0
  208. package/src/provider/descriptor.ts +129 -0
  209. package/src/provider/index.ts +59 -0
  210. package/src/provider/oauth.ts +285 -0
  211. package/src/provider/rent-node.ts +275 -0
  212. package/src/push-fanout.ts +8 -2
  213. package/src/relay-addrs.ts +9 -4
  214. package/src/relay-reservation.ts +1211 -1121
  215. package/src/seed-bootstrap.ts +1502 -1448
  216. package/src/seed-trust-policy.ts +353 -140
  217. package/src/strand-addr-protocol.ts +26 -35
  218. package/src/strand-commit-durability.ts +116 -0
  219. package/src/strand-database.ts +46 -14
  220. package/src/strand-first-sync-gate.ts +7 -1
  221. package/src/strand-formation-protocol.ts +1039 -1036
  222. package/src/strand-fret-addrs.ts +179 -145
  223. package/src/strand-instance-manager.ts +2026 -1883
  224. package/src/strand-move.ts +585 -0
  225. package/src/strand-network-config.ts +7 -6
  226. package/src/strand-peer-redial.ts +307 -0
  227. package/src/strand-revocation-enforcer.ts +11 -11
  228. package/src/strand-wake-protocol.ts +23 -30
  229. package/src/trusted-owner-store.ts +242 -171
  230. package/src/types.ts +2687 -2242
@@ -1,75 +1,78 @@
1
1
  /**
2
2
  * The pending-join retry loop: carries on a join this party asked for through another party's
3
- * invitation (`CadreControl.PendingJoin`, one row per invitation) in the background, on every
4
- * owner machine of the party, until the join works, the invitation is used up or expires, or
5
- * the user dismisses it. The behaviour is described in `docs/strands.md` → "Joining while the
6
- * inviter is offline".
3
+ * invitation (`CadreControl.JoinRequest`, one row per invitation, with its outcome in
4
+ * `JoinSuccess` / `JoinFailure`) in the background, on every owner machine of the party, until
5
+ * the join works, the invitation is used up or expires, or the user dismisses it. The behaviour
6
+ * is described in `docs/strands.md` → "Joining while the inviter is offline".
7
7
  *
8
8
  * `CadreNode` owns every side effect and hands this module plain functions
9
- * ({@link PendingJoinRunnerDeps}): read the rows, run one attempt (its own `formStrand`), write
9
+ * ({@link PendingJoinRunnerDeps}): read the joins, run one attempt (its own `formStrand`), write
10
10
  * an outcome, say whether this machine is an owner, and the clock. This module owns the policy:
11
11
  * when to attempt, how to read an attempt's failure, and how to settle an outcome write that
12
12
  * another machine's write beat.
13
13
  *
14
- * Only owner machines run it, because every `PendingJoin` write is owner-signed. Letting a
14
+ * Only owner machines run it, because every pending-join write is owner-signed. Letting a
15
15
  * machine without an owner key finish a join is `blocked/decide-non-owner-machine-completes-a-pending-join`;
16
16
  * that changes {@link PendingJoinRunnerDeps.isOwner} and the write functions, not this loop.
17
17
  */
18
- import type { FormStrandResult, PendingJoinRow, PendingJoinStatus, StrandFormationDisclosure, StrandMembershipInvite } from './types.js';
18
+ import type { FormStrandResult, JoinOutcome, PendingJoin, PendingJoinStatus, StrandFormationDisclosure, StrandMembershipInvite } from './types.js';
19
+ import { type JoinRequestFields, type PendingJoinFields } from './control-database.js';
19
20
  import { type TimeoutScheduler } from './timeout-scheduler.js';
20
21
  /** How often an owner machine re-reads the party's pending joins (it also reads once right after start). */
21
22
  export declare const PENDING_JOIN_POLL_MS = 30000;
22
23
  /** Ceiling on the wait between two attempts of one join on one machine, before jitter. */
23
24
  export declare const PENDING_JOIN_MAX_BACKOFF_MS: number;
24
25
  /**
25
- * The longest a join is tried for. A row's `ExpiresAt` is the earlier of this and the
26
+ * The longest a join is tried for. A request's `ExpiresAt` is the earlier of this and the
26
27
  * invitation's own expiration, which the inviter chose.
27
28
  */
28
29
  export declare const MAX_PENDING_JOIN_MS: number;
29
- /** A `PendingJoin` row as written: every column but the stamp, which each write mints. */
30
- export type PendingJoinFields = Omit<PendingJoinRow, 'StampId'>;
30
+ /** Which pending-join write this machine made: the request itself (an insert or a rewrite), or an outcome row for it. */
31
+ export type PendingJoinWrite = 'request' | 'outcome';
31
32
  export interface PendingJoinRunnerDeps {
32
- /** This machine's peer id; with the row id it fixes when this machine first tries a row it did not ask for. */
33
+ /** This machine's peer id; with the request id it fixes when this machine first tries a join it did not ask for. */
33
34
  selfId: string;
34
35
  /** `NetworkConfig.linkRoundTripMs`: the retry pace follows the formation deadlines it yields. */
35
36
  linkRoundTripMs?: number;
36
- /** Whether this machine may write `PendingJoin` rows now. Asked every pass. */
37
+ /** Whether this machine may write pending joins now. Asked every pass. */
37
38
  isOwner(): Promise<boolean>;
38
- readRows(): Promise<PendingJoinRow[]>;
39
- readRow(id: string): Promise<PendingJoinRow | null>;
40
- /** One formation attempt for the row's invitation and disclosure (`CadreNode.formStrand`). */
41
- attempt(row: PendingJoinRow): Promise<FormStrandResult>;
42
- /** `ControlDatabase.replacePendingJoin`, owner-signed: throws `PendingJoinChangedError` when the live row is not `expectedStampId`. */
43
- replace(expectedStampId: string, next: PendingJoinFields): Promise<PendingJoinRow>;
39
+ readRows(): Promise<PendingJoin[]>;
40
+ readRow(id: string): Promise<PendingJoin | null>;
41
+ /** One formation attempt for the request's invitation and disclosure (`CadreNode.formStrand`). */
42
+ attempt(join: PendingJoin): Promise<FormStrandResult>;
43
+ /** `ControlDatabase.recordJoinOutcome`, owner-signed: throws `PendingJoinChangedError` when the live join is not `expected`. */
44
+ record(expected: PendingJoin, outcome: JoinOutcome): Promise<PendingJoin>;
45
+ /** `ControlDatabase.rewritePendingJoin`, owner-signed: throws `PendingJoinChangedError` when the live request is not `expectedStampId`. */
46
+ rewrite(expectedStampId: string, next: PendingJoinFields): Promise<PendingJoin>;
44
47
  /** `ControlDatabase.deletePendingJoin`, owner-signed. */
45
48
  remove(id: string): Promise<boolean>;
46
49
  /** Whether this machine has no control connection now, so a write it commits reaches no other machine. */
47
50
  isAlone(): boolean;
48
- /** The sApp the row's invitation names. */
49
- sAppIdOf(row: PendingJoinRow): string;
50
- /** Every pass's rows, read by an owner machine; `CadreNode` stages the membership invitations they carry. */
51
- observeRows(rows: readonly PendingJoinRow[]): void;
51
+ /** The sApp the request's invitation names. */
52
+ sAppIdOf(join: PendingJoin): string;
53
+ /** Every pass's joins, read by an owner machine; `CadreNode` stages the membership invitations they carry. */
54
+ observeRows(joins: readonly PendingJoin[]): void;
52
55
  emit(status: PendingJoinStatus): void;
53
56
  now?: () => number;
54
57
  random?: () => number;
55
58
  scheduler?: TimeoutScheduler;
56
59
  }
57
60
  /**
58
- * The pending row a `requestJoin` writes: tried until the invitation's own expiration or
61
+ * The request a `requestJoin` writes: tried until the invitation's own expiration or
59
62
  * {@link MAX_PENDING_JOIN_MS} from now, whichever comes first.
60
63
  */
61
- export declare function requestedPendingJoin(id: string, encodedInvitation: string, disclosure: StrandFormationDisclosure, invitationExpiresAt: number, now: number): PendingJoinFields;
62
- /** A row's stored disclosure, as the next attempt sends it. Owner-signed, so anything but an object is a bug. */
63
- export declare function parseStoredDisclosure(row: PendingJoinRow): StrandFormationDisclosure;
64
- /** A `joined` row's `MembershipInvite` column, or null when it is not the `{inviteKey, invitePrivateKey}` JSON the loop writes. */
64
+ export declare function requestedPendingJoin(id: string, encodedInvitation: string, disclosure: StrandFormationDisclosure, invitationExpiresAt: number, now: number): JoinRequestFields;
65
+ /** A request's stored disclosure, as the next attempt sends it. Owner-signed, so anything but an object is a bug. */
66
+ export declare function parseStoredDisclosure(join: PendingJoin): StrandFormationDisclosure;
67
+ /** A `JoinSuccess` row's `MembershipInvite` column, or null when it is not the `{inviteKey, invitePrivateKey}` JSON the loop writes. */
65
68
  export declare function parseStoredMembershipInvite(text: string): StrandMembershipInvite | null;
66
69
  /**
67
- * The membership invitations `joined` rows carry that this process has not staged yet, so a
70
+ * The membership invitations joined requests carry that this process has not staged yet, so a
68
71
  * closed strand joined on one owner machine can be seated by whichever machine launches it
69
- * first. Rows older than {@link MEMBERSHIP_INVITE_TTL_MS} are skipped: their invitation is dead.
72
+ * first. Joins older than {@link MEMBERSHIP_INVITE_TTL_MS} are skipped: their invitation is dead.
70
73
  * `alreadyStaged` holds invite keys; a malformed column is skipped and logged.
71
74
  */
72
- export declare function membershipInvitesToStage(rows: readonly PendingJoinRow[], alreadyStaged: ReadonlySet<string>, now: number): Array<{
75
+ export declare function membershipInvitesToStage(joins: readonly PendingJoin[], alreadyStaged: ReadonlySet<string>, now: number): Array<{
73
76
  rowId: string;
74
77
  strandId: string;
75
78
  invite: StrandMembershipInvite;
@@ -77,13 +80,13 @@ export declare function membershipInvitesToStage(rows: readonly PendingJoinRow[]
77
80
  export declare class PendingJoinRunner {
78
81
  private readonly deps;
79
82
  private readonly tracked;
80
- /** Rows whose latest write by this machine committed with no control connection: id → the stamp written. */
83
+ /** Joins whose latest write by this machine committed with no control connection: id → the request stamp written. */
81
84
  private readonly writtenAlone;
82
85
  private readonly dueQueue;
83
86
  private readonly scheduler;
84
87
  private readonly now;
85
88
  private readonly random;
86
- /** First retry delay, and the window a row this machine did not ask for is first tried in. */
89
+ /** First retry delay, and the window a join this machine did not ask for is first tried in. */
87
90
  private readonly baseDelayMs;
88
91
  /** How long a `token-spent` answer waits before its confirming attempt: long enough for a sibling's `joined` write to replicate. */
89
92
  private readonly spentConfirmDelayMs;
@@ -99,8 +102,8 @@ export declare class PendingJoinRunner {
99
102
  * Stop scheduling. Clears every timer and starts no new attempt.
100
103
  *
101
104
  * NOTE: an attempt already in flight is not awaited, because `formStrand` takes no abort
102
- * signal. An approval that lands while the node stops can lose its local records; the row then
103
- * stays pending, and the next start's attempt answers `token-spent`, which fails the row after
105
+ * signal. An approval that lands while the node stops can lose its local records; the request
106
+ * then stays pending, and the next start's attempt answers `token-spent`, which fails it after
104
107
  * its confirming attempt. Honest and bounded; if it shows up in practice, give `formStrand` a
105
108
  * signal and abort it here.
106
109
  */
@@ -108,25 +111,30 @@ export declare class PendingJoinRunner {
108
111
  /** Run a pass now, for a change that may make one useful (this machine just became an owner). */
109
112
  kick(): void;
110
113
  /**
111
- * Try `row` on this machine at once, outside the background slots, and report the status
112
- * after the attempt. Joins an attempt already running for the row.
114
+ * Try `join` on this machine at once, outside the background slots, and report the status
115
+ * after the attempt. Joins an attempt already running for it.
113
116
  */
114
- attemptNow(row: PendingJoinRow): Promise<PendingJoinStatus>;
115
- /** This machine's view of `row`: the row's own state, with this machine's attempt state laid over a pending row. */
116
- statusOf(row: PendingJoinRow): PendingJoinStatus;
117
- /** Record a `PendingJoin` write this machine made outside the loop (a `requestJoin`), for {@link reissueWritesMadeAlone}. */
118
- noteWritten(row: PendingJoinRow): void;
119
- /** Stop tracking a row the user dismissed. An attempt in flight finishes; its outcome write then finds the row gone. */
117
+ attemptNow(join: PendingJoin): Promise<PendingJoinStatus>;
118
+ /** This machine's view of `join`: its own state, with this machine's attempt state laid over a pending one. */
119
+ statusOf(join: PendingJoin): PendingJoinStatus;
120
+ /**
121
+ * Record a pending-join write this machine made, for {@link reissueWritesMadeAlone}. A write
122
+ * made alone marks the join. A request write made connected clears the mark, since it
123
+ * carried the request; an outcome write made connected does not, since the request it names
124
+ * may still be unknown to the other machines.
125
+ */
126
+ noteWritten(join: PendingJoin, write: PendingJoinWrite): void;
127
+ /** Stop tracking a join the user dismissed. An attempt in flight finishes; its outcome write then finds the request gone. */
120
128
  forgetRow(id: string): void;
121
129
  /**
122
- * Re-write, with identical content under a fresh stamp, each row this machine last wrote while
130
+ * Re-write, with identical content under a fresh stamp, each join this machine last wrote while
123
131
  * it had no control connection, so the other machines receive it. Called on the control
124
- * connection growth edge. A row someone wrote since is left alone.
132
+ * connection growth edge. A join someone wrote since is left alone.
125
133
  *
126
- * NOTE: in memory only, so a row written alone by a process that stopped before it reconnected
127
- * reaches the party only with that row's next write. A sweep of every row this machine wrote,
134
+ * NOTE: in memory only, so a join written alone by a process that stopped before it reconnected
135
+ * reaches the party only with that join's next write. A sweep of every join this machine wrote,
128
136
  * on the first connection after start, would cover that, at the cost of one permanent
129
- * `Revocation` tombstone per row per start. Revisit if other machines are seen missing such rows.
137
+ * `Revocation` tombstone per join per start. Revisit if other machines are seen missing such joins.
130
138
  */
131
139
  reissueWritesMadeAlone(): Promise<void>;
132
140
  private schedulePass;
@@ -136,11 +144,11 @@ export declare class PendingJoinRunner {
136
144
  private runPass;
137
145
  /** Drop every scheduled attempt; the first pass that finds this machine an owner again schedules afresh. */
138
146
  private pauseAttempts;
139
- /** Bring one read row into this machine's schedule. */
147
+ /** Bring one read join into this machine's schedule. */
140
148
  private consider;
141
149
  /**
142
- * The tracked entry for `row`, updated to it. A row asked for again (`RequestedAt` changed)
143
- * starts this machine's counting over; a finished row stops its schedule.
150
+ * The tracked entry for `join`, updated to it. A join asked for again (`RequestedAt` changed)
151
+ * starts this machine's counting over; a finished join stops its schedule.
144
152
  */
145
153
  private adopt;
146
154
  private scheduleAttempt;
@@ -151,27 +159,27 @@ export declare class PendingJoinRunner {
151
159
  /** Run one attempt for `entry`, or join the one already running. Never rejects. */
152
160
  private startAttempt;
153
161
  private attemptOnce;
154
- /** Read a failed attempt: retry, confirm a spent token, or fail the row. */
162
+ /** Read a failed attempt: retry, confirm a spent token, or fail the join. */
155
163
  private onAttemptFailed;
156
164
  /**
157
165
  * A `token-spent` answer may mean another owner machine of this party won the same
158
- * invitation. Adopt its outcome if the row already shows one; otherwise confirm once, after
159
- * long enough for that machine's `joined` write to arrive, before failing the row.
166
+ * invitation. Adopt its outcome if the join already shows one; otherwise confirm once, after
167
+ * long enough for that machine's `joined` write to arrive, before failing the join.
160
168
  */
161
169
  private onSpent;
162
170
  private retryLater;
163
171
  /** `min(base × 2^(n−1), max)`, moved by up to ±{@link RETRY_JITTER}. */
164
172
  private backoffMs;
165
173
  /**
166
- * Write `next` over the row this machine last read. When another write got there first,
167
- * re-read and settle by {@link resolveLostWrite}. A row the user dismissed meanwhile is not
168
- * recreated; a join this machine made is still remembered machine-locally, as every
169
- * `formStrand` is.
174
+ * Record `next` on the join this machine last read. When another write got there first, settle
175
+ * by {@link resolveLostWrite} from the live join the refusal carries. A join the user dismissed
176
+ * meanwhile is not recreated; a join this machine made is still remembered machine-locally, as
177
+ * every `formStrand` join is.
170
178
  */
171
179
  private writeOutcome;
172
180
  private settle;
173
181
  /**
174
- * Remove a finished row {@link MEMBERSHIP_INVITE_TTL_MS} after its outcome: the membership
182
+ * Remove a finished join {@link MEMBERSHIP_INVITE_TTL_MS} after its outcome: the membership
175
183
  * invitation it carries is dead by then, and an app that was not running has seen the strand
176
184
  * through `strand:discovered`. Only while connected, like every write nothing waits on.
177
185
  *