@ibgib/core-gib 0.1.13 → 0.1.15
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/dist/keystone/keystone-helpers.mjs +3 -3
- package/dist/keystone/keystone-helpers.mjs.map +1 -1
- package/dist/sync/sync-constants.d.mts +6 -1
- package/dist/sync/sync-constants.d.mts.map +1 -1
- package/dist/sync/sync-constants.mjs +5 -0
- package/dist/sync/sync-constants.mjs.map +1 -1
- package/dist/sync/sync-helpers.d.mts +18 -2
- package/dist/sync/sync-helpers.d.mts.map +1 -1
- package/dist/sync/sync-helpers.mjs +84 -3
- package/dist/sync/sync-helpers.mjs.map +1 -1
- package/dist/sync/sync-innerspace.respec.d.mts +1 -1
- package/dist/sync/sync-innerspace.respec.mjs +52 -370
- package/dist/sync/sync-innerspace.respec.mjs.map +1 -1
- package/dist/sync/sync-peer/sync-peer-innerspace-v1.d.mts +39 -0
- package/dist/sync/sync-peer/sync-peer-innerspace-v1.d.mts.map +1 -0
- package/dist/sync/sync-peer/sync-peer-innerspace-v1.mjs +112 -0
- package/dist/sync/sync-peer/sync-peer-innerspace-v1.mjs.map +1 -0
- package/dist/sync/sync-peer/sync-peer-types.d.mts +30 -0
- package/dist/sync/sync-peer/sync-peer-types.d.mts.map +1 -0
- package/dist/sync/sync-peer/sync-peer-types.mjs +5 -0
- package/dist/sync/sync-peer/sync-peer-types.mjs.map +1 -0
- package/dist/sync/sync-peer/sync-peer-v1.d.mts +22 -0
- package/dist/sync/sync-peer/sync-peer-v1.d.mts.map +1 -0
- package/dist/sync/sync-peer/sync-peer-v1.mjs +13 -0
- package/dist/sync/sync-peer/sync-peer-v1.mjs.map +1 -0
- package/dist/sync/sync-saga-context/sync-saga-context-constants.d.mts +8 -0
- package/dist/sync/sync-saga-context/sync-saga-context-constants.d.mts.map +1 -0
- package/dist/sync/sync-saga-context/sync-saga-context-constants.mjs +8 -0
- package/dist/sync/sync-saga-context/sync-saga-context-constants.mjs.map +1 -0
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.d.mts +54 -0
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.d.mts.map +1 -0
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.mjs +87 -0
- package/dist/sync/sync-saga-context/sync-saga-context-helpers.mjs.map +1 -0
- package/dist/sync/sync-saga-context/sync-saga-context-types.d.mts +66 -0
- package/dist/sync/sync-saga-context/sync-saga-context-types.d.mts.map +1 -0
- package/dist/sync/sync-saga-context/sync-saga-context-types.mjs +12 -0
- package/dist/sync/sync-saga-context/sync-saga-context-types.mjs.map +1 -0
- package/dist/sync/sync-saga-coordinator.d.mts +201 -121
- package/dist/sync/sync-saga-coordinator.d.mts.map +1 -1
- package/dist/sync/sync-saga-coordinator.mjs +710 -434
- package/dist/sync/sync-saga-coordinator.mjs.map +1 -1
- package/dist/sync/sync-saga-coordinator.respec.mjs +7 -7
- package/dist/sync/sync-saga-coordinator.respec.mjs.map +1 -1
- package/dist/sync/sync-saga-message/sync-saga-message-constants.d.mts +2 -0
- package/dist/sync/sync-saga-message/sync-saga-message-constants.d.mts.map +1 -0
- package/dist/sync/sync-saga-message/sync-saga-message-constants.mjs +2 -0
- package/dist/sync/sync-saga-message/sync-saga-message-constants.mjs.map +1 -0
- package/dist/sync/sync-saga-message/sync-saga-message-helpers.d.mts +15 -0
- package/dist/sync/sync-saga-message/sync-saga-message-helpers.d.mts.map +1 -0
- package/dist/sync/sync-saga-message/sync-saga-message-helpers.mjs +43 -0
- package/dist/sync/sync-saga-message/sync-saga-message-helpers.mjs.map +1 -0
- package/dist/sync/sync-saga-message/sync-saga-message-types.d.mts +51 -0
- package/dist/sync/sync-saga-message/sync-saga-message-types.d.mts.map +1 -0
- package/dist/sync/sync-saga-message/sync-saga-message-types.mjs +2 -0
- package/dist/sync/sync-saga-message/sync-saga-message-types.mjs.map +1 -0
- package/dist/sync/sync-types.d.mts +85 -4
- package/dist/sync/sync-types.d.mts.map +1 -1
- package/dist/sync/sync-types.mjs +27 -1
- package/dist/sync/sync-types.mjs.map +1 -1
- package/dist/timeline/timeline-api.d.mts +16 -3
- package/dist/timeline/timeline-api.d.mts.map +1 -1
- package/dist/timeline/timeline-api.mjs +7 -7
- package/dist/timeline/timeline-api.mjs.map +1 -1
- package/dist/witness/space/outer-space/outer-space-types.d.mts +2 -0
- package/dist/witness/space/outer-space/outer-space-types.d.mts.map +1 -1
- package/dist/witness/space/space-base-v1.d.mts +19 -1
- package/dist/witness/space/space-base-v1.d.mts.map +1 -1
- package/dist/witness/space/space-base-v1.mjs +66 -6
- package/dist/witness/space/space-base-v1.mjs.map +1 -1
- package/dist/witness/space/space-helper.d.mts +14 -0
- package/dist/witness/space/space-helper.d.mts.map +1 -1
- package/dist/witness/space/space-helper.mjs +44 -1
- package/dist/witness/space/space-helper.mjs.map +1 -1
- package/dist/witness/space/space-respec-helper.d.mts.map +1 -1
- package/dist/witness/space/space-respec-helper.mjs +1 -1
- package/dist/witness/space/space-respec-helper.mjs.map +1 -1
- package/dist/witness/space/space-types.d.mts +12 -1
- package/dist/witness/space/space-types.d.mts.map +1 -1
- package/dist/witness/space/space-types.mjs +4 -0
- package/dist/witness/space/space-types.mjs.map +1 -1
- package/package.json +2 -2
- package/src/keystone/keystone-helpers.mts +3 -3
- package/src/sync/README.md +275 -0
- package/src/sync/sync-constants.mts +9 -1
- package/src/sync/sync-helpers.mts +105 -6
- package/src/sync/sync-innerspace.respec.mts +55 -402
- package/src/sync/sync-peer/sync-peer-innerspace-v1.mts +150 -0
- package/src/sync/sync-peer/sync-peer-types.mts +43 -0
- package/src/sync/sync-peer/sync-peer-v1.mts +28 -0
- package/src/sync/sync-saga-context/sync-saga-context-constants.mts +8 -0
- package/src/sync/sync-saga-context/sync-saga-context-helpers.mts +147 -0
- package/src/sync/sync-saga-context/sync-saga-context-types.mts +80 -0
- package/src/sync/sync-saga-coordinator.mts +913 -517
- package/src/sync/sync-saga-coordinator.respec.mts +7 -7
- package/src/sync/sync-saga-message/sync-saga-message-constants.mts +1 -0
- package/src/sync/sync-saga-message/sync-saga-message-helpers.mts +59 -0
- package/src/sync/sync-saga-message/sync-saga-message-types.mts +66 -0
- package/src/sync/sync-types.mts +107 -4
- package/src/timeline/timeline-api.mts +20 -4
- package/src/witness/space/space-base-v1.mts +62 -12
- package/src/witness/space/space-helper.mts +50 -1
- package/src/witness/space/space-respec-helper.mts +2 -1
- package/src/witness/space/space-types.mts +13 -1
- package/tmp.md +122 -4
package/tmp.md
CHANGED
|
@@ -1,11 +1,129 @@
|
|
|
1
|
-
OK
|
|
1
|
+
OK great! We're making progress for sure. Here are some issues and questions that I've come across.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
around line 154
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
// 5. MERGE RESULT (Optimistic Commit)
|
|
9
|
+
// we need to refactor this to a `finalizeSaga` method that...
|
|
10
|
+
// * moves all ibgibs stored in temp space to target space in
|
|
11
|
+
// one go (commit phase 1)
|
|
12
|
+
// * registers each timeline AFTER commit space via
|
|
13
|
+
// metaspace.registerNewIbGib (commit phase 2)
|
|
14
|
+
// * need to add a skipBroadcast flag so we can register
|
|
15
|
+
// without broadcasting until the very tip of each timeline
|
|
16
|
+
// * deletes the temp space
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
I want to keep this in because we will need to do the `registerNewIbGib`
|
|
20
|
+
somewhere when we do the commit transaction process.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
around line 283:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
if (!remoteFrameAddr) {
|
|
28
|
+
// warnings are mostly to be avoided. i use warnings primarily for temporary code reminders to remember to do something before prod.
|
|
29
|
+
// console.warn(`${lc} Peer response has no sagaFrame. Ending loop.`);
|
|
30
|
+
// currentFrame = null;
|
|
31
|
+
// break;
|
|
32
|
+
|
|
33
|
+
// question: are we prepared to error out the saga when an exception arrives?
|
|
34
|
+
throw new Error(`Peer response has no sagaFrame. Ending loop. (E: 0224e84a83e1c7ee288aaed6bdc40826)`);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
around line 421:
|
|
40
|
+
|
|
41
|
+
Why does "Commit" run on either sender/receiver?
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
around line 512:
|
|
46
|
+
|
|
47
|
+
Added todo to change to use `getLatestAddrs({tjpAddrs: remoteTjps})`
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
around line 626:
|
|
52
|
+
|
|
53
|
+
I reverted to my corrected, more explicit separate error conditional checks.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
around line 639:
|
|
58
|
+
|
|
59
|
+
readded todo:
|
|
60
|
+
|
|
61
|
+
// todo: change this to batch getFromSpace. Also, do not get addrs that are primitive.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
in sync-saga-context-helpers.mts, shouldn't sagaFrame be required in createSyncSagaContext?
|
|
66
|
+
This would change the CreateSyncSagaContextOptions also, and would throw if this was falsy.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
In just sync-saga-coordinator.mts alone, there are 68 uses of the word "payload"
|
|
71
|
+
(case-insensitive).
|
|
72
|
+
|
|
73
|
+
But the term `payload` is defined in multiple places differently. In some
|
|
74
|
+
places, this is defined as `IbGib_V1[]`, others it is `any`, and still others
|
|
75
|
+
it is `string[]`.
|
|
76
|
+
|
|
77
|
+
For example, in CreateSyncSagaContextOptions, this is defined as:
|
|
4
78
|
|
|
5
79
|
```
|
|
6
80
|
/**
|
|
7
|
-
*
|
|
81
|
+
* Payload addresses (strings) for bulk data.
|
|
8
82
|
*/
|
|
9
|
-
|
|
83
|
+
payload?: string[];
|
|
10
84
|
```
|
|
11
85
|
|
|
86
|
+
But `getStageAndPayloadFromFrame` has in its return type `payload: any`.
|
|
87
|
+
|
|
88
|
+
And in `executeSagaLoop`: `let nextPayload: IbGib_V1[] = [];`
|
|
89
|
+
|
|
90
|
+
This is being used in different contexts and is causing confusion
|
|
91
|
+
as to how it is being used. We need to create different, explicitly named
|
|
92
|
+
variable and property names that are specific to the immediate use case. And we
|
|
93
|
+
should have zero `any` types being used, except in extremely rare difficult
|
|
94
|
+
compilation contexts (like when we have to cast to any before casting to some
|
|
95
|
+
other type). The only reason I allow `any` at all is mainly for backwards compat
|
|
96
|
+
(would be too much work to do the whole codebase).
|
|
97
|
+
|
|
98
|
+
In my prototype, I also came across a similar problem. My solution was to always
|
|
99
|
+
be explicit with [x]IbGib's vs. [x]Addrs. Sometimes it seemed like overkill, but
|
|
100
|
+
it was a way to reduce difficulty in reading and following code.
|
|
101
|
+
|
|
102
|
+
So, we need to change these to `payloadIbGibs` and `payloadAddrs` in ALL
|
|
103
|
+
locations, so we can be explicit.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
analyzeTimelines returns this:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
{
|
|
111
|
+
srcStones: IbGib_V1[],
|
|
112
|
+
srcTimelinesMap: { [tjp: string]: IbGib_V1[] },
|
|
113
|
+
srcSortedTjps: string[],
|
|
114
|
+
srcGraph: { [addr: string]: IbGib_V1 },
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
But the calling code is
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
const { srcTimelinesMap, srcGraph } = await this.analyzeTimelines({ domainIbGibs, space: localSpace });
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Where are we synchronizing the src stones? I understand when we create our initial knowledgeVector, we usually want just our timelines. But we still need to synchronize stones as well. What if one of our `domainIbGibs` is itself a stone? All of the dna for the timelines will be in srcStones. I could just be missing something of your algorithm, but to me, we need to include the stone addrs in the knowledge vector. Perhaps we can skip the dna for the timelines initially, but ultimately we will need to send those as well.
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
So that is just some of the issues. I haven't gone through the entire file yet. Please let's talk about these, and do NOT make any changes to the file. We are in full discussion mode right now!!
|