@ibgib/core-gib 0.1.54 → 0.1.57
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.
- package/CHANGELOG.md +11 -3
- package/README.md +12 -15
- package/dist/keystone/aggregate-details.respec.d.mts +2 -0
- package/dist/keystone/aggregate-details.respec.d.mts.map +1 -0
- package/dist/keystone/aggregate-details.respec.mjs +118 -0
- package/dist/keystone/aggregate-details.respec.mjs.map +1 -0
- package/dist/keystone/keystone-constants.d.mts +5 -0
- package/dist/keystone/keystone-constants.d.mts.map +1 -1
- package/dist/keystone/keystone-constants.mjs +6 -1
- package/dist/keystone/keystone-constants.mjs.map +1 -1
- package/dist/keystone/keystone-helpers.d.mts +7 -1
- package/dist/keystone/keystone-helpers.d.mts.map +1 -1
- package/dist/keystone/keystone-helpers.mjs +5 -2
- package/dist/keystone/keystone-helpers.mjs.map +1 -1
- package/dist/keystone/keystone-service-v1.d.mts +51 -0
- package/dist/keystone/keystone-service-v1.d.mts.map +1 -1
- package/dist/keystone/keystone-service-v1.mjs +176 -9
- package/dist/keystone/keystone-service-v1.mjs.map +1 -1
- package/dist/keystone/keystone-service-v1.respec.mjs +40 -98
- package/dist/keystone/keystone-service-v1.respec.mjs.map +1 -1
- package/dist/keystone/keystone-types.d.mts +5 -0
- package/dist/keystone/keystone-types.d.mts.map +1 -1
- package/dist/sync/graft-info/graft-info-helpers.respec.mjs +8 -8
- package/dist/sync/graft-info/graft-info-helpers.respec.mjs.map +1 -1
- package/dist/sync/sync-conflict-adv-multitimelines.respec.mjs +26 -30
- package/dist/sync/sync-conflict-adv-multitimelines.respec.mjs.map +1 -1
- package/dist/sync/sync-conflict-basic-divergence.respec.mjs +7 -8
- package/dist/sync/sync-conflict-basic-divergence.respec.mjs.map +1 -1
- package/dist/sync/sync-conflict-basic-multitimelines.respec.mjs +10 -11
- package/dist/sync/sync-conflict-basic-multitimelines.respec.mjs.map +1 -1
- package/dist/sync/sync-conflict-text-merge.respec.mjs +30 -33
- package/dist/sync/sync-conflict-text-merge.respec.mjs.map +1 -1
- package/dist/sync/sync-constants.d.mts +1 -56
- package/dist/sync/sync-constants.d.mts.map +1 -1
- package/dist/sync/sync-constants.mjs +2 -59
- package/dist/sync/sync-constants.mjs.map +1 -1
- package/dist/sync/sync-helpers.d.mts +0 -1
- package/dist/sync/sync-helpers.d.mts.map +1 -1
- package/dist/sync/sync-helpers.mjs +1 -6
- package/dist/sync/sync-helpers.mjs.map +1 -1
- package/dist/sync/sync-innerspace-constants.respec.mjs +5 -9
- package/dist/sync/sync-innerspace-constants.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-deep-updates.respec.mjs +6 -7
- package/dist/sync/sync-innerspace-deep-updates.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-dest-ahead-withid.respec.mjs +22 -22
- package/dist/sync/sync-innerspace-dest-ahead-withid.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-dest-ahead.respec.mjs +8 -9
- package/dist/sync/sync-innerspace-dest-ahead.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-multiple-timelines.respec.mjs +6 -7
- package/dist/sync/sync-innerspace-multiple-timelines.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-partial-update.respec.mjs +7 -8
- package/dist/sync/sync-innerspace-partial-update.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace.respec.mjs +8 -11
- package/dist/sync/sync-innerspace.respec.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-http-node-adapter.mjs +10 -5
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-http-node-adapter.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-types.d.mts +3 -1
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-types.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.d.mts +4 -2
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.mjs +37 -6
- package/dist/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-types.d.mts +3 -1
- package/dist/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-types.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-v1.d.mts +4 -2
- package/dist/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-v1.mjs +37 -0
- package/dist/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-v1.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-types.d.mts +7 -1
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-types.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.d.mts +10 -2
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mjs +50 -38
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-types.d.mts +21 -5
- package/dist/sync/sync-peer/sync-peer-types.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-v1.d.mts +30 -5
- package/dist/sync/sync-peer/sync-peer-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-v1.mjs +41 -25
- package/dist/sync/sync-peer/sync-peer-v1.mjs.map +1 -1
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.d.mts +2 -11
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.d.mts.map +1 -1
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.mjs +7 -51
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.mjs.map +1 -1
- package/dist/sync/sync-saga-context/sync-saga-context-types.d.mts +1 -47
- package/dist/sync/sync-saga-context/sync-saga-context-types.d.mts.map +1 -1
- package/dist/sync/sync-saga-coordinator.d.mts +6 -58
- package/dist/sync/sync-saga-coordinator.d.mts.map +1 -1
- package/dist/sync/sync-saga-coordinator.mjs +23 -425
- package/dist/sync/sync-saga-coordinator.mjs.map +1 -1
- package/dist/sync/sync-saga-message/sync-saga-message-types.d.mts +2 -2
- package/dist/sync/sync-saga-message/sync-saga-message-types.d.mts.map +1 -1
- package/dist/sync/sync-types.d.mts +2 -19
- package/dist/sync/sync-types.d.mts.map +1 -1
- package/dist/sync/sync-types.mjs.map +1 -1
- package/dist/test/mock-space.mjs +1 -1
- package/dist/test/mock-space.mjs.map +1 -1
- package/dist/test-helpers.d.mts +0 -6
- package/dist/test-helpers.d.mts.map +1 -1
- package/dist/test-helpers.mjs +2 -25
- package/dist/test-helpers.mjs.map +1 -1
- package/package.json +10 -34
- package/src/keystone/aggregate-details.respec.mts +137 -0
- package/src/keystone/docs/architecture.md +16 -0
- package/src/keystone/keystone-constants.mts +6 -1
- package/src/keystone/keystone-helpers.mts +9 -1
- package/src/keystone/keystone-service-v1.mts +216 -8
- package/src/keystone/keystone-service-v1.respec.mts +39 -103
- package/src/keystone/keystone-types.mts +6 -0
- package/src/sync/README.md +2 -87
- package/src/sync/docs/architecture.md +26 -5
- package/src/sync/docs/security.md +176 -0
- package/src/sync/graft-info/graft-info-helpers.respec.mts +7 -7
- package/src/sync/sync-conflict-adv-multitimelines.respec.mts +25 -29
- package/src/sync/sync-conflict-basic-divergence.respec.mts +6 -7
- package/src/sync/sync-conflict-basic-multitimelines.respec.mts +9 -10
- package/src/sync/sync-conflict-text-merge.respec.mts +29 -32
- package/src/sync/sync-constants.mts +2 -62
- package/src/sync/sync-helpers.mts +1 -8
- package/src/sync/sync-id-testlog.txt +421 -0
- package/src/sync/sync-innerspace-constants.respec.mts +4 -8
- package/src/sync/sync-innerspace-deep-updates.respec.mts +5 -6
- package/src/sync/sync-innerspace-dest-ahead-withid.respec.mts +23 -25
- package/src/sync/sync-innerspace-dest-ahead.respec.mts +7 -8
- package/src/sync/sync-innerspace-multiple-timelines.respec.mts +5 -6
- package/src/sync/sync-innerspace-partial-update.respec.mts +6 -7
- package/src/sync/sync-innerspace.respec.mts +7 -10
- package/src/sync/sync-peer/sync-peer-http-receiver/sync-http-node-adapter.mts +5 -5
- package/src/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-types.mts +5 -1
- package/src/sync/sync-peer/sync-peer-http-receiver/sync-peer-http-receiver-v1.mts +30 -9
- package/src/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-types.mts +3 -1
- package/src/sync/sync-peer/sync-peer-http-sender/sync-peer-http-sender-v1.mts +29 -2
- package/src/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-types.mts +7 -1
- package/src/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mts +51 -38
- package/src/sync/sync-peer/sync-peer-types.mts +23 -6
- package/src/sync/sync-peer/sync-peer-v1.mts +68 -28
- package/src/sync/sync-saga-context/sync-saga-context-helpers.mts +6 -66
- package/src/sync/sync-saga-context/sync-saga-context-types.mts +1 -48
- package/src/sync/sync-saga-coordinator.mts +12 -552
- package/src/sync/sync-saga-message/sync-saga-message-types.mts +2 -3
- package/src/sync/sync-types.mts +2 -22
- package/src/sync/unused-identity-backup.mts.md +311 -0
- package/src/test/mock-space.mts +1 -1
- package/src/test-helpers.mts +1 -26
- package/test_output.log +0 -0
- package/test_output_utf8.txt +398 -0
- package/.vscode/core-gib-snippets.code-snippets +0 -293
- package/.vscode/launch.json +0 -40
- package/.vscode/settings.json +0 -58
- package/.vscode/tasks.json +0 -37
- package/dist/sync/sync-peer/sync-peer-http.respec.d.mts +0 -2
- package/dist/sync/sync-peer/sync-peer-http.respec.d.mts.map +0 -1
- package/dist/sync/sync-peer/sync-peer-http.respec.mjs +0 -340
- package/dist/sync/sync-peer/sync-peer-http.respec.mjs.map +0 -1
- package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-helper.d.mts +0 -42
- package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-helper.d.mts.map +0 -1
- package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-helper.mjs +0 -312
- package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-helper.mjs.map +0 -1
- package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-types.d.mts +0 -84
- package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-types.d.mts.map +0 -1
- package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-types.mjs +0 -65
- package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-types.mjs.map +0 -1
- package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-v1.d.mts +0 -73
- package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-v1.d.mts.map +0 -1
- package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-v1.mjs +0 -667
- package/dist/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-v1.mjs.map +0 -1
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_createAndInit.node-filesystem-space-v1.respec.d.mts +0 -2
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_createAndInit.node-filesystem-space-v1.respec.d.mts.map +0 -1
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_createAndInit.node-filesystem-space-v1.respec.mjs +0 -67
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_createAndInit.node-filesystem-space-v1.respec.mjs.map +0 -1
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_persistTransformResult.node-filesystem-space-v1.respec.d.mts +0 -2
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_persistTransformResult.node-filesystem-space-v1.respec.d.mts.map +0 -1
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_persistTransformResult.node-filesystem-space-v1.respec.mjs +0 -67
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_persistTransformResult.node-filesystem-space-v1.respec.mjs.map +0 -1
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_putGetDelete.node-filesystem-space-v1.respec.d.mts +0 -2
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_putGetDelete.node-filesystem-space-v1.respec.d.mts.map +0 -1
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_putGetDelete.node-filesystem-space-v1.respec.mjs +0 -68
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_putGetDelete.node-filesystem-space-v1.respec.mjs.map +0 -1
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_registerNewIbGib_GetLatest.node-filesystem-space-v1.respec.d.mts +0 -2
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_registerNewIbGib_GetLatest.node-filesystem-space-v1.respec.d.mts.map +0 -1
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_registerNewIbGib_GetLatest.node-filesystem-space-v1.respec.mjs +0 -69
- package/dist/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_registerNewIbGib_GetLatest.node-filesystem-space-v1.respec.mjs.map +0 -1
- package/src/sync/sync-peer/sync-peer-http.respec.mts +0 -396
- package/src/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-helper.mts +0 -298
- package/src/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-types.mts +0 -150
- package/src/witness/space/filesystem-space/node-filesystem-space/node-filesystem-space-v1.mts +0 -666
- package/src/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_createAndInit.node-filesystem-space-v1.respec.mts +0 -87
- package/src/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_persistTransformResult.node-filesystem-space-v1.respec.mts +0 -88
- package/src/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_putGetDelete.node-filesystem-space-v1.respec.mts +0 -88
- package/src/witness/space/filesystem-space/node-filesystem-space/respec/testSpace_registerNewIbGib_GetLatest.node-filesystem-space-v1.respec.mts +0 -90
|
@@ -18,7 +18,7 @@ import { getIbGibAddr } from '@ibgib/ts-gib/dist/helper.mjs';
|
|
|
18
18
|
import { IbGibData_V1, IbGib_V1 } from '@ibgib/ts-gib/dist/V1/types.mjs';
|
|
19
19
|
|
|
20
20
|
import { GLOBAL_LOG_A_LOT } from '../core-constants.mjs';
|
|
21
|
-
import { TestTransformer,
|
|
21
|
+
import { TestTransformer, } from '../test-helpers.mjs';
|
|
22
22
|
import { TestMut8Info, } from '../test-types.mjs';
|
|
23
23
|
import { SyncSagaCoordinator } from './sync-saga-coordinator.mjs';
|
|
24
24
|
import { getFromSpace } from '../witness/space/space-helper.mjs';
|
|
@@ -80,14 +80,14 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
80
80
|
const testTransformer = new TestTransformer(metaspace, sourceSpace, destSpace);
|
|
81
81
|
|
|
82
82
|
if (logalot) { console.log(`${lc} Setting up Coordinators...`); }
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
-
const receiverCoordinator = new SyncSagaCoordinator(mockKeystone);
|
|
83
|
+
const senderCoordinator = new SyncSagaCoordinator();
|
|
84
|
+
const receiverCoordinator = new SyncSagaCoordinator();
|
|
86
85
|
|
|
87
86
|
async function newTestPeer(): Promise<SyncPeerInnerspace_V1> {
|
|
88
87
|
const peer = new SyncPeerInnerspace_V1(clone(SYNC_PEER_INNERSPACE_DEFAULT_DATA_V1));
|
|
89
88
|
await peer.initialized;
|
|
90
89
|
await peer.initializeOpts({
|
|
90
|
+
localMetaspace: metaspace,
|
|
91
91
|
localSpace: sourceSpace,
|
|
92
92
|
receiverSpace: destSpace,
|
|
93
93
|
receiverCoordinator: receiverCoordinator,
|
|
@@ -128,7 +128,6 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
128
128
|
metaspace,
|
|
129
129
|
domainIbGibs: [r1_alpha_v0_source.ibGib],
|
|
130
130
|
conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
|
|
131
|
-
useSessionIdentity: false,
|
|
132
131
|
});
|
|
133
132
|
await r1_syncSaga.done;
|
|
134
133
|
if (logalot) { console.log(`${lc} R1 Sync Complete.`); }
|
|
@@ -148,7 +147,7 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
148
147
|
});
|
|
149
148
|
const r1_alpha_source_tipAddr = r1_alpha_sourceKV[alpha_tjpAddr];
|
|
150
149
|
if (!r1_alpha_source_tipAddr) {
|
|
151
|
-
await
|
|
150
|
+
await ifWeMight(sir, 'r1_alpha_source_tipAddr is falsy?', async () => {
|
|
152
151
|
iReckon(sir, true).asTo('fail').isGonnaBeFalse();
|
|
153
152
|
});
|
|
154
153
|
return; /* <<<< returns early */
|
|
@@ -161,17 +160,17 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
161
160
|
});
|
|
162
161
|
const r1_alpha_dest_tipAddr = r1_alpha_destKV[alpha_tjpAddr];
|
|
163
162
|
if (!r1_alpha_dest_tipAddr) {
|
|
164
|
-
await
|
|
163
|
+
await ifWeMight(sir, 'r1_alpha_dest_tipAddr is falsy?', async () => {
|
|
165
164
|
iReckon(sir, true).asTo('fail').isGonnaBeFalse();
|
|
166
165
|
});
|
|
167
166
|
return; /* <<<< returns early */
|
|
168
167
|
}
|
|
169
168
|
|
|
170
|
-
await
|
|
169
|
+
await ifWeMight(sir, 'r1 tip addrs match', async () => {
|
|
171
170
|
iReckon(sir, r1_alpha_source_tipAddr).asTo('R1 source/dest have same tip').isGonnaBe(r1_alpha_dest_tipAddr);
|
|
172
171
|
});
|
|
173
172
|
|
|
174
|
-
await
|
|
173
|
+
await ifWeMight(sir, 'r1 text synced correctly', async () => {
|
|
175
174
|
if (!r1_alpha_dest_tipAddr) {
|
|
176
175
|
throw new Error(`r1_dest_tipAddr is null/undefined (E: 1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d)`);
|
|
177
176
|
}
|
|
@@ -181,7 +180,7 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
181
180
|
iReckon(sir, destTipIbGib.data!.text).asTo('Dest has initial text').isGonnaBe(INITIAL_TEXT);
|
|
182
181
|
});
|
|
183
182
|
|
|
184
|
-
await
|
|
183
|
+
await ifWeMight(sir, 'r1 dep graphs synced', async () => {
|
|
185
184
|
const [r1_alpha_source_tip] = await getIbGibsFromCache_fallbackToSpaces({
|
|
186
185
|
addrs: [r1_alpha_source_tipAddr],
|
|
187
186
|
space: sourceSpace,
|
|
@@ -260,7 +259,7 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
260
259
|
// #endregion r2 dest edits
|
|
261
260
|
|
|
262
261
|
await respecfully(sir, `r2 verify pre`, async () => {
|
|
263
|
-
await
|
|
262
|
+
await ifWeMight(sir, 'texts as expected', async () => {
|
|
264
263
|
// before the sync, each side only has their edit. after the sync,
|
|
265
264
|
// both sides should have both prepended and appended text
|
|
266
265
|
iReckon(sir, r2_alpha_v1_source_appendedText.ibGib.data?.text.includes(INITIAL_TEXT)).asTo('alpha source has initial text').isGonnaBeTrue();
|
|
@@ -282,7 +281,6 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
282
281
|
metaspace,
|
|
283
282
|
domainIbGibs: [r2_alpha_v1_source_appendedText.ibGib],
|
|
284
283
|
conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
|
|
285
|
-
useSessionIdentity: false,
|
|
286
284
|
});
|
|
287
285
|
await r2_syncSaga.done;
|
|
288
286
|
} catch (e) {
|
|
@@ -296,14 +294,14 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
296
294
|
const kv_dest = await senderCoordinator.getKnowledgeMap({ space: destSpace, metaspace, domainIbGibs: [r1_alpha_v0_source.ibGib] });
|
|
297
295
|
const r2_alpha_source_tipAddr = kv_source[alpha_tjpAddr];
|
|
298
296
|
if (!r2_alpha_source_tipAddr) {
|
|
299
|
-
await
|
|
297
|
+
await ifWeMight(sir, 'r2_alpha_source_tipAddr falsy?', async () => {
|
|
300
298
|
iReckon(sir, true).asTo('fails').isGonnaBe(false);
|
|
301
299
|
});
|
|
302
300
|
return; /* <<<< returns early */
|
|
303
301
|
}
|
|
304
302
|
const r2_alpha_dest_tipAddr = kv_dest[alpha_tjpAddr];
|
|
305
303
|
if (!r2_alpha_dest_tipAddr) {
|
|
306
|
-
await
|
|
304
|
+
await ifWeMight(sir, 'r2_alpha_dest_tipAddr falsy?', async () => {
|
|
307
305
|
iReckon(sir, true).asTo('fails').isGonnaBe(false);
|
|
308
306
|
});
|
|
309
307
|
return; /* <<<< returns early */
|
|
@@ -317,11 +315,11 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
317
315
|
space: sourceSpace,
|
|
318
316
|
});
|
|
319
317
|
|
|
320
|
-
await
|
|
318
|
+
await ifWeMight(sir, 'r2 tip addrs match', async () => {
|
|
321
319
|
iReckon(sir, r2_alpha_source_tipAddr).asTo('alpha').isGonnaBe(r2_alpha_dest_tipAddr);
|
|
322
320
|
});
|
|
323
321
|
|
|
324
|
-
await
|
|
322
|
+
await ifWeMight(sir, 'r2 text merged correctly', async () => {
|
|
325
323
|
// before the sync, each side only has their edit. after the sync,
|
|
326
324
|
// both sides should have both prepended and appended text
|
|
327
325
|
iReckon(sir, r2_alpha_v1_source_appendedText.ibGib.data?.text.includes(INITIAL_TEXT)).asTo('alpha source has initial text').isGonnaBeTrue();
|
|
@@ -340,7 +338,7 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
340
338
|
iReckon(sir, text).asTo('R2 has both prepend and append').isGonnaBe(DEST_PREPEND + INITIAL_TEXT + SOURCE_APPEND);
|
|
341
339
|
});
|
|
342
340
|
|
|
343
|
-
await
|
|
341
|
+
await ifWeMight(sir, 'r2 dep graphs synced', async () => {
|
|
344
342
|
// alpha's full dep graph should exist on dest
|
|
345
343
|
const depGraph_alpha_source = await getDependencyGraph({
|
|
346
344
|
ibGib: r2_alpha_source_tip,
|
|
@@ -414,7 +412,7 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
414
412
|
// // #endregion r3 dest edits
|
|
415
413
|
|
|
416
414
|
// await respecfully(sir, `r3 verify pre`, async () => {
|
|
417
|
-
// await
|
|
415
|
+
// await ifWeMight(sir, 'dest has alpha after R2 graft', async () => {
|
|
418
416
|
// const kv = await receiverCoordinator.getKnowledgeMap({ space: destSpace, metaspace, domainIbGibs: [r3_v0_graft_fromDest] });
|
|
419
417
|
// iReckon(sir, !!kv[alpha_tjpAddr]).asTo('dest has tip').isGonnaBeTrue();
|
|
420
418
|
// });
|
|
@@ -430,7 +428,6 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
430
428
|
// metaspace,
|
|
431
429
|
// domainIbGibs: [r3_v1_source.ibGib],
|
|
432
430
|
// conflictStrategy: SyncConflictStrategy.optimisticWithLCS,
|
|
433
|
-
// useSessionIdentity: false,
|
|
434
431
|
// });
|
|
435
432
|
// await r3_syncSaga.done;
|
|
436
433
|
// } catch (e) {
|
|
@@ -445,11 +442,11 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
445
442
|
// const r3_tip_s = kv_s[alpha_tjpAddr];
|
|
446
443
|
// const r3_tip_d = kv_d[alpha_tjpAddr];
|
|
447
444
|
|
|
448
|
-
// await
|
|
445
|
+
// await ifWeMight(sir, 'r3 tip addrs match', async () => {
|
|
449
446
|
// iReckon(sir, r3_tip_s).asTo('R3 tips match').isGonnaBe(r3_tip_d);
|
|
450
447
|
// });
|
|
451
448
|
|
|
452
|
-
// await
|
|
449
|
+
// await ifWeMight(sir, 'r3 both paragraph edits merged', async () => {
|
|
453
450
|
// const res = await getFromSpace({ space: sourceSpace, addr: r3_tip_s! });
|
|
454
451
|
// const tip = res.ibGibs![0] as IbGib_V1<TestData>;
|
|
455
452
|
// const mergedText = tip.data!.text!;
|
|
@@ -468,7 +465,7 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
468
465
|
// .isGonnaBeTrue();
|
|
469
466
|
// });
|
|
470
467
|
|
|
471
|
-
// await
|
|
468
|
+
// await ifWeMight(sir, 'r3 dep graphs synced', async () => {
|
|
472
469
|
// const [d] = await getIbGibsFromCache_fallbackToSpaces({ addrs: [r3_tip_s!], space: destSpace });
|
|
473
470
|
// iReckon(sir, d).asTo('exists dest').isGonnaBeTruthy();
|
|
474
471
|
// });
|
|
@@ -502,7 +499,7 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
502
499
|
// // #endregion r4 dest edits
|
|
503
500
|
|
|
504
501
|
// await respecfully(sir, `r4 verify pre`, async () => {
|
|
505
|
-
// await
|
|
502
|
+
// await ifWeMight(sir, 'dest has alpha after R3 graft', async () => {
|
|
506
503
|
// // TODO: Verify pre-sync state
|
|
507
504
|
// });
|
|
508
505
|
// });
|
|
@@ -512,16 +509,16 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
512
509
|
// // TODO: Add sync operation
|
|
513
510
|
|
|
514
511
|
// await respecfully(sir, `r4 verify post`, async () => {
|
|
515
|
-
// await
|
|
512
|
+
// await ifWeMight(sir, 'r4 tip addrs match', async () => {
|
|
516
513
|
// // TODO: Verify tips match
|
|
517
514
|
// });
|
|
518
515
|
|
|
519
|
-
// await
|
|
516
|
+
// await ifWeMight(sir, 'r4 LCS merged both word changes', async () => {
|
|
520
517
|
// // TODO: Verify text has both source and dest word changes
|
|
521
518
|
// // TODO: Verify LCS algorithm preserved both edits correctly
|
|
522
519
|
// });
|
|
523
520
|
|
|
524
|
-
// await
|
|
521
|
+
// await ifWeMight(sir, 'r4 dep graphs synced', async () => {
|
|
525
522
|
// // TODO: Verify dep graphs
|
|
526
523
|
// });
|
|
527
524
|
// });
|
|
@@ -556,7 +553,7 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
556
553
|
// // #endregion r5 dest edits
|
|
557
554
|
|
|
558
555
|
// await respecfully(sir, `r5 verify pre`, async () => {
|
|
559
|
-
// await
|
|
556
|
+
// await ifWeMight(sir, 'dest has alpha after R4 graft', async () => {
|
|
560
557
|
// // TODO: Verify pre-sync state
|
|
561
558
|
// });
|
|
562
559
|
// });
|
|
@@ -566,24 +563,24 @@ await respecfully(sir, `Text merge (LCS) conflict resolution`, async () => {
|
|
|
566
563
|
// // TODO: Add sync operation
|
|
567
564
|
|
|
568
565
|
// await respecfully(sir, `r5 verify post`, async () => {
|
|
569
|
-
// await
|
|
566
|
+
// await ifWeMight(sir, 'r5 tip addrs match', async () => {
|
|
570
567
|
// // TODO: Verify tips match
|
|
571
568
|
// });
|
|
572
569
|
|
|
573
|
-
// await
|
|
570
|
+
// await ifWeMight(sir, 'r5 text field merged', async () => {
|
|
574
571
|
// // TODO: Verify text field has both source and dest changes
|
|
575
572
|
// });
|
|
576
573
|
|
|
577
|
-
// await
|
|
574
|
+
// await ifWeMight(sir, 'r5 description field merged', async () => {
|
|
578
575
|
// // TODO: Verify description field has both source and dest changes
|
|
579
576
|
// });
|
|
580
577
|
|
|
581
|
-
// await
|
|
578
|
+
// await ifWeMight(sir, 'r5 both fields independently LCS-merged', async () => {
|
|
582
579
|
// // TODO: Verify each field was merged independently
|
|
583
580
|
// // TODO: Ensure one field's merge didn't affect the other
|
|
584
581
|
// });
|
|
585
582
|
|
|
586
|
-
// await
|
|
583
|
+
// await ifWeMight(sir, 'r5 dep graphs synced', async () => {
|
|
587
584
|
// // TODO: Verify dep graphs
|
|
588
585
|
// });
|
|
589
586
|
// });
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ROOT_ADDR } from "@ibgib/ts-gib/dist/V1/constants.mjs";
|
|
3
|
-
import { KeystoneReplenishStrategy } from "../keystone/keystone-types.mjs";
|
|
4
|
-
import { KEYSTONE_VERB_MANAGE, KEYSTONE_VERB_SIGN, POOL_ID_DEFAULT, POOL_ID_DELEGATE, POOL_ID_TRANSITION } from "../keystone/keystone-constants.mjs";
|
|
1
|
+
// import { ROOT_ADDR } from "@ibgib/ts-gib/dist/V1/constants.mjs";
|
|
5
2
|
|
|
6
3
|
export const SYNC_ATOM = "sync";
|
|
7
4
|
|
|
8
5
|
export const SYNC_MSG_REL8N_NAME = "syncmsg";
|
|
9
6
|
/**
|
|
10
7
|
* payload addrs should be domain-only, i.e., we are not including the sync
|
|
11
|
-
* saga ibgib, or its message stone
|
|
8
|
+
* saga ibgib, or its message stone.
|
|
12
9
|
*/
|
|
13
10
|
export const SYNC_SAGA_PAYLOAD_ADDRS_DOMAIN = "@payloadAddrsDomain";
|
|
14
11
|
|
|
@@ -80,60 +77,3 @@ export function isValidSyncConflictStrategy(strategy: string): strategy is SyncC
|
|
|
80
77
|
return SYNC_CONFLICT_STRATEGY_VALID_VALUES.includes(strategy as SyncConflictStrategy);
|
|
81
78
|
}
|
|
82
79
|
// #endregion SyncConflictStrategy
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* to be used by the sender
|
|
86
|
-
*/
|
|
87
|
-
export const SESSION_IDENTITY_KEYSTONE_PRIMARY_POOL_ID = POOL_ID_DEFAULT;
|
|
88
|
-
/**
|
|
89
|
-
* single use pool
|
|
90
|
-
*/
|
|
91
|
-
export const SESSION_IDENTITY_KEYSTONE_TRANSITION_POOL_ID = POOL_ID_TRANSITION;
|
|
92
|
-
/**
|
|
93
|
-
* to be used by the receiver, created via the single-use transition pool.
|
|
94
|
-
*/
|
|
95
|
-
export const SESSION_IDENTITY_KEYSTONE_DELEGATE_POOL_ID = POOL_ID_DELEGATE;
|
|
96
|
-
/**
|
|
97
|
-
* When synchronizing, the plan for identity integration is to create a session
|
|
98
|
-
* keystone. This keystone will have a primary pool, driven by the sender's
|
|
99
|
-
* secret, and a secondary delegated pool for use by the receiver. Initially,
|
|
100
|
-
* this will have a known, weak "secret" and it is the job of the receiver to
|
|
101
|
-
* use this to then change the keystone to use a secret chosen by the
|
|
102
|
-
* receiver's end.
|
|
103
|
-
*/
|
|
104
|
-
export const SESSION_IDENTITY_KEYSTONE_SECRET_TRANSITIONPOOL = ROOT_ADDR;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* has to be big enough to avoid our currently poor (atow 02/24/2026)
|
|
108
|
-
* implementation of the binding target.
|
|
109
|
-
*/
|
|
110
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_SIZE = 100;
|
|
111
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_ALGO = HashAlgorithm.sha_256;
|
|
112
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_ROUNDS = 3;
|
|
113
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_RANDOM = 2;
|
|
114
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_SEQUENTIAL = 2;
|
|
115
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_TARGET_BINDING = 4;
|
|
116
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_REPLENISH_STRATEGY = KeystoneReplenishStrategy.topUp;
|
|
117
|
-
/**
|
|
118
|
-
* verbs associated with primary/sender participant.
|
|
119
|
-
*
|
|
120
|
-
* todo: would be slightly cleaner to have the sender/primary genesis with two pools, one for signing and one being one-time manage use (to add the transition pool) just like the transition pool, but this is a finesse and not for V1. Still it is neat that this possibility/mechanism exists.
|
|
121
|
-
*/
|
|
122
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_VERBS_PRIMARY = [KEYSTONE_VERB_MANAGE];
|
|
123
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_VERBS_DELEGATE = [KEYSTONE_VERB_SIGN];
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* transition pool is purposefully weak with a known password.
|
|
127
|
-
*/
|
|
128
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_SIZE_TRANSITIONPOOL = 1;
|
|
129
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_ALGO_TRANSITIONPOOL = HashAlgorithm.sha_256;
|
|
130
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_ROUNDS_TRANSITIONPOOL = 1;
|
|
131
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_RANDOM_TRANSITIONPOOL = 0;
|
|
132
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_SEQUENTIAL_TRANSITIONPOOL = 1;
|
|
133
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_TARGET_BINDING_TRANSITIONPOOL = 0;
|
|
134
|
-
/**
|
|
135
|
-
* This pool is to be used only once, by the receiver, in order for the receiver
|
|
136
|
-
* to create their own pool.
|
|
137
|
-
*/
|
|
138
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_REPLENISH_STRATEGY_TRANSITIONPOOL = KeystoneReplenishStrategy.deleteAll;
|
|
139
|
-
export const SESSION_IDENTITY_KEYSTONE_CONFIG_VERBS_TRANSITIONPOOL = [KEYSTONE_VERB_MANAGE];
|
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
import { IbGibSpaceAny } from "../witness/space/space-base-v1.mjs";
|
|
17
17
|
import { getFromSpace, putInSpace } from "../witness/space/space-helper.mjs";
|
|
18
18
|
import { IbGibSpaceResultData, IbGibSpaceResultIbGib, IbGibSpaceResultRel8ns } from "../witness/space/space-types.mjs";
|
|
19
|
-
import { KeystoneIbGib_V1 } from "../keystone/keystone-types.mjs";
|
|
20
19
|
import { SyncSagaConflictInfo, SyncSagaMessageCommitData_V1, SyncSagaMessageDeltaData_V1, SyncSagaMessageIbGib_V1 } from "./sync-saga-message/sync-saga-message-types.mjs";
|
|
21
20
|
import { getIbGibsFromCache_fallbackToSpaces } from "../common/other/ibgib-helper.mjs";
|
|
22
21
|
import { isGraftInfo } from "./graft-info/graft-info-helpers.mjs";
|
|
@@ -166,7 +165,6 @@ export async function isPastFrame({
|
|
|
166
165
|
* It only retrieves the *content* of the current frame:
|
|
167
166
|
* 1. The Frame itself.
|
|
168
167
|
* 2. The Message Stone(s) (`rel8ns.msg`).
|
|
169
|
-
* 3. The Identity(s) (`rel8ns.identity`).
|
|
170
168
|
*
|
|
171
169
|
* This is used for efficient transmission of the "Current Step" without re-sending the entire history.
|
|
172
170
|
*/
|
|
@@ -203,12 +201,7 @@ export async function getSyncSagaFrameDependencyGraph({
|
|
|
203
201
|
const msgStoneAddrs = sagaIbGib.rel8ns[SYNC_MSG_REL8N_NAME]!;
|
|
204
202
|
const msgStones = await fnGet(msgStoneAddrs) as SyncSagaMessageIbGib_V1[];
|
|
205
203
|
|
|
206
|
-
|
|
207
|
-
const identities = sagaIbGib.rel8ns.identity && sagaIbGib.rel8ns.identity.length > 0 ?
|
|
208
|
-
await fnGet(sagaIbGib.rel8ns.identity) as KeystoneIbGib_V1[] :
|
|
209
|
-
[];
|
|
210
|
-
|
|
211
|
-
return { sagaIbGib, msgStones, identities, };
|
|
204
|
+
return { sagaIbGib, msgStones, };
|
|
212
205
|
}
|
|
213
206
|
|
|
214
207
|
/**
|