@interop/wallet-core 0.71.0 → 0.72.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 (135) hide show
  1. package/README.md +14 -3
  2. package/dist/clientAnnex/forget.d.ts.map +1 -1
  3. package/dist/clientAnnex/forget.js +4 -3
  4. package/dist/clientAnnex/forget.js.map +1 -1
  5. package/dist/clientAnnex/forgetLast.d.ts +55 -35
  6. package/dist/clientAnnex/forgetLast.d.ts.map +1 -1
  7. package/dist/clientAnnex/forgetLast.js +87 -35
  8. package/dist/clientAnnex/forgetLast.js.map +1 -1
  9. package/dist/clientAnnex/gc.d.ts +48 -19
  10. package/dist/clientAnnex/gc.d.ts.map +1 -1
  11. package/dist/clientAnnex/gc.js +82 -31
  12. package/dist/clientAnnex/gc.js.map +1 -1
  13. package/dist/clientAnnex/grantRevocation.d.ts +137 -0
  14. package/dist/clientAnnex/grantRevocation.d.ts.map +1 -0
  15. package/dist/clientAnnex/grantRevocation.js +135 -0
  16. package/dist/clientAnnex/grantRevocation.js.map +1 -0
  17. package/dist/clientAnnex/index.d.ts +4 -2
  18. package/dist/clientAnnex/index.d.ts.map +1 -1
  19. package/dist/clientAnnex/index.js +2 -1
  20. package/dist/clientAnnex/index.js.map +1 -1
  21. package/dist/clientAnnex/ladderAnchored.d.ts +0 -22
  22. package/dist/clientAnnex/ladderAnchored.d.ts.map +1 -1
  23. package/dist/clientAnnex/ladderAnchored.js +8 -34
  24. package/dist/clientAnnex/ladderAnchored.js.map +1 -1
  25. package/dist/clientAnnex/log.d.ts +65 -13
  26. package/dist/clientAnnex/log.d.ts.map +1 -1
  27. package/dist/clientAnnex/log.js +160 -67
  28. package/dist/clientAnnex/log.js.map +1 -1
  29. package/dist/clientAnnex/mend.js +51 -24
  30. package/dist/clientAnnex/mend.js.map +1 -1
  31. package/dist/clients/grantState.d.ts +6 -3
  32. package/dist/clients/grantState.d.ts.map +1 -1
  33. package/dist/clients/grantState.js +6 -3
  34. package/dist/clients/grantState.js.map +1 -1
  35. package/dist/clients/policy.d.ts.map +1 -1
  36. package/dist/clients/policy.js +3 -0
  37. package/dist/clients/policy.js.map +1 -1
  38. package/dist/keyring/fetch.d.ts +6 -2
  39. package/dist/keyring/fetch.d.ts.map +1 -1
  40. package/dist/keyring/fetch.js +7 -3
  41. package/dist/keyring/fetch.js.map +1 -1
  42. package/dist/keyring/index.d.ts +7 -5
  43. package/dist/keyring/index.d.ts.map +1 -1
  44. package/dist/keyring/index.js +7 -5
  45. package/dist/keyring/index.js.map +1 -1
  46. package/dist/keyring/kdf.d.ts +1 -1
  47. package/dist/keyring/kdf.d.ts.map +1 -1
  48. package/dist/keyring/kdf.js +1 -1
  49. package/dist/keyring/kdf.js.map +1 -1
  50. package/dist/keyring/unlockSpace.d.ts +45 -68
  51. package/dist/keyring/unlockSpace.d.ts.map +1 -1
  52. package/dist/keyring/unlockSpace.js +66 -88
  53. package/dist/keyring/unlockSpace.js.map +1 -1
  54. package/dist/menders/derive.d.ts +85 -0
  55. package/dist/menders/derive.d.ts.map +1 -0
  56. package/dist/menders/derive.js +138 -0
  57. package/dist/menders/derive.js.map +1 -0
  58. package/dist/menders/ids.d.ts +20 -0
  59. package/dist/menders/ids.d.ts.map +1 -0
  60. package/dist/menders/ids.js +85 -0
  61. package/dist/menders/ids.js.map +1 -0
  62. package/dist/menders/index.d.ts +42 -0
  63. package/dist/menders/index.d.ts.map +1 -0
  64. package/dist/menders/index.js +37 -0
  65. package/dist/menders/index.js.map +1 -0
  66. package/dist/menders/registry.d.ts +84 -0
  67. package/dist/menders/registry.d.ts.map +1 -0
  68. package/dist/menders/registry.js +62 -0
  69. package/dist/menders/registry.js.map +1 -0
  70. package/dist/menders/runner.d.ts +143 -0
  71. package/dist/menders/runner.d.ts.map +1 -0
  72. package/dist/menders/runner.js +222 -0
  73. package/dist/menders/runner.js.map +1 -0
  74. package/dist/menders/types.d.ts +146 -0
  75. package/dist/menders/types.d.ts.map +1 -0
  76. package/dist/menders/types.js +2 -0
  77. package/dist/menders/types.js.map +1 -0
  78. package/dist/menders/vocabulary.d.ts +88 -0
  79. package/dist/menders/vocabulary.d.ts.map +1 -0
  80. package/dist/menders/vocabulary.js +83 -0
  81. package/dist/menders/vocabulary.js.map +1 -0
  82. package/dist/recovery/index.d.ts +1 -1
  83. package/dist/recovery/index.js +1 -1
  84. package/dist/recovery/recoveryWebvh.d.ts.map +1 -1
  85. package/dist/recovery/recoveryWebvh.js +11 -17
  86. package/dist/recovery/recoveryWebvh.js.map +1 -1
  87. package/dist/resourceLog/document.d.ts.map +1 -1
  88. package/dist/resourceLog/document.js +30 -6
  89. package/dist/resourceLog/document.js.map +1 -1
  90. package/dist/space/activity.d.ts +70 -0
  91. package/dist/space/activity.d.ts.map +1 -1
  92. package/dist/space/activity.js +82 -0
  93. package/dist/space/activity.js.map +1 -1
  94. package/dist/space/deleteSpace.d.ts.map +1 -1
  95. package/dist/space/deleteSpace.js +6 -5
  96. package/dist/space/deleteSpace.js.map +1 -1
  97. package/dist/space/index.d.ts +1 -1
  98. package/dist/space/index.d.ts.map +1 -1
  99. package/dist/space/index.js +1 -1
  100. package/dist/space/index.js.map +1 -1
  101. package/dist/testing.d.ts +78 -0
  102. package/dist/testing.d.ts.map +1 -0
  103. package/dist/testing.js +89 -0
  104. package/dist/testing.js.map +1 -0
  105. package/dist/unlock/index.d.ts +2 -2
  106. package/dist/unlock/index.d.ts.map +1 -1
  107. package/dist/unlock/index.js +1 -1
  108. package/dist/unlock/retire.d.ts +20 -5
  109. package/dist/unlock/retire.d.ts.map +1 -1
  110. package/dist/unlock/retire.js.map +1 -1
  111. package/dist/unlock/standingWebvh.d.ts +22 -2
  112. package/dist/unlock/standingWebvh.d.ts.map +1 -1
  113. package/dist/unlock/standingWebvh.js +22 -2
  114. package/dist/unlock/standingWebvh.js.map +1 -1
  115. package/dist/webvh/didWebvh.d.ts +33 -0
  116. package/dist/webvh/didWebvh.d.ts.map +1 -1
  117. package/dist/webvh/didWebvh.js +50 -11
  118. package/dist/webvh/didWebvh.js.map +1 -1
  119. package/dist/webvh/enrollClient.d.ts.map +1 -1
  120. package/dist/webvh/enrollClient.js +4 -16
  121. package/dist/webvh/enrollClient.js.map +1 -1
  122. package/dist/webvh/index.d.ts +13 -3
  123. package/dist/webvh/index.d.ts.map +1 -1
  124. package/dist/webvh/index.js +13 -3
  125. package/dist/webvh/index.js.map +1 -1
  126. package/dist/webvh/listClients.d.ts +47 -0
  127. package/dist/webvh/listClients.d.ts.map +1 -1
  128. package/dist/webvh/listClients.js +40 -1
  129. package/dist/webvh/listClients.js.map +1 -1
  130. package/dist/webvh/standingZcap.d.ts +66 -0
  131. package/dist/webvh/standingZcap.d.ts.map +1 -1
  132. package/dist/webvh/standingZcap.js +96 -0
  133. package/dist/webvh/standingZcap.js.map +1 -1
  134. package/dist/webvh/zcap.d.ts +1 -1
  135. package/package.json +18 -6
