@open-e2ee/signal-protocol-sdk 0.3.0 → 1.0.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 (273) hide show
  1. package/ADAPTERS.md +7 -0
  2. package/ARCHITECTURE.md +2 -0
  3. package/CHANGELOG.md +96 -5
  4. package/README.md +67 -102
  5. package/SECURITY.md +2 -2
  6. package/THIRD_PARTY_NOTICES.md +1 -1
  7. package/TROUBLESHOOTING.md +7 -0
  8. package/blocking/README.md +1 -0
  9. package/client/README.md +10 -0
  10. package/device/README.md +12 -5
  11. package/dist/client/client.d.ts +3 -2
  12. package/dist/client/client.d.ts.map +1 -1
  13. package/dist/client/client.js +58 -25
  14. package/dist/client/client.js.map +1 -1
  15. package/dist/client/config.d.ts +46 -7
  16. package/dist/client/config.d.ts.map +1 -1
  17. package/dist/client/config.js +2 -2
  18. package/dist/client/config.js.map +1 -1
  19. package/dist/client/group-outbox.d.ts +38 -0
  20. package/dist/client/group-outbox.d.ts.map +1 -0
  21. package/dist/client/group-outbox.js +221 -0
  22. package/dist/client/group-outbox.js.map +1 -0
  23. package/dist/client/group-sealed-sender.d.ts +28 -0
  24. package/dist/client/group-sealed-sender.d.ts.map +1 -0
  25. package/dist/client/group-sealed-sender.js +74 -0
  26. package/dist/client/group-sealed-sender.js.map +1 -0
  27. package/dist/client/groups.d.ts.map +1 -1
  28. package/dist/client/groups.js +14 -4
  29. package/dist/client/groups.js.map +1 -1
  30. package/dist/client/hosted-push.d.ts +77 -0
  31. package/dist/client/hosted-push.d.ts.map +1 -0
  32. package/dist/client/hosted-push.js +90 -0
  33. package/dist/client/hosted-push.js.map +1 -0
  34. package/dist/client/hosted.d.ts +207 -0
  35. package/dist/client/hosted.d.ts.map +1 -0
  36. package/dist/client/hosted.js +505 -0
  37. package/dist/client/hosted.js.map +1 -0
  38. package/dist/client/index.d.ts +4 -2
  39. package/dist/client/index.d.ts.map +1 -1
  40. package/dist/client/index.js +2 -0
  41. package/dist/client/index.js.map +1 -1
  42. package/dist/client/relay-subscription.d.ts.map +1 -1
  43. package/dist/client/relay-subscription.js +34 -7
  44. package/dist/client/relay-subscription.js.map +1 -1
  45. package/dist/client/{sealed-sender-ops.d.ts → sealed-sender.d.ts} +39 -22
  46. package/dist/client/sealed-sender.d.ts.map +1 -0
  47. package/dist/client/sealed-sender.js +296 -0
  48. package/dist/client/sealed-sender.js.map +1 -0
  49. package/dist/client/signal-service-cipher.d.ts +23 -26
  50. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  51. package/dist/client/signal-service-cipher.js +465 -706
  52. package/dist/client/signal-service-cipher.js.map +1 -1
  53. package/dist/client/types.d.ts +18 -3
  54. package/dist/client/types.d.ts.map +1 -1
  55. package/dist/client/types.js +6 -0
  56. package/dist/client/types.js.map +1 -1
  57. package/dist/device/index.d.ts +2 -2
  58. package/dist/device/index.d.ts.map +1 -1
  59. package/dist/device/index.js +1 -1
  60. package/dist/device/index.js.map +1 -1
  61. package/dist/device/transfer.d.ts +7 -43
  62. package/dist/device/transfer.d.ts.map +1 -1
  63. package/dist/device/transfer.js +31 -150
  64. package/dist/device/transfer.js.map +1 -1
  65. package/dist/device/types.d.ts +6 -47
  66. package/dist/device/types.d.ts.map +1 -1
  67. package/dist/device/types.js +1 -1
  68. package/dist/device/types.js.map +1 -1
  69. package/dist/index.d.ts +5 -4
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +5 -5
  72. package/dist/index.js.map +1 -1
  73. package/dist/internal/encoding/proto/pq-ratchet-serialize.js +1 -1
  74. package/dist/internal/encoding/proto/pq-ratchet-serialize.js.map +1 -1
  75. package/dist/internal/encoding/proto/primitives.js +1 -1
  76. package/dist/internal/encoding/proto/primitives.js.map +1 -1
  77. package/dist/internal/groups/manager.d.ts +3 -3
  78. package/dist/internal/groups/manager.d.ts.map +1 -1
  79. package/dist/internal/groups/manager.js +5 -4
  80. package/dist/internal/groups/manager.js.map +1 -1
  81. package/dist/internal/protocol/sealed-sender/certificate.d.ts +10 -4
  82. package/dist/internal/protocol/sealed-sender/certificate.d.ts.map +1 -1
  83. package/dist/internal/protocol/sealed-sender/certificate.js +64 -7
  84. package/dist/internal/protocol/sealed-sender/certificate.js.map +1 -1
  85. package/dist/internal/protocol/sealed-sender/decryption.d.ts +34 -47
  86. package/dist/internal/protocol/sealed-sender/decryption.d.ts.map +1 -1
  87. package/dist/internal/protocol/sealed-sender/decryption.js +95 -182
  88. package/dist/internal/protocol/sealed-sender/decryption.js.map +1 -1
  89. package/dist/internal/protocol/sealed-sender/encryption.d.ts +49 -64
  90. package/dist/internal/protocol/sealed-sender/encryption.d.ts.map +1 -1
  91. package/dist/internal/protocol/sealed-sender/encryption.js +120 -123
  92. package/dist/internal/protocol/sealed-sender/encryption.js.map +1 -1
  93. package/dist/internal/protocol/sealed-sender/index.d.ts +5 -7
  94. package/dist/internal/protocol/sealed-sender/index.d.ts.map +1 -1
  95. package/dist/internal/protocol/sealed-sender/index.js +4 -12
  96. package/dist/internal/protocol/sealed-sender/index.js.map +1 -1
  97. package/dist/internal/protocol/sealed-sender/{v2-helpers.d.ts → multi-recipient-crypto.d.ts} +1 -1
  98. package/dist/internal/protocol/sealed-sender/multi-recipient-crypto.d.ts.map +1 -0
  99. package/dist/internal/protocol/sealed-sender/{v2-helpers.js → multi-recipient-crypto.js} +1 -1
  100. package/dist/internal/protocol/sealed-sender/multi-recipient-crypto.js.map +1 -0
  101. package/dist/internal/protocol/sealed-sender/{v2-binary.d.ts → multi-recipient-message.d.ts} +3 -2
  102. package/dist/internal/protocol/sealed-sender/multi-recipient-message.d.ts.map +1 -0
  103. package/dist/internal/protocol/sealed-sender/{v2-binary.js → multi-recipient-message.js} +16 -8
  104. package/dist/internal/protocol/sealed-sender/multi-recipient-message.js.map +1 -0
  105. package/dist/internal/protocol/sealed-sender/proto/index.d.ts +3 -0
  106. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  107. package/dist/internal/protocol/sealed-sender/proto/index.js +25 -2
  108. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  109. package/dist/internal/protocol/sealed-sender/trust-root.d.ts +11 -1
  110. package/dist/internal/protocol/sealed-sender/trust-root.d.ts.map +1 -1
  111. package/dist/internal/protocol/sealed-sender/trust-root.js +13 -1
  112. package/dist/internal/protocol/sealed-sender/trust-root.js.map +1 -1
  113. package/dist/internal/protocol/sealed-sender/types.d.ts +20 -135
  114. package/dist/internal/protocol/sealed-sender/types.d.ts.map +1 -1
  115. package/dist/internal/protocol/sealed-sender/types.js +15 -6
  116. package/dist/internal/protocol/sealed-sender/types.js.map +1 -1
  117. package/dist/internal/protocol/sender-keys/manager.d.ts +22 -1
  118. package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
  119. package/dist/internal/protocol/sender-keys/manager.js +39 -4
  120. package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
  121. package/dist/internal/protocol/spqr/braid-serialize.js +1 -1
  122. package/dist/internal/protocol/spqr/braid-serialize.js.map +1 -1
  123. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js +4 -4
  124. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js.map +1 -1
  125. package/dist/internal/protocol/zk/groups/index.d.ts +1 -1
  126. package/dist/internal/protocol/zk/groups/index.d.ts.map +1 -1
  127. package/dist/internal/protocol/zk/groups/index.js +1 -1
  128. package/dist/internal/protocol/zk/groups/index.js.map +1 -1
  129. package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts +37 -12
  130. package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts.map +1 -1
  131. package/dist/internal/protocol/zk/groups/profile-key-credential.js +104 -31
  132. package/dist/internal/protocol/zk/groups/profile-key-credential.js.map +1 -1
  133. package/dist/internal/sesame/types.d.ts +0 -2
  134. package/dist/internal/sesame/types.d.ts.map +1 -1
  135. package/dist/internal/sesame/types.js +0 -2
  136. package/dist/internal/sesame/types.js.map +1 -1
  137. package/dist/local/store/expo/adapter.d.ts +1 -0
  138. package/dist/local/store/expo/adapter.d.ts.map +1 -1
  139. package/dist/local/store/expo/adapter.js +3 -0
  140. package/dist/local/store/expo/adapter.js.map +1 -1
  141. package/dist/local/store/expo/key-storage.d.ts +1 -0
  142. package/dist/local/store/expo/key-storage.d.ts.map +1 -1
  143. package/dist/local/store/expo/key-storage.js +4 -0
  144. package/dist/local/store/expo/key-storage.js.map +1 -1
  145. package/dist/local/store/memory/adapter.d.ts +1 -0
  146. package/dist/local/store/memory/adapter.d.ts.map +1 -1
  147. package/dist/local/store/memory/adapter.js +4 -0
  148. package/dist/local/store/memory/adapter.js.map +1 -1
  149. package/dist/local/store/node/adapter.d.ts +1 -0
  150. package/dist/local/store/node/adapter.d.ts.map +1 -1
  151. package/dist/local/store/node/adapter.js +3 -0
  152. package/dist/local/store/node/adapter.js.map +1 -1
  153. package/dist/local/store/node/database.d.ts +1 -0
  154. package/dist/local/store/node/database.d.ts.map +1 -1
  155. package/dist/local/store/node/database.js +5 -0
  156. package/dist/local/store/node/database.js.map +1 -1
  157. package/dist/local/store/react-native/adapter.d.ts +1 -0
  158. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  159. package/dist/local/store/react-native/adapter.js +4 -0
  160. package/dist/local/store/react-native/adapter.js.map +1 -1
  161. package/dist/local/store/react-native/reference-backend.js +1 -1
  162. package/dist/local/store/react-native/reference-backend.js.map +1 -1
  163. package/dist/local/store/reliability.d.ts +63 -0
  164. package/dist/local/store/reliability.d.ts.map +1 -0
  165. package/dist/local/store/reliability.js +219 -0
  166. package/dist/local/store/reliability.js.map +1 -0
  167. package/dist/local/store/web/adapter.d.ts +1 -0
  168. package/dist/local/store/web/adapter.d.ts.map +1 -1
  169. package/dist/local/store/web/adapter.js +5 -0
  170. package/dist/local/store/web/adapter.js.map +1 -1
  171. package/dist/media/index.d.ts +0 -1
  172. package/dist/media/index.d.ts.map +1 -1
  173. package/dist/media/index.js +0 -1
  174. package/dist/media/index.js.map +1 -1
  175. package/dist/remote/relay/convex/backend.d.ts +6 -16
  176. package/dist/remote/relay/convex/backend.d.ts.map +1 -1
  177. package/dist/remote/relay/convex/backend.js +12 -21
  178. package/dist/remote/relay/convex/backend.js.map +1 -1
  179. package/dist/remote/relay/convex/component/_generated/component.d.ts +9 -16
  180. package/dist/remote/relay/convex/component/_generated/component.d.ts.map +1 -1
  181. package/dist/remote/relay/convex/component/certificates.d.ts.map +1 -1
  182. package/dist/remote/relay/convex/component/certificates.js +14 -5
  183. package/dist/remote/relay/convex/component/certificates.js.map +1 -1
  184. package/dist/remote/relay/convex/component/messages.d.ts +2 -15
  185. package/dist/remote/relay/convex/component/messages.d.ts.map +1 -1
  186. package/dist/remote/relay/convex/component/messages.js +14 -48
  187. package/dist/remote/relay/convex/component/messages.js.map +1 -1
  188. package/dist/remote/relay/convex/component/schema.d.ts +5 -3
  189. package/dist/remote/relay/convex/component/schema.js +2 -1
  190. package/dist/remote/relay/convex/component/schema.js.map +1 -1
  191. package/dist/remote/relay/convex/component/zkAuth.d.ts +7 -1
  192. package/dist/remote/relay/convex/component/zkAuth.d.ts.map +1 -1
  193. package/dist/remote/relay/convex/component/zkAuth.js +29 -14
  194. package/dist/remote/relay/convex/component/zkAuth.js.map +1 -1
  195. package/dist/remote/relay/convex/relay.d.ts +2 -5
  196. package/dist/remote/relay/convex/relay.d.ts.map +1 -1
  197. package/dist/remote/relay/convex/relay.js +17 -47
  198. package/dist/remote/relay/convex/relay.js.map +1 -1
  199. package/dist/remote/relay/memory/adapter.d.ts +4 -10
  200. package/dist/remote/relay/memory/adapter.d.ts.map +1 -1
  201. package/dist/remote/relay/memory/adapter.js +31 -34
  202. package/dist/remote/relay/memory/adapter.js.map +1 -1
  203. package/dist/remote/relay/types.d.ts +6 -19
  204. package/dist/remote/relay/types.d.ts.map +1 -1
  205. package/dist/types/api.d.ts +2 -0
  206. package/dist/types/api.d.ts.map +1 -1
  207. package/dist/types/errors.d.ts +3 -1
  208. package/dist/types/errors.d.ts.map +1 -1
  209. package/dist/types/errors.js +4 -2
  210. package/dist/types/errors.js.map +1 -1
  211. package/dist/types/protocol-config.d.ts +1 -1
  212. package/dist/username/link.d.ts.map +1 -1
  213. package/dist/username/link.js +1 -1
  214. package/dist/username/link.js.map +1 -1
  215. package/dist/utils/retry.d.ts +2 -1
  216. package/dist/utils/retry.d.ts.map +1 -1
  217. package/dist/utils/retry.js +2 -1
  218. package/dist/utils/retry.js.map +1 -1
  219. package/docs/ASSURANCE.md +16 -10
  220. package/docs/CLIENT_COMPOSITION.md +3 -0
  221. package/docs/DEVIATIONS.md +32 -61
  222. package/docs/DOCUMENTATION_STANDARDS.md +28 -0
  223. package/docs/ERROR_HANDLING.md +91 -60
  224. package/docs/GETTING_STARTED.md +27 -1
  225. package/docs/INTERFACES.md +5 -0
  226. package/docs/PACKAGE_SURFACE.md +1 -0
  227. package/docs/PROTOCOL_POLICY.md +6 -0
  228. package/docs/RECIPES.md +9 -0
  229. package/docs/SECURITY.md +6 -0
  230. package/encoding/README.md +1 -0
  231. package/files/README.md +1 -0
  232. package/groups/README.md +1 -0
  233. package/keys/README.md +2 -0
  234. package/local/store/README.md +2 -0
  235. package/local/store/expo/README.md +2 -0
  236. package/local/store/memory/README.md +2 -0
  237. package/local/store/node/README.md +1 -0
  238. package/local/store/react-native/README.md +2 -0
  239. package/local/store/web/README.md +1 -0
  240. package/local/vault/README.md +1 -0
  241. package/media/README.md +2 -0
  242. package/package.json +4 -2
  243. package/profile/README.md +1 -0
  244. package/remote/README.md +6 -0
  245. package/remote/object-store/README.md +1 -0
  246. package/remote/object-store/convex-r2/README.md +2 -0
  247. package/remote/object-store/s3/README.md +1 -0
  248. package/remote/relay/README.md +2 -0
  249. package/remote/relay/convex/README.md +1 -0
  250. package/remote/relay/convex/component/README.md +29 -14
  251. package/remote/relay/memory/README.md +2 -0
  252. package/safety/README.md +1 -0
  253. package/scripts/oe-groups.mjs +5 -1
  254. package/sealed-sender/README.md +1 -0
  255. package/types/README.md +1 -0
  256. package/username/README.md +1 -0
  257. package/utils/README.md +1 -0
  258. package/zk/README.md +1 -0
  259. package/dist/client/sealed-sender-ops.d.ts.map +0 -1
  260. package/dist/client/sealed-sender-ops.js +0 -203
  261. package/dist/client/sealed-sender-ops.js.map +0 -1
  262. package/dist/internal/protocol/sealed-sender/decryption-v2.d.ts +0 -46
  263. package/dist/internal/protocol/sealed-sender/decryption-v2.d.ts.map +0 -1
  264. package/dist/internal/protocol/sealed-sender/decryption-v2.js +0 -198
  265. package/dist/internal/protocol/sealed-sender/decryption-v2.js.map +0 -1
  266. package/dist/internal/protocol/sealed-sender/encryption-v2.d.ts +0 -56
  267. package/dist/internal/protocol/sealed-sender/encryption-v2.d.ts.map +0 -1
  268. package/dist/internal/protocol/sealed-sender/encryption-v2.js +0 -163
  269. package/dist/internal/protocol/sealed-sender/encryption-v2.js.map +0 -1
  270. package/dist/internal/protocol/sealed-sender/v2-binary.d.ts.map +0 -1
  271. package/dist/internal/protocol/sealed-sender/v2-binary.js.map +0 -1
  272. package/dist/internal/protocol/sealed-sender/v2-helpers.d.ts.map +0 -1
  273. package/dist/internal/protocol/sealed-sender/v2-helpers.js.map +0 -1
