@ibgib/core-gib 0.1.53 → 0.1.55

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 (189) hide show
  1. package/CHANGELOG.md +16 -2
  2. package/README.md +12 -15
  3. package/dist/keystone/aggregate-details.respec.d.mts +2 -0
  4. package/dist/keystone/aggregate-details.respec.d.mts.map +1 -0
  5. package/dist/keystone/aggregate-details.respec.mjs +118 -0
  6. package/dist/keystone/aggregate-details.respec.mjs.map +1 -0
  7. package/dist/keystone/keystone-constants.d.mts +5 -0
  8. package/dist/keystone/keystone-constants.d.mts.map +1 -1
  9. package/dist/keystone/keystone-constants.mjs +6 -1
  10. package/dist/keystone/keystone-constants.mjs.map +1 -1
  11. package/dist/keystone/keystone-helpers.d.mts +7 -1
  12. package/dist/keystone/keystone-helpers.d.mts.map +1 -1
  13. package/dist/keystone/keystone-helpers.mjs +5 -2
  14. package/dist/keystone/keystone-helpers.mjs.map +1 -1
  15. package/dist/keystone/keystone-service-v1.d.mts +51 -0
  16. package/dist/keystone/keystone-service-v1.d.mts.map +1 -1
  17. package/dist/keystone/keystone-service-v1.mjs +176 -9
  18. package/dist/keystone/keystone-service-v1.mjs.map +1 -1
  19. package/dist/keystone/keystone-service-v1.respec.mjs +40 -98
  20. package/dist/keystone/keystone-service-v1.respec.mjs.map +1 -1
  21. package/dist/keystone/keystone-types.d.mts +5 -0
  22. package/dist/keystone/keystone-types.d.mts.map +1 -1
  23. package/dist/sync/graft-info/graft-info-helpers.respec.mjs +8 -8
  24. package/dist/sync/graft-info/graft-info-helpers.respec.mjs.map +1 -1
  25. package/dist/sync/sync-conflict-adv-multitimelines.respec.mjs +26 -30
  26. package/dist/sync/sync-conflict-adv-multitimelines.respec.mjs.map +1 -1
  27. package/dist/sync/sync-conflict-basic-divergence.respec.mjs +7 -8
  28. package/dist/sync/sync-conflict-basic-divergence.respec.mjs.map +1 -1
  29. package/dist/sync/sync-conflict-basic-multitimelines.respec.mjs +10 -11
  30. package/dist/sync/sync-conflict-basic-multitimelines.respec.mjs.map +1 -1
  31. package/dist/sync/sync-conflict-text-merge.respec.mjs +30 -33
  32. package/dist/sync/sync-conflict-text-merge.respec.mjs.map +1 -1
  33. package/dist/sync/sync-constants.d.mts +1 -56
  34. package/dist/sync/sync-constants.d.mts.map +1 -1
  35. package/dist/sync/sync-constants.mjs +2 -59
  36. package/dist/sync/sync-constants.mjs.map +1 -1
  37. package/dist/sync/sync-helpers.d.mts +0 -1
  38. package/dist/sync/sync-helpers.d.mts.map +1 -1
  39. package/dist/sync/sync-helpers.mjs +1 -6
  40. package/dist/sync/sync-helpers.mjs.map +1 -1
  41. package/dist/sync/sync-innerspace-constants.respec.mjs +5 -9
  42. package/dist/sync/sync-innerspace-constants.respec.mjs.map +1 -1
  43. package/dist/sync/sync-innerspace-deep-updates.respec.mjs +6 -7
  44. package/dist/sync/sync-innerspace-deep-updates.respec.mjs.map +1 -1
  45. package/dist/sync/sync-innerspace-dest-ahead-withid.respec.mjs +22 -22
  46. package/dist/sync/sync-innerspace-dest-ahead-withid.respec.mjs.map +1 -1
  47. package/dist/sync/sync-innerspace-dest-ahead.respec.mjs +8 -9
  48. package/dist/sync/sync-innerspace-dest-ahead.respec.mjs.map +1 -1
  49. package/dist/sync/sync-innerspace-multiple-timelines.respec.mjs +6 -7
  50. package/dist/sync/sync-innerspace-multiple-timelines.respec.mjs.map +1 -1
  51. package/dist/sync/sync-innerspace-partial-update.respec.mjs +7 -8
  52. package/dist/sync/sync-innerspace-partial-update.respec.mjs.map +1 -1
  53. package/dist/sync/sync-innerspace.respec.mjs +8 -11
  54. package/dist/sync/sync-innerspace.respec.mjs.map +1 -1
  55. package/dist/sync/sync-peer/sync-peer-http-receiver/sync-http-node-adapter.mjs +10 -5
  56. package/dist/sync/sync-peer/sync-peer-http-receiver/sync-http-node-adapter.mjs.map +1 -1
  57. package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-types.d.mts +3 -1
  58. package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-types.d.mts.map +1 -1
  59. package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.d.mts +4 -2
  60. package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.d.mts.map +1 -1
  61. package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.mjs +37 -6
  62. package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.mjs.map +1 -1
  63. package/dist/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-types.d.mts +3 -1
  64. package/dist/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-types.d.mts.map +1 -1
  65. package/dist/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-v1.d.mts +4 -2
  66. package/dist/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-v1.d.mts.map +1 -1
  67. package/dist/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-v1.mjs +37 -0
  68. package/dist/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-v1.mjs.map +1 -1
  69. package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-types.d.mts +7 -1
  70. package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-types.d.mts.map +1 -1
  71. package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.d.mts +10 -2
  72. package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.d.mts.map +1 -1
  73. package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mjs +50 -38
  74. package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mjs.map +1 -1
  75. package/dist/sync/sync-peer/sync-peer-types.d.mts +21 -5
  76. package/dist/sync/sync-peer/sync-peer-types.d.mts.map +1 -1
  77. package/dist/sync/sync-peer/sync-peer-v1.d.mts +30 -5
  78. package/dist/sync/sync-peer/sync-peer-v1.d.mts.map +1 -1
  79. package/dist/sync/sync-peer/sync-peer-v1.mjs +41 -25
  80. package/dist/sync/sync-peer/sync-peer-v1.mjs.map +1 -1
  81. package/dist/sync/sync-saga-context/sync-saga-context-helpers.d.mts +2 -11
  82. package/dist/sync/sync-saga-context/sync-saga-context-helpers.d.mts.map +1 -1
  83. package/dist/sync/sync-saga-context/sync-saga-context-helpers.mjs +7 -51
  84. package/dist/sync/sync-saga-context/sync-saga-context-helpers.mjs.map +1 -1
  85. package/dist/sync/sync-saga-context/sync-saga-context-types.d.mts +1 -47
  86. package/dist/sync/sync-saga-context/sync-saga-context-types.d.mts.map +1 -1
  87. package/dist/sync/sync-saga-coordinator.d.mts +6 -58
  88. package/dist/sync/sync-saga-coordinator.d.mts.map +1 -1
  89. package/dist/sync/sync-saga-coordinator.mjs +23 -425
  90. package/dist/sync/sync-saga-coordinator.mjs.map +1 -1
  91. package/dist/sync/sync-saga-message/sync-saga-message-types.d.mts +2 -2
  92. package/dist/sync/sync-saga-message/sync-saga-message-types.d.mts.map +1 -1
  93. package/dist/sync/sync-types.d.mts +2 -19
  94. package/dist/sync/sync-types.d.mts.map +1 -1
  95. package/dist/sync/sync-types.mjs.map +1 -1
  96. package/dist/test/mock-space.mjs +1 -1
  97. package/dist/test/mock-space.mjs.map +1 -1
  98. package/dist/test-helpers.d.mts +0 -6
  99. package/dist/test-helpers.d.mts.map +1 -1
  100. package/dist/test-helpers.mjs +2 -25
  101. package/dist/test-helpers.mjs.map +1 -1
  102. package/package.json +10 -34
  103. package/src/keystone/aggregate-details.respec.mts +137 -0
  104. package/src/keystone/docs/architecture.md +16 -0
  105. package/src/keystone/keystone-constants.mts +6 -1
  106. package/src/keystone/keystone-helpers.mts +9 -1
  107. package/src/keystone/keystone-service-v1.mts +216 -8
  108. package/src/keystone/keystone-service-v1.respec.mts +39 -103
  109. package/src/keystone/keystone-types.mts +6 -0
  110. package/src/sync/README.md +18 -0
  111. package/src/sync/docs/architecture.md +21 -0
  112. package/src/sync/graft-info/graft-info-helpers.respec.mts +7 -7
  113. package/src/sync/sync-conflict-adv-multitimelines.respec.mts +25 -29
  114. package/src/sync/sync-conflict-basic-divergence.respec.mts +6 -7
  115. package/src/sync/sync-conflict-basic-multitimelines.respec.mts +9 -10
  116. package/src/sync/sync-conflict-text-merge.respec.mts +29 -32
  117. package/src/sync/sync-constants.mts +2 -62
  118. package/src/sync/sync-helpers.mts +1 -8
  119. package/src/sync/sync-id-testlog.txt +421 -0
  120. package/src/sync/sync-innerspace-constants.respec.mts +4 -8
  121. package/src/sync/sync-innerspace-deep-updates.respec.mts +5 -6
  122. package/src/sync/sync-innerspace-dest-ahead-withid.respec.mts +23 -25
  123. package/src/sync/sync-innerspace-dest-ahead.respec.mts +7 -8
  124. package/src/sync/sync-innerspace-multiple-timelines.respec.mts +5 -6
  125. package/src/sync/sync-innerspace-partial-update.respec.mts +6 -7
  126. package/src/sync/sync-innerspace.respec.mts +7 -10
  127. package/src/sync/sync-peer/sync-peer-http-receiver/sync-http-node-adapter.mts +5 -5
  128. package/src/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-types.mts +5 -1
  129. package/src/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.mts +30 -9
  130. package/src/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-types.mts +3 -1
  131. package/src/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-v1.mts +29 -2
  132. package/src/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-types.mts +7 -1
  133. package/src/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mts +51 -38
  134. package/src/sync/sync-peer/sync-peer-types.mts +23 -6
  135. package/src/sync/sync-peer/sync-peer-v1.mts +68 -28
  136. package/src/sync/sync-saga-context/sync-saga-context-helpers.mts +6 -66
  137. package/src/sync/sync-saga-context/sync-saga-context-types.mts +1 -48
  138. package/src/sync/sync-saga-coordinator.mts +12 -552
  139. package/src/sync/sync-saga-message/sync-saga-message-types.mts +2 -3
  140. package/src/sync/sync-types.mts +2 -22
  141. package/src/sync/unused-identity-backup.mts.md +311 -0
  142. package/src/test/mock-space.mts +1 -1
  143. package/src/test-helpers.mts +1 -26
  144. package/test_output.log +0 -0
  145. package/test_output_utf8.txt +398 -0
  146. package/.vscode/core-gib-snippets.code-snippets +0 -293
  147. package/.vscode/launch.json +0 -40
  148. package/.vscode/settings.json +0 -58
  149. package/.vscode/tasks.json +0 -37
  150. package/dist/sync/sync-peer/sync-peer-http.respec.d.mts +0 -2
  151. package/dist/sync/sync-peer/sync-peer-http.respec.d.mts.map +0 -1
  152. package/dist/sync/sync-peer/sync-peer-http.respec.mjs +0 -340
  153. package/dist/sync/sync-peer/sync-peer-http.respec.mjs.map +0 -1
  154. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-helper.d.mts +0 -42
  155. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-helper.d.mts.map +0 -1
  156. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-helper.mjs +0 -312
  157. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-helper.mjs.map +0 -1
  158. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-types.d.mts +0 -84
  159. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-types.d.mts.map +0 -1
  160. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-types.mjs +0 -65
  161. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-types.mjs.map +0 -1
  162. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-v1.d.mts +0 -73
  163. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-v1.d.mts.map +0 -1
  164. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-v1.mjs +0 -667
  165. package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-v1.mjs.map +0 -1
  166. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_createAndInit.node-filesystem-space-v1.respec.d.mts +0 -2
  167. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_createAndInit.node-filesystem-space-v1.respec.d.mts.map +0 -1
  168. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_createAndInit.node-filesystem-space-v1.respec.mjs +0 -67
  169. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_createAndInit.node-filesystem-space-v1.respec.mjs.map +0 -1
  170. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_persistTransformResult.node-filesystem-space-v1.respec.d.mts +0 -2
  171. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_persistTransformResult.node-filesystem-space-v1.respec.d.mts.map +0 -1
  172. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_persistTransformResult.node-filesystem-space-v1.respec.mjs +0 -67
  173. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_persistTransformResult.node-filesystem-space-v1.respec.mjs.map +0 -1
  174. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_putGetDelete.node-filesystem-space-v1.respec.d.mts +0 -2
  175. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_putGetDelete.node-filesystem-space-v1.respec.d.mts.map +0 -1
  176. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_putGetDelete.node-filesystem-space-v1.respec.mjs +0 -68
  177. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_putGetDelete.node-filesystem-space-v1.respec.mjs.map +0 -1
  178. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_registerNewIbGib_GetLatest.node-filesystem-space-v1.respec.d.mts +0 -2
  179. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_registerNewIbGib_GetLatest.node-filesystem-space-v1.respec.d.mts.map +0 -1
  180. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_registerNewIbGib_GetLatest.node-filesystem-space-v1.respec.mjs +0 -69
  181. package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_registerNewIbGib_GetLatest.node-filesystem-space-v1.respec.mjs.map +0 -1
  182. package/src/sync/sync-peer/sync-peer-http.respec.mts +0 -396
  183. package/src/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-helper.mts +0 -298
  184. package/src/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-types.mts +0 -150
  185. package/src/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-v1.mts +0 -666
  186. package/src/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_createAndInit.node-filesystem-space-v1.respec.mts +0 -87
  187. package/src/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_persistTransformResult.node-filesystem-space-v1.respec.mts +0 -88
  188. package/src/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_putGetDelete.node-filesystem-space-v1.respec.mts +0 -88
  189. package/src/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_registerNewIbGib_GetLatest.node-filesystem-space-v1.respec.mts +0 -90
