@interop/wallet-core 0.100.0 → 0.101.1

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 (61) hide show
  1. package/README.md +10 -2
  2. package/dist/clientAnnex/gc.d.ts +107 -25
  3. package/dist/clientAnnex/gc.d.ts.map +1 -1
  4. package/dist/clientAnnex/gc.js +258 -89
  5. package/dist/clientAnnex/gc.js.map +1 -1
  6. package/dist/clientAnnex/heal.d.ts +32 -0
  7. package/dist/clientAnnex/heal.d.ts.map +1 -1
  8. package/dist/clientAnnex/heal.js +52 -50
  9. package/dist/clientAnnex/heal.js.map +1 -1
  10. package/dist/clientAnnex/index.d.ts +1 -1
  11. package/dist/clientAnnex/index.d.ts.map +1 -1
  12. package/dist/clientAnnex/index.js +1 -1
  13. package/dist/clientAnnex/index.js.map +1 -1
  14. package/dist/clientAnnex/log.d.ts +18 -1
  15. package/dist/clientAnnex/log.d.ts.map +1 -1
  16. package/dist/clientAnnex/log.js +25 -2
  17. package/dist/clientAnnex/log.js.map +1 -1
  18. package/dist/space/ceremony.d.ts +5 -4
  19. package/dist/space/ceremony.d.ts.map +1 -1
  20. package/dist/space/ceremony.js +7 -4
  21. package/dist/space/ceremony.js.map +1 -1
  22. package/dist/space/collections.d.ts +3 -3
  23. package/dist/space/collections.d.ts.map +1 -1
  24. package/dist/space/collections.js +5 -5
  25. package/dist/space/collections.js.map +1 -1
  26. package/dist/space/index.d.ts +2 -2
  27. package/dist/space/index.d.ts.map +1 -1
  28. package/dist/space/index.js +2 -2
  29. package/dist/space/index.js.map +1 -1
  30. package/dist/sync/index.d.ts +3 -3
  31. package/dist/sync/index.js +3 -3
  32. package/dist/sync/push.d.ts.map +1 -1
  33. package/dist/sync/push.js +17 -25
  34. package/dist/sync/push.js.map +1 -1
  35. package/dist/sync/remint.d.ts +1 -1
  36. package/dist/sync/remint.d.ts.map +1 -1
  37. package/dist/sync/remint.js +2 -2
  38. package/dist/sync/remint.js.map +1 -1
  39. package/dist/sync/types.d.ts +36 -33
  40. package/dist/sync/types.d.ts.map +1 -1
  41. package/dist/sync/types.js +8 -5
  42. package/dist/sync/types.js.map +1 -1
  43. package/dist/testing/accountBuilder.d.ts +237 -0
  44. package/dist/testing/accountBuilder.d.ts.map +1 -0
  45. package/dist/testing/accountBuilder.js +510 -0
  46. package/dist/testing/accountBuilder.js.map +1 -0
  47. package/dist/testing/fastKdf.d.ts +16 -0
  48. package/dist/testing/fastKdf.d.ts.map +1 -0
  49. package/dist/testing/fastKdf.js +8 -0
  50. package/dist/testing/fastKdf.js.map +1 -0
  51. package/dist/testing/index.d.ts +13 -0
  52. package/dist/testing/index.d.ts.map +1 -0
  53. package/dist/testing/index.js +13 -0
  54. package/dist/testing/index.js.map +1 -0
  55. package/dist/{testing.d.ts → testing/signerFixture.d.ts} +2 -2
  56. package/dist/testing/signerFixture.d.ts.map +1 -0
  57. package/dist/{testing.js → testing/signerFixture.js} +1 -1
  58. package/dist/testing/signerFixture.js.map +1 -0
  59. package/package.json +13 -11
  60. package/dist/testing.d.ts.map +0 -1
  61. package/dist/testing.js.map +0 -1
