@ibgib/core-gib 0.1.59 → 0.1.61
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 +12 -1
- package/dist/common/other/graph-helper.d.mts.map +1 -1
- package/dist/common/other/graph-helper.mjs +7 -6
- package/dist/common/other/graph-helper.mjs.map +1 -1
- package/dist/keystone/keystone-config-builder.d.mts +1 -2
- package/dist/keystone/keystone-config-builder.d.mts.map +1 -1
- package/dist/keystone/keystone-config-builder.mjs +4 -19
- package/dist/keystone/keystone-config-builder.mjs.map +1 -1
- package/dist/keystone/keystone-constants.d.mts +2 -0
- package/dist/keystone/keystone-constants.d.mts.map +1 -1
- package/dist/keystone/keystone-constants.mjs +2 -0
- package/dist/keystone/keystone-constants.mjs.map +1 -1
- package/dist/keystone/keystone-helpers.d.mts +5 -15
- package/dist/keystone/keystone-helpers.d.mts.map +1 -1
- package/dist/keystone/keystone-helpers.mjs +59 -73
- package/dist/keystone/keystone-helpers.mjs.map +1 -1
- package/dist/keystone/keystone-policy-types.d.mts +6 -4
- package/dist/keystone/keystone-policy-types.d.mts.map +1 -1
- package/dist/keystone/keystone-service-v1.d.mts.map +1 -1
- package/dist/keystone/keystone-service-v1.mjs +4 -8
- package/dist/keystone/keystone-service-v1.mjs.map +1 -1
- package/dist/keystone/keystone-service-v1.respec.mjs +182 -33
- package/dist/keystone/keystone-service-v1.respec.mjs.map +1 -1
- package/dist/keystone/keystone-types.d.mts +4 -11
- package/dist/keystone/keystone-types.d.mts.map +1 -1
- package/dist/keystone/policy/keystone-profile-builder.d.mts +25 -0
- package/dist/keystone/policy/keystone-profile-builder.d.mts.map +1 -0
- package/dist/keystone/policy/keystone-profile-builder.mjs +117 -0
- package/dist/keystone/policy/keystone-profile-builder.mjs.map +1 -0
- package/dist/keystone/policy/profiles/profile-high.json +84 -0
- package/dist/keystone/policy/profiles/profile-low.json +84 -0
- package/dist/keystone/policy/profiles/profile-medium.json +84 -0
- package/dist/keystone/policy/profiles/profile-session.json +84 -0
- package/dist/keystone/policy/profiles/profile-test.json +84 -0
- package/dist/keystone/policy/schemas/connect-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/connect-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/connect-pool.medium.schema.json +23 -0
- package/dist/keystone/policy/schemas/keystone.high.schema.json +26 -0
- package/dist/keystone/policy/schemas/keystone.low.schema.json +26 -0
- package/dist/keystone/policy/schemas/keystone.medium.schema.json +26 -0
- package/dist/keystone/policy/schemas/manage-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/manage-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/manage-pool.medium.schema.json +23 -0
- package/dist/keystone/policy/schemas/revoke-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/revoke-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/revoke-pool.medium.schema.json +23 -0
- package/dist/keystone/policy/schemas/sign-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/sign-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/sign-pool.medium.schema.json +23 -0
- package/dist/keystone/policy/schemas/sync-pool.high.schema.json +23 -0
- package/dist/keystone/policy/schemas/sync-pool.low.schema.json +23 -0
- package/dist/keystone/policy/schemas/sync-pool.medium.schema.json +23 -0
- package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.d.mts +8 -0
- package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.mjs +582 -0
- package/dist/sync/sync-conflict-adv-multitimelines.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-conflict-basic-divergence.withid.respec.d.mts +7 -0
- package/dist/sync/sync-conflict-basic-divergence.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-conflict-basic-divergence.withid.respec.mjs +274 -0
- package/dist/sync/sync-conflict-basic-divergence.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.d.mts +8 -0
- package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.mjs +322 -0
- package/dist/sync/sync-conflict-basic-multitimelines.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-conflict-text-merge.withid.respec.d.mts +7 -0
- package/dist/sync/sync-conflict-text-merge.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-conflict-text-merge.withid.respec.mjs +307 -0
- package/dist/sync/sync-conflict-text-merge.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-constants.withid.respec.d.mts +8 -0
- package/dist/sync/sync-innerspace-constants.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-constants.withid.respec.mjs +233 -0
- package/dist/sync/sync-innerspace-constants.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-deep-updates.withid.respec.d.mts +7 -0
- package/dist/sync/sync-innerspace-deep-updates.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-deep-updates.withid.respec.mjs +233 -0
- package/dist/sync/sync-innerspace-deep-updates.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-dest-ahead.withid.respec.d.mts +7 -0
- package/dist/sync/sync-innerspace-dest-ahead.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-dest-ahead.withid.respec.mjs +225 -0
- package/dist/sync/sync-innerspace-dest-ahead.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-multiple-timelines.respec.mjs.map +1 -1
- package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.d.mts +7 -0
- package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.mjs +235 -0
- package/dist/sync/sync-innerspace-multiple-timelines.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace-partial-update.withid.respec.d.mts +7 -0
- package/dist/sync/sync-innerspace-partial-update.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace-partial-update.withid.respec.mjs +211 -0
- package/dist/sync/sync-innerspace-partial-update.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-innerspace.withid.respec.d.mts +8 -0
- package/dist/sync/sync-innerspace.withid.respec.d.mts.map +1 -0
- package/dist/sync/sync-innerspace.withid.respec.mjs +260 -0
- package/dist/sync/sync-innerspace.withid.respec.mjs.map +1 -0
- package/dist/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mjs +1 -1
- 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 +12 -1
- package/dist/sync/sync-peer/sync-peer-types.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-v1.d.mts +7 -0
- package/dist/sync/sync-peer/sync-peer-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-v1.mjs +43 -1
- package/dist/sync/sync-peer/sync-peer-v1.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.d.mts +2 -0
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.mjs +28 -9
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.d.mts +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mjs +5 -3
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-sender/sync-peer-websocket-sender-v1.d.mts +16 -0
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-sender/sync-peer-websocket-sender-v1.d.mts.map +1 -1
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-sender/sync-peer-websocket-sender-v1.mjs +223 -79
- package/dist/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-sender/sync-peer-websocket-sender-v1.mjs.map +1 -1
- 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 +41 -2
- 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 +4 -0
- package/dist/sync/sync-saga-context/sync-saga-context-types.d.mts.map +1 -1
- package/dist/sync/sync-saga-coordinator.d.mts +6 -0
- package/dist/sync/sync-saga-coordinator.d.mts.map +1 -1
- package/dist/sync/sync-saga-coordinator.mjs +213 -137
- package/dist/sync/sync-saga-coordinator.mjs.map +1 -1
- package/dist/sync/sync-withid.pingpong.respec.mjs +70 -2
- package/dist/sync/sync-withid.pingpong.respec.mjs.map +1 -1
- package/dist/timeline/timeline-api.d.mts.map +1 -1
- package/dist/timeline/timeline-api.mjs +1 -14
- package/dist/timeline/timeline-api.mjs.map +1 -1
- package/dist/witness/space/reconciliation-space/reconciliation-space-base.d.mts.map +1 -1
- package/dist/witness/space/reconciliation-space/reconciliation-space-base.mjs +0 -40
- package/dist/witness/space/reconciliation-space/reconciliation-space-base.mjs.map +1 -1
- package/dist/witness/space/reconciliation-space/reconciliation-space-helper.d.mts.map +1 -1
- package/dist/witness/space/reconciliation-space/reconciliation-space-helper.mjs +6 -6
- package/dist/witness/space/reconciliation-space/reconciliation-space-helper.mjs.map +1 -1
- package/ibgib-foundations.md +2 -1
- package/package.json +1 -1
- package/src/common/other/graph-helper.mts +7 -6
- package/src/keystone/README.md +19 -15
- package/src/keystone/docs/CRYPTANALYSIS.md +185 -0
- package/src/keystone/docs/architecture.md +24 -1
- package/src/keystone/docs/profiles.md +124 -0
- package/src/keystone/keystone-config-builder.mts +3 -21
- package/src/keystone/keystone-constants.mts +2 -0
- package/src/keystone/keystone-helpers.mts +74 -77
- package/src/keystone/keystone-policy-types.mts +6 -4
- package/src/keystone/keystone-service-v1.mts +4 -9
- package/src/keystone/keystone-service-v1.respec.mts +214 -32
- package/src/keystone/keystone-types.mts +5 -9
- package/src/keystone/policy/IMPLEMENTATION.md +60 -0
- package/src/keystone/policy/README.md +94 -0
- package/src/keystone/policy/keystone-profile-builder.mts +131 -0
- package/src/keystone/policy/profiles/profile-high.json +84 -0
- package/src/keystone/policy/profiles/profile-low.json +84 -0
- package/src/keystone/policy/profiles/profile-medium.json +84 -0
- package/src/keystone/policy/profiles/profile-session.json +84 -0
- package/src/keystone/policy/profiles/profile-test.json +84 -0
- package/src/keystone/policy/schemas/connect-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/connect-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/connect-pool.medium.schema.json +23 -0
- package/src/keystone/policy/schemas/keystone.high.schema.json +26 -0
- package/src/keystone/policy/schemas/keystone.low.schema.json +26 -0
- package/src/keystone/policy/schemas/keystone.medium.schema.json +26 -0
- package/src/keystone/policy/schemas/manage-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/manage-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/manage-pool.medium.schema.json +23 -0
- package/src/keystone/policy/schemas/revoke-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/revoke-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/revoke-pool.medium.schema.json +23 -0
- package/src/keystone/policy/schemas/sign-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/sign-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/sign-pool.medium.schema.json +23 -0
- package/src/keystone/policy/schemas/sync-pool.high.schema.json +23 -0
- package/src/keystone/policy/schemas/sync-pool.low.schema.json +23 -0
- package/src/keystone/policy/schemas/sync-pool.medium.schema.json +23 -0
- package/src/sync/docs/security-3b.md +92 -0
- package/src/sync/docs/security.md +139 -38
- package/src/sync/sync-conflict-adv-multitimelines.withid.respec.mts +706 -0
- package/src/sync/sync-conflict-basic-divergence.withid.respec.mts +321 -0
- package/src/sync/sync-conflict-basic-multitimelines.withid.respec.mts +374 -0
- package/src/sync/sync-conflict-text-merge.withid.respec.mts +347 -0
- package/src/sync/sync-innerspace-constants.withid.respec.mts +264 -0
- package/src/sync/sync-innerspace-deep-updates.withid.respec.mts +272 -0
- package/src/sync/sync-innerspace-dest-ahead.withid.respec.mts +266 -0
- package/src/sync/sync-innerspace-multiple-timelines.respec.mts +0 -1
- package/src/sync/sync-innerspace-multiple-timelines.withid.respec.mts +273 -0
- package/src/sync/sync-innerspace-partial-update.withid.respec.mts +249 -0
- package/src/sync/sync-innerspace.withid.respec.mts +265 -0
- package/src/sync/sync-peer/sync-peer-innerspace/sync-peer-innerspace-v1.mts +1 -1
- package/src/sync/sync-peer/sync-peer-types.mts +11 -1
- package/src/sync/sync-peer/sync-peer-v1.mts +47 -1
- package/src/sync/sync-peer/sync-peer-websocket/README.md +42 -0
- package/src/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-peer-websocket-receiver-v1.mts +26 -9
- package/src/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-receiver/sync-websocket-peer-helpers.mts +5 -3
- package/src/sync/sync-peer/sync-peer-websocket/sync-peer-websocket-sender/sync-peer-websocket-sender-v1.mts +242 -78
- package/src/sync/sync-saga-context/sync-saga-context-helpers.mts +46 -4
- package/src/sync/sync-saga-context/sync-saga-context-types.mts +5 -0
- package/src/sync/sync-saga-coordinator.mts +221 -137
- package/src/sync/sync-withid.pingpong.respec.mts +76 -3
- package/src/timeline/timeline-api.mts +1 -15
- package/src/timeline/timeline-api.respec.mts +3 -3
- package/src/witness/space/reconciliation-space/reconciliation-space-base.mts +0 -46
- package/src/witness/space/reconciliation-space/reconciliation-space-helper.mts +6 -5
- package/tsconfig.json +6 -1
- package/src/keystone/keystone-policy.schema.json +0 -51
- package/src/sync/docs/ping_pong_plan.md +0 -147
- package/src/witness/space/reconciliation-space/reconciliation-space-base.mts.OLD.md +0 -884
- package/src/witness/space/reconciliation-space/reconciliation-space-helper.mts.OLD.md +0 -125
|
@@ -689,52 +689,6 @@ export abstract class ReconciliationSpaceBase<
|
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
|
|
692
|
-
// protected async applyTransforms({
|
|
693
|
-
// src,
|
|
694
|
-
// createdIbGibs_Running,
|
|
695
|
-
// dnaAddrsToApplyToStoreVersion,
|
|
696
|
-
// allLocalIbGibs,
|
|
697
|
-
// }: {
|
|
698
|
-
// src: TIbGib,
|
|
699
|
-
// createdIbGibs_Running: TIbGib[],
|
|
700
|
-
// dnaAddrsToApplyToStoreVersion: IbGibAddr[],
|
|
701
|
-
// allLocalIbGibs: TIbGib[],
|
|
702
|
-
// }): Promise<TIbGib> {
|
|
703
|
-
// const lc = `${this.lc}[${this.applyTransforms.name}]`;
|
|
704
|
-
// try {
|
|
705
|
-
// if (logalot) { console.log(`${lc} starting...`); }
|
|
706
|
-
|
|
707
|
-
// let currentSrc = src;
|
|
708
|
-
// // find the dna ibgibs from the local ibgibs that were passed in.
|
|
709
|
-
// const allLocalIbGibsMap = new Map<IbGibAddr, TIbGib>();
|
|
710
|
-
// allLocalIbGibs.forEach(x => allLocalIbGibsMap.set(getIbGibAddr({ ibGib: x }), x));
|
|
711
|
-
|
|
712
|
-
// for (const dnaAddr of dnaAddrsToApplyToStoreVersion) {
|
|
713
|
-
// const dnaIbGib = allLocalIbGibsMap.get(dnaAddr);
|
|
714
|
-
// if (!dnaIbGib) { throw new Error(`(UNEXPECTED) dnaIbGib not found in allLocalIbGibs. addr: ${dnaAddr} (E: 106402377a644e5989710f606e9323ff)`); }
|
|
715
|
-
// const resMut8 = await mut8({
|
|
716
|
-
// src: currentSrc,
|
|
717
|
-
// mut8Ib: dnaIbGib.ib,
|
|
718
|
-
// dataToAddOrPatch: { ...dnaIbGib.data }, // this is a transform, so we just care about data and ib
|
|
719
|
-
// noTimestamp: true,
|
|
720
|
-
// });
|
|
721
|
-
|
|
722
|
-
// currentSrc = resMut8.newIbGib as TIbGib;
|
|
723
|
-
// if (resMut8.intermediateIbGibs) {
|
|
724
|
-
// resMut8.intermediateIbGibs.forEach(x => createdIbGibs_Running.push(x as TIbGib));
|
|
725
|
-
// }
|
|
726
|
-
// createdIbGibs_Running.push(currentSrc);
|
|
727
|
-
// }
|
|
728
|
-
|
|
729
|
-
// return currentSrc;
|
|
730
|
-
// } catch (error) {
|
|
731
|
-
// const emsg = `${lc} ${extractErrorMsg(error)}`;
|
|
732
|
-
// console.error(emsg);
|
|
733
|
-
// throw error;
|
|
734
|
-
// }
|
|
735
|
-
// }
|
|
736
|
-
|
|
737
|
-
|
|
738
692
|
protected async routeAndDoCommand<TCmdModifier extends SyncSpaceOptionsCmdModifier = SyncSpaceOptionsCmdModifier>({
|
|
739
693
|
cmd,
|
|
740
694
|
cmdModifiers,
|
|
@@ -135,13 +135,14 @@ export async function applyTransforms({
|
|
|
135
135
|
const dnaIbGib_IntermediateArray =
|
|
136
136
|
allLocalIbGibs.filter(x => getIbGibAddr({ ibGib: x }) === dnaAddrToApply);
|
|
137
137
|
let dnaIbGib: IbGib_V1;
|
|
138
|
-
if (dnaIbGib_IntermediateArray.length
|
|
138
|
+
if (dnaIbGib_IntermediateArray.length > 0) {
|
|
139
139
|
dnaIbGib = dnaIbGib_IntermediateArray[0];
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
// NOTE: length > 1 is NOT an error condition because mut8/rel8
|
|
141
|
+
// transforms do not have uuids or timestamps. So if the same
|
|
142
|
+
// mut8/rel8 call occurs, e.g., changing the same field on the
|
|
143
|
+
// same source, then we could have a duplicate dna transform.
|
|
142
144
|
} else {
|
|
143
|
-
|
|
144
|
-
throw new Error(`More than one ibGib in allLocalIbGibs with the dna address of ${dnaAddrToApply}? (E: a726134f4cc14a4fb2ed2d39d22af17c)(UNEXPECTED)`);
|
|
145
|
+
throw new Error(`dna ibGib not found in supplied allLocalIbGibs. dnaAddr: ${dnaAddrToApply}. (E: 7f56826852cf48a79ab8af16bf27e284)`);
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
// we have our dna to apply, so do so against the incoming src
|
package/tsconfig.json
CHANGED
|
@@ -9,9 +9,14 @@
|
|
|
9
9
|
"outDir": "./dist", /* Redirect output structure to the directory. */
|
|
10
10
|
"module": "ESNext", /* https://www.typescriptlang.org/docs/handbook/esm-node.html */
|
|
11
11
|
},
|
|
12
|
+
"include": [
|
|
13
|
+
"src/**/*.ts",
|
|
14
|
+
"src/**/*.mts",
|
|
15
|
+
"src/keystone/policy/profiles/*.json"
|
|
16
|
+
],
|
|
12
17
|
"exclude": [
|
|
13
18
|
"./node_modules",
|
|
14
19
|
"**/*.spec.mts",
|
|
15
20
|
"./dist/**/*"
|
|
16
21
|
]
|
|
17
|
-
}
|
|
22
|
+
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"title": "KeystonePolicyConfigTemplate",
|
|
4
|
-
"type": "object",
|
|
5
|
-
"properties": {
|
|
6
|
-
"behaviorProfiles": {
|
|
7
|
-
"type": "object",
|
|
8
|
-
"additionalProperties": {
|
|
9
|
-
"type": "object",
|
|
10
|
-
"properties": {
|
|
11
|
-
"size": { "type": "integer", "minimum": 1 },
|
|
12
|
-
"replenish": { "type": "string", "enum": ["top-up", "replace-all", "consume", "delete-all"] },
|
|
13
|
-
"selectSequentially": { "type": "integer", "minimum": 0 },
|
|
14
|
-
"selectRandomly": { "type": "integer", "minimum": 0 },
|
|
15
|
-
"targetBindingChars": { "type": "integer", "minimum": 0 }
|
|
16
|
-
},
|
|
17
|
-
"required": ["size", "replenish", "selectSequentially", "selectRandomly", "targetBindingChars"]
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"pools": {
|
|
21
|
-
"type": "object",
|
|
22
|
-
"additionalProperties": {
|
|
23
|
-
"type": "object",
|
|
24
|
-
"properties": {
|
|
25
|
-
"id": { "type": "string" },
|
|
26
|
-
"allowedVerbs": {
|
|
27
|
-
"type": "array",
|
|
28
|
-
"items": { "type": "string" }
|
|
29
|
-
},
|
|
30
|
-
"behaviorProfile": { "type": "string" },
|
|
31
|
-
"behaviorInline": {
|
|
32
|
-
"type": "object",
|
|
33
|
-
"properties": {
|
|
34
|
-
"size": { "type": "integer", "minimum": 1 },
|
|
35
|
-
"replenish": { "type": "string", "enum": ["top-up", "replace-all", "consume", "delete-all"] },
|
|
36
|
-
"selectSequentially": { "type": "integer", "minimum": 0 },
|
|
37
|
-
"selectRandomly": { "type": "integer", "minimum": 0 },
|
|
38
|
-
"targetBindingChars": { "type": "integer", "minimum": 0 }
|
|
39
|
-
},
|
|
40
|
-
"required": ["size", "replenish", "selectSequentially", "selectRandomly", "targetBindingChars"]
|
|
41
|
-
},
|
|
42
|
-
"algo": { "type": "string", "enum": ["SHA-256", "SHA-512"] },
|
|
43
|
-
"rounds": { "type": "integer", "minimum": 1 },
|
|
44
|
-
"type": { "type": "string", "enum": ["hash-reveal-v1"] }
|
|
45
|
-
},
|
|
46
|
-
"required": ["id", "allowedVerbs", "algo", "rounds"]
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"required": ["pools"]
|
|
51
|
-
}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
# Phase 3: Ping Pong Sync with Identity Plan
|
|
2
|
-
|
|
3
|
-
This document details the step-by-step execution flow, space-routing rules, and verification requirements for implementing Phase 3 (Basic Single-Timeline Sync with Identity).
|
|
4
|
-
|
|
5
|
-
## Core Concepts & Terms
|
|
6
|
-
* **Durable Space**: Persistent local database/filesystem storage (`localSpace`).
|
|
7
|
-
* **Temporary Space**: In-memory or transient storage (`tempSpace`) used during the sync saga to accumulate uncommitted domain data.
|
|
8
|
-
* **Control/Saga IbGibs**: The sync saga timeline, saga message stones, context envelopes, and session identity evolutions. These represent the protocol communication and auditing trail.
|
|
9
|
-
* **Domain IbGibs**: The actual user timelines, files, or payload data being synchronized.
|
|
10
|
-
* **Sender (Alice / Initiator)**: The node that generates and signs all request turns using the ephemeral Session Keystone ($S$).
|
|
11
|
-
* **Receiver (Bob / Sovereign Broker / Reactor)**: The node that validates the sender's cryptographic turns and replies with unsigned contexts echoing the same session identity.
|
|
12
|
-
|
|
13
|
-
### Note on "Domain" Overloaded Term
|
|
14
|
-
|
|
15
|
-
The term "domain" is overloaded at this point WRT sync and identity contexts. In this sync context, "domain" refers to ibgibs in the business logic domain, i.e., the actual data we're working with. This is in contrast to the identity context, in which "domain" means the identity boundary created with a main identity keystone. Neither usage is easily refactorable in code, hence the term overloading.
|
|
16
|
-
|
|
17
|
-
**TL;DR - Sync: "domain" vs "control". Identity: "domain" keystone vs. "session" keystone**
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## Storage & Routing Rules (Security Boundary)
|
|
22
|
-
|
|
23
|
-
| IbGib Category | Target Space (Validation Phase) | Target Space (Commit Phase) | Rationale |
|
|
24
|
-
| :--- | :--- | :--- | :--- |
|
|
25
|
-
| **Control / Saga** | Durable Space (`localSpace`) | Durable Space (`localSpace`) | Must be persisted ASAP after authentication/validation per exchange between endpoints to maintain a tamper-evident audit trail, even if the sync fails midway. |
|
|
26
|
-
| **Domain Payloads** | Temporary Space (`tempSpace`) | Durable Space (`localSpace`) | Avoids polluting the durable space with unverified or partial data before a transaction successfully commits. |
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Detailed Leg-by-Leg Execution Flow
|
|
31
|
-
|
|
32
|
-
```mermaid
|
|
33
|
-
sequenceDiagram
|
|
34
|
-
autonumber
|
|
35
|
-
actor Alice as Sender (Alice)
|
|
36
|
-
actor Bob as Receiver (Bob)
|
|
37
|
-
|
|
38
|
-
Note over Alice: Leg 1: Init (Sign & Post)
|
|
39
|
-
Alice->>Alice: Sign/Evolve S -> S_init
|
|
40
|
-
Alice->>Alice: Bind context.rel8ns.sessionIdentity = S_genesis
|
|
41
|
-
Alice->>Alice: Bind context.signedSessionIdentity = S_init
|
|
42
|
-
Alice->>Bob: Send Context (with S_init frame)
|
|
43
|
-
Note over Bob: Authenticate S_init independently
|
|
44
|
-
Bob->>Bob: Save Context & S_init to Durable Space
|
|
45
|
-
|
|
46
|
-
Note over Bob: Leg 2: Ack (Passive Validation)
|
|
47
|
-
Bob->>Bob: Prepare Ack context
|
|
48
|
-
Bob->>Bob: Bind context.rel8ns.sessionIdentity = S_init
|
|
49
|
-
Note over Bob: (No new evolution / signedSessionIdentity = undefined)
|
|
50
|
-
Bob->>Alice: Return Ack Context
|
|
51
|
-
|
|
52
|
-
Note over Alice: Leg 3: Delta (Sign & Payload)
|
|
53
|
-
Alice->>Alice: Process Ack requests
|
|
54
|
-
Alice->>Alice: Sign/Evolve S_init -> S_delta
|
|
55
|
-
Alice->>Alice: Bind context.rel8ns.sessionIdentity = S_init
|
|
56
|
-
Alice->>Alice: Bind context.signedSessionIdentity = S_delta
|
|
57
|
-
Alice->>Bob: Send Delta Context + Domain Payloads
|
|
58
|
-
Note over Bob: Authenticate S_delta independently
|
|
59
|
-
Bob->>Bob: Save Context & S_delta to Durable Space
|
|
60
|
-
Bob->>Bob: Save Domain Payloads to Temp Space
|
|
61
|
-
|
|
62
|
-
Note over Bob: Leg 4: Commit (Passive Verification)
|
|
63
|
-
Bob->>Bob: Prepare Commit context
|
|
64
|
-
Bob->>Bob: Bind context.rel8ns.sessionIdentity = S_delta
|
|
65
|
-
Bob->>Alice: Return Commit Context
|
|
66
|
-
Bob->>Bob: Move Domain Payloads (Temp -> Durable)
|
|
67
|
-
Alice->>Alice: Move Domain Payloads (Temp -> Durable)
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Leg 1: Init (Sender $\to$ Receiver)
|
|
71
|
-
1. **Sender (Alice)**:
|
|
72
|
-
* [ ] Generates the `Init` message frame.
|
|
73
|
-
* [ ] Signs and evolves the session identity from $S_{genesis}$ to $S_{init}$ using the `sync` pool, targeting the `Init` context ibgib.
|
|
74
|
-
* [ ] Wraps the saga in a context:
|
|
75
|
-
* `context.rel8ns.sessionIdentity = [S_genesis_addr]`
|
|
76
|
-
* `context.signedSessionIdentity = S_init`
|
|
77
|
-
* [ ] Transmits the context to the peer. Note: We only transmit the single evolved `S_init` frame inside `signedSessionIdentity`.
|
|
78
|
-
2. **Receiver (Bob)**:
|
|
79
|
-
* [ ] Receives the context.
|
|
80
|
-
* [ ] **Authentication**: Run `authenticateContext`.
|
|
81
|
-
* [ ] Retrieve the previous keystone frame ($S_{genesis}$) independently from Bob's own local registry (using the session identity address obtained via $I_1$'s claim), rather than trusting any path/history Alice sends.
|
|
82
|
-
* [ ] Validate the cryptographic evolution from $S_{genesis}$ to the incoming $S_{init}$ (sequential counters, signature verification).
|
|
83
|
-
* [ ] Verify the signature in $S_{init}$ targets the exact context address.
|
|
84
|
-
* [ ] **Persistence**: Ensure $S_{init}$ is saved to the durable space alongside the context/saga control ibgibs (already handled by the coordinator's sync state saving mechanism, but needs to include the new session identity frame).
|
|
85
|
-
|
|
86
|
-
### Leg 2: Ack (Receiver $\to$ Sender)
|
|
87
|
-
1. **Receiver (Bob)**:
|
|
88
|
-
* [ ] Creates the `Ack` message frame.
|
|
89
|
-
* [ ] Wraps it in an `Ack` context:
|
|
90
|
-
* `context.rel8ns.sessionIdentity = [S_init_addr]`
|
|
91
|
-
* `context.signedSessionIdentity = undefined` (Bob does *not* sign or evolve $S$).
|
|
92
|
-
* [ ] Transmits the `Ack` context to Alice.
|
|
93
|
-
2. **Sender (Alice)**:
|
|
94
|
-
* [ ] Receives the `Ack` context.
|
|
95
|
-
* [ ] Processes the gap requests and prepares domain payloads.
|
|
96
|
-
|
|
97
|
-
### Leg 3: Delta (Sender $\to$ Receiver)
|
|
98
|
-
1. **Sender (Alice)**:
|
|
99
|
-
* [ ] Creates the `Delta` message frame.
|
|
100
|
-
* [ ] Signs and evolves the session identity from $S_{init}$ to $S_{delta}$, targeting the `Delta` context ibgib.
|
|
101
|
-
* [ ] Wraps it in a `Delta` context:
|
|
102
|
-
* `context.rel8ns.sessionIdentity = [S_init_addr]`
|
|
103
|
-
* `context.signedSessionIdentity = S_delta`
|
|
104
|
-
* [ ] Transmits the `Delta` context and the domain payloads.
|
|
105
|
-
2. **Receiver (Bob)**:
|
|
106
|
-
* [ ] Receives the context and domain payloads.
|
|
107
|
-
* [ ] **Authentication**: Run `authenticateContext`.
|
|
108
|
-
* [ ] Retrieve $S_{init}$ independently from Bob's own local registry.
|
|
109
|
-
* [ ] Validate transition from $S_{init}$ to $S_{delta}$.
|
|
110
|
-
* [ ] Verify signature targets the `Delta` context address.
|
|
111
|
-
* [ ] **Persistence**:
|
|
112
|
-
* [ ] Ensure $S_{delta}$ is saved to the durable space alongside the control ibgibs.
|
|
113
|
-
* [ ] Save incoming domain payloads to **Temporary Space** (`tempSpace`).
|
|
114
|
-
|
|
115
|
-
### Leg 4: Commit (Receiver $\to$ Sender)
|
|
116
|
-
1. **Receiver (Bob)**:
|
|
117
|
-
* [ ] Creates the `Commit` message frame and context.
|
|
118
|
-
* [ ] Returns the `Commit` context to Alice.
|
|
119
|
-
* [ ] Commits the sync session: transfers all domain payloads from `tempSpace` to `localSpace` (Durable).
|
|
120
|
-
2. **Sender (Alice)**:
|
|
121
|
-
* [ ] Receives the `Commit` context.
|
|
122
|
-
* [ ] Commits the sync session: transfers accumulated domain payloads from `tempSpace` to `localSpace` (Durable).
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
## Phase 3A: Step-by-Step Testing Plan
|
|
127
|
-
|
|
128
|
-
To prevent complexity explosion, we will implement this incrementally using a new test file: `libs/core-gib/src/sync/sync-withid.pingpong.respec.mts`.
|
|
129
|
-
|
|
130
|
-
### Step 1: Scaffold & Establish
|
|
131
|
-
* [ ] Initialize a basic sync saga setup (two spaces, two coordinators, custom in-memory peer).
|
|
132
|
-
* [ ] Perform Phase 1 establish to load the sender identity $I$ and session identity $S_{genesis}$ into the spaces.
|
|
133
|
-
* [ ] Trigger `sync(...)`. Assert that the saga fails on Leg 1 due to unimplemented identity checks on the receiver.
|
|
134
|
-
|
|
135
|
-
### Step 2: Implement Leg 1 Validation
|
|
136
|
-
* [ ] Implement `authenticateContext` on the sync peer receiver (or as a helper).
|
|
137
|
-
* [ ] Wire `authenticateContext` into the coordinator/peer incoming frame handler.
|
|
138
|
-
* [ ] Verify that Leg 1 completes without error and that the receiver successfully writes the saga/session frames to durable space.
|
|
139
|
-
|
|
140
|
-
### Step 3: Implement Leg 2 & Leg 3 Validation
|
|
141
|
-
* [ ] Verify Alice processes the Ack and produces a Delta.
|
|
142
|
-
* [ ] Implement Alice's second evolution to $S_{delta}$ and verification of it by Bob.
|
|
143
|
-
* [ ] Verify domain payloads are successfully written to `tempSpace` during the Delta stage.
|
|
144
|
-
|
|
145
|
-
### Step 4: Transactional Commit
|
|
146
|
-
* [ ] Implement the commit phase logic that transfers domain payloads from `tempSpace` to `localSpace` upon receipt/emission of the `Commit` frame.
|
|
147
|
-
* [ ] Assert that the final domain graphs on both sides are completely equivalent.
|