@@ -2,7 +2,7 @@ import {
2
2
  respecfully, iReckon, ifWe, firstOfAll, firstOfEach, lastOfAll, lastOfEach, respecfullyDear, ifWeMight
3
3
  } from '@ibgib/helper-gib/dist/respec-gib/respec-gib.mjs';
4
4
  const maam = `[${import.meta.url}]`, sir = maam;
5
- import { clone, hash } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
5
+ import { clone, hash, getUUID } from '@ibgib/helper-gib/dist/helpers/utils-helper.mjs';
6
6
  import { IbGib_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs';
7
7
  import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
8
8
 
@@ -17,79 +17,6 @@ import { addToBindingMap } from './keystone-helpers.mjs';
17
17
  const logalot = GLOBAL_LOG_A_LOT;
18
18
 
19
19
 
20
- // /**
21
- // * not sure where to put this, but we probably will want to reuse this in the
22
- // * future (assuming it works)
23
- // * @returns metaspace service reference
24
- // */
25
- // async function getNewInitializedInMemoryMetaspaceForTesting({
26
- // defaultSpaceName,
27
- // }: {
28
- // defaultSpaceName: string,
29
- // }): Promise<MetaspaceService> {
30
- // const lc = `[${getNewInitializedInMemoryMetaspaceForTesting.name}]`;
31
- // try {
32
- // if (logalot) { console.log(`${lc} starting... (I: 766d7596addcb73f4820586469233b25)`); }
33
-
34
- // let metaspace = new Metaspace_Innerspace(/*cacheSvc*/undefined);
35
- // if (logalot) { console.log(`${lc} creating metaspace complete. initializing... (I: 61b74d62e8832c9fa853e4b8c4c2d825)`); }
36
- // getGibInfo()
37
-
38
- // await metaspace.initialize({
39
- // spaceName: defaultSpaceName,
40
- // /**
41
- // * passing in undefined will use the defaults. probably will need to
42
- // * adjust this for testing purposes, but let's see what happens with
43
- // * this first.
44
- // */
45
- // metaspaceFactory: {
46
- // fnDtoToSpace: async () => {
47
- // if (!currentSpace) { currentSpace = new IbGibTestSpace(); }
48
- // return currentSpace;
49
- // },
50
- // fnZeroSpaceFactory: () => {
51
- // if (!currentZeroSpace) { currentZeroSpace = new IbGibTestSpace(); }
52
- // return currentZeroSpace;
53
- // },
54
- // fnDefaultLocalSpaceFactory: async () => {
55
- // if (!currentSpace) { currentSpace = new IbGibTestSpace(); }
56
- // return currentSpace;
57
- // },
58
-
59
- // // export type DtoToSpaceFunction = (spaceDto: IbGib_V1) => Promise<IbGibSpaceAny>;
60
- // // export type ZeroSpaceFactoryFunction = () => IbGibSpaceAny;
61
- // // export type LocalSpaceFactoryFunction = (opts: CreateLocalSpaceOptions) => Promise<IbGibSpaceAny | undefined>;
62
- // },
63
- // getFnAlert: () => { return async ({ title, msg }) => console.log(title, msg) },
64
- // getFnPrompt: () => {
65
- // return async ({ title, msg }) => {
66
- // // if this is needed, we might set up some way for testing
67
- // // to prepare either a queue of prompts or some kind of map or getter
68
- // // and put it on the metaspace itself
69
- // throw new Error(`not implemented (E: c7ef688a02f8cb74487260f9274ac825)`);
70
- // // promptForText({ title, msg, confirm: false });
71
- // }
72
- // },
73
- // getFnPromptPassword: () => {
74
- // return async () => {
75
- // // similar to getFnPrompt, if we need a _different_
76
- // // password, we might set up some way for testing to prepare
77
- // // either a queue of passwords or some kind of map or getter
78
- // // and put it on the metaspace itself
79
- // return 'password';
80
- // // promptForSecret({ confirm: true })
81
- // }
82
- // },
83
- // });
84
- // return metaspace;
85
- // } catch (error) {
86
- // console.error(`${lc} ${extractErrorMsg(error)}`);
87
- // throw error;
88
- // } finally {
89
- // if (logalot) { console.log(`${lc} complete.`); }
90
- // }
91
- // }
92
-
93
20
  /**
94
21
  * A simple in-memory map acting as a Space.
95
22
  * Pure Storage. No Indexing logic.
@@ -115,8 +42,8 @@ class MockIbGibSpace {
115
42
  const addrs = arg.data.ibGibAddrs || [];
116
43
  const ibGibs: IbGib_V1[] = [];
117
44
  for (const addr of addrs) {
118
- const ig = await this.get({ addr });
119
- if (ig) ibGibs.push(ig);
45
+ const x = await this.get({ addr });
46
+ if (x) { ibGibs.push(x); }
120
47
  }
121
48
  return { ibGibs };
122
49
  }
@@ -190,13 +117,14 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
190
117
 
191
118
  // Setup generic variables
192
119
  const masterSecret = "TestSecret_12345";
193
- const salt = "TestPool";
120
+ const poolId = "TestPool";
194
121
  let config: KeystonePoolConfig_HashV1;
195
122
 
196
123
  firstOfAll(sir, async () => {
197
124
  // Use our standard builder to get a valid config object
125
+ const salt = (await getUUID()).substring(0, 16);
198
126
  config = createStandardPoolConfig({
199
- id: salt,
127
+ id: poolId,
200
128
  salt,
201
129
  }) as KeystonePoolConfig_HashV1;
202
130
  });
@@ -243,7 +171,7 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
243
171
  const challengeId = "a3ff7843552870fc28bef2b"; // arbitrary random challengeId
244
172
 
245
173
  // 1. Generate Solution
246
- const solution = await strategy.generateSolution({ poolSecret, poolId: salt, challengeId });
174
+ const solution = await strategy.generateSolution({ poolSecret, poolId: config.id, challengeId });
247
175
  iReckon(sir, solution.value).asTo('solution value exists').isGonnaBeTruthy();
248
176
  iReckon(sir, solution.challengeId).asTo('id matches').willEqual(challengeId);
249
177
 
@@ -262,7 +190,7 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
262
190
  const challengeId = "8c994f3ed598f150e25513"; // arbitrary random challengeId
263
191
 
264
192
  // Generate real pair
265
- const solution = await strategy.generateSolution({ poolSecret, poolId: salt, challengeId });
193
+ const solution = await strategy.generateSolution({ poolSecret, poolId: config.id, challengeId });
266
194
  const challenge = await strategy.generateChallenge({ solution });
267
195
 
268
196
  // Tamper with solution value
@@ -278,11 +206,11 @@ await respecfully(sir, 'Suite A: Strategy Vectors (HashRevealV1)', async () => {
278
206
 
279
207
  // Generate pair A
280
208
  const challengeId_A = "416c38cfd6ee63dbf8d4e5ef36"; // arbitrary random challengeId
281
- const solutionA = await strategy.generateSolution({ poolSecret, poolId: salt, challengeId: challengeId_A });
209
+ const solutionA = await strategy.generateSolution({ poolSecret, poolId: config.id, challengeId: challengeId_A });
282
210
 
283
211
  // Generate pair B
284
212
  const challengeId_B = "c487ef6b7878fae798c3"; // arbitrary random challengeId
285
- const solutionB = await strategy.generateSolution({ poolSecret, poolId: salt, challengeId: challengeId_B });
213
+ const solutionB = await strategy.generateSolution({ poolSecret, poolId: config.id, challengeId: challengeId_B });
286
214
  const challengeB = await strategy.generateChallenge({ solution: solutionB });
287
215
 
288
216
  // Check A against B
@@ -314,9 +242,10 @@ await respecfully(sir, 'Suite B: Service Lifecycle', async () => {
314
242
 
315
243
  await respecfully(sir, 'Genesis', async () => {
316
244
  await ifWe(sir, 'creates a valid genesis frame and persists it', async () => {
245
+ const salt = (await getUUID()).substring(0, 16);
317
246
  const config = createStandardPoolConfig({
318
247
  id: POOL_ID_DEFAULT,
319
- salt: POOL_ID_DEFAULT,
248
+ salt,
320
249
  });
321
250
 
322
251
  genesisKeystone = await service.genesis({
@@ -406,9 +335,10 @@ await respecfully(sir, 'Suite C: Security Vectors', async () => {
406
335
  mockMetaspace = new MockMetaspaceService(mockSpace);
407
336
 
408
337
  // Setup Alice's Identity
338
+ const salt = (await getUUID()).substring(0, 16);
409
339
  const config = createStandardPoolConfig({
410
340
  id: POOL_ID_DEFAULT,
411
- salt: POOL_ID_DEFAULT,
341
+ salt,
412
342
  targetBinding: 0,
413
343
  size: 10,
414
344
  });
@@ -509,13 +439,15 @@ await respecfully(sir, 'Suite D: Revocation', async () => {
509
439
  mockMetaspace = new MockMetaspaceService(mockSpace);
510
440
 
511
441
  // Setup Identity WITH a Revocation Pool
442
+ const stdSalt = (await getUUID()).substring(0, 16);
443
+ const revokeSalt = (await getUUID()).substring(0, 16);
512
444
  const stdConfig = createStandardPoolConfig({
513
445
  id: POOL_ID_DEFAULT,
514
- salt: POOL_ID_DEFAULT,
446
+ salt: stdSalt,
515
447
  });
516
448
  const revokeConfig = createRevocationPoolConfig({
517
449
  id: POOL_ID_REVOKE,
518
- salt: POOL_ID_REVOKE,
450
+ salt: revokeSalt,
519
451
  }); // Special Config
520
452
 
521
453
  genesisKeystone = await service.genesis({
@@ -588,7 +520,8 @@ await respecfully(sir, 'Suite E: Structural Evolution (addPools)', async () => {
588
520
 
589
521
  // Helper to generate a "Foreign" pool (e.g. from Bob)
590
522
  const createForeignPool = async (id: string, verbs: string[] = []): Promise<KeystoneChallengePool> => {
591
- const config = createStandardPoolConfig({ id, salt: id });
523
+ const salt = (await getUUID()).substring(0, 16);
524
+ const config = createStandardPoolConfig({ id, salt });
592
525
  config.allowedVerbs = verbs;
593
526
 
594
527
  // We use the factory manually here to simulate Bob doing this offline
@@ -625,7 +558,8 @@ await respecfully(sir, 'Suite E: Structural Evolution (addPools)', async () => {
625
558
  mockMetaspace = new MockMetaspaceService(mockSpace);
626
559
 
627
560
  // Alice Genesis: Standard pool (allows all verbs, including 'manage')
628
- const config = createStandardPoolConfig({ id: POOL_ID_DEFAULT, salt: POOL_ID_DEFAULT });
561
+ const salt = (await getUUID()).substring(0, 16);
562
+ const config = createStandardPoolConfig({ id: POOL_ID_DEFAULT, salt });
629
563
  aliceKeystone = await service.genesis({
630
564
  masterSecret: aliceSecret,
631
565
  configs: [config],
@@ -746,7 +680,8 @@ await respecfully(sir, 'Suite E: Structural Evolution (addPools)', async () => {
746
680
 
747
681
  // Helper to simulate Bob creating a pool "offline" to give to Alice
748
682
  const createForeignPool = async (id: string, verbs: string[] = []): Promise<KeystoneChallengePool> => {
749
- const config = createStandardPoolConfig({ id, salt: id });
683
+ const salt = (await getUUID()).substring(0, 16);
684
+ const config = createStandardPoolConfig({ id, salt });
750
685
  config.allowedVerbs = verbs;
751
686
 
752
687
  // We use the factory manually here to simulate Bob doing this on his own machine
@@ -783,9 +718,10 @@ await respecfully(sir, 'Suite E: Structural Evolution (addPools)', async () => {
783
718
  mockMetaspace = new MockMetaspaceService(mockSpace);
784
719
 
785
720
  // Alice Genesis: Standard pool (allows all verbs, including 'manage')
721
+ const salt = (await getUUID()).substring(0, 16);
786
722
  const config = createStandardPoolConfig({
787
723
  id: POOL_ID_DEFAULT,
788
- salt: POOL_ID_DEFAULT,
724
+ salt,
789
725
  });
790
726
  aliceKeystone = await service.genesis({
791
727
  masterSecret: aliceSecret,
@@ -899,27 +835,27 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
899
835
 
900
836
  const service = new KeystoneService_V1();
901
837
  const aliceSecret = "Alice_Deep_Inspect";
902
- const salt = "granularity_pool";
838
+ const poolId = "granularity_pool";
903
839
 
904
840
  let mockSpace: MockIbGibSpace;
905
841
  let mockMetaspace: any;
906
842
  let genesisKeystone: KeystoneIbGib_V1;
907
-
908
843
  let signedKeystone: KeystoneIbGib_V1;
909
-
910
- // We use a specific hybrid config to test exact selection logic
911
- const hybridConfig = createStandardPoolConfig({
912
- id: salt,
913
- salt,
914
- // 2 FIFO + 2 Random = 4 Total per sign
915
- sequential: 2, random: 2, targetBinding: 0,
916
- size: 20, // Small enough to track, large enough to be random
917
- }) as KeystonePoolConfig_HashV1;
844
+ let hybridConfig: KeystonePoolConfig_HashV1;
918
845
 
919
846
  firstOfAll(sir, async () => {
920
847
  mockSpace = new MockIbGibSpace();
921
848
  mockMetaspace = new MockMetaspaceService(mockSpace);
922
849
 
850
+ const salt = (await getUUID()).substring(0, 16);
851
+ hybridConfig = createStandardPoolConfig({
852
+ id: poolId,
853
+ salt,
854
+ // 2 FIFO + 2 Random = 4 Total per sign
855
+ sequential: 2, random: 2, targetBinding: 0,
856
+ size: 20, // Small enough to track, large enough to be random
857
+ }) as KeystonePoolConfig_HashV1;
858
+
923
859
  genesisKeystone = await service.genesis({
924
860
  masterSecret: aliceSecret,
925
861
  configs: [hybridConfig],
@@ -949,7 +885,7 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
949
885
 
950
886
  await ifWe(sir, 'verifies the math manually (White-box Crypto Check)', async () => {
951
887
  const proof = signedKeystone.data!.proofs[0];
952
- const poolSnapshot = genesisKeystone.data!.challengePools.find(p => p.id === salt)!;
888
+ const poolSnapshot = genesisKeystone.data!.challengePools.find(p => p.id === poolId)!;
953
889
 
954
890
  // We iterate every solution in the proof and MANUALLY verify the hash relationship
955
891
  // bypassing the Service's validation logic to ensure the raw math holds up.
@@ -978,7 +914,7 @@ await respecfully(sir, 'Suite F: Deep Inspection', async () => {
978
914
 
979
915
  await ifWe(sir, 'verifies FIFO logic (Deterministic Selection)', async () => {
980
916
  const proof = signedKeystone.data!.proofs[0];
981
- const poolSnapshot = genesisKeystone.data!.challengePools.find(p => p.id === salt)!;
917
+ const poolSnapshot = genesisKeystone.data!.challengePools.find(p => p.id === poolId)!;
982
918
 
983
919
  // The first N keys in the pool should be the FIFO targets.
984
920
  // Assumption: Object.keys returns insertion order (Standard in modern JS engines)
@@ -349,6 +349,12 @@ export interface KeystoneData_V1 extends IbGibData_V1 {
349
349
  * to the next frame's data during evolution.
350
350
  */
351
351
  frameDetails?: any;
352
+
353
+ /**
354
+ * Aggregated state of the Keystone identity up to this frame.
355
+ * Acts as a snapshot to avoid walking the entire timeline.
356
+ */
357
+ checkpointDetails?: any;
352
358
  }