@@ -94,7 +94,7 @@ export interface ProtocolSelectionEvent {
94
94
  *
95
95
  * Braid mode spreads an ML-KEM key agreement across many messages. Each
96
96
  * message carries one erasure-coded chunk, and an epoch closes only once
97
- * enough chunks have travelled in both directions. Nothing outside the braid
97
+ * enough chunks have traveled in both directions. Nothing outside the braid
98
98
  * state machine can otherwise observe that. A host that wants to show or log
99
99
  * the ratchet's progress has no other source for it.
100
100
  */
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../username/link.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,UAAU,CAAC;IACpB,iBAAiB,EAAE,UAAU,CAAC;CAC/B;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,UAAU,CAAC;IACpB,MAAM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C;AACnD,eAAO,MAAM,mCAAmC,QACe,CAAC;AAEhE;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,UAAU,GAC3B,OAAO,CAAC,YAAY,CAAC,CAGvB;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAG7E;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,sBAAsB,GAAG,MAAM,CAOvF;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,sBAAsB,CAcpF;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,UAAU,EAAE,sBAAsB,GACjC,gCAAgC,CAOlC;AAED;;GAEG;AACH,wBAAgB,iCAAiC,CAC/C,UAAU,EAAE,gCAAgC,GAC3C,sBAAsB,CAQxB"}
@@ -6,7 +6,7 @@
6
6
  * payloads without exposing the plaintext username to the service.
7
7
  */
8
8
  import { base64ToBytes, bytesToUrlSafeBase64, concatBytes, urlSafeToBase64, } from '../internal/crypto/utils.js';
9
- import { bytesToServiceId, serviceIdToBytes } from '../internal/protocol/sealed-sender/v2-binary.js';
9
+ import { bytesToServiceId, serviceIdToBytes, } from '../internal/protocol/sealed-sender/multi-recipient-message.js';
10
10
  import { asBase64 } from '../types/utils.js';
11
11
  // Fixed username-link entropy size.
12
12
  export const USERNAME_LINK_ENTROPY_SIZE = 32;
@@ -1 +1 @@
1
- {"version":3,"file":"link.js","sourceRoot":"","sources":["../../username/link.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,MAAM,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,CAAC,iCAAiC,mCAAmC,QAAQ,CAAC,CAAC;IAChG,CAAC;IAED,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,0BAA0B,CAAC,CAAC;IAC7D,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAE9D,OAAO;QACL,OAAO;QACP,MAAM,EAAE,gBAAgB,CAAC,WAAW,CAAC;KACtC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,+BAA+B,CAC7C,UAAkC;IAElC,2BAA2B,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAEhD,OAAO;QACL,OAAO,EAAE,oBAAoB,CAAC,UAAU,CAAC,OAAO,CAAC;QACjD,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iCAAiC,CAC/C,UAA4C;IAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7E,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAErC,OAAO;QACL,OAAO;QACP,MAAM,EAAE,UAAU,CAAC,MAAM;KAC1B,CAAC;AACJ,CAAC;AAED,SAAS,2BAA2B,CAAC,OAAmB;IACtD,IAAI,OAAO,CAAC,MAAM,KAAK,0BAA0B,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,yCAAyC,0BAA0B,QAAQ,CAAC,CAAC;IAC/F,CAAC;AACH,CAAC;AAED,KAAK,UAAU,sBAAsB;IAGnC,OAAO,MAAM,CAAC,oCAAoC,CAAC,CAAC;AACtD,CAAC"}
@@ -29,7 +29,8 @@ export interface SignalProtocolRetryConfig {
29
29
  * Check if an error is retryable for Signal Protocol operations
30
30
  *
31
31
  * Non-retryable:
32
- * - Encryption error codes (invalid prekey, session conflict, etc.)
32
+ * - The eight codes in NON_RETRYABLE_ERROR_CODES (invalid prekey bundle,
33
+ * untrusted identity, and the rest)
33
34
  *
34
35
  * Retryable:
35
36
  * - Network/timeout errors
@@ -1 +1 @@
1
- {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../utils/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;GAIG;AACH,OAAO,EAAE,CAAC;AACV,MAAM,WAAW,yBAAyB;IACxC,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAsFD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAyBtD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAC/B,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,MAAM,GAAE,yBAA8B,GACrC,OAAO,CAAC,CAAC,CAAC,CAoCZ"}
1
+ {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../utils/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;GAIG;AACH,OAAO,EAAE,CAAC;AACV,MAAM,WAAW,yBAAyB;IACxC,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAsFD;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAyBtD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAC/B,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,MAAM,GAAE,yBAA8B,GACrC,OAAO,CAAC,CAAC,CAAC,CAoCZ"}
@@ -83,7 +83,8 @@ function isRaceConditionError(error) {
83
83
  * Check if an error is retryable for Signal Protocol operations
84
84
  *
85
85
  * Non-retryable:
86
- * - Encryption error codes (invalid prekey, session conflict, etc.)
86
+ * - The eight codes in NON_RETRYABLE_ERROR_CODES (invalid prekey bundle,
87
+ * untrusted identity, and the rest)
87
88
  *
88
89
  * Retryable:
89
90
  * - Network/timeout errors
@@ -1 +1 @@
1
- {"version":3,"file":"retry.js","sourceRoot":"","sources":["../../utils/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAqB/C,MAAM,mBAAmB,GAAG;IAC1B,UAAU,EAAE,CAAC;IACb,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,KAAK;IACf,iBAAiB,EAAE,CAAC;IACpB,YAAY,EAAE,IAAI;CACnB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC;IACxC,mBAAmB,CAAC,qBAAqB;IACzC,mBAAmB,CAAC,iBAAiB;IACrC,mBAAmB,CAAC,yBAAyB;IAC7C,mBAAmB,CAAC,iBAAiB;IAErC,mBAAmB,CAAC,kBAAkB;IACtC,mBAAmB,CAAC,6BAA6B;IACjD,mBAAmB,CAAC,wBAAwB;IAC5C,mBAAmB,CAAC,yBAAyB;CAC9C,CAAC,CAAC;AAEH,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,O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AAE,CAAC;gBACxE,MAAM;YACR,CAAC;YAED,MAAM,KAAK,GAAG,qBAAqB,CACjC,OAAO,EACP,SAAS,EACT,QAAQ,EACR,mBAAmB,CAAC,iBAAiB,EACrC,YAAY,CACb,CAAC;YACF,MAAM,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IAED,MAAM,SAAS,IAAI,IAAI,KAAK,CAAC,GAAG,aAAa,gCAAgC,CAAC,CAAC;AACjF,CAAC"}
package/docs/ASSURANCE.md CHANGED
@@ -30,16 +30,16 @@ files that nobody could run would look like assurance without being any.
30
30
  Every change to the source repository runs the full set of automated checks,
31
31
  and an export is only cut from a revision where they pass.
32
32
 
33
- Most recent full run on 2026-08-17:
33
+ Most recent full run on 2026-08-27:
34
34
 
35
35
  | | |
36
36
  |---|---|
37
- | Modules executed | 389 |
38
- | Assertions | 6,922 |
39
- | Passed | 6,920 |
37
+ | Modules executed | 393 |
38
+ | Assertions | 6,986 |
39
+ | Passed | 6,984 |
40
40
  | Skipped | 2 |
41
41
  | Failed | 0 |
42
- | Wall time | 139 s |
42
+ | Wall time | 212 s |
43
43
 
44
44
  That figure excludes longer-running performance and endurance checks, which run
45
45
  under separate commands.
@@ -74,9 +74,10 @@ Coverage spans, in the terms this documentation uses elsewhere:
74
74
  backend.
75
75
  - **Public surface**. The exported API shape, and the quickstart printed in the
76
76
  [README](../README.md). CI runs that quickstart as written on every change.
77
- - **Error surface**. Every exported error class and every documented error code
78
- traces back to a construction site in the library. An error the documentation
79
- tells you to branch on is therefore one the library can throw.
77
+ - **Error surface**. Every class in the exported `EncryptionError` family has a
78
+ construction site. Every `EncryptionErrorCode` and
79
+ `MediaAttachmentErrorCode` value also has one. The check rejects unresolved
80
+ code forwarding instead of treating it as proof.
80
81
 
81
82
  In every adapter case the assertions target the adapter's contract. The engines
82
83
  are the environment the adapter must honor that contract in, not the subject of
@@ -108,8 +109,13 @@ a badge on the README that you can click through to the run logs:
108
109
  and run against the packed package. A second run adds
109
110
  `--disallow-code-generation-from-strings`, which stands in for a strict
110
111
  `script-src` policy and for a Chrome MV3 extension.
111
- - every classified snippet in the shipped documentation, executed against the
112
- packed package.
112
+ - every TypeScript snippet in the shipped documentation, checked against the
113
+ packed package. The check runs each complete program and matches its output.
114
+ For a snippet that cannot run, it compiles every SDK name against the
115
+ package's types. A renamed or deleted export therefore fails the build in
116
+ every document that names it. A snippet that previews an unreleased API
117
+ declares which import paths do not exist yet. The build fails if one of them
118
+ resolves, and names each pseudocode block in its log.
113
119
  - every subpath in the package's export map. A consumer outside the repository
114
120
  imports each one, with all of the optional peer dependencies removed from
115
121
  its `node_modules`. The check itself names the platform-bound entry points,
@@ -29,6 +29,7 @@ const signal = await createSignalProtocolClient({
29
29
 
30
30
  ## Expo + Convex Client
31
31
 
32
+ <!-- doc-snippet:skip requires-external-context -->
32
33
  ```ts
33
34
  import { createSignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
34
35
  import { expoStore } from "@open-e2ee/signal-protocol-sdk/local/store/expo";
@@ -60,6 +61,7 @@ const signal = await createSignalProtocolClient({
60
61
 
61
62
  ## Attachments
62
63
 
64
+ <!-- doc-snippet:skip requires-external-context -->
63
65
  ```ts
64
66
  import { convexR2ObjectStore } from "@open-e2ee/signal-protocol-sdk/remote/object-store/convex-r2";
65
67
  import { api } from "../convex/_generated/api";
@@ -103,6 +105,7 @@ app code does not have to compose queue callbacks for ordinary sends. See
103
105
  `SignalProtocolClient.create()` remains the low-level primitive. It uses the same
104
106
  developer-facing protocol config:
105
107
 
108
+ <!-- doc-snippet:skip requires-external-context -->
106
109
  ```ts
107
110
  import { SignalProtocolClient } from "@open-e2ee/signal-protocol-sdk";
108
111
 
@@ -57,7 +57,7 @@ Deviations fall into three kinds:
57
57
  `libsignal` system.
58
58
 
59
59
  A fourth label, **faithful**, appears in the table for an area that follows the
60
- specification closely. Such a row is here only to delimit what the neighbouring
60
+ specification closely. Such a row is here only to delimit what the neighboring
61
61
  deviations do and do not touch.
62
62
 
63
63
  Companion documents: [Protocol Policy](./PROTOCOL_POLICY.md) states which
@@ -83,12 +83,11 @@ model and what is out of scope.
83
83
  | **SPQR / ML-KEM Braid** | ML-KEM Braid rev. 1 | **Deviation.** Same protocol, same KDF labels, same Reed–Solomon parameters, byte-identical message framing — except `hek = SHA3-256(ek_seed ‖ ek_vector)`, the operand order the specification states, which is the reverse of `libsignal`'s implementation | The normative text was followed over the executable reference | Wire-visible. Headers, ciphertexts, and shared secrets diverge; a braid session cannot complete a single epoch against `libsignal`'s implementation. Also means the KEM is not FIPS 203 in braid mode |
84
84
  | **Triple Ratchet** | `libsignal` `triple_ratchet.rs` | **Faithful.** The PQ secret enters as the HKDF salt at message-key expansion, same label, same order | — | The braiding construction follows the ML-KEM Braid specification |
85
85
  | **Sesame** | Sesame rev. 2 | **Deviation** on session expiry (§4.2 applies only to unacknowledged sessions) and on deleted devices (hard-removed rather than marked stale). **Extensions:** QR provisioning, device transfer, encrypted device names, identity-change gating, a 5-device cap | Product requirements the specification does not address | Hard deletion **drops the MAXLATENCY window, so in-flight messages from a just-removed device become permanently undecryptable**. Device transfer clones ratchet state, which weakens the forward-secrecy bound |
86
- | **Sealed sender v1** | `libsignal` `sealed_sender.rs` | **Deviation.** Correct labels, cipher, and MAC length, but the 96-byte HKDF output is split `(cipher, mac, chain)` where `libsignal` splits `(chain, cipher, mac)`; keys in the salt omit the `0x05` type byte; the inner envelope is a hand-rolled varint format rather than the `UnidentifiedSenderMessage.Message` protobuf, though it now carries the same message-type values | The slice order and the missing prefix are unintentional; the framing is a deliberate simplification | Self-consistent and secure, but every v1 key sits in a different slot than `libsignal`'s |
87
- | **Sealed sender v2** | `libsignal` `sealed_sender.rs` | **Faithful** on all four labels, the KEM, AES-256-GCM-SIV, the multi-recipient binary format, and the `0x3FFF` registration-ID mask | — | The v2 construction follows `libsignal` |
86
+ | **Sealed sender** | `libsignal` `sealed_sender.rs` | **Faithful** on the multi-recipient transport labels, KEM, AES-256-GCM-SIV, binary format, and `0x3FFF` registration-ID mask. **Extension:** sender and server certificates require signed Relay scope and issuer validity under operator-owned Ed25519 roots | Binds anonymous delivery to one Relay deployment and supports explicit issuer rotation and revocation | The transport follows `libsignal`; certificates are not interchangeable with Signal Messenger or another deployment |
88
87
  | **Delivery token** | `libsignal` `profile_key.rs` | **Faithful.** `deriveAccessKey` follows `libsignal`'s `ProfileKey::derive_access_key`, and reproduces `libsignal`'s published known-answer values | — | Not an SDK invention, despite what the module name suggests |
89
88
  | **Sender keys** | `libsignal` `sender_keys.rs` | **Deviation.** Protobuf field numbers and `0x33` framing match, and the `0x01`/`0x02` seeds match, but message-key derivation **omits HKDF-Extract**, signatures are Ed25519 not XEdDSA, and `distributionUuid` carries a UTF-8 string rather than 16 UUID bytes | The Ed25519 choice follows the identity profile; the missing Extract appears unintentional | Group message keys differ from `libsignal`'s for the same chain key. Confirmed numerically, not merely by inspection |
90
- | **Groups** | Signal Private Group System | **Independent design.** Real zkgroup primitives underneath; the server validates every change against zero-knowledge presentations and signs the accepted result, and clients verify those signatures. **Deviation:** profile-key credential issuance is not blinded — the issuing server sees the raw profile key at issuance time | Ships a validating group server with an enforcement contract (S1–S14) specified in-tree | Not wire-compatible with the Signal Private Group System; credentials are not interchangeable. The unblinded issuance path means a hostile issuance server learns profile keys, which the Signal Private Group System's blinded issuance prevents |
91
- | **zkgroup / zkcredential** | `libsignal` `zkgroup`, `zkcredential`, `poksho` | **Faithful** port of the Ristretto255 KVAC and Sigma-protocol system, verified against `libsignal`'s known-answer vectors. **Deviation:** server parameter derivation is structured as four labelled derivations rather than one seeded derivation | Server keys are the deploying operator's own trust root (each deployment generates its own seed), not Signal Messenger's | The zero-knowledge properties are real. Credentials are not interchangeable with Signal Messenger's |
89
+ | **Groups** | Signal Private Group System | **Independent design.** Real zkgroup primitives underneath; profile-key credential issuance blinds the ACI-bound profile-key attribute, the server validates every change against zero-knowledge presentations and signs the accepted result, and clients verify those signatures | Ships a validating group server with an enforcement contract (S1–S14) specified in-tree | Not wire-compatible with the Signal Private Group System; credentials are not interchangeable. The issuer sees the authenticated ACI and redemption window, but not the raw profile key |
90
+ | **zkgroup / zkcredential** | `libsignal` `zkgroup`, `zkcredential`, `poksho` | **Faithful** port of the Ristretto255 KVAC and Sigma-protocol system, verified against `libsignal`'s known-answer vectors. **Deviation:** server parameter derivation is structured as four labeled derivations rather than one seeded derivation | Server keys are the deploying operator's own trust root (each deployment generates its own seed), not Signal Messenger's | The zero-knowledge properties are real. Credentials are not interchangeable with Signal Messenger's |
92
91
  | **Registration IDs** | `libsignal` `sealed_sender.rs` | **Faithful.** Generated in `[1, 16383]`, strictly inside the 14 bits the wire format reserves | — | — |
93
92
 
94
93
  ---
@@ -247,7 +246,7 @@ The SDK generates registration IDs in the closed range `[1, 16383]`
247
246
  The upper bound is load-bearing rather than cosmetic. The value `16384` is
248
247
  `0x4000` and does not fit in 14 bits. The SDK's multi-recipient sealed-sender
249
248
  encoder masks rather than rejects
250
- (`internal/protocol/sealed-sender/v2-binary.ts:170-171`), so an ID one above
249
+ (`internal/protocol/sealed-sender/multi-recipient-message.ts`), so an ID one above
251
250
  the range would reach the wire as `0`. The generated range is therefore strictly
252
251
  narrower than `libsignal`'s accepted range, and a test asserts that every
253
252
  generated ID survives the mask unchanged.
@@ -307,7 +306,7 @@ The SDK does not use `libsignal`'s labels, `WhisperText` and
307
306
  Inheriting them would be wrong on both parameters:
308
307
 
309
308
  1. **`pqkem` would name a KEM the SDK does not run**, violating §2.2. That is
310
- worse than a labelling error. Two implementations feeding an identical label
309
+ worse than a labeling error. Two implementations feeding an identical label
311
310
  derive *different* shared secrets. The KEM underneath differs, and nothing at
312
311
  the KDF layer signals it. Domain separation is the one job the info string
313
312
  has.
@@ -538,7 +537,7 @@ independently and pinned against commit `fd32048`, which upstream tags
538
537
  - **ML-KEM-768 with the same incremental split** (32-byte seed, 1152-byte vector,
539
538
  960/128-byte ciphertext parts).
540
539
 
541
- The delta review that moved the pin forward from `f2589fef` found one behavioural
540
+ The delta review that moved the pin forward from `f2589fef` found one behavioral
542
541
  change upstream. Decoding a chain epoch direction now rejects a `next` chain key
543
542
  whose length is neither zero nor 32 bytes. The internal next-key assertion checks
544
543
  that same exact length rather than mere non-emptiness.
@@ -548,7 +547,7 @@ key, root key, and skipped-message key to be canonical base64 for exactly 32
548
547
  bytes (`internal/protocol/spqr/serialize.ts:44-72`). The SDK has no state in
549
548
  which the key is absent. Two upstream error strings now name the value they
550
549
  reject. The rest of the delta is proof-assistant annotation and loop rewriting,
551
- which leaves behaviour unchanged.
550
+ which leaves behavior unchanged.
552
551
 
553
552
  ### 4.1 The `hek` operand order diverges
554
553
 
@@ -758,7 +757,7 @@ possession must add it at the application layer.
758
757
 
759
758
  ## 6. Sealed sender
760
759
 
761
- ### 6.1 Version 2 is faithful
760
+ ### 6.1 The multi-recipient transport is faithful
762
761
 
763
762
  These parts match `libsignal`:
764
763
 
@@ -771,39 +770,9 @@ These parts match `libsignal`:
771
770
  ServiceIds
772
771
  - the packed device ID with its 14-bit registration ID and `0x3FFF` mask
773
772
 
774
- Certificate validation order and semantics match as well. That includes the
775
- trust-root loop, which does not short-circuit and therefore does not reveal which
776
- root validated.
777
-
778
- ### 6.2 Version 1 diverges in three places
779
-
780
- **The SDK splits the 96-byte HKDF output in a different order.** `libsignal`
781
- derives `(chain_key, cipher_key, mac_key)` ([`sealed_sender.rs:711-746`][ss]).
782
- The SDK derives `(cipher, mac, chain)`
783
- (`internal/protocol/sealed-sender/encryption.ts:164-166`). The construction is
784
- self-consistent and secure, because the keys are independent HKDF output either
785
- way. Every v1 key still sits in a different slot than `libsignal`'s. This is an
786
- implementation divergence rather than a design decision. The SDK's own pinned
787
- specification document records the same order, so the two agree with each other.
788
-
789
- **Public keys in the v1 salt and in certificates omit the `0x05` type byte.**
790
- `libsignal` uses the 33-byte serialized form. The SDK uses raw 32 bytes and
791
- enforces that length
792
- (`internal/protocol/sealed-sender/certificate.ts:306-309`). The SDK's own v2 path
793
- *does* apply the `0x05` prefix, so the two sealed-sender versions disagree with
794
- each other.
795
-
796
- **The inner envelope is a hand-rolled varint format**
797
- (`internal/protocol/sealed-sender/encryption.ts:46-86`) rather than the
798
- `UnidentifiedSenderMessage.Message` protobuf. It still carries the message-type
799
- field that `libsignal` dispatches on, which selects between prekey, regular,
800
- sender-key, and plaintext payloads ([`sealed_sender.rs:2055-2075`][ss]). The
801
- field is a leading byte holding `libsignal`'s enum values. The framing therefore
802
- differs while the dispatch does not.
803
-
804
- That field lets the unseal path restore the real message type. Without it the
805
- path would rebuild the envelope with a fixed type, and a sealed group message
806
- would not decrypt as a group message.
773
+ The base trust-root loop also matches. It does not short-circuit and therefore
774
+ does not reveal which root validated. Required signed scope and issuer-validity
775
+ checks extend the upstream certificate semantics.
807
776
 
808
777
  **`PLAINTEXT_CONTENT` (8) is a known wire value that this SDK rejects.**
809
778
  `libsignal` uses it to carry a `DecryptionErrorMessage` when no session exists
@@ -829,7 +798,7 @@ one pattern: sealed messages from one peer stack fail with that error while
829
798
  messages from this SDK succeed. Check the leading content-type byte before you
830
799
  treat that as a cryptographic failure.
831
800
 
832
- ### 6.3 The delivery token follows `libsignal`, not an SDK invention
801
+ ### 6.2 The delivery token follows `libsignal`, not an SDK invention
833
802
 
834
803
  Despite the module name, `deriveAccessKey`
835
804
  (`internal/protocol/sealed-sender/delivery-token.ts:52-91`) is `libsignal`'s
@@ -846,10 +815,11 @@ The SDK's own documentation once described a different, 12-byte HKDF
846
815
  construction that no code implements. That description is wrong, and the PR that
847
816
  accompanies this file corrects it.
848
817
 
849
- Certificate signatures use Ed25519 rather than XEdDSA, per §1.2, so SDK
850
- certificates cannot validate against a Signal Messenger trust root or vice versa. The
851
- revocation list is empty where `libsignal` revokes one key ID, which is
852
- appropriate for a different trust root but worth noting.
818
+ Certificate signatures use Ed25519 rather than XEdDSA, per §1.2. The signed
819
+ Relay scope and issuer-validity interval are deployment extensions. Hosted and
820
+ self-hosted deployments use disjoint operator roots, issuers, scopes, and
821
+ revocation policy. Their certificates cannot validate against each other or a
822
+ Signal Messenger trust root.
853
823
 
854
824
  ---
855
825
 
@@ -940,17 +910,18 @@ implements that contract. On every applied change, clients verify the server's
940
910
  signature, the group binding, the strict version sequence, and the pre-state
941
911
  authorization.
942
912
 
943
- **Profile-key credential issuance is not blinded**. The issuance endpoint
944
- receives the raw 32-byte profile key, so the issuing server sees every user's
945
- profile key in plaintext at issuance time. The Signal Private Group System issues
946
- profile-key credentials over a *blinded* commitment, so its server never learns
947
- the key. The blinding primitives exist in this codebase
948
- (`internal/protocol/zk/credentials/issuance.ts`), but nothing wires them into
949
- this path. Section 12.1 of the in-tree group specification carries the same
950
- caveat.
913
+ **Profile-key credential issuance uses a package-owned blinded wire format**.
914
+ The client sends a fixed-width serialized request that contains an ephemeral
915
+ blinding public key and an ACI-bound blinded profile-key attribute. The issuer
916
+ sees the authenticated ACI and the public redemption time, but it does not
917
+ receive the raw 32-byte profile key or the client's blinding secret. The client
918
+ verifies and unblinds the signed response with the matching request context.
919
+ Fresh request randomness makes two requests for the same ACI and profile key
920
+ unlinkable from the blinded request bytes.
951
921
 
952
- Until blinded issuance ships, a deployer must assume that the issuance server
953
- learns profile keys, and therefore profile names and avatars.
922
+ This preserves the Signal Private Group System's issuer-privacy property, but
923
+ the request and response encodings remain this SDK's own and are not
924
+ interchangeable with Signal Messenger or `libsignal` credentials.
954
925
 
955
926
  **Serialization is JSON**, not protobuf, both for group state
956
927
  (`internal/groups/manager.ts:1229-1236`) and for the blob payloads inside the
@@ -982,7 +953,7 @@ system parameters against a hex string taken from `libsignal`'s own Rust test,
982
953
  and it passes.
983
954
 
984
955
  One deviation remains. The SDK derives server secret parameters through four
985
- separately labelled key derivations, where `libsignal` uses a single seeded
956
+ separately labeled key derivations, where `libsignal` uses a single seeded
986
957
  derivation (`internal/protocol/zk/groups/server-params.ts:43-54`). The same
987
958
  randomness therefore yields different server keys.
988
959
 
@@ -1004,7 +975,7 @@ confirm any of them in source.
1004
975
 
1005
976
  - **Does a sealed-sender-wrapped prekey message decrypt end to end?** The unseal
1006
977
  path rebuilds the envelope with a fixed message type
1007
- (`client/sealed-sender-ops.ts:263-265`). An adjacent comment suggests that the
978
+ (`client/sealed-sender.ts`). An adjacent comment suggests that the
1008
979
  Sesame layer re-derives the initiation state from the ciphertext. This review
1009
980
  traced neither that path nor the integration tests. First-contact sealed
1010
981
  messages break if Sesame does not detect the state itself.
@@ -1031,7 +1002,7 @@ confirm any of them in source.
1031
1002
  `libsignal` commits the new state only after the MAC and the decryption
1032
1003
  succeed. The SDK's receive
1033
1004
  path mutates state during decode, and this review did not trace the caller's
1034
- rollback behaviour.
1005
+ rollback behavior.
1035
1006
  - **Does an equivalent of `libsignal`'s `promote_matching_session` exist?**
1036
1007
  `libsignal` matches archived sessions on `(version, base key)`. The SDK keys
1037
1008
  its map on the base key alone.
@@ -101,6 +101,34 @@ State boundaries directly:
101
101
  Avoid absolute security claims. Describe the threat boundary and required host
102
102
  controls instead.
103
103
 
104
+ ## Code snippets
105
+
106
+ Every TypeScript code block in the shipped documentation carries an HTML
107
+ comment that says how the build checks it. A block with no marker fails the
108
+ build, so a new snippet cannot enter the documentation unclassified.
109
+
110
+ | Marker | What the build does | Use it for |
111
+ | --- | --- | --- |
112
+ | `doc-snippet:run <id> expect="<stdout>"` | Compiles the snippet against the packed package, runs it, and matches its output. | A complete program. |
113
+ | `doc-snippet:skip <reason>` | Reconstructs every SDK name the snippet uses and compiles that against the packed package. | A snippet that needs a live client, a fixture, or a larger program around it. |
114
+ | `doc-snippet:planned <id> unshipped="<specifier>[,…]"` | Checks the shipped part as `skip` does, and asserts that each declared specifier does **not** resolve. | A preview of an API the package has not released. |
115
+ | `doc-snippet:illustrative <reason>` | Nothing. The build names the snippet on its own line. | Pseudocode, and only pseudocode. |
116
+
117
+ `skip` is the default for a snippet that cannot run. It is not an exemption:
118
+ a renamed or deleted export still fails the build, and the error names the
119
+ document the snippet came from.
120
+
121
+ `planned` states a negative, so the build fails when a declared specifier
122
+ starts to resolve. Promote the snippet to `skip` or `run` in the release that
123
+ ships the API, and the marker cannot outlive the claim it makes.
124
+
125
+ `illustrative` is the one tier no compiler reads. Use it only when the snippet
126
+ is not TypeScript: elided arguments, a bare object fragment, or control flow
127
+ written for a person. Anything that parses belongs in another tier.
128
+
129
+ `scripts/run-doc-snippets.mjs` runs all four. It reports each snippet by
130
+ document and identifier, so the build log shows which check each snippet took.
131
+
104
132
  ## Generated API documentation
105
133
 
106
134
  Do not edit `docs/api/` by hand. Update exported JSDoc or public declarations,