@@ -1,4 +1,6 @@
1
- import { clientAnnexDidParts, clientAnnexLogStore, delegatedClientsPointer, embeddedGenerationDelegation, ensureGenerationDelegationCurrent, GENERATION_ID_PREFIX, mintCredentialClientAnnexGeneration, mintGenerationDelegation, readClientAnnexLogOrAbsent, revokeTreatingAlreadyRevokedAsSuccess, setDelegatedClientsPointer } from './log.js';
1
+ import { readSpaceMetadata } from './heal.js';
2
+ import { clientAnnexDidParts, clientAnnexLogStore, DelegatedClientsPointerMovedError, delegatedClientsPointer, delegatedClientsPointerHistory, embeddedGenerationDelegation, ensureGenerationDelegationCurrent, GENERATION_ID_PREFIX, mintCredentialClientAnnexGeneration, mintGenerationDelegation, readClientAnnexLogOrAbsent, revokeTreatingAlreadyRevokedAsSuccess, setDelegatedClientsPointer } from './log.js';
3
+ import { readPublishedLogOrThrow } from '../webvh/didWebvh.js';
2
4
  /**
3
5
  * The fixed GC cadence: a generation is replaced at the first remembered login
4
6
  * 90 days after the current pointer value was established. Wallet GC policy
@@ -76,14 +78,17 @@ export function clientAnnexGcDue({ log, now = Date.now() }) {
76
78
  /**
77
79
  * The live-entry guard: whether a generation is GC-quiet -- its newest
78
80
  * entry's `versionTime` is older than the quiet bound plus the skew grace
79
- * margin. Applies to the POINTED generation only (an unpointed generation
80
- * authorizes nothing under pointer equality, so nothing inside it ever
81
- * defers deletion). An unparseable `versionTime` reads as not quiet: the
82
- * swap defers rather than abandoning a possibly-live visit.
81
+ * margin. On the POINTED generation it defers the swap, so a possibly-live
82
+ * visit is not abandoned. On an unpointed generation the account log NEVER
83
+ * pointed at it defers the collect: such a generation authorizes nothing
84
+ * under pointer equality, but one written moments ago may be a sibling
85
+ * client's fresh generation whose re-point has not landed yet, and collecting
86
+ * it would leave the account pointing at a deleted generation. An
87
+ * unparseable `versionTime` reads as not quiet, so both arms defer rather
88
+ * than act.
83
89
  *
84
90
  * @param options {object}
85
- * @param options.log {DIDLog} the pointed generation's VERIFIED annex
86
- * log
91
+ * @param options.log {DIDLog} the generation's VERIFIED annex log
87
92
  * @param [options.now] {number} epoch milliseconds, for tests
88
93
  * @returns {boolean}
89
94
  */
@@ -108,7 +113,38 @@ export function generationQuiet({ log, now = Date.now() }) {
108
113
  * a chain whose signer has left the document is read as that), re-writes
109
114
  * the digest (the deterministic payload id collapses the second row at read
110
115
  * time), and re-runs the idempotent delete; a swap torn before its re-point
111
- * leaves an unpointed fresh generation the same fan-out collects.
116
+ * leaves an unpointed fresh generation the same fan-out collects once it is
117
+ * GC-quiet.
118
+ *
119
+ * Two guards keep the fan-out off the pointed generation. The pointer the
120
+ * fan-out compares against is re-read from the account log under this
121
+ * client's pin immediately before the fan-out, so a sibling client's swap,
122
+ * or this pass's own re-point whose response was lost, is seen rather than
123
+ * the caller's pre-pass view. And an unpointed generation the fresh log
124
+ * never pointed at is collected only when GC-quiet, so a sibling mid-swap
125
+ * (minted, not yet pointed) keeps its fresh generation; one the log once
126
+ * pointed at is collected at once. A generation whose log does not exist
127
+ * carries no timestamp and is deleted at once. A sibling whose genesis and
128
+ * install both land in the gap between that read and the delete goes on to
129
+ * re-point at the deleted generation; the next remembered login's repair,
130
+ * or the next transient visit's readiness ensure, mends that.
131
+ *
132
+ * The pointed generation's log is read on every pass: when the swap is due
133
+ * it is the quiet gate, and on every pass it is the detector of a dead
134
+ * pointed generation (a collected or never-minted one the pointer still
135
+ * names), which the pass repairs with an off-cadence swap so the next
136
+ * transient visit can enroll. Before the repair the account log is re-read
137
+ * under this client's pin: when the pointer has moved off the one the caller
138
+ * passed, a sibling client swapped since the caller's read, and the pass
139
+ * reports `not-due` and repairs nothing (`no-pointer` when the re-read
140
+ * document carries none). The repair's own re-point is conditional on the
141
+ * same pointer, so a sibling's re-point landing while the repair mints also
142
+ * stands, and the pass reports `not-due`. The repair then confirms the
143
+ * auxiliary Space
144
+ * itself still answers, and refuses when it does not: replacing a gone Space
145
+ * is the transient readiness ensure's, whose two-probe rule tells absence
146
+ * from a masked read, and a repair racing it across two Spaces would strand
147
+ * whichever Space lost the re-point.
112
148
  *