353
359
 
354
360
  export interface KeystoneRel8ns_V1 extends IbGibRel8ns_V1 {
@@ -174,3 +174,21 @@ See [graft-info-helpers.mts](file:./graft-info/graft-info-helpers.mts) for imple
174
174
 
175
175
  ## Verification
176
176
  We rely on rigorous In-Memory Simulation (`InnerSpace`) to verify complex graph scenarios. See **[Verification](./docs/verification.md)** for the full status.
177
+
178
+ ---
179
+
180
+ ## ❓ Open Questions
181
+
182
+ ### Payload Scope Validation: Can the Protocol Police What ibGibs Are Transmitted?
183
+
184
+ **Question**: During a sync session authorized by session substone S (itself authorized by domain keystone I with `claim.target = S^Stjp` and sync subject `X^X10.Xtjp`), should the server validate that all Delta payload ibgibs are genuinely related to X's timeline? Or is it sufficient that they arrive under a valid substone?
185
+
186
+ **Context**: The substone's `frameDetails` records both the parent identity `I^Itjp` and the sync subject `X^X10.Xtjp`. In theory the server could walk the dependency graph of each incoming Delta payload and confirm every ibgib is either:
187
+ - A control ibgib (sync saga, context, substone frames), or
188
+ - Part of the dependency graph rooted at some frame of X's timeline (`X^Xtjp`)
189
+
190
+ **Problem**: This check may not be enforceable at the protocol layer. A client who controls the keystone (has the master secret) could always evolve X's timeline to hard-link any arbitrary ibgib, and that ibgib would then pass the "is in X's dependency graph" check. So the constraint can be trivially bypassed by the legitimate key-holder, making it only useful against *illegitimate* actors — who are already blocked by the keystone proof requirement.
191
+
192
+ **Current position**: This is likely a **higher-layer business rule** rather than a sync protocol concern. The sync protocol's job is to ensure the session is cryptographically authorized (via keystone proofs). What is stored under an authorized session is the domain owner's responsibility. Enforcement of content policies (e.g., "only ibgibs of type X are allowed") belongs in the server's `authorizeContext` hook, not in the core sync coordinator.
193
+
194
+ **Tracked in**: `space-gib.sync-walkthrough.md`
@@ -67,3 +67,24 @@ The protocol supports two types of data:
67
67
  ## 4. Security & Identity
68
68
  * **Session Keystone**: Each Saga can optionally generate an ephemeral identity to sign frames, linked to a master identity. ⚠️ **Currently non-functional** - see [README Session Identity section](file:../README.md#session-identity-usesessionidentity) for status.
69
69
  * **Trust Chain**: Each frame points to the previous one (`past` rel8n), creating a hash-linked chain of custody.
70
+
71
+ > [!WARNING]
72
+ > ## 5. Sync Storage & Persistence Rules (Critical Security)
73
+ >
74
+ > Knowing **when** to put **what** ibgib frames into **which** space is a high-priority security concern. The sync algorithm must balance maintaining a robust audit trail with protecting durable spaces from unauthorized pollution. Always follow these rules:
75
+ >
76
+ > ### Rule 1: Saga/Control Audit Trail (Immediate Persistence)
77
+ > We need an audit trail of the sync saga itself (including context and identity info).
78
+ > * The initial session keystone (or any valid evolution performed locally) and saga control ibgibs are trusted because *we* just generated them.
79
+ > * Persist these immediately in the **local durable space** (and possibly the local temporary space if needed for transit) so they are available for validation and auditing.
80
+ >
81
+ > ### Rule 2: Domain IbGibs (Deferred Persistence)
82
+ > We do NOT persist *any* domain ibgibs (e.g., user payloads) into the durable space before the `commit` phase of the sync process.
83
+ > * Domain ibgibs must be routed to the **tempSpace** during the `delta` or `ack` phases.
84
+ > * The `commit` phase acts as the transaction boundary. By waiting for the commit, we avoid polluting durable spaces on error, preventing the need for complex rollbacks.
85
+ >
86
+ > ### Rule 3: Validate First, Store Second
87
+ > We never chance storing intrinsically invalid ibgibs.
88
+ > * **First step:** Intrinsically validate ibgibs (hashes, basic structure).
89
+ > * **Second step:** Perform AuthN/AuthZ checks (using the ephemeral session keystone).
90
+ > * **Final step:** Once verified, saga "control" ibgibs (which only contain "soft" links to domain ibgibs) can be safely persisted to durable spaces.
@@ -8,7 +8,7 @@ await respecfully(sir, 'Graft Info Helpers', async () => {
8
8
 
9
9
  await respecfully(sir, 'mergeTextLCS', async () => {
10
10
 
11
- await ifWe(sir, 'mergeTextLCS should interleave unique lines (A then B)', async () => {
11
+ await ifWeMight(sir, 'mergeTextLCS should interleave unique lines (A then B)', async () => {
12
12
  const textA = "Line 1\nLine A\nLine 3";
13
13
  const textB = "Line 1\nLine B\nLine 3";
14
14
  const res = await mergeTextByLongestCommonSubsequence({ textA, textB });
@@ -16,7 +16,7 @@ await respecfully(sir, 'Graft Info Helpers', async () => {
16
16
  iReckon(sir, res).asTo('result').isGonnaBe(expected);
17
17
  });
18
18
 
19
- await ifWe(sir, 'mergeTextLCS should handle insertions', async () => {
19
+ await ifWeMight(sir, 'mergeTextLCS should handle insertions', async () => {
20
20
  const textA = "Line 1\nLine 3";
21
21
  const textB = "Line 1\nLine 2\nLine 3";
22
22
  const res = await mergeTextByLongestCommonSubsequence({ textA, textB });
@@ -24,7 +24,7 @@ await respecfully(sir, 'Graft Info Helpers', async () => {
24
24
  iReckon(sir, res).asTo('result').isGonnaBe(expected);
25
25
  });
26
26
 
27
- await ifWe(sir, 'mergeTextLCS should handle appends', async () => {
27
+ await ifWeMight(sir, 'mergeTextLCS should handle appends', async () => {
28
28
  const textA = "Line 1";
29
29
  const textB = "Line 1\nLine 2";
30
30
  const res = await mergeTextByLongestCommonSubsequence({ textA, textB });
@@ -32,7 +32,7 @@ await respecfully(sir, 'Graft Info Helpers', async () => {
32
32
  iReckon(sir, res).asTo('result').isGonnaBe(expected);
33
33
  });
34
34
 
35
- await ifWe(sir, 'mergeTextLCS should handle simultaneous list additions', async () => {
35
+ await ifWeMight(sir, 'mergeTextLCS should handle simultaneous list additions', async () => {
36
36
  const textA = "- Item 1\n- Item 2\n- Item A";
37
37
  const textB = "- Item 1\n- Item 2\n- Item B";
38
38
  const res = await mergeTextByLongestCommonSubsequence({ textA, textB });
@@ -42,7 +42,7 @@ await respecfully(sir, 'Graft Info Helpers', async () => {
42
42
  iReckon(sir, res).asTo('result').isGonnaBe(expected);
43
43
  });
44
44
 
45
- await ifWe(sir, 'mergeTextLCS should handle distinct modifications in code block', async () => {
45
+ await ifWeMight(sir, 'mergeTextLCS should handle distinct modifications in code block', async () => {
46
46
  const textA = `function foo() {
47
47
  console.log("start");
48
48
  doA();
@@ -64,7 +64,7 @@ await respecfully(sir, 'Graft Info Helpers', async () => {
64
64
  iReckon(sir, res).asTo('result').isGonnaBe(expected);
65
65
  });
66
66
 
67
- await ifWe(sir, 'mergeTextLCS should return same string if identical', async () => {
67
+ await ifWeMight(sir, 'mergeTextLCS should return same string if identical', async () => {
68
68
  const textA = "Hello";
69
69
  const res = await mergeTextByLongestCommonSubsequence({ textA, textB: textA });
70
70
  iReckon(sir, res).asTo('result').isGonnaBe(textA);
@@ -75,7 +75,7 @@ await respecfully(sir, 'Graft Info Helpers', async () => {
75
75
  await respecfully(sir, 'graftTimelines', async () => {
76
76
  // We need a more complex setup to test this properly (mock space, etc.)
77
77
  // For now, this placeholder ensures the test file runs.
78
- await ifWe(sir, 'graftTimelines placeholders', async () => {
78
+ await ifWeMight(sir, 'graftTimelines placeholders', async () => {
79
79
  iReckon(sir, true).isGonnaBeTrue();
80
80
  });
81
81
  });
@@ -15,7 +15,7 @@ import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
15
15
  import { IbGibData_V1, IbGib_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs';
16
16
 
17
17
  import { GLOBAL_LOG_A_LOT } from '../core-constants.mjs';
18
- import { TestTransformer, getTestKeystoneServiceHelper } from '../test-helpers.mjs';
18
+ import { TestTransformer, } from '../test-helpers.mjs';
19
19
  import { TestMut8Info, } from '../test-types.mjs';
20
20
  import { SyncSagaCoordinator } from './sync-saga-coordinator.mjs';
21
21
  import { getFromSpace } from '../witness/space/space-helper.mjs';
@@ -78,14 +78,14 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
78
78
  const testTransformer = new TestTransformer(metaspace, sourceSpace, destSpace);
79
79
 
80
80
  if (logalot) { console.log(`${lc} Setting up Coordinators...`); }
81
- const mockKeystone = await getTestKeystoneServiceHelper();
82
- const senderCoordinator = new SyncSagaCoordinator(mockKeystone);
83
- const receiverCoordinator = new SyncSagaCoordinator(mockKeystone);
81
+ const senderCoordinator = new SyncSagaCoordinator();
82
+ const receiverCoordinator = new SyncSagaCoordinator();
84
83
 
85
84
  async function newTestPeer(): Promise<SyncPeerInnerspace_V1> {
86
85
  const peer = new SyncPeerInnerspace_V1(clone(SYNC_PEER_INNERSPACE_DEFAULT_DATA_V1));
87
86
  await peer.initialized;
88
87
  await peer.initializeOpts({
88
+ localMetaspace: metaspace,
89
89
  localSpace: sourceSpace,
90
90
  receiverSpace: destSpace,
91
91
  receiverCoordinator: receiverCoordinator,
@@ -127,7 +127,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
127
127
  // #endregion r1 setup
128
128
 
129
129
  await respecfully(sir, `r1 verify pre`, async () => {
130
- await ifWe(sir, 'dest should NOT have alpha', async () => {
130
+ await ifWeMight(sir, 'dest should NOT have alpha', async () => {
131
131
  const resGet = await getFromSpace({
132
132
  space: destSpace,
133
133
  addr: alpha_tjpAddr,
@@ -144,14 +144,13 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
144
144
  metaspace,
145
145
  domainIbGibs: [r1_alpha_v1_source_common.ibGib],
146
146
  conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
147
- useSessionIdentity: false,
148
147
  });
149
148
 
150
149
  await r1_syncSaga.done;
151
150
  if (logalot) { console.log(`${lc} r1_syncSaga Complete.`); }
152
151
 
153
152
  await respecfully(sir, `r1 verify post`, async () => {
154
- await ifWe(sir, 'dest should have alpha', async () => {
153
+ await ifWeMight(sir, 'dest should have alpha', async () => {
155
154
  // alpha's full dep graph should exist on dest
156
155
  const [alpha_dest] = await getIbGibsFromCache_fallbackToSpaces({
157
156
  addrs: [r1_alpha_v0_source.addr],
@@ -231,7 +230,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
231
230
  // Verify Receiver has correct KV (Pre-Sync Check)
232
231
  // This ensures the conflict precondition exists.
233
232
  await respecfully(sir, `r2 verify pre`, async () => {
234
- await ifWe(sir, 'dest has alpha v1 common', async () => {
233
+ await ifWeMight(sir, 'dest has alpha v1 common', async () => {
235
234
  try {
236
235
  const destKV = await receiverCoordinator.getKnowledgeMap({
237
236
  space: destSpace,
@@ -265,7 +264,6 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
265
264
  metaspace,
266
265
  domainIbGibs: [r2_alpha_v3_source_rel8dBeta.ibGib],
267
266
  conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
268
- useSessionIdentity: false,
269
267
  });
270
268
 
271
269
  if (logalot) { console.log(`${lc} awaiting r2_syncSaga.done`) }
@@ -310,7 +308,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
310
308
  if (!alpha_dest_tipAddr) {
311
309
  throw new Error(`dest Space missing timeline tip for ${alpha_tjpAddr} (E: 30b018c6349917aa28c9f538fa567826)`);
312
310
  }
313
- await ifWe(sir, 'tip addrs', async () => {
311
+ await ifWeMight(sir, 'tip addrs', async () => {
314
312
  iReckon(sir, alpha_source_tipAddr).asTo('source/dest have same tip addrs').isGonnaBe(alpha_dest_tipAddr);
315
313
  })
316
314
 
@@ -336,7 +334,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
336
334
  // #endregion DEBUG SANITY CHECK
337
335
 
338
336
 
339
- await ifWe(sir, 'r2 basics of alpha merge', async () => {
337
+ await ifWeMight(sir, 'r2 basics of alpha merge', async () => {
340
338
  iReckon(sir, alpha_source_tipAddr)
341
339
  .asTo(`Source Tip (${alpha_source_tipAddr}) should NOT be r2_alpha_v3_source_rel8dBeta`)
342
340
  .not.isGonnaBe(r2_alpha_v3_source_rel8dBeta.addr);
@@ -359,7 +357,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
359
357
  iReckon(sir, gotten_alpha_source_tipIbGib.data![r2_dest_mut8Info.key!]).asTo(`New Tip has dest field ${r2_dest_mut8Info.key!}`).isGonnaBe(r2_dest_mut8Info.value!);
360
358
  });
361
359
 
362
- await ifWe(sir, 'r2 alpha and deps synced', async () => {
360
+ await ifWeMight(sir, 'r2 alpha and deps synced', async () => {
363
361
  // alpha's full dep graph should exist on dest, even though its
364
362
  // timeline was grafted
365
363
  const [alpha_dest] = await getIbGibsFromCache_fallbackToSpaces({
@@ -392,7 +390,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
392
390
  }
393
391
  });
394
392
 
395
- await ifWe(sir, 'r2 beta and deps synced', async () => {
393
+ await ifWeMight(sir, 'r2 beta and deps synced', async () => {
396
394
  // beta's full dep graph should exist on dest
397
395
  const [beta_dest] = await getIbGibsFromCache_fallbackToSpaces({
398
396
  addrs: [r2_beta_v0_source.addr],
@@ -512,7 +510,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
512
510
  // #endregion r3 dest edits
513
511
 
514
512
  await respecfully(sir, `r3 verify pre`, async () => {
515
- await ifWe(sir, 'dest has both alpha and beta tips (pre-conflict)', async () => {
513
+ await ifWeMight(sir, 'dest has both alpha and beta tips (pre-conflict)', async () => {
516
514
  try {
517
515
  const destKV = await receiverCoordinator.getKnowledgeMap({
518
516
  space: destSpace,
@@ -544,7 +542,6 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
544
542
  metaspace,
545
543
  domainIbGibs: [r3_alpha_v4_source_mut8fieldC.ibGib, r3_beta_v1_source.ibGib],
546
544
  conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
547
- useSessionIdentity: false,
548
545
  });
549
546
 
550
547
  if (logalot) { console.log(`${lc} awaiting r3_syncSaga.done`) }
@@ -588,13 +585,13 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
588
585
  });
589
586
  const r3_beta_dest_tipAddr = beta_destKV_afterR3[beta_tjpAddr];
590
587
  if (!r3_beta_dest_tipAddr) {
591
- await ifWe(sir, 'r3_beta_dest_tipAddr is falsy?', async () => {
588
+ await ifWeMight(sir, 'r3_beta_dest_tipAddr is falsy?', async () => {
592
589
  iReckon(sir, true).asTo('fail').isGonnaBeFalse();
593
590
  });
594
591
  return; /* <<<< returns early */
595
592
  }
596
593
 
597
- await ifWe(sir, 'r3 tip addrs match (both timelines)', async () => {
594
+ await ifWeMight(sir, 'r3 tip addrs match (both timelines)', async () => {
598
595
  iReckon(sir, r3_alpha_source_tipAddr).asTo('alpha source/dest have same tip addrs').isGonnaBe(r3_alpha_dest_tipAddr);
599
596
  iReckon(sir, r3_beta_source_tipAddr).asTo('beta source/dest have same tip addrs').isGonnaBe(r3_beta_dest_tipAddr);
600
597
  });
@@ -613,7 +610,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
613
610
  const resGet_r3_beta_tip = await getFromSpace({ space: sourceSpace, addr: r3_beta_source_tipAddr });
614
611
  const r3_beta_tipIbGib = resGet_r3_beta_tip.ibGibs![0] as IbGib_V1<TestData>;
615
612
 
616
- await ifWe(sir, 'r3 alpha merge has all four fields (commonField, fieldA, fieldB, fieldC, fieldD)', async () => {
613
+ await ifWeMight(sir, 'r3 alpha merge has all four fields (commonField, fieldA, fieldB, fieldC, fieldD)', async () => {
617
614
  // Should have new graft point with different addr than before
618
615
  iReckon(sir, r3_alpha_source_tipAddr)
619
616
  .asTo(`Alpha R3 tip should NOT be r3_alpha_v4_source_mut8fieldC`)
@@ -634,7 +631,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
634
631
  .isGonnaBe(r3_alpha_v4_dest_mut8Info.value!);
635
632
  });
636
633
 
637
- await ifWe(sir, 'r3 beta merge has both fields (betaFieldA, betaFieldB)', async () => {
634
+ await ifWeMight(sir, 'r3 beta merge has both fields (betaFieldA, betaFieldB)', async () => {
638
635
  // Should have new graft point with different addr than before
639
636
  iReckon(sir, r3_beta_source_tipAddr)
640
637
  .asTo(`Beta R3 tip should NOT be r3_beta_v1_source`)
@@ -655,7 +652,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
655
652
  .isGonnaBe(r3_dest_beta_mut8Info.value!);
656
653
  });
657
654
 
658
- await ifWe(sir, 'r3 alpha and deps synced', async () => {
655
+ await ifWeMight(sir, 'r3 alpha and deps synced', async () => {
659
656
  const [alpha_dest] = await getIbGibsFromCache_fallbackToSpaces({
660
657
  // addrs: [r1_alpha_v0_source.addr],
661
658
  addrs: [r3_alpha_source_tipAddr],
@@ -687,7 +684,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
687
684
  }
688
685
  });
689
686
 
690
- await ifWe(sir, 'r3 beta and deps synced', async () => {
687
+ await ifWeMight(sir, 'r3 beta and deps synced', async () => {
691
688
  const [beta_dest] = await getIbGibsFromCache_fallbackToSpaces({
692
689
  // addrs: [r2_beta_v0_source.addr],
693
690
  addrs: [r3_beta_dest_tipAddr],
@@ -839,7 +836,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
839
836
  // #endregion r4 dest edits
840
837
 
841
838
  await respecfully(sir, `r4 verify pre`, async () => {
842
- await ifWe(sir, 'dest has alpha and beta post-R3 tips', async () => {
839
+ await ifWeMight(sir, 'dest has alpha and beta post-R3 tips', async () => {
843
840
  try {
844
841
  const destKV = await receiverCoordinator.getKnowledgeMap({
845
842
  space: destSpace,
@@ -871,7 +868,6 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
871
868
  metaspace,
872
869
  domainIbGibs: [r4_alpha_v7_source.ibGib, r4_gamma_v0_source.ibGib, r4_beta_v2_source.ibGib],
873
870
  conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
874
- useSessionIdentity: false,
875
871
  });
876
872
 
877
873
  if (logalot) { console.log(`${lc} awaiting r4_syncSaga.done`) }
@@ -917,7 +913,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
917
913
  });
918
914
  const r4_beta_dest_tipAddr = r4_beta_destKV[beta_tjpAddr];
919
915
  if (!r4_beta_dest_tipAddr) {
920
- await ifWe(sir, 'r4_beta_dest_tipAddr is falsy?', async () => {
916
+ await ifWeMight(sir, 'r4_beta_dest_tipAddr is falsy?', async () => {
921
917
  iReckon(sir, true).asTo('fail').isGonnaBeFalse();
922
918
  });
923
919
  return; /* <<<< returns early */
@@ -937,7 +933,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
937
933
  });
938
934
  const r4_gamma_dest_tipAddr = r4_gamma_destKV[gamma_tjpAddr];
939
935
 
940
- await ifWe(sir, 'r4 tip addrs match (alpha, beta, gamma)', async () => {
936
+ await ifWeMight(sir, 'r4 tip addrs match (alpha, beta, gamma)', async () => {
941
937
  iReckon(sir, r4_alpha_source_tipAddr).asTo('alpha source/dest have same tip addrs').isGonnaBe(r4_alpha_dest_tipAddr);
942
938
  iReckon(sir, r4_beta_source_tipAddr).asTo('beta source/dest have same tip addrs').isGonnaBe(r4_beta_dest_tipAddr);
943
939
  iReckon(sir, r4_gamma_source_tipAddr).asTo('gamma source/dest have same tip addrs').isGonnaBe(r4_gamma_dest_tipAddr);
@@ -962,7 +958,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
962
958
  const resGet_r4_gamma_tip = await getFromSpace({ space: sourceSpace, addr: r4_gamma_source_tipAddr });
963
959
  const r4_gamma_tipIbGib = resGet_r4_gamma_tip.ibGibs![0] as IbGib_V1<TestData>;
964
960
 
965
- await ifWe(sir, 'r4 alpha has complete chain of edits and gamma relation', async () => {
961
+ await ifWeMight(sir, 'r4 alpha has complete chain of edits and gamma relation', async () => {
966
962
  // Should have new graft point with different addr than either pre-graft version
967
963
  iReckon(sir, r4_alpha_source_tipAddr)
968
964
  .asTo(`Alpha R4 tip should NOT be r4_alpha_v7_source`)
@@ -998,7 +994,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
998
994
  .isGonnaBeTrue();
999
995
  });
1000
996
 
1001
- await ifWe(sir, 'r4 beta has all edits', async () => {
997
+ await ifWeMight(sir, 'r4 beta has all edits', async () => {
1002
998
  // Beta should have new graft from R4
1003
999
  iReckon(sir, r4_beta_source_tipAddr)
1004
1000
  .asTo(`Beta R4 tip should NOT be r4_beta_v2_source (source version pre-graft)`)
@@ -1019,7 +1015,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
1019
1015
  .isGonnaBe(r4_dest_beta_mut8Info.value!);
1020
1016
  });
1021
1017
 
1022
- await ifWe(sir, 'r4 gamma synced with deps', async () => {
1018
+ await ifWeMight(sir, 'r4 gamma synced with deps', async () => {
1023
1019
  const [gamma_dest] = await getIbGibsFromCache_fallbackToSpaces({
1024
1020
  addrs: [r4_gamma_v0_source.addr],
1025
1021
  space: destSpace,
@@ -1050,7 +1046,7 @@ await respecfully(sir, `Multi-round/timeline permutations`, async () => {
1050
1046
  }
1051
1047
  });
1052
1048
 
1053
- await ifWe(sir, 'r4 all timelines dep graphs synced', async () => {
1049
+ await ifWeMight(sir, 'r4 all timelines dep graphs synced', async () => {
1054
1050
  // Verify alpha dep graphs
1055
1051
  const [alpha_dest] = await getIbGibsFromCache_fallbackToSpaces({
1056
1052
  addrs: [r4_alpha_source_tipAddr],