@interop/wallet-core 0.24.0 → 0.25.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 (70) hide show
  1. package/README.md +18 -14
  2. package/dist/clients/index.d.ts +6 -4
  3. package/dist/clients/index.d.ts.map +1 -1
  4. package/dist/clients/index.js +5 -3
  5. package/dist/clients/index.js.map +1 -1
  6. package/dist/clients/policy.d.ts +11 -3
  7. package/dist/clients/policy.d.ts.map +1 -1
  8. package/dist/clients/policy.js +12 -4
  9. package/dist/clients/policy.js.map +1 -1
  10. package/dist/clients/revocation.d.ts +21 -3
  11. package/dist/clients/revocation.d.ts.map +1 -1
  12. package/dist/clients/revocation.js +18 -1
  13. package/dist/clients/revocation.js.map +1 -1
  14. package/dist/clients/rosterPolicy.d.ts +12 -5
  15. package/dist/clients/rosterPolicy.d.ts.map +1 -1
  16. package/dist/clients/rosterPolicy.js +28 -4
  17. package/dist/clients/rosterPolicy.js.map +1 -1
  18. package/dist/descriptors/acquire.d.ts +4 -1
  19. package/dist/descriptors/acquire.d.ts.map +1 -1
  20. package/dist/descriptors/acquire.js +29 -1
  21. package/dist/descriptors/acquire.js.map +1 -1
  22. package/dist/descriptors/index.d.ts +9 -1
  23. package/dist/descriptors/index.d.ts.map +1 -1
  24. package/dist/descriptors/index.js +9 -1
  25. package/dist/descriptors/index.js.map +1 -1
  26. package/dist/descriptors/logSource.d.ts +33 -0
  27. package/dist/descriptors/logSource.d.ts.map +1 -0
  28. package/dist/descriptors/logSource.js +49 -0
  29. package/dist/descriptors/logSource.js.map +1 -0
  30. package/dist/keys/index.d.ts +6 -2
  31. package/dist/keys/index.d.ts.map +1 -1
  32. package/dist/keys/index.js +5 -2
  33. package/dist/keys/index.js.map +1 -1
  34. package/dist/keys/rosterLogStore.d.ts +24 -5
  35. package/dist/keys/rosterLogStore.d.ts.map +1 -1
  36. package/dist/keys/rosterLogStore.js +29 -5
  37. package/dist/keys/rosterLogStore.js.map +1 -1
  38. package/dist/keys/rosterStore.d.ts +3 -3
  39. package/dist/keys/rosterStore.d.ts.map +1 -1
  40. package/dist/keys/rosterStore.js +1 -1
  41. package/dist/keys/rosterStore.js.map +1 -1
  42. package/dist/keys/userKeyCascade.d.ts +13 -6
  43. package/dist/keys/userKeyCascade.d.ts.map +1 -1
  44. package/dist/keys/userKeyCascade.js +11 -2
  45. package/dist/keys/userKeyCascade.js.map +1 -1
  46. package/dist/request/appKey.d.ts +8 -7
  47. package/dist/request/appKey.d.ts.map +1 -1
  48. package/dist/request/appKey.js +17 -23
  49. package/dist/request/appKey.js.map +1 -1
  50. package/dist/request/composeVp.d.ts +6 -7
  51. package/dist/request/composeVp.d.ts.map +1 -1
  52. package/dist/request/composeVp.js +44 -55
  53. package/dist/request/composeVp.js.map +1 -1
  54. package/dist/request/processRequest.d.ts +1 -4
  55. package/dist/request/processRequest.d.ts.map +1 -1
  56. package/dist/request/processRequest.js +2 -5
  57. package/dist/request/processRequest.js.map +1 -1
  58. package/dist/resourceLog/index.d.ts +5 -2
  59. package/dist/resourceLog/index.d.ts.map +1 -1
  60. package/dist/resourceLog/index.js +5 -2
  61. package/dist/resourceLog/index.js.map +1 -1
  62. package/dist/resourceLog/seal.d.ts +86 -0
  63. package/dist/resourceLog/seal.d.ts.map +1 -0
  64. package/dist/resourceLog/seal.js +99 -0
  65. package/dist/resourceLog/seal.js.map +1 -0
  66. package/dist/resourceLog/verify.d.ts +7 -1
  67. package/dist/resourceLog/verify.d.ts.map +1 -1
  68. package/dist/resourceLog/verify.js +1 -0
  69. package/dist/resourceLog/verify.js.map +1 -1
  70. package/package.json +2 -1
package/README.md CHANGED
@@ -80,22 +80,24 @@ The subpaths:
80
80
  adversarial host (parse shape, SCID and entry-hash recomputation, entry
81
81
  proofs, the external-authorization rule against the independently verified
82
82
  did:webvh controller document, terminal handover entries), the chain-head pin