package/README.md CHANGED
@@ -161,6 +161,17 @@ The subpaths:
161
161
  per-visit readiness ensure, and the transient-recovery continuation. It sits
162
162
  on top of the other subpaths and none of them import from it.
163
163
 
164
+ - **`@interop/wallet-core/menders`** -- the mender registry keyed by invariant:
165
+ the `InvariantDeclaration` and `Registration` types, the closed vocabularies
166
+ (authorities, triggers, account shapes, evidence, mend outcomes, gap kinds),
167
+ the `INVARIANT_IDS` census, the `menderRegistry` readers with
168
+ `heldAuthorities`, the `runMenderBlock` runner with its
169
+ `mendReportAccumulator`, and the derived sets a wallet's audit tests pin
170
+ (`transientReachableInvariants`, `deriveGaps`, `undeclaredGaps`,
171
+ `undeclaredInvariants`). A wallet declares its own invariant table and its own
172
+ registrations; nothing here executes a ceremony, and the subpath imports
173
+ nothing from the signing or KMS graph.
174
+
164
175
  The request pipeline (input classification, VPR parsing, cryptosuite
165
176
  negotiation, VP composition, the App Connect app-key credential) now lives in
166
177
  [`@interop/wallet-request`](https://npm.im/@interop/wallet-request).
@@ -201,9 +212,9 @@ import {
201
212
 
202
213
  The `sync` and `space` subpaths are re-exported from the package root as well.
203
214
  Every other subpath (`webvh`, `resourceLog`, `keys`, `clients`, `descriptors`,
204
- `keyring`, `enrollment`, `genesis`, `unlock`, `recovery`, `clientAnnex`) is
205
- import-directly-only, so consumers of the root never pull the signing / KMS /
206
- document-loader dependency graph.
215
+ `keyring`, `enrollment`, `genesis`, `unlock`, `recovery`, `clientAnnex`,
216
+ `menders`) is import-directly-only, so consumers of the root never pull the
217
+ signing / KMS / document-loader dependency graph.
207
218
 
208
219
  One further export is a leaf of that same isolation, carved out to stay
209
220
  dependency-light: `keys/clientKeyRecord` is the client-key record codec alone,
@@ -1 +1 @@
1
- {"version":3,"file":"forget.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/forget.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAA;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AAMzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE;;;;;;;GAOG;AACH,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,oBAAoB,CAAA;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAA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BAAgB,CAAC,EAAE,kBAAkB,CAAA;IACrC,WAAW,EAAE,kBAAkB,CAAA;CAChC,GAAG,OAAO,CAAC,0BAA0B,CAAC,CA+DtC"}
@@ -1,6 +1,7 @@
1
1
  import { readPublishedLogOrThrow } from '../webvh/didWebvh.js';
2
+ import { isLastEnrolledClient } from '../webvh/listClients.js';
2
3
  import { retireRosterRecipientAndCascade, rosterRecipientKid } from '../keys/index.js';
3
- import { forgetWebvhClient, isSoleEnrolledClient, LastEnrolledClientForgetError } from './ladderAnchored.js';
4
+ import { forgetWebvhClient, LastEnrolledClientForgetError } from './ladderAnchored.js';
4
5
  /**
5
6
  * Forgets one enrolled client -- this browser's own -- from its
6
7
  * account. See the module doc for the stage order (rotation and fan-out
@@ -56,9 +57,9 @@ export async function forgetEnrolledClient({ logStore, clientLogStore, ladderSee
56
57
  expectedDid,
57
58
  missingMessage: 'did:webvh: did.jsonl is missing; nothing to forget from.'
58
59
  });
59
- if (isSoleEnrolledClient({
60
+ if (isLastEnrolledClient({
60
61
  doc: published.doc,
61
- vmId: `${published.did}#${forgottenClient.signingKeyMultibase}`
62
+ signingVmId: `${published.did}#${forgottenClient.signingKeyMultibase}`
62
63
  })) {
63
64
  throw new LastEnrolledClientForgetError();
64
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"forget.js","sourceRoot":"","sources":["../../src/clientAnnex/forget.ts"],"names":[],"mappings":"AAsEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAG9D,OAAO,EACL,+BAA+B,EAC/B,kBAAkB,EAKnB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,6BAA6B,EAC9B,MAAM,qBAAqB,CAAA;AAoB5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,QAAQ,EACR,cAAc,EACd,UAAU,EACV,eAAe,EAC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AAW;KACZ,CAAC,CAAA;IAEF,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,QAAQ,EAAE,OAAO,CAAC,GAAG;QACrB,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,gBAAgB;YACvC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE;YACpE,CAAC,CAAC,EAAE,CAAC;KACR,CAAA;AACH,CAAC"}
@@ -59,20 +59,27 @@
59
59
  * an account where no enrolled client's login sweep will ever run again.
60
60
  * 3. **The collection fan-out**, still under this client's invocation
61
61
  * authority: every encrypted collection re-epochs onto the fresh key.
62
- * 4. **The generation-delegation replacement and revocations**: a fresh
63
- * ladder-signed generation delegation replaces the embedded one when the
64
- * house staleness policy, read against a projected post-edit document,
65
- * says it is owed -- this credential's ladder VM and the forgotten client
66
- * are both named retiring, which is every key this ceremony ends. Then
67
- * EVERY still-unexpired delegation the annex log's history ever embedded
68
- * that this credential's ladder VM signed is revoked at the server (a
69
- * renewal inside the 30-day window can leave two) -- closing the
70
- * resurrection window a reinstalled derived-key VM would otherwise
71
- * reopen. The replacement is what keeps the account
72
- * transient-login-reachable after the transition; replace-before-revoke
73
- * is what keeps a torn run from stranding the generation delegation-less.
74
- * A delegation a surviving sibling credential's ladder signed is left
75
- * standing, since the revocation loop never reaches it either.
62
+ * 4. **The generation-delegation revocations and replacement**: EVERY
63
+ * delegation the annex log's history ever embedded that this
64
+ * credential's ladder VM signed is revoked at the server (a renewal
65
+ * inside the 30-day window can leave two, and a prior torn run's own
66
+ * fresh one is another) -- closing the resurrection window a reinstalled
67
+ * derived-key VM would otherwise reopen -- and a fresh ladder-signed
68
+ * generation delegation replaces the embedded one when the house
69
+ * staleness policy, read against a projected post-edit document, says it
70
+ * is owed: this credential's ladder VM and the forgotten client are both
71
+ * named retiring, which is every key this ceremony ends. The order is
72
+ * revoke the historical members, replace, then revoke the embedded one.
73
+ * The replacement is what keeps the account transient-login-reachable
74
+ * after the transition; replace-before-revoke for the one live delegation
75
+ * is what keeps a torn run from stranding the generation
76
+ * delegation-less; and revoking the historical members before anything
77
+ * is minted is what keeps a revocation the server persistently refuses
78
+ * from adding a fresh doomed delegation per attempt (the first attempt
79
+ * mints once before the embedded delegation's refusal is seen; every
80
+ * re-run halts before minting). A delegation a
81
+ * surviving sibling credential's ladder signed is left standing, since
82
+ * the revocation loop never reaches it either.
76
83
  * 5. **The record re-bind seam** (`onBeforeRemoval`, required): the caller
77
84
  * re-signs the LOGIN credential's bridge and `delegatedClients` sibling
78
85
  * with the ladder VM and re-seals its unlock record with the credential
@@ -104,15 +111,19 @@
104
111
  * client's root authority rather than the credential's bridge -- the bridge
105
112
  * the strike may itself have rotted cannot authorize that write, and nothing
106
113
  * else on a one-client account could. Both entries of the pair are
107
- * idempotent and the pair is
108
- * skipped once the rotation has landed, an already-rotated
109
- * roster skips the append (no second ladder-signed append is ever
110
- * attempted), the fan-out is staleness-driven, a re-POSTed revocation's 400
111
- * already-revoked answer reads as success (decision 0006's resume contract),
112
- * the generation stage re-asks the same staleness policy (a prior run's own
113
- * fresh delegation reads as retiring, so a re-run churns one delegation and
114
- * strands nothing, while a sibling-signed one churns none), and the record
115
- * re-bind seam is idempotent. Torn after the removal entry is the
114
+ * idempotent and the pair is skipped once the rotation has landed, an
115
+ * already-rotated roster skips the append (no second ladder-signed append is
116
+ * ever attempted), the fan-out is staleness-driven, a re-POSTed revocation
117
+ * reads was-client's genuine `AlreadyRevokedError` as success and a
118
+ * delegation expired beyond the clock-skew margin skips the POST outright
119
+ * (decision 0006's resume contract) -- any OTHER revocation failure instead
120
+ * fails the stage and the whole ceremony, so a re-run resumes rather than
121
+ * the transition declaring the resurrection window closed on a delegation
122
+ * still standing -- the generation stage re-asks the same staleness policy
123
+ * (a prior run's own fresh delegation reads as retiring, so a re-run revokes
124
+ * it among the historical members and churns one delegation, while a
125
+ * sibling-signed one churns none), and the record re-bind seam is
126
+ * idempotent. Torn after the removal entry is the
116
127
  * finish-the-wipe state the app's next login maps.
117
128
  *
118
129
  * The honest limitation is the cascade's, as everywhere: ciphertext this
@@ -128,18 +139,27 @@ import { type CascadeCollections, type SealableEncryptionDescriptorStore, type U
128
139
  import type { UnlockLogStore } from '../unlock/standingWebvh.js';
129
140
  import { type ClientAnnexWriteStore } from './log.js';
130
141
  /**
131
- * What the ceremony's generation stage did: the revoked delegation ids, and
132
- * whether it wrote a replacement -- `false` with no `skipped` reason means
133
- * nothing was owed, the standing delegation being one a surviving sibling
134
- * credential's ladder signed. A `skipped` reason names the stage
135
- * that could not run -- `no-pointer` (the account points at no generation:
136
- * nothing to revoke or replace), `log-unreadable` (the pointed generation's
137
- * `did.jsonl` is gone; the delegation bytes are unrecoverable, decision
138
- * 0006's honest limit), `rung-uncommitted` (this credential cannot write the
139
- * generation's log; the account lands delegation-less until a
140
- * fresh-generation heal), `already-removed` (the whole ceremony completed on
141
- * an earlier run; nothing here can still invoke) -- and a skip never fails
142
- * the ceremony.
142
+ * What the ceremony's generation stage did: the ids of every doomed
143
+ * delegation actually revoked (the POST landed, or was-client answered the
144
+ * genuine `AlreadyRevokedError`; a doomed delegation expired beyond the
145
+ * clock-skew margin is skipped and not listed, and since every doomed
146
+ * delegation's proof key is this credential's own ladder VM, which stage 1
147
+ * just reinstalled, a server refusal is never read as signer death), and
148
+ * whether the stage wrote a replacement -- `false` with no `skipped`
149
+ * reason means nothing was owed, the standing delegation being one a
150
+ * surviving sibling credential's ladder signed. A `skipped` reason names
151
+ * the stage that could not run --
152
+ * `no-pointer` (the account points at no generation: nothing to revoke or
153
+ * replace), `log-unreadable` (the pointed generation's `did.jsonl` is gone;
154
+ * the delegation bytes are unrecoverable, decision 0006's honest limit),
155
+ * `rung-uncommitted` (this credential cannot write the generation's log; the
156
+ * account lands delegation-less until a fresh-generation heal),
157
+ * `already-removed` (the whole ceremony completed on an earlier run; nothing
158
+ * here can still invoke) -- and a skip never fails the ceremony. A doomed
159
+ * delegation that fails to revoke for any other reason is NOT a skip: the
160
+ * stage throws instead, so the ceremony halts before the removal entry
161
+ * rather than declaring the resurrection window closed while that delegation
162
+ * still stands.
143
163
  */
144
164
  export interface GenerationDelegationRetirement {
145
165
  revoked: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"forgetLast.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/forgetLast.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqHG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAK/E,OAAO,KAAK,EAAqB,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAA;AAGjC,OAAO,EAML,KAAK,kBAAkB,EACvB,KAAK,iCAAiC,EACtC,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAUhE,OAAO,EAQL,KAAK,qBAAqB,EAC3B,MAAM,UAAU,CAAA;AAEjB;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EACN,YAA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AsB,qBAAqB,CAAC,OAAO,EAAE;IACnD,KAAK,EAAE,cAAc,CAAA;IACrB,eAAe,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,kBAAkB,GAAG,eAAe,CAAC,CAAA;IAC1E,UAAU,EAAE,UAAU,CAAA;IACtB,eAAe,EAAE,iBAAiB,CAAA;IAClC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,GAAG,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAWrD"}
@@ -4,10 +4,11 @@ import { delegationProofKeyId } from '../webvh/standingZcap.js';
4
4
  import { vmFragmentOf } from '@interop/vh-resource-log';
5
5
  import { anchorRosterStoreAt, isSealableDescriptorStore, retireRosterRecipientAndCascade, rosterRecipientKid, rosterWrapsRecipient } from '../keys/index.js';
6
6
  import { ladderVmKeyMultibase } from './ladder.js';
7
- import { ladderVmIds, relationIds } from '../resourceLog/document.js';
7
+ import { ladderVmIds } from '../resourceLog/document.js';
8
+ import { enrolledClientVmIds, isLastEnrolledClient } from '../webvh/listClients.js';
8
9
  import { ladderVmZcapClient } from './zcap.js';
9
10
  import { clientForgetEntryOnce, installLadderVmWebvh, strikeLadderVmWebvh } from './ladderAnchored.js';
10
- import { clientAnnexDidParts, delegatedClientsPointer, ensureGenerationDelegationCurrent, generationDelegationHistory, mintGenerationDelegation, readClientAnnexLogOrAbsent, revokeTreatingAlreadyRevokedAsSuccess } from './log.js';
11
+ import { clientAnnexDidParts, delegatedClientsPointer, ensureGenerationDelegationCurrent, embeddedGenerationDelegation, generationDelegationHistory, mintGenerationDelegation, readClientAnnexLogOrAbsent, revokeTreatingAlreadyRevokedAsSuccess } from './log.js';
11
12
  /**
12
13
  * Forgets the account's LAST enrolled client -- this browser's own
13
14
  * -- transitioning the account to the client-less, ladder-anchored state.
@@ -147,8 +148,13 @@ export async function forgetLastEnrolledClient({ logStore, clientLogStore, ladde
147
148
  };
148
149
  }
149
150
  const signingVmId = `${before.did}#${forgottenClient.signingKeyMultibase}`;
150
- const invocationIds = relationIds(before.doc.capabilityInvocation);
151
- if (invocationIds.some(id => id !== signingVmId)) {
151
+ // The transition applies while this client stands alone. Past the removal
152
+ // entry (`present` above says the key or a hash lingers, the method is
153
+ // gone) the document lists no enrolled client at all, and the remaining
154
+ // stages converge on that state.
155
+ const enrolled = enrolledClientVmIds({ doc: before.doc });
156
+ if (enrolled.length > 0 &&
157
+ !isLastEnrolledClient({ doc: before.doc, signingVmId })) {
152
158
  throw new Error('did:webvh: another enrolled client remains; the last-client ' +
153
159
  'transition ceremony does not apply -- run the ordinary forget.');
154
160
  }
@@ -294,14 +300,18 @@ export async function forgetLastEnrolledClient({ logStore, clientLogStore, ladde
294
300
  };
295
301
  }
296
302
  /**
297
- * The generation stage: reads the pointed generation's log, replaces the
298
- * embedded delegation with a fresh ladder-signed one (so the account stays
299
- * transient-login-reachable), then revokes every still-unexpired delegation
300
- * the log's history embedded that this credential's ladder VM signed.
301
- * Replace-before-revoke is the tear-safety order: the fresh delegation is
302
- * never in the pre-replacement history, so the revocation loop cannot touch
303
- * it, and a run torn between the two leaves the generation with a live
304
- * delegation either way.
303
+ * The generation stage: reads the pointed generation's log, revokes every
304
+ * delegation the log's history embedded that this credential's ladder VM
305
+ * signed other than the currently embedded one, replaces the embedded
306
+ * delegation with a fresh ladder-signed one (so the account stays
307
+ * transient-login-reachable), then revokes the one it replaced. The doomed
308
+ * set is collected before the replacement, so the fresh delegation is never
309
+ * in it. Replace-before-revoke for the embedded delegation is the
310
+ * tear-safety order: a run torn anywhere leaves the generation with a live
311
+ * delegation. Revoke-before-mint for the historical members is the
312
+ * bounded-retry order: a revocation the server persistently refuses halts
313
+ * the stage before anything is minted, so a re-run finds the doomed set it
314
+ * left rather than one delegation larger.
305
315
  *
306
316
  * The replacement is decided by the house staleness policy read against a
307
317
  * PROJECTED post-edit document, not by an unconditional force: this
@@ -339,26 +349,73 @@ async function retireLadderGenerationDelegations({ doc, accountDid, ladderSeed,
339
349
  if (published === undefined) {
340
350
  return { revoked: [], replaced: false, skipped: 'log-unreadable' };
341
351
  }
342
- // The doomed set, collected BEFORE the replacement so the fresh delegation
343
- // can never join it: every delegation the history embedded whose proof key
344
- // is this credential's ladder VM and whose expiry has not passed. An
345
- // unparseable or absent expiry counts as unexpired -- fail-safe, since an
346
- // unbounded delegation is the worst resurrection credential.
352
+ // The doomed set: every delegation the history embedded whose proof key
353
+ // is this credential's ladder VM, the currently embedded one included. It
354
+ // is collected BEFORE the replacement so the fresh delegation can never
355
+ // join it, and split in two around the replacement: the historical
356
+ // members (everything but the embedded one) are revoked first, the
357
+ // embedded one only after its replacement stands. Expiry is not filtered
358
+ // here; the revoke helper skips a delegation expired beyond the clock-skew
359
+ // margin and reports it `expired`, which is not a failure.
347
360
  const ladderVmKey = await ladderVmKeyMultibase({ ladderSeed });
348
361
  const doomed = generationDelegationHistory({ log: published.log }).filter(delegation => {
349
362
  const proofKeyId = delegationProofKeyId(delegation);
350
363
  const fragment = proofKeyId === undefined ? null : vmFragmentOf(proofKeyId);
351
- if (fragment !== ladderVmKey) {
352
- return false;
353
- }
354
- const expires = Date.parse(delegation.expires ?? '');
355
- return Number.isNaN(expires) || expires > now;
364
+ return fragment === ladderVmKey;
356
365
  });
357
- // The replacement first: a ladder-signed fresh delegation under the
366
+ const embeddedId = embeddedGenerationDelegation({ doc: published.doc })?.id;
367
+ const isEmbedded = (delegation) => embeddedId !== undefined &&
368
+ delegation.id === embeddedId;
369
+ const revoked = [];
370
+ const revokeDoomed = async (delegations) => {
371
+ // Each revocation independent, so they run together via
372
+ // `Promise.allSettled` rather than `Promise.all`: a genuine
373
+ // `AlreadyRevokedError` still reads as success (the blind resumable
374
+ // re-POST), but every other failure must be seen and reported rather
375
+ // than aborting the batch, so `revoked` reports only what is provably
376
+ // off the account and a failure surfaces once every revocation has
377
+ // settled.
378
+ const settled = await Promise.allSettled(delegations.map(delegation => revokeTreatingAlreadyRevokedAsSuccess({
379
+ revoke: annex.revoke,
380
+ delegation,
381
+ now,
382
+ accountDoc: doc
383
+ })));
384
+ let firstRejection;
385
+ settled.forEach((settledResult, index) => {
386
+ if (settledResult.status === 'rejected') {
387
+ firstRejection ??= settledResult;
388
+ return;
389
+ }
390
+ // `expired` is a delegation nothing can invoke, not one this stage
391
+ // took off the account, so it stays out of `revoked`. `signer-gone`
392
+ // cannot be reported here: every doomed delegation's proof key is
393
+ // this credential's own ladder VM, which stage 1 reinstalled into
394
+ // `doc` before this stage ran, so a server refusal of one rethrows.
395
+ const outcome = settledResult.value;
396
+ const id = delegations[index].id;
397
+ if (typeof id === 'string' &&
398
+ (outcome === 'revoked' || outcome === 'already-revoked')) {
399
+ revoked.push(id);
400
+ }
401
+ });
402
+ if (firstRejection !== undefined) {
403
+ // Rethrown verbatim, not wrapped: every consumer dispatches on
404
+ // `err.name`, which a wrapper would erase.
405
+ throw firstRejection.reason;
406
+ }
407
+ };
408
+ // The historical members first, before anything is minted: a revocation
409
+ // the server persistently refuses halts the ceremony here, with no fresh
410
+ // delegation minted for the next attempt to find doomed in its turn. The
411
+ // embedded delegation is not among them, so a run torn after this batch
412
+ // leaves the generation with its live delegation.
413
+ await revokeDoomed(doomed.filter(delegation => !isEmbedded(delegation)));
414
+ // The replacement next: a ladder-signed fresh delegation under the
358
415
  // reinstalled VM, the annex entry signed by this credential's committed
359
416
  // annex rung. A credential the generation does not commit cannot write the
360
417
  // entry -- the honest skip, leaving the generation delegation-less once
361
- // the doomed set is revoked below.
418
+ // the embedded delegation is revoked below.
362
419
  let replaced = false;
363
420
  let rungUncommitted = false;
364
421
  const ladderClient = await ladderVmZcapClient({ accountDid, ladderSeed });
@@ -381,7 +438,7 @@ async function retireLadderGenerationDelegations({ doc, accountDid, ladderSeed,
381
438
  });
382
439
  // `replaced` reports what the stage actually wrote. A delegation the
383
440
  // policy leaves standing -- a surviving sibling ladder's, which the
384
- // revocations below never reach -- ends the stage current rather than
441
+ // revocations never reach -- ends the stage current rather than
385
442
  // replaced, with no `skipped` reason: nothing was owed.
386
443
  replaced = ensured.renewed;
387
444
  }
@@ -392,16 +449,11 @@ async function retireLadderGenerationDelegations({ doc, accountDid, ladderSeed,
392
449
  }
393
450
  rungUncommitted = true;
394
451
  }
395
- // The revocations, blind and resumable (400 already-revoked as success).
396
- // They target independent delegations, so they run together; the reported
397
- // ids keep the doomed list's order.
398
- await Promise.all(doomed.map(delegation => revokeTreatingAlreadyRevokedAsSuccess({
399
- revoke: annex.revoke,
400
- delegation
401
- })));
402
- const revoked = doomed
403
- .map(delegation => delegation.id)
404
- .filter((id) => typeof id === 'string');
452
+ // The embedded delegation last, now that its replacement stands (or the
453
+ // rung-uncommitted skip has been taken): replace-before-revoke for the
454
+ // one live delegation is what keeps a torn run from stranding the
455
+ // generation delegation-less.
456
+ await revokeDoomed(doomed.filter(isEmbedded));
405
457
  return rungUncommitted
406
458
  ? { revoked, replaced, skipped: 'rung-uncommitted' }
407
459
  : { revoked, replaced };
@@ -1 +1 @@
1
- {"version":3,"file":"forgetLast.js","sourceRoot":"","sources":["../../src/clientAnnex/forgetLast.ts"],"names":[],"mappings":"AA4HA,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,mBAAmB,EAEpB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,+BAA+B,EAC/B,kBAAkB,EAClB,oBAAoB,EAMrB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAA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;;;;;;;;;;GAYG;AACH,KAAK,UAAU,wBAAwB,CAAC,EACtC,SAAS,EACT,UAAU,EAIX;IACC,MAAM,UAAU,GAAG,GAAG,SAAS,CAAC,GAAG,IAAI,MAAM,oBAAoB,CAAC;QAChE,UAAU;KACX,CAAC,EAAE,CAAA;IACJ,IAAI,CAAC,WAAW,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9D,MAAM,IAAI,KAAK,CACb,iEAAiE;YAC/D,kEAAkE;YAClE,oBAAoB,CACvB,CAAA;IACH,CAAC;AACH,CAAC"}
@@ -26,11 +26,11 @@
26
26
  * every `gen-` collection the pointer does not name -- the generation a
27
27
  * swap just superseded, a torn GC's leftover, a torn signup's orphan, a
28
28
  * double-genesis loser -- gets identical treatment (revoke its embedded
29
- * delegation blind, reading the server's 400 already-revoked answer as
30
- * success; write the digest; delete), so a GC torn anywhere resumes at the
31
- * next login instead of waiting a quarter. Failures are collected per
32
- * generation and never abort the fan-out: a partial pass is a resumable
33
- * success.
29
+ * delegation blind, reading was-client's genuine `AlreadyRevokedError` as
30
+ * success and an already-expired delegation as needing no POST at all;
31
+ * write the digest; delete), so a GC torn anywhere resumes at the next
32
+ * login instead of waiting a quarter. Failures are collected per generation
33
+ * and never abort the fan-out: a partial pass is a resumable success.
34
34
  *
35
35
  * The completion predicate is durable state alone (exactly one `gen-`
36
36
  * collection exists in the auxiliary Space and it is the one the pointer
@@ -55,6 +55,7 @@ import type { ZcapClient } from '@interop/ezcap';
55
55
  import type { WasClient } from '@interop/was-client';
56
56
  import type { AccountLogSigner } from '../webvh/accountEntry.js';
57
57
  import type { ClientWebvhUpdateKeys, PublishedWebvhLog, WebvhIdStore } from '../webvh/didWebvh.js';
58
+ import type { ClientAnnexSwapRevokeOutcome } from '../unlock/retire.js';
58
59
  /**
59
60
  * The fixed GC cadence: a generation is replaced at the first remembered login
60
61
  * 90 days after the current pointer value was established. Wallet GC policy
@@ -158,16 +159,36 @@ export interface ClientAnnexGcReport {
158
159
  /**
159
160
  * One generation swap's outcome: the fresh annex DID the account now points
160
161
  * at, and what the revoke stage did with the old generation's embedded
161
- * delegation -- `revoked` (the POST landed, or the server answered
162
- * already-revoked), `no-delegation` (the old log stands and embeds none),
163
- * or `log-absent` (the pointed log does not exist, so there were no bytes to
164
- * revoke; pointer equality retires the delegation on a conforming server).
165
- * Reported rather than folded into the DID so a caller can tell a swap that
166
- * revoked from one that could not.
162
+ * delegation -- `revoked` (the POST landed, or was-client answered the
163
+ * genuine `AlreadyRevokedError`), `expired` (the delegation's own `expires`
164
+ * is past beyond doubt, so no POST was sent, or the server refused the POST
165
+ * inside the skew band around `expires`), `signer-gone` (the server refused
166
+ * the POST and the delegation's proof key has left the account document --
167
+ * a rotted chain), `refused` (the server, or was-client before the POST,
168
+ * refused the revocation for a reason the stage could not classify; the
169
+ * error rides in `revokeError`, the re-point still landed, and the old
170
+ * generation is left for the collect fan-out, which re-attempts the
171
+ * revocation and keeps the generation while it keeps failing),
172
+ * `no-delegation` (the old log stands and embeds none), or `log-absent` (the
173
+ * pointed log does not exist, so there were no bytes to revoke; pointer
174
+ * equality retires the delegation on a conforming server). Reported rather
175
+ * than folded into the DID so a caller can tell a swap that revoked from one
176
+ * that could not.
177
+ *
178
+ * A refusal does not abort the swap: by the time the revoke stage runs the
179
+ * fresh generation is minted and its delegation installed, and a swap that
180
+ * threw here would leave that orphan behind and mint another at every due
181
+ * login, with the old generation never superseded. Re-pointing anyway costs
182
+ * nothing the refusal did not already cost: a delegation the server refused
183
+ * to revoke fails the chain check an invocation under it runs too, a
184
+ * refusal raised client-side before any POST is a configuration fault the
185
+ * next pass meets again, and the fan-out keeps the bytes until a pass
186
+ * succeeds.
167
187
  */
168
188
  export interface ClientAnnexGenerationSwap {
169
189
  clientAnnexDid: string;
170
- revoke: 'revoked' | 'no-delegation' | 'log-absent';
190
+ revoke: ClientAnnexSwapRevokeOutcome;
191
+ revokeError?: unknown;
171
192
  }
172
193
  /**
173
194
  * One annex GC pass: the quarterly swap when due and quiet, then the
@@ -175,11 +196,13 @@ export interface ClientAnnexGenerationSwap {
175
196
  * See the module header for the stage order and its load-bearing constraints.
176
197
  *
177
198
  * Convergence: every stage detects completion from durable state. A re-run
178
- * after a tear re-POSTs the revocation blind (400 already-revoked reads as
179
- * success), re-writes the digest (the deterministic payload id collapses the
180
- * second row at read time), and re-runs the idempotent delete; a swap torn
181
- * before its re-point leaves an unpointed fresh generation the same fan-out
182
- * collects.
199
+ * after a tear re-POSTs the revocation blind (a genuine `AlreadyRevokedError`
200
+ * reads as success; a delegation expired beyond the clock-skew margin is
201
+ * skipped locally before any POST, and a refusal inside the skew band or of
202
+ * a chain whose signer has left the document is read as that), re-writes
203
+ * the digest (the deterministic payload id collapses the second row at read
204
+ * time), and re-runs the idempotent delete; a swap torn before its re-point
205
+ * leaves an unpointed fresh generation the same fan-out collects.
183
206
  *
184
207
  * @param options {object}
185
208
  * @param options.was {WasClient} the storage client, signing as an
@@ -248,16 +271,21 @@ export declare function runClientAnnexGc({ was, wasServerUrl, accountSpaceId, ac
248
271
  * the revoke is skipped and reported as `log-absent`, and pointer equality
249
272
  * retires the old delegation on a conforming server; a served log that fails
250
273
  * verification or falls behind this client's pin throws, since a swap over a
251
- * log this client cannot trust would skip a revoke it may owe.
274
+ * log this client cannot trust would skip a revoke it may owe. This is the
275
+ * arm credential retirement calls, and the standing delegation there is
276
+ * often signed by a ladder VM a PRIOR retirement already struck: the server
277
+ * refuses that chain, and the revoke stage reads the refusal against the
278
+ * caller's `account.doc` and reports `signer-gone`.
252
279
  *
253
280
  * @param options {object} see {@link runClientAnnexGc} for the shared
254
281
  * members ({ was, wasServerUrl, accountSpaceId, account, idStore,
255
282
  * updateKeys, zcapClient }); `ladderSeed` here is the SURVIVING
256
283
  * credential's seed the fresh generation is minted from
284
+ * @param [options.now] {number} epoch milliseconds, for tests
257
285
  * @returns {Promise<ClientAnnexGenerationSwap>} the fresh annex DID and
258
286
  * what the revoke stage did
259
287
  */
260
- export declare function swapClientAnnexGeneration({ was, wasServerUrl, accountSpaceId, account, idStore, signer, zcapClient, ladderSeed }: {
288
+ export declare function swapClientAnnexGeneration({ was, wasServerUrl, accountSpaceId, account, idStore, signer, zcapClient, ladderSeed, now }: {
261
289
  was: WasClient;
262
290
  wasServerUrl: string;
263
291
  accountSpaceId: string;
@@ -266,5 +294,6 @@ export declare function swapClientAnnexGeneration({ was, wasServerUrl, accountSp
266
294
  signer: AccountLogSigner;
267
295
  zcapClient: ZcapClient;
268
296
  ladderSeed: Uint8Array;
297
+ now?: number;
269
298
  }): Promise<ClientAnnexGenerationSwap>;
270
299
  //# sourceMappingURL=gc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gc.d.ts","sourceRoot":"","sources":["../../src/clientAnnex/gc.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAepD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EACV,qBAAqB,EACrB,iBAAiB,EACjB,YAAY,EACb,MAAM,sBAAsB,CAAA;AAE7B;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,QAA2B,CAAA;AAE/D;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,QAAsB,CAAA;AAE5D;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,QAAiB,CAAA;AAEvD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oCAAoC,CAAC,EACnD,GAAG,EACJ,EAAE;IACD,GAAG,EAAE,MAAM,CAAA;C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