113
149
  * @param options {object}
114
150
  * @param options.was {WasClient} the storage client, signing as an
@@ -125,8 +161,8 @@ export function generationQuiet({ log, now = Date.now() }) {
125
161
  * @param options.zcapClient {ZcapClient} signs the fresh generation
126
162
  * delegation (the promoted account keyId)
127
163
  * @param [options.ladderSeed] {Uint8Array} the login credential's ladder
128
- * seed; absent, a due swap reports `no-ladder-seed` and only the collect
129
- * fan-out runs
164
+ * seed; absent, a due swap or a needed repair reports `no-ladder-seed` and
165
+ * only the collect fan-out runs
130
166
  * @param options.recordDigest {Function}
131
167
  * `({ generationId, firstEntry, lastEntry, entryCount }) => Promise<void>`
132
168
  * -- writes the GenerationCollect wallet-activity row; called before the
@@ -141,75 +177,140 @@ export function generationQuiet({ log, now = Date.now() }) {
141
177
  export async function runClientAnnexGc({ was, wasServerUrl, accountSpaceId, account, idStore, updateKeys, zcapClient, ladderSeed, recordDigest, onCollected, now = Date.now() }) {
142
178
  const pointedDid = delegatedClientsPointer({ doc: account.doc });
143
179
  if (pointedDid === undefined) {
144
- return { swap: 'no-pointer', collected: [], failed: [] };
180
+ return { swap: 'no-pointer', collected: [], deferred: [], failed: [] };
145
181
  }
146
182
  // The annex logs pin in the same store the account log does: one pin
147
183
  // store per client, every slot derived by the store that serves it.
148
184
  const pinStore = idStore.pin.store;
149
- const { spaceId } = clientAnnexDidParts({ did: pointedDid });
185
+ const { spaceId, generationId: pointedGenerationId } = clientAnnexDidParts({
186
+ did: pointedDid
187
+ });
150
188
  const failed = [];
151
- // 1. The swap, when the quarterly cadence is due. Its own failure is
152
- // collected under the pointed generation's id rather than aborting the
153
- // pass: the collect fan-out below still cleans what it can, and the next
154
- // remembered login re-attempts the swap from durable state.
155
- let swap = 'not-due';
156
- let currentDid = pointedDid;
157
- if (clientAnnexGcDue({ log: account.log, now })) {
158
- swap =
159
- ladderSeed === undefined
160
- ? 'no-ladder-seed'
161
- : await (async () => {
162
- const oldParts = clientAnnexDidParts({ did: pointedDid });
163
- try {
164
- const old = await readClientAnnexGeneration({
165
- was,
166
- spaceId,
167
- generationId: oldParts.generationId,
168
- pinStore,
169
- expectedDid: pointedDid
170
- });
171
- if (old === undefined ||
172
- !generationQuiet({ log: old.log, now })) {
173
- // A missing pointed log is a broken state the collect
174
- // fan-out cannot touch (the pointer still names it); defer
175
- // rather than swap onto a generation this pass could not
176
- // read as quiet.
177
- return old === undefined ? 'failed' : 'deferred-live';
178
- }
179
- const swapped = await replaceClientAnnexGeneration({
180
- was,
181
- wasServerUrl,
182
- accountSpaceId,
183
- account,
184
- idStore,
185
- signer: { kind: 'enrolled', updateKeys },
186
- zcapClient,
187
- ladderSeed,
188
- clientAnnexSpaceId: spaceId,
189
- oldGeneration: old,
190
- now
191
- });
192
- // A `refused` revoke is not reported here: the swap
193
- // completed, the old generation is now unpointed, and the
194
- // fan-out below re-attempts its revocation in this same pass,
195
- // reporting the failure under its id if it fails again.
196
- currentDid = swapped.clientAnnexDid;
197
- return 'replaced';
198
- }
199
- catch (err) {
200
- failed.push({ generationId: oldParts.generationId, error: err });
201
- return 'failed';
202
- }
203
- })();
189
+ // 1. The swap: the quarterly one when the cadence is due and the pointed
190
+ // generation is quiet, or the off-cadence repair when the pointed
191
+ // generation's log does not exist. The pointed log is read on every pass
192
+ // for the second reason: a pointer naming a dead generation shuts every
193
+ // transient visit out, and the cadence alone would not re-read it for a
194
+ // quarter. A failure is collected under the pointed generation's id
195
+ // rather than aborting the pass: the collect fan-out below still cleans
196
+ // what it can, and the next remembered login re-attempts from durable
197
+ // state.
198
+ //
199
+ // Both arms decide on the account log re-read under this client's pin,
200
+ // not on the caller's pre-pass view, which a sibling's swap since then
201
+ // can have left naming a generation the account no longer points at (the
202
+ // module header has the account). The re-read failing rejects the pass:
203
+ // there is nothing safe to swap or collect against.
204
+ const head = await readPublishedLogOrThrow({
205
+ idStore,
206
+ expectedDid: account.did,
207
+ missingMessage: 'did:webvh: did.jsonl is missing; nothing to collect against.'
208
+ });
209
+ const headPointer = delegatedClientsPointer({ doc: head.doc });
210
+ if (headPointer === undefined) {
211
+ return { swap: 'no-pointer', collected: [], deferred: [], failed: [] };
204
212
  }
205
- // 2. The collect fan-out: every `gen-` collection the (possibly fresh)
206
- // pointer does not name. Orphan discovery is a plain prefix match over the
207
- // auxiliary Space's collection listing -- no registry of generations
208
- // exists anywhere -- and a torn GC's old generation, a torn signup's
209
- // orphan, and a double-genesis loser get identical treatment.
210
- const currentGenerationId = clientAnnexDidParts({
211
- did: currentDid
212
- }).generationId;
213
+ // Whether the swap reached a write: set before the mint, so a swap torn
214
+ // or raced anywhere past that point re-reads the account log below.
215
+ let swapWrote = false;
216
+ const swap = await (async () => {
217
+ try {
218
+ if (headPointer !== pointedDid) {
219
+ return 'not-due';
220
+ }
221
+ const pointed = await readClientAnnexGeneration({
222
+ was,
223
+ spaceId,
224
+ generationId: pointedGenerationId,
225
+ pinStore,
226
+ expectedDid: pointedDid
227
+ });
228
+ // The caller's view and the re-read head name the same pointer, so
229
+ // the entry that established it, and the cadence read off that
230
+ // entry's `versionTime`, are the same in both.
231
+ if (pointed !== undefined &&
232
+ !clientAnnexGcDue({ log: account.log, now })) {
233
+ return 'not-due';
234
+ }
235
+ if (pointed !== undefined &&
236
+ !generationQuiet({ log: pointed.log, now })) {
237
+ return 'deferred-live';
238
+ }
239
+ if (ladderSeed === undefined) {
240
+ return 'no-ladder-seed';
241
+ }
242
+ if (pointed === undefined) {
243
+ await assertAnnexSpacePresent({ was, spaceId });
244
+ }
245
+ // A `refused` revoke is not reported here: the swap completed, the old
246
+ // generation is now unpointed, and the fan-out below re-attempts its
247
+ // revocation in this same pass, reporting the failure under its id if
248
+ // it fails again. A dead pointed generation has no bytes to revoke; the
249
+ // revoke stage reports `log-absent` and pointer equality retires its
250
+ // delegation on a conforming server.
251
+ swapWrote = true;
252
+ await replaceClientAnnexGeneration({
253
+ was,
254
+ wasServerUrl,
255
+ accountSpaceId,
256
+ account: head,
257
+ idStore,
258
+ signer: { kind: 'enrolled', updateKeys },
259
+ zcapClient,
260
+ ladderSeed,
261
+ clientAnnexSpaceId: spaceId,
262
+ ...(pointed !== undefined ? { oldGeneration: pointed } : {}),
263
+ head,
264
+ now
265
+ });
266
+ return pointed === undefined ? 'repaired' : 'replaced';
267
+ }
268
+ catch (err) {
269
+ if (err instanceof DelegatedClientsPointerMovedError) {
270
+ // A sibling client re-pointed while this pass minted. Its pointer
271
+ // stands, and the generation this pass minted is an unpointed orphan
272
+ // a later pass collects once it is GC-quiet.
273
+ return 'not-due';
274
+ }
275
+ failed.push({ generationId: pointedGenerationId, error: err });
276
+ return 'failed';
277
+ }
278
+ })();
279
+ // 2. The pointer the fan-out compares against: the account log as the
280
+ // host serves it now, not the caller's pre-pass view and not what this
281
+ // pass believes it published. A swap that reached a write is re-read
282
+ // under this client's pin, since its re-point may have landed with the
283
+ // response lost, or lost to a sibling's; a swap that wrote nothing left
284
+ // the head read above as that view. A document with no pointer collects
285
+ // nothing: the annex inventory is being removed, and nothing under it is
286
+ // this pass's to delete.
287
+ const fresh = swapWrote
288
+ ? await readPublishedLogOrThrow({
289
+ idStore,
290
+ expectedDid: account.did,
291
+ missingMessage: 'did:webvh: did.jsonl is missing; nothing to collect against.'
292
+ })
293
+ : head;
294
+ const freshPointer = delegatedClientsPointer({ doc: fresh.doc });
295
+ if (freshPointer === undefined) {
296
+ return { swap, collected: [], deferred: [], failed };
297
+ }
298
+ const freshParts = clientAnnexDidParts({ did: freshPointer });
299
+ // A pointer that moved to another auxiliary Space leaves this one wholly
300
+ // unpointed; the quiet guard still keeps anything young in it.
301
+ const currentGenerationId = freshParts.spaceId === spaceId ? freshParts.generationId : undefined;
302
+ // Every annex DID the fresh log ever pointed at: a generation among them
303
+ // is a superseded one, not a sibling's fresh mint, so the quiet gate does
304
+ // not apply to it.
305
+ const everPointed = new Set(delegatedClientsPointerHistory({ log: fresh.log }));
306
+ // 3. The collect fan-out: every `gen-` collection the fresh pointer does
307
+ // not name. Orphan discovery is a plain prefix match over the auxiliary
308
+ // Space's collection listing -- no registry of generations exists anywhere
309
+ // -- and a torn GC's old generation, a torn signup's orphan, a sibling's
310
+ // superseded generation, and a double-genesis loser get identical
311
+ // treatment. One the log never pointed at is collected only once GC-quiet
312
+ // (`deferred` otherwise), so a sibling's fresh generation is never
313
+ // collected between its mint and its re-point.
213
314
  const space = was.space(spaceId);
214
315
  const stale = [];
215
316
  for await (const page of space.collectionsPages()) {
@@ -221,9 +322,10 @@ export async function runClientAnnexGc({ was, wasServerUrl, accountSpaceId, acco
221
322
  }
222
323
  }
223
324
  const collected = [];
325
+ const deferred = [];
224
326
  await Promise.all(stale.map(async (generationId) => {
225
327
  try {
226
- await collectOneGeneration({
328
+ const outcome = await collectOneGeneration({
227
329
  was,
228
330
  spaceId,
229
331
  generationId,
@@ -231,15 +333,21 @@ export async function runClientAnnexGc({ was, wasServerUrl, accountSpaceId, acco
231
333
  recordDigest,
232
334
  onCollected,
233
335
  now,
234
- accountDoc: account.doc
336
+ accountDoc: fresh.doc,
337
+ everPointed
235
338
  });
236
- collected.push(generationId);
339
+ if (outcome === 'collected') {
340
+ collected.push(generationId);
341
+ }
342
+ else {
343
+ deferred.push(generationId);
344
+ }
237
345
  }
238
346
  catch (err) {
239
347
  failed.push({ generationId, error: err });
240
348
  }
241
349
  }));
242
- return { swap, pointedDid: currentDid, collected, failed };
350
+ return { swap, pointedDid: freshPointer, collected, deferred, failed };
243
351
  }
244
352
  /**
245
353
  * Reads and verifies one generation's published annex log, or resolves
@@ -280,12 +388,17 @@ async function readClientAnnexGeneration({ was, spaceId, generationId, pinStore,
280
388
  * off-cadence swap whose pointed log does not exist), the revoke stage is
281
389
  * skipped and the old generation's delegation dies with the re-point on a
282
390
  * conforming server
391
+ * @param options.head {PublishedWebvhLog} the verified account head the
392
+ * caller read; the re-point builds on it and lands only while the account
393
+ * log still points at the generation it names
283
394
  * @param options.now {number} epoch milliseconds, read against the old
284
395
  * delegation's own `expires`
285
396
  * @returns {Promise<ClientAnnexGenerationSwap>} the fresh annex DID and
286
397
  * what the revoke stage did
398
+ * @throws {DelegatedClientsPointerMovedError} when the account log no
399
+ * longer points at the generation `head` names
287
400
  */
288
- async function replaceClientAnnexGeneration({ was, wasServerUrl, accountSpaceId, account, idStore, signer, zcapClient, ladderSeed, clientAnnexSpaceId, oldGeneration, now }) {
401
+ async function replaceClientAnnexGeneration({ was, wasServerUrl, accountSpaceId, account, idStore, signer, zcapClient, ladderSeed, clientAnnexSpaceId, oldGeneration, head, now }) {
289
402
  const pinStore = idStore.pin.store;
290
403
  // 1. Mint + genesis: a fresh generation in the existing auxiliary Space
291
404
  // (the typed-Space ensure no-ops on it; the controller argument is only
@@ -365,15 +478,21 @@ async function replaceClientAnnexGeneration({ was, wasServerUrl, accountSpaceId,
365
478
  else {
366
479
  revoke = oldGeneration === undefined ? 'log-absent' : 'no-delegation';
367
480
  }
368
- // 4. Re-point the account document at the fresh generation. On a
369
- // conforming server the pointer equality itself kills the old
370
- // generation's ladder-signed delegations; the explicit revoke above
371
- // covered the fail-open case and the enrolled-client-signed ones.
481
+ // 4. Re-point the account document at the fresh generation, while it
482
+ // still points at the one this swap replaces: the first attempt builds on
483
+ // the caller's head, and a lost compare-and-swap re-reads and checks the
484
+ // pointer again, where an unconditional re-point would rebase over a
485
+ // sibling client's. On a conforming server the pointer equality itself
486
+ // kills the old generation's ladder-signed delegations; the explicit
487
+ // revoke above covered the fail-open case and the enrolled-client-signed
488
+ // ones.
372
489
  await setDelegatedClientsPointer({
373
490
  idStore,
374
491
  signer,
375
492
  clientAnnexDid: minted.did,
376
- expectedDid: account.did
493
+ expectedDid: account.did,
494
+ expectedPointer: delegatedClientsPointer({ doc: head.doc }),
495
+ published: head
377
496
  });
378
497
  return {
379
498
  clientAnnexDid: minted.did,
@@ -406,6 +525,12 @@ async function replaceClientAnnexGeneration({ was, wasServerUrl, accountSpaceId,
406
525
  * refuses that chain, and the revoke stage reads the refusal against the
407
526
  * caller's `account.doc` and reports `signer-gone`.
408
527
  *
528
+ * The re-point lands only while the account log, re-read under this
529
+ * client's pin before the mint, still points at the generation the caller's
530
+ * `account.doc` names. A sibling's re-point that lands first stands, and the
531
+ * swap throws rather than move the account off it; the caller re-runs its
532
+ * ceremony over a fresh read.
533
+ *
409
534
  * @param options {object} see {@link runClientAnnexGc} for the shared
410
535
  * members ({ was, wasServerUrl, accountSpaceId, account, idStore,
411
536
  * updateKeys, zcapClient }); `ladderSeed` here is the SURVIVING
@@ -413,6 +538,8 @@ async function replaceClientAnnexGeneration({ was, wasServerUrl, accountSpaceId,
413
538
  * @param [options.now] {number} epoch milliseconds, for tests
414
539
  * @returns {Promise<ClientAnnexGenerationSwap>} the fresh annex DID and
415
540
  * what the revoke stage did
541
+ * @throws {Error} `DelegatedClientsPointerMovedError` when the account log
542
+ * no longer points at the generation `account.doc` names
416
543
  */
417
544
  export async function swapClientAnnexGeneration({ was, wasServerUrl, accountSpaceId, account, idStore, signer, zcapClient, ladderSeed, now = Date.now() }) {
418
545
  const pointedDid = delegatedClientsPointer({ doc: account.doc });
@@ -421,6 +548,14 @@ export async function swapClientAnnexGeneration({ was, wasServerUrl, accountSpac
421
548
  'service entry; no generation exists to swap.');
422
549
  }
423
550
  const { spaceId, generationId } = clientAnnexDidParts({ did: pointedDid });
551
+ const head = await readPublishedLogOrThrow({
552
+ idStore,
553
+ expectedDid: account.did,
554
+ missingMessage: 'did:webvh: did.jsonl is missing; nothing to point at a client annex.'
555
+ });
556
+ if (delegatedClientsPointer({ doc: head.doc }) !== pointedDid) {
557
+ throw new DelegatedClientsPointerMovedError();
558
+ }
424
559
  const oldGeneration = await readClientAnnexGeneration({
425
560
  was,
426
561
  spaceId,
@@ -439,9 +574,32 @@ export async function swapClientAnnexGeneration({ was, wasServerUrl, accountSpac
439
574
  ladderSeed,
440
575
  clientAnnexSpaceId: spaceId,
441
576
  ...(oldGeneration !== undefined ? { oldGeneration } : {}),
577
+ head,
442
578
  now
443
579
  });
444
580
  }
581
+ /**
582
+ * Refuses the repair unless the auxiliary Space itself answers. The
583
+ * enrolled client reads the Space Metadata object at the Space's `meta`
584
+ * sub-resource. A 404 is absence or a masked unauthorized read, and either
585
+ * way minting into the Space is not this pass's to do; a Space that is gone
586
+ * is replaced by the transient readiness ensure, whose two-probe rule tells
587
+ * the two apart. Any other non-2xx answer says nothing about the Space, and
588
+ * the read itself throws on it, so the repair refuses rather than mint into
589
+ * a Space it could not read.
590
+ *
591
+ * @param options {object}
592
+ * @param options.was {WasClient}
593
+ * @param options.spaceId {string} the auxiliary annex Space's id
594
+ * @returns {Promise<void>}
595
+ */
596
+ async function assertAnnexSpacePresent({ was, spaceId }) {
597
+ const answer = await readSpaceMetadata({ was, annexSpaceId: spaceId });
598
+ if (answer === 'not-found') {
599
+ throw new Error(`client annex: the pointed auxiliary Space "${spaceId}" is gone or ` +
600
+ 'unreadable; the repair mints nothing into it.');
601
+ }
602
+ }
445
603
  /**
446
604
  * Collects one non-pointed generation: revoke its embedded delegation
447
605
  * (blind; a genuine `AlreadyRevokedError` reads as success, a delegation
@@ -452,7 +610,11 @@ export async function swapClientAnnexGeneration({ was, wasServerUrl, accountSpac
452
610
  * local cleanup. A generation whose `did.jsonl` does not exist held no
453
611
  * visits and is deleted without a digest row; one whose log exists but fails
454
612
  * verification is kept and reported (deleting it would destroy the evidence
455
- * of tampering).
613
+ * of tampering). One whose log exists, that the account log never pointed
614
+ * at, and that is not GC-quiet is kept untouched and resolves `deferred`:
615
+ * its newest entry is too recent to rule out a sibling client mid-swap onto
616
+ * it, and the next pass meets it quiet. One the account log once pointed at
617
+ * is collected whatever its age.
456
618
  *
457
619
  * @param options {object}
458
620
  * @param options.was {WasClient}
@@ -464,12 +626,14 @@ export async function swapClientAnnexGeneration({ was, wasServerUrl, accountSpac
464
626
  * @param [options.onCollected] {Function} see {@link runClientAnnexGc}
465
627
  * @param options.now {number} epoch milliseconds, read against the
466
628
  * embedded delegation's own `expires`
467
- * @param options.accountDoc {PublishedKeyDocument} the locally VERIFIED
468
- * account document, read against the embedded delegation's proof key when
469
- * the server refuses the revocation
470
- * @returns {Promise<void>}
629
+ * @param options.accountDoc {PublishedKeyDocument} the VERIFIED account
630
+ * document the pass re-read, read against the embedded delegation's proof
631
+ * key when the server refuses the revocation
632
+ * @param options.everPointed {ReadonlySet<string>} every annex DID the
633
+ * re-read account log has ever pointed at
634
+ * @returns {Promise<'collected' | 'deferred'>}
471
635
  */
472
- async function collectOneGeneration({ was, spaceId, generationId, pinStore, recordDigest, onCollected, now, accountDoc }) {
636
+ async function collectOneGeneration({ was, spaceId, generationId, pinStore, recordDigest, onCollected, now, accountDoc, everPointed }) {
473
637
  // No expectedDid: an orphan was possibly never pointed from this client.
474
638
  // The read runs under the store's own chain-head pin; the slot it
475
639
  // establishes is the caller's to drop (`onCollected`) with the generation.
@@ -482,6 +646,10 @@ async function collectOneGeneration({ was, spaceId, generationId, pinStore, reco
482
646
  pinStore
483
647
  });
484
648
  if (published !== undefined) {
649
+ if (!everPointed.has(published.did) &&
650
+ !generationQuiet({ log: published.log, now })) {
651
+ return 'deferred';
652
+ }
485
653
  const oldDelegation = embeddedGenerationDelegation({ doc: published.doc });
486
654
  if (oldDelegation !== undefined) {
487
655
  await revokeTreatingAlreadyRevokedAsSuccess({
@@ -504,5 +672,6 @@ async function collectOneGeneration({ was, spaceId, generationId, pinStore, reco
504
672
  // Idempotent: a re-run's delete of an already-deleted collection resolves.
505
673
  await was.space(spaceId).collection(generationId).delete();
506
674
  await onCollected?.({ generationId });
675
+ return 'collected';
507
676
  }
508
677
  //# sourceMappingURL=gc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gc.js","sourceRoot":"","sources":["../../src/clientAnnex/gc.ts"],"names":[],"mappings":"AAwDA,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,uBAAuB,EACvB,4BAA4B,EAC5B,iCAAiC,EACjC,oBAAoB,EACpB,mCAAmC,EACnC,wBAAwB,EACxB,0BAA0B,EAC1B,qCAAqC,EACrC,0BAA0B,EAC3B,MAAM,UAAU,CAAA;AAUjB;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAE/D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAE5D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAEvD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oCAAoC,CAAC,EACnD,GAAG,EAGJ;IACC,IAAI,aAAiC,CAAA;IACrC,IAAI,QAA4B,CAAA;IAChC,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE,CAAC;QACxB,MAAM,OAAO,GAAG,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C,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;gBAChC,UAAU,EAAE,aAAa;gBACzB,GAAG;gBACH,UAAU;aACX,CAAC,CAAA;QACJ,CAAC;QACD,kEAAkE;QAClE,oEAAoE;QACpE,iEAAiE;QACjE,MAAM,YAAY,CAAC;YACjB,YAAY;YACZ,UAAU,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW;YACzC,SAAS,EAAE,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,WAAW;YAC/D,UAAU,EAAE,SAAS,CAAC,GAAG,CAAC,MAAM;SACjC,CAAC,CAAA;IACJ,CAAC;IAED,2EAA2E;IAC3E,MAAM,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAA;IAC1D,MAAM,WAAW,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,CAAA;IACrC,OAAO,WAAW,CAAA;AACpB,CAAC"}
@@ -203,6 +203,38 @@ export interface ClientAnnexGenerationEnsureOutcome {
203
203
  */
204
204
  generationLog?: PublishedWebvhLog;
205
205
  }
206
+ /**
207
+ * One Space Metadata read, judged by its HTTP STATUS alone. A 404 is
208
+ * `'not-found'`; a 2xx is `'present'`, whatever its body says, since a
209
+ * Space served with an unreadable body is a present Space and reading it
210
+ * as absence is exactly what would re-point a live account. Every other
211
+ * answer -- a transport failure, a 5xx, a 4xx that is not 404 -- throws,
212
+ * so nothing but a real 404 can ever reach the absence decision.
213
+ *
214
+ * The Space Description lives at the Space's `meta` sub-resource, which is
215
+ * both where the read goes and what the probe capability targets. The
216
+ * container URL itself is not read here: it lists the Space's Collections
217
+ * rather than describing it, and the probe's one allowed verb is scoped to
218
+ * the Metadata object.
219
+ *
220
+ * The read goes through the raw signed request rather than the
221
+ * `describe()` handle, whose null-on-404 translation also swallows 401 and
222
+ * 403 and an unparseable body.
223
+ *
224
+ * @param options {object}
225
+ * @param options.was {WasClient} the client whose signer invokes (the
226
+ * standing client at a transient visit, an enrolled client at the GC
227
+ * repair)
228
+ * @param options.annexSpaceId {string}
229
+ * @param [options.capability] {IZcap} the attached capability; absent
230
+ * means a root invocation
231
+ * @returns {Promise<'present' | 'not-found'>}
232
+ */
233
+ export declare function readSpaceMetadata({ was, annexSpaceId, capability }: {
234
+ was: WasClient;
235
+ annexSpaceId: string;
236
+ capability?: IZcap;
237
+ }): Promise<'present' | 'not-found'>;
206
238
  /**
207
239
  * Ensures a transient visit can reach a live client-annex generation with a
208
240
  * current generation delegation and a usable sibling delegation, mending
@@ -1 +1 @@
1
- {"version":3,"file":"heal.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/heal.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAGxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAM3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAiBxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEnD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAIjE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,sCAAsC,GAChD,wB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