83
- with its continuity rules, the entry builders, and the read/append/create path
84
- (compare-and-swap with rebase-and-retry, read-back confirmation). Transport
85
- lives in [`@interop/was-client`](https://npm.im/@interop/was-client)'s `/log`
86
- subpath; the hashing and proof kernel in
83
+ with its continuity rules, the entry builders, the read/append/create path
84
+ (compare-and-swap with rebase-and-retry, read-back confirmation), and the
85
+ sealing sweep -- the idempotent backstop append that re-anchors a log's head
86
+ past the controller's latest membership change. Transport lives in
87
+ [`@interop/was-client`](https://npm.im/@interop/was-client)'s `/log` subpath;
88
+ the hashing and proof kernel in
87
89
  [`@interop/did-method-webvh`](https://npm.im/@interop/did-method-webvh).
88
90
 
89
91
  - **`@interop/wallet-core/keys`** -- the user key and its wrap-set roster,
90
92
  governed by the `key-map/user-key.jsonl` resource log: minting, the roster's
91
93
  init/read/rotate primitives with their client-side guards (the verified log
92
94
  itself, the latest-seen epoch pin, the document-backed recipient resolver),
93
- the log-governed descriptor store those primitives drive, and the user key
94
- rotation cascade's per-collection op (re-epoch a collection onto the roster's
95
- current user key, staleness detected from durable state alone, history
96
- escrowed -- also the completion sweep's building block), plus the detector
97
- that converges a roster left wrapping the current key to a recipient the
98
- account document no longer keys. Also `ensureWalletSpaceEpochs`, the
95
+ the log-governed (and sealable) descriptor store those primitives drive, and
96
+ the user key rotation cascade's per-collection op (re-epoch a collection onto
97
+ the roster's current user key, staleness detected from durable state alone,
98
+ history escrowed -- also the completion sweep's building block), plus the
99
+ detector that converges a roster left wrapping the current key to a recipient
100
+ the account document no longer keys. Also `ensureWalletSpaceEpochs`, the
99
101
  provision-time install of each encrypted wallet collection's key epoch[0] (a
100
102
  fresh random epoch key wrapped to the user key) -- the EDV-bearing second step
101
103
  of `provisionWalletSpace`. Also the enrolled-client display labels
@@ -107,12 +109,14 @@ The subpaths:
107
109
  - **`@interop/wallet-core/clients`** -- the enrolled-client management surface:
108
110
  the listing over the locally verified did:webvh log with display labels
109
111
  merged, the disconnect-eligibility policy as pure functions, the revocation
110
- cascade orchestrator (document edit, roster rotation, collection fan-out,
111
- optional recovery re-mints), and the login-time roster policy.
112
+ cascade orchestrator (document edit, roster rotation with its seal backstop,
113
+ collection fan-out, optional recovery re-mints), and the login-time roster
114
+ policy (which now also seals a converged roster's governing log).
112
115
 
113
116
  - **`@interop/wallet-core/descriptors`** -- collection encryption-descriptor
114
- acquisition (fetch / cache / offline fallback) and the unknown-epoch refresh
115
- policy, including a self-refreshing EDV document cipher.
117
+ acquisition (fetch / cache / offline fallback), the log-governed descriptor
118
+ source (every read re-verifies the governing resource log), and the
119
+ unknown-epoch refresh policy, including a self-refreshing EDV document cipher.
116
120
 
117
121
  - **`@interop/wallet-core/keyring`** -- the unlock layer: the unlock derivation,
118
122
  the `{ version, wrapped }` account-pointer record codec, and the unlock Space
@@ -15,19 +15,21 @@
15
15
  * surfaces refuse the same rows for the same reasons and report a partial
16
16
  * fan-out as the resumable success it is.
17
17
  * - `revokeAccountClient` -- the revocation cascade in dependency order
18
- * (document edit, roster rotation, collection fan-out, optional recovery
19
- * re-mints), with the app-specific stages injected.
18
+ * (document edit, roster rotation with its seal backstop, collection
19
+ * fan-out, optional recovery re-mints), with the app-specific stages
20
+ * injected.
20
21
  * - `checkUserKeyRosterAtLogin` / `convergeUserKeyRosterToAccount` -- the
21
22
  * login-time
22
23
  * roster policy: which roster failures refuse a session, and the standing
23
- * convergence of the roster onto the account document.
24
+ * convergence of the roster onto the account document (recipients, then
25
+ * the roster log's seal).
24
26
  */
25
27
  export { currentAccountSigningKeys, listAccountClients } from './listing.js';
26
28
  export type { AccountClientView, AccountLogPointer, VerifiedAccountLog } from './listing.js';
27
29
  export { cascadeCompletion, disconnectEligibility, revokedClientKeysFor } from './policy.js';
28
30
  export type { DisconnectRefusal } from './policy.js';
29
31
  export { revokeAccountClient } from './revocation.js';
30
- export type { CascadeCollections, ClientRevocationResult } from './revocation.js';
32
+ export type { CascadeCollections, ClientRevocationResult, RosterSealReport } from './revocation.js';
31
33
  export { checkUserKeyRosterAtLogin, convergeUserKeyRosterToAccount } from './rosterPolicy.js';
32
34
  export type { AdoptedUserKey } from './rosterPolicy.js';
33
35
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAC5E,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAC5E,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,YAAY,EACV,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA"}
@@ -15,12 +15,14 @@
15
15
  * surfaces refuse the same rows for the same reasons and report a partial
16
16
  * fan-out as the resumable success it is.
17
17
  * - `revokeAccountClient` -- the revocation cascade in dependency order
18
- * (document edit, roster rotation, collection fan-out, optional recovery
19
- * re-mints), with the app-specific stages injected.
18
+ * (document edit, roster rotation with its seal backstop, collection
19
+ * fan-out, optional recovery re-mints), with the app-specific stages
20
+ * injected.
20
21
  * - `checkUserKeyRosterAtLogin` / `convergeUserKeyRosterToAccount` -- the
21
22
  * login-time
22
23
  * roster policy: which roster failures refuse a session, and the standing
23
- * convergence of the roster onto the account document.
24
+ * convergence of the roster onto the account document (recipients, then
25
+ * the roster log's seal).
24
26
  */
25
27
  export { currentAccountSigningKeys, listAccountClients } from './listing.js';
26
28
  export { cascadeCompletion, disconnectEligibility, revokedClientKeysFor } from './policy.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAO5E,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAMrD,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clients/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAO5E,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAOrD,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAC/B,MAAM,mBAAmB,CAAA"}
@@ -31,6 +31,7 @@
31
31
  import type { RevokedClientKeys } from '../webvh/index.js';
32
32
  import type { UserKeyCascadeResult } from '../keys/index.js';
33
33
  import type { AccountClientView } from './listing.js';
34
+ import type { RosterSealReport } from './revocation.js';
34
35
  /**
35
36
  * Why a listed row cannot be disconnected. See the module doc.
36
37
  */
@@ -66,14 +67,21 @@ export declare function revokedClientKeysFor({ client }: {
66
67
  }): RevokedClientKeys;
67
68
  /**
68
69
  * How a completed cascade should be reported: `complete` when every encrypted
69
- * collection took the fresh key, `partial` when some did not -- a resumable
70
- * success, never an error (see the module doc).
70
+ * collection took the fresh key AND the roster's seal backstop did not fail,
71
+ * `partial` otherwise -- a resumable success, never an error (see the module
72
+ * doc). An unfinished seal is the same durable-staleness class as a stranded
73
+ * collection: "a governed log's head anchor predates the membership change"
74
+ * is detected from durable state alone, so a re-run (or the login sweep)
75
+ * finishes it.
71
76
  *
72
77
  * @param options {object}
73
78
  * @param options.collections {UserKeyCascadeResult} the collection fan-out result
79
+ * @param [options.rosterSeal] {RosterSealReport} the roster's seal-backstop
80
+ * report, where the cascade ran one
74
81
  * @returns {'complete' | 'partial'}
75
82
  */
76
- export declare function cascadeCompletion({ collections }: {
83
+ export declare function cascadeCompletion({ collections, rosterSeal }: {
77
84
  collections: UserKeyCascadeResult;
85
+ rosterSeal?: RosterSealReport;
78
86
  }): 'complete' | 'partial';
79
87
  //# sourceMappingURL=policy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/clients/policy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAm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,MAAM,EACN,OAAO,EACR,EAAE;IACD,MAAM,EAAE,iBAAiB,CAAA;IACzB,OAAO,EAAE,iBAAiB,EAAE,CAAA;CAC7B,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,iBAAiB,CAAA;CAAE,CAWpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACP,EAAE;IACD,MAAM,EAAE,iBAAiB,CAAA;CAC1B,GAAG,iBAAiB,CAYpB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,UAAU,EACX,EAAE;IACD,WAAW,EAAE,oBAAoB,CAAA;IACjC,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAC9B,GAAG,UAAU,GAAG,SAAS,CAIzB"}
@@ -42,14 +42,22 @@ export function revokedClientKeysFor({ client }) {
42
42
  }
43
43
  /**
44
44
  * How a completed cascade should be reported: `complete` when every encrypted
45
- * collection took the fresh key, `partial` when some did not -- a resumable
46
- * success, never an error (see the module doc).
45
+ * collection took the fresh key AND the roster's seal backstop did not fail,
46
+ * `partial` otherwise -- a resumable success, never an error (see the module
47
+ * doc). An unfinished seal is the same durable-staleness class as a stranded
48
+ * collection: "a governed log's head anchor predates the membership change"
49
+ * is detected from durable state alone, so a re-run (or the login sweep)
50
+ * finishes it.
47
51
  *
48
52
  * @param options {object}
49
53
  * @param options.collections {UserKeyCascadeResult} the collection fan-out result
54
+ * @param [options.rosterSeal] {RosterSealReport} the roster's seal-backstop
55
+ * report, where the cascade ran one
50
56
  * @returns {'complete' | 'partial'}
51
57
  */
52
- export function cascadeCompletion({ collections }) {
53
- return collections.failed.length > 0 ? 'partial' : 'complete';
58
+ export function cascadeCompletion({ collections, rosterSeal }) {
59
+ return collections.failed.length > 0 || rosterSeal?.outcome === 'failed'
60
+ ? 'partial'
61
+ : 'complete';
54
62
  }
55
63
  //# sourceMappingURL=policy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/clients/policy.ts"],"names":[],"mappings":"AAwCA;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,MAAM,EACN,OAAO,EAIR;IACC,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAA;IAC5C,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,CAAA;IACnD,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;QAC/B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAA;IAC/D,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AAC1B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,MAAM,EAGP;IACC,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,oEAAoE;YAClE,8CAA8C,CACjD,CAAA;IACH,CAAC;IACD,OAAO;QACL,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;QAC/C,wBAAwB,EAAE,MAAM,CAAC,wBAAwB;QACzD,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;KAC9C,CAAA;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,WAAW,EAGZ;IACC,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAA;AAC/D,CAAC"}
1
+ {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/clients/policy.ts"],"names":[],"mappings":"AAyCA;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,MAAM,EACN,OAAO,EAIR;IACC,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAA;IAC5C,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,CAAA;IACnD,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;QAC/B,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAA;IAC/D,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AAC1B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,MAAM,EAGP;IACC,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,oEAAoE;YAClE,8CAA8C,CACjD,CAAA;IACH,CAAC;IACD,OAAO;QACL,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;QAC/C,wBAAwB,EAAE,MAAM,CAAC,wBAAwB;QACzD,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;KAC9C,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,WAAW,EACX,UAAU,EAIX;IACC,OAAO,WAAW,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,UAAU,EAAE,OAAO,KAAK,QAAQ;QACtE,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,UAAU,CAAA;AAChB,CAAC"}
@@ -21,7 +21,11 @@
21
21
  * log this call just extended). The roster delivers, never sources, so the
22
22
  * revoked client's entry is dropped even before the retire filter. An
23
23
  * account with no roster yet stops here: the client IS disconnected, with
24
- * nothing to rotate.
24
+ * nothing to rotate. On a sealable (log-governed) roster store, the seal
25
+ * backstop follows: a rotation that no-op'd appended nothing, so the
26
+ * roster log may still be anchored before the document edit -- `seal()`
27
+ * re-anchors it with an idempotent no-op entry, best-effort and reported
28
+ * rather than thrown.
25
29
  * 3. **The collection fan-out**: every encrypted collection is re-epoch'd onto
26
30
  * the fresh key in parallel, so writes stop landing under epochs the
27
31
  * revoked client can still decrypt. Failures are collected per collection
@@ -49,6 +53,18 @@ import type { CollectionEncryption } from '@interop/was-client';
49
53
  import type { EncryptionDescriptorStore } from '@interop/was-client/edv';
50
54
  import { type ClientWebvhUpdateKeys, type RevokedClientKeys, type WebvhIdStore } from '../webvh/index.js';
51
55
  import { type UserKey, type UserKeyCascadeResult } from '../keys/index.js';
56
+ /**
57
+ * What the roster's seal backstop reported: `sealed` (the roster log's head
58
+ * still anchored before the document edit, and the backstop append landed),
59
+ * `noop` (already sealed -- the rotation itself was the sealing append, or a
60
+ * re-run found nothing to do), or `failed` (the seal could not run; carried
61
+ * in `error`, never thrown -- the cascade stays a resumable success and the
62
+ * login sweep re-seals).
63
+ */
64
+ export interface RosterSealReport {
65
+ outcome: 'sealed' | 'noop' | 'failed';
66
+ error?: unknown;
67
+ }
52
68
  /**
53
69
  * Where the cascade's collection fan-out gets its work: which encrypted
54
70
  * collections exist (only the app knows -- a mobile replica names the
@@ -64,11 +80,13 @@ export interface CascadeCollections {
64
80
  /**
65
81
  * What a completed cascade reports: whether the roster actually rotated on
66
82
  * this run (a re-run of an already-complete revocation reports `false`), the
67
- * per-collection fan-out result, the document as the edit left it, and the
68
- * recovery re-mint counts when that stage ran.
83
+ * roster's seal-backstop report (present when the roster store is sealable
84
+ * and the roster stage ran), the per-collection fan-out result, the document
85
+ * as the edit left it, and the recovery re-mint counts when that stage ran.
69
86
  */
70
87
  export interface ClientRevocationResult {
71
88
  rotated: boolean;
89
+ rosterSeal?: RosterSealReport;
72
90
  collections: UserKeyCascadeResult;
73
91
  document: object;
74
92
  userKey?: UserKey;
@@ -1 +1 @@
1
- {"version":3,"file":"revocation.d.ts","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;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;AACxE,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAKL,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAA;AAEzB;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;IACnD,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,yBAAyB,CAAA;IAC7D,WAAW,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CACzD;AAED;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,oBAAoB,CAAA;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gBAAgB,CAAC,EAAE,oBAAoB,CAAA;IACvC,QAAQ,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CACjD;AAqBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;GAgDG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,OAAO,EACP,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,yBAAyB,EACzB,iBAAiB,EAClB,EAAE;IACD,OAAO,EAAE,YAAY,CAAA;IACrB,UAAU,EAAE,qBAAqB,CAAA;IACjC,aAAa,EAAE,iBAAiB,CAAA;IAChC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,WAAW,EAAE,yBAAyB,CAAA;IACtC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE;QAC3B,OAAO,EAAE,OAAO,CAAA;QAChB,aAAa,EAAE,MAAM,CAAA;QACrB,UAAU,EAAE,oBAAoB,CAAA;KACjC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnB,WAAW,EAAE,kBAAkB,CAAA;IAC/B,yBAAyB,CAAC,EAAE,CAAC,OAAO,EAAE;QACpC,QAAQ,EAAE,MAAM,CAAA;KACjB,KAAK,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpD,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACtE,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAsHlC"}
@@ -1,5 +1,5 @@
1
1
  import { revokeWebvhClient } from '../webvh/index.js';
2
- import { cascadeCollectionsToUserKey, readUserKeyRoster, rosterRecipientKid, rotateUserKeyRoster } from '../keys/index.js';
2
+ import { cascadeCollectionsToUserKey, isSealableDescriptorStore, readUserKeyRoster, rosterRecipientKid, rotateUserKeyRoster } from '../keys/index.js';
3
3
  /**
4
4
  * Resolves the collection ids the fan-out covers, whether they are a fixed set
5
5
  * or a listing the app performs.
@@ -123,6 +123,22 @@ export async function revokeAccountClient({ idStore, updateKeys, revokedClient,
123
123
  descriptor: read.descriptor
124
124
  });
125
125
  }
126
+ // 2b. The seal backstop: an ordinary rotation is the sealing append by
127
+ // construction, but a rotation that no-op'd (the revoked client held no
128
+ // current-epoch wrap -- an orphan client, or any re-run) appended nothing,
129
+ // leaving the roster log's head anchored before the document edit. Sealing
130
+ // is best-effort and reported, never thrown: the wallet IS disconnected
131
+ // (stage 1 landed), and an unsealed log is durable state the login sweep
132
+ // re-detects and finishes.
133
+ let rosterSeal;
134
+ if (isSealableDescriptorStore(rosterStore)) {
135
+ try {
136
+ rosterSeal = { outcome: await rosterStore.seal() };
137
+ }
138
+ catch (err) {
139
+ rosterSeal = { outcome: 'failed', error: err };
140
+ }
141
+ }
126
142
  // 3. The collection fan-out, in parallel -- run even when this call found
127
143
  // the roster already rotated (a re-run after a crash), because the staleness
128
144
  // rule finds exactly the stranded collections.
@@ -144,6 +160,7 @@ export async function revokeAccountClient({ idStore, updateKeys, revokedClient,
144
160
  }
145
161
  return {
146
162
  rotated: read.rotated,
163
+ ...(rosterSeal ? { rosterSeal } : {}),
147
164
  collections: cascade,
148
165
  document: doc,
149
166
  userKey: read.userKey,
@@ -1 +1 @@
1
- {"version":3,"file":"revocation.js","sourceRoot":"","sources":["../../src/clients/revocation.ts"],"names":[],"mappings":"AAiDA,OAAO,EACL,iBAAiB,EAIlB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EAGpB,MAAM,kBAAkB,CAAA;AA8BzB;;;;;;;GAOG;AACH,KAAK,UAAU,eAAe,CAAC,EAC7B,WAAW,EAGZ;IACC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AO,EAAE,IAAI,CAAC,OAAO;KACtB,CAAC,CAAA;IAEF,2EAA2E;IAC3E,qCAAqC;IACrC,MAAM,QAAQ,GAAG,MAAM,yBAAyB,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAA;IAErE,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,MAAM,iBAAiB,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;IACtD,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrC,WAAW,EAAE,OAAO;QACpB,QAAQ,EAAE,GAAG;QACb,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,gBAAgB,EAAE,IAAI,CAAC,UAAU;QACjC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClC,CAAA;AACH,CAAC"}
@@ -28,9 +28,14 @@
28
28
  * revocation torn between its document edit and its roster rotation leaves
29
29
  * the roster wrapping the CURRENT key to a client the document no longer
30
30
  * keys -- durable and silent, since the revoked client's document edit will
31
- * never be re-run -- so it is finished here. Strictly best-effort: a log
32
- * that cannot be fetched or verified (offline, an unpromoted account) leaves
33
- * the start's own roster read in place, and the next start tries again.
31
+ * never be re-run -- so it is finished here. On a sealable (log-governed)
32
+ * store the seal backstop follows: a revocation whose rotation no-op'd
33
+ * leaves nothing for the recipient convergence to find, but the roster
34
+ * log's head still anchors before the membership change, and that unsealed
35
+ * state is detected and closed here, idempotently. Strictly best-effort: a
36
+ * log that cannot be fetched or verified (offline, an unpromoted account)
37
+ * leaves the start's own roster read in place, and the next start tries
38
+ * again.
34
39
  *
35
40
  * **Once per session.** A converged roster stays converged, and the engine
36
41
  * restart (or storage-cipher rebuild) that adopts a rotation must not
@@ -120,8 +125,9 @@ export declare function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgr
120
125
  * roster epoch
121
126
  * @param [options.onUserKeyAdopted] {Function} called with the
122
127
  * {@link AdoptedUserKey} of a rotation, before the fan-out runs
123
- * @returns {Promise<object>} whether the roster rotated on this call, the
124
- * stale recipient kids found, and the key + descriptor to fan out with
128
+ * @returns {Promise<object>} whether the roster rotated on this call,
129
+ * whether the seal backstop had to append (`sealed`), the stale recipient
130
+ * kids found, and the key + descriptor to fan out with
125
131
  */
126
132
  export declare function convergeUserKeyRosterToAccount({ pointer, store, userKey, descriptor, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted }: {
127
133
  pointer: AccountLogPointer;
@@ -133,6 +139,7 @@ export declare function convergeUserKeyRosterToAccount({ pointer, store, userKey
133
139
  onUserKeyAdopted?: (adopted: AdoptedUserKey) => Promise<void>;
134
140
  }): Promise<{
135
141
  rotated: boolean;
142
+ sealed: boolean;
136
143
  staleRecipientIds: string[];
137
144
  userKey: UserKey;
138
145
  descriptor: CollectionEncryption;
@@ -1 +1 @@
1
- {"version":3,"file":"rosterPolicy.d.ts","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;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;AACxE,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,uBAAuB,EAC7B,MAAM,kBAAkB,CAAA;AAMzB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAErD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,E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B,UAAU,EAAE,oBAAoB,CAAA;IAChC,qBAAqB,EAAE,gBAAgB,CAAA;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9D,GAAG,OAAO,CAAC;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;IACf,iBAAiB,EAAE,MAAM,EAAE,CAAA;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,oBAAoB,CAAA;CACjC,CAAC,CAqGD"}
@@ -1,4 +1,4 @@
1
- import { convergeUserKeyRosterToDocument, UserKeyRosterContinuityError, UserKeyRosterIntegrityError, UserKeyRosterUnwrapError, readUserKeyRoster } from '../keys/index.js';
1
+ import { convergeUserKeyRosterToDocument, isSealableDescriptorStore, UserKeyRosterContinuityError, UserKeyRosterIntegrityError, UserKeyRosterUnwrapError, readUserKeyRoster } from '../keys/index.js';
2
2
  import { ResourceLogContinuityError, ResourceLogIntegrityError } from '../resourceLog/index.js';
3
3
  import { verifyAccountLog } from '../webvh/index.js';
4
4
  /**
@@ -103,12 +103,14 @@ export async function checkUserKeyRosterAtLogin({ store, userKey, clientKeyAgree
103
103
  * roster epoch
104
104
  * @param [options.onUserKeyAdopted] {Function} called with the
105
105
  * {@link AdoptedUserKey} of a rotation, before the fan-out runs
106
- * @returns {Promise<object>} whether the roster rotated on this call, the
107
- * stale recipient kids found, and the key + descriptor to fan out with
106
+ * @returns {Promise<object>} whether the roster rotated on this call,
107
+ * whether the seal backstop had to append (`sealed`), the stale recipient
108
+ * kids found, and the key + descriptor to fan out with
108
109
  */
109
110
  export async function convergeUserKeyRosterToAccount({ pointer, store, userKey, descriptor, clientKeyAgreementKey, pinnedEpochId, onUserKeyAdopted }) {
110
111
  const unchanged = {
111
112
  rotated: false,
113
+ sealed: false,
112
114
  staleRecipientIds: [],
113
115
  userKey,
114
116
  descriptor
@@ -132,8 +134,29 @@ export async function convergeUserKeyRosterToAccount({ pointer, store, userKey,
132
134
  console.warn('Could not converge the wrap-set roster onto the account document:', err);
133
135
  return unchanged;
134
136
  }
137
+ // The seal backstop, on a sealable (log-governed) store: a converged
138
+ // recipient set can still leave the roster log's head anchored before the
139
+ // membership change -- the torn revocation whose rotation no-op'd (the
140
+ // revoked client held no current-epoch wrap), which the recipient
141
+ // convergence above finds nothing to rotate for. "A governed log's head
142
+ // anchor predates the membership change" is the durable signal; sealing it
143
+ // is idempotent, so every start may try. Refusal classes rethrow exactly
144
+ // like the convergence's; anything else (transport) warns and leaves the
145
+ // seal to the next start.
146
+ let sealed = false;
147
+ if (isSealableDescriptorStore(store)) {
148
+ try {
149
+ sealed = (await store.seal()) === 'sealed';
150
+ }
151
+ catch (err) {
152
+ if (isRosterRefusal(err)) {
153
+ throw err;
154
+ }
155
+ console.warn('Could not seal the wrap-set roster log:', err);
156
+ }
157
+ }
135
158
  if (!rotated) {
136
- return unchanged;
159
+ return { ...unchanged, sealed };
137
160
  }
138
161
  console.warn('The wrap-set roster still wrapped the current key to ' +
139
162
  `${staleRecipientIds.length} recipient(s) the account document no ` +
@@ -170,6 +193,7 @@ export async function convergeUserKeyRosterToAccount({ pointer, store, userKey,
170
193
  });
171
194
  return {
172
195
  rotated: true,
196
+ sealed,
173
197
  staleRecipientIds,
174
198
  userKey: read.userKey,
175
199
  descriptor: read.descriptor
@@ -1 +1 @@
1
- {"version":3,"file":"rosterPolicy.js","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAiDA,OAAO,EACL,+BAA+B,EAC/B,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EAGlB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CA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iE;YAC/D,mEAAmE;YACnE,kBAAkB,EACpB,EAAE,KAAK,EAAE,GAAG,EAAE,CACf,CAAA;IACH,CAAC;IACD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CACb,iEAAiE;YAC/D,oEAAoE;YACpE,MAAM,CACT,CAAA;IACH,CAAC;IACD,MAAM,gBAAgB,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC,CAAA;IACF,OAAO;QACL,OAAO,EAAE,IAAI;QACb,iBAAiB;QACjB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAA;AACH,CAAC"}
1
+ {"version":3,"file":"rosterPolicy.js","sourceRoot":"","sources":["../../src/clients/rosterPolicy.ts"],"names":[],"mappings":"AAsDA,OAAO,EACL,+BAA+B,EAC/B,yBAAyB,EACzB,4BAA4B,EAC5B,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EAGlB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAapD;;;;;;;;;;GAUG;AACH,SAAS,eAAe,CAAC,GAAY;IACnC,OAAO,CACL,GAAG,YAAY,0BAA0B;QACzC,GAAG,YAAY,yBAAyB;QACxC,GAAG,YAAY,4BAA4B;QAC3C,GAAG,YAAY,2BAA2B;QAC1C,GAAG,YAAY,wBAAwB,CACxC,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,EAC9C,KAAK,EACL,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,YAAY,EAOb;IACC,IAAI,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qBAAqB;YACrB,aAAa;SACd,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,MAAM,GAAG,CAAA;QACX,CAAC;QACD,MAAM,IAAI,KAAK,CACb,iEAAiE;YAC/D,mEAAmE;YACnE,kBAAkB,EACpB,EAAE,KAAK,EAAE,GAAG,EAAE,CACf,CAAA;IACH,CAAC;IACD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CACb,iEAAiE;YAC/D,oEAAoE;YACpE,MAAM,CACT,CAAA;IACH,CAAC;IACD,MAAM,gBAAgB,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC,CAAA;IACF,OAAO;QACL,OAAO,EAAE,IAAI;QACb,MAAM;QACN,iBAAiB;QACjB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAA;AACH,CAAC"}
@@ -80,7 +80,10 @@ export declare function wasDescriptorSource({ was, spaceId }: {
80
80
  * @param options.collectionId {string}
81
81
  * @param [options.onFetchError] {function} observes a swallowed fetch
82
82
  * failure (the thrown-fetch branch only; an empty description is not an
83
- * error). Errors from the cache itself throw through
83
+ * error). Errors from the cache itself throw through, as do a log-governed
84
+ * source's refusal classes (a fabricated or discontinuous log is a security
85
+ * signal, not an outage the cache should paper over) -- except a continuity
86
+ * `rollback`, which falls back to the cache like any transport hiccup
84
87
  * @returns {Promise<CollectionEncryption | undefined>}
85
88
  */
86
89
  export declare function acquireDescriptor({ source, cache, collectionId, onFetchError }: {
@@ -1 +1 @@
1
- {"version":3,"file":"acquire.d.ts","sourceRoot":"","sources":["../../src/descriptors/acquire.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;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AAY,EACZ,YAAY,EACb,EAAE;IACD,MAAM,CAAC,EAAE,0BAA0B,CAAA;IACnC,KAAK,EAAE,yBAAyB,CAAA;IAChC,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CACtE,GAAG,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAoB5C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,kBAAkB,CAAC,EACvC,MAAM,EACN,KAAK,EACL,aAAa,EACb,YAAY,EACb,EAAE;IACD,MAAM,CAAC,EAAE,0BAA0B,CAAA;IACnC,KAAK,EAAE,yBAAyB,CAAA;IAChC,aAAa,EAAE,MAAM,EAAE,CAAA;IACvB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CACtE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAiBhD"}
@@ -1,3 +1,25 @@
1
+ /**
2
+ * Whether a thrown fetch failure is a resource-log refusal the cache must NOT
3
+ * paper over: a fabricated log (`ResourceLogIntegrityError`), or a log that
4
+ * is not the continuation of the pinned history
5
+ * (`ResourceLogContinuityError`) -- EXCEPT continuity reason `rollback`,
6
+ * which is reconcilable divergence (possibly replication lag): the pin is
7
+ * never regressed and nothing rolled-back is adopted, so serving the cached
8
+ * copy in the meantime is exactly the offline posture. Matched on `err.name`
9
+ * rather than `instanceof`, which keeps this file dependency-light and
10
+ * survives a linked or duplicated copy of the package.
11
+ *
12
+ * @param err {unknown}
13
+ * @returns {boolean}
14
+ */
15
+ function isLogRefusal(err) {
16
+ const name = err?.name;
17
+ if (name === 'ResourceLogIntegrityError') {
18
+ return true;
19
+ }
20
+ return (name === 'ResourceLogContinuityError' &&
21
+ err.reason !== 'rollback');
22
+ }
1
23
  /**
2
24
  * The {@link EncryptionDescriptorSource} over a was-client handle: reads the
3
25
  * collection's Description in the given Space and returns its `encryption`
@@ -35,7 +57,10 @@ export function wasDescriptorSource({ was, spaceId }) {
35
57
  * @param options.collectionId {string}
36
58
  * @param [options.onFetchError] {function} observes a swallowed fetch
37
59
  * failure (the thrown-fetch branch only; an empty description is not an
38
- * error). Errors from the cache itself throw through
60
+ * error). Errors from the cache itself throw through, as do a log-governed
61
+ * source's refusal classes (a fabricated or discontinuous log is a security
62
+ * signal, not an outage the cache should paper over) -- except a continuity
63
+ * `rollback`, which falls back to the cache like any transport hiccup
39
64
  * @returns {Promise<CollectionEncryption | undefined>}
40
65
  */
41
66
  export async function acquireDescriptor({ source, cache, collectionId, onFetchError }) {
@@ -53,6 +78,9 @@ export async function acquireDescriptor({ source, cache, collectionId, onFetchEr
53
78
  return cache.readDescriptor({ collectionId });
54
79
  }
55
80
  catch (err) {
81
+ if (isLogRefusal(err)) {
82
+ throw err;
83
+ }
56
84
  onFetchError?.(err, { collectionId });
57
85
  return cache.readDescriptor({ collectionId });
58
86
  }
@@ -1 +1 @@
1
- {"version":3,"file":"acquire.js","sourceRoot":"","sources":["../../src/descriptors/acquire.ts"],"names":[],"mappings":"AAuDA;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,GAAG,EACH,OAAO,EAIR;IACC,OAAO;QACL,KAAK,CAAC,oBAAoB,CAAC,EAAE,YAAY,EAAE;YACzC,MAAM,WAAW,GAAG,MAAM,GAAG;iBAC1B,KAAK,CAAC,OAAO,CAAC;iBACd,UAAU,CAAC,YAAY,CAAC;iBACxB,QAAQ,EAAE,CAAA;YACb,OAAO,WAAW,EAAE,UAAU,IAAI,SAAS,CAAA;QAC7C,CAAC;KACF,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,EACtC,MAA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O,EAAE,CAAC,CAAA;YAClE,OAAO,OAAO,CAAA;QAChB,CAAC;QACD,0EAA0E;QAC1E,+DAA+D;QAC/D,OAAO,KAAK,CAAC,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC,CAAA;IAC/C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,GAAG,CAAA;QACX,CAAC;QACD,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,YAAY,EAAE,CAAC,CAAA;QACrC,OAAO,KAAK,CAAC,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC,CAAA;IAC/C,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EACvC,MAAM,EACN,KAAK,EACL,aAAa,EACb,YAAY,EAMb;IACC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,aAAa,CAAC,GAAG,CACf,KAAK,EAAC,YAAY,EAAC,EAAE,CACnB;QACE,YAAY;QACZ,MAAM,iBAAiB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;KAC9D,CACb,CACF,CAAA;IACD,MAAM,WAAW,GAAyC,EAAE,CAAA;IAC5D,KAAK,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,IAAI,QAAQ,EAAE,CAAC;QAClD,IAAI,UAAU,EAAE,CAAC;YACf,WAAW,CAAC,YAAY,CAAC,GAAG,UAAU,CAAA;QACxC,CAAC;IACH,CAAC;IACD,OAAO,WAAW,CAAA;AACpB,CAAC"}
@@ -20,7 +20,14 @@
20
20
  * description is ambiguous, since WAS masks an unauthorized read as an
21
21
  * absent one). No descriptor anywhere means a plaintext collection, or an
22
22
  * encrypted one whose epoch[0] install has not landed -- which a caller that
23
- * has declared the collection encrypted must refuse fail-closed.
23
+ * has declared the collection encrypted must refuse fail-closed. A
24
+ * log-governed source's refusal classes rethrow instead of falling back
25
+ * (except a continuity rollback, which is reconcilable divergence).
26
+ * - `logGovernedDescriptorSource` -- the `EncryptionDescriptorSource` for
27
+ * collections whose descriptor is governed by a resource log: every read
28
+ * (including the unknown-epoch refresh) re-verifies the log and resolves to
29
+ * its verified head state, refusing a head that is not a
30
+ * `WasEpochConfiguration`.
24
31
  * - `DescriptorRefreshPolicy` -- the once-per-collection-per-session
25
32
  * unknown-epoch refresh guard, plus the refresh-and-re-read-once wrapper
26
33
  * for hosts whose reads scan rows and count unknown-epoch skips.
@@ -31,6 +38,7 @@
31
38
  */
32
39
  export { acquireDescriptor, acquireDescriptors, wasDescriptorSource } from './acquire.js';
33
40
  export type { EncryptionDescriptorCache, EncryptionDescriptorSource } from './acquire.js';
41
+ export { EPOCH_CONFIGURATION_STATE_TYPE, logGovernedDescriptorSource } from './logSource.js';
34
42
  export { DescriptorRefreshPolicy } from './refresh.js';
35
43
  export { createRefreshingEdvDocCipher } from './cipher.js';
36
44
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AACrB,YAAY,EACV,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AACrB,YAAY,EACV,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC5B,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA"}
@@ -20,7 +20,14 @@
20
20
  * description is ambiguous, since WAS masks an unauthorized read as an
21
21
  * absent one). No descriptor anywhere means a plaintext collection, or an
22
22
  * encrypted one whose epoch[0] install has not landed -- which a caller that
23
- * has declared the collection encrypted must refuse fail-closed.
23
+ * has declared the collection encrypted must refuse fail-closed. A
24
+ * log-governed source's refusal classes rethrow instead of falling back
25
+ * (except a continuity rollback, which is reconcilable divergence).
26
+ * - `logGovernedDescriptorSource` -- the `EncryptionDescriptorSource` for
27
+ * collections whose descriptor is governed by a resource log: every read
28
+ * (including the unknown-epoch refresh) re-verifies the log and resolves to
29
+ * its verified head state, refusing a head that is not a
30
+ * `WasEpochConfiguration`.
24
31
  * - `DescriptorRefreshPolicy` -- the once-per-collection-per-session
25
32
  * unknown-epoch refresh guard, plus the refresh-and-re-read-once wrapper
26
33
  * for hosts whose reads scan rows and count unknown-epoch skips.
@@ -30,6 +37,7 @@
30
37
  * instance.
31
38
  */
32
39
  export { acquireDescriptor, acquireDescriptors, wasDescriptorSource } from './acquire.js';
40
+ export { EPOCH_CONFIGURATION_STATE_TYPE, logGovernedDescriptorSource } from './logSource.js';
33
41
  export { DescriptorRefreshPolicy } from './refresh.js';
34
42
  export { createRefreshingEdvDocCipher } from './cipher.js';
35
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AAMrB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/descriptors/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,cAAc,CAAA;AAMrB,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC5B,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA"}